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