本文整理汇总了PHP中Items::GetItemSubTypeInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::GetItemSubTypeInfo方法的具体用法?PHP Items::GetItemSubTypeInfo怎么用?PHP Items::GetItemSubTypeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::GetItemSubTypeInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例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();
//.........这里部分代码省略.........