<?php //Si le joueur est dans une ville, on regarde si il est actuellement en combat if (verif_battle()) { if (request_confirm('Continue')) { $_final = ""; $end_battle = false; if (verif_town(true)) { $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 ($_SESSION['Mission_Battle'] == 1) { // selection de la mission en cours : la mission suivant la plus recente remporté par le joueur $Mission = get_db('mission_account', array('Player_Mission_Level' => user_data('Account_Mission'), 'Town' => $_SESSION['Town_ID'])); } if ($_SESSION['Chapter_Battle'] == 1) { $Chapter_Level = get_db("chapter_account", array('Chapter_Number' => user_data('Account_Chapter'))); } //Si la HP du monstre est inférieur ou égale à zero le joueur à gagné le combat if (monster_data('HP') <= 0) { $end_battle = true; $Gold_Gained = monster_data('Golds'); $_final .= "Vous avez remporté le combat !!!<br /><br />"; $_final .= "Pièces d'or (PO) + {$Gold_Gained} <br /><br />"; user_set('Account_Golds', user_data('Account_Golds') + $Gold_Gained); if ($_SESSION['Arena_Battle'] !== 1) { $Experience_Gained = monster_data('Experience'); $_final .= "Experience (XP) + {$Experience_Gained} <br />"; user_set('Account_Experience', user_data('Account_Experience') + $Experience_Gained); $loots = list_db('foreign_list', array('table' => 'Caranille_Monster_Loot', 'ID' => 'Loot_Monster_ID', 'value' => monster_data("ID")));
//echo "page :: $page<br/>"; $array_game_secteur = array('Game', 'Guild', 'Map', 'Shop', 'Battle', 'User'); $array_iden_secteur = array('Register', 'User'); $array_game_page = array('chat', 'craft', 'guild', 'character', 'order', 'inventory', 'map', 'town', 'world', 'questlogs', 'questboard', 'diary', 'weapon', 'accessory', 'item', 'Magic_shop', 'Temple'); $array_iden_page = array('login', 'logout', 'register'); $array_news_page = array('comments'); $array_forum_page = array('forum', 'post', 'poster', 'topic', 'main'); $already_call_menu_character = true; $already_call_menu_town = true; $already_call_menu_guild = true; $already_call_menu_profil = true; if ($secteur_module !== 'Admin' && $secteur_module !== 'Moderator') { if (isset($page) && $page != '') { if (in_array($page, $array_game_page) && in_array($secteur_module, $array_game_secteur)) { include_once $_path . "Sources/Map/Modules/Index.php"; include_once path_module(verif_town() ? 'Town' : 'World', 'Map'); load_css('map.css', 'map'); load_css('boussole.css', 'boussole'); load_css('infobulle.css', 'infobulle'); } if (in_array($page, $array_news_page) && $secteur_module === 'Public') { include_once $_path . "Sources/Public/Modules/news-Index.php"; } } if ($page == 'blog') { include_once path_module("Main", "Public"); } // if($page == 'logout') // header(get_link('Main','Public')); } //echo "page :: $page<br/>";
<?php if (verif_connect()) { if (isset($exit) && $exit == true) { echo '<p>' . $message . '<br/><br/>'; echo '<form method="POST" action="' . get_link('Map', 'Map') . '">'; echo '<input type="submit" name="carte" value="' . LanguageValidation::nMsg("btn.return.world") . '"/>' . LanguageValidation::eMsg("btn.return.world"); //Retourner à la carte du monde">'; echo '<input type="hidden" name="token" value="' . generer_token('carte') . '" />'; echo '</form></p>'; } else { if (verif_town()) { $Town_Image = htmlspecialchars(addslashes($information_Town['Town_Image'])); menu_town(); instruction(isset($message) ? $message : ""); bousole("Town"); include_once path_source("map-1", "Map", "Map"); //echo '<div style="float:left; margin-left:35px">'; echo "<img src=\"{$Town_Image}\"><br />"; echo "" . $information_Town['Town_Description'] . "<br /><br />"; echo '<form method="POST" action="' . get_link('Map', 'Map') . '">'; echo '<input type="submit" name="Exit_Town" value="' . LanguageValidation::nMsg("btn.leave.town") . '"/>' . LanguageValidation::eMsg("btn.leave.town"); //Quitter la Ville">'; echo '<input type="hidden" name="token" value="' . generer_token('Exit_Town-' . $information_Town['Town_ID']) . '" />'; echo '</form>'; //echo '</div>'; } } }
/** * gere la construction des liens en absolue * @param $Module => la page * @param $directory => le repertoire * @author Dimitri * exemple <a href='". get_Link("Main","Admin") ?>" >Administration</a> */ function get_link($Module = "Main", $directory = "", $params = array()) { global $_url, $_path, $_rewrite, $install_step, $installing, $_configured, $MMORPG_Template; $parametres = ""; if (!empty($params)) { foreach ($params as $key => $value) { if ($key != "") { if ($_rewrite && $_configured && !$installing && $install_step > 4) { $parametres .= $key . "-" . $value . "/"; } else { $parametres .= $key . "=" . $value . "&"; } } } } if ($_rewrite && $_configured && !$installing && $install_step > 4) { $parametres = rtrim($parametres, "/"); } else { $parametres = rtrim($parametres, "&"); } if ($installing && $install_step < 5) { return $_url . "index.php?install={$Module}" . ($parametres != "" ? '&' . $parametres : ''); } debug_log("get_link({$Module}) caranile is installed"); if (strcasecmp($Module, "install") == 0) { // ($Module==="Install" ) if (file_exists($_path . "Sources/Install/index.php")) { if ($_rewrite && $_configured && !$installing && $install_step > 4) { return $_url . "install" . ($parametres != "" ? '?' . $parametres : '') . ".html"; } else { return $_url . "index.php?install=index"; } } } if (strcasecmp($directory, "install") == 0) { // ($directory==="Install") if (file_exists($_path . "Sources/Contenu/{$Module}.php")) { if ($_rewrite && $_configured && !$installing && $install_step > 4) { return $_url . "install/" . $Module . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?install={$Module}"; } } } debug_log("get_link({$Module}) install is not required"); if ($directory == "") { if (file_exists($_path . 'Design/' . $MMORPG_Template . "/" . $Module . '.php')) { if ($_rewrite && $_configured && !$installing && $install_step > 4) { return $_url . $Module . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?Public=" . $Module; } } } //return($_path.'Templates/'.$MMORPG_Template."/".$Module.'.php'); debug_log("get_link({$Module},{$MMORPG_Template}) not template page"); switch (ucfirst($directory)) { case '': default: if (file_exists($_path . "Sources/Public/Modules/" . ucfirst($Module) . ".php")) { if ($_rewrite) { return $_url . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?public={$Module}" . ($parametres != "" ? '&' . $parametres : ''); } } break; case 'Map': if (ucfirst($Module) == 'Map') { $Module = verif_town(true) ? 'Town' : 'World'; } if (file_exists($_path . "Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php")) { if ($_rewrite) { return $_url . strtolower($directory) . "/" . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?" . strtolower($directory) . "=" . strtolower($Module) . ($parametres != "" ? '&' . $parametres : ''); } } else { debug_log("file not exists({$_path}/Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php)", false); } break; case 'Register': $step = isset($_SESSION['Account_Register']['step']) ? $_SESSION['Account_Register']['step'] : 1; if ($step === 1) { $Module = 'Members'; } elseif ($step === 2) { $Module = 'Order'; } elseif ($step === 3) { $Module = 'Race'; } elseif ($step === 4) { $Module = 'Classe'; } elseif ($step === 5) { $Module = 'Bonus'; } elseif ($step === 6) { $Module = 'End'; } else { $Module = 'Members'; } if (file_exists($_path . "Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php")) { if ($_rewrite) { return $_url . strtolower($directory) . "/" . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?" . strtolower($directory) . "=" . strtolower($Module) . ($parametres != "" ? '&' . $parametres : ''); } } else { debug_log("file not exists({$_path}/Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php)", false); } break; case 'Chat': case 'Public': case 'Forum': case 'User': case 'Game': case 'Guild': case 'Admin': case 'Battle': case 'Moderator': if (file_exists($_path . "Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php")) { debug_log("file exists({$_path}/Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php)", false); if ($_rewrite) { $final_link = $_url . strtolower($directory) . "/" . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { $final_link = $_url . "index.php?" . strtolower($directory) . "=" . strtolower($Module) . ($parametres != "" ? '&' . $parametres : ''); } return $final_link; } else { debug_log("file not exists({$_path}/Sources/" . ucfirst($directory) . "/Modules/" . ucfirst($Module) . ".php)", false); } break; case 'Shop': if (file_exists($_path . "Sources/" . ucfirst($directory) . "/Modules/Index.php")) { if ($_rewrite) { return $_url . strtolower($directory) . "/" . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?" . strtolower($directory) . "=" . strtolower($Module) . ($parametres != "" ? '&' . $parametres : ''); } } break; /** case 'Chat' :{ if(file_exists($_path."Sources/User/Modules/".$directory."/".ucfirst($Module).".php")) if($_rewrite) return $_url.strtolower($directory)."/".strtolower($Module).".html".($parametres !="" ? '?'.$parametres : '' ); else return $_url."?".strtolower($directory)."=".strtolower($Module).""; }break; **/ /** case 'Chat' :{ if(file_exists($_path."Sources/User/Modules/".$directory."/".ucfirst($Module).".php")) if($_rewrite) return $_url.strtolower($directory)."/".strtolower($Module).".html".($parametres !="" ? '?'.$parametres : '' ); else return $_url."?".strtolower($directory)."=".strtolower($Module).""; }break; **/ case 'Contenu': case 'Content': // pages institutionnelles | A propos | Contact | Mentions légales | Règlement | FAQ if (file_exists($_path . "Sources/Contenu/Modules/Index.php")) { //".ucfirst($Module)." if ($_rewrite) { return $_url . "Contenu/" . strtolower($Module) . ($parametres != "" ? '/' . $parametres : '') . ".html"; } else { return $_url . "index.php?contenu=" . strtolower($Module) . ($parametres != "" ? '&' . $parametres : ''); } } break; case 'Gallery': // capture d'ecran if (file_exists($_path . "Design/Images/" . $directory . "/" . $Module)) { return $_url . "Design/Images/" . $directory . "/" . $Module . ($parametres != "" ? '&' . $parametres : ''); } break; } }
<?php include_once $_path . "Sources/Map/Modules/Index.php"; debug_log("exec world....."); if (verif_connect()) { $enter = false; if (!verif_town()) { if (request_confirm('deplacement')) { if (verifier_token(600, get_link('World', 'Map'), 'deplacement-Map')) { $deplacement = explode('|', $_POST['deplacement']); // On sépare les deux valeurs du déplacement. Ici On aura $deplacement['0'] qui contiendra la valeur du déplacement horizontalement et $deplacement ['1'] celles du déplacement vertical. $valX = $deplacement['0']; // On utilise des noms de variable plus clairs. $valY = $deplacement['1']; $newX = $valX + user_data('Account_PosX'); // On calcule les hypothétiques nouvelles coordonnées $newY = $valY + user_data('Account_PosY'); $verif = get_db('coords_account', compact($newX, $newY)); // Recherche des personnages à la case où le joueur souhaite aller. if (!empty($verif)) { // S'il y a déjà quelqu'un sur cette case. $message = 'Tu ne peux pas te déplacer en ' . $newX . ' | ' . $newY . "<br />\n"; $message .= 'Cette case est occupée par ' . $verif['Account_Pseudo'] . "\n"; } else { //mysql_query("UPDATE Caranille_Accounts SET posx='$newX', posy='$newY' WHERE Account_Name='".user_data('Account_Pseudo')."';") ); // Et maintenant seulement on met à jour ! update_db('Caranille_Accounts', array('Account_PosX' => $newX, 'Account_PosY' => $newY, 'Account_ID' => user_data('Account_ID'))); $message = 'Tu réussis à te déplacer en <br/>' . $newX . ' | ' . $newY . "\n"; } } } if (request_confirm('recolte')) {
<div class="games"> <div class="content"> <h3>Carte</h3> <ul> <li><?php if (isset($racine) && $racine != "") { include_once path_view('Index', 'Shop'); } ?> </li> <li><?php include_once path_view(verif_town() ? 'Town' : 'World', 'Map'); ?> </li> <li><?php include_once path_view('Accessory', 'Shop'); ?> </li> </ul> </div> <div class="aside"> <h3>Auberge</h3> <ul> <?php include_once path_view('Inn', 'Map'); ?>
?> " method="post"> <input type="submit" value="⇘" /> <input type="hidden" name="deplacement" value="1|-1" /> <input type="hidden" name="token" value="<?php echo $bousole_token; ?> " /> </form> </td> </tr> </table> <?php unset($bousole_token); } } function instruction($message = "") { ?> <div><!-- style="position:fixed;top:320px;right:330px;width:200px;display:block"--> <?php //if(isset($message) && $message!="") echo $message ?> La carte vous montrera tous les lieux où vous pouvez aller que çe soit pour vous balader ou pour une mission<br /> </div> <?php } load_css('map.css', 'map'); load_css('boussole.css', 'boussole'); $baseline = "Bienvenue " . (!verif_town(true) ? "dans la carte du monde" : "à " . $information_Town['Town_Name']);