本文整理汇总了PHP中Items::extractSocketInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::extractSocketInfo方法的具体用法?PHP Items::extractSocketInfo怎么用?PHP Items::extractSocketInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::extractSocketInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: CreateAdditionalItemTooltip
//.........这里部分代码省略.........
}
if ($itemSlotName) {
$rPropInfo = Items::GetRandomPropertiesData($itemID, $characters->GetGUID(), $characters->GetEquippedItemGuidBySlot($itemSlotName));
} else {
$rPropInfo = Items::GetRandomPropertiesData($itemID, $characters->GetGUID());
}
if ($isCharacter && !$parent && is_array($rPropInfo)) {
$xml->XMLWriter()->startElement('randomEnchantData');
$xml->XMLWriter()->startElement('suffix');
$xml->XMLWriter()->text($rPropInfo['suffix']);
$xml->XMLWriter()->endElement();
//enchant
if (is_array($rPropInfo['data'])) {
foreach ($rPropInfo['data'] as $randProp) {
$xml->XMLWriter()->startElement('enchant');
$xml->XMLWriter()->text($randProp);
$xml->XMLWriter()->endElement();
//enchant
}
}
$xml->XMLWriter()->endElement();
//randomEnchantData
}
}
$xml->XMLWriter()->startElement('socketData');
$socket_data = false;
$socketBonusCheck = array();
for ($i = 1; $i < 4; $i++) {
if ($data['socketColor_' . $i] > 0) {
switch ($data['socketColor_' . $i]) {
case 1:
$color = 'Meta';
$socket_data = array('color' => 'Meta');
$gem = Items::extractSocketInfo($characters->GetGUID(), $itemID, $i, $characters->GetEquippedItemGuidBySlot($itemSlotName));
if ($gem && !$parent) {
$socket_data['enchant'] = $gem['enchant'];
$socket_data['icon'] = $gem['icon'];
$currentColor = $this->aDB->selectCell("SELECT `color` FROM `armory_gemproperties` WHERE `spellitemenchantement`=? LIMIT 1", $gem['enchant_id']);
if ($currentColor == 1) {
$socket_data['match'] = '1';
}
}
break;
case 2:
$socket_data = array('color' => 'Red');
$gem = Items::extractSocketInfo($characters->GetGUID(), $itemID, $i, $characters->GetEquippedItemGuidBySlot($itemSlotName));
if ($gem && !$parent) {
$socket_data['enchant'] = $gem['enchant'];
$socket_data['icon'] = $gem['icon'];
$currentColor = $this->aDB->selectCell("SELECT `color` FROM `armory_gemproperties` WHERE `spellitemenchantement`=? LIMIT 1", $gem['enchant_id']);
if ($currentColor == 6 || $currentColor == 10 || $currentColor == 14) {
$socket_data['match'] = '1';
}
}
break;
case 4:
$socket_data = array('color' => 'Yellow');
$gem = Items::extractSocketInfo($characters->GetGUID(), $itemID, $i, $characters->GetEquippedItemGuidBySlot($itemSlotName));
if ($gem && !$parent) {
$socket_data['enchant'] = $gem['enchant'];
$socket_data['icon'] = $gem['icon'];
$currentColor = $this->aDB->selectCell("SELECT `color` FROM `armory_gemproperties` WHERE `spellitemenchantement`=? LIMIT 1", $gem['enchant_id']);
if ($currentColor == 6 || $currentColor == 12 || $currentColor == 14) {
$socket_data['match'] = '1';
}
}