7,
'Semi Rare' => 2,
'Rare' => 0.5,
'Very Rare' => 0
);
?>
Hide None | ';
echo 'Hide Not Found | ';
echo 'Hide Monsters Without Loot | ';
echo 'Hide All | ';
echo 'Use Normal Loot Rate | ';
echo 'Use Server Loot Rate';
?>
Could not load items!');
foreach($items->item as $v)
$itemList[(int)$v['id']] = $v['name'];
if(isset($_GET['lootrate'])) {
$config = parse_ini_file($otdir . '/config.lua');
$lootRate = $config['rate_loot'];
}
$monsters = simplexml_load_file($otdir . '/data/monster/monsters.xml') or die('Could not load monsters!');
foreach($monsters->monster as $monster) {
$loot = simplexml_load_file($otdir . '/data/monster/' . $monster['file']);
if($loot) {
if($item = $loot->loot->item) {
echo '
[+] ' . $monster['name'] . '
';
addLoot($item);
echo '
';
} elseif(!isset($_GET['hideempty']))
echo '[x] ' . $monster['name'] . '
';
} elseif(!isset($_GET['hidefail']))
echo 'Failed to load monster ' . $monster[name] . ' (' . $monster[file] . ')
';
}
function addLoot($loot, $level=1) {
foreach($loot as $test) {
$chance = $test['chance'];
if(!$chance)
$chance = $test['chance1'];
printLoot($level, $test['id'], $test['countmax'], $chance);
foreach($test as $k => $v)
addLoot($v->item, $level + 1);
}
}
function printLoot($level, $itemid, $count, $chance) {
global $itemList, $rarity;
$chance /= 1000;
if(isset($_GET['lootrate'])) {
global $lootRate;
$chance *= $lootRate;
}
foreach($rarity as $lootRarity => $percent){
if($chance >= $percent) {
echo str_repeat("... ", $level) . '' . ($count ? $count : 1) . ' ' . $itemList[(int)$itemid] . ' - ' . $lootRarity . ' (' . $chance . '%)
';
break;
}
}
}
?>