本文整理汇总了PHP中Items::getItemName方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::getItemName方法的具体用法?PHP Items::getItemName怎么用?PHP Items::getItemName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::getItemName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: AdvancedItemsSearch
//.........这里部分代码省略.........
if ($loot_id['type'] == 'object') {
$loot_template = '`gameobject_loot_template`';
$source_type = 'sourceType.creatureDrop';
} elseif ($loot_id['type'] == 'npc') {
$loot_template = '`creature_loot_template`';
$source_type = 'sourceType.gameObjectDrop';
}
}
}
}
if ($this->get_array['boss'] != 'all') {
$current_instance_key = $this->get_array['dungeon'];
$current_dungeon_data = $this->aDB->selectRow("SELECT `id`, `map`, `name_" . $this->_locale . "` AS `name` FROM `armory_instance_template` WHERE `key`=? LIMIT 1", $current_instance_key);
}
if ($this->searchQuery && is_array($item_id_array)) {
$items_query = $this->wDB->select("\n SELECT\n `item_template`.`entry` AS `id`,\n `item_template`.`name`,\n `item_template`.`ItemLevel`,\n `item_template`.`Quality` AS `rarity`,\n `item_template`.`displayid`,\n `item_template`.`bonding`,\n `item_template`.`flags`,\n `item_template`.`duration`,\n `creature_loot_template`.`entry`,\n `creature_loot_template`.`item`,\n `creature_loot_template`.`ChanceOrQuestChance`\n FROM `item_template` AS `item_template`\n LEFT JOIN `creature_loot_template` AS `creature_loot_template` ON `creature_loot_template`.`item`=`item_template`.`entry`\n WHERE `creature_loot_template`.`entry` IN (?a) AND `creature_loot_template`.`item` IN (?a)\n ORDER BY `item_template`.`ItemLevel` DESC LIMIT 200", $loot_table, $item_id_array);
if (!$items_query) {
$items_query = $this->wDB->select("\n SELECT\n `item_template`.`entry` AS `id`,\n `item_template`.`name`,\n `item_template`.`ItemLevel`,\n `item_template`.`Quality` AS `rarity`,\n `item_template`.`displayid`,\n `item_template`.`bonding`,\n `item_template`.`flags`,\n `item_template`.`duration`,\n `gameobject_loot_template`.`entry`,\n `gameobject_loot_template`.`item`,\n `gameobject_loot_template`.`ChanceOrQuestChance`\n FROM `item_template` AS `item_template`\n LEFT JOIN `gameobject_loot_template` AS `gameobject_loot_template` ON `gameobject_loot_template`.`item`=`item_template`.`entry`\n WHERE `gameobject_loot_template`.`entry` IN (?a) AND `gameobject_loot_template`.`item` IN (?a)\n ORDER BY `item_template`.`ItemLevel` DESC LIMIT 200", $loot_table, $item_id_array);
}
} else {
$items_query = $this->wDB->select("\n SELECT\n `item_template`.`entry` AS `id`,\n `item_template`.`name`,\n `item_template`.`ItemLevel`,\n `item_template`.`Quality` AS `rarity`,\n `item_template`.`displayid`,\n `item_template`.`bonding`,\n `item_template`.`flags`,\n `item_template`.`duration`,\n " . $loot_template . ".`entry`,\n " . $loot_template . ".`item`,\n " . $loot_template . ".`ChanceOrQuestChance`\n FROM `item_template` AS `item_template`\n LEFT JOIN " . $loot_template . " AS " . $loot_template . " ON " . $loot_template . ".`item`=`item_template`.`entry`\n WHERE " . $loot_template . ".`entry` IN (?a)\n ORDER BY `item_template`.`ItemLevel` DESC LIMIT 200", $loot_table);
}
}
break;
case 'reputation':
if (!isset($this->get_array['faction'])) {
$this->get_array['faction'] = 'all';
}
if ($this->get_array['faction'] == 'all' || $this->get_array['faction'] == -1) {
$items_query = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `RequiredReputationFaction` > 0 ORDER BY `ItemLevel` DESC LIMIT 200", $this->get_array['faction']);
} else {
$items_query = $this->wDB->select("SELECT `entry` AS `id`, `name`, `ItemLevel`, `Quality` AS `rarity`, `displayid`, `bonding`, `flags`, `duration` FROM `item_template` WHERE `RequiredReputationFaction`=? ORDER BY `ItemLevel` DESC LIMIT 200", $this->get_array['faction']);
}
break;
}
if (!isset($items_query) || !is_array($items_query)) {
$this->Log()->writeError('%s : unable to get items for "%s" query (current locale: %s, locId: %d) ', __METHOD__, $this->searchQuery, $this->_locale, $this->_loc);
return false;
}
$items_result = array();
$exists_items = array();
$i = 0;
foreach ($items_query as $item) {
if (isset($exists_items[$item['id']])) {
continue;
// do not add the same items to result array
}
if ($i >= 200) {
if ($count) {
return count($exists_items);
} else {
return $items_result;
}
} elseif (!$count) {
if ($this->get_array['source'] == 'dungeon' && $allowedDungeon && isset($this->get_array['boss']) && $this->get_array['boss'] == 'all') {
$current_instance_key = Utils::GetBossDungeonKey($item['entry']);
$current_dungeon_data = $this->aDB->selectRow("SELECT `id`, `map`, `name_" . $this->_locale . "` AS `name` FROM `armory_instance_template` WHERE `key`=? LIMIT 1", $current_instance_key);
}
$items_result[$i]['data'] = array();
$items_result[$i]['filters'] = array();
$items_result[$i]['data']['id'] = $item['id'];
if ($this->_locale != 'en_gb' || $this->_locale != 'en_us') {
$items_result[$i]['data']['name'] = Items::getItemName($item['id']);
} else {
$items_result[$i]['data']['name'] = $item['name'];
}
if (self::CanAuction($item)) {
$items_result[$i]['data']['canAuction'] = 1;
}
$items_result[$i]['data']['rarity'] = $item['rarity'];
$items_result[$i]['data']['icon'] = $this->aDB->selectCell("SELECT `icon` FROM `armory_icons` WHERE `displayid`=?", $item['displayid']);
$items_result[$i]['filters'][0] = array('name' => 'itemLevel', 'value' => $item['ItemLevel']);
$items_result[$i]['filters'][1] = array('name' => 'relevance', 'value' => 100);
switch ($this->get_array['source']) {
case 'dungeon':
if (isset($current_dungeon_data) && $allowedDungeon && is_array($current_dungeon_data)) {
$items_result[$i]['filters'][2] = array('areaId' => $current_dungeon_data['id'], 'areaKey' => $current_instance_key, 'areaName' => $current_dungeon_data['name'], 'name' => 'source', 'value' => $source_type);
} elseif (!$allowedDungeon && self::IsExtendedCost()) {
$items_result[$i]['filters'][2] = array('name' => 'source', 'value' => 'sourceType.vendor');
}
break;
case 'reputation':
$items_result[$i]['filters'][2] = array('name' => 'source', 'value' => 'sourceType.factionReward');
break;
case 'quest':
$items_result[$i]['filters'][2] = array('name' => 'source', 'value' => 'sourceType.questReward');
break;
case 'pvpAlliance':
case 'pvpHorde':
break;
}
}
$exists_items[$item['id']] = $item['id'];
$i++;
}
if ($count == true) {
return count($exists_items);
}
return $items_result;
}
示例3: 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();
//.........这里部分代码省略.........
示例4: 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;
}
示例5: 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;
}