function getSpellCostText($spell)
{
    // Заполняем стоимость заклинания
    $powerType = getPowerTypeName($spell['powerType']);
    $powerCost = "";
    if ($spell['AttributesEx'] & 2) {
        $powerCost = "Uses 100% " . $powerType;
    } else {
        if ($spell['ManaCostPercentage']) {
            $powerCost = $spell['ManaCostPercentage'] . "% of base";
        } else {
            if ($spell['manaCost']) {
                $powerCost = $spell['manaCost'];
            }
        }
        if ($powerCost) {
            $powerCost .= " " . $powerType;
            if ($spell['manaPerSecond']) {
                $powerCost .= " plus " . $spell['manaPerSecond'] . " per sec";
            }
        }
    }
    return $powerCost;
}
function showEffectInfo($spell, $effect, $eff_id)
{
    global $lang;
    $misc = $spell['EffectMiscValue_' . $effect];
    switch ($eff_id) {
        // школа
        case 2:
            echo ' (' . getSpellSchool($spell['SchoolMask']) . ')';
            break;
            // Misc - тип энергии
        // Misc - тип энергии
        case 8:
            // SPELL_EFFECT_POWER_DRAIN
        // SPELL_EFFECT_POWER_DRAIN
        case 30:
            // SPELL_EFFECT_ENERGIZE
        // SPELL_EFFECT_ENERGIZE
        case 62:
            echo ' (' . getPowerTypeName($misc) . ')';
            break;
        case 16:
            // SPELL_EFFECT_QUEST_COMPLETE
        // SPELL_EFFECT_QUEST_COMPLETE
        case 147:
            // SPELL_EFFECT_QUEST_FAIL
        // SPELL_EFFECT_QUEST_FAIL
        case 139:
            echo ' (' . getQuestName($misc) . ')';
            break;
        case 28:
            // SPELL_EFFECT_SUMMON
        // SPELL_EFFECT_SUMMON
        case 56:
            // SPELL_EFFECT_SUMMON_PET
        // SPELL_EFFECT_SUMMON_PET
        case 90:
            // Kill Credit
        // Kill Credit
        case 134:
            echo ' (' . getCreatureName($misc) . ')';
            break;
        case 50:
            // SPELL_EFFECT_SUMMON_OBJECT
        // SPELL_EFFECT_SUMMON_OBJECT
        case 76:
            // SPELL_EFFECT_SUMMON_OBJECT_WILD
        // SPELL_EFFECT_SUMMON_OBJECT_WILD
        case 104:
        case 105:
        case 106:
        case 107:
            echo ' (' . getGameobjectName($misc) . ')';
            break;
        case 53:
            // SPELL_EFFECT_ENCHANT_ITEM
        // SPELL_EFFECT_ENCHANT_ITEM
        case 54:
            // SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
        // SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
        case 92:
            echo ' (' . getEnchantmentDesc($misc) . ')';
            break;
        case 39:
            echo ' (' . getLaungageName($misc) . ')';
            break;
        case 44:
            // SPELL_EFFECT_SKILL_STEP
        // SPELL_EFFECT_SKILL_STEP
        case 118:
            echo ' (' . getSkillName($misc) . ')';
            break;
            // Misc - тип рейтинга
        // Misc - тип рейтинга
        case 189:
            echo ' (' . getRatingList($misc) . ')';
            break;
            // Misc - тип диспелла
        // Misc - тип диспелла
        case 38:
            // SPELL_EFFECT_DISPEL
        // SPELL_EFFECT_DISPEL
        case 126:
            echo ' (' . getDispelName(abs($misc)) . ')';
            break;
            // Misc - тип механики
        // Misc - тип механики
        case 108:
            echo ' (' . getMechanicName($misc) . ')';
            break;
        case 94:
            // SPELL_EFFECT_SELF_RESURRECT
        // SPELL_EFFECT_SELF_RESURRECT
        case 113:
            echo ' (Restore ' . $misc . ' power)';
            break;
        case 103:
            echo ' (' . getFactionName($misc) . ')';
            break;
        case 33:
            echo ' (' . getLockType($misc, 2) . ')';
            break;
        case 146:
            echo ' (' . getRuneName($misc) . ')';
            break;
        case 74:
            echo ' (' . getGlyphName($misc) . ')';
            break;
        default:
            if ($misc) {
                echo ' (' . $misc . ')';
            }
            break;
    }
    if ($effect == 1) {
        // Spell target position on map
        if ($t = getSpellTargetPosition($spell['id'])) {
            echo '<a style="float: right;" href="?map&point=' . $t['target_map'] . ':' . $t['target_position_x'] . ':' . $t['target_position_y'] . ':' . $t['target_position_z'] . '">' . $lang['map'] . '</a>';
        }
        // Spell target
        if ($s = getSpellScriptTarget($spell['id'])) {
            foreach ($s as $s1) {
                if ($s1['type'] == 0) {
                    echo '<br><a style="float: right;" href="?object=' . $s1['targetEntry'] . '">' . getGameobjectName($s1['targetEntry'], 0) . '</a>';
                } else {
                    if ($s1['type'] == 1) {
                        echo '<br><a style="float: right;" href="?npc=' . $s1['targetEntry'] . '">' . getCreatureName($s1['targetEntry'], 0) . '</a>';
                    } else {
                        if ($s1['type'] == 2) {
                            echo '<br><a style="float: right;" href="?npc=' . $s1['targetEntry'] . '">' . getCreatureName($s1['targetEntry'], 0) . '</a>';
                        }
                    }
                }
            }
        }
    }
}