pageLoadTimeStart(); ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## ## Filename : warsim.php ## ## Type : Attack Simulator File ## ## --------------------------------------------------------------------------- ## ## Developed by : Dzoki (Original) ## ## Refactored by : Shadow ## ## Redesign by : Shadow ## ## --------------------------------------------------------------------------- ## ## Contact : cata7007@gmail.com ## ## Project : TravianZ ## ## URLs: : https://travianz.org ## ## GitHub : https://github.com/Shadowss/TravianZ ## ## --------------------------------------------------------------------------- ## ## License : TravianZ Project ## ## Copyright : TravianZ (c) 2010-2026. All rights reserved. ## ## --------------------------------------------------------------------------- ## ################################################################################# use App\Utils\AccessLogger; include_once("GameEngine/Village.php"); AccessLogger::logRequest(); $battle->procSim($_POST); ?> <?php echo SERVER_NAME ?> - Combat Simulator "; ?>

Combat simulator

tribe; include("Templates/Simulator/res_a".(int)$tribe.".tpl"); foreach($target as $tar) { include("Templates/Simulator/res_d".(int)$tar.".tpl"); } echo "

Type of attack: "; echo $form->getValue('ktyp') == 0 ? "Normal" : "Raid"; echo "

"; echo "

"; if (isset($_POST['result'][7]) && isset($_POST['result'][8])){ if ($form->getValue('ktyp') == 1) { echo "Hint: The ram does not work during a raid.
"; }elseif ($_POST['result'][7] == 0){ echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level 0

"; }elseif ($_POST['result'][7] == $_POST['result'][8]){ echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level ".$form->getValue('walllevel')."

"; }else{ echo "Damage done by ram: from level ".$form->getValue('walllevel')." to level ".(int)$_POST['result'][7]."

"; } } if (isset($_POST['result'][3]) && isset($_POST['result'][4])){ if ($form->getValue('ktyp') == 1) { echo "Hint: The catapult does not shoot during a raid.

"; }elseif ($_POST['result'][3] == 0){ echo "Damage done by catapult: from level ".$form->getValue('kata')." to level 0

"; }elseif ($_POST['result'][3] == $_POST['result'][4]){ echo "Damage done by catapult: from level ".$form->getValue('kata')." to level ".$form->getValue('kata')."

"; }else{ echo "Damage done by catapult: from level ".$form->getValue('kata')." to level ".(int)$_POST['result'][3]."

"; } } } if (!empty($_GET['target'])) { // this only works for Nature, as GET links like this one will come from an oasis if (!$_GET['target'] != 4) { $_GET['target'] = 4; } // fill-in session value-array data foreach ($_GET as $key => $value) { if ($key[0] === 'u' && is_numeric($value)) { $form->setValue('a2_' . substr($key, 1), $value); } } } $target = isset($_POST['target'])? $_POST['target'] : (!empty($_GET['target']) ? array((int) $_GET['target']) : array()); $tribe = isset($_POST['mytribe'])? $_POST['mytribe'] : $session->tribe; if(count($target) > 0) { include("Templates/Simulator/att_".(int)$tribe.".tpl"); echo ""; foreach($target as $tar) { include("Templates/Simulator/def_".(int)$tar.".tpl"); } include("Templates/Simulator/def_end.tpl"); echo "
"; } /** * Ce bonusuri PROPRII a folosit simularea. * * Simulatorul preia automat itemele echipate ale eroului si bonusurile * aliantei. Fara acest panou le-ar aplica in tacere, iar jucatorul n-ar avea * cum sa stie daca rezultatul le include sau nu. */ $wsLines = array(); if (class_exists('HeroBattleBonus') && HeroBattleBonus::enabled() && !empty($session->uid)) { $wsStrength = (int) HeroBattleBonus::statBonus($session->uid); if ($wsStrength > 0) { $wsLines[] = (defined('TZ_WS_ITEM_STRENGTH') ? TZ_WS_ITEM_STRENGTH : 'Equipment strength') . ': +' . number_format($wsStrength) . ''; } $wsMap = HeroBattleBonus::unitBonusMap($session->uid); if (!empty($wsMap)) { foreach ($wsMap as $wsUnit => $wsPer) { // Numele unitatilor sunt constante de limba (U1..U90), nu campuri // in unitdata.php - acolo sunt doar valorile de lupta. $wsConst = 'U' . (int) $wsUnit; $wsName = defined($wsConst) ? constant($wsConst) : $wsConst; $wsLines[] = (defined('TZ_WS_ITEM_UNIT') ? TZ_WS_ITEM_UNIT : 'Weapon bonus') . ': +' . (int) $wsPer . ' / ' . htmlspecialchars($wsName, ENT_QUOTES, 'UTF-8'); } } $wsBon = HeroBattleBonus::bonuses($session->uid); if ($wsBon && defined('HB_VS_NATARS') && !empty($wsBon[HB_VS_NATARS])) { $wsLines[] = (defined('TZ_WS_VS_NATARS') ? TZ_WS_VS_NATARS : 'Against Natars') . ': +' . (int) $wsBon[HB_VS_NATARS] . '%'; } } if (class_exists('AllianceBonus') && AllianceBonus::enabled() && !empty($session->uid)) { $wsMetal = AllianceBonus::multiplier($session->uid, AllianceBonus::METALLURGY); if ($wsMetal > 1.0) { $wsLines[] = (defined('ALLYBONUS_METALLURGY') ? ALLYBONUS_METALLURGY : 'Metallurgy') . ': +' . round(($wsMetal - 1) * 100) . '%'; } } if ($wsLines) { ?>
Defender
Attacker Defender Type of attack
























"; include("Templates/links.tpl"); } ?>
pageLoadTimeEnd()-$start_timer)*1000); ?> ms