Пример #1
0
                }
            }
            // Goal List
            if ($GoalMethod == 1) {
                $Query2 = "SELECT * FROM goallists WHERE listid='" . $GoalID . "'";
                $QueryResult2 = mysql_query($Query2) or message_die('task.php', 'MYSQL_QUERY', $Query2, mysql_error());
                $GoalListString = "";
                if (mysql_num_rows($QueryResult2) > 0) {
                    while ($row2 = mysql_fetch_array($QueryResult2)) {
                        if ($GoalType == "NPCID" && $row2["entry"]) {
                            $NPCID = $row2["entry"];
                            $NPCName = GetFieldByQuery("name", "SELECT name FROM npc_types WHERE id = {$NPCID}");
                            $GoalListString .= "<li>Related NPC: <a href=npc.php?id=" . $NPCID . ">" . ReadableNpcName($NPCName) . "</a></li>";
                        }
                        if ($GoalType == "ItemID" && $row2["entry"]) {
                            $ItemID = $row2["entry"];
                            $ItemName = GetFieldByQuery("name", "SELECT name FROM items WHERE id = {$ItemID}");
                            $GoalListString .= "<li>Related Item: <a href=item.php?id=" . $ItemID . ">" . $ItemName . "</a></li>";
                        }
                    }
                }
                print $GoalListString;
            }
            print "</ul></ul></td></tr>";
        }
    } else {
        print "<tr><td nowrap='1'><b>No Task Activities Listed</b></td></tr>";
    }
}
print "</table></center></p>";
include $includes_dir . "footers.php";
Пример #2
0
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>';
for ($n = 1; $n <= 12; $n++) {
    SpellDescription($spell, $n);
}
echo '</small></td>';
print "</table></td><td nowrap>";
$query = "SELECT {$tbitems}.id,{$tbitems}.name\n\t\t\tFROM {$tbitems}\n\t\t\tWHERE {$tbitems}.scrolleffect={$id}\n\t\t\tORDER BY {$tbitems}.name ASC";
$result = mysql_query($query) or message_die('item.php', 'MYSQL_QUERY', $query, mysql_error());
if (mysql_num_rows($result)) {
    print "<b>Items with that spell</b>";
    while ($row = mysql_fetch_array($result)) {
        print "<li><a href=item.php?id=" . $row["id"] . ">" . $row["name"] . "</a>";
Пример #3
0
<?php

include './includes/constantes.php';
include './includes/config.php';
include $includes_dir . 'mysql.php';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (!is_numeric($id)) {
    header("Location: recipes.php");
    exit;
}
$Title = "Recipe : " . str_replace('_', ' ', GetFieldByQuery("name", "SELECT name FROM {$tbtradeskillrecipe} WHERE id={$id}"));
include $includes_dir . 'headers.php';
include $includes_dir . 'functions.php';
if (!isset($id)) {
    print "<script>document.location=\"index.php\";</script>";
}
$query = "SELECT *\n\t\t\tFROM {$tbtradeskillrecipe}\n\t\t\tWHERE id={$id}";
$result = mysql_query($query) or message_die('recipe.php', 'MYSQL_QUERY', $query, mysql_error());
$recipe = mysql_fetch_array($result);
print "<table border=0 width=0%>";
print "<tr><td nowrap><b>Recipe : </b></td><td nowrap>" . ucfirstwords(str_replace('_', ' ', $recipe["name"])) . "</td></tr>";
print "<tr><td nowrap><b>Tradeskill : </b></td><td nowrap>" . ucfirstwords($dbskills[$recipe["tradeskill"]]) . "</td></tr>";
if ($recipe["skillneeded"] > 0) {
    print "<tr><td nowrap><b>Skill needed : </b></td><td nowrap>" . $recipe["skillneeded"] . "</td></tr>";
}
print "<tr><td nowrap><b>Trivial at : </b></td><td nowrap>" . $recipe["trivial"] . "</td></tr>";
if ($recipe["nofail"] > 0) {
    print "<tr><td nowrap colspan=2>This recipe cannot fail.</td></tr>";
}
if ($recipe["notes"] != "") {
    print "<tr><td cospan=2><b>Notes : </b>" . $recipe["notes"] . "</td></tr>";
Пример #4
0
function SpellDescription($spell, $n, $csv = false, $echo = true)
{
    global $dbspelleffects, $tbitems, $dbiracenames, $tbspells, $ServerMaxLevel;
    if ($spell["effectid{$n}"] != 254 and $spell["effectid{$n}"] != 10) {
        $maxlvl = $spell["effect_base_value{$n}"];
        $minlvl = $ServerMaxLevel;
        for ($i = 1; $i <= 16; $i++) {
            if ($spell["classes" . $i] < $minlvl) {
                $minlvl = $spell["classes" . $i];
            }
        }
        $min = CalcSpellEffectValue($spell["formula" . $n], $spell["effect_base_value{$n}"], $spell["max{$n}"], $minlvl);
        $max = CalcSpellEffectValue($spell["formula" . $n], $spell["effect_base_value{$n}"], $spell["max{$n}"], $ServerMaxLevel);
        $base_limit = $spell["effect_limit_value{$n}"];
        if ($min < $max and $max < 0) {
            $tn = $min;
            $min = $max;
            $max = $tn;
        }
        if ($csv == true) {
            $html_string .= ",,";
        } else {
            $html_string .= "<b>{$n} : Effect type : </b>";
        }
        switch ($spell["effectid{$n}"]) {
            case 3:
                // Increase Movement (% / 0)
                if ($max < 0) {
                    // Decrease
                    $html_string .= "Decrease Movement";
                    if ($min != $max) {
                        $html_string .= " by " . abs($min) . "% (L{$minlvl}) to " . abs($max) . "% (L{$maxlvl})";
                    } else {
                        $html_string .= " by " . abs(100) . "%";
                    }
                } else {
                    $html_string .= "Increase Movement";
                    if ($min != $max) {
                        $html_string .= " by " . $min . "% (L{$minlvl}) to " . $max . "% (L{$maxlvl})";
                    } else {
                        $html_string .= " by " . $max . "%";
                    }
                }
                break;
            case 11:
                // Decrease OR Inscrease AttackSpeed (max/min = percentage of speed / normal speed, IE, 70=>-30% 130=>+30%
                if ($max < 100) {
                    // Decrease
                    $html_string .= "Decrease Attack Speed";
                    if ($min != $max) {
                        $html_string .= " by " . (100 - $min) . "% (L{$minlvl}) to " . (100 - $max) . "% (L{$maxlvl})";
                    } else {
                        $html_string .= " by " . (100 - $max) . "%";
                    }
                } else {
                    $html_string .= "Increase Attack Speed";
                    if ($min != $max) {
                        $html_string .= " by " . ($min - 100) . "% (L{$minlvl}) to " . ($max - 100) . "% (L{$maxlvl})";
                    } else {
                        $html_string .= " by " . ($max - 100) . "%";
                    }
                }
                break;
            case 21:
                // stun
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($min != $max) {
                    $html_string .= " (" . $min / 1000 . " sec (L{$minlvl}) to " . $max / 1000 . " sec (L{$maxlvl}))";
                } else {
                    $html_string .= " (" . $max / 1000 . " sec)";
                }
                break;
            case 32:
                // summonitem
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $name = GetFieldByQuery("name", "SELECT name FROM {$tbitems} WHERE id=" . $spell["effect_base_value{$n}"]);
                if ($name != "" and $csv == false) {
                    $html_string .= " : <a href=item.php?id=" . $spell["effect_base_value{$n}"] . ">{$name}</a>";
                } else {
                    $html_string .= " : {$name}";
                }
                break;
            case 87:
                // Increase Magnification
            // Increase Magnification
            case 98:
                // Increase Haste v2
            // Increase Haste v2
            case 114:
                // Increase Agro Multiplier
            // Increase Agro Multiplier
            case 119:
                // Increase Haste v3
            // Increase Haste v3
            case 123:
                // Increase Spell Damage
            // Increase Spell Damage
            case 124:
                // Increase Spell Damage
            // Increase Spell Damage
            case 125:
                // Increase Spell Healing
            // Increase Spell Healing
            case 127:
                // Increase Spell Haste
            // Increase Spell Haste
            case 128:
                // Increase Spell Duration
            // Increase Spell Duration
            case 129:
                // Increase Spell Range
            // Increase Spell Range
            case 130:
                // Decrease Spell/Bash Hate
            // Decrease Spell/Bash Hate
            case 131:
                // Decrease Chance of Using Reagent
            // Decrease Chance of Using Reagent
            case 132:
                // Decrease Spell Mana Cost
            // Decrease Spell Mana Cost
            case 158:
                // Increase Chance to Reflect Spell
            // Increase Chance to Reflect Spell
            case 168:
                // Increase Melee Mitigation
            // Increase Melee Mitigation
            case 169:
                // Increase Chance to Critical Hit
            // Increase Chance to Critical Hit
            case 172:
                // Increase Chance to Avoid Melee
            // Increase Chance to Avoid Melee
            case 173:
                // Increase Chance to Riposte
            // Increase Chance to Riposte
            case 174:
                // Increase Chance to Dodge
            // Increase Chance to Dodge
            case 175:
                // Increase Chance to Parry
            // Increase Chance to Parry
            case 176:
                // Increase Chance to Dual Wield
            // Increase Chance to Dual Wield
            case 177:
                // Increase Chance to Double Attack
            // Increase Chance to Double Attack
            case 180:
                // Increase Chance to Resist Spell
            // Increase Chance to Resist Spell
            case 181:
                // Increase Chance to Resist Fear Spell
            // Increase Chance to Resist Fear Spell
            case 183:
                // Increase All Skills Skill Check
            // Increase All Skills Skill Check
            case 184:
                // Increase Chance to Hit With all Skills
            // Increase Chance to Hit With all Skills
            case 185:
                // Increase All Skills Damage Modifier
            // Increase All Skills Damage Modifier
            case 186:
                // Increase All Skills Minimum Damage Modifier
            // Increase All Skills Minimum Damage Modifier
            case 188:
                // Increase Chance to Block
            // Increase Chance to Block
            case 200:
                // Increase Proc Modifier
            // Increase Proc Modifier
            case 201:
                // Increase Range Proc Modifier
            // Increase Range Proc Modifier
            case 216:
                // Increase Accuracy
            // Increase Accuracy
            case 227:
                // Reduce Skill Timer
            // Reduce Skill Timer
            case 266:
                // Add Attack Chance
            // Add Attack Chance
            case 273:
                // Increase Critical Dot Chance
            // Increase Critical Dot Chance
            case 294:
                // Increase Critical Spell Chance
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($min != $max) {
                    $html_string .= " by {$min}% (L{$minlvl}) to {$max}% (L{$maxlvl})";
                } else {
                    $html_string .= " by {$max}%";
                }
                break;
            case 15:
                // Increase Mana per tick
            // Increase Mana per tick
            case 100:
                // Increase Hitpoints v2 per tick
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($min != $max) {
                    $html_string .= " by " . abs($min) . " (L{$minlvl}) to " . abs($max) . " (L{$maxlvl}) per tick (total " . abs($min * $duration) . " to " . abs($max * $duration) . ")";
                } else {
                    $html_string .= " by {$max} per tick (total " . abs($max * $duration) . ")";
                }
                break;
            case 30:
                // Frenzy Radius
            // Frenzy Radius
            case 86:
                // Reaction Radius
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " (" . $spell["effect_base_value{$n}"] . "/" . $spell["effect_limit_value{$n}"] . ")";
                break;
            case 22:
                // Charm
            // Charm
            case 23:
                // Fear
            // Fear
            case 31:
                // Mesmerize
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " up to level " . $spell["effect_limit_value{$n}"];
                break;
            case 33:
                // Summon Pet:
            // Summon Pet:
            case 68:
                // Summon Skeleton Pet:
            // Summon Skeleton Pet:
            case 106:
                // Summon Warder:
            // Summon Warder:
            case 108:
                // Summon Familiar:
            // Summon Familiar:
            case 113:
                // Summon Horse:
            // Summon Horse:
            case 152:
                // Summon Pets:
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($csv == false) {
                    $html_string .= " <a href=pet.php?name=" . $spell["teleport_zone"] . ">" . $spell["teleport_zone"] . "</a>";
                } else {
                    $html_string .= " : " . $spell["teleport_zone"];
                }
                break;
            case 13:
                // See Invisible
            // See Invisible
            case 18:
                // Pacify
            // Pacify
            case 20:
                // Blindness
            // Blindness
            case 25:
                // Bind Affinity
            // Bind Affinity
            case 26:
                // Gate
            // Gate
            case 28:
                // Invisibility versus Undead
            // Invisibility versus Undead
            case 29:
                // Invisibility versus Animals
            // Invisibility versus Animals
            case 40:
                // Invunerability
            // Invunerability
            case 41:
                // Destroy Target
            // Destroy Target
            case 42:
                // Shadowstep
            // Shadowstep
            case 44:
                // Lycanthropy
            // Lycanthropy
            case 52:
                // Sense Undead
            // Sense Undead
            case 53:
                // Sense Summoned
            // Sense Summoned
            case 54:
                // Sense Animals
            // Sense Animals
            case 56:
                // True North
            // True North
            case 57:
                // Levitate
            // Levitate
            case 61:
                // Identify
            // Identify
            case 64:
                // SpinStun
            // SpinStun
            case 65:
                // Infravision
            // Infravision
            case 66:
                // UltraVision
            // UltraVision
            case 67:
                // Eye of Zomm
            // Eye of Zomm
            case 68:
                // Reclaim Energy
            // Reclaim Energy
            case 73:
                // Bind Sight
            // Bind Sight
            case 74:
                // Feign Death
            // Feign Death
            case 75:
                // Voice Graft
            // Voice Graft
            case 76:
                // Sentinel
            // Sentinel
            case 77:
                // Locate Corpse
            // Locate Corpse
            case 82:
                // Summon PC
            // Summon PC
            case 90:
                // Cloak
            // Cloak
            case 93:
                // Stop Rain
            // Stop Rain
            case 94:
                // Make Fragile (Delete if combat)
            // Make Fragile (Delete if combat)
            case 95:
                // Sacrifice
            // Sacrifice
            case 96:
                // Silence
            // Silence
            case 99:
                // Root
            // Root
            case 101:
                // Complete Heal (with duration)
            // Complete Heal (with duration)
            case 103:
                // Call Pet
            // Call Pet
            case 104:
                // Translocate target to their bind point
            // Translocate target to their bind point
            case 105:
                // Anti-Gate
            // Anti-Gate
            case 115:
                // Food/Water
            // Food/Water
            case 117:
                // Make Weapons Magical
            // Make Weapons Magical
            case 135:
                // Limit: Resist(Magic allowed)
            // Limit: Resist(Magic allowed)
            case 137:
                // Limit: Effect(Hitpoints allowed)
            // Limit: Effect(Hitpoints allowed)
            case 138:
                // Limit: Spell Type(Detrimental only)
            // Limit: Spell Type(Detrimental only)
            case 141:
                // Limit: Instant spells only
            // Limit: Instant spells only
            case 150:
                // Death Save - Restore Full Health
            // Death Save - Restore Full Health
            case 151:
                // Suspend Pet - Lose Buffs and Equipment
            // Suspend Pet - Lose Buffs and Equipment
            case 154:
                // Remove Detrimental
            // Remove Detrimental
            case 156:
                // Illusion: Target
            // Illusion: Target
            case 178:
                // Lifetap from Weapon Damage
            // Lifetap from Weapon Damage
            case 179:
                // Instrument Modifier
            // Instrument Modifier
            case 182:
                // Hundred Hands Effect
            // Hundred Hands Effect
            case 194:
                // Fade
            // Fade
            case 195:
                // Stun Resist
            // Stun Resist
            case 205:
                // Rampage
            // Rampage
            case 206:
                // Area of Effect Taunt
            // Area of Effect Taunt
            case 311:
                // Limit: Combat Skills Not Allowed
            // Limit: Combat Skills Not Allowed
            case 314:
                // Fixed Duration Invisbility
            // Fixed Duration Invisbility
            case 299:
                // Wake the Dead
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                break;
            case 58:
                // Illusion:
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= $dbiracenames[$spell["effect_base_value{$n}"]];
                break;
            case 63:
                // Memblur
            // Memblur
            case 120:
                // Set Healing Effectiveness
            // Set Healing Effectiveness
            case 330:
                // Critical Damage Mob
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " ({$max}%)";
                break;
            case 81:
                // Resurrect
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " and restore " . $spell["effect_base_value{$n}"] . "% experience";
                break;
            case 83:
                // Teleport
            // Teleport
            case 88:
                // Evacuate
            // Evacuate
            case 145:
                // Teleport v2
                //$html_string .= " (Need to add zone to spells table)";
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($csv == false) {
                    $html_string .= " <a href=zone.php?name=" . $spell["teleport_zone"] . ">" . $spell["teleport_zone"] . "</a>";
                } else {
                    $html_string .= " : " . $spell["teleport_zone"];
                }
                break;
            case 85:
                // Add Proc:
            // Add Proc:
            case 289:
                // Improved Spell Effect:
            // Improved Spell Effect:
            case 323:
                // Add Defensive Proc:
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $name = GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $spell["effect_base_value{$n}"]);
                if ($csv == false) {
                    $html_string .= "<a href=spell.php?id=" . $spell["effect_base_value{$n}"] . ">{$name}</a>";
                } else {
                    $html_string .= " : {$name}";
                }
                break;
            case 89:
                // Increase Player Size
                $name = $dbspelleffects[$spell["effectid{$n}"]];
                $min -= 100;
                $max -= 100;
                if ($max < 0) {
                    $name = str_replace("Increase", "Decrease", $name);
                }
                $html_string .= $name;
                if ($min != $max) {
                    $html_string .= " by {$min}% (L{$minlvl}) to {$max}% (L{$maxlvl})";
                } else {
                    $html_string .= " by {$max}%";
                }
                break;
            case 27:
                // Cancel Magic
            // Cancel Magic
            case 134:
                // Limit: Max Level
            // Limit: Max Level
            case 157:
                // Spell-Damage Shield
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " ({$max})";
                break;
            case 121:
                // Reverse Damage Shield
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " (-{$max})";
                break;
            case 91:
                // Summon Corpse
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " (max level {$max})";
                break;
            case 136:
                // Limit: Target
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                if ($max < 0) {
                    $max = -$max;
                    $v = " excluded";
                } else {
                    $v = "";
                }
                $html_string .= " (" . $dbspelltargets[$max] . "{$v})";
                break;
            case 139:
                // Limit: Spell
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $max = $spell["effect_base_value{$n}"];
                if ($max < 0) {
                    $max = -$max;
                    $v = " excluded";
                }
                $name = GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id={$max}");
                if ($csv == false) {
                    $html_string .= "({$name})";
                } else {
                    $html_string .= " (<a href=spell.php?id=" . $spell["effect_base_value{$n}"] . ">{$name}</a>{$v})";
                }
                break;
            case 140:
                // Limit: Min Duration
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $min *= 6;
                $max *= 6;
                if ($min != $max) {
                    $html_string .= " ({$min} sec (L{$minlvl}) to {$max} sec (L{$maxlvl}))";
                } else {
                    $html_string .= " ({$max} sec)";
                }
                break;
            case 143:
                // Limit: Min Casting Time
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $min *= 6;
                $max *= 6;
                if ($min != $max) {
                    $html_string .= " (" . $min / 6000 . " sec (L{$minlvl}) to " . $max / 6000 . " sec (L{$maxlvl}))";
                } else {
                    $html_string .= " (" . $max / 6000 . " sec)";
                }
                break;
            case 148:
                // Stacking: Overwrite existing spell
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " if slot " . ($spell["effectid{$n}"] - 200) . " is effect '" . $dbspelleffects[$spell["effect_base_value{$n}"]] . "' and <" . $spell["effect_limit_value{$n}"];
                break;
            case 149:
                // Stacking: Overwrite existing spell
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " if slot " . ($spell["effectid{$n}"] - 200) . " is effect '" . $dbspelleffects[$spell["effect_base_value{$n}"]] . "' and <" . $spell["effect_limit_value{$n}"];
                break;
            case 147:
                // Increase Hitpoints (%)
                $name = $dbspelleffects[$spell["effectid{$n}"]];
                if ($max < 0) {
                    $name = str_replace("Increase", "Decrease", $name);
                }
                $html_string .= $name . " by " . $spell["effect_limit_value{$n}"] . " ({$max}% max)";
                break;
            case 153:
                // Balance Party Health
                $html_string .= $dbspelleffects[$spell["effectid{$n}"]];
                $html_string .= " ({$max}% penalty)";
                break;
            case 0:
                // In/Decrease hitpoints
            // In/Decrease hitpoints
            case 1:
                // Increase AC
            // Increase AC
            case 2:
                // Increase ATK
            // Increase ATK
            case 4:
                // Increase STR
            // Increase STR
            case 5:
                // Increase DEX
            // Increase DEX
            case 6:
                // Increase AGI
            // Increase AGI
            case 7:
                // Increase STA
            // Increase STA
            case 8:
                // Increase INT
            // Increase INT
            case 9:
                // Increase WIS
            // Increase WIS
            case 19:
                // Increase Faction
            // Increase Faction
            case 35:
                // Increase Disease Counter
            // Increase Disease Counter
            case 36:
                // Increase Poison Counter
            // Increase Poison Counter
            case 46:
                // Increase Magic Fire
            // Increase Magic Fire
            case 47:
                // Increase Magic Cold
            // Increase Magic Cold
            case 48:
                // Increase Magic Poison
            // Increase Magic Poison
            case 49:
                // Increase Magic Disease
            // Increase Magic Disease
            case 50:
                // Increase Magic Resist
            // Increase Magic Resist
            case 55:
                // Increase Absorb Damage
            // Increase Absorb Damage
            case 59:
                // Increase Damage Shield
            // Increase Damage Shield
            case 69:
                // Increase Max Hitpoints
            // Increase Max Hitpoints
            case 78:
                // Increase Absorb Magic Damage
            // Increase Absorb Magic Damage
            case 79:
                // Increase HP when cast
            // Increase HP when cast
            case 92:
                // Increase hate
            // Increase hate
            case 97:
                // Increase Mana Pool
            // Increase Mana Pool
            case 111:
                // Increase All Resists
            // Increase All Resists
            case 112:
                // Increase Effective Casting
            // Increase Effective Casting
            case 116:
                // Decrease Curse Counter
            // Decrease Curse Counter
            case 118:
                // Increase Singing Skill
            // Increase Singing Skill
            case 159:
                // Decrease Stats
            // Decrease Stats
            case 167:
                // Pet Power Increase
            // Pet Power Increase
            case 192:
                // Increase hate
            // Increase hate
            default:
                $name = $dbspelleffects[$spell["effectid{$n}"]];
                if ($max < 0) {
                    $name = str_replace("Increase", "Decrease", $name);
                }
                $html_string .= $name;
                if ($min != $max) {
                    $html_string .= " by {$min} (L{$minlvl}) to {$max} (L{$maxlvl})";
                } else {
                    if ($max < 0) {
                        $max = -$max;
                    }
                    $html_string .= " by {$max}";
                }
                break;
        }
        $html_string .= '<br>';
        if ($echo == true) {
            echo $html_string;
        } else {
            return $html_string;
        }
    }
}
Пример #5
0
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;
}
Пример #6
0
             }
             $DroppedList .= "<li><a href='npc.php?id=" . $row["id"] . "'>" . str_replace("_", " ", $row["name"]) . "</a>";
             if ($ItemAddChanceToDrop) {
                 $DroppedList .= " (" . $row["chance"] * $row["probability"] / 100 . "% x " . $row["multiplier"] . ")";
             }
             $DroppedList .= "</li>\n";
         }
         $DroppedList .= "</ul>\n";
         $DroppedList .= "</ul>\n";
         $DroppedList .= "</td>\n";
         $DroppedList .= "</tr>\n";
         print $DroppedList;
     }
 }
 // Check with a quick query before trying the long one
 $IsSold = GetFieldByQuery("item", "SELECT item FROM {$tbmerchantlist} WHERE item={$id} LIMIT 1");
 if ($IsSold) {
     // npcs selling this (Very Heavy Query)
     $query = "SELECT {$tbnpctypes}.id,{$tbnpctypes}.name,{$tbspawn2}.zone,{$tbzones}.long_name,{$tbnpctypes}.class\n\t\t\t\t\tFROM {$tbnpctypes},{$tbmerchantlist},{$tbspawn2},{$tbzones},{$tbspawnentry}\n\t\t\t\t\tWHERE {$tbmerchantlist}.item={$id}\n\t\t\t\t\tAND {$tbnpctypes}.id={$tbspawnentry}.npcID\n\t\t\t\t\tAND {$tbspawnentry}.spawngroupID={$tbspawn2}.spawngroupID\n\t\t\t\t\tAND {$tbmerchantlist}.merchantid={$tbnpctypes}.merchant_id\n\t\t\t\t\tAND {$tbzones}.short_name={$tbspawn2}.zone";
     $result = mysql_query($query) or message_die('item.php', 'MYSQL_QUERY', $query, mysql_error());
     if (mysql_num_rows($result) > 0) {
         $MerchantList = "";
         $MerchantList .= $Separator;
         $Separator = "<tr class='myline' height='6'><td colspan='2'></td><tr>\n";
         $MerchantList .= "<tr>\n";
         $MerchantList .= "<td nowrap='1'><b>This item is sold : </b>\n";
         $CurrentZone = "";
         while ($row = mysql_fetch_array($result)) {
             if ($CurrentZone != $row["zone"]) {
                 if ($CurrentZone != "") {
                     $MerchantList .= "</ul>\n";
Пример #7
0
        $Query = 'INSERT INTO goallists ( listid, entry ) VALUES ( ' . $goalid . ',  0 )';
        $QueryResult = mysql_query($Query) or message_die('taskbuild.php', 'MYSQL_QUERY', $Query, mysql_error());
        $GoalMessage = '<font ><b>New Entry!</b></font>';
    }
    $Query = 'SELECT listid, entry FROM goallists WHERE listid = ' . $goalid . ' ORDER BY entry';
    $QueryResult = mysql_query($Query) or message_die('taskbuild.php', 'MYSQL_QUERY', $Query, mysql_error());
    $GoalTypeValue = "taskactivitygoalid";
    if ($type == "rewardid") {
        $GoalTypeValue = "rewardid";
    }
    $TaskContent .= '<table align="left" style="margin-left:25px;">';
    while ($row = mysql_fetch_array($QueryResult)) {
        $CurGoalID = $row["listid"];
        $CurGoalEntry = $row["entry"];
        $NPCName = ReadableNpcName(GetFieldByQuery("name", "SELECT name FROM npc_types WHERE id=" . $CurGoalEntry . ""));
        $ItemName = GetFieldByQuery("Name", "SELECT Name FROM items WHERE id=" . $CurGoalEntry . "");
        $TaskContent .= '<tr><td align="right"><b>Goal List ' . $CurGoalID . ' : </b></td><td>
			<input size="11" id="goalentry' . $CurGoalEntry . '" name="goalentry' . $CurGoalEntry . '" type="text" value="' . $CurGoalEntry . '" onchange="changeGoal(' . $CurGoalID . ', \'updategoal\', ' . $CurGoalEntry . ', this.value)"/>';
        $TaskContent .= '<a href="javascript:;" class="btn red btn-xs" onclick="changeGoal(' . $CurGoalID . ', \'deletegoal\', ' . $CurGoalEntry . ')"><i class="fa fa-trash-o"></i> Delete</a>';
        $TaskContent .= ' ';
        if ($ItemName) {
            $TaskContent .= '<a href="' . $root_url . 'item.php?id=' . $CurGoalEntry . '"> ' . $ItemName . '<a/>';
        }
        if ($ItemName && $NPCName && $type == "taskactivitygoalid") {
            $TaskContent .= '<font color="red"><b> OR </b><font>';
        }
        if ($NPCName && $type == "taskactivitygoalid") {
            $TaskContent .= '<a href="' . $root_url . 'npc.php?id=' . $CurGoalEntry . '"> ' . $NPCName . '<a/>';
        }
        if (!$ItemName && !$NPCName) {
            if ($type == "taskactivitygoalid") {
Пример #8
0
function GetTaskEditForm($id)
{
    global $tbtaskactivities, $tbtasks, $icons_url, $root_url;
    $taskid = $id;
    $activityid = -1;
    if ($id != "" && is_numeric($id)) {
        if ($id == 0) {
            $MaxTaskID = GetFieldByQuery("MAXID", "SELECT MAX(id) AS MAXID FROM `tasks`");
            $id = $MaxTaskID + 1;
            $taskid = $id;
            $task["id"] = $id;
            $task["minlevel"] = 0;
            $task["maxlevel"] = 0;
            $task["duration"] = 0;
            $task["repeatable"] = 1;
            $task["startzone"] = 0;
            $task["rewardmethod"] = 0;
            $task["title"] = "Default Description";
            $Query = "INSERT INTO `tasks` (id, minlevel, maxlevel, duration, repeatable, startzone, rewardmethod, title, description) \n\t\t\t\t\tVALUES('" . $task["id"] . "','" . $task["minlevel"] . "','" . $task["maxlevel"] . "','" . $task["duration"] . "','" . $task["repeatable"] . "','" . $task["startzone"] . "','" . $task["rewardmethod"] . "','" . $task["title"] . "','" . $task["title"] . "')";
            $QueryResult = mysql_query($Query) or message_die('taskbuild.php', 'MYSQL_QUERY', $Query, mysql_error());
            if ($QueryResult) {
                $Query = "SELECT * FROM `tasks` WHERE id='" . $id . "'";
                $QueryResult = mysql_query($Query) or message_die('taskbuild.php', 'MYSQL_QUERY', $Query, mysql_error());
                if (mysql_num_rows($QueryResult) == 0) {
                    //exit();
                }
                $task = mysql_fetch_array($QueryResult);
            }
        } else {
            $Query = "SELECT * FROM `tasks` WHERE id='" . $id . "'";
            $QueryResult = mysql_query($Query);
            if (mysql_num_rows($QueryResult) == 0) {
                // No task data - Return nothing
                return;
            }
            $task = mysql_fetch_array($QueryResult);
        }
    }
    $TaskContent = "";
    $TaskContent .= '<div>';
    // Outter Table that includes the task data table on the left and activity table on the right
    $TaskContent .= '<table align="left" style="margin-left:15px;" width="100%"><tr><td style="vertical-align:top">';
    // Task Data Table
    $TaskContent .= '<form id="taskform" class="customForm" action="tasks.php" method="post">';
    $TaskContent .= '<table align="left" width="0%">';
    $TaskContent .= '<tr><td align="center"><div id="taskDeleteDiv"><a href="javascript:;" class="btn btn-xs red" onclick="deleteTaskActivity(' . $taskid . ', ' . $activityid . ', \'delete\', \'taskDeleteDiv\')"><i class="fa fa-trash-o"></i> Delete Task</a><hr></div></td></tr>';
    // Task ID
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskid", "Task ID", $task["id"], 2, "right", 1);
    // Task Title
    $TaskContent .= GetTaskFormString($taskid, $activityid, "tasktitle", "Task Title", $task["title"], 64, "right", 1);
    // Min Level
    //$TaskContent .= GetTaskFormString($taskid, $activityid, "taskminlevel", "Min Level", $task["minlevel"], 1, "right", 0);
    $TaskContent .= '<tr><td align="right" nowrap="nowrap"><b>Min Level</b></td>';
    // Begin Min/Max Level and Duration Table
    $TaskContent .= '<td><table><tr>';
    $TaskContent .= '<td><input class="form-control" autocomplete="off" size="1" id="taskminlevel" name="taskminlevel" type="text" onchange="UpdateDBField(' . $taskid . ', ' . $activityid . ', this.id, this.value)" value="' . $task["minlevel"] . '"/></td>';
    // Max Level
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskmaxlevel", "Max Level", $task["maxlevel"], 1, "right", 0);
    // Duration
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskduration", "Duration", $task["duration"], 1, "right", 0);
    // End Min/Max Level and Duration Table
    $TaskContent .= '</tr></table></td></tr>';
    $ZoneID = $task["startzone"];
    // Start Zone
    $TaskContent .= '<tr><td align="right" nowrap="nowrap"><b>Starts In</b></td><td>';
    // Zone List Select Box
    $TaskContent .= GetZoneSelect($ZoneID, "taskstartzone", $taskid, $activityid);
    $TaskContent .= '</td></tr>';
    // Reward Method
    $TaskContent .= '<tr><td align="right" nowrap="nowrap"><b>Reward Method</b></td><td>
				<div class="customSelect">
					<select class="form-control" id="taskrewardmethod" name="taskrewardmethod" autocomplete="off" onchange="UpdateDBField(' . $taskid . ', ' . $activityid . ', this.id, this.value)">';
    $RewardMethodArray = array("Single Item", "Item Goal List", "Quest Reward");
    for ($i = 0; $i < 3; $i++) {
        if ($i == $task["rewardmethod"]) {
            $TaskContent .= '<option value="' . $i . '" selected="selected">' . $i . ' - ' . $RewardMethodArray[$i] . '</option>';
        } else {
            $TaskContent .= '<option value="' . $i . '">' . $i . ' - ' . $RewardMethodArray[$i] . '</option>';
        }
    }
    $TaskContent .= '</select></div><div class="fix"></div></td></tr>';
    // Reward Description
    $Reward = $task["reward"];
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskreward", "Reward Description", $Reward, 64, "right", 1);
    $TaskContent .= '<tr><td align="right" nowrap="nowrap">
				<b>Reward ID/Goal List</b></td><td><table width="100%"><tr>
				<td><input class="form-control" size="11" id="taskrewardid" name="taskrewardid" type="text" value="' . $task["rewardid"] . '" onchange="UpdateDBField(' . $taskid . ', ' . $activityid . ', this.id, this.value)" />';
    $TaskContent .= '<a href="javascript:;" class="btn green btn-xs" onclick="addGoal(' . $taskid . ', ' . $activityid . ', \'taskrewardid\')"><i class="fa fa-plus-square"></i> New</a> ';
    $TaskContent .= '<a href="javascript:;" class="btn blue btn-xs" onclick="getGoalList(\'taskrewardid\', 1200, 800)"><i class="fa fa-pencil-square-o"></i> Edit</a></td>';
    if ($task["rewardmethod"] == 0 && is_numeric($task["rewardid"])) {
        $ItemName = GetFieldByQuery("Name", "SELECT Name FROM items WHERE id = " . $task["rewardid"]);
        if ($ItemName) {
            $TaskContent .= '<td align="right" nowrap="nowrap"><a id="taskrewarditemlink" href="' . $root_url . 'item.php?id=' . $task["rewardid"] . '"> ' . $ItemName . '<a/></td>';
        }
    }
    $TaskContent .= '</tr></table></td></tr>';
    $TaskCash = $task["cashreward"];
    $ItemValue = "";
    $Platinum = 0;
    $Gold = 0;
    $Silver = 0;
    $Copper = 0;
    if ($TaskCash > 1000) {
        $Platinum = (int) ($TaskCash / 1000);
    }
    if ($TaskCash - $Platinum * 1000 > 100) {
        $Gold = (int) (($TaskCash - $Platinum * 1000) / 100);
    }
    if ($TaskCash - $Platinum * 1000 - $Gold * 100 > 10) {
        $Silver = (int) (($TaskCash - $Platinum * 1000 - $Gold * 100) / 10);
    }
    if ($TaskCash - $Platinum * 1000 - $Gold * 100 - $Silver * 10 > 0) {
        $Copper = $TaskCash - $Platinum * 1000 - $Gold * 100 - $Silver * 10;
    }
    // Cash Reward
    $ItemValue .= '<tr><td align="right" nowrap="nowrap"><b>Cash Reward</b></td><td><table>';
    $ItemValue .= '<tr><td nowrap="nowrap"> <img src="' . $icons_url . 'item_644.gif" width="14" height="14"/> <input autocomplete="off" size="11" id="taskplatinum" name="taskplatinum" type="text" value="' . $Platinum . '"/> ' . '</td><td nowrap="nowrap"> <img src="' . $icons_url . 'item_645.gif" width="14" height="14"/> <input autocomplete="off" size="2" id="taskgold" name="taskgold" type="text" value="' . $Gold . '"/> ' . '</td><td nowrap="nowrap"> <img src="' . $icons_url . 'item_646.gif" width="14" height="14"/> <input autocomplete="off" size="2" id="tasksilver" name="tasksilver" type="text" value="' . $Silver . '"/> ' . '</td><td nowrap="nowrap"> <img src="' . $icons_url . 'item_647.gif" width="14" height="14"/> <input autocomplete="off" size="2" id="taskcopper" name="taskcopper" type="text" value="' . $Copper . '"/> ';
    $ItemValue .= '</td></tr></table></td></tr>';
    // Disabled Split Coin Fields for Cash Reward
    //$TaskContent .= $ItemValue;
    // Cash Reward
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskcashreward", "Cash Reward", $task["cashreward"], 11, "right", 1);
    // Experience Reward
    $TaskContent .= GetTaskFormString($taskid, $activityid, "taskxpreward", "Experience Reward", $task["xpreward"], 11, "right", 1);
    // Repeatable
    $Repeatable = $task["repeatable"];
    $CheckBoxChecked = '';
    if ($Repeatable != 0) {
        $CheckBoxChecked = 'checked="checked" ';
    }
    $TaskContent .= '<tr><td align="right" nowrap="nowrap"><b>Repeatable</b></td><td>
				<input autocomplete="off" type="checkbox" id="taskrepeatable" name="taskrepeatable" class="" ' . $CheckBoxChecked . ' onchange="UpdateDBField(' . $taskid . ', ' . $activityid . ', this.id, this.value)"/>
				<label for="taskrepeatable" class="customCheckbox-label"></label></td></tr>';
    // Task description
    $TaskContent .= '<tr><td><b>Task Description</b>
							</td><td><textarea class="form-control" rows="8" cols="64" id="taskdescription" name="taskdescription" autocomplete="off" onchange="UpdateDBField(' . $taskid . ', ' . $activityid . ', this.id, this.value)">' . $task["description"] . '</textarea></td></tr>';
    // End the task data table and start the activities table
    $TaskContent .= '</table></td><td style="vertical-align:top">';
    $TaskContent .= '</form>';
    $TaskContent .= '<div id="activityListDiv">';
    $TaskContent .= GetActivityList($id);
    $TaskContent .= '</div>';
    // End the outter table
    $TaskContent .= '</td></tr></table>';
    $TaskContent .= '</div><div class="fix"></div>';
    return $TaskContent;
}
Пример #9
0
function BuildItemStats($item, $show_name_icon)
{
    global $dbitypes, $dam2h, $dbbagtypes, $dbskills, $icons_url, $tbspells, $dbiaugrestrict, $dbiracenames;
    $Tableborder = 0;
    $html_string = "";
    $html_string .= "<table border='{$Tableborder}' width='100%'><tr><td valign='top'>";
    if ($show_name_icon) {
        $html_string .= "<h4 style='margin-top:0'>" . $item["Name"] . "</h4></td>";
        $html_string .= "<td><img src='" . $icons_url . "item_" . $item["icon"] . ".gif' align='right' valign='top'/></td></tr><tr><td>";
    }
    $html_string .= "<table border='{$Tableborder}' width='100%' cellpadding='0' cellspacing='0'>";
    // lore, nodrop, norent, magic
    $html_string .= "<tr>";
    $html_string .= "<td colspan='2' nowrap='1'>";
    $v = "";
    if ($item["itemtype"] == 54) {
        $html_string .= "{$v} AUGMENTATION";
        $v = " ";
    }
    if ($item["magic"] == 1) {
        $html_string .= "{$v} MAGIC ITEM";
        $v = " ";
    }
    if ($item["loreflag"] == 1) {
        $html_string .= "{$v} LORE ITEM";
        $v = " ";
    }
    if ($item["nodrop"] == 0) {
        $html_string .= "{$v} NODROP";
        $v = " ";
    }
    if ($item["norent"] == 0) {
        $html_string .= "{$v} NORENT";
        $v = " ";
    }
    $html_string .= "                            </td>";
    $html_string .= "                          </tr>";
    // Classes
    if ($item["classes"] > 0) {
        $html_string .= "<tr><td colspan='2'><b>Classes: </b>" . getclasses($item["classes"]) . "</td></tr>";
    } else {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Classes: </b>All classes</td></tr>";
    }
    // Races
    if ($item["races"] > 0) {
        $html_string .= "<tr><td colspan='2'><b>Races: </b>" . getraces($item["races"]) . "</td></tr>";
    } else {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Races: </b>All races</td></tr>";
    }
    // Deity
    if ($item["deity"] > 0) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Deity: </b>" . gedeities($item["deity"]) . "</td></tr>";
    }
    // Slots
    if ($item["slots"] > 0) {
        $html_string .= "<tr><td colspan='2'><b>Slot: </b>" . strtoupper(getslots($item["slots"])) . "</td></tr>";
    }
    if ($item["slots"] == 0) {
        $html_string .= "<tr><td colspan='2' ><b>Slot: </b>NONE</td></tr>";
    }
    $TypeString = "";
    switch ($item["itemtype"]) {
        case 0:
            // 1HS
        // 1HS
        case 2:
            // 1HP
        // 1HP
        case 3:
            // 1HB
        // 1HB
        case 42:
            // H2H
        // H2H
        case 1:
            // 2hs
        // 2hs
        case 4:
            // 2hb
        // 2hb
        case 35:
            // 2hp
            $TypeString = "Skill";
            break;
        default:
            $TypeString = "Item Type";
            break;
    }
    // Item type or Skill
    // Bags show as 1HS
    if ($dbitypes[$item["itemtype"]] != "" && $item["bagslots"] == 0) {
        if ($item["slots"] == 0) {
            $html_string .= "<tr><td width='0%' nowrap='1' colspan='2'><b>" . $TypeString . ": </b>Inventory";
        } else {
            $html_string .= "<tr><td width='0%' nowrap='1' colspan='2'><b>" . $TypeString . ": </b>" . $dbitypes[$item["itemtype"]];
        }
        if ($item["stackable"] > 0) {
            $html_string .= " (stackable)";
        }
        $html_string .= "</td></tr>";
    }
    // Bag-specific information
    if ($item["bagslots"] > 0) {
        $html_string .= "<tr><td width='0%' nowrap='1'><b>Item Type: </b>Container</td></tr>";
        $html_string .= "<tr><td width='0%' nowrap='1'><b>Number of Slots: </b>" . $item["bagslots"] . "</td></tr>";
        if ($item["bagtype"] > 0) {
            $html_string .= "<tr><td width='0%' nowrap='1'><b>Trade Skill Container: </b>" . $dbbagtypes[$item["bagtype"]] . "</td></tr>";
        }
        if ($item["bagwr"] > 0) {
            $html_string .= "<tr><td width='0%'  nowrap='1'><b>Weight Reduction: </b>" . $item["bagwr"] . "%</td></tr>";
        }
        $html_string .= "<tr><td width='0%' nowrap='1' colspan='2'>This can hold " . strtoupper(getsize($item["bagsize"])) . " and smaller items.</td></tr>";
    }
    $html_string .= "</table>";
    $html_string .= "<table border='{$Tableborder}' width='0%' cellpadding='0' cellspacing='0'>";
    // Weight, Size, Rec/Req Level, skill
    $html_string .= "<tr valign='top'><td>";
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= "<tr><td><b>Size: </b></td><td>" . strtoupper(getsize($item["size"])) . "</td></tr>";
    $html_string .= GetItemStatsString("Weight", $item["weight"] / 10);
    $html_string .= GetItemStatsString("Rec Level", $item["reclevel"]);
    $html_string .= GetItemStatsString("Req Level", $item["reqlevel"]);
    $html_string .= "</table>";
    $html_string .= "</td><td>";
    // AC, HP, Mana, End, Haste
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= GetItemStatsString("AC", $item["ac"]);
    $html_string .= GetItemStatsString("HP", $item["hp"]);
    $html_string .= GetItemStatsString("Mana", $item["mana"]);
    $html_string .= GetItemStatsString("Endur", $item["endur"]);
    $html_string .= GetItemStatsString("Haste", $item["haste" . "%"]);
    $html_string .= "</table>";
    $html_string .= "</td><td>";
    // Base Damage, Ele/Bane/BodyType Damage, BS Damage, Delay, Range, Damage Bonus, Range
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= GetItemStatsString("Base Damage", $item["damage"]);
    $html_string .= GetItemStatsString(ucfirstwords($dbelements[$item["elemdmgtype"]]) . " Damage", $item["elemdmgamt"]);
    if ($item["banedmgrace"] > 0 && $item["banedmgamt"] != 0) {
        $html_string .= "<tr><td><b>Bane Damage (";
        $html_string .= $dbiracenames[$item["banedmgrace"]];
        $html_string .= ") </b></td><td>" . sign($item["banedmgamt"]) . "</td></tr>";
    }
    $html_string .= GetItemStatsString(ucfirstwords($dbbodytypes[$item["banedmgbody"]]), $item["banedmgamt"]);
    $html_string .= GetItemStatsString("Backstab Damage", $item["backstabdmg"]);
    $html_string .= GetItemStatsString("Delay", $item["delay"]);
    if ($item["damage"] > 0) {
        switch ($item["itemtype"]) {
            case 0:
                // 1HS
            // 1HS
            case 2:
                // 1HP
            // 1HP
            case 3:
                // 1HB
            // 1HB
            case 42:
                // H2H
                $dmgbonus = 13;
                // floor((65-25)/3)  main hand
                $html_string .= "<tr><td><b>Damage bonus: </b></td><td>{$dmgbonus}</td></tr>";
                break;
            case 1:
                // 2hs
            // 2hs
            case 4:
                // 2hb
            // 2hb
            case 35:
                // 2hp
                $dmgbonus = $dam2h[$item["delay"]];
                $html_string .= "<tr><td><b>Damage bonus: </b></td><td>{$dmgbonus}</td></tr>";
                break;
        }
    }
    $html_string .= GetItemStatsString("Range", $item["range"]);
    $html_string .= "</table>";
    $html_string .= "</td></tr>";
    $html_string .= "<tr valign='top'><td>";
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= GetItemStatsString("Strength", $item["astr"], $item["heroic_str"], "orange");
    $html_string .= GetItemStatsString("Stamina", $item["asta"], $item["heroic_sta"], "orange");
    $html_string .= GetItemStatsString("Intelligence", $item["aint"], $item["heroic_int"], "orange");
    $html_string .= GetItemStatsString("Wisdom", $item["awis"], $item["heroic_wis"], "orange");
    $html_string .= GetItemStatsString("Agility", $item["aagi"], $item["heroic_agi"], "orange");
    $html_string .= GetItemStatsString("Dexterity", $item["adex"], $item["heroic_dex"], "orange");
    $html_string .= GetItemStatsString("Charisma", $item["acha"], $item["heroic_cha"], "orange");
    $html_string .= "</table>";
    $html_string .= "</td><td>";
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= GetItemStatsString("Magic Resist", $item["mr"], $item["heroic_mr"], "orange");
    $html_string .= GetItemStatsString("Fire Resist", $item["fr"], $item["heroic_fr"], "orange");
    $html_string .= GetItemStatsString("Cold Resist", $item["cr"], $item["heroic_cr"], "orange");
    $html_string .= GetItemStatsString("Disease Resist", $item["dr"], $item["heroic_dr"], "orange");
    $html_string .= GetItemStatsString("Poison Resist", $item["pr"], $item["heroic_pr"], "orange");
    $html_string .= "</table>";
    $html_string .= "</td><td>";
    $html_string .= "<table width='0%' border='{$Tableborder}' cellpadding='0' cellspacing='5'>";
    $html_string .= GetItemStatsString("Attack", $item["attack"]);
    $html_string .= GetItemStatsString("HP Regen", $item["regen"]);
    $html_string .= GetItemStatsString("Mana Regen", $item["manaregen"]);
    $html_string .= GetItemStatsString("Endurance Regen", $item["enduranceregen"]);
    $html_string .= GetItemStatsString("Spell Shielding", $item["spellshield"]);
    $html_string .= GetItemStatsString("Combat Effects", $item["combateffects"]);
    $html_string .= GetItemStatsString("Shielding", $item["shielding"]);
    $html_string .= GetItemStatsString("DoT Shielding", $item["dotshielding"]);
    $html_string .= GetItemStatsString("Avoidance", $item["avoidance"]);
    $html_string .= GetItemStatsString("Accuracy", $item["accuracy"]);
    $html_string .= GetItemStatsString("Stun Resist", $item["stunresist"]);
    $html_string .= GetItemStatsString("Strikethrough", $item["strikethrough"]);
    $html_string .= GetItemStatsString("Damage Shield", $item["damageshield"]);
    $html_string .= "</td></tr></table>";
    $html_string .= "</td></tr></table>";
    if ($item["extradmgamt"] > 0) {
        $html_string .= "<tr><td><b>" . ucfirstwords($dbskills[$item["extradmgskill"]]) . " Damage: </b>" . sign($item["extradmgamt"]) . "</td></tr>";
    }
    //	$html_string .= "</td></tr>";
    // Skill Mods
    if ($item["skillmodtype"] > 0 && $item["skillmodvalue"] != 0) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Skill Mod: " . ucfirstwords($dbskills[$item["skillmodtype"]]) . ": </b>" . sign($item["skillmodvalue"]) . "%</td></tr>";
    }
    // Augmentations
    for ($i = 1; $i <= 5; $i++) {
        if ($item["augslot" . $i . "type"] > 0) {
            $html_string .= "<tr><td width='0%' nowrap='1' colspan='2'><b>Slot " . $i . ": </b>Type " . $item["augslot" . $i . "type"] . "</td></tr>";
        }
    }
    //item proc
    if ($item["proceffect"] > 0 && $item["proceffect"] < 65535) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Combat Effect: </b><a href='spell.php?id=" . $item["proceffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["proceffect"]) . "</a>";
        if ($item["proclevel2"] > 0) {
            $html_string .= "<br><b>Level for effect: </b>" . $item["proclevel2"];
        }
        $html_string .= "</td></tr>";
    }
    // worn effect
    if ($item["worneffect"] > 0 && $item["worneffect"] < 65535) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Worn Effect: </b><a href='spell.php?id=" . $item["worneffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["worneffect"]) . "</a>";
        if ($item["wornlevel"] > 0) {
            $html_string .= "<br><b>Level for effect: </b>" . $item["wornlevel"];
        }
        $html_string .= "</td></tr>";
    }
    // focus effect
    if ($item["focuseffect"] > 0 && $item["focuseffect"] < 65535) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Focus Effect: </b><a href='spell.php?id=" . $item["focuseffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["focuseffect"]) . "</a>";
        if ($item["focuslevel"] > 0) {
            $html_string .= "<br/><b>Level for effect: </b>" . $item["focuslevel"];
        }
        $html_string .= "</td></tr>";
    }
    // clicky effect
    if ($item["clickeffect"] > 0 && $item["clickeffect"] < 65535) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Click Effect: </b><a href='spell.php?id=" . $item["clickeffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["clickeffect"]) . "</a> (";
        if ($item["clicktype"] == 4) {
            $html_string .= "Must Equip. ";
        }
        if ($item["casttime"] > 0) {
            $html_string .= "<b>Casting time: </b>" . $item["casttime"] / 1000 . " sec";
        } else {
            $html_string .= "<b>Casting time: </b>Instant";
        }
        $html_string .= ")";
        if ($item["clicklevel"] > 0) {
            $html_string .= "<br/><b>Level for effect: </b>" . $item["clicklevel"];
        }
        if ($item["maxcharges"] > 0) {
            $html_string .= "<br/><b>Charges: </b>" . $item["maxcharges"];
        } elseif ($item["maxcharges"] < 0) {
            $html_string .= "<br/><b>Charges: </b>Unlimited";
        } else {
            $html_string .= "<br/><b>Charges: </b>None";
        }
        $html_string .= "</td></tr>";
    }
    // scroll
    if ($item["scrolleffect"] > 0 && $item["scrolleffect"] < 65535) {
        $html_string .= "<tr><td colspan='2' nowrap='1'><b>Spell Scroll Effect: </b><a href='spell.php?id=" . $item["scrolleffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["scrolleffect"]) . "</a>";
        $html_string .= "</td></tr>";
    }
    // bard item ?
    if ($item["bardtype"] > 22 && $item["bardtype"] < 65535) {
        $html_string .= "<tr><td width='0%' nowrap='1' colspan='2'><b>Bard skill: </b> " . $dbbardskills[$item["bardtype"]];
        if ($dbbardskills[$item["bardtype"]] == "") {
            $html_string .= "Unknown" . $item["bardtype"];
        }
        $val = $item["bardvalue"] * 10 - 100;
        if ($val > 0) {
            $html_string .= " (" . sign($val) . "%)</td></tr>";
        }
    }
    // Augmentation type
    if ($item["itemtype"] == 54) {
        if ($item["augtype"] > 0) {
            $Comma = "";
            $AugSlots = "";
            $AugType = $item["augtype"];
            $Bit = 1;
            for ($i = 1; $i < 25; $i++) {
                if ($Bit <= $AugType && $Bit & $AugType) {
                    $AugSlots .= $Comma . $i;
                    $Comma = ", ";
                }
                $Bit *= 2;
            }
            $html_string .= "<tr><td colspan='2' nowrap='1'><b>Augmentation Slot Type: </b>" . $AugSlots . "</td></tr>";
        } else {
            $html_string .= "<tr><td colspan='2' nowrap='1'><b>Augmentation Slot Type: </b>All Slots</td></tr>";
        }
        if ($item["augrestrict"] > 0) {
            if ($item["augrestrict"] > 12) {
                $html_string .= "<tr><td colspan='2' nowrap='1'><b>Augmentation Restriction: </b>Unknown Type</td></tr>";
            } else {
                $Restriction = $dbiaugrestrict[$item["augrestrict"]];
                $html_string .= "<tr><td colspan='2' nowrap='1'><b>Augmentation Restriction: </b>{$Restriction}</td></tr>";
            }
        }
    }
    $ItemPrice = $item["price"];
    $ItemValue = "";
    $Platinum = 0;
    $Gold = 0;
    $Silver = 0;
    $Copper = 0;
    if ($ItemPrice > 1000) {
        $Platinum = (int) ($ItemPrice / 1000);
    }
    if ($ItemPrice - $Platinum * 1000 > 100) {
        $Gold = (int) (($ItemPrice - $Platinum * 1000) / 100);
    }
    if ($ItemPrice - $Platinum * 1000 - $Gold * 100 > 10) {
        $Silver = (int) (($ItemPrice - $Platinum * 1000 - $Gold * 100) / 10);
    }
    if ($ItemPrice - $Platinum * 1000 - $Gold * 100 - $Silver * 10 > 0) {
        $Copper = $ItemPrice - $Platinum * 1000 - $Gold * 100 - $Silver * 10;
    }
    $ItemValue .= "<tr><td nowrap><b>Value: </b>";
    $ItemValue .= $Platinum . " <img src='" . $icons_url . "item_644.gif' width='14' height='14'/> " . $Gold . " <img src='" . $icons_url . "item_645.gif' width='14' height='14'/> " . $Silver . " <img src='" . $icons_url . "item_646.gif' width='14' height='14'/> " . $Copper . " <img src='" . $icons_url . "item_647.gif' width='14' height='14'/>";
    $ItemValue .= "</td></tr><br>";
    $html_string .= $ItemValue;
    $html_string .= "</td></tr></table>";
    return $html_string;
}
Пример #10
0
/** Returns an items stats formatted for display.
 */
function GetItem($item)
{
    global $dbelements;
    global $dbskills;
    global $dam2h;
    global $dbitypes;
    global $tbspells;
    global $tbraces;
    global $dbbodytypes;
    global $dbbardskills;
    //return buffer, build item here
    $Output = "";
    $tab = "           ";
    // LORE AUGMENT NODROP NORENT MAGIC
    $spaceswitch = "";
    if ($item["itemtype"] == 54) {
        $Output .= "{$spaceswitch} AUGMENTATION";
        $spaceswitch = " ";
    }
    if ($item["magic"] == 1) {
        $Output .= "{$spaceswitch} MAGIC ITEM";
        $spaceswitch = " ";
    }
    if ($item["loregroup"] == -1) {
        $Output .= "{$spaceswitch} LORE ITEM";
        $spaceswitch = " ";
    }
    if ($item["nodrop"] == 0) {
        $Output .= "{$spaceswitch} NO TRADE";
        $spaceswitch = " ";
    }
    if ($item["norent"] == 0) {
        $Output .= "{$spaceswitch} NO RENT";
        $spaceswitch = " ";
    }
    $Output .= "<br>\n";
    //EXPENDABLE, Charges
    if ($item["clicktype"] == 3) {
        $Output .= $tab . "EXPENDABLE ";
    }
    //if($item["clicktype"]>0 && $item["maxcharges"]>0) { $Output .= "Charges: ".$item["maxcharges"]."<br>\n"; } //replaced maxcharges logic 2/25/2014
    if ($item["clicktype"] > 0 && $item["maxcharges"] != 0) {
        $Output .= "Charges: " . ($item["maxcharges"] > 0 ? $item["maxcharges"] : "Infinite") . "<br>\n";
    }
    // Augmentation type
    if ($item["itemtype"] == 54) {
        //if($item["augtype"] > 0) { $Output .= $tab."Augmentation type: ".$item["augtype"]."<br>\n"; }            //removed 2/25/2014
        if ($item["augtype"] > 0) {
            $Output .= $tab . "Augmentation type: " . getaugtype($item["augtype"]) . "<br>\n";
        } else {
            $Output .= $tab . "Augmentation type: for all slots<br>\n";
        }
    }
    // Slots
    if ($item["slots"] > 0) {
        $Output .= $tab . "Slot: " . strtoupper(getslots($item["slots"])) . "<br>\n";
    }
    // Bag-specific information
    if ($item["bagslots"] > 0) {
        $Output .= $tab . "Item type: Container<br>\n";
        $Output .= $tab . "Number of slots: " . $item["bagslots"] . "<br>\n";
        if ($item["bagtype"] > 0) {
            $Output .= $tab . "Trade skill container: " . $dbbagtypes[$item["bagtype"]] . "<br>\n";
        }
        if ($item["bagwr"] > 0) {
            $Output .= $tab . "Weight reduction: " . $item["bagwr"] . "%<br>\n";
        }
        $Output .= $tab . "This can hold " . strtoupper(getsize($item["bagsize"])) . " and smaller items.<br>\n";
    }
    // Damage/Delay
    if ($item["damage"] > 0) {
        $WepSkill = $dbitypes[$item["itemtype"]];
        if ($item["itemtype"] == 27) {
            $WepSkill = "Archery";
        }
        $Output .= $tab . "Skill: " . $WepSkill . " ";
        $Output .= "Atk Delay: " . $item["delay"] . "<br>\n" . $tab . "DMG:  " . $item["damage"] . "";
        switch ($item["itemtype"]) {
            case 0:
                // 1HS
            // 1HS
            case 2:
                // 1HP
            // 1HP
            case 3:
                // 1HB
            // 1HB
            case 45:
                // H2H
            // H2H
            case 27:
                //Arrow
                $dmgbonus = 13;
                // floor((65-25)/3)  main hand
                $Output .= $tab . "Dmg bonus:{$dmgbonus} <i>(lvl 65)</i>";
                if ($item["ac"] == 0) {
                    $Output .= "<br>\n";
                }
                break;
            case 5:
                //archery
            //archery
            case 1:
                // 2hs
            // 2hs
            case 4:
                // 2hb
            // 2hb
            case 35:
                // 2hp
                $dmgbonus = $dam2h[$item["delay"]];
                $Output .= $tab . "Dmg bonus: {$dmgbonus} <i>(lvl 65)</i>";
                if ($item["ac"] == 0) {
                    $Output .= "<br>\n";
                }
                break;
        }
    }
    //backstab dmg, added 2/24/2014
    if ($item["backstabdmg"] > 0) {
        $Output .= "Backstab Damage: " . $item["backstabdmg"] . "<br>\n";
    }
    //AC
    if ($item["ac"] != 0) {
        $Output .= $tab . " AC: " . $item["ac"] . "<br>\n";
    }
    // Elemental DMG
    if ($item["elemdmgtype"] > 0 and $item["elemdmgamt"] != 0) {
        $Output .= $tab . strtolower_ucfirst($dbelements[$item["elemdmgtype"]]) . " DMG: " . sign($item["elemdmgamt"]) . "<br>\n";
    }
    //Bane DMG
    if ($item["banedmgrace"] > 0 and $item["banedmgraceamt"] != 0) {
        $Output .= $tab . "Bane DMG: ";
        $Output .= GetFieldByQuery("name", "SELECT name FROM {$tbraces} WHERE id=" . $item["banedmgrace"]);
        $Output .= " " . sign($item["banedmgraceamt"]) . "<br>\n";
    }
    if ($item["banedmgbody"] > 0 and $item["banedmgamt"] != 0) {
        $Output .= $tab . "Bane DMG: " . $dbbodytypes[$item["banedmgbody"]];
        $Output .= " " . sign($item["banedmgamt"]) . "<br>\n";
    }
    // Skill Mods
    if ($item["skillmodtype"] > 0 and $item["skillmodvalue"] != 0) {
        $Output .= $tab . "Skill Mod: " . strtolower_ucfirst($dbskills[$item["skillmodtype"]]) . " " . sign($item["skillmodvalue"]) . "%<br>\n";
    }
    //item proc
    if ($item["proceffect"] > 0 and $item["proceffect"] < 65535) {
        $Output .= $tab . "Effect: <a href='http://mqemulator.net/spell.php?id=" . $item["proceffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["proceffect"]) . "</a>";
        $Output .= "&nbsp;(Combat)";
        $Output .= " <i>(Level " . $item["proclevel2"] . ")</i>";
        $Output .= "<br>\n";
    }
    // worn effect
    if ($item["worneffect"] > 0 and $item["worneffect"] < 65535) {
        $Output .= $tab . "Effect: <a href='http://mqemulator.net/spell.php?id=" . $item["worneffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["worneffect"]) . "</a>";
        $Output .= "&nbsp;(Worn)";
        $Output .= " <i>(Level " . $item["wornlevel"] . ")</i>";
        $Output .= "<br>\n";
    }
    // focus effect
    if ($item["focuseffect"] > 0 and $item["focuseffect"] < 65535) {
        $Output .= $tab . "Focus: <a href='http://mqemulator.net/spell.php?id=" . $item["focuseffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["focuseffect"]) . "</a>";
        if ($item["focuslevel"] > 0) {
            $Output .= " <i>(Level " . $item["focuslevel"] . ")</i>";
        }
        $Output .= "<br>\n";
    }
    // clicky effect
    if ($item["clickeffect"] > 0 and $item["clickeffect"] < 65535) {
        $Output .= $tab . "Effect: <a href='http://mqemulator.net/spell.php?id=" . $item["clickeffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["clickeffect"]) . "</a>";
        $Output .= "&nbsp;(";
        if ($item["clicktype"] == 1) {
            $Output .= "Any Slot, ";
        }
        if ($item["clicktype"] == 4) {
            $Output .= "Must Equip, ";
        }
        if ($item["clicktype"] == 5) {
            $Output .= "Any Slot/Can Equip, ";
        }
        $Output .= "Casting Time: ";
        if ($item["casttime"] > 0) {
            $casttime = sprintf("%.1f", $item["casttime"] / 1000);
            $Output .= $casttime;
        } else {
            $Output .= "Instant";
        }
        $Output .= ")";
        $Output .= " <i>(Level " . $item["clicklevel"] . ")</i>";
        $Output .= "<br>\n";
    }
    // Stats / HP / Mana / Endurance
    $Stats = "";
    //replaced block BEGIN 2/25/2014
    /*if($item[ "astr"] != 0)  $Stats .= " STR: "           .sign($item ["astr"]);
    	if($item[ "asta"] != 0)  $Stats .= " STA: "           .sign($item ["asta"]);
    	if($item[ "aagi"] != 0)  $Stats .= " AGI: "           .sign($item ["aagi"]);
    	if($item[ "adex"] != 0)  $Stats .= " DEX: "           .sign($item ["adex"]);
    	if($item[ "awis"] != 0)  $Stats .= " WIS: "           .sign($item ["awis"]);
    	if($item[ "aint"] != 0)  $Stats .= " INT: "           .sign($item ["aint"]);
    	if($item[ "acha"] != 0)  $Stats .= " CHA: "           .sign($item ["acha"]);
    	if($item[   "hp"] != 0)  $Stats .= " HP: "            .sign($item   ["hp"]);
    	if($item[ "mana"] != 0)  $Stats .= " MANA: "          .sign($item ["mana"]);
    	if($item["endur"] != 0)  $Stats .= " Endurance: "     .sign($item["endur"]);*/
    if ($item["astr"] != 0) {
        $Stats .= " STR: " . $item["astr"];
    }
    if ($item["heroic_str"] != 0) {
        $Stats .= " " . $item["heroic_str"];
    }
    if ($item["asta"] != 0) {
        $Stats .= " STA: " . $item["asta"];
    }
    if ($item["heroic_sta"] != 0) {
        $Stats .= " " . $item["heroic_sta"];
    }
    if ($item["aagi"] != 0) {
        $Stats .= " AGI: " . $item["aagi"];
    }
    if ($item["heroic_agi"] != 0) {
        $Stats .= " " . $item["heroic_agi"];
    }
    if ($item["adex"] != 0) {
        $Stats .= " DEX: " . $item["adex"];
    }
    if ($item["heroic_dex"] != 0) {
        $Stats .= " " . $item["heroic_dex"];
    }
    if ($item["awis"] != 0) {
        $Stats .= " WIS: " . $item["awis"];
    }
    if ($item["heroic_wis"] != 0) {
        $Stats .= " " . $item["heroic_wis"];
    }
    if ($item["aint"] != 0) {
        $Stats .= " INT: " . $item["aint"];
    }
    if ($item["heroic_int"] != 0) {
        $Stats .= " " . $item["heroic_int"];
    }
    if ($item["acha"] != 0) {
        $Stats .= " CHA: " . $item["acha"];
    }
    if ($item["heroic_cha"] != 0) {
        $Stats .= " " . $item["heroic_cha"];
    }
    //replace block END 2/25/2014
    if ($Stats != "") {
        $Output .= $tab . $Stats . "<br>\n";
    }
    //resists
    $Stats = "";
    //replaced block BEGIN 2/25/2014
    /*if($item[   "fr"] != 0)  $Stats .= " SV FIRE: "   .sign($item   ["fr"]);
    	if($item[   "dr"] != 0)  $Stats .= " SV DISEASE: ".sign($item   ["dr"]);
    	if($item[   "cr"] != 0)  $Stats .= " SV COLD: "   .sign($item   ["cr"]);
    	if($item[   "mr"] != 0)  $Stats .= " SV MAGIC: "  .sign($item   ["mr"]);
    	if($item[   "pr"] != 0)  $Stats .= " SV POISON: " .sign($item   ["pr"]);*/
    if ($item["fr"] != 0) {
        $Stats .= " Fire: " . $item["fr"];
    }
    if ($item["heroic_fr"] != 0) {
        $Stats .= " " . $item["heroic_fr"];
    }
    if ($item["dr"] != 0) {
        $Stats .= " Disease: " . $item["dr"];
    }
    if ($item["heroic_dr"] != 0) {
        $Stats .= " " . $item["heroic_dr"];
    }
    if ($item["cr"] != 0) {
        $Stats .= " Cold: " . $item["cr"];
    }
    if ($item["heroic_cr"] != 0) {
        $Stats .= " " . $item["heroic_cr"];
    }
    if ($item["mr"] != 0) {
        $Stats .= " Magic: " . $item["mr"];
    }
    if ($item["heroic_mr"] != 0) {
        $Stats .= " " . $item["heroic_mr"];
    }
    if ($item["pr"] != 0) {
        $Stats .= " Poison: " . $item["pr"];
    }
    if ($item["heroic_pr"] != 0) {
        $Stats .= " " . $item["heroic_pr"];
    }
    if ($item["hp"] != 0) {
        $Stats .= " HP: " . sign($item["hp"]);
    }
    if ($item["mana"] != 0) {
        $Stats .= " MANA: " . sign($item["mana"]);
    }
    if ($item["endur"] != 0) {
        $Stats .= " Endurance: " . sign($item["endur"]);
    }
    //replaced block END 2/25/2014
    if ($Stats != "") {
        $Output .= $tab . $Stats . "<br>\n";
    }
    // bonuses
    if ($item["haste"] > 0) {
        $Output .= $tab . "Haste: " . $item["haste"] . "%<br>\n";
    }
    if ($item["avoidance"] > 0) {
        $Output .= $tab . "Avoidance: " . sign($item["avoidance"]) . "<br>\n";
    }
    if ($item["attack"] > 0) {
        $Output .= $tab . "Attack: " . sign($item["attack"]) . "<br>\n";
    }
    if ($item["extradmgamt"] > 0) {
        $Output .= $tab . strtolower_ucfirst($dbskills[$item["extradmgskill"]]) . " DMG: " . sign($item["extradmgamt"]) . "<br>\n";
    }
    if ($item["damageshield"] > 0) {
        $Output .= $tab . "Damage Shield: " . sign($item["damageshield"]) . "<br>\n";
    }
    if ($item["dotshielding"] > 0) {
        $Output .= $tab . "Dot Shielding: " . sign($item["dotshielding"]) . "%<br>\n";
    }
    if ($item["manaregen"] > 0) {
        $Output .= $tab . "Mana Regeneration: " . sign($item["manaregen"]) . "<br>\n";
    }
    if ($item["shielding"] > 0) {
        $Output .= $tab . "Shielding: " . sign($item["shielding"]) . "%<br>\n";
    }
    if ($item["hpregen"] > 0) {
        $Output .= $tab . "Regeneration: " . sign($item["hpregen"]) . "<br>\n";
    }
    if ($item["combateffects"] > 0) {
        $Output .= $tab . "Combat Effects: " . sign($item["combateffects"]) . "<br>\n";
    }
    if ($item["accuracy"] > 0) {
        $Output .= $tab . "Accuracy: " . sign($item["accuracy"]) . "<br>\n";
    }
    if ($item["combatskill"] > 0) {
        $Output .= $tab . strtolower_ucfirst($dbskills[$item["combatskill"]]) . " DMG: " . sign($item["combatskilldmg"]) . "<br>\n";
    }
    if ($item["spellshield"] > 0) {
        $Output .= $tab . "Spell Shielding: " . sign($item["spellshield"]) . "%<br>\n";
    }
    if ($item["strikethrough"] > 0) {
        $Output .= $tab . "Strikethrough: " . sign($item["strikethrough"]) . "%<br>\n";
    }
    if ($item["stunresist"] > 0) {
        $Output .= $tab . "Stun Resist: " . sign($item["stunresist"]) . "%<br>\n";
    }
    // bard item ?
    if ($item["bardtype"] > 0) {
        $Output .= $tab . $dbbardskills[$item["bardtype"]] . ": " . $item["bardvalue"];
        $val = $item["bardvalue"] * 10 - 100;
        if ($val > 0) {
            $Output .= "<i> (" . sign($val) . "%)</i>";
        }
        $Output .= "<br>\n";
    }
    //required level
    if ($item["reqlevel"] > 0) {
        $Output .= $tab . "Required level of " . $item["reqlevel"] . ".<br>\n";
    }
    //recomended level
    if ($item["reclevel"] > 0) {
        $Output .= $tab . "Recommended level of " . $item["reclevel"] . ".<br>\n";
    }
    // Weight
    $weight = sprintf("%.1f", $item["weight"] / 10);
    $Output .= $tab . "WT: " . $weight . " ";
    // Item range
    if ($item["range"] > 0) {
        $Output .= $tab . "Range: " . $item["range"] . " ";
    }
    //size
    $Output .= $tab . "Size: " . strtoupper(getsize($item["size"])) . "<br>\n";
    //classes
    $Output .= $tab . "Class: " . getclasses($item["classes"]) . "<br>\n";
    //races
    $Output .= $tab . "Race: " . getraces($item["races"]) . "<br>\n";
    // Deity
    if ($item["deity"] > 0) {
        $Output .= $tab . "Deity: " . getdeities($item["deity"]) . "<br>\n";
    }
    // Augmentations
    for ($i = 1; $i <= 5; $i++) {
        if ($item["augslot" . $i . "type"] > 0) {
            $Output .= $tab . "Slot " . $i . ": Type " . $item["augslot" . $i . "type"] . "<br>\n";
        }
    }
    // scroll
    if ($item["scrolleffect"] > 0 and $item["scrolleffect"] < 65535) {
        $Output .= $tab . "Effect: <a href='http://mqemulator.net/spell.php?id=" . $item["scrolleffect"] . "'>" . GetFieldByQuery("name", "SELECT name FROM {$tbspells} WHERE id=" . $item["scrolleffect"]) . "</a>";
        $Output .= "<br>\n";
    }
    return $Output;
}
Пример #11
0
include './includes/config.php';
include $includes_dir . 'mysql.php';
// Pagination //
$page = isset($_GET['page']) ? addslashes($_GET['page']) : 0;
$targetpage = "npcfactions.php";
// File name  (the name of this file)
$tbl_name = $tbfactionlist;
// Table name
if ($page) {
    $start = ($page - 1) * $MaxResultsPerPage;
    //first item to display on this page
} else {
    $start = 0;
    //if no page var is given, set start to 0
}
$total_pages = GetFieldByQuery("num", "SELECT COUNT(*) as num FROM {$tbl_name}");
// Pagination //
$Title = "Bestiary by Factions";
include $includes_dir . 'headers.php';
include $includes_dir . 'functions.php';
echo '<br><center><table width="50%" border ="1" style="background-color: ; filter:alpha(opacity=80); -moz-opacity:0.8; opacity: 0.8;"><td align="left">';
echo "<p class=menuh>Factions:<p>";
$query = "SELECT id,name from {$tbfactionlist} order by name ASC";
// Limits for pagination
$query .= " LIMIT {$start}, {$MaxResultsPerPage}";
$result = mysql_query($query) or message_die('item.php', 'MYSQL_QUERY', $query, mysql_error());
$RowClass = "lr";
while ($row = mysql_fetch_array($result)) {
    echo '<tr class="' . $RowClass . '"><td>';
    echo "<li><a href=faction.php?id=" . $row["id"] . ">" . $row["name"] . "</a>";
    echo '</td></tr>';
Пример #12
0
<?php

include './includes/constantes.php';
include './includes/config.php';
include $includes_dir . 'mysql.php';
$name = isset($_GET['name']) ? addslashes($_GET['name']) : '';
$order = isset($_GET['order']) ? addslashes($_GET["order"]) : 'name';
$mode = isset($_GET['mode']) ? addslashes($_GET["mode"]) : 'npcs';
if ($DisplayNamedNPCsInfo == FALSE) {
    header("Location: index.php");
    exit;
}
$Title = GetFieldByQuery("long_name", "SELECT long_name FROM {$tbzones} WHERE short_name='{$name}'") . " ({$name})";
include $includes_dir . 'headers.php';
include $includes_dir . 'functions.php';
if (!isset($name)) {
    print "<script>document.location=\"zones.php\";</script>";
}
$ZoneDebug = FALSE;
// this is new in 0.5.3 but undocumented, it is for world builders
if ($ZoneDebug == TRUE) {
    print "<p>ZoneDebug at TRUE ! Edit source code and set it to false.<p>";
}
print "<table border=0 width=100%><tr valign=top><td width=100%>";
$query = "SELECT {$tbzones}.*\n        FROM {$tbzones}\n        WHERE {$tbzones}.short_name='{$name}'";
$result = mysql_query($query) or message_die('zones.php', 'MYSQL_QUERY', $query, mysql_error());
$zone = mysql_fetch_array($result);
print "<center><table border=0 width=0%><tr valign=top><td>";
print "<p><b>Succor point : </b>" . floor($zone["safe_x"]) . " / " . floor($zone["safe_y"]) . " / " . floor($zone["safe_z"]);
if ($zone["minium_level"] > 0) {
    print "<br><b>Minimum level : </b>" . floor($zone["minium_level"]);
Пример #13
0
}
if (!isset($iclass)) {
    $iclass = "c";
}
if (!isset($ilevel)) {
    $ilevel = "l";
}
if (!isset($ifaction)) {
    $ifaction = "5";
}
if (!isset($irace)) {
    $irace = '\\&lt\\;your\\&nbsp\\;race\\&gt\\;';
}
$Title = "Quest(s) for :: " . str_replace('_', ' ', $npc);
if ($zone != "") {
    $myzone = GetFieldByQuery("long_name", "SELECT long_name FROM zone WHERE short_name like '" . addslashes($zone) . "'");
}
$Title .= "<br><a href=zones.php?aZone={$zone}>{$myzone}</a>";
include '../includes/headers.php';
if ($AlwaysBuildQuest == TRUE) {
    print "<center><table border=0 width=0%>";
    print "<form method=POST action={$PHP_SELF}>";
    print "<input type=hidden value=\"{$zone}\" name=zone>";
    print "<input type=hidden value=\"{$npc}\" name=npc>";
    print "<tr><td nowrap><b>Run the quest as a </b></td>";
    print "<td><select name=iclass class=form>";
    print "<option value=\"c\"" . ($c == "" ? " selected" : "") . ">-</option>\n";
    foreach ($dbclasses_names as $c) {
        print "<option value={$c}" . ($c == $iclass ? " selected" : "") . ">{$c}</option>\n";
    }
    print "</select></td><td>";