本文整理汇总了PHP中Items::getItemIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::getItemIcon方法的具体用法?PHP Items::getItemIcon怎么用?PHP Items::getItemIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::getItemIcon方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoSearchItems
public function DoSearchItems($count = false, $findUpgrade = false)
{
if (!$this->searchQuery && !$findUpgrade) {
return false;
}
if ($findUpgrade > 0) {
$source_item_data = $this->wDB->selectRow("SELECT `class`, `subclass`, `InventoryType`, `ItemLevel`, `Quality` FROM `item_template` WHERE `entry`=?", $findUpgrade);
/*
,
`stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`,
`stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`,
`stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`
*/
if (!$source_item_data) {
return false;
}
}
if ($count == true) {
if ($findUpgrade) {
$sql_query = sprintf("SELECT COUNT(`entry`) FROM `item_template` WHERE `class`=%d AND `subclass`=%d AND `InventoryType`=%d AND `Quality` >= %d AND `ItemLevel` >= %d", $source_item_data['class'], $source_item_data['subclass'], $source_item_data['InventoryType'], $source_item_data['Quality'], $source_item_data['ItemLevel']);
$count_items = $this->wDB->selectCell($sql_query);
} else {
$count_items = $this->wDB->selectCell("SELECT COUNT(`entry`) FROM `item_template` WHERE `name` LIKE ? OR `entry` IN (SELECT `entry` FROM `locales_item` WHERE `name_loc" . $this->_loc . "` LIKE ?)", '%' . $this->searchQuery . '%', '%' . $this->searchQuery . '%');
}
if ($count_items > 200) {
return 200;
}
return $count_items;
}
if ($findUpgrade) {
$sql_query = sprintf("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid` FROM `item_template` WHERE `class`=%d AND `subclass`=%d AND `InventoryType`=%d AND `Quality` >= %d AND `ItemLevel` >= %d ORDER BY `ItemLevel` DESC LIMIT 200", $source_item_data['class'], $source_item_data['subclass'], $source_item_data['InventoryType'], $source_item_data['Quality'], $source_item_data['ItemLevel']);
$items = $this->wDB->select($sql_query);
} else {
$items = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid` FROM `item_template` WHERE `name` LIKE ? OR `entry` IN (SELECT `entry` FROM `locales_item` WHERE `name_loc" . $this->_loc . "` LIKE ?) ORDER BY `ItemLevel` DESC LIMIT 200", '%' . $this->searchQuery . '%', '%' . $this->searchQuery . '%');
}
if (!$items) {
return false;
}
$result_data = array();
$i = 0;
foreach ($items as $item) {
$result_data[$i]['data'] = $item;
$result_data[$i]['data']['icon'] = Items::getItemIcon($item['id'], $item['displayid']);
if ($this->_locale != 'en_gb' || $this->_locale != 'en_us') {
$result_data[$i]['data']['name'] = Items::getItemName($item['id']);
}
$result_data[$i]['filters'] = array(array('name' => 'itemLevel', 'value' => $item['ItemLevel']), array('name' => 'relevance', 'value' => 100));
$i++;
unset($result_data[$i]['data']['ItemLevel']);
}
return $result_data;
}
示例2: GetExtendedCost
public function GetExtendedCost($costId)
{
$costInfo = $this->aDB->selectRow("SELECT * FROM `armory_extended_cost` WHERE `id`=? LIMIT 1", $costId);
if (!$costInfo) {
return false;
}
$extended_cost = array();
for ($i = 1; $i < 6; $i++) {
if ($costInfo['item' . $i] > 0) {
$extended_cost[$i]['count'] = $costInfo['item' . $i . 'count'];
$extended_cost[$i]['icon'] = Items::getItemIcon($costInfo['item' . $i]);
$extended_cost[$i]['id'] = $costInfo['item' . $i];
}
}
return $extended_cost;
}
示例3: BuildGuildBankItemList
/**
* 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;
}
示例4: DoSearchItems
public function DoSearchItems($count = false, $findUpgrade = false)
{
if (!$this->searchQuery && !$findUpgrade && !$this->heirloom) {
$this->Log()->writeError('%s : unable to start search: no data provided', __METHOD__);
return false;
}
if ($findUpgrade > 0) {
$source_item_data = $this->wDB->selectRow("SELECT `class`, `subclass`, `InventoryType`, `ItemLevel`, `Quality`, `bonding` FROM `item_template` WHERE `entry`=?", $findUpgrade);
/*
,
`stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`,
`stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`,
`stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`
*/
if (!$source_item_data) {
$this->Log()->writeError('%s : unable to item info for ID #%d (findUpgrade)', __METHOD__, $findUpgrade);
return false;
}
}
if ($count == true) {
if ($findUpgrade) {
$sql_query = sprintf("SELECT COUNT(`entry`) FROM `item_template` WHERE `class`=%d AND `subclass`=%d AND `InventoryType`=%d AND `Quality` >= %d AND `ItemLevel` >= %d", $source_item_data['class'], $source_item_data['subclass'], $source_item_data['InventoryType'], $source_item_data['Quality'], $source_item_data['ItemLevel']);
$count_items = $this->wDB->selectCell($sql_query);
} elseif ($this->heirloom == true) {
$count_items = $this->wDB->selectCell("SELECT COUNT(`entry`) FROM `item_template` WHERE `Quality`=7");
} else {
if ($this->_loc == 0) {
$count_items = $this->wDB->selectCell("SELECT COUNT(`entry`) FROM `item_template` WHERE `name` LIKE ?", '%' . $this->searchQuery . '%');
} else {
$count_items = $this->wDB->selectCell("SELECT COUNT(`entry`) FROM `item_template` WHERE `name` LIKE ? OR `entry` IN (SELECT `entry` FROM `locales_item` WHERE `name_loc" . $this->_loc . "` LIKE ?)", '%' . $this->searchQuery . '%', '%' . $this->searchQuery . '%');
}
}
if ($count_items > 200) {
return 200;
}
return $count_items;
}
if ($findUpgrade) {
$sql_query = sprintf("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `class`=%d AND `subclass`=%d AND `InventoryType`=%d AND `Quality` >= %d AND `ItemLevel` >= %d ORDER BY `ItemLevel` DESC LIMIT 200", $source_item_data['class'], $source_item_data['subclass'], $source_item_data['InventoryType'], $source_item_data['Quality'], $source_item_data['ItemLevel']);
$items = $this->wDB->select($sql_query);
} elseif ($this->heirloom == true) {
$items = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `Quality`=7 ORDER BY `ItemLevel` DESC LIMIT 200");
} else {
if ($this->_loc == 0) {
$items = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `name` LIKE ? ORDER BY `ItemLevel` DESC LIMIT 200", '%' . $this->searchQuery . '%');
} else {
$items = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `name` LIKE ? OR `entry` IN (SELECT `entry` FROM `locales_item` WHERE `name_loc" . $this->_loc . "` LIKE ?) ORDER BY `ItemLevel` DESC LIMIT 200", '%' . $this->searchQuery . '%', '%' . $this->searchQuery . '%');
}
}
if (!$items) {
$this->Log()->writeLog('%s : unable to find any items with `%s` query (current locale: %s, locId: %d)', __METHOD__, $this->searchQuery, $this->_locale, $this->_loc);
return false;
}
$result_data = array();
$i = 0;
foreach ($items as $item) {
$result_data[$i]['data'] = $item;
$result_data[$i]['data']['icon'] = Items::getItemIcon($item['id'], $item['displayid']);
if (self::CanAuction($item)) {
$result_data[$i]['data']['canAuction'] = 1;
}
unset($result_data[$i]['data']['flags'], $result_data[$i]['data']['duration'], $result_data[$i]['data']['bonding']);
if ($this->_locale != 'en_gb' || $this->_locale != 'en_us') {
$result_data[$i]['data']['name'] = Items::getItemName($item['id']);
}
$result_data[$i]['filters'] = array(array('name' => 'itemLevel', 'value' => $item['ItemLevel']), array('name' => 'relevance', 'value' => 100));
if ($this->heirloom == true) {
$result_data[$i]['filters'][2] = array('name' => 'source', 'value' => 'sourceType.vendor');
}
$i++;
unset($result_data[$i]['data']['ItemLevel']);
}
return $result_data;
}
示例5: GetCharacterItemInfo
/**
* @todo enchantments
**/
public function GetCharacterItemInfo($slot)
{
if (!$this->guid) {
$this->Log()->writeError('%s : player guid not provided', __METHOD__);
return false;
}
$item_id = $this->getCharacterEquip($slot['slot']);
if (!$item_id) {
$this->Log()->writeLog('%s : unable to get item_id for player %d (%s); slotid is %s (nothing equipped?)', __METHOD__, $this->guid, $this->name, $slot['slot']);
return false;
}
$durability = Items::getItemDurability($this->guid, $item_id);
$gems = array('g0' => Items::extractSocketInfo($this->guid, $item_id, 1), 'g1' => Items::extractSocketInfo($this->guid, $item_id, 2), 'g2' => Items::extractSocketInfo($this->guid, $item_id, 3));
$item_data = $this->wDB->selectRow("SELECT `name`, `displayid`, `ItemLevel`, `Quality` FROM `item_template` WHERE `entry`=?", $item_id);
$enchantment = $this->getCharacterEnchant($slot['slot']);
$item_info = array('displayInfoId' => $item_data['displayid'], 'durability' => $durability['current'], 'icon' => Items::getItemIcon($item_id, $item_data['displayid']), 'id' => $item_id, 'level' => $item_data['ItemLevel'], 'maxDurability' => $durability['max'], 'name' => $this->_locale == 'en_gb' || $this->_locale == 'en_us' ? $item_data['name'] : Items::getItemName($item_id), 'permanentEnchantIcon' => 0, 'permanentEnchantItemId' => 0, 'permanentenchant' => null, 'pickUp' => 'PickUpLargeChain', 'putDown' => 'PutDownLArgeChain', 'randomPropertiesId' => 0, 'rarity' => $item_data['Quality'], 'seed' => 0, 'slot' => $slot['slotid']);
for ($i = 0; $i < 3; $i++) {
if ($gems['g' . $i]['item'] > 0) {
$item_info['gem' . $i . 'Id'] = $gems['g' . $i]['item'];
$item_info['gemIcon' . $i] = $gems['g' . $i]['icon'];
}
}
return $item_info;
}
示例6: CreateAdditionalItemTooltip
private function CreateAdditionalItemTooltip($itemID, XMLHandler $xml, Characters $characters, $parent = false, $comparsion = false)
{
if (!$xml) {
return false;
} elseif ($parent == true && is_array($comparsion)) {
return false;
// both variables can't have 'true' value.
}
// Item comparsion mode
$realm = false;
if (is_array($comparsion) && isset($this->realmData[$comparsion['realm_id']])) {
$realm = $this->realmData[$comparsion['realm_id']];
}
$data = $this->wDB->selectRow("SELECT * FROM `item_template` WHERE `entry`=?", $itemID);
if (!$data) {
return false;
}
$isCharacter = $characters->CheckPlayer();
$xml->XMLWriter()->startElement('id');
$xml->XMLWriter()->text($itemID);
$xml->XMLWriter()->endElement();
//id
$xml->XMLWriter()->startElement('name');
if ($this->_locale == 'en_gb' || $this->_locale == 'en_us') {
$xml->XMLWriter()->text($data['name']);
} else {
$xml->XMLWriter()->text(Items::getItemName($itemID));
}
$xml->XMLWriter()->endElement();
//name
$xml->XMLWriter()->startElement('icon');
$xml->XMLWriter()->text(Items::getItemIcon($itemID, $data['displayid']));
$xml->XMLWriter()->endElement();
//icon
// 3.2.x heroic item flag
if ($data['Flags'] == 8 || $data['Flags'] == 4104 && $data['itemset'] > 0) {
$xml->XMLWriter()->startElement('heroic');
$xml->XMLWriter()->text(1);
$xml->XMLWriter()->endElement();
//heroic
}
$xml->XMLWriter()->startElement('overallQualityId');
$xml->XMLWriter()->text($data['Quality']);
$xml->XMLWriter()->endElement();
//overallQualityId
$xml->XMLWriter()->startElement('bonding');
$xml->XMLWriter()->text($data['bonding']);
$xml->XMLWriter()->endElement();
//bonding
$xml->XMLWriter()->startElement('maxCount');
$xml->XMLWriter()->text($data['maxcount']);
$xml->XMLWriter()->endElement();
//maxCount
if ($data['startquest'] > 0) {
$xml->XMLWriter()->startElement('startQuestId');
$xml->XMLWriter()->text($data['startquest']);
$xml->XMLWriter()->endElement();
//startQuestId
}
$xml->XMLWriter()->startElement('classId');
$xml->XMLWriter()->text($data['class']);
$xml->XMLWriter()->endElement();
//classId
$xml->XMLWriter()->startElement('equipData');
$xml->XMLWriter()->startElement('inventoryType');
$xml->XMLWriter()->text($data['InventoryType']);
$xml->XMLWriter()->endElement();
//inventoryType
$xml->XMLWriter()->startElement('subclassName');
$xml->XMLWriter()->text(Items::GetItemSubTypeInfo($itemID, true, $data));
$xml->XMLWriter()->endElement();
//subclassName
if ($data['class'] == ITEM_CLASS_CONTAINER) {
$xml->XMLWriter()->startElement('containerSlots');
$xml->XMLWriter()->text($data['ContainerSlots']);
$xml->XMLWriter()->endElement();
//containerSlots
}
$xml->XMLWriter()->endElement();
//equipData
if ($data['class'] == ITEM_CLASS_WEAPON) {
$xml->XMLWriter()->startElement('damageData');
$xml->XMLWriter()->startElement('damage');
$xml->XMLWriter()->startElement('type');
$xml->XMLWriter()->text('0');
$xml->XMLWriter()->endElement();
//type
$xml->XMLWriter()->startElement('min');
$xml->XMLWriter()->text($data['dmg_min1']);
$xml->XMLWriter()->endElement();
//min
$xml->XMLWriter()->startElement('max');
$xml->XMLWriter()->text($data['dmg_max1']);
$xml->XMLWriter()->endElement();
//max
$xml->XMLWriter()->endElement();
//damage
$xml->XMLWriter()->startElement('speed');
$xml->XMLWriter()->text(round($data['delay'] / 1000, 2));
$xml->XMLWriter()->endElement();
//.........这里部分代码省略.........
示例7: BuildGuildBankItemList
/**
* Returns list of items that stored in guild bank
* @category Guilds class
* @example Guilds::BuildGuildBankItemList()
* @return array
**/
public function BuildGuildBankItemList()
{
if (!$this->guildId) {
return false;
}
$items = $this->cDB->select("SELECT `item_entry` AS `entry` FROM `guild_bank_item` WHERE `guildid`=?", $this->guildId);
if ($items) {
$count = count($items);
for ($i = 0; $i < $count; $i++) {
$items[$i]['name'] = Items::getItemName($items[$i]['entry']);
$items[$i]['icon'] = Items::getItemIcon($items[$i]['entry']);
$items[$i]['Quality'] = Items::getItemInfo($items[$i]['entry'], 'quality');
}
return $items;
}
return false;
}