Требование: PHP => 5.3, часть 2
[cswowd.git] / include / talent_table.php
blobd6c9c867979d27c63e1a21d19c53c758ce3dd093
1 <?php
3 function noBorderTalentTable($talentTab, $rank)
5 global $game_text;
6 if ($rank) $spell = getSpell($talentTab["Rank_$rank"]);
7 else $spell = getSpell($talentTab["Rank_1"]);
9 if ($spell)
11 $maxRank = 0;
12 if ($talentTab["Rank_5"]) $maxRank = 5;
13 else if ($talentTab["Rank_4"]) $maxRank = 4;
14 else if ($talentTab["Rank_3"]) $maxRank = 3;
15 else if ($talentTab["Rank_2"]) $maxRank = 2;
16 else if ($talentTab["Rank_1"]) $maxRank = 1;
18 echo "<table class=spell><tbody>";
19 $name = $spell['SpellName'];
20 // if ($spell['Rank']) $name .=" ($spell[Rank])";
21 echo "<tr><td class=Name>".$name."</td></tr>";
22 echo "<tr><td>".$game_text['talent_rank']." $rank / $maxRank</td></tr>";
23 echo "<tr><td class=Talent>".getSpellDesc($spell)."</td></tr>";
24 if ($rank!=0 && $rank!=$maxRank)
26 echo "<tr><td><br>".$game_text['talent_next_rank']."</td></tr>";
27 $spell = getSpell($talentTab["Rank_".($rank+1)]);
28 echo "<tr><td class=Talent>".getSpellDesc($spell)."</td></tr>";
30 echo "</tbody></table>";
32 else
34 echo "Talent error";
37 function generateTalentTable($talentTab, $rank)
39 echo "<table class=border cellspacing=0 cellpadding=0><tbody>";
40 echo "<tr><td class=btopl></td><td class=btop></td><td class=btopr></td></tr>";
41 echo "<tr><td class=bl></td><td class=bbody>";
42 noBorderTalentTable($talentTab, $rank);
43 echo "</td><td class=br></td></tr>";
44 echo "<tr><td class=bbottoml></td><td class=bbottom></td><td class=bbottomr></td></tr>";
45 echo "</tbody></table>";