$result = mysql_query($query) or message_die('spells.php', 'MYSQL_QUERY', $query, mysql_error()); if (mysql_num_rows($result) > 0) { $content = ""; $l = 0; if (!($iclass > 0)) { print "Spell name,Mana,Duration/Effects,Casting Time,Target\n"; } while ($row = mysql_fetch_array($result)) { if ($iclass > 0 and $l != $row["level{$iclass}"]) { print "\nLevel " . $row["level{$iclass}"] . "\n"; print "Spell name,Mana,Duration/Effects,Casting Time,Target\n"; $l = $row["level{$iclass}"]; } print $row["name"]; print "," . $row["mana"]; $duration = CalcBuffDuration($ServerMaxLevel, $row["buffformula"], $row["buffduration"]); if ($duration == 0) { print ",Instant"; } else { print "," . translate_time($duration * 6) . " ({$duration} ticks)"; } print "," . $row["casttime"] / 1000 . " sec"; print "," . $dbspelltargets[$row["targettype"]]; print "\n"; for ($n = 1; $n <= 12; $n++) { SpellDescription($row, $n, true); } } } else { print "No spell found"; }
print "<tr><td nowrap><b>Casting time : </b></td><td>" . $spell["cast_time"] / 1000 . " sec</td></tr>"; print "<tr><td nowrap><b>Recovery time : </b></td><td>" . $spell["recovery_time"] / 1000 . " sec</td></tr>"; print "<tr><td nowrap><b>Recast time : </b></td><td>" . $spell["recast_time"] / 1000 . " sec</td></tr>"; print "<tr><td nowrap><b>Range : </b></td><td>" . $spell["range"] . "</td></tr>"; print "<tr><td nowrap><b>Target : </b></td><td>"; if ($dbspelltargets[$spell["targettype"]] != "") { print $dbspelltargets[$spell["targettype"]]; } else { print "Unknown target (" . $spell["targettype"] . ")"; } print "</td></tr>"; print "<tr><td nowrap><b>Resist : </b></td><td>" . $dbspellresists[$spell["resist"]] . " (adjust: " . $spell["ResistDiff"] . ")</td></tr>"; if ($spell["TimeOfDay"] == 2) { print "<tr><td nowrap><b>Casting restriction : </b></td><td>Nighttime</td></tr>"; } $duration = CalcBuffDuration($minlvl, $spell["buffdurationformula"], $spell["buffduration"]); print "<tr><td nowrap><b>Duration : </b></td><td>"; if ($duration == 0) { print "Instant"; } else { print translate_time($duration * 6) . " ({$duration} ticks)"; } print "</td></tr>"; for ($i = 1; $i <= 4; $i++) { // reagents if ($spell["components" . $i] > 0) { print "<tr><td nowrap><b>Needed reagent {$i} : </b></td><td>" . "<a href=item.php?id=" . $spell["components" . $i] . ">" . GetFieldByQuery("Name", "SELECT Name FROM {$tbitems} WHERE id=" . $spell["components" . $i]) . " </a>(" . $spell["component_counts" . $i] . ")</td></tr>"; } } print "<tr><td colspan=2><b>Spell effects:</b></td></tr>"; echo '<td align="center" colspan=2><small>';
function BuildSpellInfo($spell, $show_name_icon) { global $dbclasses, $dbspelltargets, $dbspellresists, $dbskills, $icons_url, $tbitems, $icons_dir; $html_string = "<table border=0 style='padding:5px;width:500px'>"; if ($show_name_icon) { $html_string .= "<tr><td>"; $html_string .= '<img src="includes/img.php?type=spellimage&id=' . $spell['new_icon'] . '" class="btn btn-default">'; $html_string .= "</td><td><h2 style='margin-top:0'>" . $spell["name"] . "</h2><hr>"; $html_string .= "</td></tr>"; } $html_string .= "<tr><td nowrap><b>Classes</b></td><td>"; $v = ""; $minlvl = 70; for ($i = 1; $i <= 16; $i++) { if ($spell["classes{$i}"] > 0 and $spell["classes{$i}"] < 255) { $html_string .= "{$v} " . $dbclasses[$i] . " (" . $spell["classes{$i}"] . ")"; $v = ","; if ($spell["classes{$i}"] < $minlvl) { $minlvl = $spell["classes{$i}"]; } } } $html_string .= "</td></tr>"; if ($spell["you_cast"] != "") { $html_string .= "<tr><td nowrap><b>When you cast </b></td><td>" . $spell["you_cast"] . "</td></tr>"; } if ($spell["other_casts"] != "") { $html_string .= "<tr><td nowrap><b>When others cast</b></td><td>" . $spell["other_casts"] . "</td></tr>"; } if ($spell["cast_on_you"] != "") { $html_string .= "<tr><td nowrap><b>When cast on you </b></td><td>" . $spell["cast_on_you"] . "</td></tr>"; } if ($spell["cast_on_other"] != "") { $html_string .= "<tr><td nowrap><b>When cast on other </b></td><td>" . $spell["cast_on_other"] . "</td></tr>"; } if ($spell["spell_fades"] != "") { $html_string .= "<tr><td nowrap><b>When fading </b></td><td>" . $spell["spell_fades"] . "</td></tr>"; } $html_string .= "<tr><td nowrap><b>Mana </b></td><td>" . $spell["mana"] . "</td></tr>"; if ($spell["skill"] < 52) { $html_string .= "<tr><td nowrap><b>Skill</b></td><td>" . $dbskills[$spell["skill"]] . "</td></tr>"; } $html_string .= "<tr><td nowrap><b>Casting time</b></td><td>" . $spell["cast_time"] / 1000 . " sec</td></tr>"; $html_string .= "<tr><td nowrap><b>Recovery time</b></td><td>" . $spell["recovery_time"] / 1000 . " sec</td></tr>"; $html_string .= "<tr><td nowrap><b>Recast time</b></td><td>" . $spell["recast_time"] / 1000 . " sec</td></tr>"; $html_string .= "<tr><td nowrap><b>Range</b></td><td>" . $spell["range"] . "</td></tr>"; $html_string .= "<tr><td nowrap><b>Target</b></td><td>"; if ($dbspelltargets[$spell["targettype"]] != "") { $html_string .= $dbspelltargets[$spell["targettype"]]; } else { $html_string .= "Unknown target (" . $spell["targettype"] . ")"; } $html_string .= "</td></tr>"; $html_string .= "<tr><td nowrap><b>Resist</b></td><td>" . $dbspellresists[$spell["resist"]] . " (adjust" . $spell["ResistDiff"] . ")</td></tr>"; if ($spell["TimeOfDay"] == 2) { $html_string .= "<tr><td nowrap><b>Casting restriction</b></td><td>Nighttime</td></tr>"; } $duration = CalcBuffDuration($minlvl, $spell["buffdurationformula"], $spell["buffduration"]); $html_string .= "<tr><td nowrap><b>Duration</b></td><td>"; if ($duration == 0) { $html_string .= "Instant"; } else { $html_string .= translate_time($duration * 6) . " ({$duration} ticks)"; } $html_string .= "</td></tr>"; for ($i = 1; $i <= 4; $i++) { // reagents if ($spell["components" . $i] > 0) { $html_string .= "<tr><td nowrap><b>Needed Reagents # {$i} </b></td><td>" . "<a href=item.php?id=" . $spell["components" . $i] . ">" . GetFieldByQuery("Name", "SELECT Name FROM {$tbitems} WHERE id=" . $spell["components" . $i]) . " </a> x " . $spell["component_counts" . $i] . " </td></tr>"; } } $html_string .= "<tr><td colspan=2><b>Spell effects:</b></td></tr>"; $html_string .= "<td></td><td align='left' colspan=1><small>"; for ($n = 1; $n <= 12; $n++) { $html_string .= SpellDescription($spell, $n, false, false); } $html_string .= "</small></td>"; $html_string .= "</table>"; return $html_string; }