/** * @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; }