public function GetItemSetBonusInfo($itemsetdata)
 {
     if (in_array(WoW_Locale::GetLocale(), array('ru', 'en'))) {
         $tmp_locale = WoW_Locale::GetLocale();
     } else {
         $tmp_locale = 'en';
     }
     $itemSetBonuses = array();
     for ($i = 1; $i < 9; $i++) {
         if ($itemsetdata['bonus' . $i] > 0) {
             $threshold = $itemsetdata['threshold' . $i];
             $spell_tmp = array();
             $spell_tmp = DB::WoW()->selectRow("SELECT * FROM `DBPREFIX_spell` WHERE `id`=%d", $itemsetdata['bonus' . $i]);
             if (!isset($spell_tmp['Description_' . $tmp_locale]) || empty($spell_tmp['Description_' . $tmp_locale])) {
                 // try to find en_gb locale
                 if (isset($spell_tmp['Description_en']) && !empty($spell_tmp['Description_en'])) {
                     $tmp_locale = 'en';
                 } else {
                     continue;
                 }
             }
             $itemSetBonuses[$threshold]['desc'] = self::SpellReplace($spell_tmp, WoW_Utils::ValidateSpellText($spell_tmp['Description_' . $tmp_locale]));
             $itemSetBonuses[$threshold]['desc'] = str_replace('&quot;', '"', $itemSetBonuses[$threshold]['desc']);
             $itemSetBonuses[$threshold]['threshold'] = $threshold;
         }
     }
     sort($itemSetBonuses);
     // Correct display itemset bonuses
     return $itemSetBonuses;
 }
Пример #2
0
                    %s
                    <li class="indent-top"> </li>
                    %s
                </ul>
            </li>', $itemsetName, $equippedItemsCount, $pieces_text, $setbonus_text);
}
// Spells
for ($i = 0; $i < 5; $i++) {
    if ($proto->Spells[$i]['spellid'] > 0) {
        $spell_tmp = DB::WoW()->selectRow("SELECT * FROM `DBPREFIX_spell` WHERE `id` = %d", $proto->Spells[$i]['spellid']);
        if (in_array(WoW_Locale::GetLocale(), array('ru', 'en'))) {
            $tmp_locale = WoW_Locale::GetLocale();
        } else {
            $tmp_locale = 'en';
        }
        $spellInfo = WoW_Items::SpellReplace($spell_tmp, WoW_Utils::ValidateSpellText($spell_tmp['Description_' . $tmp_locale]));
        if ($spellInfo) {
            echo sprintf('<li class="color-q2">%s</li>', sprintf(WoW_Locale::GetString('template_item_spell_trigger_' . $proto->Spells[$i]['trigger']), $spellInfo));
        }
    }
}
// Descrition
if ($proto->description) {
    echo sprintf('<li class="color-tooltip-yellow">%s</li>', $proto->description);
}
if ($proto->SellPrice > 0) {
    $sell_price = WoW_Utils::GetMoneyFormat($proto->SellPrice);
    echo sprintf('<li>%s', WoW_Locale::GetString('template_item_sell_price'));
    $sMoney = array('gold', 'silver', 'copper');
    foreach ($sMoney as $money) {
        if ($sell_price[$money] > 0) {