示例#1
0
 public static function GetItemInfo($ItemID)
 {
     global $FCCore;
     $Statement = Items::$WConnection->prepare('
         SELECT
             it.*,
             LOWER(fi.iconname) as icon
         FROM
             item_template it
         LEFT JOIN ' . $FCCore['Database']['database'] . '.freedomcore_icons fi ON
             it.displayid = fi.id
         WHERE
             entry = :itemid
     ');
     $Statement->bindParam(':itemid', $ItemID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     if (empty($Result) || $ItemID != $Result['entry']) {
         return false;
     } else {
         $Result['subclass'] = Items::ItemSubClass($Result['class'], $Result['subclass']);
         $Result['class'] = Items::ItemClass($Result['class']);
         $Result['BuyPrice'] = Text::MoneyToCoins($Result['BuyPrice']);
         $Result['SellPrice'] = Text::MoneyToCoins($Result['SellPrice']);
         $Result['bond_translation'] = Items::BondTranslation($Result['bonding']);
         $Result['it_translation'] = Items::InventoryTypeTranslation($Result['InventoryType']);
         if ($Result['RequiredSkill'] != 0) {
             $Result['SkillData'] = Items::GetSkillReqs($Result['RequiredSkill'], $Result['RequiredSkillRank']);
         }
         $StatsCount = 0;
         for ($i = 1; $i <= 10; $i++) {
             if ($Result['stat_type' . $i] != 0) {
                 $StatsCount++;
             }
         }
         if ($StatsCount > 0) {
             for ($i = 1; $i <= $StatsCount; $i++) {
                 $Result['stat_translation' . $i] = Items::StatTranslation($Result['stat_type' . $i]);
             }
         }
         for ($i = 1; $i <= 3; $i++) {
             if ($Result['socketColor_' . $i] != 0) {
                 $Result['socket' . $i] = Items::SocketDescription($Result['socketColor_' . $i]);
             }
         }
         for ($i = 1; $i <= 5; $i++) {
             if ($Result['spellid_' . $i] != 0 && $Result['spellid_' . $i] != -1) {
                 $Result['spt_translation' . $i] = Items::SpellTrigger($Result['spelltrigger_' . $i]);
                 $Result['spell_data' . $i] = Spells::SpellInfo($Result['spellid_' . $i]);
                 if (strstr($Result['name'], $Result['spell_data' . $i]['Name'])) {
                     $Result['spell_data' . $i]['SearchForCreature'] = Items::FindCreatureBySpell($Result['spellid_' . $i]);
                 }
             }
         }
         if ($Result['socketBonus'] != 0) {
             $Result['socketBonusDescription'] = Items::SocketBonus($Result['socketBonus']);
         }
         $Result['itemsetinfo'] = Items::GetItemSetInfo($ItemID);
         if ($Result['GemProperties'] != 0) {
             $Result['gem_bonus'] = Items::getGemBonus($Result['GemProperties']);
         }
         return $Result;
     }
 }
 private static function GetItemArrayData($ItemArray)
 {
     global $FCCore;
     $SQL = 'SELECT
             it.entry,
             it.class,
             it.subclass,
             it.name,
             it.displayid,
             it.Quality,
             it.BuyPrice,
             it.SellPrice,
             it.bonding,
             it.RequiredLevel,
             it.InventoryType,
             LOWER(fi.iconname) as icon
         FROM
             item_template it
         LEFT JOIN ' . $FCCore['Database']['database'] . '.freedomcore_icons fi ON
             it.displayid = fi.id
         WHERE
             entry IN (' . $ItemArray . ')';
     $Statement = Zones::$WConnection->prepare($SQL);
     $Statement->execute();
     $Result = $Statement->fetchAll(PDO::FETCH_ASSOC);
     $ArrayIndex = 0;
     foreach ($Result as $Item) {
         $Result[$ArrayIndex]['subclass'] = Items::ItemSubClass($Item['class'], $Item['subclass']);
         $Result[$ArrayIndex]['class'] = Items::ItemClass($Item['class']);
         $Result[$ArrayIndex]['BuyPrice'] = Text::MoneyToCoins($Item['BuyPrice']);
         $Result[$ArrayIndex]['SellPrice'] = Text::MoneyToCoins($Item['SellPrice']);
         $Result[$ArrayIndex]['bond_translation'] = Items::BondTranslation($Item['bonding']);
         $Result[$ArrayIndex]['it_translation'] = Items::InventoryTypeTranslation($Item['InventoryType']);
         $ArrayIndex++;
     }
     return $Result;
 }