本文整理汇总了PHP中Items::GetItemName方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::GetItemName方法的具体用法?PHP Items::GetItemName怎么用?PHP Items::GetItemName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::GetItemName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetCharacterItemInfo
/**
* Returns array with data for item placed in $slot['slot']
* @category Character class
* @access public
* @param array $slot
* @return array
**/
public function GetCharacterItemInfo($slot)
{
if (!$this->guid) {
Armory::Log()->writeError('%s : player guid not provided', __METHOD__);
return false;
}
if (!isset($this->m_items[$slot['slotid']])) {
Armory::Log()->writeError('%s : slot %d is empty (nothing equipped?)', __METHOD__, $slot['slotid']);
return false;
}
$item = $this->m_items[$slot['slotid']];
$gems = array('g0' => $item->GetSocketInfo(1), 'g1' => $item->GetSocketInfo(2), 'g2' => $item->GetSocketInfo(3));
$durability = $item->GetItemDurability();
$item_data = Armory::$wDB->selectRow("SELECT `name`, `displayid`, `ItemLevel`, `Quality` FROM `item_template` WHERE `entry`=%d", $item->GetEntry());
$enchantment = $item->GetEnchantmentId();
$originalSpell = 0;
$enchItemData = array();
$enchItemDisplayId = 0;
if ($enchantment > 0) {
$originalSpell = Armory::$aDB->selectCell("SELECT `id` FROM `ARMORYDBPREFIX_spellenchantment` WHERE `Value`=%d", $enchantment);
if ($originalSpell > 0) {
$enchItemData = Armory::$wDB->selectRow("SELECT `entry`, `displayid` FROM `item_template` WHERE `spellid_1`=%d LIMIT 1", $originalSpell);
if ($enchItemData) {
// Item
$enchItemDisplayId = Armory::$aDB->selectCell("SELECT `icon` FROM `ARMORYDBPREFIX_icons` WHERE `displayid`=%d", $enchItemData['displayid']);
} else {
// Spell
$spellEnchData = Items::GenerateEnchantmentSpellData($originalSpell);
}
}
}
$item_info = array('displayInfoId' => $item_data['displayid'], 'durability' => $durability['current'], 'icon' => Items::GetItemIcon($item->GetEntry(), $item_data['displayid']), 'id' => $item->GetEntry(), 'level' => $item_data['ItemLevel'], 'maxDurability' => $durability['max'], 'name' => Armory::GetLocale() == 'en_gb' || Armory::GetLocale() == 'en_us' ? $item_data['name'] : Items::GetItemName($item->GetEntry()), 'permanentenchant' => $enchantment, 'pickUp' => 'PickUpLargeChain', 'putDown' => 'PutDownLArgeChain', 'randomPropertiesId' => 0, 'rarity' => $item_data['Quality'], 'seed' => $item->GetGUID(), 'slot' => $slot['slotid']);
if (is_array($gems)) {
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'];
}
}
}
if (is_array($enchItemData) && isset($enchItemData['entry'])) {
$item_info['permanentEnchantIcon'] = $enchItemDisplayId;
$item_info['permanentEnchantItemId'] = $enchItemData['entry'];
} elseif (isset($spellEnchData) && is_array($spellEnchData) && isset($spellEnchData['name'])) {
$item_info['permanentEnchantIcon'] = 'trade_engraving';
$item_info['permanentEnchantSpellName'] = $spellEnchData['name'];
$item_info['permanentEnchantSpellDesc'] = $spellEnchData['desc'];
}
return $item_info;
}
示例2: PerformAdvancedItemsSearch
//.........这里部分代码省略.........
if (!isset($global_sql_query) || !$global_sql_query) {
Armory::Log()->writeError('%s : SQL query was not created (probably "%s" is unknown source).', __METHOD__, $this->get_array['source']);
return false;
}
$items_query = Armory::$wDB->select($global_sql_query);
if (!$items_query) {
Armory::Log()->writeError('%s : unable to execute SQL query "%s"', __METHOD__, $global_sql_query);
unset($global_sql_query);
return false;
}
$items_result = array();
$exists_items = array();
$source_items = self::GetItemSourceArray($items_query);
$i = 0;
$icons_to_add = array();
$names_to_add = array();
$icons_holder = array();
$names_holder = array();
foreach ($items_query as $tmp_item) {
$icons_to_add[] = $tmp_item['displayid'];
$names_to_add[] = $tmp_item['id'];
}
$tmp_icons_holder = Armory::$aDB->select("SELECT `displayid`, `icon` FROM `ARMORYDBPREFIX_icons` WHERE `displayid` IN (%s)", $icons_to_add);
foreach ($tmp_icons_holder as $icon) {
$icons_holder[$icon['displayid']] = $icon['icon'];
}
if (Armory::GetLoc() == 0) {
$tmp_names_holder = Armory::$wDB->select("SELECT `entry`, `name` AS `name` FROM `item_template` WHERE `entry` IN (%s)", $names_to_add);
} else {
$tmp_names_holder = Armory::$wDB->select("SELECT `entry`, `name_loc%d` AS `name` FROM `locales_item` WHERE `entry` IN (%s)", Armory::GetLoc(), $names_to_add);
}
foreach ($tmp_names_holder as $name) {
if ($name['name'] == null) {
$name['name'] = Items::GetItemName($name['entry']);
}
$names_holder[$name['entry']] = $name['name'];
}
unset($tmp_icons_holder, $tmp_names_holder, $names_to_add, $icons_to_add);
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) {
$tmp_src = isset($source_items[$item['id']]) ? $source_items[$item['id']] : null;
$items_result[$i]['data'] = array();
$items_result[$i]['filters'] = array();
$items_result[$i]['data']['id'] = $item['id'];
if (!isset($names_holder[$item['id']])) {
$items_result[$i]['data']['name'] = Items::GetItemName($item['id']);
} else {
$items_result[$i]['data']['name'] = $names_holder[$item['id']];
}
if (self::CanAuction($item)) {
$items_result[$i]['data']['canAuction'] = 1;
}
$items_result[$i]['data']['rarity'] = $item['rarity'];
if (!isset($icons_holder[$item['displayid']])) {
$items_result[$i]['data']['icon'] = Items::GetItemIcon($item['id'], $item['displayid']);
} else {
示例3: BuildGuildBankItemList
/**
* 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;
}
示例4: BuildGuildBankLogList
/**
* 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;
}
示例5: SearchItems
/**
* Search items with $query name. If $num == true, function will return only number of
* @category Utils/Armory class
* @example Utils::SearchItems('ashes of al'ar')
* @return array, int
**/
public function SearchItems($query, $num = false)
{
if ($num == true) {
$Q = $this->wDB->selectPage($itemsNum, "SELECT `entry` FROM `item_template` WHERE `name` LIKE ? LIMIT 200", '%' . $query . '%');
$QQ = $this->wDB->selectPage($itemsNumRuRU, "SELECT `entry` FROM `locales_item` WHERE `name_loc8` LIKE ? LIMIT 200", '%' . $query . '%');
$rNum = $itemsNum + $itemsNumRuRU;
if ($rNum > 200) {
$rNum = 200;
}
return $rNum;
}
$searchResults = $this->wDB->select("\n SELECT `entry`, `Quality`, `ItemLevel`\n FROM `item_template`\n WHERE `name` LIKE ? OR `entry` IN \n (\n SELECT `entry`\n FROM `locales_item`\n WHERE `name_loc8` LIKE ?\n )\n LIMIT 200", '%' . $query . '%', '%' . $query . '%');
if (!$searchResults) {
return false;
}
$countItems = count($searchResults);
for ($i = 0; $i < $countItems; $i++) {
$searchResults[$i]['name'] = Items::GetItemName($searchResults[$i]['entry']);
$searchResults[$i]['icon'] = Items::GetItemIcon($searchResults[$i]['entry']);
}
return $searchResults;
}
示例6: BuildLootTable
/**
* Return array with loot info: dropped by, contained in, disenchating to, reagent for, etc.
* @category Items class
* @example Items::BuildLootTable(35000, 'vendor')
* @todo Currency for
* @return array
**/
public function BuildLootTable($item, $vendor, $data = false)
{
$lootTable = '';
switch ($vendor) {
case 'vendor':
$VendorLoot = $this->wDB->select("\n\t\t\t\tSELECT `entry`\n\t\t\t\t\tFROM `npc_vendor`\n\t\t\t\t\t\tWHERE `item`=?", $item);
if (!empty($VendorLoot)) {
$i = 0;
foreach ($VendorLoot as $vItem) {
$lootTable[$i] = array('name' => Mangos::GetNpcName($vItem['entry']), 'level' => Mangos::GetNpcInfo($vItem['entry'], 'level'), 'map' => Mangos::GetNpcInfo($vItem['entry'], 'map'));
$i++;
}
}
break;
case 'boss':
$BossLoot = $this->wDB->select("\n\t\t\t\tSELECT `entry`, `ChanceOrQuestChance`\n\t\t\t\t\tFROM `creature_loot_template`\n\t\t\t\t\t\tWHERE `item`=?", $item);
if (!empty($BossLoot)) {
$i = 0;
foreach ($BossLoot as $bItem) {
$map_npc = Mangos::GetNpcInfo($bItem['entry'], 'map');
if (!empty($map_npc)) {
$lootTable[$i] = array('entry' => $bItem['entry'], 'name' => Mangos::GetNpcName($bItem['entry']), 'level' => Mangos::GetNpcInfo($bItem['entry'], 'level'), 'boss' => Mangos::GetNpcInfo($bItem['entry'], 'isBoss'), 'map' => $map_npc, 'difficult' => Mangos::GetNpcInfo($bItem['entry'], 'dungeonlevel'), 'drop_percent' => Mangos::DropPercent($bItem['ChanceOrQuestChance']), 'makro' => '1');
$i++;
}
}
}
break;
case 'chest':
$ChestLoot = $this->wDB->select("\n\t\t\t\tSELECT `entry`, `ChanceOrQuestChance`\n\t\t\t\t\tFROM `gameobject_loot_template`\n\t\t\t\t\t\tWHERE `item`=?", $item);
if (!empty($ChestLoot)) {
$i = 0;
foreach ($ChestLoot as $cItem) {
$map_chest = Mangos::GameobjectInfo($cItem['entry'], 'map');
if (!empty($map_chest)) {
$lootTable[$i] = array('name' => Mangos::GameobjectInfo($cItem['entry'], 'name'), 'map' => $map_chest, 'difficult' => ' ', 'drop_percent' => Mangos::DropPercent($cItem['ChanceOrQuestChance']));
$i++;
}
}
}
break;
case 'questreward':
$QuestLoot = $this->wDB->select("\n\t\t\t\tSELECT `entry`, `MinLevel`\n\t\t\t\t\tFROM `quest_template`\n\t\t\t\t\t\tWHERE `RewChoiceItemId1` = ? OR `RewChoiceItemId2` = ? OR `RewChoiceItemId3` = ? OR \n\t\t\t\t\t\t`RewChoiceItemId4` = ? OR `RewChoiceItemId5` = ? OR `RewChoiceItemId6` = ?", $item, $item, $item, $item, $item, $item);
if (!empty($QuestLoot)) {
$i = 0;
foreach ($QuestLoot as $qItem) {
$lootTable[$i] = array('title' => Mangos::QuestInfo($qItem['entry'], 'title'), 'reqlevel' => $qItem['MinLevel'], 'map' => Mangos::QuestInfo($qItem['entry'], 'map'));
$i++;
}
}
break;
case 'queststart':
$QuestStart = $this->wDB->selectCell("SELECT `startquest` FROM `item_template` WHERE `entry`=?", $item);
if (!$QuestStart) {
return false;
}
$lootTable[0] = array('title' => Mangos::QuestInfo($QuestStart, 'title'), 'reqlevel' => Mangos::QuestInfo($QuestStart, 'reqlevel'), 'map' => Mangos::QuestInfo($QuestStart, 'map'));
break;
case 'providedfor':
$QuestInfo = $this->wDB->select("SELECT `entry`, `MinLevel` FROM `quest_template` WHERE `SrcItemId`=?", $item);
if (!$QuestInfo) {
return false;
}
$i = 0;
foreach ($QuestInfo as $quest) {
$lootTable[$i] = array('title' => Mangos::QuestInfo($quest['entry'], 'title'), 'reqlevel' => $quest['MinLevel'], 'map' => Mangos::QuestInfo($quest['entry'], 'map'));
}
break;
case 'objectiveof':
$QuestInfo = $this->wDB->select("\n SELECT `entry`, `MinLevel`\n FROM `quest_template`\n WHERE `ReqItemId1`=? OR `ReqItemId2`=? OR `ReqItemId3`=?\n OR `ReqItemId4`=? OR `ReqItemId5`=?", $item, $item, $item, $item, $item);
if (!$QuestInfo) {
return false;
}
$i = 0;
foreach ($QuestInfo as $quest) {
$lootTable[$i] = array('title' => Mangos::QuestInfo($quest['entry'], 'title'), 'reqlevel' => $quest['MinLevel'], 'map' => Mangos::QuestInfo($quest['entry'], 'map'));
}
break;
case 'item':
$ItemLoot = $this->wDB->select("\n SELECT `entry`, `ChanceOrQuestChance`\n FROM `item_loot_template`\n WHERE `item`=?", $item);
if (!empty($ItemLoot)) {
$i = 0;
foreach ($ItemLoot as $iItem) {
$lootTable[$i] = array('name' => Items::GetItemName($iItem['entry']), 'drop_percent' => Mangos::DropPercent($iItem['ChanceOrQuestChance']));
$i++;
}
}
break;
case 'disenchant':
$DisenchantLoot = $this->wDB->select("\n SELECT `item`, `ChanceOrQuestChance`, `maxcount`\n FROM `disenchant_loot_template`\n WHERE `entry`=?", $item);
if (!empty($DisenchantLoot)) {
$i = 0;
foreach ($DisenchantLoot as $dItem) {
$lootTable[$i] = array('entry' => $dItem['item'], 'name' => $this->GetItemName($dItem['item']), 'drop_percent' => Mangos::DropPercent($dItem['ChanceOrQuestChance']), 'count' => $dItem['maxcount'], 'icon' => $this->GetItemIcon($dItem['item']));
//.........这里部分代码省略.........