• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Monster Loot Checker

where i must add this? sry mi naab :(
 
Last edited by a moderator:
First you need a webserver (like when you make AAC in OTS) and then you make new file called like loot.php and inside of it you add that code. Then open your browser and go to like http://localhost/loot.php
 
Very good COLANDUS, grea work...

I have a question... How to add a exclusion list on this...

For exemple: Don't apear summon or editeds monsters on list...
 
Very good COLANDUS, grea work...

I have a question... How to add a exclusion list on this...

For exemple: Don't apear summon or editeds monsters on list...

There is no way to determine whether a monster is a summon, or edited.
 
Gesior acc

Hello very nice job.
One question maybe you know how it use on Gesior ACC i maked some modifications but it show only IDs of items...any idea?
Here is mine modifications:
PHP:
ALTER TABLE `z_monsters` ADD `loot` varchar( 255 ) NOT NULL

Into adminpanel.php after //install monsters add:
PHP:
//load loot
$loot = $monster->getloot();
$item_nr = 0;
$item_count = count($loot);
$loot_string = '';
foreach($loot as $item) {
$loot_string .= '"'.$item.'"';
$item_nr++;
if($item_count != $item_nr) {
$loot_string .= ", ";
}
}

into creatures.php about 167 line:

PHP:
$items = $monster['loot'];

if(!empty($items)) {

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

 
$main_content .= '<tr BGCOLOR="'.$bgcolor.'"><td width="50"><b>Loot: </b></td><td width="100%">'.$items.'</td></tr>';

After modifications go to your web side login on and reload monsters so can you read creatures like it:

Fire-Magma OTS Creatures


Any idea how to change ids of items to names? How to set rarity?
 
Last edited:
Code:
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['rateLoot']; } $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'] . '

>>> ' . $otdir . '/' . $monster['file'] . '

'; 
                    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] . ' ' . $itemid . ' ' . $lootRarity . ' (' . $chance . '%)
'; break; } } } ?>
 
Thanks alot, worked perfect. Maybe you could check your other thread? About that feedback system? Thanks
 
Back
Top