当前位置: 首页>>代码示例>>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;未经允许,请勿转载。