public static function GetCharactersDeletedItems($CharacterGUID)
 {
     $Statement = parent::$CConnection->prepare('SELECT * FROM item_restoration WHERE character_guid = :guid');
     $Statement->bindParam(':guid', $CharacterGUID);
     $Statement->execute();
     if (Database::IsEmpty($Statement)) {
         return false;
     } else {
         $Index = 0;
         $Result = $Statement->fetchAll(PDO::FETCH_ASSOC);
         foreach ($Result as $Item) {
             $Result[$Index]['price'] = Text::MoneyToCoins($Item['item_price']);
             $Result[$Index]['data'] = parent::GetItemInfo($Item['item_id']);
             $Index++;
         }
         return $Result;
     }
 }
示例#2
0
 public static function QuestInfo($QuestID)
 {
     global $FCCore;
     $Statement = Items::$WConnection->prepare('
       SELECT
         qt.*,
         ff.name_loc0 as factionname
       FROM
         quest_template qt, ' . $FCCore['Database']['database'] . '.freedomcore_factions ff
       WHERE
         qt.RewardFactionId1 = ff.factionID
       AND
         id = :questid
     ');
     $Statement->bindParam(':questid', $QuestID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     for ($i = 1; $i <= 4; $i++) {
         if ($Result['RewardItem' . $i] != 0) {
             $Result['RewardItem' . $i] = Items::GetItemInfo($Result['RewardItem' . $i]);
         }
     }
     $Result['XPReward'] = Items::QuestXP($Result['QuestLevel'], $Result['RewardXPId']);
     $Result['MoneyReward'] = Text::MoneyToCoins($Result['RewardOrRequiredMoney']);
     return $Result;
 }
示例#3
0
                         $ItemName = 'creature' . $Item['spell_data' . $i]['SearchForCreature'] . '.jpg';
                         if (!File::Exists($StorageDir . $ItemName)) {
                             File::Download('http://media.blizzard.com/wow/renders/npcs/rotate/creature' . $Item['spell_data' . $i]['SearchForCreature'] . '.jpg', $StorageDir . $ItemName);
                         }
                     }
                 }
             }
         }
         $Smarty->assign('Item', $Item);
         $Smarty->assign('ItemRelation', $ItemRelation);
         $Smarty->assign('Page', Page::Info('admin', array('bodycss' => 'item-' . $Item['entry'], 'pagetitle' => $Item['name'] . ' - ' . $Smarty->GetConfigVars('Menu_Game') . ' - ')));
         $Smarty->display('pages/item_info');
     }
 } else {
     if ($_REQUEST['lastcategory'] == 'tooltip') {
         $Item = Items::GetItemInfo($_REQUEST['subcategory']);
         if ($Item) {
             $Smarty->assign('Item', $Item);
             $Smarty->display('blocks/item_tooltip');
         } else {
             echo "Not Found!";
         }
     } elseif (strstr($_REQUEST['lastcategory'], '.frag')) {
         $Smarty->assign('RandomCommentCode', md5(uniqid(rand(), true)));
         $Fragment = str_replace('.frag', '', $_REQUEST['lastcategory']);
         $Smarty->assign('SelectedItem', $_REQUEST['subcategory']);
         $ItemRelation = Items::GetItemRelatedInfo($_REQUEST['subcategory']);
         $Smarty->assign('Relations', $ItemRelation[$Fragment]);
         $Smarty->display('fragments/' . $Fragment);
     } else {
         header('Location: /');
 private static function GetEventToys($String)
 {
     $ToysArray = [];
     if (Text::IsNull($String)) {
         return false;
     } else {
         $Exploded = explode(',', $String);
         foreach ($Exploded as $Entry) {
             $GetData = Items::GetItemInfo($Entry);
             if ($GetData != false) {
                 $ToysArray[] = $GetData;
             }
         }
     }
     return $ToysArray;
 }
示例#5
0
 /**
  * Returns list of items that stored in guild bank
  * @category Guilds class
  * @example Guilds::BuildGuildBankItemList()
  * @return array
  **/
 public function BuildGuildBankItemList()
 {
     if (!$this->guildId) {
         $this->Log()->writeError('%s : guildId not defined', __METHOD__);
         return false;
     }
     $items_list = $this->cDB->select("SELECT `item_entry` AS `id`, `item_guid` AS `seed`, `SlotId` AS `slot`, `TabId` AS `bag` FROM `guild_bank_item` WHERE `guildid`=?", $this->guildId);
     $count_items = count($items_list);
     for ($i = 0; $i < $count_items; $i++) {
         $tmp_durability = Items::GetItemDurabilityByItemGuid($items_list[$i]['seed']);
         $items_list[$i]['durability'] = $tmp_durability['current'];
         $items_list[$i]['maxDurability'] = $tmp_durability['max'];
         unset($tmp_durability);
         $items_list[$i]['icon'] = Items::getItemIcon($items_list[$i]['id']);
         $items_list[$i]['name'] = Items::getItemName($items_list[$i]['id']);
         $items_list[$i]['qi'] = Items::GetItemInfo($items_list[$i]['id'], 'quality');
         $items_list[$i]['quantity'] = Items::GetItemDataField(ITEM_FIELD_STACK_COUNT, 0, 0, $items_list[$i]['seed']);
         $items_list[$i]['randomPropertiesId'] = 0;
         $tmp_classinfo = Items::GetItemSubTypeInfo($items_list[$i]['id']);
         $items_list[$i]['subtype'] = '';
         $items_list[$i]['subtypeLoc'] = $tmp_classinfo['subclass_name'];
         $items_list[$i]['type'] = $tmp_classinfo['key'];
         $items_list[$i]['slot']++;
     }
     return $items_list;
 }
 public static function GetLearnedRecipesForProfession($ProfessionID, $CharacterGUID)
 {
     global $FCCore;
     $Statement = Characters::$CharConnection->prepare('
     SELECT
         cs.spell, fsla.skillID, fsla.req_skill_value, fsla.max_value, fsla.min_value, fs.reagent1, fs.reagent2, fs.reagent3, fs.reagent4, fs.reagent5, fs.reagent6, fs.reagent7, fs.reagent8, fs.reagentcount1, fs.reagentcount2, fs.reagentcount3, fs.reagentcount4, fs.reagentcount5, fs.reagentcount6, fs.reagentcount7, fs.reagentcount8, fs.effect1itemtype, fs.spellname_loc0 as recipe_name, it.Quality as effect1itemquality
     FROM
         character_spell cs
     LEFT JOIN ' . $FCCore['Database']['database'] . '.freedomcore_skill_line_ability fsla ON
         fsla.spellID = cs.spell
     LEFT JOIN ' . $FCCore['Database']['database'] . '.freedomcore_spell fs ON
         fsla.spellID = fs.spellID
     LEFT JOIN ' . $FCCore['WorldDB']['database'] . '.item_template it ON
         fs.effect1itemtype = it.entry
     WHERE
             fsla.skillID = :profid
         AND
             cs.guid = :charguid
     ORDER BY fsla.req_skill_value DESC;
     ');
     $Statement->bindParam(':charguid', $CharacterGUID);
     $Statement->bindParam(':profid', $ProfessionID);
     $Statement->execute();
     $Result = $Statement->fetchAll(PDO::FETCH_ASSOC);
     $Index = 0;
     foreach ($Result as $Recipe) {
         for ($i = 1; $i < 9; $i++) {
             if ($Recipe['reagent' . $i] != 0) {
                 $ItemInfo = Items::GetItemInfo($Recipe['reagent' . $i]);
                 $Result[$Index]['reagent' . $i . '_name'] = $ItemInfo['name'];
                 $Result[$Index]['reagent' . $i . '_icon'] = $ItemInfo['icon'];
             }
         }
         if ($Recipe['effect1itemtype'] != 0) {
             $ItemInfo = Items::GetItemInfo($Recipe['effect1itemtype']);
             $Result[$Index]['resultingitem_name'] = $ItemInfo['name'];
             $Result[$Index]['resultingitem_icon'] = $ItemInfo['icon'];
         }
         $Index++;
     }
     return $Result;
 }
示例#7
0
 /**
  * Returns guild bank items
  * @category Guilds class
  * @category Guilds class
  * @access   public
  * @return   array
  **/
 public function BuildGuildBankItemList()
 {
     if (!$this->guildId) {
         Armory::Log()->writeError('%s : guildId not defined', __METHOD__);
         return false;
     }
     $items_list = Armory::$cDB->select("SELECT `item_entry` AS `id`, `item_guid` AS `seed`, `SlotId` AS `slot`, `TabId` AS `bag` FROM `guild_bank_item` WHERE `guildid`=%d", $this->guildId);
     $count_items = count($items_list);
     for ($i = 0; $i < $count_items; $i++) {
         $item_data = Armory::$wDB->selectRow("SELECT `RandomProperty`, `RandomSuffix` FROM `item_template` WHERE `entry` = %d LIMIT 1", $items_list[$i]['id']);
         $tmp_durability = Items::GetItemDurabilityByItemGuid($items_list[$i]['seed'], $this->m_server);
         $items_list[$i]['durability'] = (int) $tmp_durability['current'];
         $items_list[$i]['maxDurability'] = (int) $tmp_durability['max'];
         $items_list[$i]['icon'] = Items::GetItemIcon($items_list[$i]['id']);
         $items_list[$i]['name'] = Items::GetItemName($items_list[$i]['id']);
         $items_list[$i]['qi'] = Items::GetItemInfo($items_list[$i]['id'], 'quality');
         if ($this->m_server == SERVER_MANGOS) {
             $items_list[$i]['quantity'] = Items::GetItemDataField(ITEM_FIELD_STACK_COUNT, 0, 0, $items_list[$i]['seed']);
         } elseif ($this->m_server == SERVER_TRINITY) {
             $items_list[$i]['quantity'] = Armory::$cDB->selectCell("SELECT `count` FROM `item_instance` WHERE `guid`=%d", $items_list[$i]['seed']);
         }
         //TODO: Find correct random property/suffix for items in guild vault.
         $items_list[$i]['randomPropertiesId'] = Items::GetRandomPropertiesData($items_list[$i]['id'], 0, $items_list[$i]['seed'], true, $this->m_server, null, $item_data);
         $tmp_classinfo = Items::GetItemSubTypeInfo($items_list[$i]['id']);
         $items_list[$i]['subtype'] = null;
         $items_list[$i]['subtypeLoc'] = $tmp_classinfo['subclass_name'];
         $items_list[$i]['type'] = $tmp_classinfo['key'];
         $items_list[$i]['slot']++;
     }
     return $items_list;
 }
示例#8
0
 /**
  * Returns guild bank logs
  * @category Guilds class
  * @category Guilds class
  * @access   public
  * @return   array
  **/
 public function BuildGuildBankLogList()
 {
     if (!$this->guildId) {
         Armory::Log()->writeError('%s : guildId not defined', __METHOD__);
         return false;
     }
     $log_list = Armory::$cDB->select("SELECT `LogGuid` AS `logId`, `TabId` AS `obag`, `EventType` AS `type`,\n\t\t`DestTabId` AS `dbag`, (SELECT `name` FROM `characters` WHERE `guid`=`PlayerGuid`) AS `player`,\t\n\t\t(SELECT `guild_rank`.`rname` FROM `guild_rank` WHERE `guildid`=%d AND `rid`=`guild_member`.`rank`) AS `rname`,\n\t\t`guild_member`.`rank`, `ItemOrMoney` AS `entry`, `ItemStackCount` AS `quantity`, `TimeStamp` AS `ts`\n\t\tFROM `guild_bank_eventlog` AS `guild_bank_eventlog`\n\t\tLEFT JOIN `guild_member` AS `guild_member` ON `guild_member`.`guid`=`guild_bank_eventlog`.`PlayerGuid` AND `guild_member`.`guildid`=%d\n\t\tWHERE `guild_bank_eventlog`.`guildid`=%d ORDER BY `ts` DESC LIMIT 500;", $this->guildId, $this->guildId, $this->guildId);
     $count_logs = count($log_list);
     for ($i = 0; $i < $count_logs; $i++) {
         $log_list[$i]['ts'] = date('Y-m-d H:i:s', $log_list[$i]['ts']);
         switch ($log_list[$i]['type']) {
             case 1:
                 //deposit
                 $log_list[$i]['item'] = 1;
                 $log_list[$i]['dbag'] = $log_list[$i]['obag'];
                 $log_list[$i]['obag'] = '';
                 break;
             case 2:
                 //withdraw
                 $log_list[$i]['item'] = 1;
                 $log_list[$i]['dbag'] = '';
                 break;
             case 3:
                 //move
             //move
             case 7:
                 //move
                 $log_list[$i]['item'] = 1;
                 break;
             case 4:
             case 5:
             case 6:
                 //repair
             //repair
             case 8:
             case 9:
                 //buytab
             //buytab
             default:
                 $log_list[$i]['item'] = 0;
                 $log_list[$i]['dbag'] = '';
                 $log_list[$i]['obag'] = '';
                 $log_list[$i]['money'] = $log_list[$i]['entry'];
                 break;
         }
         if ($log_list[$i]['item']) {
             $log_list[$i]['icon'] = Items::GetItemIcon($log_list[$i]['entry']);
             $log_list[$i]['name'] = Items::GetItemName($log_list[$i]['entry']);
             $log_list[$i]['qi'] = Items::GetItemInfo($log_list[$i]['entry'], 'quality');
         }
     }
     return $log_list;
 }
 public static function GetSingleItem($ItemID, $JSONP)
 {
     $NewArray = [];
     $Item = Items::GetItemInfo($ItemID);
     if ($Item != false) {
         $NewArray['id'] = $Item['entry'];
         foreach (array('description', 'name', 'icon', 'stackable') as $Field) {
             $NewArray[$Field] = $Item[$Field];
         }
         $NewArray['allowableClasses'] = 'NYI';
         $NewArray['itemBind'] = $Item['bonding'];
         for ($i = 1; $i <= 10; $i++) {
             if ($Item['stat_type' . $i] != 0) {
                 $NewArray['bonusStats'][] = ['stat' => $Item['stat_type' . $i], 'amount' => $Item['stat_value' . $i]];
             }
         }
         for ($i = 1; $i <= 5; $i++) {
             if ($Item['spellid_' . $i] != -1 && $Item['spellid_' . $i] != 0) {
                 $NewArray['itemSpells'][] = ['spellId' => $Item['spell_data' . $i]['SpellID'], 'spell' => ['id' => $Item['spell_data' . $i]['SpellID'], 'name' => $Item['spell_data' . $i]['Name'], 'icon' => $Item['spell_data' . $i]['icon'], 'description' => $Item['spell_data' . $i]['Description']]];
             }
         }
         if (isset($Item['BuyPrice']['gold'])) {
             $FinalBuyPrice = $Item['BuyPrice']['gold'];
         }
         if (isset($Item['BuyPrice']['silver'])) {
             $FinalBuyPrice = $Item['BuyPrice']['silver'];
         }
         if (isset($Item['BuyPrice']['copper'])) {
             $FinalBuyPrice = $Item['BuyPrice']['copper'];
         }
         $NewArray['buyPrice'] = $FinalBuyPrice;
         $NewArray['itemClass'] = $Item['class']['class'];
         $NewArray['itemSubClass'] = $Item['subclass']['subclass'];
         $NewArray['containerSlots'] = $Item['ContainerSlots'];
         if ($Item['class']['class'] == 2) {
             if ($Item['dmg_min1'] != 0) {
                 $DPS = ($Item['dmg_min1'] + $Item['dmg_max1']) / 2 / ($Item['delay'] / 1000);
                 $DamageMin = $Item['dmg_min1'];
                 $DamageMax = $Item['dmg_max1'];
             } elseif ($Item['dmg_min2'] != 0) {
                 $DPS = ($Item['dmg_min2'] + $Item['dmg_max2']) / 2 / ($Item['delay'] / 1000);
                 $DamageMin = $Item['dmg_min2'];
                 $DamageMax = $Item['dmg_max2'];
             }
             $NewArray['weaponInfo'] = ['damage' => ['min' => $DamageMin, 'max' => $DamageMax, 'exactMin' => number_format((double) $DamageMin, 1, '.', ''), 'exactMax' => number_format((double) $DamageMax, 1, '.', '')], 'weaponSpeed' => $Item['delay'] / 1000, 'dps' => $DPS];
         }
         $NewArray['inventoryType'] = $Item['InventoryType'];
         $NewArray['itemLevel'] = $Item['ItemLevel'];
         $NewArray['maxCount'] = $Item['maxcount'];
         $NewArray['maxDurability'] = $Item['MaxDurability'];
         $NewArray['minFactionId'] = $Item['RequiredReputationFaction'];
         $NewArray['minReputation'] = $Item['RequiredReputationRank'];
         $NewArray['quality'] = $Item['Quality'];
         if (isset($Item['SellPrice']['gold'])) {
             $FinalSellPrice = $Item['SellPrice']['gold'];
         }
         if (isset($Item['SellPrice']['silver'])) {
             $FinalSellPrice = $Item['SellPrice']['silver'];
         }
         if (isset($Item['SellPrice']['copper'])) {
             $FinalSellPrice = $Item['SellPrice']['copper'];
         }
         $NewArray['sellPrice'] = $FinalSellPrice;
         $NewArray['requiredSkill'] = $Item['RequiredSkill'];
         $NewArray['requiredLevel'] = $Item['RequiredLevel'];
         $NewArray['requiredSkillRank'] = $Item['RequiredSkillRank'];
         $SocketsCount = 0;
         for ($i = 1; $i <= 3; $i++) {
             if ($Item['socketColor_' . $i] != 0) {
                 $NewArray['socketInfo']['sockets'][] = ['type' => Items::SocketDescription($Item['socketColor_' . $i])['type']];
                 $SocketsCount++;
             }
         }
         if ($SocketsCount > 0) {
             $NewArray['socketInfo']['socketBonus'] = $Item['socketBonusDescription'];
         }
         $NewArray['baseArmor'] = $Item['armor'];
         if ($SocketsCount > 0) {
             $NewArray['hasSockets'] = true;
         } else {
             $NewArray['hasSockets'] = false;
         }
         $NewArray['displayInfoId'] = $Item['displayid'];
         return parent::Encode($NewArray, $JSONP);
     } else {
         return parent::GenerateResponse(404, true);
     }
 }