Esempio n. 1
0
 /**
  * Return full loot info (not used now)
  * @category Items class
  * @example Items::lootInfo(35000)
  * @return array
  **/
 public function lootInfo($itemID)
 {
     $bossLoot = $this->wDB->selectRow("SELECT `entry`, `ChanceOrQuestChance` FROM `creature_loot_template` WHERE `item`=?", $itemID);
     $chestLoot = $this->wDB->selectRow("SELECT `entry`, `ChanceOrQuestChance` FROM `gameobject_loot_template` WHERE `item`=?", $itemID);
     $loot = array();
     if ($bossLoot) {
         $loot = array('source' => Mangos::GetNPCName($bossLoot['entry']), 'instance' => Mangos::GetNpcInfo($bossLoot['entry'], 'map'), 'percent' => Mangos::DropPercent($bossLoot['ChanceOrQuestChance']));
     } elseif ($chestLoot) {
         $loot = array('source' => Mangos::GameobjectInfo($chestLoot['entry'], 'name'), 'instance' => Mangos::GameobjectInfo($chestLoot['entry'], 'map'), 'percent' => Mangos::DropPercent($chestLoot['ChanceOrQuestChance']));
     } else {
         $loot = array('source' => 'Unknown', 'instance' => 'Unknown', 'percent' => 'Unknown');
     }
     return $loot;
 }