<?php if ($roaster_action && $_SESSION['Arena_Battle'] !== 1) { if (has_roaster()) { $recrus = get_roaster(); if (!empty($recrus)) { $ct_recrus = count($recrus); foreach ($recrus as $Account) { $Strength_Total = $Account['Level_Strength'] + $Account['Account_Strength_Bonus'] + $roaster_max_bonus; $MIN_Strength = $Strength_Total / $bonus_malus_battle; $MAX_Strength = $Strength_Total * $bonus_malus_battle; $Positive_Damage_Player = mt_rand($MIN_Strength, $MAX_Strength); $Negative_Damage_Player = getMonsterDefense(); //mt_rand($Monster_MIN_Defense, $Monster_MAX_Defense); $Total_Damage_Player = htmlspecialchars(addslashes($Positive_Damage_Player)) - htmlspecialchars(addslashes($Negative_Damage_Player)); //Si les dégats du joueurs ou du monstre sont égal ou inférieur à zero if ($Total_Damage_Player <= 0) { $Total_Damage_Player = 0; } $_SESSION['Monster_HP'] = monster_data('HP') - htmlspecialchars(addslashes($Total_Damage_Player)); //$Total_Damage_Monster = getMonsterDamage(); $message .= "l'attaque de " . $Account['Account_Pseudo'] . " a infligé " . $Total_Damage_Player . "HP de dégat au " . monster_data('Name') . "<br /><br />"; //$message .= "Le ".monster_data('Name')." vous a infligé ".$Total_Damage_Monster."HP de dégat"; //add_diary($message); } } } }
<?php if (verif_connect()) { //Si le joueur est dans une ville, on regarde si il est actuellement en combat if (verif_battle()) { if (!has_roaster()) { get_ocedar(); } else { compo_roaster(); } if ($_SESSION['Arena_Battle'] == 0) { echo "<img title='" . monster_data('Image_Name') . "' height='50px' src='data:" . monster_data('Image_Type') . ";base64," . monster_data('Image_Base64') . "' /><br/>"; } if ($_SESSION['Arena_Battle'] == 1) { get_arena_ocedar(); } if (request_confirm('Continue')) { if ($end_battle) { echo $_final; close_battle(); } else { //Si la HP du monstre est supérieur à 0 et que la HP du personnage est supérieur à zero le combat commence ou continue if (monster_data('HP') > 0 && user_data('Account_HP_Remaining') > 0) { echo "Combat de " . monster_data('Name') . " Contre " . user_data('Account_Pseudo') . "<br /><br />"; echo "HP de " . monster_data('Name') . " " . monster_data('HP') . " HP<br />"; echo "Vos HP: " . user_data('Account_HP_Remaining') . " HP<br /><br />"; echo '<form method="POST" action="' . get_link('Battle', 'Game') . '">'; echo '<input type="submit" name="Attack" value="Attaquer"/><br />'; echo '<input type="submit" name="Magics" value="Magies"/><br />'; echo '<input type="submit" name="Invocations" value="Invocation"/><br />'; echo '<input type="submit" name="Items" value="Objets"/><br />';