* @author Slawkens * @copyright 2017 MyAAC * @link http://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); $title = "Creatures"; ?> hasErrors()) error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.'); } else { error(Creatures::getLastError()); } } if($canEdit) { ?>
query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1'.$whereandorder); echo ''; if($order == 'name' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } if($order == 'health' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } if($order == 'exp' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } if($order == 'summonable' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } if($order == 'convinceable' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } if($order == 'race' && !isset($_REQUEST['desc'])) { echo ''; } else { echo ''; } $number_of_rows = 0; foreach($monsters as $monster) { echo ''; if($monster['summonable']) { echo ''; } else { echo ''; } if($monster['convinceable']) { echo ''; } else { echo ''; } echo ''; } echo '
Name DESCNameHealth
DESC
HealthExperience
DESC
ExperienceSummonable
Mana DESC
Summonable
Mana
Convinceable
Mana DESC
Convinceable
Mana
Race
DESC
Race
'.$monster['name'].''.$monster['health'].''.$monster['exp'].''.$monster['mana'].'---'.$monster['mana'].'---'.ucwords($monster['race']).'
'; return; } $monster_name = stripslashes(trim(ucwords($_REQUEST['creature']))); $monster = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 AND `name` = '.$db->quote($monster_name).';')->fetch(); if(isset($monster['name'])) { $title = $monster['name'] . " - Creatures"; echo '

'.$monster['name'].'

'; echo ''; $loot = json_decode($monster['loot'], true); if($loot) { echo '
'; $number_of_rows = 0; echo ''; $number_of_rows++; echo ''; $number_of_rows++; echo ''; $number_of_rows++; if($monster['summonable'] == 1) echo ''; else { echo ''; } $number_of_rows++; if($monster['convinceable'] == 1) echo ''; else echo ''; echo '
Health: '.$monster['health'].'
Experience: '.$monster['exp'].'
Speed like: '.$monster['speed_lvl'].' level'; $number_of_rows++; if($monster['use_haste']) echo ' (Can use haste)'; echo '
Summon: '.$monster['mana'].' mana
Summon: Impossible
Convince: '.$monster['mana'].' mana
Convince: Impossible
'; $monster['gfx_name'] = trim(mb_strtolower($monster['name'])).".gif"; if(!file_exists('images/monsters/'.$monster['gfx_name'])) { $gfx_name = str_replace(" ", "", $monster['gfx_name']); if(file_exists('images/monsters/' . $gfx_name)) echo ''; else echo ''; } else echo ''; echo '
'; $immunities = json_decode($monster['immunities'], true); if(count($immunities) > 0) { $number_of_rows++; echo ''; } $voices = json_decode($monster['voices'], true); if(count($voices) > 0) { foreach($voices as &$voice) { $voice = '"' . $voice . '"'; } $number_of_rows++; echo ''; } echo '
Immunities: '.implode(', ', $immunities).'
Voices: '.implode(', ', $voices).'
'; function sort_by_chance($a, $b) { if($a['chance'] == $b['chance']) { return 0; } return ($a['chance'] > $b['chance']) ? -1 : 1; } usort($loot, 'sort_by_chance'); $i = 0; foreach($loot as $item) { $name = getItemNameById($item['id']); $tooltip = $name . '
Chance: ' . round($item['chance'] / 1000, 2) . '%
Max count: ' . $item['count']; echo ' ' .$name . ''; $i++; } echo '
'; } echo ''; echo ''; } else { echo "Monster with name " . $monster_name . " doesn't exist."; } //back button echo $twig->render('creatures.back_button.html.twig'); ?>