Требование: PHP => 5.3, часть 2
[cswowd.git] / include / spell_table.php
blob0825eb45d75043c2bbbb01ff1adee5aedb01ff72
1 <?php
2 include_once("spell_data.php");
4 function noBorderSpellTable($spell)
6 echo "<table class=spell><tbody>";
7 $name = $spell['SpellName'];
8 if ($spell['Rank'])
9 echo "<tr><td class=Name>".$name."</td><td class=Rank align=right>".$spell['Rank']."</td></tr>";
10 else
11 echo "<tr><td class=Name colspan=2>".$name."</td></tr>";
12 $cost = getSpellCostText($spell);
13 if ($cost or $spell['rangeIndex']>1)
15 echo "<tr><td>";
16 if ($cost)
17 echo $cost."</td><td align=right>";
18 if ($spell['rangeIndex'] > 0 AND $range = getRange($spell['rangeIndex']) AND $range!=0)
19 echo $range." yds range";
20 echo "</td></tr>";
23 // Çàïîëíÿåì ïîëå âðåìåíè êàñòà
24 $cast_time = "";
25 if (($spell['Attributes' ] & 0x404) == 0x404)
26 $cast_time = "Next melee";
27 else if ($spell['AttributesEx'] & 0x044)
28 $cast_time = "Chanelled";
29 else
30 $cast_time = getCastTimeText($spell);
32 // Çàïîëíÿåì ïîëå êóëäàóíà
33 $cooldown = getSpellCooldown($spell);
34 if ($cooldown)
35 $cooldown = getTimeText($cooldown/1000)." cooldown";
36 else
37 $cooldown = "";
39 if ($cast_time OR $cooldown)
40 echo "<tr><td>".$cast_time."</td><td align=right>".$cooldown."</td></tr>";
42 // Òîòåì êàòåãîðèÿ
43 if ($spell['TotemCategory_1'] OR $spell['TotemCategory_2'])
45 echo "<tr><td colspan=2 class=tool> Tools: ";
46 if ($spell['TotemCategory_1'])
47 echo getTotemCategory($spell['TotemCategory_1']);
48 if ($spell['TotemCategory_2'])
49 echo ", ".getTotemCategory($spell['TotemCategory_2']);
50 echo "</td></tr>";
53 $itemClass = $spell['EquippedItemClass'];
54 // Òðåáîâàíèÿ ìèëè èëè ðàíãåä îðóæèÿ
55 if ($spell['Attributes'] & 0x2)
56 echo "<tr><td colspan=2>Requires Ranged Weapon</td></tr>";
57 else if ($spell['Attributes'] & 0x4)
58 echo "<tr><td colspan=2>Requires Melee Weapon</td></tr>";
59 else if ($itemClass == 2) // Òðåáóåò îðóæèÿ
61 echo "<tr><td colSpan=2 class=req>";
62 if ($itemSubClass = $spell['EquippedItemSubClassMask'])
63 echo getSubclassList($itemClass, $itemSubClass);
64 else
65 echo getClassName($itemClass);
66 echo "</td></tr>";
68 $reqForm = getAllowableForm($spell['Stances'], 0);
69 if ($reqForm)
70 echo "<tr><td colspan=2>Requires: ".$reqForm."</td></tr>";
72 $notreqForm = getAllowableForm($spell['StancesNot'], 0);
73 if ($notreqForm)
74 echo "<tr><td class=SpellErr colspan=2>Not cast in: ".$notreqForm."</td></tr>";
76 echo "<tr><td colspan=2 class=SpellDesc><a href=\"?spell=$spell[id]\">".getSpellDesc($spell)."</a></td></tr>";
77 echo "</tbody></table>";
80 function generateSpellTable($spell)
82 echo "<table class=border cellspacing=0 cellpadding=0><tbody>";
83 echo "<tr><td class=btopl></td><td class=btop></td><td class=btopr></td></tr>";
84 echo "<tr><td class=bl></td><td class=bbody>";
85 noBorderSpellTable($spell);
86 echo "</td><td class=br></td></tr>";
87 echo "<tr><td class=bbottoml></td><td class=bbottom></td><td class=bbottomr></td></tr>";
88 echo "</tbody></table>";
91 // Âûâîä tooltip ñïåëëà (òî ÷òî âûâîäèòñÿ â ïîäñêàçêå àóðû íà èãðîêå)
92 function generateSpellBuffTable($spell)
94 echo "<table class=border cellspacing=0 cellpadding=0><tbody>";
95 echo "<tr><td class=btopl></td><td class=btop></td><td class=btopr></td></tr>";
96 echo "<tr><td class=bl></td><td class=bbody>";
98 echo "<table class=spell><tbody>";
99 $name = $spell['SpellName'];
100 echo "<tr><td class=Name>".$name."</td></tr>";
101 echo "<tr><td colSpan=2 class=SpellDesc><a href=\"?spell=$spell[id]\">".getSpellBuff($spell)."</a></td></tr>";
102 echo "</tbody></table>";
104 echo "</td><td class=br></td></tr>";
105 echo "<tr><td class=bbottoml></td><td class=bbottom></td><td class=bbottomr></td></tr>";
106 echo "</tbody></table>";