Поправочка к выводу репутации.)
[cswow.git] / include / enchant_table.php
blobca588c903b70cfc8c6e030af680a1bdfbd6d5478
1 <?php
2 include_once("functions.php");
3 include_once("spell_data.php");
5 function noBorderEnchantTable($enc)
7 global $UseorEquip, $game_text;
8 echo "<TABLE class=spell><TBODY>";
9 echo "<TR><TD class=Name>".$enc['description']."</TD></TR>";
10 // Âûâîä òðåáîâàíèÿ ñêèëà
11 if ($enc['requiredSkill'])
12 echo '<tr><td class=req>'.sprintf($game_text['req_skill'], getSkillName($enc['requiredSkill']), $enc['requiredSkillRank']).'</td></tr>';
14 for ($i=1;$i<4;$i++)
16 if ($type = $enc['display_type_'.$i])
18 $amount = $enc['amount_'.$i];
19 $spellid = $enc['spellid_'.$i];
20 switch ($type)
22 case 1: // ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL
23 if ($spell = getSpell($spellid))
25 if ($desc = getSpellDesc($spell))
26 $text = $desc;
27 else if ($buff = getSpellBuff($spell))
28 $text = $buff;
29 else
30 $text = $spell['SpellName'];
31 echo "<tr><td class=SpellEnch>".$UseorEquip[2]." <a href=\"?spell=$spellid\">".$text."</a></td></tr>";
33 else
34 echo "<tr><td class=SpellEnch>".$UseorEquip[2]." cast ?? $spellid</td></tr>";
35 break;
36 case 2: // ITEM_ENCHANTMENT_TYPE_DAMAGE
37 echo "<tr><td class=SpellEnch>+ $amount damage</td></tr>";
38 break;
39 case 3: // ITEM_ENCHANTMENT_TYPE_EQUIP_SPELL
40 if ($spell = getSpell($spellid))
42 if ($desc = getSpellDesc($spell))
43 $text = $desc;
44 else if ($buff = getSpellBuff($spell))
45 $text = $buff;
46 else
47 $text = $spell['SpellName'];
48 echo "<tr><td class=SpellEnch>".$UseorEquip[1]." <a href=\"?spell=$spellid\">".$text."</a></td></tr>";
50 else
51 echo "<tr><td class=SpellDesc>".$UseorEquip[1]." cast ?? $spellid</td></tr>";
52 break;
53 case 4: // ITEM_ENCHANTMENT_TYPE_RESISTANCE
54 echo "<tr><td> ".getResistanceText($spellid, $amount)."</td></tr>";
55 break;
56 case 5: // ITEM_ENCHANTMENT_TYPE_STAT
57 if ($spellid >=0 && $spellid < 8)
58 echo "<tr><td class=SpellEnch> ".getItemBonusText($spellid, $amount)."</td></tr>";
59 else
60 echo "<tr><td class=SpellEnch> ".getItemBonusText($spellid, $amount)."</td></tr>";
61 break;
62 case 6: // ITEM_ENCHANTMENT_TYPE_TOTEM
63 echo "<tr><td class=SpellEnch>+ $amount damage (Rockbiter)</td></tr>";
64 break;
65 case 7: // On Use
66 if ($spell = getSpell($spellid))
68 if ($desc = getSpellDesc($spell))
69 $text = $desc;
70 else if ($buff = getSpellBuff($spell))
71 $text = $buff;
72 else
73 $text = $spell['SpellName'];
74 echo "<tr><td class=SpellEnch>".$UseorEquip[0]." <a href=\"?spell=$spellid\">".$text."</a></td></tr>";
76 else
77 echo "<tr><td class=SpellDesc>".$UseorEquip[0]." cast ?? $spellid</td></tr>";
78 break;
79 case 8: // Add Sockets Enchant
80 echo "<tr><td class=SpellEnch>Add Socket Enchant</td></tr>";
81 break;
82 default:
83 echo "<tr><td>Err type $type</TD></TR>";
84 break;
88 echo "</TBODY></TABLE>";
91 function generateEnchantTable($enc)
93 echo "<table class=border cellSpacing=0 cellPadding=0><tbody>";
94 echo "<tr><td class=btopl></td><td class=btop></td><td class=btopr></td></tr>";
95 echo "<tr><td class=bl></td><td class=bbody>";
96 noBorderEnchantTable($enc);
97 echo "</td><td class=br></td></tr>";
98 echo "<tr><td class=bbottoml></td><td class=bbottom></td><td class=bbottomr></td></tr>";
99 echo "</tbody></table>";