equip shield





PHPXRef 0.7 : NEABExplorer : /object_type_code/equip_shield.php source









[ Index ]


PHP Cross Reference of NEABExplorer














if (gwGetCookie('xrefnav')=='off')
document.write('[ Show Explorer ]');
else
document.write('[ Hide Explorer ]');



[ Show Explorer ]
[ Hide Navbar ]





titleBody[close]
/object_type_code/ -> equip_shield.php (source)

[Summary view]
[Print]
[Text view]


1 <?PHP
2 /**
3 * Code used when a player equips a shield.
4 */
5
6 $info=object_info($id);
7 if($uservals["WEAPON"]+0 != 0)
8 {
9 $weapon=object_info($uservals["WEAPON"]);
10 }
11 if(inventory_check($id,$_GET["USED"]) > 0)
12 {
13 if($uservals["SHIELD"]+0 != 0)
14 {
15 echo "<BR><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#A00000>";
16 echo "<TR><TH><B><FONT COLOR=#FFFFFF>Result</FONT></B></TH></TR>\n";
17 echo "<TR><TD BGCOLOR=#E0E0E0>";
18 echo "You can only equip one shield at a given time !\n";
19 echo "</TD></TR></TABLE></DIV><BR>\n";
20 }
21 else if($uservals["WEAPON"]+0 != 0 && $weapon["HANDS"]+0 != 1)
22 {
23 echo "<BR><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#A00000>";
24 echo "<TR><TH><B><FONT COLOR=#FFFFFF>Result</FONT></B></TH></TR>\n";
25 echo "<TR><TD BGCOLOR=#E0E0E0>";
26 echo "You cannot equip a shield while wearing a two handed weapon!\n";
27 echo "</TD></TR></TABLE></DIV><BR>\n";
28 }
29 else
30 {
31 $uservals["ATTACK"]+=$info["ATTACK"];
32 $uservals["PROTECTION"]+=$info["PROTECTION"];
33 $uservals["DEXMOD"]+=$info["DEXTERITY"];
34 $uservals["STRMOD"]+=$info["STRONGNESS"];
35 $uservals["CHAMOD"]+=$info["CHARISMA"];
36 $uservals["INTMOD"]+=$info["INTELLIGENCE"];
37 $uservals["HPMOD"]+=$info["HP"];
38 $uservals["MPMOD"]+=$info["MP"];
39 $uservals["BLOCK"]+=$info["BLOCK"];
40 $uservals["SHIELD"]=$id;
41
42 if(($uservals["HP"]+0) > ($uservals["HPMOD"]+$uservals["MAXHP"]))
43 $uservals["HP"]=$uservals["HPMOD"]+$uservals["MAXHP"];
44
45 if(($uservals["MP"]+0) > ($uservals["MPMOD"]+$uservals["MAXMP"]))
46 $uservals["MP"]=$uservals["MPMOD"]+$uservals["MAXMP"];
47
48 $db->Execute("UPDATE PLAYER SET ATTACK={$uservals['ATTACK']}, PROTECTION={$uservals['PROTECTION']},
49 DEXMOD={$uservals['DEXMOD']}, STRMOD={$uservals['STRMOD']}, CHAMOD={$uservals['CHAMOD']},
50 INTMOD={$uservals['INTMOD']}, HPMOD={$uservals['HPMOD']}, MPMOD={$uservals['MPMOD']},
51 HP={$uservals['HP']}, MP={$uservals['MP']}, BLOCK={$uservals['BLOCK']},
52 SHIELD={$uservals['SHIELD']} WHERE ID=$userid");
53
54 inventory_add($id,-1,$_GET["USED"]);
55 $db->Execute("REPLACE INTO USED_OBJECTS(USERID,OBJECTID,NBTIMES) VALUES($userid,$id,".$_GET["USED"].")");
56
57 echo "<BR><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#00A000>";
58 echo "<TR><TH><B><FONT COLOR=#FFFFFF>Result</FONT></B></TH></TR>\n";
59 echo "<TR><TD BGCOLOR=#E0E0E0>";
60 echo "You equipped your ".$info["NAME"]." successfully.\n";
61 echo "</TD></TR></TABLE></DIV><BR>\n";
62 }
63 }
64 ?>



FUNC_DATA={
'inventory_add': ['inventory_add', 'Adds an item to the inventory. (no message) ', [['libs','objects_util.php',359]], 49],
'inventory_check': ['inventory_check', 'Checks if the player have this item. ', [['libs','objects_util.php',425]], 44],
'execute': ['execute', '', [['libs','db_conn_5.php',37],['libs','db_conn_4.php',37]], 652],
'object_info': ['object_info', 'Retreive the information about an object. ', [['libs','objects_util.php',457]], 20]};
CLASS_DATA={
};
CONST_DATA={
};

titleDescriptionBody
titleDescriptionBody
titleDescriptionBody
titleBody



Generated: Sun Jul 8 18:11:25 2007
Cross-referenced by PHPXref 0.7





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