equip armor





PHPXRef 0.7 : NEABExplorer : /object_type_code/equip_armor.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_armor.php (source)

[Summary view]
[Print]
[Text view]


1 <?PHP
2 /**
3 * Code used when a player equip an armor.
4 */
5
6 $info=object_info($id);
7 if(inventory_check($id,$_GET["USED"]) > 0)
8 {
9 switch($info["TYPE"])
10 {
11 case "B": // Boots
12 $piece="SHOES";
13 break;
14 case "G": // Gloves
15 $piece="GLOVES";
16 break;
17 case "t": // Hat
18 $piece="HAT";
19 break;
20 case "p": // Pants
21 $piece="PANTS";
22 break;
23 case "C": // Cape
24 $piece="CAPE";
25 break;
26 case "A":
27 default:
28 $piece="ARMOR";
29 }
30
31 if($uservals[$piece]+0 != 0)
32 {
33 echo "<BR><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#A00000>";
34 echo "<TR><TH><B><FONT COLOR=#FFFFFF>Result</FONT></B></TH></TR>\n";
35 echo "<TR><TD BGCOLOR=#E0E0E0>";
36 echo "You can only equip one armor or cape at a given time !\n";
37 echo "</TD></TR></TABLE></DIV><BR>\n";
38 }
39 else
40 {
41 $uservals["ATTACK"]+=$info["ATTACK"];
42 $uservals["PROTECTION"]+=$info["PROTECTION"];
43 $uservals["DEXMOD"]+=$info["DEXTERITY"];
44 $uservals["STRMOD"]+=$info["STRONGNESS"];
45 $uservals["CHAMOD"]+=$info["CHARISMA"];
46 $uservals["INTMOD"]+=$info["INTELLIGENCE"];
47 $uservals["HPMOD"]+=$info["HP"];
48 $uservals["MPMOD"]+=$info["MP"];
49 $uservals["BLOCK"]+=$info["BLOCK"];
50 $uservals[$piece]=$id;
51
52 if(($uservals["HP"]+0) > ($uservals["HPMOD"]+$uservals["MAXHP"]))
53 $uservals["HP"]=$uservals["HPMOD"]+$uservals["MAXHP"];
54
55 if(($uservals["MP"]+0) > ($uservals["MPMOD"]+$uservals["MAXMP"]))
56 $uservals["MP"]=$uservals["MPMOD"]+$uservals["MAXMP"];
57
58 $sql="UPDATE PLAYER SET ATTACK={$uservals['ATTACK']}, PROTECTION={$uservals['PROTECTION']},
59 DEXMOD={$uservals['DEXMOD']}, STRMOD={$uservals['STRMOD']}, CHAMOD={$uservals['CHAMOD']},
60 INTMOD={$uservals['INTMOD']}, HPMOD={$uservals['HPMOD']}, MPMOD={$uservals['MPMOD']},
61 HP={$uservals['HP']}, MP={$uservals['MP']}, BLOCK={$uservals['BLOCK']},
62 $piece=".$uservals[$piece]." WHERE ID=$userid";
63 //echo $sql;
64 $db->Execute($sql);
65 echo "<BR><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#00A000>";
66 echo "<TR><TH><B><FONT COLOR=#FFFFFF>Result</FONT></B></TH></TR>\n";
67 echo "<TR><TD BGCOLOR=#E0E0E0>";
68 echo "You equipped your ".$info["NAME"]." successfully.\n";
69 echo "</TD></TR></TABLE></DIV><BR>\n";
70 inventory_add($id,-1,$_GET["USED"]);
71 $db->Execute("REPLACE INTO USED_OBJECTS(USERID,OBJECTID,NBTIMES) VALUES($userid,$id,".$_GET["USED"].")");
72 }
73 }
74 ?>



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 armor
equip armor
equip shield
equip ring
equip ring
Operation And Function Light Anti Armor Weapons M72 And M136
Better Her Hand Armor Enchantments (Better) Readme
Fuzion Generic Weapons & Armor Tables
armor?d
equip weapon
equip ring
equip shield

więcej podobnych podstron