コード例 #1
0
function createSpellDetails($spell)
{
    global $lang;
    echo '<table class=details width=600><tbody>';
    echo '<tr><td colspan=4 class=head>' . $lang['detail_info'] . '</td></tr>';
    echo '<tr><th>Name</th><td colspan=2>' . $spell['SpellName'] . '</td><td align=right>' . $spell['Rank'] . '</td></tr>';
    if ($spell['Description']) {
        echo '<tr><th width=60>Info:</th><td colspan=3>' . getSpellDesc($spell) . '</td></tr>';
    }
    if ($spell['ToolTip']) {
        echo '<tr><th>Buff:</th><td colspan=3>' . getSpellBuff($spell) . '</td></tr>';
    }
    // Стоимость и длительность
    $cost = getSpellCostText($spell);
    $duration = getSpellDurationText($spell);
    if ($cost or $duration) {
        echo '<tr><th>Cost</th><td>' . ($cost ? $cost : 'No Cost') . '</td><th>Duration</th><td>' . $duration . '</td></tr>';
    }
    echo '<tr>';
    echo '<th width=13%>Level</th>';
    echo '<td width=37%>Base ' . $spell['baseLevel'] . ', Max ' . $spell['maxLevel'] . ', Spell ' . $spell['spellLevel'] . '</td>';
    echo '<th width=20%>Range</th>';
    echo '<td width=30%>' . getRangeText($spell['rangeIndex']) . '</td>';
    echo '</tr>';
    // Время квста и школа (выводятся всегда)
    echo '<tr><th>Cast time</th><td>' . getCastTimeText($spell) . '</td><th>School</th><td>' . getSpellSchool($spell['SchoolMask']) . '</td></tr>';
    $skillAbility = getSkillLineAbility($spell['id']);
    if ($skillAbility or $spell['Category']) {
        echo '<tr>';
        echo '<th>Skill</th>';
        if ($skillAbility) {
            echo '<td>' . getSkillName($skillAbility['skillId']) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Category</th>';
        if ($spell['Category']) {
            echo '<td>' . getCategoryName($spell['Category']) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод механики и диспелла
    if ($spell['Mechanic'] or $spell['Dispel']) {
        echo '<tr>';
        echo '<th>Mechanic</th><td>' . getMechanicName($spell['Mechanic']) . '</td>';
        echo '<th>Dispel type</th><td>' . getDispelName($spell['Dispel']) . '</td>';
        echo '</tr>';
    }
    // Вывод кулдаунов
    $cooldown = getSpellCooldown($spell);
    if ($cooldown or $spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) {
        echo '<tr>';
        echo '<th>Cooldown</th>';
        if ($cooldown) {
            echo '<td>' . getTimeText($cooldown / 1000) . '</td>';
        } else {
            echo '<td>No cooldown</td>';
        }
        echo '<th>Global cooldown</th>';
        if ($spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) {
            echo '<td>';
            echo 'Affected';
            if ($spell['StartRecoveryTime']) {
                echo ', ' . getTimeText($spell['StartRecoveryTime'] / 1000);
            } else {
                echo ', Not start';
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований форм
    $stances = $spell['Stances'];
    $stancesNot = $spell['StancesNot'];
    if ($stances or $stancesNot) {
        echo '<tr>';
        echo '<th>Req form</th>';
        if ($stances) {
            echo '<td>' . getAllowableForm($stances) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Not in form</th>';
        if ($stancesNot) {
            echo '<td>' . getAllowableForm($stancesNot) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований одетого снаряжения
    $itemClass = $spell['EquippedItemClass'];
    $itemSubClass = $spell['EquippedItemSubClassMask'];
    $inventoryTypeMask = $spell['EquippedItemInventoryTypeMask'];
    if ($itemClass >= 0 or $inventoryTypeMask) {
        echo '<tr>';
        echo '<th>Req item</th>';
        if ($itemClass >= 0) {
            echo '<td>';
            if ($itemSubClass) {
                echo getClassName($itemClass, 0) . ': ' . getSubclassList($itemClass, $itemSubClass);
            } else {
                echo getClassName($itemClass);
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Inv type</th>';
        if ($inventoryTypeMask) {
            echo '<td>' . getInventoryTypeList($inventoryTypeMask) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод тотм категорий и спеллфокуса
    $totem1 = $spell['TotemCategory_1'];
    $totem2 = $spell['TotemCategory_2'];
    $focus = $spell['RequiresSpellFocus'];
    if ($totem1 or $totem2 or $focus) {
        echo '<tr>';
        echo '<th>Tools</th>';
        if ($totem1 or $totem2) {
            echo '<td>';
            if ($totem1) {
                echo getTotemCategory($totem1);
            }
            if ($totem2) {
                echo ', ' . getTotemCategory($totem2);
            }
            echo '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Spell Focus</th>';
        if ($focus) {
            echo '<td>' . getSpellFocusName($focus, 2) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    $area = $spell['AreaGroupId'];
    if ($area) {
        echo '<tr>';
        echo '<th>Area</th>';
        if ($area) {
            echo '<td>' . $area . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    // Вывод требований целей
    $targets = $spell['Targets'];
    $targetCreature = $spell['TargetCreatureType'];
    if ($targets or $targetCreature) {
        echo '<tr>';
        echo '<th>Targets</th>';
        if ($targets) {
            echo '<td>' . getTargetsList($targets) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '<th>Creature type</th>';
        if ($targetCreature) {
            echo '<td>' . getCreatureTypeList($targetCreature) . '</td>';
        } else {
            echo '<td>n/a</td>';
        }
        echo '</tr>';
    }
    if ($spell['Reagent_1'] or $spell['Reagent_2'] or $spell['Reagent_3'] or $spell['Reagent_4'] or $spell['Reagent_5'] or $spell['Reagent_6'] or $spell['Reagent_7'] or $spell['Reagent_8']) {
        echo '<tr>';
        echo '<th>Reagents</th>';
        echo '<td colspan=3>';
        r_spellReagents($spell);
        echo '</td>';
        echo '</tr>';
    }
    // Вывод эффектов
    showEffectData($spell, 1);
    showEffectData($spell, 2);
    showEffectData($spell, 3);
    echo '</tbody></table>';
}
コード例 #2
0
function getSkillNameForSpell($spellId, $as_ref = 1)
{
    if ($SkillLineAbility = getSkillLineAbility($spellId)) {
        return getSkillName($SkillLineAbility['skillId'], $as_ref);
    }
    return "";
}