當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Items::GetRandomPropertiesData方法代碼示例

本文整理匯總了PHP中Items::GetRandomPropertiesData方法的典型用法代碼示例。如果您正苦於以下問題:PHP Items::GetRandomPropertiesData方法的具體用法?PHP Items::GetRandomPropertiesData怎麽用?PHP Items::GetRandomPropertiesData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Items的用法示例。


在下文中一共展示了Items::GetRandomPropertiesData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
 }
開發者ID:Lankytim,項目名稱:wowarmory,代碼行數:38,代碼來源:class.guilds.php

示例2: CreateAdditionalItemTooltip


//.........這裏部分代碼省略.........
             $xml->XMLWriter()->endElement();
         }
     }
     $xml->XMLWriter()->startElement('armor');
     if ($data['ArmorDamageModifier'] > 0) {
         $xml->XMLWriter()->writeAttribute('armorBonus', 1);
     }
     $xml->XMLWriter()->text($data['armor']);
     $xml->XMLWriter()->endElement();
     //armor
     $ench_array = array(1 => 'head', 2 => 'neck', 3 => 'shoulder', 4 => 'shirt', 5 => 'chest', 6 => 'belt', 7 => 'legs', 8 => 'boots', 9 => 'wrist', 10 => 'gloves', 11 => 'ring1', 12 => 'trinket1', 13 => 'mainhand', 14 => 'offhand', 15 => 'relic', 16 => 'back', 17 => 'stave', 19 => 'tabard', 20 => 'chest', 21 => 'mainhand', 22 => '', 23 => 'offhand', 24 => '', 25 => 'thrown', 26 => 'gun', 28 => 'sigil');
     if (isset($ench_array[$data['InventoryType']])) {
         $itemSlotName = $ench_array[$data['InventoryType']];
     } else {
         $itemSlotName = false;
     }
     if (!$parent && $isCharacter && $itemSlotName) {
         $enchantment = $characters->getCharacterEnchant($itemSlotName, $characters->GetGUID());
         if ($enchantment) {
             $xml->XMLWriter()->startElement('enchant');
             $xml->XMLWriter()->text($this->aDB->selectCell("SELECT `text_" . $this->_locale . "` FROM `armory_enchantment` WHERE `id`=? LIMIT 1", $enchantment));
             $xml->XMLWriter()->endElement();
             //enchant
         }
     }
     // Random property
     if ($data['RandomProperty'] > 0 || $data['RandomSuffix'] > 0) {
         if (!$isCharacter) {
             $xml->XMLWriter()->startElement('randomEnchantData');
             $xml->XMLWriter()->endElement();
             //randomEnchantData
         }
         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) {
開發者ID:sarrian,項目名稱:wowarmory,代碼行數:67,代碼來源:class.items.php


注:本文中的Items::GetRandomPropertiesData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。