add_diary($message); $_final .= $message; } if ($_SESSION['Chapter_Battle'] == 1) { $_final .= $Chapter_Level['Chapter_Ending']; } if ($_SESSION['Mission_Battle'] == 1) { $_final .= $Mission['Mission_Victory']; } $_final .= '<form method="POST" action="' . $return . '">'; $_final .= '<input type="submit" name="End_Battle" value="continuer">'; $_final .= '</form>'; } //Si la HP du personnage et inférieur ou égale à 0 le joueur à perdu le combat et sera soigné if (user_data('Account_HP_Remaining') <= 0) { $full_life = perso_data('HP_Total'); $end_battle = true; $return = get_link("Main", "Public"); // echec dans un donjon ou une mission, on l'emmene à l'hopital..... if ($_SESSION['Dungeon_Battle'] == 1 || $_SESSION['Mission_Battle'] == 1) { $Town_Price_INN = htmlspecialchars(addslashes($information_Town['Town_Price_INN'])); user_set('Account_Golds', user_data('Account_Golds') - $Town_Price_INN); $HP_recup = $full_life; } if ($_SESSION['Arena_Battle'] == 1) { $message = "Vous avez perdu le combat"; $message .= "Votre défaite dans l'arène vous fait perdre 1 points de notorieté<br />"; $HP_recup = $full_life * ($percent_life_restore_arena / 100); debug_log("HP_recup::{$HP_recup} = {$full_life}*({$percent_life_restore_chapter}/100)<br/>"); user_set('Account_Notoriety', user_data('Account_Notoriety') - 1); $Player_ID = monster_data('ID');
' class='barre' id='xp' > <div style='width:<?php echo $xp_purcent; ?> px;' > </div> <em style='width:<?php echo 100 - $xp_purcent; ?> px;' class="restant"><?php echo $Next_Level; ?> </em> </div> <br /><br /> <span class="important">Force</span> : <?php echo perso_data('Strength_Total'); ?> <br /> <span class="important">Magie</span> : <?php echo $_SESSION['Magic_Total']; ?> <br /> <span class="important">Agilité</span> : <?php echo $_SESSION['Agility_Total']; ?> <br /> <span class="important">Défense</span> : <?php echo $_SESSION['Defense_Total']; ?> <br />
$Negative_Magic_Damage_Player = getMonsterDefense(); //mt_rand($Monster_MIN_Defense, $Monster_MAX_Defense); $Positive_Magic_Damage_Player = mt_rand($MIN_Magic, $MAX_Magic) + $Magic_Effect; $Player_Total_Magic_Damage = htmlspecialchars(addslashes($Positive_Magic_Damage_Player)) - htmlspecialchars(addslashes($Negative_Magic_Damage_Player)); if ($Player_Total_Magic_Damage <= 0) { $Player_Total_Magic_Damage = 0; } $_SESSION['Monster_HP'] = monster_data('HP') - htmlspecialchars(addslashes($Player_Total_Magic_Damage)); $message = "{$Magic_Choice} a infligé {$Player_Total_Magic_Damage} HP de dégat au " . monster_data('Name') . "<br /><br />"; add_diary($message); } elseif ($Magic_Type == "Health") { //non utilisé ??? //$Monster_MIN_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) / $bonus_malus_battle; //$Monster_MAX_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) * $bonus_malus_battle; $Player_Health = mt_rand($MIN_Magic, $MAX_Magic) + $Magic_Effect; $Life_Difference = perso_data('HP_Total') - htmlspecialchars(addslashes($_SESSION['HP'])); if ($Player_Health >= $Life_Difference) { $_SESSION['HP'] = htmlspecialchars(addslashes($_SESSION['HP'])) + htmlspecialchars(addslashes($Life_Difference)); $Player_Health = htmlspecialchars(addslashes($Player_Health)); } else { $_SESSION['HP'] = htmlspecialchars(addslashes($_SESSION['HP'])) + htmlspecialchars(addslashes($Player_Health)); } $Monster_Image = monster_data('Image'); $message = "{$Magic_Choice} vous a soigné de {$Player_Health} <br /><br />"; } user_set('Account_MP_Remaining', $Remaining_MP); user_record(); $Total_Damage_Monster = getMonsterDamage(); $message .= "Le " . monster_data('Name') . " vous a infligé {$Total_Damage_Monster} HP de dégat<br /><br />"; add_diary($message); $roaster_action = true;
function get_perso_card() { global $already_call_perso_card, $installing, $secteur_module, $Next_Level, $array_character_stats; if (!$already_call_perso_card) { if (!$installing) { if (verif_connect(true) && ($secteur_module !== 'Admin' && $secteur_module !== 'Moderator' && $secteur_module !== 'Forum')) { if (isset($Next_Level)) { $hp_purcent = user_data('Account_HP_Remaining') / perso_data('HP_Total') * 100; $mp_purcent = user_data('Account_MP_Remaining') / perso_data('MP_Total') * 100; $xp_purcent = user_data('Account_Experience') / user_data('Level_Experience_Required') * 100; ?> <div class="important"><?php echo LanguageValidation::iMsg("label.pseudo.card"); ?> :</div> <?php echo user_data('Account_Pseudo'); ?> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.guild.card"); ?> :</div> <?php echo guild_data('Guild_Name'); ?> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.order.card"); ?> :</div> <?php echo user_data('Order_Name'); ?> <br /><br /> <div class="important"><?php echo LanguageValidation::iMsg("label.level.card"); ?> </div> : <?php echo user_data('Level_Number'); ?> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.hp.card"); ?> </div> : <div title='<?php echo user_data('Account_HP_Remaining') . "/" . perso_data('HP_Total'); ?> ' class='barre' id='hp' > <div style='width:<?php echo $hp_purcent; ?> px;' ></div> </div> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.mp.card"); ?> </div> : <div title='<?php echo user_data('Account_MP_Remaining') . "/" . perso_data('MP_Total'); ?> ' class='barre' id='mp' > <div style='width:<?php echo $mp_purcent; ?> px;' ></div> </div> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.xp.card"); ?> </div> : <div title='<?php echo user_data('Account_Experience') . "/" . user_data('Level_Experience_Required'); ?> ' class='barre' id='xp' > <div style='width:<?php echo $xp_purcent; ?> px;' > </div> <em style='width:<?php echo 100 - $xp_purcent; ?> px;' class="restant"><?php echo $Next_Level; ?> </em> </div> <br /><br /> <?php foreach ($array_character_stats as $char) { ?> <div class="important"><?php echo LanguageValidation::iMsg("label." . strtolower($char) . ".card"); ?> </div> : <?php echo perso_data(ucfirst($char) . '_Total'); ?> <br /> <?php } ?> <br /> <div class="important"><?php echo LanguageValidation::iMsg("label.gold.card"); ?> </div> : <?php echo render_money(); ?> <br/> <div class="important"><?php echo LanguageValidation::iMsg("label.notoriety.card"); ?> </div> : <div class="gain notoriety"><?php echo user_data('Account_Notoriety'); ?> </div><br /><br /> <?php } } } $already_call_perso_card = true; } }
if ($Item_Effect >= $Life_Difference) { $Remaining_HP = htmlspecialchars(addslashes($_SESSION['HP'])) + htmlspecialchars(addslashes($Life_Difference)); $Item_Effect = htmlspecialchars(addslashes($Life_Difference)); } else { $Remaining_HP = htmlspecialchars(addslashes($_SESSION['HP'])) + htmlspecialchars(addslashes($Item_HP_Effect)); } //$_SESSION['HP'] = htmlspecialchars(addslashes($_SESSION['HP'])) - htmlspecialchars(addslashes($Total_Damage_Monster)); user_set('Account_HP_Remaining', $Remaining_HP); user_record(); use_item($Item_ID, $inventory_ID); $message = "{$Item_Name} vous a soigné de {$Item_Effect} <br /><br />"; add_diary($message); $used = true; } if ($Item_Type == "Magic") { $Magic_Difference = perso_data('MP_Total') - htmlspecialchars(addslashes($_SESSION['MP'])); if ($Item_Effect >= $Magic_Difference) { $Remaining_MP = htmlspecialchars(addslashes($_SESSION['MP'])) + htmlspecialchars(addslashes($Magic_Difference)); $Item_Effect = htmlspecialchars(addslashes($Magic_Difference)); } else { $Remaining_MP = htmlspecialchars(addslashes($_SESSION['MP'])) + htmlspecialchars(addslashes($Item_MP_Effect)); } user_set('Account_MP_Remaining', $Remaining_MP); user_record(); use_item($Item_ID, $inventory_ID); $message = "{$Item_Name} vous a soigné de {$Item_Effect} <br /><br />"; $used = true; } if ($Item_Type == "Poison") { monster_set('etat', $Item_Type); }
<?php //Si le joueur est dans une ville, on regarde si il est actuellement en combat if (verif_battle()) { if (request_confirm('Attack')) { $MIN_Strength = perso_data('Strength_Total') / $bonus_malus_battle; $MAX_Strength = perso_data('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 = "Votre attaque 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" . "<br /><br />"; add_diary($message); $roaster_action = true; } }
<?php // l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil $title = ""; $baseline = LanguageValidation::iMsg("welcome.map.inn"); //""; if (verif_connect()) { if (verif_town()) { $array_town = array('Town_ID' => $_SESSION['Town_ID'], 'Account_ID' => user_data('Account_ID')); debug_log("verif inside", false); $information_Town = get_db('request_town', $array_town); if (request_confirm('Rest')) { if (user_data('Account_Golds') >= $information_Town['Town_Price_INN']) { $Gold = user_data('Account_Golds') - htmlspecialchars(addslashes($information_Town['Town_Price_INN'])); $HP_Total = perso_data('HP_Total'); $MP_Total = perso_data('MP_Total'); update_db('Caranille_Accounts', array('Account_HP_Remaining' => $HP_Total, 'Account_MP_Remaining' => $MP_Total, 'Account_Golds' => $Gold, 'Account_ID' => $ID)); } } } }
/** return les degats causé par le joueur dans un tour **/ function getPlayerDamage() { if (request_confirm('Attack')) { $MIN_Strength = perso_data('Strength_Total') / $bonus_malus_battle; $MAX_Strength = perso_data('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)); } if (request_confirm('End_Invocations')) { $Invocation_Choice = htmlspecialchars(addslashes($_POST['Invocation'])); $MP_Choice = htmlspecialchars(addslashes($_POST['MP_Choice'])); if ($_SESSION['MP'] >= $MP_Choice) { $Invocation = get_db("edit_admin", array('table' => 'Caranille_Invocations', 'ID' => 'Invocation_Name', 'value' => $Invocation_Choice)); $Invocation_Damage = $Invocation['Invocation_Damage']; // non utilisé ??? //$Monster_MIN_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) / $bonus_malus_battle; //$Monster_MAX_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) * $bonus_malus_battle; $Invocation_Total_Damage = htmlspecialchars(addslashes($Invocation_Damage)) * htmlspecialchars(addslashes($MP_Choice)); $_SESSION['Monster_HP'] = monster_data('HP') - htmlspecialchars(addslashes($Invocation_Total_Damage)); } else { $message = 'Vous n\'avez pas assez de MP'; } } }
<div class="entry"> <div class="left">Vie</div> <div class="right"><div title='<?php echo user_data('Account_HP_Remaining') . "/" . perso_data('HP_Total'); ?> ' class='barre' id='hp' > <div style='width:<?php echo $hp_purcent; ?> px;' ></div> </div></div> </div> <div class="entry"> <div class="left">Mana</div> <div class="right"><div title='<?php echo user_data('Account_MP_Remaining') . "/" . perso_data('MP_Total'); ?> ' class='barre' id='mp' > <div style='width:<?php echo $mp_purcent; ?> px;' ></div> </div></div> </div> <div class="entry"> <div class="left">Or</div> : <?php echo render_money(); ?> </div> <div class="entry"> <div class="left">Réputation</div> : <div class="gain notoriety"><?php