equip shield


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

$info=object_info($id);
if($uservals["WEAPON"]+0 != 0)
{
$weapon=object_info($uservals["WEAPON"]);
}
if(inventory_check($id,$_GET["USED"]) > 0)
{
if($uservals["SHIELD"]+0 != 0)
{
echo "
";
echo "\n";
echo "
Result
";
echo "You can only equip one shield at a given time !\n";
echo "

\n";
}
else if($uservals["WEAPON"]+0 != 0 && $weapon["HANDS"]+0 != 1)
{
echo "
";
echo "\n";
echo "
Result
";
echo "You cannot equip a shield while wearing a two handed weapon!\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["HPMOD"]+=$info["HP"];
$uservals["MPMOD"]+=$info["MP"];
$uservals["BLOCK"]+=$info["BLOCK"];
$uservals["SHIELD"]=$id;

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"];

$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']},
SHIELD={$uservals['SHIELD']} WHERE ID=$userid");

inventory_add($id,-1,$_GET["USED"]);
$db->Execute("REPLACE INTO USED_OBJECTS(USERID,OBJECTID,NBTIMES) VALUES($userid,$id,".$_GET["USED"].")");

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

\n";
}
}
?>

Wyszukiwarka

Podobne podstrony:
equip shield
equip shield
equip ring
Archaeology Viking Shield From Archaeology
equip armor
equip ring
PROJEKT DEEP SHIELD
Forgotten Realms Citadels, 03 The Shield of Weeping Ghosts (v0 9)
arduino xbee shield wireless module
Camouflage Love Is A Shield
equip weapon
shields?d

więcej podobnych podstron