equip ring


/**
* Code used when a player equips a ring.
*/

$info=object_info($id);
if(inventory_check($id) > 0)
{
if($uservals["RING1"]+0 != 0 && $uservals["RING2"]+0 != 0)
{
echo "
";
echo "\n";
echo "
Result
";
echo "You cannot equip more rings !\n";
echo "

\n";
}
else
{
$uservals["ATTACK"]+=$info["ATTACK"];
$uservals["PROTECTION"]+=$info["PROTECTION"];
$uservals["DEXMOD"]+=$info["DEXTERITY"];
$uservals["STRMOD"]+=$info["STRONGNESS"];
$uservals["CHAMOD"]+=$info["CHARISMA"];
$uservals["INTMOD"]+=$info["INTELLIGENCE"];
$uservals["BLOCK"]+=$info["BLOCK"];
$uservals["HPMOD"]+=$info["HP"];
$uservals["MPMOD"]+=$info["MP"];

if(($uservals["HP"]+0) > ($uservals["HPMOD"]+$uservals["MAXHP"]))
$uservals["HP"]=$uservals["HPMOD"]+$uservals["MAXHP"];

if(($uservals["MP"]+0) > ($uservals["MPMOD"]+$uservals["MAXMP"]))
$uservals["MP"]=$uservals["MPMOD"]+$uservals["MAXMP"];

if($uservals["RING1"]+0 == 0)
$uservals["RING1"]=$id;
else if($uservals["RING2"]+0 == 0)
$uservals["RING2"]=$id;

$db->Execute("UPDATE PLAYER SET ATTACK={$uservals['ATTACK']}, PROTECTION={$uservals['PROTECTION']},
DEXMOD={$uservals['DEXMOD']}, STRMOD={$uservals['STRMOD']}, CHAMOD={$uservals['CHAMOD']},
INTMOD={$uservals['INTMOD']}, HPMOD={$uservals['HPMOD']}, MPMOD={$uservals['MPMOD']},
HP={$uservals['HP']}, MP={$uservals['MP']}, BLOCK={$uservals['BLOCK']},
RING1={$uservals['RING1']},RING2={$uservals['RING2']} WHERE ID=$userid");

inventory_add($id,-1);

echo "
";
echo "\n";
echo "
Result
";
echo "You equipped your ".$info["NAME"]." successfully.\n";
echo "

\n";
}
}
?>

Wyszukiwarka

Podobne podstrony:
equip ring
equip ring
equip shield
three axis ring plot kiodane jan27
Beyoncé Single ladies (Put a ring on it)
equip armor
token ring 3 6rl5faenidlemor5ydzvykagrrwoxbl4jwrxs7y 6rl5faenidlemor5ydzvykagrrwoxbl4jwrxs7y
Bronze Signet Ring
token ring zkvitl2vd5ubrwvzjrajzjtxnhq46vd3mavwomi zkvitl2vd5ubrwvzjrajzjtxnhq46vd3mavwomi
Ring [alternatywna solucja]
Lost Souls The Promise Ring
Haggard, H Rider Queen Sheba s Ring
ring
bead&button peeking pearls ring and earrings
Quick Start LotR War of the Ring

więcej podobnych podstron