commit 71bc88162e471f230c7bf6338822136c7c0ebef0 parent 9755eacb3bd008eb99998cea5ac4704cfad0afa4 Author: Kebigon <git@kebigon.xyz> Date: Mon, 17 Feb 2020 21:24:29 +0900 RPG Illusion 1.2c (2006/08/17) Diffstat:
521 files changed, 13429 insertions(+), 4821 deletions(-)
diff --git a/A lire.txt b/A lire.txt @@ -0,0 +1,116 @@ +!-----------------------------------------------! +! ! +! RPG ILLUSION VERSION 1.2C ! +! ! +!-----------------------------------------------! +Site officiel: http://rpgillusion.franceserv.com +Forum officiel: http://rpgillusion.franceserv.com/forum/ + + +!-----------------------------------------------! +! INSTALLATION DE RPG ILLUSION 1.2c ! +!-----------------------------------------------! +Commencez par ouvrir et configurer les fichier config.php avec +votre bloc note habituel ou autre editeur de texte. + +Puis envoyer le répertoire de rpg illusion sur votre serveur + +Enfin rendez vous à la page install.php et suivez les étapes. + +!-----------------------------------------------! +! OPEN SOURCE RPG ILLUSION ! +!-----------------------------------------------! + +Ce programme est distribué sous license Open source. +Vous pouvez le modifier librement. + +ATTENTION: + +Le copyright concerne les images du jeu (appartenant à Nexon - Maplestory). Pour évitez tout problèmes, +veuillez laisser le copyright en l'état. + + +!-----------------------------------------------! +! Remerciement a tout le taff de rpg illusion ! +!-----------------------------------------------! + C'est a dire remercié : + -Sff + -Inkonito + -Noia + -Tsunami + -Almost + -Mark + -Darkmore (moi) + -ggdj3000 + -WhiteAnge + -Tchang + -Nipioko + -darknono + -Moi1449 + -Grosdunords + + +!-----------------------------------------------! +! CE QU'IL RESTAIT A FAIRE ! +!-----------------------------------------------! +- Créations des fonction du menu des maison [Fait 1.2c] +- Régler fonction allopass(4 fonction allopass)[Fait 1.2c] +- NOuveau design (+ image des ville et compagnie)[Fait 1.2c] +- Modification de l'install (Par Darkmore=moi)[Fait 1.2c] +- Correction du resultat du sondage (merci noia)[Fait 1.2c] +- Correction de l'editbloc dans l'admin (Par Darkmore=moi)[Fait 1.2c] + + +!-----------------------------------------------! +! CORRECTIONS IMPORTANT ! +!-----------------------------------------------! +- Enelevage des faille dans le forum +- Enelevage des faille dans les commentaires +- Enelevage des faille dans les signature du forum +- Enelevage des faille dans les maison. +- Enelevage des faille dans la babblebox. + +!-----------------------------------------------! +! NOUVEAUTEs ! +!-----------------------------------------------! +- NOUVEAU DESIGN +- Ajout du moderation. +- Ajout de l'upload d'avatar (modifier par darkmore). +- Ajout des modo et des admin en couleurs. +- Ajout de 20 avatar. +- Ajout du compteur de message. +- Ajout de la messagerie. +- Ajout du clan. +- Ajout du stock objet (en banque). +- Ajout du nouveau template de combat. +- Ajout de 50 image de monstres avec transparence. +- Ajout des smiley et des bbcode dans le forum . +- Ajout des smiley et des bbcode dans les news et nouvelles . +- Ajout des smiley et des bbcode dans les commentaire et la bablebox . +- Ajout des avatar dans le forum. +- Ajout des signature dans le forum. +- Ajout de l'auteur dans les news. +- Ajout du marché et de ses extension (mod revente , sacados ...). +- Finissions des maison effectué. +- Ajout de l'enchanteur +- Ajout de l'eglise +- Ajout du point mis en place +- Ajout de deux nouvelle possibilitez pour le allopass +- Ajout de l'edit forum , addsort,addville dans l'admin +- Ajout du systeme de travaille +- Ajout du systeme d'achat de sort +- Ajout du classement +- Ajout du suppression de compte +- Correction de la fonction train +- Ajout des quêtes +- Ajout de l'editquete +- Ajout des encheres +- Ajout des barre de vie, mp , hp sur la map. +- Possibiliter de changer la monnaie de son jeu. +Et plein d'autre petite amélioration + + + + + + diff --git a/admin/admin.php b/admin/admin.php @@ -1,17 +1,18 @@ -<?php // admin.php :: primary administration script. +<?php // admin.php :: Administration du script. include('../lib.php'); include('../cookies.php'); +include('../bbcode.php'); $link = opendb(); $userrow = checkcookies(); -if ($userrow == false) { die("Please log in to the <a href=\"../login.php?do=login\">game</a> before using the control panel."); } -if ($userrow["authlevel"] != 1) { die("You must have administrator privileges to use the control panel."); } +if ($userrow == false) { die("Merci de vous loger dans le <a href=\"./login.php?do=login\">jeu</a> avant d'utiliser le panneau de commande."); } +if ($userrow["authlevel"] != 1) { die("Vous devez avoir des privilèges d'administrateur pour employer le panneau de commande."); } $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $controlrow = mysql_fetch_array($controlquery); if (isset($_GET["do"])) { $do = explode(":",$_GET["do"]); - + if ($do[0] == "main") { main(); } elseif ($do[0] == "items") { items(); } elseif ($do[0] == "edititem") { edititem($do[1]); } @@ -28,456 +29,578 @@ if (isset($_GET["do"])) { elseif ($do[0] == "users") { users(); } elseif ($do[0] == "edituser") { edituser($do[1]); } elseif ($do[0] == "news") { addnews(); } - + elseif ($do[0] == "sondage") { addsondage(); } + elseif ($do[0] == "blocs") { blocs(); } + elseif ($do[0] == "babble") { babble(); } + elseif ($do[0] == "message2") { message2(); } + elseif ($do[0] == "historique") { historique(); } + elseif ($do[0] == "comment") { comment(); } + elseif ($do[0] == "message") { message(); } + elseif ($do[0] == "newsaccueil") { newsaccueil(); } + elseif ($do[0] == "interet") { interet(); } + elseif ($do[0] == "items2") { items2(); } + elseif ($do[0] == "edititem2") { edititem2($do[1]); } + elseif ($do[0] == "addville") { addville(); } + elseif ($do[0] == "addsort") { addsort(); } + elseif ($do[0] == "stats") { stats(); } + elseif ($do[0] == "villenatal") { villenatal(); } + elseif ($do[0] == "forum") { forum(); } + elseif ($do[0] == "editforum") { editforum($do[1]); } + elseif ($do[0] == "metier") { Metier(); } + elseif ($do[0] == "metier2") { Metier2(); } + elseif ($do[0] == "quete") { quete(); } + elseif ($do[0] == "createquete") { createquete(); } + elseif ($do[0] == "maisons") { maisons(); } + elseif ($do[0] == "editmaisons") { editmaisons($do[1]); } + elseif ($do[0] == "quetes") { quetes(); } + elseif ($do[0] == "editquetes") { editquetes($do[1]); } + + + } else { donothing(); } function donothing() { - $page = "Welcome to the Dragon Knight Administration section. Use the links on the left bar to control and edit various elements of the game.<br /><br />Please note that the control panel has been created mostly as a shortcut for certain individual settings. It is meant for use primarily with editing one thing at a time. If you need to completely replace an entire table (say, to replace all stock monsters with your own new ones), it is suggested that you use a more in-depth database tool such as <a href=\"http://www.phpmyadmin.net\" target=\"_new\">phpMyAdmin</a>. Also, you may want to have a copy of the Dragon Knight development kit, available from the <a href=\"http://dragon.se7enet.com/dev.php\">Dragon Knight homepage</a>.<br /><br />Also, you should be aware that certain portions of the DK code are dependent on the formatting of certain database results (for example, the special attributes on item drops). While I have attempted to point these out throughout the admin script, you should definitely pay attention and be careful when editing some fields, because mistakes in the database content may result in script errors or your game breaking completely."; - admindisplay($page, "Admin Home"); + $page = "Bienvenue sur la page d'admin de RPG illusion 1.2c . Ici vous pouvez modifier ou éditer librement plusieurs paramètres. <br><br> En cas de problème, veuillez contactez l'auteur de script à cette adresse : webmaster@rpgillusion.com<br><br><br><center><img src=\"../images/im_admin.gif\"/><br><br>Pour que RPG illusion perdure et que nous puissions financer de meilleurs services, nous vous invitons à faire un don du montant de votre choix. <font color=cc0000><b>Ceci est très important, car sans ces donations, le RPG pourrait <u>perdre sa licence open source et devenir payant</u> pour financer le développement du jeu.</b></font></span><br><br> + <form action=https://www.paypal.com/cgi-bin/webscr method=post> +<input type=hidden name=cmd value=_xclick> +<input type=hidden name=business value=ffstory1@hotmail.com> +<input type=hidden name=item_name value=RPG illusion donation> +<input type=hidden name=no_note value=1> +<input type=hidden name=currency_code value=EUR> +<input type=hidden name=tax value=0> +<input type=hidden name=bn value=PP-DonationsBF> +<input type=image src=https://www.paypal.com/fr_FR/i/btn/x-click-but21.gif border=0 name=submit alt=Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée !> +</form> + </center>"; + + admindisplay($page, "Administration"); } function main() { - - if (isset($_POST["submit"])) { - extract($_POST); - $errors = 0; - $errorlist = ""; - if ($gamename == "") { $errors++; $errorlist .= "Game name is required.<br />"; } - if (($gamesize % 5) != 0) { $errors++; $errorlist .= "Map size must be divisible by five.<br />"; } - if (!is_numeric($gamesize)) { $errors++; $errorlist .= "Map size must be a number.<br />"; } - if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "You must specify a forum address when using the External setting.<br />"; } - if ($class1name == "") { $errors++; $errorlist .= "Class 1 name is required.<br />"; } - if ($class2name == "") { $errors++; $errorlist .= "Class 2 name is required.<br />"; } - if ($class3name == "") { $errors++; $errorlist .= "Class 3 name is required.<br />"; } - if ($diff1name == "") { $errors++; $errorlist .= "Difficulty 1 name is required.<br />"; } - if ($diff2name == "") { $errors++; $errorlist .= "Difficulty 2 name is required.<br />"; } - if ($diff3name == "") { $errors++; $errorlist .= "Difficulty 3 name is required.<br />"; } - if ($diff2mod == "") { $errors++; $errorlist .= "Difficulty 2 value is required.<br />"; } - if ($diff3mod == "") { $errors++; $errorlist .= "Difficulty 3 value is required.<br />"; } - - if ($errors == 0) { - $query = doquery("UPDATE {{table}} SET gamename='$gamename',gamesize='$gamesize',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',adminemail='$adminemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble' WHERE id='1' LIMIT 1", "control"); - admindisplay("Settings updated.","Main Settings"); - } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Main Settings"); - } - } - - global $controlrow; - + +if (isset($_POST["submit"])) { +extract($_POST); +$errors = 0; +$errorlist = ""; +if ($gamename == "") { $errors++; $errorlist .= "Le nom de jeu est exigé.<br />"; } +if (($gamesize % 5) != 0) { $errors++; $errorlist .= "La taille de carte doit être divisible par cinq.<br />"; } +if (!is_numeric($gamesize)) { $errors++; $errorlist .= "La taille de la carte doit être un nombre.<br />"; } +if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "Vous devez indiquer l'adresse du forum externe.<br />"; } +if ($class1name == "") { $errors++; $errorlist .= "Le nom du Village 1 est exigé.<br />"; } +if ($class2name == "") { $errors++; $errorlist .= "Le nom du Village 2 est exigé.<br />"; } +if ($class3name == "") { $errors++; $errorlist .= "Le nom du Village 3 est exigé.<br />"; } +if ($diff1name == "") { $errors++; $errorlist .= "Le nom de la difficulté 1 est exigé.<br />"; } +if ($diff2name == "") { $errors++; $errorlist .= "Le nom de la difficulté 2 est exigé.<br />"; } +if ($diff3name == "") { $errors++; $errorlist .= "Le nom de la difficulté 3 est exigé.<br />"; } +if ($diff2mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 2 est exigée.<br />"; } +if ($diff3mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 3 est exigée.<br />"; } + +$gamename = addslashes($gamename); +if ($errors == 0) { + +$query = doquery("UPDATE {{table}} SET gamename='$gamename',gamesize='$gamesize',monnaie='$monnaie',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',adminemail='$adminemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble',register='$register' WHERE id='1' LIMIT 1", "control"); +admindisplay("Réglages mis à jour.","Main Settings"); +} else { +admindisplay("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Veuillez retourner et essayer encore.", "Menu des réglages"); +} +} + +global $controlrow; + $page = <<<END -<b><u>Main Settings</u></b><br /> -These options control several major settings for the overall game engine.<br /><br /> +<b><u>Menu des réglages</u></b><br /> +Ces options commandent plusieurs paramètres principaux du jeu.<br /><br /> <form action="admin.php?do=main" method="post"> <table width="90%"> -<tr><td width="20%"><span class="highlight">Game Open:</span></td><td><select name="gameopen"><option value="1" {{open1select}}>Open</option><option value="0" {{open0select}}>Closed</option></select><br /><span class="small">Close the game if you are upgrading or working on settings and don't want to cause odd errors for end-users. Closing the game will completely halt all activity.</span></td></tr> -<tr><td width="20%">Game Name:</td><td><input type="text" name="gamename" size="30" maxlength="50" value="{{gamename}}" /><br /><span class="small">Default is "Dragon Knight". Change this if you want to change to call your game something different.</span></td></tr> -<tr><td width="20%">Game URL:</td><td><input type="text" name="gameurl" size="50" maxlength="100" value="{{gameurl}}" /><br /><span class="small">Please specify the full URL to your game installation ("http://www.server.com/dkpath/index.php"). This gets used in the registration email sent to users. If you leave this field blank or incorrect, users may not be able to register correctly.</span></td></tr> -<tr><td width="20%">Admin Email:</td><td><input type="text" name="adminemail" size="30" maxlength="100" value="{{adminemail}}" /><br /><span class="small">Please specify your email address. This gets used when the game has to send an email to users.</span></td></tr> -<tr><td width="20%">Map Size:</td><td><input type="text" name="gamesize" size="3" maxlength="3" value="{{gamesize}}" /><br /><span class="small">Default is 250. This is the size of each map quadrant. Note that monster levels increase every 5 spaces, so you should ensure that you have at least (map size / 5) monster levels total, otherwise there will be parts of the map without any monsters, or some monsters won't ever get used. Ex: with a map size of 250, you should have 50 monster levels total.</span></td></tr> -<tr><td width="20%">Forum Type:</td><td><select name="forumtype"><option value="0" {{selecttype0}}>Disabled</option><option value="1" {{selecttype1}}>Internal</option><option value="2" {{selecttype2}}>External</option></select><br /><span class="small">'Disabled' removes the forum link. 'Internal' uses the built-in (and very stripped-down) forum program included with Dragon Knight, if you don't have your own forums software already installed. 'External' uses the address provided below and links to your own forums software.</span></td></tr> -<tr><td width="20%">External Forum:</td><td><input type="text" name="forumaddress" size="30" maxlength="200" value="{{forumaddress}}" /><br /><span class="small">If the above value is set to 'External,' please specify the complete URL to your forums here.</span></td></tr> -<tr><td width="20%">Page Compression:</td><td><select name="compression"><option value="0" {{selectcomp0}}>Disabled</option><option value="1" {{selectcomp1}}>Enabled</option></select><br /><span class="small">Enable page compression if it is supported by your server, and this will greatly reduce the amount of bandwidth required by the game.</span></td></tr> -<tr><td width="20%">Email Verification:</td><td><select name="verifyemail"><option value="0" {{selectverify0}}>Disabled</option><option value="1" {{selectverify1}}>Enabled</option></select><br /><span class="small">Make users verify their email address for added security.</span></td></tr> -<tr><td width="20%">Show News:</td><td><select name="shownews"><option value="0" {{selectnews0}}>No</option><option value="1" {{selectnews1}}>Yes</option></select><br /><span class="small">Toggle display of the Latest News box in towns.</td></tr> -<tr><td width="20%">Show Who's Online:</td><td><select name="showonline"><option value="0" {{selectonline0}}>No</option><option value="1" {{selectonline1}}>Yes</option></select><br /><span class="small">Toggle display of the Who's Online box in towns.</span></td></tr> -<tr><td width="20%">Show Babblebox:</td><td><select name="showbabble"><option value="0" {{selectbabble0}}>No</option><option value="1" {{selectbabble1}}>Yes</option></select><br /><span class="small">Toggle display of the Babble Box in towns.</span></td></tr> -<tr><td width="20%">Class 1 Name:</td><td><input type="text" name="class1name" size="20" maxlength="50" value="{{class1name}}" /><br /></td></tr> -<tr><td width="20%">Class 2 Name:</td><td><input type="text" name="class2name" size="20" maxlength="50" value="{{class2name}}" /><br /></td></tr> -<tr><td width="20%">Class 3 Name:</td><td><input type="text" name="class3name" size="20" maxlength="50" value="{{class3name}}" /><br /></td></tr> -<tr><td width="20%">Difficulty 1 Name:</td><td><input type="text" name="diff1name" size="20" maxlength="50" value="{{diff1name}}" /><br /></td></tr> -<tr><td width="20%">Difficulty 2 Name:</td><td><input type="text" name="diff2name" size="20" maxlength="50" value="{{diff2name}}" /><br /></td></tr> -<tr><td width="20%">Difficulty 2 Value:</td><td><input type="text" name="diff2mod" size="3" maxlength="3" value="{{diff2mod}}" /><br /><span class="small">Default is 1.2. Specify factoral value for medium difficulty here.</span></td></tr> -<tr><td width="20%">Difficulty 3 Name:</td><td><input type="text" name="diff3name" size="20" maxlength="50" value="{{diff3name}}" /><br /></td></tr> -<tr><td width="20%">Difficulty 3 Value:</td><td><input type="text" name="diff3mod" size="3" maxlength="3" value="{{diff3mod}}" /><br /><span class="small">Default is 1.5. Specify factoral value for hard difficulty here.</span></td></tr> +<tr><td width="20%"><span class="highlight">Statut du jeu:</span></td><td><select name="gameopen"><option value="1" {{open1select}}>Ouvert</option><option value="0" {{open0select}}>Fermé</option></select><br /><span class="small">Fermez le jeu si vous êtes faites de la maintance dessus.</span></td></tr> +<tr><td width="20%"><span class="highlight">Inscription:</span></td><td><select name="register"><option value="1" {{open1select}}>Ouvert</option><option value="0" {{open0select}}>Fermée</option></select><br /><span class="small">Fermez les inscriptions si vous estimez que le nombre d'inscris est suffisant.</span></td></tr> +<tr><td width="20%">Nom du jeu:</td><td><input type="text" name="gamename" size="30" maxlength="50" value="{{gamename}}" /><br /><span class="small">Le nom du jeu par default est "RPG illusion". Mais vous pouvez librement le modifier.</span></td></tr> +<tr><td width="20%">URL du jeu:</td><td><input type="text" name="gameurl" size="50" maxlength="100" value="{{gameurl}}" /><br /><span class="small">Veuillez indiquer l'URL complète du jeu("http://www.votre_site.com/repertoire_du_jeu/index.php").</span></td></tr> +<tr><td width="20%">Email de l'admin:</td><td><input type="text" name="adminemail" size="30" maxlength="100" value="{{adminemail}}" /><br /><span class="small">Veuillez indiquer votre adresse email. Les utilisateurs qui auront besoin d'aide utiliseront cette adresse pour vous écrire.</span></td></tr> +<tr><td width="20%">Nom del a monnaie de votre jeu:</td><td><input type="text" name="monnaie" size="30" maxlength="100" value="{{monnaie}}" /><br /></span></td></tr> +<tr><td width="20%">Taille de la carte:</td><td><input type="text" name="gamesize" size="3" maxlength="3" value="{{gamesize}}" /><br /><span class="small">250 par défault. C'est la taille de la carte en longitude et en latitude. Notez aussi que les niveaux des monstres augmentent tous les 5 espaces, ainsi vous devriez vous assurer que la valeur actuelle de la carte est supérieur à 5. Sinon il y aura quasiment aucun monstre. Avec une taille de carte de 250, vous devriez avoir le total de 50 niveaux de monstre.</span></td></tr> +<tr><td width="20%">Type du forum:</td><td><select name="forumtype"><option value="0" {{selecttype0}}>Aucun</option><option value="1" {{selecttype1}}>Interne</option><option value="2" {{selecttype2}}>Externe</option></select><br /><span class="small">'Aucun' retire le forum du jeu. 'Interne' utilise le forum inclus dans RPG illusion. 'Externe' utilise un forum qui se situe à l'exterieur du jeu. Pour cela vous devrez indiquer une URL ci dessous.</span></td></tr> +<tr><td width="20%">Forum externe:</td><td><input type="text" name="forumaddress" size="30" maxlength="200" value="{{forumaddress}}" /><br /><span class="small">Si la valeur ci-dessus est placée à 'Externe,' veuillez indiquer l'URL complète du forum externe.</span></td></tr> +<tr><td width="20%">Pages compressée:</td><td><select name="compression"><option value="0" {{selectcomp0}}>Aucune</option><option value="1" {{selectcomp1}}>Activé</option></select><br /><span class="small">Si vous compressez les pages du jeu, ceci réduira considérablement la quantité de largeur de bande passante exigée par le jeu.</span></td></tr> +<tr><td width="20%">Email de vérification:</td><td><select name="verifyemail"><option value="0" {{selectverify0}}>Aucun</option><option value="1" {{selectverify1}}>Activé</option></select><br /><span class="small">Incitez les utilisateurs à vérifier leur adresse email pour plus de sécuritée.</span></td></tr> +<tr><td width="20%">Afficher la nouvelle:</td><td><select name="shownews"><option value="0" {{selectnews0}}>Non</option><option value="1" {{selectnews1}}>Oui</option></select><br /><span class="small">Afficher la dernière nouvelle dans les villes.</td></tr> +<tr><td width="20%">Afficher "Qui est en ligne?":</td><td><select name="showonline"><option value="0" {{selectonline0}}>Non</option><option value="1" {{selectonline1}}>Oui</option></select><br /><span class="small">Afficher "Qui est en ligne?" dans les villes.</span></td></tr> +<tr><td width="20%">Afficher la boite de dialogue:</td><td><select name="showbabble"><option value="0" {{selectbabble0}}>Non</option><option value="1" {{selectbabble1}}>Oui</option></select><br /><span class="small">Afficher la boite de dialogue dans les villes.</span></td></tr> +<tr><td width="20%">Nom de la classe 1:</td><td><input type="text" name="class1name" size="20" maxlength="50" value="{{class1name}}" /><br /></td></tr> +<tr><td width="20%">Nom de la classe 2:</td><td><input type="text" name="class2name" size="20" maxlength="50" value="{{class2name}}" /><br /></td></tr> +<tr><td width="20%">Nom de la classe 3:</td><td><input type="text" name="class3name" size="20" maxlength="50" value="{{class3name}}" /><br /></td></tr> +<tr><td width="20%">Nom de la difficulté 1:</td><td><input type="text" name="diff1name" size="20" maxlength="50" value="{{diff1name}}" /><br /></td></tr> +<tr><td width="20%">Nom de la difficulté 2:</td><td><input type="text" name="diff2name" size="20" maxlength="50" value="{{diff2name}}" /><br /></td></tr> +<tr><td width="20%">Valeur de la difficulté 1:</td><td><input type="text" name="diff2mod" size="3" maxlength="3" value="{{diff2mod}}" /><br /><span class="small">1.2 par défault. Indiquez une valeur pour la difficultée moyenne ici.</span></td></tr> +<tr><td width="20%">Nom de la difficulté 3:</td><td><input type="text" name="diff3name" size="20" maxlength="50" value="{{diff3name}}" /><br /></td></tr> +<tr><td width="20%">Valeur De la difficulté 3:</td><td><input type="text" name="diff3mod" size="3" maxlength="3" value="{{diff3mod}}" /><br /><span class="small">1.5 par défault. Indiquez une valeur pour la difficultée la plus haute ici.</span></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> END; - if ($controlrow["forumtype"] == 0) { $controlrow["selecttype0"] = "selected=\"selected\" "; } else { $controlrow["selecttype0"] = ""; } - if ($controlrow["forumtype"] == 1) { $controlrow["selecttype1"] = "selected=\"selected\" "; } else { $controlrow["selecttype1"] = ""; } - if ($controlrow["forumtype"] == 2) { $controlrow["selecttype2"] = "selected=\"selected\" "; } else { $controlrow["selecttype2"] = ""; } - if ($controlrow["compression"] == 0) { $controlrow["selectcomp0"] = "selected=\"selected\" "; } else { $controlrow["selectcomp0"] = ""; } - if ($controlrow["compression"] == 1) { $controlrow["selectcomp1"] = "selected=\"selected\" "; } else { $controlrow["selectcomp1"] = ""; } - if ($controlrow["verifyemail"] == 0) { $controlrow["selectverify0"] = "selected=\"selected\" "; } else { $controlrow["selectverify0"] = ""; } - if ($controlrow["verifyemail"] == 1) { $controlrow["selectverify1"] = "selected=\"selected\" "; } else { $controlrow["selectverify1"] = ""; } - if ($controlrow["shownews"] == 0) { $controlrow["selectnews0"] = "selected=\"selected\" "; } else { $controlrow["selectnews0"] = ""; } - if ($controlrow["shownews"] == 1) { $controlrow["selectnews1"] = "selected=\"selected\" "; } else { $controlrow["selectnews1"] = ""; } - if ($controlrow["showonline"] == 0) { $controlrow["selectonline0"] = "selected=\"selected\" "; } else { $controlrow["selectonline0"] = ""; } - if ($controlrow["showonline"] == 1) { $controlrow["selectonline1"] = "selected=\"selected\" "; } else { $controlrow["selectonline1"] = ""; } - if ($controlrow["showbabble"] == 0) { $controlrow["selectbabble0"] = "selected=\"selected\" "; } else { $controlrow["selectbabble0"] = ""; } - if ($controlrow["showbabble"] == 1) { $controlrow["selectbabble1"] = "selected=\"selected\" "; } else { $controlrow["selectbabble1"] = ""; } - if ($controlrow["gameopen"] == 1) { $controlrow["open1select"] = "selected=\"selected\" "; } else { $controlrow["open1select"] = ""; } - if ($controlrow["gameopen"] == 0) { $controlrow["open0select"] = "selected=\"selected\" "; } else { $controlrow["open0select"] = ""; } +if ($controlrow["forumtype"] == 0) { $controlrow["selecttype0"] = 'selected="selected" '; } else { $controlrow["selecttype0"] = ""; } +if ($controlrow["forumtype"] == 1) { $controlrow["selecttype1"] = 'selected="selected" '; } else { $controlrow["selecttype1"] = ""; } +if ($controlrow["forumtype"] == 2) { $controlrow["selecttype2"] = 'selected="selected" '; } else { $controlrow["selecttype2"] = ""; } +if ($controlrow["compression"] == 0) { $controlrow["selectcomp0"] = 'selected="selected" '; } else { $controlrow["selectcomp0"] = ""; } +if ($controlrow["compression"] == 1) { $controlrow["selectcomp1"] = 'selected="selected" '; } else { $controlrow["selectcomp1"] = ""; } +if ($controlrow["verifyemail"] == 0) { $controlrow["selectverify0"] = 'selected="selected" '; } else { $controlrow["selectverify0"] = ""; } +if ($controlrow["verifyemail"] == 1) { $controlrow["selectverify1"] = 'selected="selected" '; } else { $controlrow["selectverify1"] = ""; } +if ($controlrow["shownews"] == 0) { $controlrow["selectnews0"] = 'selected="selected" '; } else { $controlrow["selectnews0"] = ""; } +if ($controlrow["shownews"] == 1) { $controlrow["selectnews1"] = 'selected="selected" '; } else { $controlrow["selectnews1"] = ""; } +if ($controlrow["showonline"] == 0) { $controlrow["selectonline0"] = 'selected="selected" '; } else { $controlrow["selectonline0"] = ""; } +if ($controlrow["showonline"] == 1) { $controlrow["selectonline1"] = 'selected="selected" '; } else { $controlrow["selectonline1"] = ""; } +if ($controlrow["showbabble"] == 0) { $controlrow["selectbabble0"] = 'selected="selected" '; } else { $controlrow["selectbabble0"] = ""; } +if ($controlrow["showbabble"] == 1) { $controlrow["selectbabble1"] = 'selected="selected" '; } else { $controlrow["selectbabble1"] = ""; } +if ($controlrow["gameopen"] == 1) { $controlrow["open1select"] = 'selected="selected" '; } else { $controlrow["open1select"] = ""; } +if ($controlrow["gameopen"] == 0) { $controlrow["open0select"] = 'selected="selected" '; } else { $controlrow["open0select"] = ""; } +if ($controlrow["register"] == 1) { $controlrow["open1select"] = 'selected="selected" '; } else { $controlrow["open1select"] = ""; } +if ($controlrow["register"] == 0) { $controlrow["open0select"] = 'selected="selected" '; } else { $controlrow["open0select"] = ""; } - $page = parsetemplate($page, $controlrow); - admindisplay($page, "Main Settings"); +$page = parsetemplate($page, $controlrow); +admindisplay($page, "Réglages principaux"); } function items() { - + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "items"); - $page = "<b><u>Edit Items</u></b><br />Click an item's name to edit it.<br /><br /><table width=\"50%\">\n"; + $page = "<b><u>Editer les objets</u></b><br />Cliquez sur le nom d'un objet pour le modifier.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edititem:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } - else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=edititem:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } + else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do= + + :".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No items found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas d'objets trouvés.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Items"); - + admindisplay($page, "Editer objets"); + } function edititem($id) { - - if (isset($_POST["submit"])) { - + if (isset($_POST["submit"])) { + extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } - if ($buycost == "") { $errors++; $errorlist .= "Cost is required.<br />"; } - if (!is_numeric($buycost)) { $errors++; $errorlist .= "Cost must be a number.<br />"; } - if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.<br />"; } - if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.<br />"; } + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($buycost == "") { $errors++; $errorlist .= "Le prix est exigé.<br />"; } + if (!is_numeric($buycost)) { $errors++; $errorlist .= "Le prix doit être un nombre!.<br />"; } + if ($attribute == "") { $errors++; $errorlist .= "L'attribut est exigé.<br />"; } + if (!is_numeric($attribute)) { $errors++; $errorlist .= "L'attribut doit être un nombre.<br />"; } if ($special == "" || $special == " ") { $special = "X"; } - - if ($errors == 0) { - $query = doquery("UPDATE {{table}} SET name='$name',type='$type',buycost='$buycost',attribute='$attribute',special='$special' WHERE id='$id' LIMIT 1", "items"); - admindisplay("Item updated.","Edit Items"); + + + $name = addslashes($name); + $description = addslashes($description); + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET name='$name',type='$type',buycost='$buycost',description='$description',attribute='$attribute',special='$special' WHERE id='$id' LIMIT 1", "items"); + admindisplay("Objet mis à jour.","Editer objets"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Items"); - } - - } - - + admindisplay("<b>Erreur:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Edit Items"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); $row = mysql_fetch_array($query); $page = <<<END -<b><u>Edit Items</u></b><br /><br /> +<b><u>Editer Items</u></b><br /><br /> <form action="admin.php?do=edititem:$id" method="post"> <table width="90%"> <tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> -<tr><td width="20%">Type:</td><td><select name="type"><option value="1" {{type1select}}>Weapon</option><option value="2" {{type2select}}>Armor</option><option value="3" {{type3select}}>Shield</option></select></td></tr> -<tr><td width="20%">Cost:</td><td><input type="text" name="buycost" size="5" maxlength="10" value="{{buycost}}" /> gold</td></tr> -<tr><td width="20%">Attribute:</td><td><input type="text" name="attribute" size="5" maxlength="10" value="{{attribute}}" /><br /><span class="small">How much the item adds to total attackpower (weapons) or defensepower (armor/shields).</span></td></tr> -<tr><td width="20%">Special:</td><td><input type="text" name="special" size="30" maxlength="50" value="{{special}}" /><br /><span class="small">Should be either a special code or <span class="highlight">X</span> to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.</span></td></tr> +<br /><br /> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Image:</td><td><img src="../images/items/{{image}}.gif"/></td></tr> +<tr><td width="20%">Type:</td><td><select name="type"><option value="1" {{type1select}}>Arme</option><option value="2" {{type2select}}>Armure</option><option value="3" {{type3select}}>Protection</option></select></td></tr> +<tr><td width="20%">Prix:</td><td><input type="text" name="buycost" size="5" maxlength="10" value="{{buycost}}" /> rubis</td></tr> +<tr><td width="20%">Description:</td><td><textarea name="description" type="text" rows="5" cols="50">{{description}}</textarea></td></tr> +<tr><td width="20%">Attribut:</td><td><input type="text" name="attribute" size="5" maxlength="10" value="{{attribute}}" /><br /><span class="small">Le nombre de points que l'objet ajoute au pouvoir d'attaque (armes) ou au pouvoir de défense (armures/protections).</span></td></tr> +<tr><td width="20%">Special:</td><td><input type="text" name="special" size="30" maxlength="50" value="{{special}}" /><br /><span class="small">Laissez <span class="highlight">X</span> pour donner aucun codes spéciaux à l'objet.</span></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> -<b>Special Codes:</b><br /> -Special codes can be added in the item's Special field to give it extra user attributes. Special codes are in the format <span class="highlight">attribute,value</span>. <span class="highlight">Attribute</span> can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. <span class="highlight">Value</span> may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be <span class="highlight">maxhp,50</span>.<br /><br /> -Suggested user fields for special codes:<br /> -maxhp - max hit points<br /> -maxmp - max magic points<br /> -maxtp - max travel points<br /> -goldbonus - gold bonus, in percent<br /> -expbonus - experience bonus, in percent<br /> -strength - strength (which also adds to attackpower)<br /> -dexterity - dexterity (which also adds to defensepower)<br /> -attackpower - total attack power<br /> -defensepower - total defense power +<b>Codes spéciaux:</b><br /> +Des codes spéciaux peuvent être ajoutés à tous les objets, ce qui a pour but de leurs donner plus ou moins de valeur. Par exemple si vous voulez qu'un objet donne 50 HP à un personnage, il suffit d'écrire <span class="highlight">maxhp,50</span>. Ceci marche aussi dans le sens négatif. Donc si vous voulez qu'un objet enlève 50 HP à un personnage, il suffit d'écrire <span class="highlight">maxhp,-50</span>.<br /><br /> +Voici les codes spéciaux:<br /> +maxhp - Donner des points hit (HP)<br /> +maxmp - Donner des points de magie (MP)<br /> +maxtp - Donner un max de points de voyages<br /> +goldbonus - Donner un bonnus de rubis (en pourcentage)<br /> +expbonus - Donner un bonnus d'expérience (en pourcentage)<br /> +strength - Donner de la force (qui s'ajoute également au pouvoir d'attaque)<br /> +dexterity - Donner de la dextérité (qui s'ajoute également au pouvoir de défense)<br /> +attackpower - Donner un pouvoir d'attaque<br /> +defensepower - Donner un pouvoir de défense END; - + if ($row["type"] == 1) { $row["type1select"] = "selected=\"selected\" "; } else { $row["type1select"] = ""; } if ($row["type"] == 2) { $row["type2select"] = "selected=\"selected\" "; } else { $row["type2select"] = ""; } if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; } - + $page = parsetemplate($page, $row); - admindisplay($page, "Edit Items"); - + admindisplay($page, "Editer objets"); + +} + +function addsondage() { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($question == "") { $errors++; $errorlist .= "La question est obligatoire.<br />"; } + if ($reponse1 == "") { $errors++; $errorlist .= "La réponse 1 est obligatoire.<br />"; } + if ($reponse2 == "") { $errors++; $errorlist .= "La réponse 2 est obligatoire.<br />"; } + + if ($errors == 0) { + $query = doquery("INSERT INTO {{table}} SET id='',question='$question',reponse1='$reponse1',reponse2='$reponse2',reponse3='$reponse3',reponse4='$reponse4'", "sondage"); + admindisplay("Le sondage vient d'êtres ajouté.","Ajouter un sondage"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter un sondage"); + } + + } + + +$page = ' +<b><u>Ajouter un sondage</u></b><br /><br /> +<form method="post" action="admin.php?do=sondage"> +Question : <input type="text" name="question" size="20"><br> +Réponse 1 : <input type="text" name="reponse1" size="20"><br> +Réponse 2 : <input type="text" name="reponse2" size="20"><br> +Réponse 3 (si nécessaire) : <input type="text" name="reponse3" size="20"><br> +Réponse 4 (si nécessaire) : <input type="text" name="reponse4" size="20"><br> +<br><input type="submit" name="submit" value="Créer"> +</form> +'; + + admindisplay($page, "Ajouter un sondage"); + } function drops() { - + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "drops"); - $page = "<b><u>Edit Drops</u></b><br />Click an item's name to edit it.<br /><br /><table width=\"50%\">\n"; + $page = "<b><u>Editer les objets perdus</u></b><br />Cliquez ici pour éditer un objet perdu.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editdrop:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=editdrop:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No items found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas d'objets trouvés.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Drops"); - + admindisplay($page, "Editer objets perdus"); + } function editdrop($id) { - - if (isset($_POST["submit"])) { - + if (isset($_POST["submit"])) { + extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } - if ($mlevel == "") { $errors++; $errorlist .= "Monster level is required.<br />"; } - if (!is_numeric($mlevel)) { $errors++; $errorlist .= "Monster level must be a number.<br />"; } - if ($attribute1 == "" || $attribute1 == " " || $attribute1 == "X") { $errors++; $errorlist .= "First attribute is required.<br />"; } + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($mlevel == "") { $errors++; $errorlist .= "Le niveau du monstre est exigé.<br />"; } + if (!is_numeric($mlevel)) { $errors++; $errorlist .= "Le niveau du monstre doit être en chiffre.<br />"; } + if ($attribute1 == "" || $attribute1 == " " || $attribute1 == "X") { $errors++; $errorlist .= "Le premier attribut est exigé.<br />"; } if ($attribute2 == "" || $attribute2 == " ") { $attribute2 = "X"; } - - if ($errors == 0) { + + $name = addslashes($name); + + if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',mlevel='$mlevel',attribute1='$attribute1',attribute2='$attribute2' WHERE id='$id' LIMIT 1", "drops"); - admindisplay("Item updated.","Edit Drops"); + admindisplay("Objet midifié.","Editer objets perdus"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Drops"); - } - - } - - + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les objets perdus"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "drops"); $row = mysql_fetch_array($query); $page = <<<END -<b><u>Edit Drops</u></b><br /><br /> +<b><u>Editer les objets perdus</u></b><br /><br /> <form action="admin.php?do=editdrop:$id" method="post"> <table width="90%"> <tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> -<tr><td width="20%">Monster Level:</td><td><input type="text" name="mlevel" size="5" maxlength="10" value="{{mlevel}}" /><br /><span class="small">Minimum monster level that will drop this item.</span></td></tr> -<tr><td width="20%">Attribute 1:</td><td><input type="text" name="attribute1" size="30" maxlength="50" value="{{attribute1}}" /><br /><span class="small">Must be a special code. First attribute cannot be disabled. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.</span></td></tr> -<tr><td width="20%">Attribute 2:</td><td><input type="text" name="attribute2" size="30" maxlength="50" value="{{attribute2}}" /><br /><span class="small">Should be either a special code or <span class="highlight">X</span> to disable. Edit this field very carefully because mistakes to formatting or field names can create problems in the game.</span></td></tr> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Niveau du monstre:</td><td><input type="text" name="mlevel" size="5" maxlength="10" value="{{mlevel}}" /><br /><span class="small">Niveau de probabilité pour qu'un monstre laisse tomber cet objet.</span></td></tr> +<tr><td width="20%">Attribut 1:</td><td><input type="text" name="attribute1" size="30" maxlength="50" value="{{attribute1}}" /><br /><span class="small">Doit être un code spécial. Le premier attribut ne peut pas être vide.Éditez ce champ très soigneusement, parce que les erreurs d'orthographe peuvent créer des problèmes dans le jeu.</span></td></tr> +<tr><td width="20%">Attribut 2:</td><td><input type="text" name="attribute2" size="30" maxlength="50" value="{{attribute2}}" /><br /><span class="small">Laissez <span class="highlight">X</span> pour ne mettre aucun code spécial. Sinon éditez ce champ très soigneusement, parce que les erreurs d'orthographe peuvent créer des problèmes dans le jeu.</span></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> -<b>Special Codes:</b><br /> -Special codes are used in the two attribute fields to give the item properties. The first attribute field must contain a special code, but the second one may be left empty ("X") if you wish. Special codes are in the format <span class="highlight">attribute,value</span>. <span class="highlight">Attribute</span> can be any database field from the Users table - however, it is suggested that you only use the ones from the list below, otherwise things can get freaky. <span class="highlight">Value</span> may be any positive or negative whole number. For example, if you want a weapon to give an additional 50 max hit points, the special code would be <span class="highlight">maxhp,50</span>.<br /><br /> -Suggested user fields for special codes:<br /> -maxhp - max hit points<br /> -maxmp - max magic points<br /> -maxtp - max travel points<br /> -goldbonus - gold bonus, in percent<br /> -expbonus - experience bonus, in percent<br /> -strength - strength (which also adds to attackpower)<br /> -dexterity - dexterity (which also adds to defensepower)<br /> -attackpower - total attack power<br /> -defensepower - total defense power +<b>Codes spéciaux:</b><br /> +Des codes spéciaux peuvent être ajoutés à tous les objets, ce qui a pour but de leurs donner plus ou moins de valeur. Par exemple si vous voulez qu'un objet donne 50 HP à un personnage, il suffit d'écrire <span class="highlight">maxhp,50</span>. Ceci marche aussi dans le sens négatif. Donc si vous voulez qu'un objet enlève 50 HP à un personnage, il suffit d'écrire <span class="highlight">maxhp,50</span>.<br /><br /> +Voici les codes spéciaux:<br /> +maxhp - Donner des points hit (HP)<br /> +maxmp - Donner des points de magie (MP)<br /> +maxtp - Donner un max de points de voyages<br /> +goldbonus - Donner un bonnus de rubis (en pourcentage)<br /> +expbonus - Donner un bonnus d'expérience (en pourcentage)<br /> +strength - Donner de la force (qui s'ajoute également au pouvoir d'attaque)<br /> +dexterity - Donner de la dextérité (qui s'ajoute également au pouvoir de défense)<br /> +attackpower - Donner un pouvoir d'attaque<br /> +defensepower - Donner un pouvoir de défense END; - $page = parsetemplate($page, $row); - admindisplay($page, "Edit Drops"); - + admindisplay($page, "Editer objets perdus"); + } function towns() { - + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "towns"); - $page = "<b><u>Edit Towns</u></b><br />Click an town's name to edit it.<br /><br /><table width=\"50%\">\n"; + $page = "<b><u>Editer les villes</u></b><br />Cliquez sur un nom de ville pour l'éditer.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edittown:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=edittown:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No towns found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas de villes trouvées.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Towns"); - + admindisplay($page, "Editer villes"); + } function edittown($id) { - - if (isset($_POST["submit"])) { - + if (isset($_POST["submit"])) { + extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } - if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.<br />"; } - if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.<br />"; } - if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.<br />"; } - if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.<br />"; } - if ($innprice == "") { $errors++; $errorlist .= "Inn Price is required.<br />"; } - if (!is_numeric($innprice)) { $errors++; $errorlist .= "Inn Price must be a number.<br />"; } - if ($mapprice == "") { $errors++; $errorlist .= "Map Price is required.<br />"; } - if (!is_numeric($mapprice)) { $errors++; $errorlist .= "Map Price must be a number.<br />"; } - - if ($travelpoints == "") { $errors++; $errorlist .= "Travel Points is required.<br />"; } - if (!is_numeric($travelpoints)) { $errors++; $errorlist .= "Travel Points must be a number.<br />"; } - if ($itemslist == "") { $errors++; $errorlist .= "Items List is required.<br />"; } - - if ($errors == 0) { - $query = doquery("UPDATE {{table}} SET name='$name',latitude='$latitude',longitude='$longitude',innprice='$innprice',mapprice='$mapprice',travelpoints='$travelpoints',itemslist='$itemslist' WHERE id='$id' LIMIT 1", "towns"); - admindisplay("Town updated.","Edit Towns"); + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($latitude == "") { $errors++; $errorlist .= "La latitude est exigée.<br />"; } + if (!is_numeric($latitude)) { $errors++; $errorlist .= "La latitude doit être un nombre.<br />"; } + if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigée.<br />"; } + if (!is_numeric($longitude)) { $errors++; $errorlist .= "La longitude doit être un nombre.<br />"; } + if ($innprice == "") { $errors++; $errorlist .= "Le prix de l'auberge est exigé.<br />"; } + if (!is_numeric($innprice)) { $errors++; $errorlist .= "Le prix de l'auberge doir être un nombre.<br />"; } + if ($mapprice == "") { $errors++; $errorlist .= "Le prix de la carte est exigé.<br />"; } + if (!is_numeric($mapprice)) { $errors++; $errorlist .= "Le prix de la carte doit être un nombre.<br />"; } + + if ($interets == "") { $errors++; $errorlist .= "Le pourcentage d'interet est exigés.<br />"; } + if (!is_numeric($interets)) { $errors++; $errorlist .= "Le pourcentage d'interet doit être un nombre.<br />"; } + if ($prixenchanteur == "") { $errors++; $errorlist .= "Le prix de l'enchanteur est exigé.<br />"; } + if (!is_numeric($prixenchanteur)) { $errors++; $errorlist .= "Le prix doit être un nombre.<br />"; } + if ($prixsoigneur == "") { $errors++; $errorlist .= "Le prix de l'église est exigés.<br />"; } + if (!is_numeric($prixsoigneur)) { $errors++; $errorlist .= "Le prix doit être un nombre.<br />"; } + + if ($travelpoints == "") { $errors++; $errorlist .= "Les points de voyages sont exigés.<br />"; } + if (!is_numeric($travelpoints)) { $errors++; $errorlist .= "Les points de voyages doivent êtres des nombres.<br />"; } + if ($itemslist == "") { $errors++; $errorlist .= "La liste des objets est exigée.<br />"; } + + $name = addslashes($name); + $allopass = addslashes($allopass); + $alloprice = addslashes($alloprice); + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET homeprice='$homeprice',itemslistb='$itemslistb',interets='$interets',name='$name',chiffreniveau='$chiffreniveau',chiffrebanque='$chiffrebanque',codebanque='$codebanque', + codeniveau='$codeniveau',chiffrexp='$chiffrexp',codexp='$codexp',chiffreptlevel='$chiffreptlevel',codeptlevel='$codeptlevel',latitude='$latitude',longitude='$longitude',innprice='$innprice',mapprice='$mapprice',travelpoints='$travelpoints',itemslist='$itemslist',prixsoigneur='$prixsoigneur',prixenchanteur='$prixenchanteur' WHERE id='$id' LIMIT 1", "towns"); + admindisplay("Ville mise à jour.","Editer villes"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Towns"); - } - - } - - + admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les villes"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); $row = mysql_fetch_array($query); $page = <<<END -<b><u>Edit Towns</u></b><br /><br /> +<b><u>Edit Towns</u><br /><br /> <form action="admin.php?do=edittown:$id" method="post"> <table width="90%"> <tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> <tr><td width="20%">Latitude:</td><td><input type="text" name="latitude" size="5" maxlength="10" value="{{latitude}}" /><br /><span class="small">Positive or negative integer.</span></td></tr> <tr><td width="20%">Longitude:</td><td><input type="text" name="longitude" size="5" maxlength="10" value="{{longitude}}" /><br /><span class="small">Positive or negative integer.</span></td></tr> -<tr><td width="20%">Inn Price:</td><td><input type="text" name="innprice" size="5" maxlength="10" value="{{innprice}}" /> gold</td></tr> -<tr><td width="20%">Map Price:</td><td><input type="text" name="mapprice" size="5" maxlength="10" value="{{mapprice}}" /> gold<br /><span class="small">How much it costs to buy the map to this town.</span></td></tr> -<tr><td width="20%">Travel Points:</td><td><input type="text" name="travelpoints" size="5" maxlength="10" value="{{travelpoints}}" /><br /><span class="small">How many TP are consumed when travelling to this town.</span></td></tr> -<tr><td width="20%">Items List:</td><td><input type="text" name="itemslist" size="30" maxlength="200" value="{{itemslist}}" /><br /><span class="small">Comma-separated list of item ID numbers available for purchase at this town. (Example: <span class="highlight">1,2,3,6,9,10,13,20</span>)</span></td></tr> +<tr><td width="20%">Taux d'interets:</td><td><input type="text" name="interets" size="5" maxlength="10" value="{{interets}}" /> pourcent (%)</td></tr> + +<tr><td width="20%">Prix de l'auberge:</td><td><input type="text" name="innprice" size="5" maxlength="10" value="{{innprice}}" /> gold</td></tr> +<tr><td width="20%">Prix de l'enchanteur:</td><td><input type="text" name="prixenchanteur" size="5" maxlength="10" value="{{prixenchanteur}}" /> gold</td></tr> +<tr><td width="20%">Prix de l'eglise:</td><td><input type="text" name="prixsoigneur" size="5" maxlength="10" value="{{prixsoigneur}}" /> gold</td></tr> +<tr><td width="20%">Prix de la maison:</td><td><input type="text" name="homeprice" size="5" maxlength="10" value="{{homeprice}}" /> gold</td></tr> + +<tr><td width="20%">Prix de la carte:</td><td><input type="text" name="mapprice" size="5" maxlength="10" value="{{mapprice}}" /> gold<br /><span class="small">Prix de la carte de cette ville.</span></td></tr> +<tr><td width="20%">Points de voyage:</td><td><input type="text" name="travelpoints" size="5" maxlength="10" value="{{travelpoints}}" /><br /><span class="small">Nombre de Points de voyage (TP) consommés pour aller à cette ville.</span></td></tr> +<tr><td width="20%">Liste des objets:</td><td><input type="text" name="itemslist" size="30" maxlength="200" value="{{itemslist}}" /><br /><span class="small">Liste des objets disponible dans le magasin de cette ville. (Example: <span class="highlight">1,2,3,6,9,10,13,20</span>)</span> Note: L'objet numéro 1 correspond à l'ID numéro 1 (pour voir l'ID des objets rendez vous dans la rubrique <span class="highlight">Editer objets</span>).</td></tr> +<tr><td width="20%">Liste des objets dans le marché:</td><td><input type="text" name="itemslistb" size="30" maxlength="200" value="{{itemslistb}}" /><br /><span class="small">Liste des objets disponible dans le marché de cette ville. (Example: <span class="highlight">1,2,3,6,9,10,13,20</span>)</span> Note: L'objet numéro 1 correspond à l'ID numéro 1 (pour voir l'ID des objets rendez vous dans la rubrique <span class="highlight">Editer objets</span>).</td></tr> +<tr><td width="20%">Niv monnaie:</td><td><input type="text" name="chiffrebanque" size="5" maxlength="10" value="{{chiffrebanque}}" /> gold</td></tr> +<tr><td width="20%">Code allopass banque:</td><td><textarea name="codebanque" rows="7" cols="30">{{codebanque}}</textarea><br><b>URL de la page d'accès:</b> " http://www.votresite.com/demonstration/index.php "<br><b>URL du document:</b> "http://www.votresite.com/index.php?do=cheatbanque "<br></td></tr> +<tr><td width="20%">Niv allopass:</td><td><input type="text" name="chiffreniveau" size="5" maxlength="10" value="{{chiffreniveau}}" /> niveau</td></tr> +<tr><td width="20%">Code allopass niv:</td><td><textarea name="codeniveau" rows="7" cols="30">{{codeniveau}}</textarea><br><b>URL de la page d'accès:</b> " http://www.votresite.com/demonstration/index.php "<br><b>URL du document:</b> "http://www.votresite.com/index.php?do=cheatniveau "<br></td></tr> +<tr><td width="20%">Niv xp:</td><td><input type="text" name="chiffrexp" size="5" maxlength="10" value="{{chiffrexp}}" /> xp</td></tr> +<tr><td width="20%">Code allopass xp:</td><td><textarea name="codexp" rows="7" cols="30">{{codexp}}</textarea><br><b>URL de la page d'accès:</b> " http://www.votresite.com/demonstration/index.php "<br><b>URL du document:</b> "http://www.votresite.com/index.php?do=cheatxp "<br></td></tr> +<tr><td width="20%">Niv ptlevel:</td><td><input type="text" name="chiffreptlevel" size="5" maxlength="10" value="{{chiffreptlevel}}" /> level</td></tr> +<tr><td width="20%">Code allopass niv:</td><td><textarea name="codeptlevel" rows="7" cols="30">{{codeptlevel}}</textarea><br><b>URL de la page d'accès:</b> " http://www.votresite.com/demonstration/index.php "<br><b>URL du document:</b> "http://www.votresite.com/index.php?do=cheatptlevel "<br></td></tr> + +<tr><td width="20%">Bannière:</td><td><img src="./images/town_{{id}}.gif" width='420'></td></tr> + </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> END; - + $page = parsetemplate($page, $row); - admindisplay($page, "Edit Towns"); - + admindisplay($page, "Editer villes"); + } + function monsters() { - + global $controlrow; - + $statquery = doquery("SELECT * FROM {{table}} ORDER BY level DESC LIMIT 1", "monsters"); $statrow = mysql_fetch_array($statquery); - + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "monsters"); - $page = "<b><u>Edit Monsters</u></b><br />"; - + $page = "<b><u>Editer les monstres</u></b><br />"; + if (($controlrow["gamesize"]/5) != $statrow["level"]) { - $page .= "<span class=\"highlight\">Note:</span> Your highest monster level does not match with your entered map size. Highest monster level should be ".($controlrow["gamesize"]/5).", yours is ".$statrow["level"].". Please fix this before opening the game to the public.<br /><br />"; - } else { $page .= "Monster level and map size match. No further actions are required for map compatibility.<br /><br />"; } - - $page .= "Click an monster's name to edit it.<br /><br /><table width=\"50%\">\n"; + $page .= "<span class=\"highlight\">Note:</span> Le niveau élevé des monstre ne s'assortit pas avec le taille de la carte. Le niveau le plus élevé de monstre devrait être ".($controlrow["gamesize"]/5).", le votre est ".$statrow["level"].". Veuillez modifier la valeur avant d'ouvrir le jeu au public.<br /><br />"; + } else { $page .= "Le niveau du monstre correspont parfaitement avec la taille de la carte, aucunes modifications n'est exigé.<br /><br />"; } + + $page .= "Cliquez sur le nom d'un monstre pour l'éditer.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editmonster:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=editmonster:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No towns found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas villes trouvés.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Monster"); - + admindisplay($page, "Editer monstres"); + } function editmonster($id) { - - if (isset($_POST["submit"])) { - + if (isset($_POST["submit"])) { + extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } - if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.<br />"; } - if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.<br />"; } - if ($maxdam == "") { $errors++; $errorlist .= "Max Damage is required.<br />"; } - if (!is_numeric($maxdam)) { $errors++; $errorlist .= "Max Damage must be a number.<br />"; } - if ($armor == "") { $errors++; $errorlist .= "Armor is required.<br />"; } - if (!is_numeric($armor)) { $errors++; $errorlist .= "Armor must be a number.<br />"; } - if ($level == "") { $errors++; $errorlist .= "Monster Level is required.<br />"; } - if (!is_numeric($level)) { $errors++; $errorlist .= "Monster Level must be a number.<br />"; } - if ($maxexp == "") { $errors++; $errorlist .= "Max Exp is required.<br />"; } - if (!is_numeric($maxexp)) { $errors++; $errorlist .= "Max Exp must be a number.<br />"; } - if ($maxgold == "") { $errors++; $errorlist .= "Max Gold is required.<br />"; } - if (!is_numeric($maxgold)) { $errors++; $errorlist .= "Max Gold must be a number.<br />"; } - - if ($errors == 0) { + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($maxhp == "") { $errors++; $errorlist .= "Le max de HP est exigé.<br />"; } + if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Le max de HP doit être un nombre.<br />"; } + if ($maxdam == "") { $errors++; $errorlist .= "Le max de dommage est exigé.<br />"; } + if (!is_numeric($maxdam)) { $errors++; $errorlist .= "Le max de dommage doit être un nombre.<br />"; } + if ($armor == "") { $errors++; $errorlist .= "Le niveau de l'armure est exigé.<br />"; } + if (!is_numeric($armor)) { $errors++; $errorlist .= "Le niveau de l'armure doir être un nombre.<br />"; } + if ($level == "") { $errors++; $errorlist .= "Le niveau du monstre est exigé.<br />"; } + if (!is_numeric($level)) { $errors++; $errorlist .= "Le niveau du monstre doit être un nombre.<br />"; } + if ($maxexp == "") { $errors++; $errorlist .= "Le max d'expérience est exigé.<br />"; } + if (!is_numeric($maxexp)) { $errors++; $errorlist .= "Le max d'expérience doit être un nombre.<br />"; } + if ($maxgold == "") { $errors++; $errorlist .= "Le max de rubis est exigé.<br />"; } + if (!is_numeric($maxgold)) { $errors++; $errorlist .= "Le max de rubis doit être un nombre.<br />"; } + + $name = addslashes($name); + + if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',maxhp='$maxhp',maxdam='$maxdam',armor='$armor',level='$level',maxexp='$maxexp',maxgold='$maxgold',immune='$immune' WHERE id='$id' LIMIT 1", "monsters"); - admindisplay("Monster updated.","Edit monsters"); + admindisplay("Monstre mis à jour.","Editer monstres"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit monsters"); - } - - } - - + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les monstres"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "monsters"); $row = mysql_fetch_array($query); $page = <<<END -<b><u>Edit Monsters</u></b><br /><br /> +<b><u>Editer les monstres</u></b><br /><br /> <form action="admin.php?do=editmonster:$id" method="post"> <table width="90%"> <tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> -<tr><td width="20%">Max Hit Points:</td><td><input type="text" name="maxhp" size="5" maxlength="10" value="{{maxhp}}" /></td></tr> -<tr><td width="20%">Max Damage:</td><td><input type="text" name="maxdam" size="5" maxlength="10" value="{{maxdam}}" /><br /><span class="small">Compares to player's attackpower.</span></td></tr> -<tr><td width="20%">Armor:</td><td><input type="text" name="armor" size="5" maxlength="10" value="{{armor}}" /><br /><span class="small">Compares to player's defensepower.</span></td></tr> -<tr><td width="20%">Monster Level:</td><td><input type="text" name="level" size="5" maxlength="10" value="{{level}}" /><br /><span class="small">Determines spawn location and item drops.</span></td></tr> -<tr><td width="20%">Max Experience:</td><td><input type="text" name="maxexp" size="5" maxlength="10" value="{{maxexp}}" /><br /><span class="small">Max experience gained from defeating monster.</span></td></tr> -<tr><td width="20%">Max Gold:</td><td><input type="text" name="maxgold" size="5" maxlength="10" value="{{maxgold}}" /><br /><span class="small">Max gold gained from defeating monster.</span></td></tr> -<tr><td width="20%">Immunity:</td><td><select name="immune"><option value="0" {{immune0select}}>None</option><option value="1" {{immune1select}}>Hurt Spells</option><option value="2" {{immune2select}}>Hurt & Sleep Spells</option></select><br /><span class="small">Some monsters may not be hurt by certain spells.</span></td></tr> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Portait:</td><td><img src="../images/monstre/{{image}}.gif" width="71" height="59"></td></tr> +<tr><td width="20%">Max de HP:</td><td><input type="text" name="maxhp" size="5" maxlength="10" value="{{maxhp}}" /></td></tr> +<tr><td width="20%">Max de dommages:</td><td><input type="text" name="maxdam" size="5" maxlength="10" value="{{maxdam}}" /><br /><span class="small">Comparez au pouvoir d'attaque du joueur.</span></td></tr> +<tr><td width="20%">Armures:</td><td><input type="text" name="armor" size="5" maxlength="10" value="{{armor}}" /><br /><span class="small">Comparez au pouvoir de défense du joueur.</span></td></tr> +<tr><td width="20%">Niveau du monstre:</td><td><input type="text" name="level" size="5" maxlength="10" value="{{level}}" /><br /><span class="small">Determines spawn location and item drops.</span></td></tr> +<tr><td width="20%">Max d'experience:</td><td><input type="text" name="maxexp" size="5" maxlength="10" value="{{maxexp}}" /><br /><span class="small">Le maximum d'expérience qui sera donné au joueur, après avoir battu le monstre.</span></td></tr> +<tr><td width="20%">Max de rubis:</td><td><input type="text" name="maxgold" size="5" maxlength="10" value="{{maxgold}}" /><br /><span class="small">Le maximum de rubis qui sera donné au joueur, après avoir battu le monstre.</span></td></tr> +<tr><td width="20%">Immunisé contre le sort:</td><td><select name="immune"><option value="0" {{immune0select}}>Aucune</option><option value="1" {{immune1select}}>Attaque</option><option value="2" {{immune2select}}>Attaque & Sommeil</option></select><br /><span class="small">Quelques monstres peuvent ne pas être blessés par certains sorts.</span></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> END; - + if ($row["immune"] == 1) { $row["immune1select"] = "selected=\"selected\" "; } else { $row["immune1select"] = ""; } if ($row["immune"] == 2) { $row["immune2select"] = "selected=\"selected\" "; } else { $row["immune2select"] = ""; } if ($row["immune"] == 3) { $row["immune3select"] = "selected=\"selected\" "; } else { $row["immune3select"] = ""; } - + $page = parsetemplate($page, $row); - admindisplay($page, "Edit Monsters"); - + admindisplay($page, "Editer monstres"); + } function spells() { - + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "spells"); - $page = "<b><u>Edit Spells</u></b><br />Click an spell's name to edit it.<br /><br /><table width=\"50%\">\n"; + $page = "<b><u>Editer les sorts</u></b><br />Cliquez sur le nom d'un sort pour l'éditer.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editspell:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=editspell:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas de sorts trouvés.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Spells"); - + admindisplay($page, "Editer sorts"); + } function editspell($id) { - - if (isset($_POST["submit"])) { - + if (isset($_POST["submit"])) { + extract($_POST); $errors = 0; $errorlist = ""; - if ($name == "") { $errors++; $errorlist .= "Name is required.<br />"; } - if ($mp == "") { $errors++; $errorlist .= "MP is required.<br />"; } - if (!is_numeric($mp)) { $errors++; $errorlist .= "MP must be a number.<br />"; } - if ($attribute == "") { $errors++; $errorlist .= "Attribute is required.<br />"; } - if (!is_numeric($attribute)) { $errors++; $errorlist .= "Attribute must be a number.<br />"; } - - if ($errors == 0) { + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($mp == "") { $errors++; $errorlist .= "Les MP sont exigés.<br />"; } + if (!is_numeric($mp)) { $errors++; $errorlist .= "Les MP doivent êtres des nombres.<br />"; } + if ($attribute == "") { $errors++; $errorlist .= "L'attribut est exigé.<br />"; } + if (!is_numeric($attribute)) { $errors++; $errorlist .= "L'attribut doit être un nombre.<br />"; } + + $name = addslashes($name); + + if ($errors == 0) { $query = doquery("UPDATE {{table}} SET name='$name',mp='$mp',attribute='$attribute',type='$type' WHERE id='$id' LIMIT 1", "spells"); - admindisplay("Spell updated.","Edit Spells"); + admindisplay("Sort mis à jour.","Editer sorts"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Spells"); - } - - } - - + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les sorts"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "spells"); $row = mysql_fetch_array($query); $page = <<<END -<b><u>Edit Spells</u></b><br /><br /> +<b><u>Editer les sorts</u></b><br /><br /> <form action="admin.php?do=editspell:$id" method="post"> <table width="90%"> <tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Name:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> -<tr><td width="20%">Magic Points:</td><td><input type="text" name="mp" size="5" maxlength="10" value="{{mp}}" /><br /><span class="small">MP required to cast spell.</span></td></tr> -<tr><td width="20%">Attribute:</td><td><input type="text" name="attribute" size="5" maxlength="10" value="{{attribute}}" /><br /><span class="small">Numeric value of the spell's effect. Ties with type, below.</span></td></tr> -<tr><td width="20%">Type:</td><td><select name="type"><option value="1" {{type1select}}>Heal</option><option value="2" {{type2select}}>Hurt</option><option value="3" {{type3select}}>Sleep</option><option value="4" {{type4select}}>Uber Attack</option><option value="5" {{type5select}}>Uber Defense</option></select><br /><span class="small">- Heal gives player back [attribute] hit points.<br />- Hurt deals [attribute] damage to monster.<br />- Sleep keeps monster from attacking ([attribute] is monster's chance out of 15 to stay asleep each turn).<br />- Uber Attack increases total attack damage by [attribute] percent.<br />- Uber Defense increases total defense from attack by [attribute] percent.</span></td></tr> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Points de magie:</td><td><input type="text" name="mp" size="5" maxlength="10" value="{{mp}}" /><br /><span class="small">MP requis pour éxécuter ce sort.</span></td></tr> +<tr><td width="20%">Attribut:</td><td><input type="text" name="attribute" size="5" maxlength="10" value="{{attribute}}" /><br /><span class="small">Valeur numérique du type de sorts que vous avez choisi ci-dessous.</span></td></tr> +<tr><td width="20%">Type:</td><td><select name="type"><option value="1" {{type1select}}>Soin</option><option value="2" {{type2select}}>Attaque</option><option value="3" {{type3select}}>Sommeil</option><option value="4" {{type4select}}>Attaque d'Uber</option><option value="5" {{type5select}}>Défense d'Uber</option></select><br /><span class="small">- "Soin" redonne des HP au joueur.<br />- "Attaque" cause des dommages au monstre.<br />- "Sommeil" endort le monstre. Note: Si vous mettez l'attribut du sommeil sur 2, le monstre aura très peu de chance de s'endormir, par contre si vous le mettez sur 15, le monstre s'endormira certainement (l'attribut du sommeil varie de 1 à 15).<br>- L'attaque d'Uber augmente les dommages d'attaque totale par 50% par exemple si vous mettez dans les attributs 50.<br>- La défense d'Uber augmente la défense totale sur une attaque par 50% par exemple si vous mettez dans les attributs 50. </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> END; @@ -486,92 +609,92 @@ END; if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; } if ($row["type"] == 4) { $row["type4select"] = "selected=\"selected\" "; } else { $row["type4select"] = ""; } if ($row["type"] == 5) { $row["type5select"] = "selected=\"selected\" "; } else { $row["type5select"] = ""; } - + $page = parsetemplate($page, $row); - admindisplay($page, "Edit Spells"); - + admindisplay($page, "Editer sorts"); + } function levels() { $query = doquery("SELECT id FROM {{table}} ORDER BY id DESC LIMIT 1", "levels"); $row = mysql_fetch_array($query); - + $options = ""; for($i=2; $i<$row["id"]; $i++) { $options .= "<option value=\"$i\">$i</option>\n"; } - + $page = <<<END -<b><u>Edit Levels</u></b><br />Select a level number from the dropdown box to edit it.<br /><br /> +<b><u>Editer les niveaux du jeu</u></b><br />Modifier le niveau du jeu à partir du menu déroulant ci-dessous.<br /><br /> <form action="admin.php?do=editlevel" method="post"> <select name="level"> $options -</select> -<input type="submit" name="go" value="Submit" /> +</select> +<input type="submit" name="go" value="Valider" /> </form> END; - admindisplay($page, "Edit Levels"); - + admindisplay($page, "Editer niveaux"); + } function editlevel() { - if (!isset($_POST["level"])) { admindisplay("No level to edit.", "Edit Levels"); die(); } + if (!isset($_POST["level"])) { admindisplay("Pas de niveaux à éditer.", "Editer les niveaux du jeu"); die(); } $id = $_POST["level"]; - + if (isset($_POST["submit"])) { - + extract($_POST); $errors = 0; $errorlist = ""; - if ($_POST["1_exp"] == "") { $errors++; $errorlist .= "Class 1 Experience is required.<br />"; } - if ($_POST["1_hp"] == "") { $errors++; $errorlist .= "Class 1 HP is required.<br />"; } - if ($_POST["1_mp"] == "") { $errors++; $errorlist .= "Class 1 MP is required.<br />"; } - if ($_POST["1_tp"] == "") { $errors++; $errorlist .= "Class 1 TP is required.<br />"; } - if ($_POST["1_strength"] == "") { $errors++; $errorlist .= "Class 1 Strength is required.<br />"; } - if ($_POST["1_dexterity"] == "") { $errors++; $errorlist .= "Class 1 Dexterity is required.<br />"; } - if ($_POST["1_spells"] == "") { $errors++; $errorlist .= "Class 1 Spells is required.<br />"; } - if (!is_numeric($_POST["1_exp"])) { $errors++; $errorlist .= "Class 1 Experience must be a number.<br />"; } - if (!is_numeric($_POST["1_hp"])) { $errors++; $errorlist .= "Class 1 HP must be a number.<br />"; } - if (!is_numeric($_POST["1_mp"])) { $errors++; $errorlist .= "Class 1 MP must be a number.<br />"; } - if (!is_numeric($_POST["1_tp"])) { $errors++; $errorlist .= "Class 1 TP must be a number.<br />"; } - if (!is_numeric($_POST["1_strength"])) { $errors++; $errorlist .= "Class 1 Strength must be a number.<br />"; } - if (!is_numeric($_POST["1_dexterity"])) { $errors++; $errorlist .= "Class 1 Dexterity must be a number.<br />"; } - if (!is_numeric($_POST["1_spells"])) { $errors++; $errorlist .= "Class 1 Spells must be a number.<br />"; } - - if ($_POST["2_exp"] == "") { $errors++; $errorlist .= "Class 2 Experience is required.<br />"; } - if ($_POST["2_hp"] == "") { $errors++; $errorlist .= "Class 2 HP is required.<br />"; } - if ($_POST["2_mp"] == "") { $errors++; $errorlist .= "Class 2 MP is required.<br />"; } - if ($_POST["2_tp"] == "") { $errors++; $errorlist .= "Class 2 TP is required.<br />"; } - if ($_POST["2_strength"] == "") { $errors++; $errorlist .= "Class 2 Strength is required.<br />"; } - if ($_POST["2_dexterity"] == "") { $errors++; $errorlist .= "Class 2 Dexterity is required.<br />"; } - if ($_POST["2_spells"] == "") { $errors++; $errorlist .= "Class 2 Spells is required.<br />"; } - if (!is_numeric($_POST["2_exp"])) { $errors++; $errorlist .= "Class 2 Experience must be a number.<br />"; } - if (!is_numeric($_POST["2_hp"])) { $errors++; $errorlist .= "Class 2 HP must be a number.<br />"; } - if (!is_numeric($_POST["2_mp"])) { $errors++; $errorlist .= "Class 2 MP must be a number.<br />"; } - if (!is_numeric($_POST["2_tp"])) { $errors++; $errorlist .= "Class 2 TP must be a number.<br />"; } - if (!is_numeric($_POST["2_strength"])) { $errors++; $errorlist .= "Class 2 Strength must be a number.<br />"; } - if (!is_numeric($_POST["2_dexterity"])) { $errors++; $errorlist .= "Class 2 Dexterity must be a number.<br />"; } - if (!is_numeric($_POST["2_spells"])) { $errors++; $errorlist .= "Class 2 Spells must be a number.<br />"; } - - if ($_POST["3_exp"] == "") { $errors++; $errorlist .= "Class 3 Experience is required.<br />"; } - if ($_POST["3_hp"] == "") { $errors++; $errorlist .= "Class 3 HP is required.<br />"; } - if ($_POST["3_mp"] == "") { $errors++; $errorlist .= "Class 3 MP is required.<br />"; } - if ($_POST["3_tp"] == "") { $errors++; $errorlist .= "Class 3 TP is required.<br />"; } - if ($_POST["3_strength"] == "") { $errors++; $errorlist .= "Class 3 Strength is required.<br />"; } - if ($_POST["3_dexterity"] == "") { $errors++; $errorlist .= "Class 3 Dexterity is required.<br />"; } - if ($_POST["3_spells"] == "") { $errors++; $errorlist .= "Class 3 Spells is required.<br />"; } - if (!is_numeric($_POST["3_exp"])) { $errors++; $errorlist .= "Class 3 Experience must be a number.<br />"; } - if (!is_numeric($_POST["3_hp"])) { $errors++; $errorlist .= "Class 3 HP must be a number.<br />"; } - if (!is_numeric($_POST["3_mp"])) { $errors++; $errorlist .= "Class 3 MP must be a number.<br />"; } - if (!is_numeric($_POST["3_tp"])) { $errors++; $errorlist .= "Class 3 TP must be a number.<br />"; } - if (!is_numeric($_POST["3_strength"])) { $errors++; $errorlist .= "Class 3 Strength must be a number.<br />"; } - if (!is_numeric($_POST["3_dexterity"])) { $errors++; $errorlist .= "Class 3 Dexterity must be a number.<br />"; } - if (!is_numeric($_POST["3_spells"])) { $errors++; $errorlist .= "Class 3 Spells must be a number.<br />"; } + if ($_POST["1_exp"] == "") { $errors++; $errorlist .= "L'expérience de la classe 1 est exigée.<br />"; } + if ($_POST["1_hp"] == "") { $errors++; $errorlist .= "Le HP de la classe 1 est exigé.<br />"; } + if ($_POST["1_mp"] == "") { $errors++; $errorlist .= "Le MP de la classe 1 est exigé.<br />"; } + if ($_POST["1_tp"] == "") { $errors++; $errorlist .= "Le TP de la classe 1 est exigé.<br />"; } + if ($_POST["1_strength"] == "") { $errors++; $errorlist .= "La force de la classe 1 est exigée.<br />"; } + if ($_POST["1_dexterity"] == "") { $errors++; $errorlist .= "La dextérité de la classe 1 est exigée.<br />"; } + if ($_POST["1_spells"] == "") { $errors++; $errorlist .= "Le sort de la classe 1 est exigée.<br />"; } + if (!is_numeric($_POST["1_exp"])) { $errors++; $errorlist .= "L'expérience de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_hp"])) { $errors++; $errorlist .= "Le HP de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_mp"])) { $errors++; $errorlist .= "Le MP de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_tp"])) { $errors++; $errorlist .= "Le TP de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_strength"])) { $errors++; $errorlist .= "La force de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_dexterity"])) { $errors++; $errorlist .= "La dextérité de la classe 1 doit être un nombre.<br />"; } + if (!is_numeric($_POST["1_spells"])) { $errors++; $errorlist .= "Le sort de la classe 1 doit être un nombre.<br />"; } - if ($errors == 0) { + if ($_POST["2_exp"] == "") { $errors++; $errorlist .= "L'expérience de la classe 2 est exigée.<br />"; } + if ($_POST["2_hp"] == "") { $errors++; $errorlist .= "Le HP de la classe 2 est exigé.<br />"; } + if ($_POST["2_mp"] == "") { $errors++; $errorlist .= "Le MP de la classe 2 est exigé.<br />"; } + if ($_POST["2_tp"] == "") { $errors++; $errorlist .= "Le TP de la classe 2 est exigé.<br />"; } + if ($_POST["2_strength"] == "") { $errors++; $errorlist .= "La force de la classe 2 est exigée.<br />"; } + if ($_POST["2_dexterity"] == "") { $errors++; $errorlist .= "La dextérité de la classe 2 est exigée.<br />"; } + if ($_POST["2_spells"] == "") { $errors++; $errorlist .= "Le sort de la classe 2 est exigé.<br />"; } + if (!is_numeric($_POST["2_exp"])) { $errors++; $errorlist .= "L'expérience de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_hp"])) { $errors++; $errorlist .= "Le HP de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_mp"])) { $errors++; $errorlist .= "Le MP de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_tp"])) { $errors++; $errorlist .= "Le TP de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_strength"])) { $errors++; $errorlist .= "La force de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_dexterity"])) { $errors++; $errorlist .= "La dextérité de la classe 2 doit être un nombre.<br />"; } + if (!is_numeric($_POST["2_spells"])) { $errors++; $errorlist .= "Le sort de la classe 2 doit être un nombre.<br />"; } + + if ($_POST["3_exp"] == "") { $errors++; $errorlist .= "L'expérience de la classe 3 est exigée.<br />"; } + if ($_POST["3_hp"] == "") { $errors++; $errorlist .= "Le HP de la classe 3 est exigé.<br />"; } + if ($_POST["3_mp"] == "") { $errors++; $errorlist .= "Le MP de la classe 3 est exigé.<br />"; } + if ($_POST["3_tp"] == "") { $errors++; $errorlist .= "Le TP de la classe 3 est exigé.<br />"; } + if ($_POST["3_strength"] == "") { $errors++; $errorlist .= "La force de la classe 3 est exigée.<br />"; } + if ($_POST["3_dexterity"] == "") { $errors++; $errorlist .= "La dextérité de la classe 3 est exigée.<br />"; } + if ($_POST["3_spells"] == "") { $errors++; $errorlist .= "Le sort de la classe 3 est exigé.<br />"; } + if (!is_numeric($_POST["3_exp"])) { $errors++; $errorlist .= "L'expérience de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_hp"])) { $errors++; $errorlist .= "Le HP de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_mp"])) { $errors++; $errorlist .= "Le MP de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_tp"])) { $errors++; $errorlist .= "Le TP de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_strength"])) { $errors++; $errorlist .= "La force de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_dexterity"])) { $errors++; $errorlist .= "La dextérité de la classe 3 doit être un nombre.<br />"; } + if (!is_numeric($_POST["3_spells"])) { $errors++; $errorlist .= "Le sort de la classe 3 doit être un nombre.<br />"; } + + if ($errors == 0) { $updatequery = <<<END UPDATE {{table}} SET 1_exp='$1_exp', 1_hp='$1_hp', 1_mp='$1_mp', 1_tp='$1_tp', 1_strength='$1_strength', 1_dexterity='$1_dexterity', 1_spells='$1_spells', @@ -579,15 +702,15 @@ UPDATE {{table}} SET 3_exp='$3_exp', 3_hp='$3_hp', 3_mp='$3_mp', 3_tp='$3_tp', 3_strength='$3_strength', 3_dexterity='$3_dexterity', 3_spells='$3_spells' WHERE id='$id' LIMIT 1 END; - $query = doquery($updatequery, "levels"); - admindisplay("Level updated.","Edit Levels"); + $query = doquery($updatequery, "levels"); + admindisplay("Niveau mis à jour.","Editer niveaux"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Spells"); - } - - } - - + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les sorts"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "levels"); $row = mysql_fetch_array($query); global $controlrow; @@ -596,8 +719,8 @@ END; $class3name = $controlrow["class3name"]; $page = <<<END -<b><u>Edit Levels</u></b><br /><br /> -Experience values for each level should be the cumulative total amount of experience up to this point. All other values should be only the new amount to add this level.<br /><br /> +<b><u>Editer les niveaux</u></b><br /><br /> +Nous vous déconseillons fortement de modifier les valeurs du 5ème paliers (niveau, expérience, force...), car le jeu a fait un calcul précis pour arriver à ces résulats. Si vous changez ces valeurs des erreurs peuvent se produirent.<br /><br /> <form action="admin.php?do=editlevel" method="post"> <input type="hidden" name="level" value="$id" /> <table width="90%"> @@ -605,155 +728,155 @@ Experience values for each level should be the cumulative total amount of experi <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">$class1name Experience:</td><td><input type="text" name="1_exp" size="10" maxlength="8" value="{{1_exp}}" /></td></tr> -<tr><td width="20%">$class1name HP:</td><td><input type="text" name="1_hp" size="5" maxlength="5" value="{{1_hp}}" /></td></tr> -<tr><td width="20%">$class1name MP:</td><td><input type="text" name="1_mp" size="5" maxlength="5" value="{{1_mp}}" /></td></tr> -<tr><td width="20%">$class1name TP:</td><td><input type="text" name="1_tp" size="5" maxlength="5" value="{{1_tp}}" /></td></tr> -<tr><td width="20%">$class1name Strength:</td><td><input type="text" name="1_strength" size="5" maxlength="5" value="{{1_strength}}" /></td></tr> -<tr><td width="20%">$class1name Dexterity:</td><td><input type="text" name="1_dexterity" size="5" maxlength="5" value="{{1_dexterity}}" /></td></tr> -<tr><td width="20%">$class1name Spells:</td><td><input type="text" name="1_spells" size="5" maxlength="3" value="{{1_spells}}" /></td></tr> +<tr><td width="20%">Experience du $class1name:</td><td><input type="text" name="1_exp" size="10" maxlength="8" value="{{1_exp}}" /></td></tr> +<tr><td width="20%">HP du $class1name:</td><td><input type="text" name="1_hp" size="5" maxlength="5" value="{{1_hp}}" /></td></tr> +<tr><td width="20%">MP du $class1name:</td><td><input type="text" name="1_mp" size="5" maxlength="5" value="{{1_mp}}" /></td></tr> +<tr><td width="20%">TP du $class1name:</td><td><input type="text" name="1_tp" size="5" maxlength="5" value="{{1_tp}}" /></td></tr> +<tr><td width="20%">Force du $class1name:</td><td><input type="text" name="1_strength" size="5" maxlength="5" value="{{1_strength}}" /></td></tr> +<tr><td width="20%">Dextérité du $class1name:</td><td><input type="text" name="1_dexterity" size="5" maxlength="5" value="{{1_dexterity}}" /></td></tr> +<tr><td width="20%">Sorts du $class1name:</td><td><input type="text" name="1_spells" size="5" maxlength="3" value="{{1_spells}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">$class2name Experience:</td><td><input type="text" name="2_exp" size="10" maxlength="8" value="{{2_exp}}" /></td></tr> -<tr><td width="20%">$class2name HP:</td><td><input type="text" name="2_hp" size="5" maxlength="5" value="{{2_hp}}" /></td></tr> -<tr><td width="20%">$class2name MP:</td><td><input type="text" name="2_mp" size="5" maxlength="5" value="{{2_mp}}" /></td></tr> -<tr><td width="20%">$class2name TP:</td><td><input type="text" name="2_tp" size="5" maxlength="5" value="{{2_tp}}" /></td></tr> -<tr><td width="20%">$class2name Strength:</td><td><input type="text" name="2_strength" size="5" maxlength="5" value="{{2_strength}}" /></td></tr> -<tr><td width="20%">$class2name Dexterity:</td><td><input type="text" name="2_dexterity" size="5" maxlength="5" value="{{2_dexterity}}" /></td></tr> -<tr><td width="20%">$class2name Spells:</td><td><input type="text" name="2_spells" size="5" maxlength="3" value="{{2_spells}}" /></td></tr> +<tr><td width="20%">Expérience du $class2name:</td><td><input type="text" name="2_exp" size="10" maxlength="8" value="{{2_exp}}" /></td></tr> +<tr><td width="20%">HP du $class2name:</td><td><input type="text" name="2_hp" size="5" maxlength="5" value="{{2_hp}}" /></td></tr> +<tr><td width="20%">MP du $class2name:</td><td><input type="text" name="2_mp" size="5" maxlength="5" value="{{2_mp}}" /></td></tr> +<tr><td width="20%">TP du $class2name:</td><td><input type="text" name="2_tp" size="5" maxlength="5" value="{{2_tp}}" /></td></tr> +<tr><td width="20%">Force du $class2name:</td><td><input type="text" name="2_strength" size="5" maxlength="5" value="{{2_strength}}" /></td></tr> +<tr><td width="20%">Dextérité du $class2name:</td><td><input type="text" name="2_dexterity" size="5" maxlength="5" value="{{2_dexterity}}" /></td></tr> +<tr><td width="20%">Sorts du $class2name:</td><td><input type="text" name="2_spells" size="5" maxlength="3" value="{{2_spells}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">$class3name Experience:</td><td><input type="text" name="3_exp" size="10" maxlength="8" value="{{3_exp}}" /></td></tr> -<tr><td width="20%">$class3name HP:</td><td><input type="text" name="3_hp" size="5" maxlength="5" value="{{3_hp}}" /></td></tr> -<tr><td width="20%">$class3name MP:</td><td><input type="text" name="3_mp" size="5" maxlength="5" value="{{3_mp}}" /></td></tr> -<tr><td width="20%">$class3name TP:</td><td><input type="text" name="3_tp" size="5" maxlength="5" value="{{3_tp}}" /></td></tr> -<tr><td width="20%">$class3name Strength:</td><td><input type="text" name="3_strength" size="5" maxlength="5" value="{{3_strength}}" /></td></tr> -<tr><td width="20%">$class3name Dexterity:</td><td><input type="text" name="3_dexterity" size="5" maxlength="5" value="{{3_dexterity}}" /></td></tr> -<tr><td width="20%">$class3name Spells:</td><td><input type="text" name="3_spells" size="5" maxlength="3" value="{{3_spells}}" /></td></tr> +<tr><td width="20%">Experience du $class3name:</td><td><input type="text" name="3_exp" size="10" maxlength="8" value="{{3_exp}}" /></td></tr> +<tr><td width="20%">HP du $class3name:</td><td><input type="text" name="3_hp" size="5" maxlength="5" value="{{3_hp}}" /></td></tr> +<tr><td width="20%">MP du $class3name:</td><td><input type="text" name="3_mp" size="5" maxlength="5" value="{{3_mp}}" /></td></tr> +<tr><td width="20%">TP du $class3name:</td><td><input type="text" name="3_tp" size="5" maxlength="5" value="{{3_tp}}" /></td></tr> +<tr><td width="20%">Force du $class3name:</td><td><input type="text" name="3_strength" size="5" maxlength="5" value="{{3_strength}}" /></td></tr> +<tr><td width="20%">Dextérité du $class3name:</td><td><input type="text" name="3_dexterity" size="5" maxlength="5" value="{{3_dexterity}}" /></td></tr> +<tr><td width="20%">Sorts du $class3name:</td><td><input type="text" name="3_spells" size="5" maxlength="3" value="{{3_spells}}" /></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> </form> END; - + $page = parsetemplate($page, $row); - admindisplay($page, "Edit Levels"); - + admindisplay($page, "Editer niveaux"); + } function users() { - + $query = doquery("SELECT id,username FROM {{table}} ORDER BY id", "users"); - $page = "<b><u>Edit Users</u></b><br />Click a username to edit the account.<br /><br /><table width=\"50%\">\n"; + $page = "<b><u>Editer les utilisateurs</u></b><br />Cliquez sur le nom d'un utilisateur pour éditer son compte.<br /><br /><table width=\"50%\">\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edituser:".$row["id"]."\">".$row["username"]."</a></td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=edituser:".$row["id"]."\">".$row["username"]."</a></td></tr>\n"; $count = 1; } } - if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">No spells found.</td></tr>\n"; } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas de sorts trouvés.</td></tr>\n"; } $page .= "</table>"; - admindisplay($page, "Edit Users"); + admindisplay($page, "Editer utilisateurs"); } function edituser($id) { - - if (isset($_POST["submit"])) { - - extract($_POST); - $errors = 0; - $errorlist = ""; - if ($email == "") { $errors++; $errorlist .= "Email is required.<br />"; } - if ($verify == "") { $errors++; $errorlist .= "Verify is required.<br />"; } - if ($charname == "") { $errors++; $errorlist .= "Character Name is required.<br />"; } - if ($authlevel == "") { $errors++; $errorlist .= "Auth Level is required.<br />"; } - if ($latitude == "") { $errors++; $errorlist .= "Latitude is required.<br />"; } - if ($longitude == "") { $errors++; $errorlist .= "Longitude is required.<br />"; } - if ($difficulty == "") { $errors++; $errorlist .= "Difficulty is required.<br />"; } - if ($charclass == "") { $errors++; $errorlist .= "Character Class is required.<br />"; } - if ($currentaction == "") { $errors++; $errorlist .= "Current Action is required.<br />"; } - if ($currentfight == "") { $errors++; $errorlist .= "Current Fight is required.<br />"; } - - if ($currentmonster == "") { $errors++; $errorlist .= "Current Monster is required.<br />"; } - if ($currentmonsterhp == "") { $errors++; $errorlist .= "Current Monster HP is required.<br />"; } - if ($currentmonstersleep == "") { $errors++; $errorlist .= "Current Monster Sleep is required.<br />"; } - if ($currentmonsterimmune == "") { $errors++; $errorlist .= "Current Monster Immune is required.<br />"; } - if ($currentuberdamage == "") { $errors++; $errorlist .= "Current Uber Damage is required.<br />"; } - if ($currentuberdefense == "") { $errors++; $errorlist .= "Current Uber Defense is required.<br />"; } - if ($currenthp == "") { $errors++; $errorlist .= "Current HP is required.<br />"; } - if ($currentmp == "") { $errors++; $errorlist .= "Current MP is required.<br />"; } - if ($currenttp == "") { $errors++; $errorlist .= "Current TP is required.<br />"; } - if ($maxhp == "") { $errors++; $errorlist .= "Max HP is required.<br />"; } - - if ($maxmp == "") { $errors++; $errorlist .= "Max MP is required.<br />"; } - if ($maxtp == "") { $errors++; $errorlist .= "Max TP is required.<br />"; } - if ($level == "") { $errors++; $errorlist .= "Level is required.<br />"; } - if ($gold == "") { $errors++; $errorlist .= "Gold is required.<br />"; } - if ($experience == "") { $errors++; $errorlist .= "Experience is required.<br />"; } - if ($goldbonus == "") { $errors++; $errorlist .= "Gold Bonus is required.<br />"; } - if ($expbonus == "") { $errors++; $errorlist .= "Experience Bonus is required.<br />"; } - if ($strength == "") { $errors++; $errorlist .= "Strength is required.<br />"; } - if ($dexterity == "") { $errors++; $errorlist .= "Dexterity is required.<br />"; } - if ($attackpower == "") { $errors++; $errorlist .= "Attack Power is required.<br />"; } - - if ($defensepower == "") { $errors++; $errorlist .= "Defense Power is required.<br />"; } - if ($weaponid == "") { $errors++; $errorlist .= "Weapon ID is required.<br />"; } - if ($armorid == "") { $errors++; $errorlist .= "Armor ID is required.<br />"; } - if ($shieldid == "") { $errors++; $errorlist .= "Shield ID is required.<br />"; } - if ($slot1id == "") { $errors++; $errorlist .= "Slot 1 ID is required.<br />"; } - if ($slot2id == "") { $errors++; $errorlist .= "Slot 2 ID is required.<br />"; } - if ($slot3id == "") { $errors++; $errorlist .= "Slot 3 ID is required.<br />"; } - if ($weaponname == "") { $errors++; $errorlist .= "Weapon Name is required.<br />"; } - if ($armorname == "") { $errors++; $errorlist .= "Armor Name is required.<br />"; } - if ($shieldname == "") { $errors++; $errorlist .= "Shield Name is required.<br />"; } - - if ($slot1name == "") { $errors++; $errorlist .= "Slot 1 Name is required.<br />"; } - if ($slot2name == "") { $errors++; $errorlist .= "Slot 2 Name is required.<br />"; } - if ($slot3name == "") { $errors++; $errorlist .= "Slot 3 Name is required.<br />"; } - if ($dropcode == "") { $errors++; $errorlist .= "Drop Code is required.<br />"; } - if ($spells == "") { $errors++; $errorlist .= "Spells is required.<br />"; } - if ($towns == "") { $errors++; $errorlist .= "Towns is required.<br />"; } - - if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Auth Level must be a number.<br />"; } - if (!is_numeric($latitude)) { $errors++; $errorlist .= "Latitude must be a number.<br />"; } - if (!is_numeric($longitude)) { $errors++; $errorlist .= "Longitude must be a number.<br />"; } - if (!is_numeric($difficulty)) { $errors++; $errorlist .= "Difficulty must be a number.<br />"; } - if (!is_numeric($charclass)) { $errors++; $errorlist .= "Character Class must be a number.<br />"; } - if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Current Fight must be a number.<br />"; } - if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "Current Monster must be a number.<br />"; } - if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Current Monster HP must be a number.<br />"; } - if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "Current Monster Sleep must be a number.<br />"; } - - if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "Current Monster Immune must be a number.<br />"; } - if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Current Uber Damage must be a number.<br />"; } - if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "Current Uber Defense must be a number.<br />"; } - if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Current HP must be a number.<br />"; } - if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Current MP must be a number.<br />"; } - if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Current TP must be a number.<br />"; } - if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Max HP must be a number.<br />"; } - if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Max MP must be a number.<br />"; } - if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Max TP must be a number.<br />"; } - if (!is_numeric($level)) { $errors++; $errorlist .= "Level must be a number.<br />"; } - - if (!is_numeric($gold)) { $errors++; $errorlist .= "Gold must be a number.<br />"; } - if (!is_numeric($experience)) { $errors++; $errorlist .= "Experience must be a number.<br />"; } - if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Gold Bonus must be a number.<br />"; } - if (!is_numeric($expbonus)) { $errors++; $errorlist .= "Experience Bonus must be a number.<br />"; } - if (!is_numeric($strength)) { $errors++; $errorlist .= "Strength must be a number.<br />"; } - if (!is_numeric($dexterity)) { $errors++; $errorlist .= "Dexterity must be a number.<br />"; } - if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Attack Power must be a number.<br />"; } - if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Defense Power must be a number.<br />"; } - if (!is_numeric($weaponid)) { $errors++; $errorlist .= "Weapon ID must be a number.<br />"; } - if (!is_numeric($armorid)) { $errors++; $errorlist .= "Armor ID must be a number.<br />"; } - - if (!is_numeric($shieldid)) { $errors++; $errorlist .= "Shield ID must be a number.<br />"; } - if (!is_numeric($slot1id)) { $errors++; $errorlist .= "Slot 1 ID must be a number.<br />"; } - if (!is_numeric($slot2id)) { $errors++; $errorlist .= "Slot 2 ID must be a number.<br />"; } - if (!is_numeric($slot3id)) { $errors++; $errorlist .= "Slot 3 ID must be a number.<br />"; } - if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Drop Code must be a number.<br />"; } - - if ($errors == 0) { + if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; + +if ($email == "") { $errors++; $errorlist .= "L'Email est exigé.<br />"; } +if ($verify == "") { $errors++; $errorlist .= "La vérification de l'email est exigée.<br />"; } +if ($charname == "") { $errors++; $errorlist .= "Le nom du personnage est exigé.<br />"; } +if ($authlevel == "") { $errors++; $errorlist .= "Le niveau d'accès est exigé.<br />"; } +if ($latitude == "") { $errors++; $errorlist .= "La latitude est exigée.<br />"; } +if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigée.<br />"; } +if ($difficulty == "") { $errors++; $errorlist .= "La difficulté est exigée.<br />"; } +if ($charclass == "") { $errors++; $errorlist .= "La classe du personnagee est exigée.<br />"; } +if ($currentaction == "") { $errors++; $errorlist .= "L'action actuel est exigée.<br />"; } +if ($currentfight == "") { $errors++; $errorlist .= "Le combat en cours est exigé.<br />"; } + +if ($currentmonster == "") { $errors++; $errorlist .= "L'ID du monstre actuel est exigé.<br />"; } +if ($currentmonsterhp == "") { $errors++; $errorlist .= "Le HP du monstre actuel est exigé.<br />"; } +if ($currentmonstersleep == "") { $errors++; $errorlist .= "L'ID des sorts du monstre actuel est exigés.<br />"; } +if ($currentmonsterimmune == "") { $errors++; $errorlist .= "L'immunité du monstre actuel est exigée.<br />"; } +if ($currentuberdamage == "") { $errors++; $errorlist .= "Le dommage actuel d'Uber est exigé.<br />"; } +if ($currentuberdefense == "") { $errors++; $errorlist .= "La défense actuel d'Uber est exigé.<br />"; } +if ($currenthp == "") { $errors++; $errorlist .= "Le HP actuel est exigé.<br />"; } +if ($currentmp == "") { $errors++; $errorlist .= "Le MP actuel est exigé.<br />"; } +if ($currenttp == "") { $errors++; $errorlist .= "Le TP actuel est exigé.<br />"; } +if ($maxhp == "") { $errors++; $errorlist .= "Le HP max est exigé.<br />"; } + +if ($maxmp == "") { $errors++; $errorlist .= "Le MP max est exigé.<br />"; } +if ($maxtp == "") { $errors++; $errorlist .= "Le TP max est exigé.<br />"; } +if ($level == "") { $errors++; $errorlist .= "Le niveau est exigé.<br />"; } +if ($gold == "") { $errors++; $errorlist .= "Les rubis sont exigés.<br />"; } +if ($experience == "") { $errors++; $errorlist .= "L'experience est exigée.<br />"; } +if ($goldbonus == "") { $errors++; $errorlist .= "Les rubis bonnus sont exigés.<br />"; } +if ($expbonus == "") { $errors++; $errorlist .= "L'experience Bonus est exigé.<br />"; } +if ($strength == "") { $errors++; $errorlist .= "La force est exigée.<br />"; } +if ($dexterity == "") { $errors++; $errorlist .= "La dextérité est exigée.<br />"; } +if ($attackpower == "") { $errors++; $errorlist .= "Le pouvoir d'attaque est exigé.<br />"; } + +if ($defensepower == "") { $errors++; $errorlist .= "Le pouvoir de défense est exigé.<br />"; } +if ($weaponid == "") { $errors++; $errorlist .= "L'ID de l'arme est exigé.<br />"; } +if ($armorid == "") { $errors++; $errorlist .= "L'ID de l'armure est exigé.<br />"; } +if ($shieldid == "") { $errors++; $errorlist .= "L'ID de la protection est exigé.<br />"; } +if ($slot1id == "") { $errors++; $errorlist .= "L'ID de la fente 1 est exigé.<br />"; } +if ($slot2id == "") { $errors++; $errorlist .= "L'ID de la fente 2 est exigé.<br />"; } +if ($slot3id == "") { $errors++; $errorlist .= "L'ID de la fente 3 est exigé.<br />"; } +if ($weaponname == "") { $errors++; $errorlist .= "Le nom de l'arme est exigé.<br />"; } +if ($armorname == "") { $errors++; $errorlist .= "Le nom de l'armure est exigé.<br />"; } +if ($shieldname == "") { $errors++; $errorlist .= "Le nom de la protection est exigé.<br />"; } + +if ($slot1name == "") { $errors++; $errorlist .= "Le nom de la fente 1 est exigé.<br />"; } +if ($slot2name == "") { $errors++; $errorlist .= "Le nom de la fente 2 est exigé.<br />"; } +if ($slot3name == "") { $errors++; $errorlist .= "Le nom de la fente 2 est exigé.<br />"; } +if ($dropcode == "") { $errors++; $errorlist .= "Le code drop est exigé.<br />"; } +if ($spells == "") { $errors++; $errorlist .= "L'ID des sorts sont exigés.<br />"; } +if ($towns == "") { $errors++; $errorlist .= "Les villes sont exigées.<br />"; } + +if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Le niveau d'accès doit être un nombre.<br />"; } +if (!is_numeric($latitude)) { $errors++; $errorlist .= "La latitude doit être un nombre.<br />"; } +if (!is_numeric($longitude)) { $errors++; $errorlist .= "La longitude doit être un nombre.<br />"; } +if (!is_numeric($difficulty)) { $errors++; $errorlist .= "La difficultée doit être un nombre.<br />"; } +if (!is_numeric($charclass)) { $errors++; $errorlist .= "La classe du personnage doit être un nombre.<br />"; } +if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Le combat en cours doit être un nombre.<br />"; } +if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "L'ID monstre actuel doit être un nombre.<br />"; } +if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Le HP du monstre actuel doit être un nombre.<br />"; } +if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "L'ID des sorts du monstre actuel doit être un nombre.<br />"; } + +if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "L'immunité du monstre actuel doit être nombre.<br />"; } +if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Le dommage actuel d'Uber doit être un nombre.<br />"; } +if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "La défense actuel d'Uber doit être un nombre.<br />"; } +if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Le HP actuel doit être un nombre.<br />"; } +if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Le MP actuel doit être un nombre.<br />"; } +if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Le TP actuel doit être un nombre.<br />"; } +if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Le HP Max doit àtre un nombre.<br />"; } +if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Le MP Max doit àtre un nombre.<br />"; } +if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Le TP Max doit àtre un nombre.<br />"; } +if (!is_numeric($level)) { $errors++; $errorlist .= "Le niveau doit être un nombre.<br />"; } + +if (!is_numeric($gold)) { $errors++; $errorlist .= "Les rubis doivent êtres des nombres.<br />"; } +if (!is_numeric($experience)) { $errors++; $errorlist .= "L'expérience doit être un nombre.<br />"; } +if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Les rubis bonnus doivent êtres des nombres.<br />"; } +if (!is_numeric($expbonus)) { $errors++; $errorlist .= "L'expérience bonnus doit être un nombre.<br />"; } +if (!is_numeric($strength)) { $errors++; $errorlist .= "La force doit être un nombre.<br />"; } +if (!is_numeric($dexterity)) { $errors++; $errorlist .= "La dextérité doit être un nombre.<br />"; } +if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Le pouvoir d'attaque doit être un nombre.<br />"; } +if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Le pouvoir de défense doit être un nombre.<br />"; } +if (!is_numeric($weaponid)) { $errors++; $errorlist .= "L'ID de la l'arme doit être un nombre.<br />"; } +if (!is_numeric($armorid)) { $errors++; $errorlist .= "L'ID de l'armure doit être un nombre.<br />"; } + +if (!is_numeric($shieldid)) { $errors++; $errorlist .= "L'ID de la protection doit tre un nombre.<br />"; } +if (!is_numeric($slot1id)) { $errors++; $errorlist .= "L'ID de la fente 1 doit être un nombre.<br />"; } +if (!is_numeric($slot2id)) { $errors++; $errorlist .= "L'ID de la fente 2 doit être un nombre.<br />"; } +if (!is_numeric($slot3id)) { $errors++; $errorlist .= "L'ID de la fente 3 doit être un nombre.<br />"; } +if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Le code drop doit être un nombre.<br />"; } + +if ($errors == 0) { $updatequery = <<<END UPDATE {{table}} SET email="$email", verify="$verify", charname="$charname", authlevel="$authlevel", latitude="$latitude", @@ -767,146 +890,1126 @@ slot2id="$slot2id", slot3id="$slot3id", weaponname="$weaponname", armorname="$ar slot1name="$slot1name", slot2name="$slot2name", slot3name="$slot3name", dropcode="$dropcode", spells="$spells", towns="$towns" WHERE id="$id" LIMIT 1 END; - $query = doquery($updatequery, "users"); - admindisplay("User updated.","Edit Users"); - } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Edit Users"); - } - - } - - $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); - $row = mysql_fetch_array($query); - global $controlrow; - $diff1name = $controlrow["diff1name"]; - $diff2name = $controlrow["diff2name"]; - $diff3name = $controlrow["diff3name"]; - $class1name = $controlrow["class1name"]; - $class2name = $controlrow["class2name"]; - $class3name = $controlrow["class3name"]; +$query = doquery($updatequery, "users"); +admindisplay("Utilisateur mis à jour.","Editer utilisateurs"); +} else { +admindisplay("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les utilsateurs"); +} -$page = <<<END -<b><u>Edit Users</u></b><br /><br /> +} + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); +$row = mysql_fetch_array($query); +global $controlrow; +$diff1name = $controlrow["diff1name"]; +$diff2name = $controlrow["diff2name"]; +$diff3name = $controlrow["diff3name"]; +$class1name = $controlrow["class1name"]; +$class2name = $controlrow["class2name"]; +$class3name = $controlrow["class3name"]; + + +$page = <<<END +<b><u>Editer les utilsateurs</u></b><br /><br /> <form action="admin.php?do=edituser:$id" method="post"> <table width="90%"> -<tr><td width="20%">ID:</td><td>{{id}}</td></tr> -<tr><td width="20%">Username:</td><td>{{username}}</td></tr> +<tr><td width="20%">Joueur numéro:</td><td>{{id}}</td></tr> +<tr><td width="20%">ID:</td><td>{{username}}</td></tr> +<tr><td width="20%">Avatar classe:</td><td><img src="../images/avatar/{{avatar}}" width="71" height="66"></td></tr> <tr><td width="20%">Email:</td><td><input type="text" name="email" size="30" maxlength="100" value="{{email}}" /></td></tr> -<tr><td width="20%">Verify:</td><td><input type="text" name="verify" size="30" maxlength="8" value="{{verify}}" /></td></tr> -<tr><td width="20%">Character Name:</td><td><input type="text" name="charname" size="30" maxlength="30" value="{{charname}}" /></td></tr> -<tr><td width="20%">Register Date:</td><td>{{regdate}}</td></tr> -<tr><td width="20%">Last Online:</td><td>{{onlinetime}}</td></tr> -<tr><td width="20%">Auth Level:</td><td><select name="authlevel"><option value="0" {{auth0select}}>User</option><option value="1" {{auth1select}}>Admin</option><option value="2" {{auth2select}}>Blocked</option></select><br /><span class="small">Set to "Blocked" to temporarily (or permanently) ban a user.</span></td></tr> +<tr><td width="20%">Verifié:</td><td><input type="text" name="verify" size="30" maxlength="8" value="{{verify}}" /></td></tr> +<tr><td width="20%">Nom du personnage:</td><td><input type="text" name="charname" size="30" maxlength="30" value="{{charname}}" /></td></tr> +<tr><td width="20%">Date d'inscription:</td><td>{{regdate}}</td></tr> +<tr><td width="20%">Dernière fois en ligne:</td><td>{{onlinetime}}</td></tr> +<tr><td width="20%">Niv. d'accès:</td><td><select name="authlevel"><option value="0" {{auth0select}}>Simple joueur</option><option value="3" {{auth3select}}>Modérateur</option><option value="1" {{auth1select}}>Administrateur</option><option value="2" {{auth2select}}>Bloqué</option></select><br /><span class="small">Sélectionnez "bloqué" pour empêcher un utilisateur d'accèder au jeu.</span></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> <tr><td width="20%">Latitude:</td><td><input type="text" name="latitude" size="5" maxlength="6" value="{{latitude}}" /></td></tr> <tr><td width="20%">Longitude:</td><td><input type="text" name="longitude" size="5" maxlength="6" value="{{longitude}}" /></td></tr> -<tr><td width="20%">Difficulty:</td><td><select name="difficulty"><option value="1" {{diff1select}}>$diff1name</option><option value="2" {{diff2select}}>$diff2name</option><option value="3" {{diff3select}}>$diff3name</option></select></td></tr> -<tr><td width="20%">Character Class:</td><td><select name="charclass"><option value="1" {{class1select}}>$class1name</option><option value="2" {{class2select}}>$class2name</option><option value="3" {{class3select}}>$class3name</option></select></td></tr> +<tr><td width="20%">Difficulté:</td><td><select name="difficulty"><option value="1" {{diff1select}}>$diff1name</option><option value="2" {{diff2select}}>$diff2name</option><option value="3" {{diff3select}}>$diff3name</option></select></td></tr> +<tr><td width="20%">Classe du personnage:</td><td><select name="charclass"><option value="1" {{class1select}}>$class1name</option><option value="2" {{class2select}}>$class2name</option><option value="3" {{class3select}}>$class3name</option></select></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">Current Action:</td><td><input type="text" name="currentaction" size="30" maxlength="30" value="{{currentaction}}" /></td></tr> -<tr><td width="20%">Current Fight:</td><td><input type="text" name="currentfight" size="5" maxlength="4" value="{{currentfight}}" /></td></tr> -<tr><td width="20%">Current Monster:</td><td><input type="text" name="currentmonster" size="5" maxlength="6" value="{{currentmonster}}" /></td></tr> -<tr><td width="20%">Current Monster HP:</td><td><input type="text" name="currentmonsterhp" size="5" maxlength="6" value="{{currentmonsterhp}}" /></td></tr> -<tr><td width="20%">Current Monster Sleep:</td><td><input type="text" name="currentmonsterimmune" size="5" maxlength="3" value="{{currentmonsterimmune}}" /></td></tr> -<tr><td width="20%">Current Monster Immune:</td><td><input type="text" name="currentmonstersleep" size="5" maxlength="3" value="{{currentmonstersleep}}" /></td></tr> -<tr><td width="20%">Current Uber Damage:</td><td><input type="text" name="currentuberdamage" size="5" maxlength="3" value="{{currentuberdamage}}" /></td></tr> -<tr><td width="20%">Current Uber Defense:</td><td><input type="text" name="currentuberdefense" size="5" maxlength="3" value="{{currentuberdefense}}" /></td></tr> +<tr><td width="20%">Action en cours:</td><td><input type="text" name="currentaction" size="30" maxlength="30" value="{{currentaction}}" /></td></tr> +<tr><td width="20%">Combat en cours:</td><td><input type="text" name="currentfight" size="5" maxlength="4" value="{{currentfight}}" /></td></tr> +<tr><td width="20%">ID du monstre:</td><td><input type="text" name="currentmonster" size="5" maxlength="6" value="{{currentmonster}}" /></td></tr> +<tr><td width="20%">HP du monstre:</td><td><input type="text" name="currentmonsterhp" size="5" maxlength="6" value="{{currentmonsterhp}}" /></td></tr> +<tr><td width="20%">ID des sorts du monstre:</td><td><input type="text" name="currentmonsterimmune" size="5" maxlength="3" value="{{currentmonsterimmune}}" /></td></tr> +<tr><td width="20%">Immunité du monstre:</td><td><input type="text" name="currentmonstersleep" size="5" maxlength="3" value="{{currentmonstersleep}}" /></td></tr> +<tr><td width="20%">Dommage actuel d'Uber:</td><td><input type="text" name="currentuberdamage" size="5" maxlength="3" value="{{currentuberdamage}}" /></td></tr> +<tr><td width="20%">Défense actuel d'Uber:</td><td><input type="text" name="currentuberdefense" size="5" maxlength="3" value="{{currentuberdefense}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">Current HP:</td><td><input type="text" name="currenthp" size="5" maxlength="6" value="{{currenthp}}" /></td></tr> -<tr><td width="20%">Current MP:</td><td><input type="text" name="currentmp" size="5" maxlength="6" value="{{currentmp}}" /></td></tr> -<tr><td width="20%">Current TP:</td><td><input type="text" name="currenttp" size="5" maxlength="6" value="{{currenttp}}" /></td></tr> +<tr><td width="20%">HP actuel:</td><td><input type="text" name="currenthp" size="5" maxlength="6" value="{{currenthp}}" /></td></tr> +<tr><td width="20%">MP actuel:</td><td><input type="text" name="currentmp" size="5" maxlength="6" value="{{currentmp}}" /></td></tr> +<tr><td width="20%">TP actuel:</td><td><input type="text" name="currenttp" size="5" maxlength="6" value="{{currenttp}}" /></td></tr> <tr><td width="20%">Max HP:</td><td><input type="text" name="maxhp" size="5" maxlength="6" value="{{maxhp}}" /></td></tr> <tr><td width="20%">Max MP:</td><td><input type="text" name="maxmp" size="5" maxlength="6" value="{{maxmp}}" /></td></tr> <tr><td width="20%">Max TP:</td><td><input type="text" name="maxtp" size="5" maxlength="6" value="{{maxtp}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">Level:</td><td><input type="text" name="level" size="5" maxlength="5" value="{{level}}" /></td></tr> -<tr><td width="20%">Gold:</td><td><input type="text" name="gold" size="10" maxlength="8" value="{{gold}}" /></td></tr> +<tr><td width="20%">Niveau:</td><td><input type="text" name="level" size="5" maxlength="5" value="{{level}}" /></td></tr> +<tr><td width="20%">Monnaie:</td><td><input type="text" name="gold" size="10" maxlength="8" value="{{gold}}" /></td></tr> <tr><td width="20%">Experience:</td><td><input type="text" name="experience" size="10" maxlength="8" value="{{experience}}" /></td></tr> -<tr><td width="20%">Gold Bonus:</td><td><input type="text" name="goldbonus" size="5" maxlength="5" value="{{goldbonus}}" /></td></tr> -<tr><td width="20%">Experience Bonus:</td><td><input type="text" name="expbonus" size="5" maxlength="5" value="{{expbonus}}" /></td></tr> -<tr><td width="20%">Strength:</td><td><input type="text" name="strength" size="5" maxlength="5" value="{{strength}}" /></td></tr> -<tr><td width="20%">Dexterity:</td><td><input type="text" name="dexterity" size="5" maxlength="5" value="{{dexterity}}" /></td></tr> -<tr><td width="20%">Attack Power:</td><td><input type="text" name="attackpower" size="5" maxlength="5" value="{{attackpower}}" /></td></tr> -<tr><td width="20%">Defense Power:</td><td><input type="text" name="defensepower" size="5" maxlength="5" value="{{defensepower}}" /></td></tr> +<tr><td width="20%">Bonnus rubis:</td><td><input type="text" name="goldbonus" size="5" maxlength="5" value="{{goldbonus}}" /></td></tr> +<tr><td width="20%">Bonnus experience :</td><td><input type="text" name="expbonus" size="5" maxlength="5" value="{{expbonus}}" /></td></tr> +<tr><td width="20%">Force:</td><td><input type="text" name="strength" size="5" maxlength="5" value="{{strength}}" /></td></tr> +<tr><td width="20%">Dextérité:</td><td><input type="text" name="dexterity" size="5" maxlength="5" value="{{dexterity}}" /></td></tr> +<tr><td width="20%">Pouvoir d'attaque:</td><td><input type="text" name="attackpower" size="5" maxlength="5" value="{{attackpower}}" /></td></tr> +<tr><td width="20%">Pouvoir de défense:</td><td><input type="text" name="defensepower" size="5" maxlength="5" value="{{defensepower}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">Weapon ID:</td><td><input type="text" name="weaponid" size="5" maxlength="5" value="{{weaponid}}" /></td></tr> -<tr><td width="20%">Armor ID:</td><td><input type="text" name="armorid" size="5" maxlength="5" value="{{armorid}}" /></td></tr> -<tr><td width="20%">Shield ID:</td><td><input type="text" name="shieldid" size="5" maxlength="5" value="{{shieldid}}" /></td></tr> -<tr><td width="20%">Slot 1 ID:</td><td><input type="text" name="slot1id" size="5" maxlength="5" value="{{slot1id}}" /></td></tr> -<tr><td width="20%">Slot 2 ID:</td><td><input type="text" name="slot2id" size="5" maxlength="5" value="{{slot2id}}" /></td></tr> -<tr><td width="20%">Slot 3 ID:</td><td><input type="text" name="slot3id" size="5" maxlength="5" value="{{slot3id}}" /></td></tr> -<tr><td width="20%">Weapon Name:</td><td><input type="text" name="weaponname" size="30" maxlength="30" value="{{weaponname}}" /></td></tr> -<tr><td width="20%">Armor Name:</td><td><input type="text" name="armorname" size="30" maxlength="30" value="{{armorname}}" /></td></tr> -<tr><td width="20%">Shield Name:</td><td><input type="text" name="shieldname" size="30" maxlength="30" value="{{shieldname}}" /></td></tr> -<tr><td width="20%">Slot 1 Name:</td><td><input type="text" name="slot1name" size="30" maxlength="30" value="{{slot1name}}" /></td></tr> -<tr><td width="20%">Slot 2 Name:</td><td><input type="text" name="slot2name" size="30" maxlength="30" value="{{slot2name}}" /></td></tr> -<tr><td width="20%">Slot 3 Name:</td><td><input type="text" name="slot3name" size="30" maxlength="30" value="{{slot3name}}" /></td></tr> +<tr><td width="20%">ID de l'arme:</td><td><input type="text" name="weaponid" size="5" maxlength="5" value="{{weaponid}}" /></td></tr> +<tr><td width="20%">ID del'armure:</td><td><input type="text" name="armorid" size="5" maxlength="5" value="{{armorid}}" /></td></tr> +<tr><td width="20%">ID de la protection:</td><td><input type="text" name="shieldid" size="5" maxlength="5" value="{{shieldid}}" /></td></tr> +<tr><td width="20%">ID de la fente 1:</td><td><input type="text" name="slot1id" size="5" maxlength="5" value="{{slot1id}}" /></td></tr> +<tr><td width="20%">ID de la fente 2:</td><td><input type="text" name="slot2id" size="5" maxlength="5" value="{{slot2id}}" /></td></tr> +<tr><td width="20%">ID de la fente 3:</td><td><input type="text" name="slot3id" size="5" maxlength="5" value="{{slot3id}}" /></td></tr> +<tr><td width="20%">Nom de l'arme:</td><td><input type="text" name="weaponname" size="30" maxlength="30" value="{{weaponname}}" /></td></tr> +<tr><td width="20%">Nom de l'armure:</td><td><input type="text" name="armorname" size="30" maxlength="30" value="{{armorname}}" /></td></tr> +<tr><td width="20%">Nom de la protec.:</td><td><input type="text" name="shieldname" size="30" maxlength="30" value="{{shieldname}}" /></td></tr> +<tr><td width="20%">Nom de la fente 1:</td><td><input type="text" name="slot1name" size="30" maxlength="30" value="{{slot1name}}" /></td></tr> +<tr><td width="20%">Nom de la fente 2:</td><td><input type="text" name="slot2name" size="30" maxlength="30" value="{{slot2name}}" /></td></tr> +<tr><td width="20%">Nom de la fente 3:</td><td><input type="text" name="slot3name" size="30" maxlength="30" value="{{slot3name}}" /></td></tr> <tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> -<tr><td width="20%">Drop Code:</td><td><input type="text" name="dropcode" size="5" maxlength="8" value="{{dropcode}}" /></td></tr> -<tr><td width="20%">Spells:</td><td><input type="text" name="spells" size="50" maxlength="50" value="{{spells}}" /></td></tr> -<tr><td width="20%">Towns:</td><td><input type="text" name="towns" size="50" maxlength="50" value="{{towns}}" /></td></tr> +<tr><td width="20%">Code drop:</td><td><input type="text" name="dropcode" size="5" maxlength="8" value="{{dropcode}}" /></td></tr> +<tr><td width="20%">Sorts:</td><td><input type="text" name="spells" size="50" maxlength="50" value="{{spells}}" /></td></tr> +<tr><td width="20%">Ville:</td><td><input type="text" name="towns" size="50" maxlength="50" value="{{towns}}" /></td></tr> </table> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> +</form> +END; + +if ($row["authlevel"] == 0) { $row["auth0select"] = "selected='selected' "; } else { $row["auth0select"] = ""; } +if ($row["authlevel"] == 1) { $row["auth1select"] = "selected='selected' "; } else { $row["auth1select"] = ""; } +if ($row["authlevel"] == 2) { $row["auth2select"] = "selected='selected' "; } else { $row["auth2select"] = ""; } +if ($row["charclass"] == 1) { $row["class1select"] = "selected='selected' "; } else { $row["class1select"] = ""; } +if ($row["charclass"] == 2) { $row["class2select"] = "selected='selected' "; } else { $row["class2select"] = ""; } +if ($row["charclass"] == 3) { $row["class3select"] = "selected='selected' "; } else { $row["class3select"] = ""; } +if ($row["difficulty"] == 1) { $row["diff1select"] = "selected='selected' "; } else { $row["diff1select"] = ""; } +if ($row["difficulty"] == 2) { $row["diff2select"] = "selected='selected' "; } else { $row["diff2select"] = ""; } +if ($row["difficulty"] == 3) { $row["diff3select"] = "selected='selected' "; } else { $row["diff3select"] = ""; } + +$page = parsetemplate($page, $row); +admindisplay($page, "Editer utilisateurs"); + +} + + +function addnews() { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($content == "") { $errors++; $errorlist .= "Vous devez écrire une nouvelle.<br />"; } + + $content = addslashes($content); + if ($errors == 0) { + $query = doquery("INSERT INTO {{table}} SET id='',author='$author',postdate=NOW(),content='$content'", "news"); + $texte = new texte(); + admindisplay("La nouvelle vient d'êtres ajouté.","Ajouter une nouvelle"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter une nouvelle"); + } + + } + +$page = <<<END +<b><u>Ajouter une nouvelle</u></b><br /><br /> +<form action="admin.php?do=news" method="post"> +Après avoir rédigé votre nouvelle, cliquez sur Envoyer pour l'afficher tout de suite dans toutes les villes.<br /> +<input type="text" name="author" size="20" value="Pseudo de l'auteur"><br><br> +<textarea name="content" rows="5" cols="50"></textarea><br /> +Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url]<br> +<img src='../images/smileys/1.jpg'> :1: / +<img src='../images/smileys/2.jpg'> :2: / +<img src='../images/smileys/3.jpg'> :3: / +<img src='../images/smileys/4.jpg'> :4: / +<img src='../images/smileys/5.jpg'> :5: / +<img src='../images/smileys/6.jpg'> :6: / +<img src='../images/smileys/7.jpg'> :7: / +<img src='../images/smileys/8.jpg'> :8: /<br> +<input type="submit" name="submit" value="Envoyer" /> <input type="reset" name="reset" value="Annuler" /> </form> END; - if ($row["authlevel"] == 0) { $row["auth0select"] = "selected=\"selected\" "; } else { $row["auth0select"] = ""; } - if ($row["authlevel"] == 1) { $row["auth1select"] = "selected=\"selected\" "; } else { $row["auth1select"] = ""; } - if ($row["authlevel"] == 2) { $row["auth2select"] = "selected=\"selected\" "; } else { $row["auth2select"] = ""; } - if ($row["charclass"] == 1) { $row["class1select"] = "selected=\"selected\" "; } else { $row["class1select"] = ""; } - if ($row["charclass"] == 2) { $row["class2select"] = "selected=\"selected\" "; } else { $row["class2select"] = ""; } - if ($row["charclass"] == 3) { $row["class3select"] = "selected=\"selected\" "; } else { $row["class3select"] = ""; } - if ($row["difficulty"] == 1) { $row["diff1select"] = "selected=\"selected\" "; } else { $row["diff1select"] = ""; } - if ($row["difficulty"] == 2) { $row["diff2select"] = "selected=\"selected\" "; } else { $row["diff2select"] = ""; } - if ($row["difficulty"] == 3) { $row["diff3select"] = "selected=\"selected\" "; } else { $row["diff3select"] = ""; } + admindisplay($page, "Ajouter une nouvelle"); + +} + +function blocs() { + +$townquery3 = doquery("SELECT bloc1,bloc2,bloc4,bloc5 FROM {{table}} WHERE id='1' LIMIT 1", "blocs"); +$townrow3 = mysql_fetch_array($townquery3); + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($bloc4 == "") { $errors++; $errorlist .= "Le bloc 1 est obligatoire! (copyright).<br />"; } + $bloc1 = addslashes($bloc1); + $bloc2 = addslashes($bloc2); + $bloc5 = addslashes($bloc5); + + if ($errors == 0) { + $query = doquery("Update {{table}} SET id='1',bloc1='$bloc1',bloc2='$bloc2',bloc4='$bloc4',bloc5='$bloc5'", "blocs"); + admindisplay("Les blocs ont été modifiés.","Editer les blocs"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + +$page = ' +<b><u>Editer les blocs</u></b><br /><br /> +<form method="post" action="admin.php?do=blocs"> +Bloc 1: <input type="text" name="bloc1" size="20" value="'.$townrow3["bloc1"].'"><br>Indiquez le premier logo<br> +Bloc 2: <input type="text" name="bloc2" size="20" value="'.$townrow3["bloc2"].'"><br>Indiquez le deuxieme logo<br> +Bloc 3: <input type="text" name="bloc4" size="20" value="'.$townrow3["bloc4"].'"><br>Indiquez le premier texte copyright de la sociétée (optionnel)<br> +Bloc 4: <input type="text" name="bloc5" size="20" value="'.$townrow3["bloc5"].'"><br>Indiquez le deuxieme texte copyright de la sociétée (optionnel)<br> +<br><input type="submit" name="submit" value="Valider"><br><br><b>Attention:</b> Vous ne pouvez pas modifier une seule info. Vous devez réinsérer tous les liens des logos et le texte du copyright (indispensable) en même temps. +</form> +'; + + admindisplay($page, "Editer blocs du bas"); + +} + +function babble() +{ +if (isset($_POST["submit"])) +{ +mysql_query("TRUNCATE TABLE `rpg_babble`"); +} +$page = ' +<b><u> Vider Le Chat box </u></b><br /><br /> +<form method="post" action="admin.php?do=babble"> +<input type="submit" name="submit" value="Valider" /> +<br><br><b><font color="red">! Attention !</font></b> Vider le babble entrenera la perte de tout les messages figurant dedans, il sera impossible de les récupérer ! +</form> +'; + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + + if ($errors == 0) { + + admindisplay("La chatbox à été vidée","vider le chatbox"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + admindisplay($page, "vider le chatbox"); +} + +function message2() +{ +if (isset($_POST["submit"])) +{ +mysql_query("TRUNCATE TABLE `rpg_msg`"); +} +$page = ' +<b><u> Vider Les messageries </u></b><br /><br /> +<form method="post" action="admin.php?do=message2"> +<input type="submit" name="submit" value="Valider" /> +<br><br><b><font color="red">! Attention !</font></b> Vider les messagerie entrenera la perte de tout les messages figurant dedans, il sera impossible de les récupérer ! +</form> +'; + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + + if ($errors == 0) { + + admindisplay("Les msg à été vidée","vider le forum"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + admindisplay($page, "vider les messageries"); +} + +function comment() +{ +if (isset($_POST["submit"])) +{ +mysql_query("TRUNCATE TABLE `rpg_comments`"); +} +$page = ' +<b><u> Vider Les commentaires </u></b><br /><br /> +<form method="post" action="admin.php?do=comment"> +<input type="submit" name="submit" value="Valider" /> +<br><br><b><font color="red">! Attention !</font></b> Vider les commentaires entrenera la perte de tout les messages figurant dedans, il sera impossible de les récupérer ! +</form> +'; + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + + if ($errors == 0) { + + admindisplay("Les comentaires ont été vidées","vider les commentaires"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + admindisplay($page, "vider les commentaires"); +} + + + +function message() +{ +$texte = new texte(); + if (!isset ($_POST["envoi"])){ + $page = '<b><u> Envoyer un mail </u></b><br /><br /> + <form action="'.$_SERVER['PHP_SELF'].'?do=message" method=POST> + Email de l\'expediteur:<input type=text name=email_expediteur size=20><br>Sujet du mail:<input type=text name=sujet_mail size=20><br> + Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url]<br> +<img src="images/smileys/1.jpg"> :1: / +<img src="images/smileys/2.jpg"> :2: / +<img src="images/smileys/3.jpg"> :3: / +<img src="images/smileys/4.jpg"> :4: / +<img src="images/smileys/5.jpg"> :5: / +<img src="images/smileys/6.jpg"> :6: / +<img src="images/smileys/7.jpg"> :7: / +<img src="images/smileys/8.jpg"> :8: /<br> + <br>Message <br><textarea rows=5 name=message_envoi cols=50></textarea><br><br><input type=submit name=envoi value="Envoyer le message"></form>'; + } + else{ + //On regarde si tous les champs ont été remplis + if (empty ($_POST['email_expediteur']) || empty ($_POST['sujet_mail']) || empty ($_POST['message_envoi'])){ + echo '<script language=javascript>alert ("Vous devez remplir tous les champs!!")</script>'; + echo '<script language=javascript>window.location="'.$_SERVER['PHP_SELF'].'?do=message"</script>'; + } + else{ + //On sélectionne tous les emails et on envoie le message + $selection="select * from rpg_users where verify=1"; + $sql=mysql_query($selection); + while ($a_row=mysql_fetch_assoc($sql)){ + //La récupération étant terminée, on envoie le message à chaque membre! + $to = "$a_row[email]"; + $sujet = "$_POST[sujet_mail]"; + //--- la structure du mail ----// + $from = "From:$_POST[email_expediteur]\n"; + $from .= "MIME-version: 1.0\n"; + $from .= "Content-type: text/html; charset= iso-8859-1\n"; + //--- Corps du message ---// + $message_def="$_POST[message_envoi]\n"; + //--- on envoie l'email ---// + mail($to,$sujet,$message_def,$from); + } + if (isset($_POST["envoi"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($email_expediteur == "") { $errors++; $errorlist .= "Entrez l'email de l'expediteur.<br />"; } + if ($message_envoi == "") { $errors++; $errorlist .= "Entrez votre message.<br />"; } + + if ($errors == 0) { + + admindisplay("Le mail a été envoyé","Editer un mail"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + } + } + + + admindisplay($page, "Editer un mail"); +} + +function newsaccueil() { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + $content = addslashes($content); + $titre = addslashes($titre); + if ($errors == 0) { + $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),titre='$titre', content='$content', auteur='$auteur'", "newsaccueil"); + $texte = new texte(); + admindisplay("La new a été Ajoutée.","Editer la new 1"); + } else { + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer la new"); + } + + } + + +$page = ' +<b><u>Editer les news</u></b><br /><br /> +<form method="post" action="admin.php?do=newsaccueil"> +<input type="text" name="titre" size="20" value="Titre de la News"><br><br> +<input type="text" name="auteur" size="20" value="Pseudo de lauteur"><br><br> +Ecrivez l\'intégralité de la new ci dessous<br> +<textarea name="content" rows="5" cols="50"></textarea><br> +Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url]<br> +<img src="../images/smileys/1.jpg"> :1: / +<img src="../images/smileys/2.jpg"> :2: / +<img src="../images/smileys/3.jpg"> :3: / +<img src="../images/smileys/4.jpg"> :4: / +<img src="../images/smileys/5.jpg"> :5: / +<img src="../images/smileys/6.jpg"> :6: / +<img src="../images/smileys/7.jpg"> :7: / +<img src="../images/smileys/8.jpg"> :8: /<br> +<input type="submit" name="submit" value="Valider"> +<input type="submit" name="reset" value="Annuler"><br><br>Vous pouvez ajouter une image dans la news en ajoutant ce code: <b>img src="url de l\'image"></b> . N\'oubliez pas le <b><</b> devant le img! <br><b>Attention :</b> Si vous avez actuellement 5 news sur la page d\'accueil, celle-ci effacera la plus ancienne. +</form> +'; + + admindisplay($page, "Editer les news"); + +} + +function interet() { +if (isset($_POST["submit"])) { +mysql_query ("UPDATE rpg_users SET bank = bank + (bank * 0.03 )") or die(mysql_error()); +admindisplay("Les interets ont bien été ajouté", "Interets"); +} +$page = ' +<b><u>Interet</u></b><br /><br /> +<form method="post" action="admin.php?do=interet"> +Pour déclencher les interets il suffit de cliquer sur le bouton ci-dessous +<input type="submit" name="submit" value="Déclencher les interets"> +</form> +'; + +admindisplay($page, "Interets"); +} + +function items2() { - $page = parsetemplate($page, $row); - admindisplay($page, "Edit Users"); + $query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "items2"); + $page = "<b><u>Editer les objets</u></b><br />Cliquez sur le nom d'un objet pour le modifier.<br /><br /><table width=\"50%\">\n"; + $count = 1; + while ($row = mysql_fetch_array($query)) { + if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=edititem2:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 2; } + else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=edititem2:".$row["id"]."\">".$row["name"]."</a></td></tr>\n"; $count = 1; } + } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas d'objets trouvés.</td></tr>\n"; } + $page .= "</table>"; + admindisplay($page, "Editer objets"); +} + +function edititem2($id) { + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($name == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } + if ($buycost == "") { $errors++; $errorlist .= "Le prix est exigé.<br />"; } + if (!is_numeric($buycost)) { $errors++; $errorlist .= "Le prix doit être un nombre!.<br />"; } + + + $name = addslashes($name); + $description = addslashes($description); + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET name='$name',type='$type',buycost='$buycost',description='$description' WHERE id='$id' LIMIT 1", "items2"); + admindisplay("Objet mis à jour.","Editer objets"); + } else { + admindisplay("<b>Erreur:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Edit Items2"); + } + + } + + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items2"); + $row = mysql_fetch_array($query); + +$page = <<<END +<b><u>Editer Items</u></b><br /><br /> +<form action="admin.php?do=edititem2:$id" method="post"> +<table width="90%"> +<tr><td width="20%">ID:</td><td>{{id}}</td></tr> +<br /><br /> +<tr><td width="20%">Nom:</td><td><input type="text" name="name" size="30" maxlength="30" value="{{name}}" /></td></tr> +<tr><td width="20%">Type:</td><td><select name="type"><option value="1" {{type1select}}>Arme</option><option value="2" {{type2select}}>Armure</option><option value="3" {{type3select}}>Protection</option></select></td></tr> +<tr><td width="20%">Prix:</td><td><input type="text" name="buycost" size="5" maxlength="10" value="{{buycost}}" /> rubis</td></tr> +<tr><td width="20%">Description:</td><td><textarea name="description" type="text" rows="5" cols="50">{{description}}</textarea></td></tr> + + +</table> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> +</form> + +END; + + if ($row["type"] == 1) { $row["type1select"] = "selected=\"selected\" "; } else { $row["type1select"] = ""; } + if ($row["type"] == 2) { $row["type2select"] = "selected=\"selected\" "; } else { $row["type2select"] = ""; } + if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; } + + $page = parsetemplate($page, $row); + admindisplay($page, "Editer objets"); + } -function addnews() { +function addville() { + +if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; + +if ($name == "") { $errors++; $errorlist .= "Le nom de la ville est exigé.<br />"; } +if ($codebanque == "") { $errors++; $errorlist .= "Le codebanque est exigée.<br />"; } +if ($codeniveau == "") { $errors++; $errorlist .= "Le codeniveau est exigé.<br />"; } +if ($interets == "") { $errors++; $errorlist .= "Les intérêts sont exigés.<br />"; } +if ($chiffrebanque == "") { $errors++; $errorlist .= "Le chiffrebanque est exigée.<br />"; } +if ($chiffreniveau == "") { $errors++; $errorlist .= "Le chiffreniveau est exigée.<br />"; } +if ($latitude == "") { $errors++; $errorlist .= "La latitude est exigée.<br />"; } +if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigée.<br />"; } +if ($innprice == "") { $errors++; $errorlist .= "Le prix de l'hôtel est exigée.<br />"; } +if ($mapprice == "") { $errors++; $errorlist .= "Le prix de la carte est exigé.<br />"; } +if ($homeprice == "") { $errors++; $errorlist .= "Le prix de la maison est exigé.<br />"; } +if ($travelpoints == "") { $errors++; $errorlist .= "Les points de voyages sont exigés.<br />"; } +if ($itemslist == "") { $errors++; $errorlist .= "La liste des objets est exigée.<br />"; } + +if ($errors == 0) { +$updatequery = <<<END +INSERT INTO rpg_towns (id, name, codebanque, codeniveau, interets, chiffrebanque, chiffreniveau, latitude, longitude, innprice, mapprice, homeprice, travelpoints, itemslist) VALUES('', '$name', '$codebanque', '$codeniveau', '$interers', '$chiffrebanque', '$chiffreniveau', '$latitude', '$longitude', '$innprice', '$mapprice', '$homeprice', '$travelpoints', '$itemlist'); +END; +$query = doquery($updatequery, "towns"); +admindisplay("Utilisateur mis à jour.","Ajouter une ville"); +} else { +admindisplay("<b>Erreurs :</b><br /><div style='color:red;'>$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter une ville"); +} + +} + + + +$page = <<<END +<b><u>Ajouter une ville</u></b><br/><br/> +<form method="POST" action="admin.php?do=addville"> +<p>ID de la ville : <input type="text" name="id" size="20"></p> +<p></p> +<p>Nom de la ville : <input type="text" name="name" size="20"></p> +<p>Code banque : <input type="text" name="codebanque" size="20" value="Service non disponible"> +Par Défaut : Service non disponible.</p> +<p>Code niveau : <input type="text" name="codeniveau" size="20" value="Service non disponible"> +Par Défaut : Service non disponible.</p> +<p>Intérêts : <input type="text" name="interets" size="20" value="0"> Intérêts +pour la banque.</p> +<p>Chiffre banque : <input type="text" name="chiffrebanque" size="20" value="5000"></p> +<p>Chiffre niveau : <input type="text" name="chiffreniveau" size="20" value="5"></p> +<p>Latitude : <input type="text" name="latitude" size="20"></p> +<p>Longitude : <input type="text" name="longitude" size="20"></p> +<p>Prix de l´Hôtel : <input type="text" name="innprice" size="20" value="5"></p> +<p>Prix de la Carte : <input type="text" name="mapprice" size="20" value="0"></p> +<p>Prix de la Maison : <input type="text" name="homeprice" size="20" value="1000"> Prix +pour construire une maison.</p> +<p>Points de Voyage : <input type="text" name="travelpoints" size="20" value="0"></p> +<p>Liste des Objets : <input type="text" name="itemslist" size="20"> Les objets pour les +magasins.</p> +<p><center><input type="submit" name="submit" value="Valider"> +<input type="reset" name="reset" value="Annuler"> </center></p> +</form> +END; + +if ($row[""] == 0) { +$row[""] = "selected='selected' "; +} +else { +$row[""] = ""; +} + + +$page = parsetemplate($page, $row); +admindisplay($page, "Ajouter une ville"); + +} + +function addsort() { + +if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; + +if ($name == "") { $errors++; $errorlist .= "Le nom du est exigé.<br />"; } +if ($mp == "") { $errors++; $errorlist .= "Le mp est exigée.<br />"; } +if ($attribute == "") { $errors++; $errorlist .= "L'attribute est exigé.<br />"; } +if ($type == "") { $errors++; $errorlist .= "Les type est exigés.<br />"; } +if ($price == "") { $errors++; $errorlist .= "Le prix est exigée.<br />"; } +if ($errors == 0) { +$updatequery = <<<END +INSERT INTO rpg_spells (id, name, mp, attribute, type, price) VALUES('', '$name', '$mp', '$attribute', '$type', '$price'); +END; +$query = doquery($updatequery, "spells"); +admindisplay("Sort ajouté","Ajouter un sort"); +} else { +admindisplay("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter une ville"); +} + +} + + + +$page = <<<END +<b><u>Ajouter un sort</u></b><br/><br/> +<form method="POST" action="admin.php?do=addsort"> +ID:<input type="text" name="id" size="20"></p> +<p>Nom:<input type="text" name="name" size="20"></p> +<p>mp:<input type="text" name="mp" size="20"> Pour les domages!</p> +<p>attribute:<input type="text" name="attribute" size="20"></p> +<p>type:<input type="text" name="type" size="20"></p> +<p>Price:<input type="text" name="price" size="20"> Prix</p> +<p><input type="submit" name="submit" value="Valider"> +<input type="reset" name="reset" value="Annuler"> </p> +</form> +END; + +if ($row[""] == 0) { $row[""] = "selected='selected' "; } else { $row[""] = ""; } + +$page = parsetemplate($page, $row); +admindisplay($page, "Ajouter un sort"); + +} + +function stats() { +$stats_users_actif_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE verify='1'") or die (mysql_error()); +$stats_users_actif_donnee = mysql_fetch_array($stats_users_actif_sql); +$stats_users_actif = $stats_users_actif_donnee["id"]; + +$stats_users_admin_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE authlevel='1'") or die (mysql_error()); +$stats_users_admin_donnee = mysql_fetch_array($stats_users_admin_sql); +$stats_users_admin = $stats_users_admin_donnee["id"]; + +$stats_users_membre_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE verify='1'") or die (mysql_error()); +$stats_users_membre_donnee = mysql_fetch_array($stats_users_membre_sql); +$stats_users_membre = $stats_users_membre_donnee["id"]; + +$stats_users_inactif_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE verify='0'") or die (mysql_error()); +$stats_users_inactif_donnee = mysql_fetch_array($stats_users_inactif_sql); +$stats_users_inactif = $stats_users_inactif_donnee["id"]; + +$stats_forum_sujets_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_forum WHERE parent='0'") or die (mysql_error()); +$stats_forum_sujets_donnee = mysql_fetch_array($stats_forum_sujets_sql); +$stats_forum_sujets = $stats_forum_sujets_donnee["id"]; + +$stats_forum_messages_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_forum WHERE parent='1'") or die (mysql_error()); +$stats_forum_messages_donnee = mysql_fetch_array($stats_forum_messages_sql); +$stats_forum_messages = $stats_forum_messages_donnee["id"]; + +$stats_userlieu_ville_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE currentaction='En ville'") or die (mysql_error()); +$stats_userlieu_ville_donnee = mysql_fetch_array($stats_userlieu_ville_sql); +$stats_userlieu_ville = $stats_userlieu_ville_donnee["id"]; + +$stats_userlieu_balade_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE currentaction='En exploration'") or die (mysql_error()); +$stats_userlieu_balade_donnee = mysql_fetch_array($stats_userlieu_balade_sql); +$stats_userlieu_balade = $stats_userlieu_balade_donnee["id"]; + +$stats_lieu_villes_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_towns") or die (mysql_error()); +$stats_lieu_villes_donnee = mysql_fetch_array($stats_lieu_villes_sql); +$stats_lieu_villes = $stats_lieu_villes_donnee["id"]; + +$stats_userlieu_combat_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_users WHERE currentaction='En combat'") or die (mysql_error()); +$stats_userlieu_combat_donnee = mysql_fetch_array($stats_userlieu_combat_sql); +$stats_userlieu_combat = $stats_userlieu_combat_donnee["id"]; + +$stats_lieu_maisons_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_maison") or die (mysql_error()); +$stats_lieu_maisons_donnee = mysql_fetch_array($stats_lieu_maisons_sql); +$stats_lieu_maisons = $stats_lieu_maisons_donnee["id"]; + +$stats_perso_monstre_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_monsters") or die (mysql_error()); +$stats_perso_monstre_donnee = mysql_fetch_array($stats_perso_monstre_sql); +$stats_perso_monstre = $stats_perso_monstre_donnee["id"]; + +$stats_perso_level_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_levels") or die (mysql_error()); +$stats_perso_level_donnee = mysql_fetch_array($stats_perso_level_sql); +$stats_perso_level = $stats_perso_level_donnee["id"]; + +$stats_tchat_msg_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_babble") or die (mysql_error()); +$stats_tchat_msg_donnee = mysql_fetch_array($stats_tchat_msg_sql); +$stats_tchat_msg = $stats_tchat_msg_donnee["id"]; + +$stats_news_commentaires_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_comments") or die (mysql_error()); +$stats_news_commentaires_donnee = mysql_fetch_array($stats_news_commentaires_sql); +$stats_news_commentaires = $stats_news_commentaires_donnee["id"]; + +$stats_news_total_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_newsaccueil") or die (mysql_error()); +$stats_news_total_donnee = mysql_fetch_array($stats_news_total_sql); +$stats_news_total = $stats_news_total_donnee["id"]; + +$stats_nouvelles_total_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_news") or die (mysql_error()); +$stats_nouvelles_total_donnee = mysql_fetch_array($stats_nouvelles_total_sql); +$stats_nouvelles_total = $stats_nouvelles_total_donnee["id"]; + +$stats_objets_perdus_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_drops") or die (mysql_error()); +$stats_objets_perdus_donnee = mysql_fetch_array($stats_objets_perdus_sql); +$stats_objets_perdus = $stats_objets_perdus_donnee["id"]; + +$stats_sondages_total_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_sondage") or die (mysql_error()); +$stats_sondages_total_donnee = mysql_fetch_array($stats_sondages_total_sql); +$stats_sondages_total = $stats_sondages_total_donnee["id"]; + +$stats_sondages_participation_sql = mysql_query("SELECT COUNT(*) AS id FROM rpg_sondage_ip") or die (mysql_error()); +$stats_sondages_participation_donnee = mysql_fetch_array($stats_sondages_participation_sql); +$stats_sondages_participation = $stats_sondages_participation_donnee["id"]; + +$stats_rpg_version_sql = mysql_query("SELECT gamename FROM rpg_control") or die (mysql_error()); +while ($stats_rpg_version_donnee = mysql_fetch_array($stats_rpg_version_sql) ) +{ +$stats_rpg_version = $stats_rpg_version_donnee['gamename']; +} +$page = <<<END +<h2><p align="center"><font color=red>Statistiques</font><p></h2> +<p><b>Nombre de membres actifs :</b> $stats_users_actif</p> +<p><b>Nombre des administrateurs :</b> $stats_users_admin</p> +<p><b>Nombre de membres actifs (total) :</b> $stats_users_membre</p> +<p><b>Nombre de membres inactifs :</b> $stats_users_inactif</p> +<p><b>Nombre de sujets dans le forum :</b> $stats_forum_sujets</p> +<p><b>Nombre de messages dans le forum :</b> $stats_forum_messages</p> +<p><b>Nombre de personnages en ville :</b> $stats_userlieu_ville</p> +<p><b>Nombre de personnage en exploration :</b> $stats_userlieu_balade</p> +<p><b>Nombre de personnage en combat :</b> $stats_userlieu_combat</p> +<p><b>Nombre de villes :</b> $stats_lieu_villes</p> +<p><b>Nombre de maisons :</b> $stats_lieu_maisons</p> +<p><b>Nombre de monstres :</b> $stats_perso_monstre</p> +<p><b>Nombre de niveaux :</b> $stats_perso_level</p> +<p><b>Nombre de messages dans le chat :</b> $stats_tchat_msg</p> +<p><b>Nombre de news :</b> $stats_news_total</p> +<p><b>Nombre de nouvelles :</b> $stats_nouvelles_total</p> +<p><b>Nombre de commentaires aux nouvelles :</b> $stats_news_commentaires</p> +<p><b>Nombre des objets perdus :</b> $stats_objets_perdus</p> +<p><b>Nombre de sondages :</b> $stats_sondages_total</p> +<p><b>Nombre de participations au sondages :</b> $stats_sondages_participation</p> +<p><b>Version du RPG :</b> $stats_rpg_version</p> +END; +admindisplay($page, "Statistiques du jeu"); +} + +function villenatal() { if (isset($_POST["submit"])) { extract($_POST); $errors = 0; $errorlist = ""; - if ($content == "") { $errors++; $errorlist .= "Content is required.<br />"; } - + + if ($lati == "") { $errors++; $errorlist .= "Exigé.<br />"; } + if ($long == "") { $errors++; $errorlist .= "Exigé.<br />"; } if ($errors == 0) { - $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),content='$content'", "news"); - admindisplay("News post added.","Add News"); +$updatequery = <<<END +UPDATE rpg_users SET latitude='$lati',longitude='$long' WHERE verify=1 +END; + $query = doquery($updatequery, "towns"); + admindisplay("Longitude et latitude réussie","Longitude et latitude"); } else { - admindisplay("<b>Errors:</b><br /><div style=\"color:red;\">$errorlist</div><br />Please go back and try again.", "Add News"); + admindisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter une ville"); } } + + $page = <<<END -<b><u>Add A News Post</u></b><br /><br /> -<form action="admin.php?do=news" method="post"> -Type your post below and then click Submit to add it.<br /> -<textarea name="content" rows="5" cols="50"></textarea><br /> -<input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /> +<b><u>Modifier touts la position des joueurs</u></b><br/><br/> +<form method="POST" action="admin.php?do=villenatal"> + <p>Latitude:<input type="text" name="lati" size="20"></p> + <p>Longitude:<input type="text" name="long" size="20"></p> + <p><input type="submit" name="submit" value="Valider"> + <input type="reset" name="reset" value="Annuler"> </p> </form> END; - - admindisplay($page, "Add News"); + + if ($row[""] == 0) { $row[""] = "selected=\"selected\" "; } else { $row[""] = ""; } + + + $page = parsetemplate($page, $row); + admindisplay($page, "Longitude et Latitude"); } + +function forum() { + + $query = doquery("SELECT id,title,author,postdate FROM {{table}} ORDER BY id", "forum"); + $page = "<b><u>Editer les forums</u></b><br />Cliquez sur le nom du sujet pour le modifier.<br /><br /><table width=\"50%\">\n"; + $count = 1; + while ($row = mysql_fetch_array($query)) { + if ($count == 1) { + $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">Id</td><td width=\"8%\" style=\"background-color: #ffffff;\">Auteur</td><td style=\"background-color: #fffffff;\">Titre</td><td style=\"background-color: #fffffff;\">Posté le :</td>"; + $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["author"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"admin.php?do=editforum:".$row["id"]."\">".$row["title"]."</a></td><td style=\"background-color: #eeeeee;\">".$row["postdate"]."</td></tr>\n"; $count = 2; } + else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["author"]."</td><td style=\"background-color: #ffffff;\"><a href=\"admin.php?do=editforum:".$row["id"]."\">".$row["title"]."</a></td><td style=\"background-color: #ffffff;\">".$row["postdate"]."</td></tr>\n"; $count = 1; } + } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas de sujet trouvé.</td></tr>\n"; } + $page .= "</table>"; + admindisplay($page, "Editer Forum"); +} + +function editforum($id) { + + if (isset($_POST['delete'])) { + $sql ="delete from rpg_forum where id=$id"; + mysql_query($sql) or die("MySQL error: ".mysql_error().""); + admindisplay("Message supprimé. <a href='admin.php?do=forum'>Retour</a>","Editer Forum"); + } + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($author == "") { $errors++; $errorlist .= "Le nom de l'auteur est exigé.<br />"; } + if ($title == "") { $errors++; $errorlist .= "Le titre est exigé.<br />"; } + if ($content == "") { $errors++; $errorlist .= "Le contenu est exigé.<br />"; } + + + $author = addslashes($author); + $content = addslashes($content); + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET author='$author',title='$title',content='$content' WHERE id='$id' LIMIT 1", "forum"); + admindisplay("Forum mis à jour. <a href='admin.php?do=forum'>Retour</a>","Editer Forum"); + } else { + admindisplay("<b>Erreur:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer Forum"); + } + + } + + + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "forum"); + $row = mysql_fetch_array($query); + +$page = <<<END +<b><u>Editer les forums :</u></b><br /><br /> +<form action="admin.php?do=editforum:$id" method="post"> + +<table width="90%"> +<tr><td width="20%">ID:</td><td>{{id}}</td></tr> +<br /><br /> +<tr><td width="20%">Auteur:</td><td><input type="text" name="author" size="30" maxlength="30" value="{{author}}" /></td></tr> +<tr><td width="20%">Titre:</td><td><input type="text" name="title" size="30" maxlength="30" value="{{title}}" /></td></tr> +<tr><td width="20%">Contenu:</td><td><textarea name="content" type="text" rows="5" cols="50">{{content}}</textarea></td></tr> +<tr><td width="20%">Supprimé:</td><td><input type="submit" value="Supprimer" name="delete"></td></tr> +</table> + +<input type="submit" name="submit" value="Valider" /><input type="reset" name="reset" value="Annuler" /></form> +<input type="hidden" name="id" value="id"></form> + + +END; + + if ($row["type"] == 1) { $row["type1select"] = "selected=\"selected\" "; } else { $row["type1select"] = ""; } + if ($row["type"] == 2) { $row["type2select"] = "selected=\"selected\" "; } else { $row["type2select"] = ""; } + if ($row["type"] == 3) { $row["type3select"] = "selected=\"selected\" "; } else { $row["type3select"] = ""; } + + $page = parsetemplate($page, $row); + admindisplay($page, "Editer Forum"); + +} + +function metier(){ +global $userrow; +admindisplay("<center>Voulez vous remetre les Metier a JOUR ?</center><center><form method='post' action='admin.php?do=metier2'><input type='submit' name='submit' value='Oui' /> <input type='submit' name='cancel' value='Non' /></p></form></center>", "remetre les metier a jour"); +} +function metier2() { +if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } +global $userrow, $numqueries; +$news = $userrow["ptmetier"] + 1; +mysql_query("UPDATE rpg_users SET ptmetier=ptmetier+$news WHERE ptmetier=0 "); +admindisplay("C'est ok !!! Les Metier sont mis a jour", "Bon travail pour demain"); + +} + +function quetes() { + +$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "quete"); +$page = '<b><u><span class="mauve1">Editer les quêtes</span></u></b><br /><br />Cliquez sur le nom d\'une quete pour la modifier.<br /><br /><table width="350">'; +$count = 1; +while ($maisons = mysql_fetch_array($query)) { +if ($count == 1) { $page .= '<tr><td width="20" class="rose1">'.$maisons['id'].'</td><td class="rose1"><a href="admin.php?do=editquetes:'.$maisons['id'].'">'.$maisons['name'].'</a></td></tr>'; $count = 2; } +else { $page .= '<tr><td width="2" class="rose2">'.$maisons['id'].'</td><td class="rose2"><a href="admin.php?do=editquetes:'.$maisons['id'].'">'.$maisons['name'].'</a></td></tr>'; $count = 1; } +} +if (mysql_num_rows($query) == 0) { $page = 'Pas de quêtes trouvés.'; } +$page .= ''; + +admindisplay($page, 'Editer les quêtes'); + +} + +function editquetes($id) { + +if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; + + +$charname = addslashes($charname); + +if ($errors == 0) +{ +if ( empty($effacement) ) { +$query = doquery("UPDATE {{table}} SET id='$id',name='$name',description='$description',level='$level',type='$type',monster='$monster',number='$number',longi='$longi',lati='$lati',town='$town',experience='$experience',gils='$gils' WHERE id='$id' LIMIT 1", "quete"); +} +else { +$query = doquery("DELETE FROM {{table}} WHERE id='$id' LIMIT 1", "quete"); +} +admindisplay('Quete mis à jour.','Editer les Quete'); +} +else { +admindisplay('<b>Erreurs:</b><br /><br /><span class="alerte">'.$errorlist.'</span><br /><a href="admin.php?do=editquetes:'.$id.'">Veuillez retourner et essayer encore</a>.', 'Editer les quetes'); +} + + +} + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "quete"); +$quetes = mysql_fetch_array($query); + +$page = ' +<b><u><span class="mauve1">Editer maisons</span></u></b><br /><br /> +<form action="admin.php?do=editquetes:'.$id.'" method="post"> +<table width="386" border="0" cellspacing="0" cellpadding="0"> +<tr valign="top"><td width="110"><span class="marron3">ID:</span></td><td>'.$id.'<br /><br /></td></tr> +<br /><br /> +<tr valign="top"><td width="110"><span class="marron3">Nom de la quête:</span></td><td><input type="text" name="name" size="30" maxlength="30" value="'.stripslashes($quetes['name']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Texte Personnage:</span></td><td><textarea name="description" size="8" maxlength="3"/>'.stripslashes($quetes['description']).'</textarea><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Niveau de la quete:</span></td><td><input type="text" name="level" size="8" maxlength="3" value="'.stripslashes($quetes['level']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Gain en xp:</span></td><td><input type="text" name="experience" size="10" maxlength="4" value="'.stripslashes($quetes['experience']).'" /> xp<br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Monnaie gagnés:</span></td><td><input type="text" name="Monnaie" size="8" maxlength="3" value="'.stripslashes($quetes['Monnaie']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Effacer la quete:</span></td><td><input type="checkbox" name="effacement" value="1"><br /><br /></td></tr> +<tr valign="top"><td width="110"></td><td><input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> +</td></tr> +</table> +</form> +'; +$page = parsetemplate($page, $quetees); +admindisplay($page, "Editer les quetes"); + +} + +function maisons() { + +$query = doquery("SELECT id,name FROM {{table}} ORDER BY id", "maison"); +$page = '<b><u><span class="mauve1">Editer les maisons</span></u></b><br /><br />Cliquez sur le nom d\'une maison pour la modifier.<br /><br /><table width="350">'; +$count = 1; +while ($maisons = mysql_fetch_array($query)) { +if ($count == 1) { $page .= '<tr><td width="20" class="rose1">'.$maisons['id'].'</td><td class="rose1"><a href="admin.php?do=editmaisons:'.$maisons['id'].'">'.$maisons['name'].'</a></td></tr>'; $count = 2; } +else { $page .= '<tr><td width="2" class="rose2">'.$maisons['id'].'</td><td class="rose2"><a href="admin.php?do=editmaisons:'.$maisons['id'].'">'.$maisons['name'].'</a></td></tr>'; $count = 1; } +} +if (mysql_num_rows($query) == 0) { $page = 'Pas de maisons trouvés.'; } +$page .= ''; + +admindisplay($page, 'Editer les maisons'); + +} + +function editmaisons($id) { + +if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; +if ($charname == "") { $errors++; $errorlist .= "Le nom est exigé.<br />"; } +if (preg_match("/[\^*+<>?#]/", $charname)==1) { $errors++; $errorlist .= "Le nom du site doit être écrit en caractères alphanumériques.<br />"; } +if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigée.<br />"; } +if (!is_numeric($longitude)) { $errors++; $errorlist .= "La longitude doit être un nombre!.<br />"; } +if ($latitude == "") { $errors++; $errorlist .= "La latitude est exigée.<br />"; } +if (!is_numeric($latitude)) { $errors++; $errorlist .= "La latitude doit être un nombre!.<br />"; } if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigé.<br />"; } +if ($auberge == "") { $errors++; $errorlist .= "Le prix de l'auberge est exigé.<br />"; } +if (!is_numeric($auberge)) { $errors++; $errorlist .= "Le prix de l'auberge doit être un nombre!.<br />"; } if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigé.<br />"; } + + +$charname = addslashes($charname); + +if ($errors == 0) +{ +if ( empty($effacement) ) { +$query = doquery("UPDATE {{table}} SET name='".addslashes($name)."',longitude='$longitude',latitude='$latitude',innprice='$auberge' WHERE id='$id' LIMIT 1", "maison"); +} +else { +$query = doquery("DELETE FROM {{table}} WHERE id='$id' LIMIT 1", "maison"); +} +admindisplay('Maison mis à jour.','Editer les maisons'); +} +else { +admindisplay('<b>Erreurs:</b><br /><br /><span class="alerte">'.$errorlist.'</span><br /><a href="admin.php?do=editmaisons:'.$id.'">Veuillez retourner et essayer encore</a>.', 'Editer les maisons'); +} + + +} + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "maison"); +$maisons = mysql_fetch_array($query); + +$page = ' +<b><u><span class="mauve1">Editer maisons</span></u></b><br /><br /> +<form action="admin.php?do=editmaisons:'.$id.'" method="post"> +<table width="386" border="0" cellspacing="0" cellpadding="0"> +<tr valign="top"><td width="110"><span class="marron3">ID:</span></td><td>'.$id.'<br /><br /></td></tr> +<br /><br /> +<tr valign="top"><td width="110"><span class="marron3">Charname:</span></td><td><input type="text" name="charname" size="30" maxlength="30" value="'.stripslashes($maisons['name']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Latitude:</span></td><td><input type="text" name="latitude" size="8" maxlength="3" value="'.stripslashes($maisons['latitude']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Longitude:</span></td><td><input type="text" name="longitude" size="8" maxlength="3" value="'.stripslashes($maisons['longitude']).'" /><br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Prix de l\'auberge:</span></td><td><input type="text" name="auberge" size="10" maxlength="4" value="'.stripslashes($maisons['innprice']).'" /> rubis<br /><br /></td></tr> +<tr valign="top"><td width="110"><span class="marron3">Effacer la maison:</span></td><td><input type="checkbox" name="effacement" value="1"><br /><br /></td></tr> +<tr valign="top"><td width="110"></td><td><input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> +</td></tr> +</table> +</form> +'; +$page = parsetemplate($page, $maisons); +admindisplay($page, "Editer les maisons"); + +} + +function createquete () +{ +extract($_POST); +if($radio1=='1') +{ +if($radio2=='1') { $prolongation=$oldquest; } else { $prolongation=0; } +mysql_query("INSERT INTO rpg_quete (name,description,level,type,monster,number,longi,lati, +town,experience,gils,prolongation) VALUES ('$nomquete','$textequete','$niveau','1',' +$typemonster', +'$nbrmonster','','','$ville','$gain','$gils','$prolongation')") or die ("Erreur"); +admindisplay("La Quete a été Ajoutée.","Quete Effective"); +} +elseif($radio1=='2') +{ +if($radio2=='1') { $prolongation=$oldquest; } else { $prolongation=0; } +mysql_query("INSERT INTO rpg_quete (name,description,level,type,monster,number,longi,lati, +town,experience,gils,prolongation) VALUES ('$nomquete','$textequete','$niveau','2','','', +'$longi','$lati', +'$ville','$gain','$gils','$prolongation')") or die ("Erreur"); +admindisplay("La Quete a été Ajoutée.","Quete Effective"); +} +else +{ +admindisplay("Une erreur inattendue a empecher la création de la quete !","Erreur sur la Quete"); +} +} + +function quete () { + +global $radio1; +$page = ' +<form id="form1" name="form1" method="post" action="admin.php?do=createquete"> +<label>Nom de la Quête +<input name="nomquete" type="text" id="nomquete" size="30" maxlength="50" /> +</label> +<p>Entrez le texte du personnage <br /> +<label> +<textarea name="textequete" cols="50" rows="10" id="textequete"></textarea> +</label> +</p> +<p>Entrez le niveau de la quete +<label> +<input name="niveau" type="text" size="3" maxlength="3" /> +</label> +</p> +<p>Entrez le gain en experience +<label> +<input name="gain" type="text" size="3" maxlength="3" /> +</label> +</p> +<p>Entrez le nombre de Monnaie gagnés +<label> +<input name="Monnaie" type="text" size="3" maxlength="3" /> +</label> +</p> +<p>Que doit faire la personne pour résoudre la quete ?<br /> +<label> +<input type="radio" name="radio1" value="1" /> +Tuer des Monstres</label> +(Type de Monstres : +<label> +<select name="typemonster" id="type monster">'; +$query = mysql_query("SELECT * FROM rpg_monsters"); +while( $req = mysql_fetch_array($query) ) +{ +$page .= '<option value="' . $req[1] . '">' . $req[1] . '</option>'; +} +$page .=' +</select> +</label> +et le nombre +<label> +<input name="nbrmonster" type="text" id="nbrmonster" size="5" maxlength="5" /> +</label> +) +<br /> +<label> +<input type="radio" name="radio1" value="2" /> +Trouver un Endroit Particulier </label> +(Longitude : +<label> +<input name="longi" type="text" id="longi" size="5" maxlength="5" /> +</label> +Lattitude : +<label> +<input name="lati" type="text" id="lati" size="5" maxlength="5" /> +</label> +) <br /> +<!-- <label> +<input type="radio" name="radio1" value="3" /> +Parler à quelqu\'un de spécifique</label> +--> +<br /> +Choisissez la ville de départ : +<label> +<select name="ville" id="ville">'; +$query = mysql_query("SELECT * FROM rpg_towns"); +while( $req = mysql_fetch_array($query) ) +{ +$page .= '<option value="' . $req[1] . '">' . $req[1] . '</option>'; +} + + +$page .= ' +</select> +</label> +<br />Cette Quête est elle la prolongation d une autre quete ? <label>Oui<input type="radio" name="radio2" value="1" /></label><label>Non<input type="radio" name="radio2" value="2" /></label><br /> +Si oui de quelle quête s agit t il ? +<label> +<select name="oldquest" id="oldquest">'; + +$query = mysql_query("SELECT * FROM rpg_quete"); +while( $req = mysql_fetch_array($query) ) +{ +$page .= '<option value="' . $req[0] . '">' . $req[1] . '</option>'; +} + +$page .= '</select><br /><input type="submit" value="Envoyer" /> </p> +</form>'; + +admindisplay($page, "Créer les Quetes"); +} ?> \ No newline at end of file diff --git a/admin/modo.php b/admin/modo.php @@ -0,0 +1,513 @@ +<?php // modo.php :: modoration du script. + +include('../lib.php'); +include('../cookies.php'); +include('../bbcode.php'); +$link = opendb(); +$userrow = checkcookies(); +if ($userrow == false) { die("Merci de vous loger dans le <a href=\"../login.php?do=login\">jeu</a> avant d'utiliser le panneau de commande."); } +if ($userrow["authlevel"] != 3) { die("Vous devez avoir des privilèges d'modoistrateur pour employer le panneau de commande."); } +$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$controlrow = mysql_fetch_array($controlquery); + +if (isset($_GET["do"])) { + $do = explode(":",$_GET["do"]); + + if ($do[0] == "main") { main(); } + elseif ($do[0] == "users") { users(); } + elseif ($do[0] == "edituser") { edituser($do[1]); } + elseif ($do[0] == "news") { addnews(); } + elseif ($do[0] == "message") { message(); } + elseif ($do[0] == "babble") { babble(); } + elseif ($do[0] == "newsaccueil") { newsaccueil(); } + + +} else { donothing() ; } + +function donothing() { + + $page = "Bienvenue sur la page de modération de RPG illusion. Ici vous pouvez modifier ou éditer librement plusieurs paramètres. <br><br> En cas de problème, veuillez contactez l'auteur de script à cette adresse : webmaster@rpgillusion.com<br><br><br><center><img src=\"../images/im_admin.gif\"/><br><br>Pour que RPG illusion perdure et que nous puissions financer de meilleurs services, nous vous invitons à faire un don du montant de votre choix. <font color=cc0000><b>Ceci est très important, car sans ces donations, le RPG pourrait <u>perdre sa licence open source et devenir payant</u> pour financer le développement du jeu.</b></font></span><br><br> + <form action=https://www.paypal.com/cgi-bin/webscr method=post> +<input type=hidden name=cmd value=_xclick> +<input type=hidden name=business value=ffstory1@hotmail.com> +<input type=hidden name=item_name value=RPG illusion donation> +<input type=hidden name=no_note value=1> +<input type=hidden name=currency_code value=EUR> +<input type=hidden name=tax value=0> +<input type=hidden name=bn value=PP-DonationsBF> +<input type=image src=https://www.paypal.com/fr_FR/i/btn/x-click-but21.gif border=0 name=submit alt=Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée !> +</form> + </center>"; + + mododisplay($page, "Administration"); + +} + +function main() { + + if (isset($_POST["submit"])) { + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($gamename == "") { $errors++; $errorlist .= "Le nom de jeu est exigé.<br />"; } + if (($gamesize % 5) != 0) { $errors++; $errorlist .= "La taille de carte doit être divisible par cinq.<br />"; } + if (!is_numeric($gamesize)) { $errors++; $errorlist .= "La taille de la carte doit être un nombre.<br />"; } + if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "Vous devez indiquer l'adresse du forum externe.<br />"; } + if ($class1name == "") { $errors++; $errorlist .= "Le nom de la classe 1 est exigé.<br />"; } + if ($class2name == "") { $errors++; $errorlist .= "Le nom de la classe 2 est exigé.<br />"; } + if ($class3name == "") { $errors++; $errorlist .= "Le nom de la classe 3 est exigé.<br />"; } + if ($diff1name == "") { $errors++; $errorlist .= "Le nom de la difficulté 1 est exigé.<br />"; } + if ($diff2name == "") { $errors++; $errorlist .= "Le nom de la difficulté 2 est exigé.<br />"; } + if ($diff3name == "") { $errors++; $errorlist .= "Le nom de la difficulté 3 est exigé.<br />"; } + if ($diff2mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 2 est exigée.<br />"; } + if ($diff3mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 3 est exigée.<br />"; } + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET gamename='$gamename',gamesize='$gamesize',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',modoemail='$modoemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble' WHERE id='1' LIMIT 1", "control"); + mododisplay("Réglages mis à jour.","Main Settings"); + } else { + mododisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Menu des réglages"); + } + } + + global $controlrow; + +$page = ""; +$controlrow["control"] = ""; + + + if ($controlrow["forumtype"] == 0) { $controlrow["selecttype0"] = "selected=\"selected\" "; } else { $controlrow["selecttype0"] = ""; } + if ($controlrow["forumtype"] == 1) { $controlrow["selecttype1"] = "selected=\"selected\" "; } else { $controlrow["selecttype1"] = ""; } + if ($controlrow["forumtype"] == 2) { $controlrow["selecttype2"] = "selected=\"selected\" "; } else { $controlrow["selecttype2"] = ""; } + if ($controlrow["compression"] == 0) { $controlrow["selectcomp0"] = "selected=\"selected\" "; } else { $controlrow["selectcomp0"] = ""; } + if ($controlrow["compression"] == 1) { $controlrow["selectcomp1"] = "selected=\"selected\" "; } else { $controlrow["selectcomp1"] = ""; } + if ($controlrow["verifyemail"] == 0) { $controlrow["selectverify0"] = "selected=\"selected\" "; } else { $controlrow["selectverify0"] = ""; } + if ($controlrow["verifyemail"] == 1) { $controlrow["selectverify1"] = "selected=\"selected\" "; } else { $controlrow["selectverify1"] = ""; } + if ($controlrow["shownews"] == 0) { $controlrow["selectnews0"] = "selected=\"selected\" "; } else { $controlrow["selectnews0"] = ""; } + if ($controlrow["shownews"] == 1) { $controlrow["selectnews1"] = "selected=\"selected\" "; } else { $controlrow["selectnews1"] = ""; } + if ($controlrow["showonline"] == 0) { $controlrow["selectonline0"] = "selected=\"selected\" "; } else { $controlrow["selectonline0"] = ""; } + if ($controlrow["showonline"] == 1) { $controlrow["selectonline1"] = "selected=\"selected\" "; } else { $controlrow["selectonline1"] = ""; } + if ($controlrow["showbabble"] == 0) { $controlrow["selectbabble0"] = "selected=\"selected\" "; } else { $controlrow["selectbabble0"] = ""; } + if ($controlrow["showbabble"] == 1) { $controlrow["selectbabble1"] = "selected=\"selected\" "; } else { $controlrow["selectbabble1"] = ""; } + if ($controlrow["gameopen"] == 1) { $controlrow["open1select"] = "selected=\"selected\" "; } else { $controlrow["open1select"] = ""; } + if ($controlrow["gameopen"] == 0) { $controlrow["open0select"] = "selected=\"selected\" "; } else { $controlrow["open0select"] = ""; } + + $page = template("control"); + $page = parsetemplate($page, $controlrow); + mododisplay($page, "Réglages principaux"); + +} + + + mododisplay($page, "Reglage des zones"); + + + + +function users() { + + $query = doquery("SELECT id,username FROM {{table}} ORDER BY id", "users"); + $page = "<b><u>Editer les utilisateurs</u></b><br />Cliquez sur le nom d'un utilisateur pour éditer son compte.<br /><br /><table width=\"50%\">\n"; + $count = 1; + while ($row = mysql_fetch_array($query)) { + if ($count == 1) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">".$row["id"]."</td><td style=\"background-color: #eeeeee;\"><a href=\"modo.php?do=edituser:".$row["id"]."\">".$row["username"]."</a></td></tr>\n"; $count = 2; } + else { $page .= "<tr><td width=\"8%\" style=\"background-color: #ffffff;\">".$row["id"]."</td><td style=\"background-color: #ffffff;\"><a href=\"modo.php?do=edituser:".$row["id"]."\">".$row["username"]."</a></td></tr>\n"; $count = 1; } + } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\" style=\"background-color: #eeeeee;\">Pas de sorts trouvés.</td></tr>\n"; } + $page .= "</table>"; + mododisplay($page, "Editer utilisateurs"); + +} + +function edituser($id) { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + + if ($email == "") { $errors++; $errorlist .= "L'Email est exigé.<br />"; } + if ($verify == "") { $errors++; $errorlist .= "La vérification de l'email est exigée.<br />"; } + if ($charname == "") { $errors++; $errorlist .= "Le nom du personnage est exigé.<br />"; } + if ($authlevel == "") { $errors++; $errorlist .= "Le niveau d'accès est exigé.<br />"; } + if ($latitude == "") { $errors++; $errorlist .= "La latitude est exigée.<br />"; } + if ($longitude == "") { $errors++; $errorlist .= "La longitude est exigée.<br />"; } + if ($difficulty == "") { $errors++; $errorlist .= "La difficulté est exigée.<br />"; } + if ($charclass == "") { $errors++; $errorlist .= "La classe du personnagee est exigée.<br />"; } + if ($currentaction == "") { $errors++; $errorlist .= "L'action actuel est exigée.<br />"; } + if ($currentfight == "") { $errors++; $errorlist .= "Le combat en cours est exigé.<br />"; } + + if ($currentmonster == "") { $errors++; $errorlist .= "L'ID du monstre actuel est exigé.<br />"; } + if ($currentmonsterhp == "") { $errors++; $errorlist .= "Le HP du monstre actuel est exigé.<br />"; } + if ($currentmonstersleep == "") { $errors++; $errorlist .= "L'ID des sorts du monstre actuel est exigés.<br />"; } + if ($currentmonsterimmune == "") { $errors++; $errorlist .= "L'immunité du monstre actuel est exigée.<br />"; } + if ($currentuberdamage == "") { $errors++; $errorlist .= "Le dommage actuel d'Uber est exigé.<br />"; } + if ($currentuberdefense == "") { $errors++; $errorlist .= "La défense actuel d'Uber est exigé.<br />"; } + if ($currenthp == "") { $errors++; $errorlist .= "Le HP actuel est exigé.<br />"; } + if ($currentmp == "") { $errors++; $errorlist .= "Le MP actuel est exigé.<br />"; } + if ($currenttp == "") { $errors++; $errorlist .= "Le TP actuel est exigé.<br />"; } + if ($maxhp == "") { $errors++; $errorlist .= "Le HP max est exigé.<br />"; } + + if ($maxmp == "") { $errors++; $errorlist .= "Le MP max est exigé.<br />"; } + if ($maxtp == "") { $errors++; $errorlist .= "Le TP max est exigé.<br />"; } + if ($level == "") { $errors++; $errorlist .= "Le niveau est exigé.<br />"; } + if ($gold == "") { $errors++; $errorlist .= "Les rubis sont exigés.<br />"; } + if ($experience == "") { $errors++; $errorlist .= "L'experience est exigée.<br />"; } + if ($goldbonus == "") { $errors++; $errorlist .= "Les rubis bonnus sont exigés.<br />"; } + if ($expbonus == "") { $errors++; $errorlist .= "L'experience Bonus est exigé.<br />"; } + if ($strength == "") { $errors++; $errorlist .= "La force est exigée.<br />"; } + if ($dexterity == "") { $errors++; $errorlist .= "La dextérité est exigée.<br />"; } + if ($attackpower == "") { $errors++; $errorlist .= "Le pouvoir d'attaque est exigé.<br />"; } + + if ($defensepower == "") { $errors++; $errorlist .= "Le pouvoir de défense est exigé.<br />"; } + if ($weaponid == "") { $errors++; $errorlist .= "L'ID de l'arme est exigé.<br />"; } + if ($armorid == "") { $errors++; $errorlist .= "L'ID de l'armure est exigé.<br />"; } + if ($shieldid == "") { $errors++; $errorlist .= "L'ID de la protection est exigé.<br />"; } + if ($slot1id == "") { $errors++; $errorlist .= "L'ID de la fente 1 est exigé.<br />"; } + if ($slot2id == "") { $errors++; $errorlist .= "L'ID de la fente 2 est exigé.<br />"; } + if ($slot3id == "") { $errors++; $errorlist .= "L'ID de la fente 3 est exigé.<br />"; } + if ($weaponname == "") { $errors++; $errorlist .= "Le nom de l'arme est exigé.<br />"; } + if ($armorname == "") { $errors++; $errorlist .= "Le nom de l'armure est exigé.<br />"; } + if ($shieldname == "") { $errors++; $errorlist .= "Le nom de la protection est exigé.<br />"; } + + if ($slot1name == "") { $errors++; $errorlist .= "Le nom de la fente 1 est exigé.<br />"; } + if ($slot2name == "") { $errors++; $errorlist .= "Le nom de la fente 2 est exigé.<br />"; } + if ($slot3name == "") { $errors++; $errorlist .= "Le nom de la fente 2 est exigé.<br />"; } + if ($dropcode == "") { $errors++; $errorlist .= "Le code drop est exigé.<br />"; } + if ($spells == "") { $errors++; $errorlist .= "L'ID des sorts sont exigés.<br />"; } + if ($towns == "") { $errors++; $errorlist .= "Les villes sont exigées.<br />"; } + + if (!is_numeric($authlevel)) { $errors++; $errorlist .= "Le niveau d'accès doit être un nombre.<br />"; } + if (!is_numeric($latitude)) { $errors++; $errorlist .= "La latitude doit être un nombre.<br />"; } + if (!is_numeric($longitude)) { $errors++; $errorlist .= "La longitude doit être un nombre.<br />"; } + if (!is_numeric($difficulty)) { $errors++; $errorlist .= "La difficultée doit être un nombre.<br />"; } + if (!is_numeric($charclass)) { $errors++; $errorlist .= "La classe du personnage doit être un nombre.<br />"; } + if (!is_numeric($currentfight)) { $errors++; $errorlist .= "Le combat en cours doit être un nombre.<br />"; } + if (!is_numeric($currentmonster)) { $errors++; $errorlist .= "L'ID monstre actuel doit être un nombre.<br />"; } + if (!is_numeric($currentmonsterhp)) { $errors++; $errorlist .= "Le HP du monstre actuel doit être un nombre.<br />"; } + if (!is_numeric($currentmonstersleep)) { $errors++; $errorlist .= "L'ID des sorts du monstre actuel doit être un nombre.<br />"; } + + if (!is_numeric($currentmonsterimmune)) { $errors++; $errorlist .= "L'immunité du monstre actuel doit être nombre.<br />"; } + if (!is_numeric($currentuberdamage)) { $errors++; $errorlist .= "Le dommage actuel d'Uber doit être un nombre.<br />"; } + if (!is_numeric($currentuberdefense)) { $errors++; $errorlist .= "La défense actuel d'Uber doit être un nombre.<br />"; } + if (!is_numeric($currenthp)) { $errors++; $errorlist .= "Le HP actuel doit être un nombre.<br />"; } + if (!is_numeric($currentmp)) { $errors++; $errorlist .= "Le MP actuel doit être un nombre.<br />"; } + if (!is_numeric($currenttp)) { $errors++; $errorlist .= "Le TP actuel doit être un nombre.<br />"; } + if (!is_numeric($maxhp)) { $errors++; $errorlist .= "Le HP Max doit àtre un nombre.<br />"; } + if (!is_numeric($maxmp)) { $errors++; $errorlist .= "Le MP Max doit àtre un nombre.<br />"; } + if (!is_numeric($maxtp)) { $errors++; $errorlist .= "Le TP Max doit àtre un nombre.<br />"; } + if (!is_numeric($level)) { $errors++; $errorlist .= "Le niveau doit être un nombre.<br />"; } + + if (!is_numeric($gold)) { $errors++; $errorlist .= "Les rubis doivent êtres des nombres.<br />"; } + if (!is_numeric($experience)) { $errors++; $errorlist .= "L'expérience doit être un nombre.<br />"; } + if (!is_numeric($goldbonus)) { $errors++; $errorlist .= "Les rubis bonnus doivent êtres des nombres.<br />"; } + if (!is_numeric($expbonus)) { $errors++; $errorlist .= "L'expérience bonnus doit être un nombre.<br />"; } + if (!is_numeric($strength)) { $errors++; $errorlist .= "La force doit être un nombre.<br />"; } + if (!is_numeric($dexterity)) { $errors++; $errorlist .= "La dextérité doit être un nombre.<br />"; } + if (!is_numeric($attackpower)) { $errors++; $errorlist .= "Le pouvoir d'attaque doit être un nombre.<br />"; } + if (!is_numeric($defensepower)) { $errors++; $errorlist .= "Le pouvoir de défense doit être un nombre.<br />"; } + if (!is_numeric($weaponid)) { $errors++; $errorlist .= "L'ID de la l'arme doit être un nombre.<br />"; } + if (!is_numeric($armorid)) { $errors++; $errorlist .= "L'ID de l'armure doit être un nombre.<br />"; } + + if (!is_numeric($shieldid)) { $errors++; $errorlist .= "L'ID de la protection doit tre un nombre.<br />"; } + if (!is_numeric($slot1id)) { $errors++; $errorlist .= "L'ID de la fente 1 doit être un nombre.<br />"; } + if (!is_numeric($slot2id)) { $errors++; $errorlist .= "L'ID de la fente 2 doit être un nombre.<br />"; } + if (!is_numeric($slot3id)) { $errors++; $errorlist .= "L'ID de la fente 3 doit être un nombre.<br />"; } + if (!is_numeric($dropcode)) { $errors++; $errorlist .= "Le code drop doit être un nombre.<br />"; } + + if ($errors == 0) { +$updatequery = <<<END +UPDATE {{table}} SET +email="$email", verify="$verify", charname="$charname", authlevel="$authlevel", latitude="$latitude", +longitude="$longitude", difficulty="$difficulty", charclass="$charclass", currentaction="$currentaction", currentfight="$currentfight", +currentmonster="$currentmonster", currentmonsterhp="$currentmonsterhp", currentmonstersleep="$currentmonstersleep", currentmonsterimmune="$currentmonsterimmune", currentuberdamage="$currentuberdamage", +currentuberdefense="$currentuberdefense", currenthp="$currenthp", currentmp="$currentmp", currenttp="$currenttp", maxhp="$maxhp", +maxmp="$maxmp", maxtp="$maxtp", level="$level", gold="$gold", experience="$experience", +goldbonus="$goldbonus", expbonus="$expbonus", strength="$strength", dexterity="$dexterity", attackpower="$attackpower", +defensepower="$defensepower", weaponid="$weaponid", armorid="$armorid", shieldid="$shieldid", slot1id="$slot1id", +slot2id="$slot2id", slot3id="$slot3id", weaponname="$weaponname", armorname="$armorname", shieldname="$shieldname", +slot1name="$slot1name", slot2name="$slot2name", slot3name="$slot3name", dropcode="$dropcode", spells="$spells", +towns="$towns" WHERE id="$id" LIMIT 1 +END; + $query = doquery($updatequery, "users"); + mododisplay("Utilisateur mis à jour.","Editer utilisateurs"); + } else { + mododisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les utilsateurs"); + } + + } + + $query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + $row = mysql_fetch_array($query); + global $controlrow; + $diff1name = $controlrow["diff1name"]; + $diff2name = $controlrow["diff2name"]; + $diff3name = $controlrow["diff3name"]; + $class1name = $controlrow["class1name"]; + $class2name = $controlrow["class2name"]; + $class3name = $controlrow["class3name"]; + +$page = <<<END +<b><u>Editer les utilsateurs</u></b><br /><br /> +<form action="modo.php?do=edituser:$id" method="post"> +<table width="90%"> +<tr><td width="20%">Joueur numéro:</td><td>{{id}}</td></tr> +<tr><td width="20%">ID:</td><td>{{username}}</td></tr> +<tr><td width="20%">Avatar classe:</td><td><img src="../images/avatar/num-{{avatar}}.gif" width="71" height="66"></td></tr> +<tr><td width="20%">Email:</td><td><input type="text" name="email" size="30" maxlength="100" value="{{email}}" /></td></tr> +<tr><td width="20%">Verifié:</td><td><input type="text" name="verify" size="30" maxlength="8" value="{{verify}}" /></td></tr> +<tr><td width="20%">Nom du personnage:</td><td><input type="text" name="charname" size="30" maxlength="30" value="{{charname}}" /></td></tr> +<tr><td width="20%">Date d'inscription:</td><td>{{regdate}}</td></tr> +<tr><td width="20%">Dernière fois en ligne:</td><td>{{onlinetime}}</td></tr> +<tr><td width="20%">Niv. d'accès:</td><td><select name="authlevel"><option value="0" {{auth0select}}>Simple joueur</option><option value="3" {{auth3select}}>Moderateur</option><option value="2" {{auth2select}}>Bloqué</option></select><br /><span class="small">Sélectionnez "bloqué" pour empêcher un utilisateur d'accèder au jeu.</span></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">Latitude:</td><td><input type="text" name="latitude" size="5" maxlength="6" value="{{latitude}}" /></td></tr> +<tr><td width="20%">Longitude:</td><td><input type="text" name="longitude" size="5" maxlength="6" value="{{longitude}}" /></td></tr> +<tr><td width="20%">Difficulté:</td><td><select name="difficulty"><option value="1" {{diff1select}}>$diff1name</option><option value="2" {{diff2select}}>$diff2name</option><option value="3" {{diff3select}}>$diff3name</option></select></td></tr> +<tr><td width="20%">Classe du personnage:</td><td><select name="charclass"><option value="1" {{class1select}}>$class1name</option><option value="2" {{class2select}}>$class2name</option><option value="3" {{class3select}}>$class3name</option></select></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">Action en cours:</td><td><input type="text" name="currentaction" size="30" maxlength="30" value="{{currentaction}}" /></td></tr> +<tr><td width="20%">Combat en cours:</td><td><input type="text" name="currentfight" size="5" maxlength="4" value="{{currentfight}}" /></td></tr> +<tr><td width="20%">ID du monstre:</td><td><input type="text" name="currentmonster" size="5" maxlength="6" value="{{currentmonster}}" /></td></tr> +<tr><td width="20%">HP du monstre:</td><td><input type="text" name="currentmonsterhp" size="5" maxlength="6" value="{{currentmonsterhp}}" /></td></tr> +<tr><td width="20%">ID des sorts du monstre:</td><td><input type="text" name="currentmonsterimmune" size="5" maxlength="3" value="{{currentmonsterimmune}}" /></td></tr> +<tr><td width="20%">Immunité du monstre:</td><td><input type="text" name="currentmonstersleep" size="5" maxlength="3" value="{{currentmonstersleep}}" /></td></tr> +<tr><td width="20%">Dommage actuel d'Uber:</td><td><input type="text" name="currentuberdamage" size="5" maxlength="3" value="{{currentuberdamage}}" /></td></tr> +<tr><td width="20%">Défense actuel d'Uber:</td><td><input type="text" name="currentuberdefense" size="5" maxlength="3" value="{{currentuberdefense}}" /></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">HP actuel:</td><td><input type="text" name="currenthp" size="5" maxlength="6" value="{{currenthp}}" /></td></tr> +<tr><td width="20%">MP actuel:</td><td><input type="text" name="currentmp" size="5" maxlength="6" value="{{currentmp}}" /></td></tr> +<tr><td width="20%">TP actuel:</td><td><input type="text" name="currenttp" size="5" maxlength="6" value="{{currenttp}}" /></td></tr> +<tr><td width="20%">Max HP:</td><td><input type="text" name="maxhp" size="5" maxlength="6" value="{{maxhp}}" /></td></tr> +<tr><td width="20%">Max MP:</td><td><input type="text" name="maxmp" size="5" maxlength="6" value="{{maxmp}}" /></td></tr> +<tr><td width="20%">Max TP:</td><td><input type="text" name="maxtp" size="5" maxlength="6" value="{{maxtp}}" /></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">Niveau:</td><td><input type="text" name="level" size="5" maxlength="5" value="{{level}}" /></td></tr> +<tr><td width="20%">Gils:</td><td><input type="text" name="gold" size="10" maxlength="8" value="{{gold}}" /></td></tr> +<tr><td width="20%">Experience:</td><td><input type="text" name="experience" size="10" maxlength="8" value="{{experience}}" /></td></tr> +<tr><td width="20%">Bonnus rubis:</td><td><input type="text" name="goldbonus" size="5" maxlength="5" value="{{goldbonus}}" /></td></tr> +<tr><td width="20%">Bonnus experience :</td><td><input type="text" name="expbonus" size="5" maxlength="5" value="{{expbonus}}" /></td></tr> +<tr><td width="20%">Force:</td><td><input type="text" name="strength" size="5" maxlength="5" value="{{strength}}" /></td></tr> +<tr><td width="20%">Dextérité:</td><td><input type="text" name="dexterity" size="5" maxlength="5" value="{{dexterity}}" /></td></tr> +<tr><td width="20%">Pouvoir d'attaque:</td><td><input type="text" name="attackpower" size="5" maxlength="5" value="{{attackpower}}" /></td></tr> +<tr><td width="20%">Pouvoir de défense:</td><td><input type="text" name="defensepower" size="5" maxlength="5" value="{{defensepower}}" /></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">ID de l'arme:</td><td><input type="text" name="weaponid" size="5" maxlength="5" value="{{weaponid}}" /></td></tr> +<tr><td width="20%">ID del'armure:</td><td><input type="text" name="armorid" size="5" maxlength="5" value="{{armorid}}" /></td></tr> +<tr><td width="20%">ID de la protection:</td><td><input type="text" name="shieldid" size="5" maxlength="5" value="{{shieldid}}" /></td></tr> +<tr><td width="20%">ID de la fente 1:</td><td><input type="text" name="slot1id" size="5" maxlength="5" value="{{slot1id}}" /></td></tr> +<tr><td width="20%">ID de la fente 2:</td><td><input type="text" name="slot2id" size="5" maxlength="5" value="{{slot2id}}" /></td></tr> +<tr><td width="20%">ID de la fente 3:</td><td><input type="text" name="slot3id" size="5" maxlength="5" value="{{slot3id}}" /></td></tr> +<tr><td width="20%">Nom de l'arme:</td><td><input type="text" name="weaponname" size="30" maxlength="30" value="{{weaponname}}" /></td></tr> +<tr><td width="20%">Nom de l'armure:</td><td><input type="text" name="armorname" size="30" maxlength="30" value="{{armorname}}" /></td></tr> +<tr><td width="20%">Nom de la protec.:</td><td><input type="text" name="shieldname" size="30" maxlength="30" value="{{shieldname}}" /></td></tr> +<tr><td width="20%">Nom de la fente 1:</td><td><input type="text" name="slot1name" size="30" maxlength="30" value="{{slot1name}}" /></td></tr> +<tr><td width="20%">Nom de la fente 2:</td><td><input type="text" name="slot2name" size="30" maxlength="30" value="{{slot2name}}" /></td></tr> +<tr><td width="20%">Nom de la fente 3:</td><td><input type="text" name="slot3name" size="30" maxlength="30" value="{{slot3name}}" /></td></tr> + +<tr><td colspan="2" style="background-color:#cccccc;"> </td></tr> + +<tr><td width="20%">Code drop:</td><td><input type="text" name="dropcode" size="5" maxlength="8" value="{{dropcode}}" /></td></tr> +<tr><td width="20%">Sorts:</td><td><input type="text" name="spells" size="50" maxlength="50" value="{{spells}}" /></td></tr> +<tr><td width="20%">Ville:</td><td><input type="text" name="towns" size="50" maxlength="50" value="{{towns}}" /></td></tr> + +</table> +<input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /> +</form> +END; + + if ($row["authlevel"] == 0) { $row["auth0select"] = "selected=\"selected\" "; } else { $row["auth0select"] = ""; } + if ($row["authlevel"] == 1) { $row["auth1select"] = "selected=\"selected\" "; } else { $row["auth1select"] = ""; } + if ($row["authlevel"] == 2) { $row["auth2select"] = "selected=\"selected\" "; } else { $row["auth2select"] = ""; } + if ($row["charclass"] == 1) { $row["class1select"] = "selected=\"selected\" "; } else { $row["class1select"] = ""; } + if ($row["charclass"] == 2) { $row["class2select"] = "selected=\"selected\" "; } else { $row["class2select"] = ""; } + if ($row["charclass"] == 3) { $row["class3select"] = "selected=\"selected\" "; } else { $row["class3select"] = ""; } + if ($row["difficulty"] == 1) { $row["diff1select"] = "selected=\"selected\" "; } else { $row["diff1select"] = ""; } + if ($row["difficulty"] == 2) { $row["diff2select"] = "selected=\"selected\" "; } else { $row["diff2select"] = ""; } + if ($row["difficulty"] == 3) { $row["diff3select"] = "selected=\"selected\" "; } else { $row["diff3select"] = ""; } + + $page = parsetemplate($page, $row); + mododisplay($page, "Editer utilisateurs"); + +} + +function addnews() { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($content == "") { $errors++; $errorlist .= "Vous devez écrire une nouvelle.<br />"; } + + $content = addslashes($content); + if ($errors == 0) { + $query = doquery("INSERT INTO {{table}} SET id='',author='$author',postdate=NOW(),content='$content'", "news"); + $texte = new texte(); + mododisplay("La nouvelle vient d'êtres ajouté.","Ajouter une nouvelle"); + } else { + mododisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Ajouter une nouvelle"); + } + + } + +$page = <<<END +<b><u>Ajouter une nouvelle</u></b><br /><br /> +<form action="modo.php?do=news" method="post"> +Après avoir rédigé votre nouvelle, cliquez sur Envoyer pour l'afficher tout de suite dans toutes les villes.<br /> +<input type="text" name="author" size="20" value="Pseudo de l'auteur"><br><br> +<textarea name="content" rows="5" cols="50"></textarea><br /> +Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url]<br> +<img src='../images/smileys/1.jpg'> :1: / +<img src='../images/smileys/2.jpg'> :2: / +<img src='../images/smileys/3.jpg'> :3: / +<img src='../images/smileys/4.jpg'> :4: / +<img src='../images/smileys/5.jpg'> :5: / +<img src='../images/smileys/6.jpg'> :6: / +<img src='../images/smileys/7.jpg'> :7: / +<img src='../images/smileys/8.jpg'> :8: /<br> +<input type="submit" name="submit" value="Envoyer" /> <input type="reset" name="reset" value="Annuler" /> +</form> +END; + + mododisplay($page, "Ajouter une nouvelle"); + +} + + + + +function message() +{ +$page .= "<table align=\"center\" width=\"380\" cellspacing=\"0\" cellpadding=\"0\"><tr><td background=\"../images/bloc_graphic1/bloc_01.gif\"></td>"; +$page .= "<td background=\"../images/bloc_graphic1/bloc_02.gif\" height=\"17px\"></td>"; +$page .= "<td background=\"../images/bloc_graphic1/bloc_03.gif\"></td></tr>"; +$page .= "<tr><td background=\"../images/bloc_graphic1/bloc_04.gif\" width=\"17px\"></td>"; +$page .= "<td align=\"center\" background=\"../images/bloc_graphic1/bloc_05.gif\" height=\"60px\">"; + +//On regarde si le formulaire a été validé + if (!isset ($_POST['envoi'])){ + $page .= '<center>Vous pouvez envoyer ici un email aux membres.<br>Il vous suffit de remplir le formulaire ci dessous et d´envoyer!!<br><br> + <form action="'.$_SERVER['PHP_SELF'].'?do=message" method=POST> + L´email qui apparaitra en expediteur:<br><input type=text name=email_expediteur size=20><br>Sujet du mail:<br><input type=text name=sujet_mail size=20><br><br> + Votre message <br><textarea rows=20 name=message_envoi cols=55></textarea><br><br><input type=submit name=envoi value="Envoyer le message"><br><br></form><a href=\'modo.php\'>Retour</a>'; + } + else{ + //On regarde si tous les champs ont été remplis + if (empty ($_POST['email_expediteur']) || empty ($_POST['sujet_mail']) || empty ($_POST['message_envoi'])){ + $page .= '<strong>Erreur</strong>'; + } + else{ + //On sélectionne tous les emails et on envoie le message + $selection="select * from maf_users where id"; + $sql=mysql_query($selection); + while ($a_row=mysql_fetch_assoc($sql)){ + //La récupération étant terminée, on envoie le message à chaque membre! + $to .= $a_row[email]; + $sujet .= $_POST[sujet_mail]; + //--- la structure du mail ----// + $from .= "From:$_POST[email_expediteur]\n"; + $from .= "MIME-version: 1.0\n"; + $from .= "Content-type: text/html; charset= iso-8859-1\n"; + //--- Corps du message ---// + $message_def=$_POST[message_envoi]; + //--- on envoie l'email ---// + mail($to,$sujet,$message_def,$from); + } + $page .= '<strong>Erreur</strong>'; + } + } + $page .= "</td><td background=\"../images/bloc_graphic1/bloc_06.gif\" width=\"17px\"></td></tr>"; + $page .= "<tr><td background=\"../images/bloc_graphic1/bloc_07.gif\"></td>"; + $page .= "<td background=\"../images/bloc_graphic1/bloc_08.gif\" height=\"17px\"></td>"; + $page .= "<td background=\"../images/bloc_graphic1/bloc_09.gif\"></td></tr></table>"; + + mododisplay($page, "Message"); +} + +function newsaccueil() { + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + $content = addslashes($content); + $titre = addslashes($titre); + if ($errors == 0) { + $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),titre='$titre', content='$content', auteur='$auteur'", "newsaccueil"); + $texte = new texte(); + mododisplay("La new a été Ajoutée.","Editer la new 1"); + } else { + mododisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer la new"); + } + + } + + +$page = ' +<b><u>Editer les news</u></b><br /><br /> +<form method="post" action="modo.php?do=newsaccueil"> +<input type="text" name="titre" size="20" value="Titre de la News"><br><br> +<input type="text" name="auteur" size="20" value="Pseudo de lauteur"><br><br> +Ecrivez l\'intégralité de la new ci dessous<br> +<textarea name="content" rows="5" cols="50"></textarea><br> +Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url]<br> +<img src="../images/smileys/1.jpg"> :1: / +<img src="../images/smileys/2.jpg"> :2: / +<img src="../images/smileys/3.jpg"> :3: / +<img src="../images/smileys/4.jpg"> :4: / +<img src="../images/smileys/5.jpg"> :5: / +<img src="../images/smileys/6.jpg"> :6: / +<img src="../images/smileys/7.jpg"> :7: / +<img src="../images/smileys/8.jpg"> :8: /<br> +<input type="submit" name="submit" value="Valider"> +<input type="submit" name="reset" value="Annuler"><br><br>Vous pouvez ajouter une image dans la news en ajoutant ce code: <b>img src="url de l\'image"></b> . N\'oubliez pas le <b><</b> devant le img! <br><b>Attention :</b> Si vous avez actuellement 5 news sur la page d\'accueil, celle-ci effacera la plus ancienne. +</form> +'; + + mododisplay($page, "Editer les news"); + +} + +function babble() +{ +if (isset($_POST["submit"])) +{ +mysql_query("TRUNCATE TABLE `rpg_babble`"); +} +$page = ' +<b><u> Vider Le Chat box </u></b><br /><br /> +<form method="post" action="modo.php?do=babble"> +<input type="submit" name="submit" value="Valider" /> +<br><br><b><font color="red">! Attention !</font></b> Vider le babble entrenera la perte de tout les messages figurant dedans, il sera impossible de les récupérer ! +</form> +'; + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + + if ($errors == 0) { + + mododisplay("La chatbox à été vidée","vider le chatbox"); + } else { + mododisplay("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Veuillez retourner et essayer encore.", "Editer les blocs"); + } + + } + mododisplay($page, "vider le chatbox"); +} +?> +\ No newline at end of file diff --git a/anpe.php b/anpe.php @@ -0,0 +1,352 @@ +<?php + +function metier() { // Staying at the inn resets all expendable stats to their max values. + +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); + +global $userrow, $numqueries; + + + +/////- Metier n°1 -///// + +if (isset($_POST["1"])) { +if ($userrow["gold"] > 500 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 500 ; +$query = doquery("UPDATE {{table}} SET metier='forgeron',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "ANPE"; +$page = "vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°1 -///// + +/////- Metier n°2 -///// + +if (isset($_POST["2"])) { +if ($userrow["gold"] > 1000 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 1000 ; +$query = doquery("UPDATE {{table}} SET metier='bucheron',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 2", "users"); +$title = "ANPE"; +$page = "Vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°2 -///// + +/////- Metier n°3 -///// + +if (isset($_POST["3"])) { +if ($userrow["gold"] > 1500 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 1500 ; +$query = doquery("UPDATE {{table}} SET metier='taneur',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 2", "users"); +$title = "ANPE"; +$page = "Vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°3 -///// + +/////- Metier n°4 -///// + +if (isset($_POST["4"])) { +if ($userrow["gold"] > 2000 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 2000 ; +$query = doquery("UPDATE {{table}} SET metier='aubergiste',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 2", "users"); +$title = "ANPE"; +$page = "Vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°4 -///// + +/////- Metier n°5 -///// + +if (isset($_POST["5"])) { +if ($userrow["gold"] > 2500 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 2500 ; +$query = doquery("UPDATE {{table}} SET metier='apothicaires',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 2", "users"); +$title = "ANPE"; +$page = "Vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°5 -///// + +/////- Metier n°6 -///// + +if (isset($_POST["5"])) { +if ($userrow["gold"] > 3000 ) { + + +$newtpmetier = $userrow["ptmetier"] - 1 ; +$newgold = $userrow["gold"] - 3000 ; +$query = doquery("UPDATE {{table}} SET metier='ichikaku',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 2", "users"); +$title = "ANPE"; +$page = "Vous etes bien embaucher <a href=\"index.php?do=metier\">Retour</a></br>"; +display($page, $title); +} else {display("Vous n'avez pas assez d'argent pour vous former", "Metier"); die(); } +} +/////- FIN Metier n°6 -///// + + + +else { + +$title = "ANPE"; +$metier = $userrow["metier"] ; +$monnaie = $townrow3["monnaie"]; +$page = " + +<p align=\"center\">Vous etes un(e) $metier </p> +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"450\" height=\"68\" valign=\"top\"><div align=\"center\"><a href=\"index.php?do=travail\">Aller au boulot </a></div></td> +<td width=\"450\" height=\"68\" valign=\"top\"><div align=\"center\"><a href=\"index.php\">Retour en ville</a> +</tr> +</table> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/forge.jpg\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Forgeron</u></p> +<p align=\"center\">500 $monnaie de Formation</p> +<p align=\"center\">50 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"1\" type=\"submit\" id=\"1\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/buche.jpg\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Bucheron</u></p> +<p align=\"center\">1000 $monnaie de Formation</p> +<p align=\"center\">100 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"2\" type=\"submit\" id=\"2\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/tane.jpg\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Taneur</u></p> +<p align=\"center\">1500 $monnaie de Formation</p> +<p align=\"center\">150 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"3\" type=\"submit\" id=\"3\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/auberge.jpg\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Aubergiste</u></p> +<p align=\"center\">2000 $monnaie de Formation</p> +<p align=\"center\">200 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"4\" type=\"submit\" id=\"4\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/apothicaires.jpg\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Apothicaires</u></p> +<p align=\"center\">2500 $monnaie de Formation</p> +<p align=\"center\">250 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"5\" type=\"submit\" id=\"5\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> + +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> +<!--DWLayoutTable--> +<tr> +<td width=\"300\" height=\"250\" valign=\"top\"><div align=\"center\"> +<p><img src=\"././images/travail/ichikaku.gif\"></p> +</div></td> +<td width=\"150\" valign=\"top\"><p align=\"center\"><u>Ichikaku</u></p> +<p align=\"center\">3000 $monnaie de Formation</p> +<p align=\"center\">300 $monnaie / Jour</p> +<form name=\"form1\" method=\"post\" action=\"index.php?do=metier\"> +<div align=\"center\"> +<input name=\"6\" type=\"submit\" id=\"6\" value=\"Se Former\"> +</div> +</form> <p align=\"center\"> </p></td> +</tr> +</table> +</br> +<table width=\"450\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> + +<tr> + +</table> + +"; + +} +display($page, $title); +} + + + + + +function travail() { // Staying at the inn resets all expendable stats to their max values. + +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); +$monnaie = $townrow3["monnaie"]; + +global $userrow, $numqueries; + +if ($userrow["ptmetier"] < 1) { display("Vous avez deja travaillés ! <a href=\"index.php\">retourner à la ville</a>", "Forge"); die(); } + + + +/////- Metier n°1 -///// + + +if ($userrow["metier"] == "forgeron") { + + +$newgold = $userrow["gold"] + 50 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 50 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°1 -///// + +/////- Metier n°2-///// + + +if ($userrow["metier"] == "bucheron") { + + +$newgold = $userrow["gold"] + 100 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 100 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°2 -///// + +/////- Metier n°3-///// + + +if ($userrow["metier"] == "taneur") { + + +$newgold = $userrow["gold"] + 150 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 150 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°3 -///// + +/////- Metier n°4-///// + + +if ($userrow["metier"] == "aubergiste") { + + +$newgold = $userrow["gold"] + 200 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 200 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°4 -///// + +/////- Metier n°5-///// + + +if ($userrow["metier"] == "apothicaires") { + + +$newgold = $userrow["gold"] + 250 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 250 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°5-///// + +/////- Metier n°6-///// + + +if ($userrow["metier"] == "ichikaku") { + + +$newgold = $userrow["gold"] + 300 ; +$newptmetier = $userrow["ptmetier"] - 1 ; +$query = doquery("UPDATE {{table}} SET gold='$newgold',ptmetier='$newptmetier' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Au boulot"; +$page = "Vous avez bien travaillés aujourd'hui ! vous remportez 300 $monnaie ! <a href=\"index.php\">retourner à la ville</a>"; +display($page, $title); +} +/////- Metier n°6-///// + +} +?> +\ No newline at end of file diff --git a/avatar.html b/avatar.html @@ -0,0 +1,177 @@ +<style type="text/css"> +body { + background-image: url(images/background.jpg); + color: black; + font: 11px verdana; +} +table { + border-style: none; + padding: 0px; + font: 11px verdana; +} + +td { + border-style: none; + padding: 3px; + vertical-align: top; +} +td.top { + width: 889px; + border-bottom: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-right: solid 0px black; +} +td.left { + width: 180px; + border-right: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +td.right { + width: 205px; + border-left: solid 1px black; + border-style:dotted; + border-right: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +a { + color: #663300; + text-decoration: none; + font-weight: bold; +} +a:hover { + color: #330000; +} +.small { + font: 10px verdana; +} +.highlight { + color: red; +} +.light { + color: #999999; +} +.title { + padding: 1px; + margin: 0px; +} +.location { + border: solid 1px white; + padding: 5px; + margin: 0px; +} +.copyright { + border: solid 1px black; + background-color: #eeeeee; + font: 10px verdana; +} +</style> +<body oncontextmenu="return false"><script language="JavaScript"> +function disableselect(e){ +return false +} + +function reEnable(){ +return true +} + +//internet explorer version 4 et plus +document.onselectstart=new Function ("return false") + +//internet explorer version 6 +if (window.sidebar){ +document.onmousedown=disableselect +document.onclick=reEnable +} +</script> <table width="200" align="center"> +<tr> +<td width="67"><div align="center"><img src="images/avatar/num-1.gif" width="67" height="71"></div></td> +<td width="38"><div align="center"><img src="images/avatar/num-2.gif" width="67" height="71"></div></td> +<td width="37"><div align="center"><img src="images/avatar/num-3.gif" width="67" height="71"></div></td> +<td width="11"><div align="center"><img src="images/avatar/num-4.gif" width="67" height="71"></div></td> +<td width="13"><div align="center"><img src="images/avatar/num-5.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°1</div></td> +<td><div align="center" class="Style2">N°2</div></td> +<td><div align="center" class="Style2">N°3</div></td> +<td><div align="center" class="Style2">N°4</div></td> +<td><div align="center" class="Style2">N°5</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-6.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-7.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-8.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-9.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-10.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°6</div></td> +<td><div align="center" class="Style2">N°7</div></td> +<td><div align="center" class="Style2">N°8</div></td> +<td><div align="center" class="Style2">N°9</div></td> +<td><div align="center" class="Style2">N°10</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-11.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-12.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-13.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-14.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-15.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°11</div></td> +<td><div align="center" class="Style2">N°12</div></td> +<td><div align="center" class="Style2">N°13</div></td> +<td><div align="center" class="Style2">N°14</div></td> +<td><div align="center" class="Style2">N°15</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-16.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-17.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-18.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-19.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-20.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°16</div></td> +<td><div align="center" class="Style2">N°17</div></td> +<td><div align="center" class="Style2">N°18</div></td> +<td><div align="center" class="Style2">N°19</div></td> +<td><div align="center" class="Style2">N°20</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-21.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-22.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-23.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-24.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-25.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°21</div></td> +<td><div align="center" class="Style2">N°22</div></td> +<td><div align="center" class="Style2">N°23</div></td> +<td><div align="center" class="Style2">N°24</div></td> +<td><div align="center" class="Style2">N°25</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-26.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-27.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-28.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-29.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-30.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°26</div></td> +<td><div align="center" class="Style2">N°27</div></td> +<td><div align="center" class="Style2">N°28</div></td> +<td><div align="center" class="Style2">N°29</div></td> +<td><div align="center" class="Style2">N°30</div></td> +</tr> +</table> +<p align="center"><a href="javascript:window.close();">Fermer</a></body> +\ No newline at end of file diff --git a/avatar.php b/avatar.php @@ -0,0 +1,177 @@ +<style type="text/css"> +body { + background-image: url(images/background.jpg); + color: black; + font: 11px verdana; +} +table { + border-style: none; + padding: 0px; + font: 11px verdana; +} + +td { + border-style: none; + padding: 3px; + vertical-align: top; +} +td.top { + width: 889px; + border-bottom: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-right: solid 0px black; +} +td.left { + width: 180px; + border-right: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +td.right { + width: 205px; + border-left: solid 1px black; + border-style:dotted; + border-right: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +a { + color: #663300; + text-decoration: none; + font-weight: bold; +} +a:hover { + color: #330000; +} +.small { + font: 10px verdana; +} +.highlight { + color: red; +} +.light { + color: #999999; +} +.title { + padding: 1px; + margin: 0px; +} +.location { + border: solid 1px white; + padding: 5px; + margin: 0px; +} +.copyright { + border: solid 1px black; + background-color: #eeeeee; + font: 10px verdana; +} +</style> +<body oncontextmenu="return false"><script language="JavaScript"> +function disableselect(e){ +return false +} + +function reEnable(){ +return true +} + +//internet explorer version 4 et plus +document.onselectstart=new Function ("return false") + +//internet explorer version 6 +if (window.sidebar){ +document.onmousedown=disableselect +document.onclick=reEnable +} +</script> <table width="200" align="center"> +<tr> +<td width="67"><div align="center"><img src="images/avatar/num-1.gif" width="67" height="71"></div></td> +<td width="38"><div align="center"><img src="images/avatar/num-2.gif" width="67" height="71"></div></td> +<td width="37"><div align="center"><img src="images/avatar/num-3.gif" width="67" height="71"></div></td> +<td width="11"><div align="center"><img src="images/avatar/num-4.gif" width="67" height="71"></div></td> +<td width="13"><div align="center"><img src="images/avatar/num-5.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°1</div></td> +<td><div align="center" class="Style2">N°2</div></td> +<td><div align="center" class="Style2">N°3</div></td> +<td><div align="center" class="Style2">N°4</div></td> +<td><div align="center" class="Style2">N°5</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-6.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-7.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-8.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-9.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-10.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°6</div></td> +<td><div align="center" class="Style2">N°7</div></td> +<td><div align="center" class="Style2">N°8</div></td> +<td><div align="center" class="Style2">N°9</div></td> +<td><div align="center" class="Style2">N°10</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-11.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-12.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-13.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-14.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-15.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°11</div></td> +<td><div align="center" class="Style2">N°12</div></td> +<td><div align="center" class="Style2">N°13</div></td> +<td><div align="center" class="Style2">N°14</div></td> +<td><div align="center" class="Style2">N°15</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-16.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-17.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-18.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-19.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-20.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°16</div></td> +<td><div align="center" class="Style2">N°17</div></td> +<td><div align="center" class="Style2">N°18</div></td> +<td><div align="center" class="Style2">N°19</div></td> +<td><div align="center" class="Style2">N°20</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-21.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-22.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-23.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-24.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-25.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°21</div></td> +<td><div align="center" class="Style2">N°22</div></td> +<td><div align="center" class="Style2">N°23</div></td> +<td><div align="center" class="Style2">N°24</div></td> +<td><div align="center" class="Style2">N°25</div></td> +</tr> +<tr> +<td><div align="center"><img src="images/avatar/num-26.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-27.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-28.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-29.gif" width="67" height="71"></div></td> +<td><div align="center"><img src="images/avatar/num-30.gif" width="67" height="71"></div></td> +</tr> +<tr> +<td><div align="center" class="Style2">N°26</div></td> +<td><div align="center" class="Style2">N°27</div></td> +<td><div align="center" class="Style2">N°28</div></td> +<td><div align="center" class="Style2">N°29</div></td> +<td><div align="center" class="Style2">N°30</div></td> +</tr> +</table> +<p align="center"><a href="javascript:window.close();">Fermer</a></body> +\ No newline at end of file diff --git a/bank.php b/bank.php @@ -0,0 +1,240 @@ +<?php // bank.php :: Les dernieres fonctions de la banque + + +function stockobjets() { // List maps the user can buy + global $userrow, $numqueries; + $page .= "Bienvenue dans la salle des coffres, vous avez un coffre pour chaque equipement. + <br><br><br><b><u> Retirer un equipement :</u></b><br><br> + Coffre 1 :<img src=\"images/icon_weapon.gif\" alt=\"Arme\" /><a href='index.php?do=stockobjets21'> $userrow[stock1name]</a><br> + Coffre 2 :<img src=\"images/icon_armor.gif\" alt=\"Armure\" /><a href='index.php?do=stockobjets22'> $userrow[stock2name]</a><br> + Coffre 3 :<img src=\"images/icon_shield.gif\" alt=\"Bouclier\" /><a href='index.php?do=stockobjets23'> $userrow[stock3name]</a><br> + <br><br><br><b><u> Deposser un equipement :</u></b><br><br> + <img src=\"images/icon_weapon.gif\" alt=\"Arme\" /><a href='index.php?do=stockobjets31'> $userrow[weaponname]</a><br> + <img src=\"images/icon_armor.gif\" alt=\"Armure\" /><a href='index.php?do=stockobjets32'> $userrow[armorname]</a><br> + <img src=\"images/icon_shield.gif\" alt=\"Bouclier\" /><a href='index.php?do=stockobjets33'> $userrow[shieldname]</a><br> + </table>\n"; + display($page, "Deposser votre arme ou armures"); + } + +function stockobjets31() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET stock1name='".$userrow["weaponname"]."', stock1id='".$userrow["weaponid"]."', weaponname='Aucun', weaponid='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de placer votre arme dans le coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function stockobjets32() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET stock2name='".$userrow["armorname"]."', stock2id='".$userrow["armorid"]."', armorname='Aucun', armorid='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de placer votre armure dans le coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function stockobjets33() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET stock3name='".$userrow["shieldname"]."', stock3id='".$userrow["shieldid"]."', shieldname='Aucun', shieldid='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de placer votre bouclier dans le coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function stockobjets21() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET weaponname='".$userrow["stock1name"]."', weaponid='".$userrow["stock1id"]."', stock1name='aucun', stock1id='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de retirer votre arme du coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function stockobjets22() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET armorname='".$userrow["stock2name"]."', armorid='".$userrow["stock2id"]."', stock2name='aucun', stock2id='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de retirer votre armure du coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function stockobjets23() { +global $userrow; +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +doquery("UPDATE {{table}} SET shieldname='".$userrow["stock3name"]."', shieldid='".$userrow["stock3id"]."', stock3name='aucun', stock3id='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous venez de retirer votre bouclier du coffre..</center></table>"; // Output +display($page, "Felicitation"); +die(); +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function sendgold() { + +global $userrow; +$maximumgold = $userrow[gold]; +$checkquery = doquery("SELECT * FROM {{table}} WHERE charname='".$_POST['reciever']."' LIMIT 1", "users"); +$rec = mysql_fetch_assoc($checkquery); +if (isset($_POST["sendgold"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; +if ($sender == "") { $errors++; $errorlist .= "The sender name is required.<br />"; } +if (!is_numeric($goldsent)) { $errors++; $errorlist .= "The amount of gold sent needs to be a number.<br />"; } +if ($goldsent == "") { $errors++; $errorlist .= "The amount of gold is required.<br />"; } +if ($reciever == "") { $errors++; $errorlist .= "The reciever's name is required.<br />"; } +if ($goldsent > $maximumgold) { $errors++; $errorlist .= "You're trying to send more gold than what you have.<br />"; } +if ($goldsent == "0") { $errors++; $errorlist .= "You need to send more gold than just zero.<br />"; } +if ($goldsent < "0") { $errors++; $errorlist .= "<font color='ffffff'>Le montant doit etre positif.<br />"; } +if ($reciever == $sender) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } +if (!$rec) { $errors++; $errorlist .= "Character name doesn't exist."; } +if ($rec == $userrow[charname]) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + + +if ($errors == 0) { +$query = doquery("UPDATE {{table}} SET gold=gold-$goldsent WHERE charname='$sender'","users"); +$query2 = doquery("UPDATE {{table}} SET gold=gold+$goldsent WHERE charname='$reciever'","users"); +display("Transaction réussie.<br /><br /><a href='index.php'>Retourner en ville.</a>","Envoie de gils"); +} else { +display("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Merci de cliquer sur precedant et de recommancer.<br /><a href='index.php?do=sendgold'>Go back</a><br />", "Envoie de gils"); +} + +} +$page = <<<END +<img src="images/gold.gif"><br> +<b><u>Envoie de gils</u></b><br /> +Vous pouvez envoyez une somme precis de gils a un autre joueur.<br /> +<table width="100%"> +<form method='post' action="index.php?do=sendgold"> +<input name="sender" type="hidden" value="$userrow[charname]" id="sender" /> +<tr><td width="30%">Quantité:</td><td><input name="goldsent" type="text" size="12" maxlength="12" /> gold.<br /></td></tr> +<tr><td width="30%">Pseudo du receveur:</td><td><input name="reciever" type="text" size="20" /><br /></td></tr> +<tr><td width="30%"><input name="sendgold" type='submit' value='submit' /> +</form> +<tr><td colspan="2"><a href='index.php'>Retourner en ville</a></td></tr></table> +END; + +display($page,"Envoie de gils"); + +} + +function sendpotion() { + + global $userrow; +$maximumgold = $userrow[itemsac1qt]; + $checkquery = doquery("SELECT * FROM {{table}} WHERE charname='".$_POST['reciever']."' LIMIT 1", "users"); + $rec = mysql_fetch_assoc($checkquery); +if (isset($_POST["sendpotion"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($sender == "") { $errors++; $errorlist .= "The sender name is required.<br />"; } + if (!is_numeric($goldsent)) { $errors++; $errorlist .= "The amount of gold sent needs to be a number.<br />"; } + if ($goldsent == "") { $errors++; $errorlist .= "The amount of gold is required.<br />"; } + if ($reciever == "") { $errors++; $errorlist .= "The reciever's name is required.<br />"; } + if ($goldsent > $maximumgold) { $errors++; $errorlist .= "You're trying to send more gold than what you have.<br />"; } + if ($goldsent == "0") { $errors++; $errorlist .= "You need to send more gold than just zero.<br />"; } + if ($reciever == $sender) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + if (!$rec) { $errors++; $errorlist .= "Character name doesn't exist."; } + if ($rec == $userrow[charname]) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET itemsac1qt=itemsac1qt-$goldsent WHERE charname='$sender'","users"); + $query2 = doquery("UPDATE {{table}} SET itemsac1qt=itemsac1qt+$goldsent WHERE charname='$reciever'","users"); + display("Transaction réussie.<br /><br /><a href=\"index.php\">Retourner en ville.</a>","Envoie de gils"); + } else { + display("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Merci de cliquer sur precedant et de recommancer.<br /><a href=\"index.php?do=sendgold\">Retour</a><br /></table>", "Envoie de gils"); + } + + } +$page = <<<END +<b><u>Envoie de pillule enrgetique</u></b><br /> +Vous pouvez envoyez un nombre precis de pillule energetique a un autre joueur.<br /> +<table width="100%"> +<form method="post" action="index.php?do=sendgold"> +<input name="sender" type="hidden" value="$userrow[charname]" id="sender" /> +<tr><td width="30%">Quantité:</td><td><input name="goldsent" type="text" size="12" maxlength="12" /> <br /></td></tr> +<tr><td width="30%">Pseudo du receveur:</td><td><input name="reciever" type="text" size="20" /><br /></td></tr> +<tr><td width="30%"><input name="sendgold" type="submit" value="Submit" /> +</form> +<tr><td colspan="2"><a href="index.php">Retourner en ville</a></td></tr></table></table> +END; + +display($page,"Envoie de potion"); + +} + +function sendeat() { + + global $userrow; +$maximumgold = $userrow[itemsac1qt]; + $checkquery = doquery("SELECT * FROM {{table}} WHERE charname='".$_POST['reciever']."' LIMIT 1", "users"); + $rec = mysql_fetch_assoc($checkquery); +if (isset($_POST["sendpotion"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($sender == "") { $errors++; $errorlist .= "The sender name is required.<br />"; } + if (!is_numeric($goldsent)) { $errors++; $errorlist .= "The amount of gold sent needs to be a number.<br />"; } + if ($goldsent == "") { $errors++; $errorlist .= "The amount of gold is required.<br />"; } + if ($reciever == "") { $errors++; $errorlist .= "The reciever's name is required.<br />"; } + if ($goldsent > $maximumgold) { $errors++; $errorlist .= "You're trying to send more gold than what you have.<br />"; } + if ($goldsent == "0") { $errors++; $errorlist .= "You need to send more gold than just zero.<br />"; } + if ($reciever == $sender) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + if (!$rec) { $errors++; $errorlist .= "Character name doesn't exist."; } + if ($rec == $userrow[charname]) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + + if ($errors == 0) { + $query = doquery("UPDATE {{table}} SET itemsac6qt=itemsac6qt-$goldsent WHERE charname='$sender'","users"); + $query2 = doquery("UPDATE {{table}} SET itemsac6qt=itemsac6qt+$goldsent WHERE charname='$reciever'","users"); + display("Transaction réussie.<br /><br /><a href=\"index.php\">Retourner en ville.</a>","Envoie de gils"); + } else { + display("<b>Erreurs:</b><br /><div style=\"color:red;\">$errorlist</div><br />Merci de cliquer sur precedant et de recommancer.<br /><a href=\"index.php?do=sendgold\">Retour</a><br /></table>", "Envoie de gils"); + } + + } +$page = <<<END +<b><u>Envoie de bol de ramen</u></b><br /> +Vous pouvez envoyez un nombre precis de bol de ramen a un autre joueur.<br /> +<table width="100%"> +<form method="post" action="index.php?do=sendgold"> +<input name="sender" type="hidden" value="$userrow[charname]" id="sender" /> +<tr><td width="30%">Quantité:</td><td><input name="goldsent" type="text" size="12" maxlength="12" /> <br /></td></tr> +<tr><td width="30%">Pseudo du receveur:</td><td><input name="reciever" type="text" size="20" /><br /></td></tr> +<tr><td width="30%"><input name="sendgold" type="submit" value="Submit" /> +</form> +<tr><td colspan="2"><a href="index.php">Retourner en ville</a></td></tr></table></table> +END; + +display($page,"Envoie de bol de ramen"); + +} +?> +\ No newline at end of file diff --git a/bbcode.php b/bbcode.php @@ -0,0 +1,36 @@ +<?php + +// Pour l'affichage du bbcode général + +class texte +{ + + function ms_format($chaine) + { +$chaine = stripcslashes($chaine); + + $chaine = str_replace(":1:", "<img src='images/smileys/1.jpg'>", $chaine); + $chaine = str_replace(":2:", "<img src='images/smileys/2.jpg'>", $chaine); + $chaine = str_replace(":3:", "<img src='images/smileys/3.jpg'>", $chaine); + $chaine = str_replace(":4:", "<img src='images/smileys/4.jpg'>", $chaine); + $chaine = str_replace(":5:", "<img src='images/smileys/5.jpg'>", $chaine); + $chaine = str_replace(":6:", "<img src='images/smileys/6.jpg'>", $chaine); + $chaine = str_replace(":7:", "<img src='images/smileys/7.jpg'>", $chaine); + $chaine = str_replace(":8:", "<img src='images/smileys/8.jpg'>", $chaine); + $chaine = preg_replace('/\[b\](.+?)\[\/b\]/', '<b>$1</b>', $chaine); + $chaine = preg_replace('/\[i\](.+?)\[\/i\]/', '<i>$1</i>', $chaine); + $chaine = preg_replace('/\[u\](.+?)\[\/u\]/', '<u>$1</u>', $chaine); + $chaine = preg_replace('/\[size=(.+?)\](.+?)\[\/size\]/', '<font size=$1>$2</font>', $chaine); + $chaine = preg_replace('/\[color=(.+?)\](.+?)\[\/color\]/', '<font color=$1>$2</font>', $chaine); + $chaine = preg_replace('/\[img\](.+?)\[\/img\]/', '<img src="$1" />', $chaine); + $chaine = preg_replace('/\[url\](.+?)\[\/url\]/', '<a href="$1" target="_blank">$1</a>', $chaine); + + $chaine = nl2br($chaine); + + + + return($chaine); + } + } + +?> +\ No newline at end of file diff --git a/blocs.php b/blocs.php @@ -0,0 +1,38 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. +include("config.php"); + +$link = opendb(); + +$query = doquery ("SELECT * FROM {{table}} ORDER by id DESC ","blocs"); + +$row = "0"; +for ( $count = 1 ; $count <= 2 && $row != null ; $count ++ ) { + $row = mysql_fetch_array($query); + +// Début de la table copyright. On compte que 1 fois car on affiche qu'une table. + + if (($count % 2) === 1 && $count >= 1) { + + echo " + <p> + <table> + <td valign=\"left\" class=\"classement\">" . $row["bloc3"] . " + <font color=\"#ffffff\"><script type=\"text/javascript\" src=\"http://www.ovnet.net/live/?code=0/100/6038/6/1&ID=19713\"></script></font> + <br>" . $row["bloc4"] . "<br>" . $row["bloc5"] . "</td> + </tr> + </table> + <table> + <tr> + <img src='".$row["bloc1"]."'> + <br> + <img src='".$row["bloc2"]."'> + </tr> + </table> + "; + } + } + +?> + + diff --git a/clan.php b/clan.php @@ -0,0 +1,331 @@ +<?php + +function lahku() { //Vous pouvez exclure un membre du clan +global $userrow; +if(isset($_POST['yes'])) { +$page.= "<center>Vous avez été exclu du clan!<p><p><a href=\"index.php\">explorer le monde</a></center>"; + +$query = doquery("SELECT * FROM {{table}} WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($query)) { +$kuulsus = $kambarow["kuulsus"] - $userrow["level"]; } +$updatequery = doquery("UPDATE {{table}} SET kuulsus='$kuulsus' WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); +$updateuserquery = doquery("UPDATE {{table}} SET kambaid='0', liikmestaatus='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + } + elseif(isset($_POST['no'])) { +$page.= <<<END +<meta http-equiv="refresh" content="2;URL=index.php"> +END; +$page.="Vous allez être redirigé vers la page principale"; } + +else { $page.= "<b><u>Voulez-vous quitter le clan?</u></b><br /><br />Etes-vous sûr?<p><p>"; +$page.="<form action=index.php?do=lahku method=post><input type=submit value=oui name=yes><p><input type=submit value=non name=no></form>"; } +display($page, "Quitter le clan"); } + +function teekamp() { //Vous pouvez faire votre clan à partir du niveau 40, vous pouvez changer ce niveau +global $userrow; +if($userrow["level"] < 25) { display("Vous n'avez pas niveau requit!<br /> Il vous faut un lvl <b>25</b> pour créer votre clan.", "Error"); } +elseif (isset($_POST['teekamp'])) { +if($_POST['nimi'] == "") { display("Vous n'avez pas rentré de nom pour le clan!!<br /><a href=\"index.php?do=kamp\">Précédent</a>", "Viga"); } +else { $page.="Votre clan a bien été créé!<br /><br /><a href=\"index.php?do=kamp\">Aller au Quartier général</a>"; +$query = doquery("INSERT INTO {{table}} SET id='', nimi='".$_POST['nimi']."', logo='".$_POST['logo']."', omanik='".$userrow["id"]."'", "clans"); +//mise à jour du membre ayant créé son clan. kambajuht --> chef du clan, si kambajuht est égal à 1, c'est que vous êtes le chef du clan, et liikmestaatus --> statut des membres. Si votre statut de membre est égal à 5 il sera affiché dans le clan à coté de votre nom chef +$query2 = doquery("UPDATE {{table}} SET kambaid='".$userrow["id"]."', kambajuht='1', liikmestaatus='5' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); } } +else { +$page .= "<center><form action=index.php?do=teekamp method=post><br />"; + $page .= "Nom du clan <input type=text name=nimi size=20 max=20><br />"; + $page .= "Logo du clan <input type=text name=logo size=20 max=20><br />"; + $page .= "<input type=submit value=Valider name=teekamp></form><br /><br /><br />"; + $page .= "Vous pouver aussi retourner <a href=\"index.php\"> explorer le monde</a></center>"; } + display($page, $title); } + +function auaste($id) { // Ici vous pouvez changer le rang des membres // chef, soldat, nouveau ect. +global $userrow; +if(isset($_POST['muuda'])) { +doquery("UPDATE {{table}} SET liikmestaatus='".$_POST['liikmestaatus']."' WHERE id='$id' LIMIT 1", "users"); +$page.="Le rang du membre a été modifié!!<br /><br />Retour au <a href=\"index.php?do=kamp\">QG</a>"; +} +else { +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + while ($row = mysql_fetch_array($query)) { +$mees = $row["charname"]; +$page.= "<b><u>Modifier le rang des membres</b></u><br /><br />"; +$page .= "<form action=index.php?do=auaste:$id method=post><br />"; + $page .= "rang de $mees : <input type=text name=liikmestaatus size=5><br />"; + $page .= "<input type=submit value=CHANGE name=muuda></form><br />"; } } +display($page, "Administration des rangs"); } + + +function kick($id) { //exclure un membre du clan +global $userrow; + +$updatequery = doquery("UPDATE {{table}} SET kambaid='0', liikmestaatus='0', liitumine='0' WHERE id='".$id."' LIMIT 1", "users"); + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + while ($row = mysql_fetch_array($query)) { + + +$kambaquery = doquery("SELECT*FROM {{table}} WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($kambaquery)) { +$k = $row["level"] * 2; +$uuskuulsus = $kambarow["kuulsus"] - $k; +$kuulsusupdate = doquery("UPDATE {{table}} SET kuulsus='$uuskuulsus' WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); +} } +$page.= "Le membre a été exclu du clan!<br /><br />Retourner au <a href=\"index.php?do=kamp\">Quartier général</a>"; + +display($page, "Exclure un membre"); } + +function yes($id) { //Si vous acceptez un membre dans votre clan +global $userrow; + +$liitujaquery = doquery("SELECT*FROM {{table}} WHERE id='$id' LIMIT 1", "liitujad"); //Vous gagnez de l'expérience pour votre clan quand le membre rejoin votre clan + while ($liitujarow = mysql_fetch_array($liitujaquery)) { + +$kasutajaupdate = doquery("UPDATE {{table}} SET kambaid='".$userrow["id"]."' WHERE id='".$liitujarow["liitujaid"]."'", "users");//le membre accepte + +$kambaquery = doquery("SELECT*FROM {{table}} WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($kambaquery)) { +$k = $liitujarow["kuulsus"] * 2; +$uuskuulsus1 = $kambarow["kuulsus"] + $k; //nouvelle expérience + +$update = doquery("UPDATE {{table}} SET kuulsus='$uuskuulsus1' WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + +$page.= "Le membre a ete accepter dans votre clan.<br /><br />Par consequence votre clan a gagné <b>$k</b> point d'experience<p><p>Vous pouvez retourner au <a href=\"index.php?do=kamp\">QG</a>"; +$delete = doquery("DELETE FROM {{table}} WHERE id='$id'", "liitujad"); +} } +display($page, "Liige vastuvõetud"); } + +function no($id) { //Si vous ne l'acceptez pas dans votre clan +$page.= "Demande refusée!!<br /><br />"; +$page.= "<a href=\"index.php?do=kamp\">Retourner au Quartier général</a>"; +doquery("DELETE FROM {{table}} WHERE id='$id'", "liitujad"); +display($page, "Demande refusée"); } + +function liitu($id) { +global $userrow; +if($userrow["liitumine"] == 1) { $page.= "Vous avez déja fait votre demande!<p><a href=\"index.php\">Tagsi linna</a>"; } +else { +doquery("INSERT INTO {{table}} SET id='', kambaid='$id', kuulsus='".$userrow["level"]."', liitujaid='".$userrow["id"]."', liitujanimi='".$userrow["charname"]."'", "liitujad"); +doquery("UPDATE {{table}} set liitumine='1' WHERE id='".$userrow["id"]."'","users"); +$page.= "Demande envoyée.<br />"; +$page.= "<a href=\"index.php\">Tagasi linna</a>"; } +display($page, "Demande envoyée"); } + +function kamp() { // +global $userrow; + +if($userrow["kambaid"] == 0) { + $page .= "<center><b><u>Quartier général</b></u></center><br />"; + $page.= "<center>Vous voulez créer un clan? <a href=\"index.php?do=teekamp\">Cliquez-ici</a><br /><br/><br /></center>"; + $page .= "<table width=\"80%\">"; + $query = doquery("SELECT * FROM {{table}} ORDER BY kuulsus DESC LIMIT 100", "clans"); + $rank = 1; + while ($row = mysql_fetch_array($query)) { + $page .= "<tr><td width=\"10%\"><b>$rank</b></td><td width=\"50\">".$row["nimi"]."</a></td><td width=\"200%\">Expérience: <b>".$row["kuulsus"]."</b></td><td width=\"20%\"><a href=\"index.php?do=liitu:".$row["omanik"]."\">Rejoindre le clan</a></td></tr>\n"; + $rank++; + } + $page .= "</table>\n<br /><br />\n"; + $page .= "<center>Cliquez-<a href=\"index.php\"> ici </a>pour explorer le monde</center>"; + $title = "Intégrer le clan"; } + + +elseif($userrow["kambajuht"] == 0 & $userrow["kambaid"] > 0 ) { //membre du clan normal + + $kambaquery = doquery("SELECT logo FROM {{table}} WHERE omanik='".$userrow["kambaid"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($kambaquery)) { + + + $logo = $kambarow["logo"]; } + $page .= "<center><img src=\"$logo\" width=\"393\" height=\"98\"/></center>"; //afficher le logo du clan + $page .= "<form action=index.php?do=kamp method=post>"; + $page .= "<table><tr><td><input type=submit value='Infos clan' name=kamp></td><td><input type=submit value='Messages' name=teated></td><td><input type=submit value='Membres' name=liikmed></td><td><input type=submit value='Page principale' name=tagasi></td></tr><tr><center><a href=\"index.php\">Explorer le monde</a></center></td></tr><tr></tr><tr><a href=\"index.php?do=lahku\">Quitter le clan !!</a></td></tr></table>"; + $page .= "<table><tr><td><input type=submit value='Ajouter un message' name=lisateade></td></tr><tr></tr></table>"; + } +elseif ($userrow["kambajuht"] == 1) { //chef du clan + $kambaquery = doquery("SELECT logo FROM {{table}} WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($kambaquery)) { + + $logo = $kambarow["logo"]; } + $page .= "<center><img src=\"$logo\" width=\"393\" hnoght=\"98\" /><br><br><a href=\"index.php\">Retourner en ville</a></center>"; + $page .= "<form action=index.php?do=kamp method=post>"; + $page .= "<table><tr><td><input type=submit value='Infos clan' name=kamp></td><td><input type=submit value='Messages' name=teated></td><td><input type=submit value='Membres' name=liikmed></td><td><input type=submit value='Administration' name=admin></td><td><input type=submit value='Page principale' name=tagasi></td></tr><tr></tr><tr></td></tr></table>"; + + } + + + +if(isset($_POST['kamp'])) { +$kambaquery = doquery("SELECT*FROM {{table}} WHERE omanik='".$userrow["kambaid"]."' LIMIT 1", "clans"); + while ($kambarow = mysql_fetch_array($kambaquery)) { + + $omanikquery = doquery("SELECT*FROM {{table}} WHERE id='".$kambarow["omanik"]."' LIMIT 1", "users"); + while ($omanikrow = mysql_fetch_array($omanikquery)) { + + + +$page.= "<center><b><u>Infos clan</b></u></center><br /><br /><table>"; +$page .="<tr><td>Nom du clan :</td><td>".$kambarow["nimi"]."</td></tr>"; +$page .="<tr><td>Chef du clan :</td><td><a href=index.php?do=onlinechar:".$omanikrow["id"]."\">".$omanikrow["charname"]."</a></td></tr>"; +$page .="<tr><td>Expérience du clan :</td><td>".$kambarow["kuulsus"]."</td></tr></table>"; } } } + + + + +if(isset($_POST['teated'])) { + + $kampquery = doquery("SELECT * FROM {{table}} WHERE omanik='".$userrow["kambaid"]."' LIMIT 1", "clans"); + + + $newsquery = doquery("SELECT * FROM {{table}} WHERE kambaid='".$userrow["kambaid"]."' ORDER BY id DESC LIMIT 25", "kambauudised"); + $rank = 1; + while ($newsrow = mysql_fetch_array($newsquery)) { + $page .= "<br/><br /><b>$rank.</b> ".$newsrow["sisu"]."<br />Message de: <a href=\"index.php?do=onlinechar:".$newsrow["lisajaid"]."\">".$newsrow["lisajanimi"]."</a><br/>"; + $rank++; + + } } + + + elseif(isset($_POST['lisateade'])) { + + $page .= "<form action=index.php?do=kamp method=post>"; + + + $page .= "Message:<br /><textarea name=\"sisu\" rows=\"4\" cols=\"20\" max=50></textarea><br /><br /><input type=\"submit\" name=\"Valider\" value=\"Envoyer\" />"; } + + + elseif(isset($_POST['Valider'])) { + $updatequery = doquery("INSERT INTO {{table}} SET id='', kambaid='".$userrow["kambaid"]."', lisajaid='".$userrow["id"]."', lisajanimi='".$userrow["charname"]."', sisu='".$_POST['sisu']."'", "kambauudised"); + + $page.= "Message ajouté"; + } + + + + + elseif(isset($_POST['admin'])) { + + $page .= "<form action=index.php?do=kamp method=post>"; + $page .= "<table><tr><td><input type=submit value='Administration du clan' name=seaded></td><td><input type=submit value='Ajouter un message' name=lisateade></td><td><input type=submit value='Rangs' name=auastmed></td><td><input type=submit value='Exclure un membre' name=kick></td><td><input type=submit value='Demandes' name=avaldus></td></td></tr><tr></tr></table>"; + } + + + + elseif(isset($_POST['avaldus'])) { + $page .= "<table><tr><td><input type=submit value='Ajouter un message' name=lisateade></td><td><input type=submit value='Rangs' name=auastmed></td><td><input type=submit value='Exclure un membre' name=kick></td></tr></table>"; + + $page .= "<table width=\"80%\">"; + $query = doquery("SELECT * FROM {{table}} WHERE kambaid='".$userrow["id"]."' ORDER BY id DESC LIMIT 100", "liitujad"); + + $rank = 1; + while ($row = mysql_fetch_array($query)) { + $kampquery = doquery("SELECT * FROM {{table}} WHERE id='".$row["liitujaid"]."'", "users"); + + + while ($kamprow = mysql_fetch_array($kampquery)) { +$page .= "<tr><td width=\"10%\"><b>$rank</b></td><td width=\"50\"><a href=\"index.php?do=onlinechar:".$row["liitujaid"]."\">Accepter ".$row["liitujanimi"]."?</a></td><td>".$kamprow["level"]."<td width=\"100%\"><a href=\"index.php?do=yes:".$row["id"]."\">[oui]</a></td><td width=\"100%\"><a href=\"index.php?do=no:".$row["id"]."\">[non]</a></td></tr>\n"; + $rank++; + } } + if (mysql_num_rows($query) == 0) { $page .= "<tr><td width=\"8%\">Vous n'avez aucune demande</td></tr>\n"; } // + + $page .= "</table>\n<br /><br />\n"; } + + elseif(isset($_POST['seaded'])) { + $page.= "<center><b><u>Administration</b></u></center><br /><br />";//modifier le nom du clan + $page .= "<form action=index.php?do=kamp method=post><br />"; + $page .= "Nom du clan <input type=text name=kambanimi size=5><br />"; + $page .= "<input type=submit value='Modifier' name=nimi><br /><br />"; + $page.= "<center><b><u>Logo du clan</b></u></center><br /><br />"; //Logo du clan + $page .= "URL du logo: <input type=text name=kambalogo size=20>(Insert http://!MAX size <b>400</b>X<b>100</b> pix)<br />"; + $page .= "<input type=submit value='Modifier' name=logo><br />"; + $page.= "<center><b><u>Supprimer votre clan</b></u></center><br /><br />"; //Logo du clan + $page .= "Cliquez <a href='index.php?do=suppr'>ici</a> pour supprimer votre clan<br />"; + $page.= "<br /><br /><center>Retourner au <a href=\"index.php?do=kamp\">Quartier général</a></center>"; } + +elseif(isset($_POST['nimi'])) { + $page .= "<center><br />Le nom du clan a été modifié!<br /><br /><a href=\"index.php?do=kamp\">Retourner au Quartier général</a></center>"; + doquery("UPDATE {{table}} SET nimi='".$_POST['kambanimi']."' WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + } + + elseif(isset($_POST['logo'])) { + $page.= "<center><br /><br />Le logo du clan a été modifié!<br /><br /><a href=\"index.php?do=kamp\">Retourner au Quartier général</a></center>"; + doquery("UPDATE {{table}} SET logo='".$_POST['kambalogo']."' WHERE omanik='".$userrow["id"]."' LIMIT 1", "clans"); + } + + + elseif(isset($_POST['auastmed'])) { + $page .= "<form action=index.php?do=kamp method=post>"; + $page .= "<table><tr><td><input type=submit value='Ajouter un message' name=lisateade></td><td><input type=submit value=Membres name=liikmed></td><td><input type=submit value='Rangs' name=auastmed></td><td><input type=submit value=exclure name=kick></td></td><td><input type=submit value='Page principale' name=tagasi></td></tr><tr></tr></table>"; + + $page .= "<table width=\"80%\">"; + $query = doquery("SELECT * FROM {{table}} WHERE kambaid='".$userrow["kambaid"]."' ORDER BY liikmestaatus DESC LIMIT 1000", "users"); + $rank = 1; + while ($row = mysql_fetch_array($query)) { + + if($row["liikmestaatus"] == 0) { $staatus = "Nouveau"; } elseif($row["liikmestaatus"] == 1) { $staatus = "Membre"; } elseif($row["liikmestaatus"] == 2) { $staatus = "Soldat"; } elseif($row["liikmestaatus"] == 3) { $staatus = "Commandant"; } elseif($row["liikmestaatus"] == 4) { $staatus = "Bras droit"; } elseif($row["liikmestaatus"] == 5) { $staatus = "Chef"; } + + +$page .= "<tr><td width=\"10%\"><b>$rank</b></td><td width=\"50\"><a href=\"index.php?do=onlinechar:".$row["id"]."\">".$row["charname"]."</a></td><td width=\"200%\">Lvl: <b>".$row["level"]."</b></td><td>Rang: </td><td><b>$staatus</b></td><td width=\"100\"><a href=\"index.php?do=auaste:".$row["id"]."\">[Changer]</a></td></tr>\n"; + $rank++; + } + $page .= "</table>\n<br /><br />\n"; } + + + elseif(isset($_POST['liikmed'])) { + + + $page .= "<table width=\"80%\">"; + $liikmedquery = doquery("SELECT * FROM {{table}} WHERE kambaid='".$userrow["kambaid"]."' ORDER BY liikmestaatus DESC LIMIT 1000", "users"); + + $rank = 1; + while ($liikmerow = mysql_fetch_array($liikmedquery)) { + if($liikmerow["liikmestaatus"] == 0) { $staatus = "Nouveau"; } elseif($liikmerow["liikmestaatus"] == 1) { $staatus = "Membre"; } elseif($liikmerow["liikmestaatus"] == 2) { $staatus = "Soldat"; } elseif($liikmerow["liikmestaatus"] == 3) { $staatus = "Commandant"; } elseif($liikmerow["liikmestaatus"] == 4) { $staatus = "Bras droit"; } elseif($liikmerow["liikmestaatus"] == 5) { $staatus = "Chef"; } + $page .= "<tr><td width=\"10%\"><b>$rank</b></td><td width=\"50\"><a href=\"index.php?do=onlinechar:".$liikmerow["id"]."\">".$liikmerow["charname"]."</a></td><td width=\"100%\"><b>".$liikmerow["level"]."</b></td><td>Rang: $staatus</td></tr>\n"; + $rank++; + } + + $page .= "</table>\n<br /><br />\n"; + } + + elseif(isset($_POST['kick'])) { + + $page .= "<form action=index.php?do=kamp method=post>"; + + $page .= "<table width=\"80%\">"; + $liikmedquery = doquery("SELECT * FROM {{table}} WHERE kambaid='".$userrow["kambaid"]."' ORDER BY liikmestaatus DESC LIMIT 1000", "users"); + + $rank = 1; + while ($liikmedrow = mysql_fetch_array($liikmedquery)) { + + if($liikmedrow["kambajuht"] == 1) { $kick = ""; } + else { $kick ="<a href=\"index.php?do=kick:".$liikmedrow["id"]."\">[Exclure le membre]</a>"; } + + $page .= "<tr><td width=\"10%\"><b>$rank</b></td><td width=\"50\"><a href=\"index.php?do=onlinechar:".$liikmedrow["id"]."\">".$liikmedrow["charname"]."</a></td></td><td>$staatus</td><td>$kick</td></tr>\n"; + $rank++; + } + + $page .= "</table>\n<br /><br />\n"; + } + + display($page, "Exclure un membre"); + } + + function suppr() { //Pour supprimer votre clan +global $userrow; +$page .= "<form action=index.php?do=suppr method=post>"; +$page .= "<center><b><u>Supprimer votre clan</b></u></center><br /><br />"; +$page .= "Etes vous certains de vouloir supprimer votre clan?"; +$page .= "<table><tr><td><input type=submit value='Oui' name=Oui></td><td><input type=submit value='Non' name=Non></td></tr></table>"; + +if(isset($_POST['Non'])) { +$page .= "Votre clan n'a donc pas été supprimé."; +$page .= "Vous pouvez retourner au <a href='index.php?do=kamp'>Quartier Général</a>."; +} +elseif(isset($_POST['Oui'])) { +$query = doquery("DELETE FROM {{table}} WHERE omanik='".$userrow["id"]."'", "clans"); +$query = doquery("UPDATE {{table}} SET kambaid='0', liikmestaatus='0', liitumine='0' WHERE kambaid='".$userrow["id"]."'","users"); +$page .= "<center><b><u>Votre clan a bien été supprimé.</b></u></center><br /><br />"; +$page .= "Cliquez <a href='index.php'>ici</a> pour retourner en ville."; +} +display($page, "Supprimer votre clan"); +} +?> +\ No newline at end of file diff --git a/classe.php b/classe.php @@ -0,0 +1,33 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. + +include("config.php"); + + $query = doquery ("SELECT * FROM {{table}} ORDER by level DESC ","users"); + + echo " <table width=\"272px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; + + //Initialisation pour une valeur de départ non null pour rentrer dans la boucle + + $var = "0"; + for ( $count = 1; $count <= 8 && $row != null ; $count ++ ) { + $var ++ ; + $row = mysql_fetch_array($query); + + //N'affiche pas la ligne si il n'y a plus d'enregistrements. + if ($var >= 3 && $row != null){ + echo " <tr>"; + echo " <td width=\"24px\" align=\"center\" class=\"classement\"><img src=\"././images/classement/num-" . $count . ".gif\"/></td>"; + echo " <td width=\"40px\" align=\"center\" class=\"classement\"><img src=\"././images/classement/class-" . $row["charclass"] . ".gif\"/></td>"; + echo " <td width=\"100px\" class=\"classement\"><b><font color=\"6b3a07\"><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["charname"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Actuellement: </b>" . $row["currentaction"] . "<br><b>Gils:</b> " . $row["gold"] . "<br><b>En banque: </b>" . $row["bank"] . "<br><b>Mp:</b> " . $row["maxmp"] . "<br><b>Tp:</b> " . $row["maxtp"] . "<br><b>Arme:</b> " .addslashes(htmlspecialchars($row["weaponname"])) ."<br><b>Armure:</b> " .addslashes(htmlspecialchars($row["armorname"])) ."<br><b>Bouclier: </b>" .addslashes(htmlspecialchars($row["shieldname"])) ."<br><b>Dextérité:</b> " . $row["dexterity"] . "<br><b> Pourvoir d\'attaque: </b>" . $row["attackpower"] . "<br><b>Pouvoir de defense:</b> " . $row["defensepower"] . " ','#FFFFF9')\" onMouseOut=kill() ;>" . $row["charname"] . "</a></font></b></td>"; + echo " <td width=\"91px\" align=\"center\" class=\"classement\"><font face=\"verdana\" size=\"1\" color=\"#990066\">Niv.</font>" . $row["level"] . " (" . $row["currenthp"] . ".hp)</td>"; + echo " </tr>"; + echo " <tr>"; + echo " <td ><img src=\"././images/classement/espace.gif\" width=\"24px\" height=\"3\"></td>"; + echo " <td colspan=\"3\"><img src=\"././images/classement/tirets.gif\" width=\"231px\" height=\"3px\"></td>"; + echo " </tr>"; + } +} + echo " </table>"; +?> + diff --git a/classe2.php b/classe2.php @@ -0,0 +1,31 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. + +include("config.php"); + +$query = doquery ("SELECT * FROM {{table}} ORDER by kuulsus DESC ","clans"); + +echo " <table width='272px' border='0' cellpadding='0' cellspacing='0'>"; + +//Initialisation pour une valeur de départ non null pour rentrer dans la boucle + +$var = "0"; +for ( $count = 1; $count <= 5 && $row != null ; $count ++ ) { +$var ++ ; +$row = mysql_fetch_array($query); + +//N'affiche pas la ligne si il n'y a plus d'enregistrements. +if ($var >= 1 && $row != null){ +echo " <tr>"; +echo " <td width='24px' align='center' class='classement'><img src='./images/classement/num-" . $count . ".gif'/></td>"; +echo " <td width='100px' class='classement'><b><font color='f4d234'>" . $row['nimi'] . "</a></font></b></td>"; +echo " <td width='91px' align='center' class='classement'><font face='verdana' size='1' color='#1cab59'>Niv.</font><font face='verdana' size='1' color='#FFFFFF'>" . $row['kuulsus'] . " </font></td>"; +echo " </tr>"; +echo " <tr>"; +echo " <td ><img src='./images/classement/espace.gif' width='24px' height='3'></td>"; +echo " <td colspan='3'><img src='./images/classement/tirets.gif' width='231px' height='3px'></td>"; +echo " </tr>"; +} +} +echo " </table>"; +?> +\ No newline at end of file diff --git a/classe_best.php b/classe_best.php @@ -0,0 +1,29 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. + +include("config.php"); + + $query = doquery ("SELECT * FROM {{table}} ORDER by level DESC","users"); + + $row = "0"; +for ( $count = 1 ; $count <= 2 && $row != null ; $count ++ ) { + $row = mysql_fetch_array($query); + if ( $row != null ) { + + echo " <table width=\"119px\" height=\"142px\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 2px\" valign=\"middle\">"; + echo " <tr> + <td width=\"119px\" height=\"8px\" background=\"././images/classement/bg1_best.gif\"></td> + </tr>"; + echo " <tr> + <td width=\"119\" height=\"122px\" valign=\"top\" border=\"0\" background=\"././images/classement/bg2_best.gif\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["charname"])) ."</b></u></font><br><img src=././images/space_bulle.gif width=150><br><b>Actuellement: </b>" . $row["currentaction"] . "<br><b>Gils:</b> " . $row["gold"] . "<br><b>En banque: </b>" . $row["bank"] . "<br><b>Mp:</b> " . $row["maxmp"] . "<br><b>Tp:</b> " . $row["maxtp"] . "<br><b>Arme:</b> " .addslashes(htmlspecialchars($row["weaponname"])) ."<br><b>Armure:</b> " .addslashes(htmlspecialchars($row["armorname"])) ."<br><b>Bouclier: </b>" .addslashes(htmlspecialchars($row["shieldname"])) ."<br><b>Dextérité:</b> " . $row["dexterity"] . "<br><b> Pourvoir d\'attaque: </b>" . $row["attackpower"] . "<br><b>Pouvoir de defense:</b> " . $row["defensepower"] . " ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/classement/num-" . $count . ".gif\" align=\"left\" valign=\"top\" class=\"classement2\" /><img src=\"././images/avatar/" . $row["avatar"] . "\" align=\"center\" align=\"top\"/></a></center><font face=\"verdana\" size=\"1\" color=\"#990066\" align=\"left\" valign=\"bottom\"><b>Nom: </b></font><font face=\"verdana\" size=\"1\" color=\"#000000\">" . $row["charname"] . "</font><br><font face=\"verdana\" size=\"1\" color=\"#990066\"align=\"left\" valign=\"bottom\"><b>Niv: </b></font><font face=\"verdana\" size=\"1\" color=\"#000000\">" . $row["level"] . "</font><br><font face=\"verdana\" size=\"1\" color=\"#990066\"align=\"left\" valign=\"bottom\"><b>Hp: </b></font><font face=\"verdana\" size=\"1\" color=\"#000000\">" . $row["currenthp"] . " </font></td> + </tr>"; + echo " <tr valign=\"top\"> + <td width=\"119px\" height=\"12px\" background=\"././images/classement/bg3_best.gif\" ></td> + </tr>"; + echo " </table>"; + + } +} + + +?> diff --git a/classe_best2.php b/classe_best2.php @@ -0,0 +1,29 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. + +include("config.php"); + + $query = doquery ("SELECT * FROM {{table}} ORDER by kuulsus DESC","clans"); + + $row = "0"; +for ( $count = 1 ; $count <= 2 && $row != null ; $count ++ ) { + $row = mysql_fetch_array($query); + if ( $row != null ) { + + echo " <table width=\"119px\" height=\"142px\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 2px\" valign=\"middle\">"; + echo " <tr> + <td width=\"119px\" height=\"8px\" background=\"././images/classement/bg1_best.gif\"></td> + </tr>"; + echo " <tr> + <td width=\"119\" height=\"122px\" valign=\"top\" border=\"0\" background=\"././images/classement/bg2_best.gif\"><font face=\"verdana\" size=\"1\" color=\"#000000\" align=\"left\" valign=\"bottom\"><img src=\"././images/classement/num-" . $count . "a.gif\" align=\"left\" valign=\"top\" class=\"classement2\" /><img src='" . $row["logo"] . "' BORDER=0 width='80px' height='80px'><br><br><b>Nom: </b></font><font face=\"verdana\" size=\"1\" color=\"#000000\">" . $row["nimi"] . "</font><br><font face=\"verdana\" size=\"1\" color=\"#000000\"align=\"left\" valign=\"bottom\"><b>Niv: </b></font><font face=\"verdana\" size=\"1\" color=\"#000000\">" . $row["kuulsus"] . "</font></td> + </tr>"; + echo " <tr valign=\"top\"> + <td width=\"119px\" height=\"12px\" background=\"././images/classement/bg3_best.gif\" ></td> + </tr>"; + echo "</table>"; + + } +} + + +?> diff --git a/classement.php b/classement.php @@ -0,0 +1,102 @@ +<?php +function classement() +{ +$ordre = $_GET['ordre']; +if ($ordre == "level") { $ordre_classement = 'level DESC'; } +elseif ($ordre == "experience") { $ordre_classement = 'experience DESC'; } +elseif ($ordre == "hp") { $ordre_classement = 'currenthp DESC'; } +elseif ($ordre == "mp") { $ordre_classement = 'currentmp DESC'; } +elseif ($ordre == "tp") { $ordre_classement = 'currenttp DESC'; } +elseif ($ordre == "level2") { $ordre_classement = 'level'; } +elseif ($ordre == "experience2") { $ordre_classement = 'experience'; } +elseif ($ordre == "hp2") { $ordre_classement = 'currenthp'; } +elseif ($ordre == "mp2") { $ordre_classement = 'currentmp'; } +elseif ($ordre == "tp2") { $ordre_classement = 'currenttp'; } +else { $ordre_classement = 'level DESC'; } + +$classement_sql = mysql_query("SELECT id,charname,level,currentaction,currenthp,maxhp,currentmp,maxmp,currenttp,maxtp,experience FROM rpg_users WHERE verify='1' ORDER BY $ordre_classement"); +while ($donnees = mysql_fetch_array($classement_sql) ) +{ +$classement_id = $donnees['id']; +$classement_utilisateur = $donnees['charname']; +$classement_niveau = $donnees['level']; +$classement_lieux = $donnees['currentaction']; +$classement_hp = $donnees['currenthp']; +$classement_hp_max = $donnees['maxhp']; +$classement_mp = $donnees['currentmp']; +$classement_mp_max = $donnees['maxmp']; +$classement_tp = $donnees['currenttp']; +$classement_tp_max = $donnees['maxtp']; +$classement_experience = $donnees['experience']; +$page_exe .= <<<END +<tr> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center"><a href="index.php?do=onlinechar:$classement_id">$classement_utilisateur</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_niveau</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_experience</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_lieux</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_hp / $classement_hp_max</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_mp / $classement_mp_max</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#ECD5B2"> + +<p align="center">$classement_tp / $classement_tp_max</p> +</td> +</tr> +END; +} + +$page = <<<END +<table align="center" cellspacing="0" style="border-collapse:collapse;" border="1"> +<tr> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center">Personnage</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center"><a href="index.php?do=classement&ordre=level">Niveau</a></p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center"><a href="index.php?do=classement&ordre=experience">Expérience</a></p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center">Lieu Actuel</p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center"><a href="index.php?do=classement&ordre=hp">Points de vie</a></p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center"><a href="index.php?do=classement&ordre=mp">Points de Magie</a></p> +</td> +<td style="border-width:1; border-color:black;" bgcolor="#DABE92"> + +<p align="center"><a href="index.php?do=classement&ordre=tp">Points de Téléportation</a></p> +</td> +</tr> +$page_exe +</table> +END; +display($page, "Classement"); +} +?> +\ No newline at end of file diff --git a/comments_mod.php b/comments_mod.php @@ -0,0 +1,49 @@ +<?PHP + +function addpost($topic) { + + global $userrow; + $comment = $_POST['comment']; + $texte = new texte(); + if ($message = '' || $message = ' ' || !$message) // Blank post + header("Location: index.php"); + doquery("INSERT INTO {{table}} SET topic=$topic,time=NOW(),poster=$userrow[id],post='$comment'", "comments"); + header("Location: index.php?do=comments:$topic"); +} + +function read($topic) { + $title = "Comments"; + $query = doquery("SELECT * FROM {{table}} WHERE id=$topic LIMIT 1", "news"); + $texte = new texte(); + $newsrow = mysql_fetch_assoc($query); + $page = "<table width=\"500px\"><tr><td class=\"title\"> <img src=\"././images/titre_news.gif\" alt=\"Dernière news\" /></td></tr><tr><td>\n"; + $page .= "<span class=\"light\">[".prettydate($newsrow["postdate"])."]</span><br />".$texte->ms_format(htmlentities($newsrow["content"])); + $page .= "</td></tr></table>\n"; + + + $page .= "<table width=\"95%\"><tr><td class=\"title\"><b>Ajouter un commentaire<b></td></tr>\n"; + $query = doquery("SELECT * FROM {{table}} WHERE topic=$topic ORDER BY id ASC", "comments"); + while ($com = mysql_fetch_assoc($query)) { + $pquery = doquery("SELECT * FROM {{table}} WHERE id=".$com['poster']." LIMIT 1", "users"); + $person = mysql_fetch_assoc($pquery); + $page .= "<tr><td><span class=\"light\">".$person['username']." -- [".prettydate($com["time"])."]</span><br />".$texte->ms_format(htmlentities($com["post"]))."</td></tr>"; + } + $page .= "</table> + + ___________________________________________ + + <br>[b]Gras[/b] / [i]Italique[/i] / [u]Souligné[/u] / [img]Image[\img] / [url]Lien[/url] + <br><img src='images/smileys/1.jpg'> :1: / + <img src='images/smileys/2.jpg'> :2: / + <img src='images/smileys/3.jpg'> :3: / + <img src='images/smileys/4.jpg'> :4: / + <img src='images/smileys/5.jpg'> :5: / + <img src='images/smileys/6.jpg'> :6: / + <img src='images/smileys/7.jpg'> :7: / + <img src='images/smileys/8.jpg'> :8: /\n"; + $page .= "<form action=index.php?do=post_comment:$topic method=post><textarea name=comment></textarea><br /><input type=submit name=submit value=Poster /></form><br />"; + $page .= "<br /><a href=index.php>Retour</a>"; + + display($page, $title); +} +?> +\ No newline at end of file diff --git a/config.php b/config.php @@ -1,11 +1,14 @@ -<?php // config.php :: Low-level app/database variables. - -$dbsettings = Array( - "server" => "localhost", // MySQL server name. (Default: localhost) - "user" => "", // MySQL username. - "pass" => "", // MySQL password. - "name" => "", // MySQL database name. - "prefix" => "dk", // Prefix for table names. (Default: dk) - "secretword" => ""); // Secret word used when hashing information for cookies. - +<?php // config.php :: Infos pour l'installation du script à remplir. + +$dbsettings = Array( + "server" => "localhost", // Nom du serveur MySQL. (Default: localhost) + "user" => "root", // Nom de votre login MySQL. + "pass" => "", // Nom de votre password MySQL. + "name" => "test", // Nom de votre base MySQL. + "secretword" => "rpg", // Mot secret utilisé lors de la mise a jour des cookies. + +// Pour éviter les problèmes MYSQL ne changez pas le préfixe + "prefix" => "rpg"); // Prefixe des tables MySQL + + ?> \ No newline at end of file diff --git a/cookies.php b/cookies.php @@ -1,32 +1,32 @@ -<?php // cookies.php :: Handles cookies. (Mmm, tasty!) - -function checkcookies() { - - include('config.php'); - - $row = false; - - if (isset($_COOKIE["dkgame"])) { - - // COOKIE FORMAT: - // {ID} {USERNAME} {PASSWORDHASH} {REMEMBERME} - $theuser = explode(" ",$_COOKIE["dkgame"]); - $query = doquery("SELECT * FROM {{table}} WHERE username='$theuser[1]'", "users"); - if (mysql_num_rows($query) != 1) { die("Invalid cookie data (Error 1). Please clear cookies and log in again."); } - $row = mysql_fetch_array($query); - if ($row["id"] != $theuser[0]) { die("Invalid cookie data (Error 2). Please clear cookies and log in again."); } - if (md5($row["password"] . "--" . $dbsettings["secretword"]) != $theuser[2]) { die("Invalid cookie data (Error 3). Please clear cookies and log in again."); } - - // If we've gotten this far, cookie should be valid, so write a new one. - $newcookie = implode(" ",$theuser); - if ($theuser[3] == 1) { $expiretime = time()+31536000; } else { $expiretime = 0; } - setcookie ("dkgame", $newcookie, $expiretime, "/", "", 0); - $onlinequery = doquery("UPDATE {{table}} SET onlinetime=NOW() WHERE id='$theuser[0]' LIMIT 1", "users"); - - } - - return $row; - -} - +<?php // cookies.php :: Création et utilisation du cookies de session. + + +function checkcookies() { + + include('config.php'); + + $row = false; + + if (isset($_COOKIE["dkgame"])) { + + // Format du cookies: + // {ID} {USERNAME} {PASSWORDHASH} {REMEMBERME} + $theuser = explode(" ",$_COOKIE["dkgame"]); + $query = doquery("SELECT * FROM {{table}} WHERE username='$theuser[1]'", "users"); + if (mysql_num_rows($query) != 1) { die("Erreur 1: cookie invalide, veuillez éffacer le cookies et vous reloger ensuite."); } + $row = mysql_fetch_array($query); + if ($row["id"] != $theuser[0]) { die("Erreur 2: cookie invalide, veuillez éffacer le cookies et vous reloger ensuite."); } + if (md5($row["password"] . "--" . $dbsettings["secretword"]) != $theuser[2]) { die("Erreur 3: cookie invalide, veuillez éffacer le cookies et vous reloger ensuite."); } + + // If we've gotten this far, cookie should be valid, so write a new one. + $newcookie = implode(" ",$theuser); + if ($theuser[3] == 1) { $expiretime = time()+31536000; } else { $expiretime = 0; } + $onlinequery = doquery("UPDATE {{table}} SET onlinetime=NOW() WHERE id='$theuser[0]' LIMIT 1", "users"); + + } + + return $row; + +} + ?> \ No newline at end of file diff --git a/delete.php b/delete.php @@ -0,0 +1,49 @@ +<?php +// Fonction de suppression du compte +// Codée par Ted_2.3 +// Pour toute aide, allez sur http://rpgillusion.online.fr/forum/ ou écrivez àthekillerofcovenants@hotmail.fr + +function delete() +{ +global $userrow; +$page .= "<center><b><u>Supprimer votre clan</b></u></center><br /><br />"; +$page .= "<form method='post' action='index.php?do=deleteuser'>"; +$page .= "Vous êtes sur le point de supprimer votre compte.<br />Etes-vous sûr de vouloir supprimer votre compte de jeu ?"; +$page .= "<table><tr><td><input type='submit' value='Oui' name='Oui'></td><td><input type='submit' value='Non' name='Non'></td></tr></table>"; +display($page, "Supprimer votre compte de jeu"); +} + +function deleteuser() +{ +global $userrow; + +if ($userrow["id"] == false) +{ +$page .= "Tentative de hack détectée. Votre IP a été enregistrée."; +display($page, "Tentative de hack détectée"); + +} +else +{ +if (isset($_POST['Non'])) +{ +$page .= "Votre compte n'a pas été supprimé.<br />Vous pouvez maintenant retourner <a href='index.php'>en ville</a>."; +display($page, "Compte non-supprimé"); + +} +elseif (isset($_POST['Oui'])) +$query = doquery("DELETE FROM {{table}} WHERE id='".$userrow["id"]."'", "users"); +if ($query == true) +{ +?> +Votre compte a correctement été supprimé. Vous pouvez <a href="login.php?do=login">retourner à l'accueil du jeu</a>.<br /> +Merci d'avoir joué à DreamWar Online ! +<?php +} +elseif ($query == false) +{ +$page .= "Une erreur s'est produite lors de la suppression de votre compte. Veuillez recommencer."; +} +} +} +?> +\ No newline at end of file diff --git a/encheres.php b/encheres.php @@ -0,0 +1,478 @@ +<?php + +// si année ou mois ou jour est supérieur + +function encheres (){ + + global $userrow, $controlrow, $numqueries; + + $prixquery = doquery("SELECT * FROM {{table}} WHERE name='".$userrow["weaponname"]."' OR name='".$userrow["armorname"]."' OR name='".$userrow["shieldname"]."'", "items"); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + $title = "Les encheres"; + + + + for($i=1;$i<=3;$i++) { + $prix[$i] = 'Aucune'; + $lien[$i] = ''; + $lien2[$i] = ''; + } + while($prixrow = mysql_fetch_array($prixquery)){ + $id[$prixrow['type']] = $prixrow['id']; + $prix[$prixrow['type']] = $prixrow['buycost']; + $lien[$prixrow['type']] .= "<a href=index.php?do=vente2:".$prixrow['id'].">"; + $lien2[$prixrow['type']] .= "</a>"; + } + + + $page .= "<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Pour mettre en vendre vos équipements, il vous suffit de cliquer sur le bouton nommé \"A vendre\".</td></tr></table>\n"; + $page .= "<table width=\"380\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n"; + $page .= "<br><br><b><img src=\"images/puce4.gif\" /> <span class=\"mauve1\">Vos équipements:</span></b><br><br><br>\n"; + $page .= "<tr valign=\"top\"><td width=\"380\" align=\"left\"><img src=\"images/arme.gif\"/> <b>".$lien[1]."".$userrow["weaponname"] ."".$lien2[1]."</b> (valeur: ".$prix[1].")<br><img src=\"images/armure.gif\"/> <b>".$lien[2]."" . $userrow["armorname"] . "".$lien2[2]."</b> (valeur: ".$prix[2].")<br><img src=\"images/bouclier.gif\"/> <b>".$lien[3]."" . $userrow["shieldname"] . "".$lien2[3]."</b> (valeur: ".$prix[3].")</td></tr>\n"; + $page .= "</table>\n"; + $page .= "<br><br><a href=\"index.php\">» Retour au sommaire</a>\n"; + + + display($page, $title); +} + +function vente2($id) { // Confirm user's intent to purchase item. + + global $userrow, $numqueries; + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); + $itemsrow = mysql_fetch_array($itemsquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + $encheresquery = doquery("SELECT * FROM {{table}} WHERE proprietaire='".$userrow['charname']."'", "encheres"); + + //hop on fait une boucle pour parcourir tous les resultats au lieu d'un seul + while($encheresrow = mysql_fetch_array($encheresquery)){ + + if ($encheresrow["name"] == $itemsrow["name"] ){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous avez déja ajouté cet objet aux enchères.<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Chez le notaire"); die(); } + +} + + $page = "<form enctype=\"multipart/form-data\" action=\"index.php?do=vente3:$id\" method=\"post\">\n"; + $page .= "<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous allez mettre en enchère l'objet ".$itemsrow["name"].", vous êtes d'accord?<br></td></tr></table>\n"; + $page .= "<table width=\"380\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n"; + $page .= "<br><br><b><img src=\"images/puce4.gif\" /> <span class=\"mauve1\">Formulaire de vente:</span></b><br><br><br>\n"; + $page .= "<tr valign=\"top\"><td width=\"110\"><div align=\"left\">Prix de départ:</div></td><td><div align=\"left\"><input type=\"text\" name=\"prix\" size=\"10\" maxlength=\"100\" value=\"".$itemsrow["buycost"]."\"/> ".$townrow3["monnaie"]."</div><br></td></tr>\n"; + $page .= "<tr valign=\"top\"><td width=\"110\"><div align=\"left\">Fin dans:</div></td><td><div align=\"left\"><select name=\"findans\"/><option value=\"1\">1</option><option value=\"10\">10</option><option value=\"30\">30</option></select> jour(s)<br><br><input type=\"submit\" name=\"submit\" value=\"Valider\" /> <input type=\"reset\" name=\"cancel\" value=\"Annuler\" /></div></td></tr>\n"; + $page .= "</table>\n"; + + + $title = "Mettre en enchère"; + display($page, $title); + +} + +function vente3($id) { // Update user profile with new item & stats. + +global $userrow; + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id'", "items"); + $itemsrow = mysql_fetch_array($itemsquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + $timeactuel = mktime(0,0,0,date("m") ,date("d"),date("Y") ); + $timefin = mktime(0,0,0,date("m") ,date("d") + $_POST['findans'] ,date("Y") ); + + $encheresquery = doquery("SELECT * FROM {{table}} WHERE proprietaire='".$userrow['charname']."'", "encheres"); + + //hop on fait une boucle pour parcourir tous les resultats au lieu d'un seul + while($encheresrow = mysql_fetch_array($encheresquery)){ + + if ($encheresrow["name"] == $itemsrow["name"] ){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous avez déja ajouté cet objet aux enchères.<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Chez le notaire"); die(); } + +} + + if (isset($_POST["cancel"])) { header("Location: index.php?do=encheres"); die(); } + + $prix = $_POST['prix'] ; + + if (isset($_POST['submit'])) { + + if ( empty($_POST['prix'])){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Votre enchère est innexistante. Veuillez recommencer!.<br><br>Maintenant vous pouvez:<br><br><a href=\"Javascript:history.go(-1)\">» retourner au formulaire d'enchère</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Ajouter un objet aux enchères"); die(); } + + else { + + $description = addslashes($itemsrow["description"]); + + $query = doquery("INSERT INTO {{table}} SET posttime='$timeactuel' , idobjet='".$itemsrow["id"]."', name='".$itemsrow["name"]."', datefin='$timefin', type='".$itemsrow["type"]."', buycost='$prix', attribute='".$itemsrow["attribute"]."', image='".$itemsrow["image"]."', special='".$itemsrow["special"]."', description='$description', proprietaire='".$userrow["charname"]."' ", "encheres"); + $title = "Ajouter un objet aux enchères"; + } + + } + + display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">".$row["name"]."Votre enchère a été validée. Elle est visible dans la liste des objets à vendre.<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Enchere ajouté"); + +} + +function afficheencheres () +{ //Fonction affichage des enchères. + + global $userrow, $numqueries, $controlrow; + + $encheresquery = doquery("SELECT * FROM {{table}} ORDER by id DESC LIMIT 20", "encheres"); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + $page = "<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Voici la liste des objets à vendre. Vous pouvez les encherir ou également revendre les votre en <a href=\"index.php?do=encheres\"><b>cliquant ici</b></a>.<br><br>Chaque objet est en vente sur une période déterminé par le vendeur. Si vous êtes la dernière personne à avoir encherit sur un objet, il sera placé sur votre compte.<br><br><br><img src=\"images/puce4.gif\"/> <span class=\"mauve1\"><b>La liste des objets à vendre:</b></span><br><br></td></tr></table><br>"; + $count = 1; + + if ( @mysql_num_rows($encheresquery) == 0 ) + { + $title = "Les enchères"; + $page .= "<table align=\"left\"><tr><td>Aucunes enchères</td></tr></table><br><br>"; + $page .= "<br><br><a href=\"index.php\">» Retour au sommaire</a>\n"; + } + + else + { + + while($row = mysql_fetch_array($encheresquery)) + { + + $timeactuel = date("d-m-Y", $row["posttime"]); + $timefin = date("d-m-Y", $row["datefin"] ); + $title = "Les enchères"; + + //debut + + + if ($row["posttime"] > $row["datefin"] ) + { + + $acheteurquery = doquery("SELECT * FROM {{table}} WHERE posttime>='".$row["datefin"]."'", "encheres"); + $acheteurrow = mysql_fetch_array($acheteurquery); + + $acheteurquery2 = doquery("SELECT * FROM {{table}} WHERE charname='".$acheteurrow["acheteur"]."'", "users"); + $acheteurrow2 = mysql_fetch_array($acheteurquery2); + + $acheteurquery3 = doquery("SELECT * FROM {{table}} WHERE charname='".$acheteurrow["proprietaire"]."'", "users"); + $acheteurrow3 = mysql_fetch_array($acheteurquery3); + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='".$acheteurrow["idobjet"]."' LIMIT 1", "items"); + $itemsrow = mysql_fetch_array($itemsquery); + + + if ($row["type"] == 1 and $row["acheteur"] != "Aucun" ) + { // weapon + + + if ($acheteurrow2["weaponid"] != 0) + { + + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$acheteurrow["idobjet"]."'", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + + } + else + { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") + // if ($itemsrow2["special"] != "Aucun" && $itemsrow2['special'] != '') + + { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $acheteurrow2[$tochange] = $acheteurrow2[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$acheteurrow2[$tochange]."',"; + if ($tochange == "strength") { $acheteurrow2["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $acheteurrow2["defensepower"] += $special[1]; } + } + + + if ($itemsrow2["special"] != "Aucun") + { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $acheteurrow2[$tochange2] = $acheteurrow2[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$acheteurrow2[$tochange2]."',"; + if ($tochange2 == "strength") { $acheteurrow2["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $acheteurrow2["defensepower"] -= $special2[1]; } + } + + // New stats. + $newattack2 = $acheteurrow3["attackpower"] - $itemsrow["attribute"] ; + $newgold2 = $acheteurrow3["gold"] + $acheteurrow["buycost"]; + $newname2 = "Aucun"; + $newid2 = 0; + $newgold = $acheteurrow2["gold"] - $acheteurrow["buycost"]; + $newattack = $acheteurrow2["attackpower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $acheteurrow2["id"]; + if ($acheteurrow2["currenthp"] > $acheteurrow2["maxhp"]) { $newhp = $acheteurrow2["maxhp"]; } + else { $newhp = $acheteurrow2["currenthp"]; } + if ($acheteurrow2["currentmp"] > $acheteurrow2["maxmp"]) { $newmp = $acheteurrow2["maxmp"]; } + else { $newmp = $acheteurrow2["currentmp"]; } + if ($acheteurrow2["currenttp"] > $acheteurrow2["maxtp"]) { $newtp = $acheteurrow2["maxtp"]; } + else { $newtp = $acheteurrow2["currenttp"]; } + + // Final update. + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', attackpower='$newattack', weaponid='$newid', weaponname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + $updatequery2 = doquery("UPDATE {{table}} SET gold='$newgold2', attackpower='$newattack2', weaponid='$newid2', weaponname='$newname2' WHERE charname='".$acheteurrow["proprietaire"]."'", "users"); + } + elseif ($itemsrow["type"] == 2 and $row["acheteur"] != "Aucun" ) + { // Armor + + // Check if they already have an item in the slot. + if ($acheteurrow2["armorid"] != 0) + { + + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$acheteurrow["idobjet"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + + } + else + { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") + { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $acheteurrow2[$tochange] = $acheteurrow2[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$acheteurrow2[$tochange]."',"; + if ($tochange == "strength") { $acheteurrow2["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $acheteurrow2["defensepower"] += $special[1]; } + } + if ($itemsrow2["special"] != "Aucun") + { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $acheteurrow2[$tochange2] = $acheteurrow2[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$acheteurrow2[$tochange2]."',"; + if ($tochange2 == "strength") { $acheteurrow2["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $acheteurrow2["defensepower"] -= $special2[1]; } + } + + // New stats. + $newdefense2 = $acheteurrow3["attackpower"] - $itemsrow["attribute"] ; + $newgold2 = $acheteurrow3["gold"] + $acheteurrow["buycost"]; + $newname2 = "Aucun"; + $newid2 = 0; + $newgold = $acheteurrow2["gold"] - $acheteurrow["buycost"]; + $newdefense = $acheteurrow2["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $acheteurrow2["id"]; + if ($acheteurrow2["currenthp"] > $acheteurrow2["maxhp"]) { $newhp = $acheteurrow2["maxhp"]; } + else { $newhp = $acheteurrow2["currenthp"]; } + if ($acheteurrow2["currentmp"] > $acheteurrow2["maxmp"]) { $newmp = $acheteurrow2["maxmp"]; } + else { $newmp = $acheteurrow2["currentmp"]; } + if ($acheteurrow2["currenttp"] > $acheteurrow2["maxtp"]) { $newtp = $acheteurrow2["maxtp"]; } + else { $newtp = $acheteurrow2["currenttp"]; } + + // Final update. + + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', armorid='$newid', armorname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + $updatequery2 = doquery("UPDATE {{table}} SET gold='$newgold2', defensepower='$newdefense2', armorid='$newid2', armorname='$newname2' WHERE charname='".$acheteurrow["proprietaire"]."'", "users"); + } + elseif ($itemsrow["type"] == 3 and $row["acheteur"] != "Aucun") + { // Shield + + // Check if they already have an item in the slot. + if ($acheteurrow2["shieldid"] != 0) + { + + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$acheteurrow["idobjet"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + + } + else + { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") + { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $acheteurrow2[$tochange] = $acheteurrow2[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$acheteurrow2[$tochange]."',"; + if ($tochange == "strength") { $acheteurrow2["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $acheteurrow2["defensepower"] += $special[1]; } + } + if ($itemsrow2["special"] != "Aucun") + { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $acheteurrow2[$tochange2] = $acheteurrow2[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$acheteurrow2[$tochange2]."',"; + if ($tochange2 == "strength") { $acheteurrow2["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $acheteurrow2["defensepower"] -= $special2[1]; } + } + + + // New stats. + $newdefense2 = $acheteurrow3["attackpower"] - $itemsrow["attribute"] ; + $newgold2 = $acheteurrow3["gold"] + $acheteurrow["buycost"]; + $newname2 = "Aucun"; + $newid2 = 0; + $newgold = $acheteurrow2["gold"] - $acheteurrow["buycost"]; + $newdefense = $acheteurrow2["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $acheteurrow2["id"]; + if ($acheteurrow2["currenthp"] > $acheteurrow2["maxhp"]) { $newhp = $acheteurrow2["maxhp"]; } + else { $newhp = $acheteurrow2["currenthp"]; } + if ($acheteurrow2["currentmp"] > $acheteurrow2["maxmp"]) { $newmp = $acheteurrow2["maxmp"]; } + else { $newmp = $acheteurrow2["currentmp"]; } + if ($acheteurrow2["currenttp"] > $acheteurrow2["maxtp"]) { $newtp = $acheteurrow2["maxtp"]; } + else { $newtp = $acheteurrow2["currenttp"]; } + + // Final update. + + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', shieldid='$newid', shieldname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + $updatequery2 = doquery("UPDATE {{table}} SET gold='$newgold2', defensepower='$newdefense2', shieldid='$newid2', shieldname='$newname2' WHERE charname='".$acheteurrow["proprietaire"]."'", "users"); + } + +// liste des destinataires du message +$adresse="".$acheteurrow2["email"].""; + +// titre du message : zone sujet +$sujet="".$controlrow["gamename"].": Vous avez un nouvel objet! "; + +// contenu du message +$corps="<html><body><font face=arial size=2>Suite à votre enchère, vous avez remporté cet objet: ".$acheteurrow["name"]."<br><br>A bientot sur ".$controlrow["gameurl"]."</font></body></html>"; + +// Création de l'entête du message +// cette entete contient l'email de l'expéditeur ainsi que l'email pour la réponse. +$entete="Content-type:text/html\nFrom:".$controlrow["adminemail"]."\r\nReply-To: +".$controlrow["adminemail"].""; + +// envoi du mail +mail ($adresse,$sujet,$corps,$entete); + +$texte = "Terminé"; + + } + +else { + +$texte = "<a href=\"index.php?do=encheres2:".$row["id"]."\">Enchérir</a>"; + + } + + + if ($count == 1) + { + $page .= "<table width=\"570\" cellspacing=\"0\" cellpadding=\"0\">"; + $page .= "<tr>"; + $page .= "<td width=\"540\" style=\"background-color: #FFE6F5;\" align=\"left\"><img src=\"images/puce3.gif\"/> <span class=\"marron4\"><b><a onmouseover=\"return overlib('" .addslashes(htmlspecialchars($row["description"])) ." ');\" onmouseout=\"return nd();\" href=\"javascript:void(0);\">".$row["name"]."</a></b> - ".$row["buycost"]." ".$townrow3["monnaie"]."</span><br><img src=images/blog/espace.gif height=\"3\"><br><span class=\"taille1\">Mise en vente le: ".$timeactuel." par ".$row["proprietaire"].". Fin le: ".$timefin.". Dernière enchère par: ".$row["acheteur"].".</span><br></td><td width=\"30\" style=\"background-color: #FFE6F5;\">".$texte."</td>"; + $page .= "</tr>"; + $page .= "</table><br>"; + $count = 2; + } + else + { + $page .= "<table width=\"570\" cellspacing=\"0\" cellpadding=\"0\">"; + $page .= "<tr>"; + $page .= "<td width=\"540\" style=\"background-color: #FFF2FA;\" align=\"left\"><img src=\"images/puce3.gif\"/> <span class=\"marron4\"><b><a onmouseover=\"return overlib('" .addslashes(htmlspecialchars($row["description"])) ." ');\" onmouseout=\"return nd();\" href=\"javascript:void(0);\">".$row["name"]."</a></b> - ".$row["buycost"]." ".$townrow3["monnaie"]."</span><br><img src=images/blog/espace.gif height=\"3\"><br><span class=\"taille1\">Mise en vente le: ".$timeactuel." par ".$row["proprietaire"].". Fin le: ".$timefin.". Dernière enchère par: ".$row["acheteur"].".</span></td><td width=\"30\" style=\"background-color: #FFF2FA;\">".$texte."</td>"; + $page .= "</tr>"; + $page .= "</table><br>"; + $count = 1; + } + } + $page .= "<br><br><a href=\"index.php\">» Retour au sommaire</a>\n"; + + $timeactuel = mktime(0,0,0,date("m") ,date("d"),date("Y") ); //postime actuel + + // efface toutes les lignes dans la table enchere avec une datefin plus grande que posttime + $updatequery3 = doquery("DELETE FROM {{table}} WHERE $timeactuel>datefin", "encheres"); + } + + + display($page, $title); +} + + +function encheres2($id) { // Confirm user's intent to purchase item. + + global $userrow, $numqueries; + + $encheresquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "encheres"); + $encheresrow = mysql_fetch_array($encheresquery); + + if ($userrow["charname"] == $encheresrow["proprietaire"] ) + { + display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous ne pouvez pas enchérir cet objet car vous êtes le vendeur.<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Encherir un objet"); + } + + if ($encheresrow["posttime"] > $encheresrow["datefin"] ) + { + $page .= "<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Cette enchère est terminée. L'objet a été remporté par ".$encheresrow["acheteur"].".<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>\n"; + }else{ + + $page = "<form enctype=\"multipart/form-data\" action=\"index.php?do=encheres3:$id\" method=\"post\">\n"; + $page .= "<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous allez encherir l'objet nommé ".$encheresrow["name"].".<br></td></tr></table>\n"; + $page .= "<table width=\"380\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" valign=\"top\">\n"; + $page .= "<br><br><b><img src=\"images/puce4.gif\" /> <span class=\"mauve1\">Formulaire d'enchère:</span></b><br><br><br>\n"; + $page .= "<tr valign=\"top\"><td width=\"110\"><div align=\"left\">Votre prix:</div></td><td><div align=\"left\"><input type=\"text\" name=\"enchere\" size=\"10\" maxlength=\"100\" value=\"".$encheresrow["buycost"]."\"/> ".$townrow3["monnaie"]."<br><br><input type=\"submit\" name=\"submit\" value=\"Valider\" /> <input type=\"reset\" name=\"cancel\" value=\"Annuler\" /></div></td></tr>\n"; + $page .= "</table>\n"; + $page .= "<br><br><a href=\"index.php\">» Retour au sommaire</a>\n"; + + + $title = "Encherir un objet"; +} + display($page, $title); + +} + +function encheres3($id) { // Update user profile with new item & stats. + + $encheresquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "encheres"); + $encheresrow = mysql_fetch_array($encheresquery); + + if (isset($_POST["cancel"])) { header("Location: index.php?do=afficheencheres"); die(); } + + global $userrow; + + if (isset($_POST['submit'])) { + + if ($userrow["bank"] > 0){ + $texte = "Vous possédez ".$userrow["bank"]." ".$townrow3["monnaie"]." en banque. Si vous souhaitez les retirer <a href=\"index.php?do=bank\">cliquez ici</a>"; + } else{ + $texte = "Malheuresement vous ne possédez rien sur votre compte en banque. Par conséquent il vous faut attendre, pour faire une enchère sur cet objet"; + } + + if ($userrow["gold"] < $_POST['enchere'] ){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Vous n'avez pas assez d'argent sur votre compte. Votre enchère ne peut dépasser ".$userrow["gold"]." ".$townrow3["monnaie"].".<br><br>".$texte.".<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Erreur d'enchère"); die(); } + + if ( empty($_POST['enchere'])){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Votre enchère est innexistante. Veuillez recommencer!.<br><br>Maintenant vous pouvez:<br><br><a href=\"Javascript:history.go(-1)\">» retourner au formulaire d'enchère</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Enchérir un objet"); die(); } + if ($_POST['enchere'] <= $encheresrow["buycost"] ){ display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Votre enchère est inférieure à celle déja proposé. Vous devez inscrire une enchère surpérieure à ".$encheresrow["buycost"].".<br><br>Maintenant vous pouvez:<br><br><a href=\"Javascript:history.go(-1)\">» retourner au formulaire d'enchère</a><br><a href=\"index.php?do=afficheencheres\">» retourner dans la salle d'enchères</a></td></tr></table>", "Enchérir un objet"); die(); } + +else { + + $query = doquery("UPDATE {{table}} SET buycost='".$_POST['enchere']."', acheteur='".$userrow['charname']."' WHERE id='".$encheresrow["id"]."'", "encheres"); + + $title = "Enchere ajouté"; + } + + } + + display("<table height=\"1\"><tr><td><img src=\"images/lesencheres.jpg\"/></td></tr></table><br><table width=\"380\"><tr><td align=\"left\">Votre enchère a été validée. Elle est visible dans la liste des objets à vendre.<br><br>Maintenant vous pouvez :<br><br><a href=\"index.php\">» retourner à la ville</a></td></tr></table>", "Enchere ajouté"); + +} + + + + +?> +\ No newline at end of file diff --git a/explore.php b/explore.php @@ -1,37 +1,216 @@ -<?php // explore.php :: Handles all map exploring, chances to fight, etc. - -function move() { - - global $userrow, $controlrow; - - if ($userrow["currentaction"] == "Fighting") { header("Location: index.php?do=fight"); die(); } - - $latitude = $userrow["latitude"]; - $longitude = $userrow["longitude"]; - if (isset($_POST["north"])) { $latitude++; if ($latitude > $controlrow["gamesize"]) { $latitude = $controlrow["gamesize"]; } } - if (isset($_POST["south"])) { $latitude--; if ($latitude < ($controlrow["gamesize"]*-1)) { $latitude = ($controlrow["gamesize"]*-1); } } - if (isset($_POST["east"])) { $longitude++; if ($longitude > $controlrow["gamesize"]) { $longitude = $controlrow["gamesize"]; } } - if (isset($_POST["west"])) { $longitude--; if ($longitude < ($controlrow["gamesize"]*-1)) { $longitude = ($controlrow["gamesize"]*-1); } } - - $townquery = doquery("SELECT id FROM {{table}} WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1", "towns"); - if (mysql_num_rows($townquery) > 0) { - $townrow = mysql_fetch_array($townquery); - include('towns.php'); - travelto($townrow["id"], false); - die(); - } - - $chancetofight = rand(1,5); - if ($chancetofight == 1) { - $action = "currentaction='Fighting', currentfight='1',"; - } else { - $action = "currentaction='Exploring',"; - } - - - $updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - header("Location: index.php"); - +<?php // explore.php :: Déplacements et actions en cours "Actuellement". + +function move() { + + global $userrow, $controlrow; + + if ($userrow["currentaction"] == "En combat") { header("Location: index.php?do=fight"); die(); } + + $latitude = $userrow["latitude"]; + $longitude = $userrow["longitude"]; + if (isset($_POST["north_x"])) { $latitude++; if ($latitude > $controlrow["gamesize"]) { $latitude = $controlrow["gamesize"]; } } + if (isset($_POST["south_x"])) { $latitude--; if ($latitude < ($controlrow["gamesize"]*-1)) { $latitude = ($controlrow["gamesize"]*-1); } } + if (isset($_POST["east_x"])) { $longitude++; if ($longitude > $controlrow["gamesize"]) { $longitude = $controlrow["gamesize"]; } } + if (isset($_POST["west_x"])) { $longitude--; if ($longitude < ($controlrow["gamesize"]*-1)) { $longitude = ($controlrow["gamesize"]*-1); } } + + $townquery = doquery("SELECT id FROM {{table}} WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1", "towns"); + if (mysql_num_rows($townquery) > 0) { + $townrow = mysql_fetch_array($townquery); + include('towns.php'); + travelto($townrow["id"], false); + die(); + } + + $homequery = doquery("SELECT id FROM {{table}} WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1", "maison"); + if (mysql_num_rows($homequery) > 0) { + $homerow = mysql_fetch_array($homequery); + include('home.php'); + travelto($homerow["id"], false); + die(); + } + + $solquery = doquery("SELECT id FROM {{table}} WHERE nom='arbre' AND lati='$latitude' AND longi='$longitude' LIMIT 1", "sol"); + if (mysql_num_rows($solquery) > 0) { + $page = " Vous ne pouvez pas continuer dans cette direction!<br>Utilisez les touches de navigation pour repartir a l 'aventure.<br></center><a href='index.php'> Revenir en arriere</a></table>"; + display($page, "Passage fermer"); + die(); + } + + $solquery = doquery("SELECT id FROM {{table}} WHERE nom='mer' AND lati='$latitude' AND longi='$longitude' LIMIT 1", "sol"); + if (mysql_num_rows($solquery) > 0) { + $page = " Vous ne pouvez pas continuer dans cette direction!<br>Utilisez les touches de navigation pour repartir a l 'aventure.<br></center><a href='index.php'> Revenir en arriere</a></table>"; + display($page, "Passage fermer"); + die(); + } + + //AJOUT QUETE TYPE RECHERCHE (2) : Trouver un endroit + $requete=mysql_query("select quete from rpg_users where id='".$userrow["id"]."'"); + while($row=mysql_fetch_array($requete)) {$quete_en_cours=$row[0];} + if($quete_en_cours>0) + { + $requete=mysql_query("select * from rpg_quete WHERE id='$quete_en_cours'"); + while($row=mysql_fetch_array($requete)) + { + if($row[4] == '2') //C bien une quete de recherche + { + //On verifie si on est au bon endroit + if($latitude==$row[8] AND $longitude==$row[7]) + { + $page = "Vous avez résolu la quête nommée $row[1] ! Félicitation. Vous gagnez :<br>"; + $page .= "$row[10] points d'Expérience et $row[11] Gils !"; + $requete1=mysql_query("SELECT listquest FROM rpg_users WHERE id='".$userrow["id"]."'"); + while($reque=mysql_fetch_array($requete1)) {$prev=$reque[0]; } + mysql_query("UPDATE rpg_users SET experience=experience+$row[10], gold=gold+$row[11], quete='0',listquest='" . $prev ."," .$quete_en_cours ."' WHERE id='".$userrow["id"]."'"); + display($page, "Quête Résolue"); + die(); + } + } + } + } + //FIN AJOUT + + $chancetofight = rand(1,5); + if ($chancetofight == 1) { + $action = "currentaction='En combat', currentfight='1',"; + } else { + $action = "currentaction='En exploration',"; + } + + + $updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php"); + + +} + +Function cherche() { + +global $userrow; + +if ($userrow["itemsac3qt"] < 1 ) { display("<br><center>Vous n'avez plus de Pioches, retournez en acheter en Ville pour pouvoir creuser.</center><br><br> +<center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } +if ($userrow["currenttp"] < 10 ) { display("<br><center>Vous etez trop fatigués pour continuer, rentrez vous reposer.....</center><br><br> +<center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } + +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +$action = "currentaction='En exploration',"; +$pioche = $userrow["itemsac3qt"] - 1; +$chancetrouve = rand(1,25); +$nbrobj = rand(1,2); +if ($chancetrouve == 1 || $chancetrouve == 2 || $chancetrouve == 3 || $chancetrouve == 4 || $chancetrouve == 5) { +doquery("UPDATE {{table}} SET itemsac3qt=itemsac3qt-1, currenttp=currenttp-10, cuivre=cuivre+$nbrobj WHERE id=".$userrow["id"], "users"); // Mise a jour de la variable cuivre. +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); // Update position. +$page = "<br><br> Vos efforts sont récompensés. En creusant vous venez de trouvez $nbrobj Minerais de Cuivre!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output + +display($page, "Vous venez de trouver du cuivre!"); +die(); + +} else if ($chancetrouve == 6 || $chancetrouve == 7 || $chancetrouve == 8 || $chancetrouve == 9 ) { +doquery("UPDATE {{table}} SET itemsac3qt=itemsac3qt-1, currenttp=currenttp-10, fer=fer+$nbrobj WHERE id=".$userrow["id"], "users"); // Mise a jour de la variable fer. +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); // Update position. +$page = "<br><br> Vos efforts sont récompensés. En creusant vous venez de trouvez $nbrobj Minerais de Fer!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output + +display($page, "Vous venez de trouver du fer!"); +die(); + +} else if ($chancetrouve == 10 || $chancetrouve == 11 || $chancetrouve == 12 ) { +doquery("UPDATE {{table}} SET itemsac3qt=itemsac3qt-1, currenttp=currenttp-10, argent=argent+$nbrobj WHERE id=".$userrow["id"], "users"); // Mise a jour de la variable argent. +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); // Update position. +$page = "<br><br> Vos efforts sont récompensés. En creusant vous venez de trouvez $nbrobj Minerais d'argent!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output + +display($page, "Vous venez de trouver de l'argent!"); +die(); + +} else if ($chancetrouve == 15 ) { +doquery("UPDATE {{table}} SET itemsac3qt=itemsac3qt-1, currenttp=currenttp-10, platine=platine+$nbrobj WHERE id=".$userrow["id"], "users"); // Mise a jour de la variable bronze. +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); // Update position. +$page = "<br><br> Vos efforts sont récompensés. En creusant vous venez de trouvez $nbrobj Platine!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output + +display($page, "Vous venez de trouver du Platine!"); +die(); +} else { +display("<br><br> Désolé, vous ne trouvez rien!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } + +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); + +} + + +function potionsoins() { + +global $userrow; + +if ($userrow["itemsac1qt"] < 1 ) { display("<br><center>Vous n'avez plus de potions de soins , retournez en acheter en Ville pour pouvoir vous soigner.</center><br><br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } + +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +$action = "currentaction='En exploration',"; +$potion = $userrow["maxhp"] / 2; + +$newhp = $userrow["currenthp"] + $potion; +if ($userrow["maxhp"] < $newhp) { $potion = $userrow["maxhp"] - $userrow["currenthp"]; +$newhp = $userrow["currenthp"] + $potion; } + +doquery("UPDATE {{table}} SET itemsac1qt=itemsac1qt-1, currenthp=$newhp WHERE id=".$userrow["id"], "users"); +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous buvez la potion et sentez ses effets sur votre corp. Vous venez de reccuperez $potion de Points de vie!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output + +display($page, "Vous buvez une potion de soins!"); +die(); + +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} + +function nourriture() { + +global $userrow; + +if ($userrow["itemsac6qt"] < 1 ) { display("<br><center>Vous n'avez plus de provisions sur vous , retournez en acheter en Ville pour pouvoir manger.</center><br><br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } + +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +$action = "currentaction='En exploration',"; +$pomme = $userrow["level"] * 5; + +$newhp = $userrow["currenthp"] + $pomme; +if ($userrow["maxhp"] < $newhp) { $pomme = $userrow["maxhp"] - $userrow["currenthp"]; +$newhp = $userrow["currenthp"] + $pomme; } + +doquery("UPDATE {{table}} SET itemsac6qt=itemsac6qt-1, currenthp=$newhp WHERE id=".$userrow["id"], "users"); +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous manger un peu et vous sentez un peu mieux. Vous venez de reccuperez $pomme de Points de vie!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output +display($page, "Vous buvez une potion de soins!"); +die(); + +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); } +function potiontp() { + +global $userrow; + +if ($userrow["itemsac5qt"] < 1 ) { display("<br><center>Vous n'avez plus de potion sur vous , retournez en acheter en Ville pour pouvoir recuperer vos TP</center><br><br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>", "Chercher"); die(); } + +$latitude = $userrow["latitude"]; +$longitude = $userrow["longitude"]; +$action = "currentaction='En exploration',"; +$pomme = $userrow["level"] * 5; + +$newtp = $userrow["currenttp"] + $pomme; +if ($userrow["maxtp"] < $newtp) { $pomme = $userrow["maxtp"] - $userrow["currenttp"]; +$newtp = $userrow["currenttp"] + $pomme; } + +doquery("UPDATE {{table}} SET itemsac5qt=itemsac5qt-1, currenttp=$newtp WHERE id=".$userrow["id"], "users"); +doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<br><br>Vous manger un peu et vous sentez un peu mieux. Vous venez de reccuperez $pomme de Points de vie!<br><center>Retournez sur la <a href=\"index.php\">Carte</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; // Output +display($page, "Vous buvez une potion de soins!"); +die(); + +$updatequery = doquery("UPDATE {{table}} SET $action latitude='$latitude', longitude='$longitude', dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +header("Location: index.php"); +} ?> \ No newline at end of file diff --git a/fight.php b/fight.php @@ -1,539 +1,593 @@ -<?php // fight.php :: Handles all fighting action. +<?php // fight.php :: Les fonctions essentielles aux combats. + +function fight() { // One big long function that determines the outcome of the fight. + + global $userrow, $controlrow; + $pagearray = array(); + $playerisdead = 0; + + $pagearray["magiclist"] = ""; + $userspells = explode(",",$userrow["spells"]); + $spellquery = doquery("SELECT id,name FROM {{table}}", "spells"); + while ($spellrow = mysql_fetch_array($spellquery)) { + $spell = false; + foreach ($userspells as $a => $b) { + if ($b == $spellrow["id"]) { $spell = true; } + } + if ($spell == true) { + $pagearray["magiclist"] .= "<option value=\"".$spellrow["id"]."\">".$spellrow["name"]."</option>\n"; + } + unset($spell); + } + if ($pagearray["magiclist"] == "") { $pagearray["magiclist"] = "<option value=\"0\">Aucun</option>\n"; } + $magiclist = $pagearray["magiclist"]; + + $chancetoswingfirst = 1; + + // First, check to see if we need to pick a monster. + if ($userrow["currentfight"] == 1) { + + if ($userrow["latitude"] < 0) { $userrow["latitude"] *= -1; } // Equalize negatives. + if ($userrow["longitude"] < 0) { $userrow["longitude"] *= -1; } // Ditto. + $maxlevel = floor(max($userrow["latitude"]+5, $userrow["longitude"]+5) / 5); // One mlevel per five spaces. + if ($maxlevel < 1) { $maxlevel = 1; } + $minlevel = $maxlevel - 2; + if ($minlevel < 1) { $minlevel = 1; } + + + // Pick a monster. + $monsterquery = doquery("SELECT * FROM {{table}} WHERE level>='$minlevel' AND level<='$maxlevel' ORDER BY RAND() LIMIT 1", "monsters"); + $monsterrow = mysql_fetch_array($monsterquery); + $userrow["currentmonster"] = $monsterrow["id"]; + $userrow["currentmonsterhp"] = rand((($monsterrow["maxhp"]/5)*4),$monsterrow["maxhp"]); + if ($userrow["difficulty"] == 2) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff3mod"]); } + $userrow["currentmonstersleep"] = 0; + $userrow["currentmonsterimmune"] = $monsterrow["immune"]; + + $chancetoswingfirst = rand(1,10) + ceil(sqrt($userrow["dexterity"])); + if ($chancetoswingfirst > (rand(1,7) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetoswingfirst = 1; } else { $chancetoswingfirst = 0; } + + unset($monsterquery); + unset($monsterrow); + + } + + // Next, get the monster statistics. + $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); + $monsterrow = mysql_fetch_array($monsterquery); + $pagearray["monstername"] = $monsterrow["name"]; + $pagearray["image"] = $monsterrow["image"]; + $pagearray["immunecontre"] = $monsterrow["immunecontre"]; + $pagearray["image2"] = $userrow["avatar"]; + +// Do run stuff. + if (isset($_POST["run"])) { + + $chancetorun = rand(4,10) + ceil(sqrt($userrow["dexterity"])); + if ($chancetorun > (rand(1,5) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetorun = 1; } else { $chancetorun = 0; } + + if ($chancetorun == 0) { + $pagearray["yourturn"] = "Vous avez essayé de prendre la fuite, mais avez été bloqués par l'avant!<br /><br />"; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + } + + $updatequery = doquery("UPDATE {{table}} SET currentaction='En exploration' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php"); + die(); + + // Do fight stuff. + } elseif (isset($_POST["fight"])) { + + // Your turn. + $pagearray["yourturn"] = ""; + $tohit = ceil(rand($userrow["attackpower"]*.75,$userrow["attackpower"])/3); + $toexcellent = rand(1,150); + if ($toexcellent <= sqrt($userrow["strength"])) { $tohit *= 2; $pagearray["yourturn"] .= "Excellent hit!<br />"; } + $toblock = ceil(rand($monsterrow["armor"]*.75,$monsterrow["armor"])/3); + $tododge = rand(1,200); + if ($tododge <= sqrt($monsterrow["armor"])) { + $tohit = 0; $pagearray["yourturn"] .= "Le monstre à esquivé votre attaque. Aucun dommage n'a été constaté.<br />"; + $monsterdamage = 0; + } else { + $monsterdamage = $tohit - $toblock; + if ($monsterdamage < 1) { $monsterdamage = 1; } + if ($userrow["currentuberdamage"] != 0) { + $monsterdamage += ceil($monsterdamage * ($userrow["currentuberdamage"]/100)); + } + } + $pagearray["yourturn"] .= "Votre attaque sur le monstre a accasionné $monsterdamage points de dommage sur lui.<br /><br />"; + $userrow["currentmonsterhp"] -= $monsterdamage; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + + $pagearray["level"] = $userrow["level"] . "<br /><br />"; + if ($userrow["currentmonsterhp"] <= 0) { + $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php?do=victory"); + die(); + } + + // Monster's turn. + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + // Do spell stuff. + } elseif (isset($_POST["spell"])) { + + // Your turn. + $pickedspell = $_POST["userspell"]; + if ($pickedspell == 0) { display("Vous devez tout d'abord choisir un sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + + $newspellquery = doquery("SELECT * FROM {{table}} WHERE id='$pickedspell' LIMIT 1", "spells"); + $newspellrow = mysql_fetch_array($newspellquery); + $spell = false; + foreach($userspells as $a => $b) { + if ($b == $pickedspell) { $spell = true; } + } + if ($pickedspell != true) { display("Vous n'avez pas encore appris ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + if ($userrow["currentmp"] < $newspellrow["mp"]) { display("Vous n'avez pas assez de points de magie pour éxécuter ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + + if ($newspellrow["type"] == 1) { // Heal spell. + $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; + if ($userrow["maxhp"] < $newhp) { $newspellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; } + $userrow["currenthp"] = $newhp; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "En éxécutant le sort ".$newspellrow["name"]." , vous avez gagné ".$newspellrow["attribute"]." points hit.<br /><br />"; + } elseif ($newspellrow["type"] == 2) { // Hurt spell. + if ($userrow["currentmonsterimmune"] == 0) { + $monsterdamage = rand((($newspellrow["attribute"]/6)*5), $newspellrow["attribute"]); + $userrow["currentmonsterhp"] -= $monsterdamage; + $pagearray["yourturn"] = "En éxécutant le sort".$newspellrow["name"]." , vous avez fait $monsterdamage points de dommage sur le monstre.<br /><br />"; + } else { + $pagearray["yourturn"] = "Vous avez éxécuté le sort".$newspellrow["name"]." , mais le monstre est immunisé contre ca.<br /><br />"; + } + $userrow["currentmp"] -= $newspellrow["mp"]; + } elseif ($newspellrow["type"] == 3) { // Sleep spell. + if ($userrow["currentmonsterimmune"] != 2) { + $userrow["currentmonstersleep"] = $newspellrow["attribute"]; + $pagearray["yourturn"] = "En éxécutant le sort ".$newspellrow["name"]." , le montre s'est endormi.<br /><br />"; + } else { + $pagearray["yourturn"] = "Vous avez éxécuté le sort ".$newspellrow["name"]." , mais le monstre est immunisé contre ca.<br /><br />"; + } + $userrow["currentmp"] -= $newspellrow["mp"]; + } elseif ($newspellrow["type"] == 4) { // +Damage spell. + $userrow["currentuberdamage"] = $newspellrow["attribute"]; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "Vous avez éxécuté le sort ".$newspellrow["name"]." , et vous avez eu ".$newspellrow["attribute"]."% de dommage sur vous.<br /><br />"; + } elseif ($newspellrow["type"] == 5) { // +Defense spell. + $userrow["currentuberdefense"] = $newspellrow["attribute"]; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "Vous avez éxécuté le sort".$newspellrow["name"]." , et vous avez gagné ".$newspellrow["attribute"]."% de défense à la fin de ce combat.<br /><br />"; + } + + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + +if ($userrow["currentmonsterhp"] <= 0) { + $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php?do=victory"); + die(); + } + + // Monster's turn. + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + if ($tohit <= $toblock) { $tohit = $toblock + 1; } + $persondamage = $tohit - $toblock; + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + // Do a monster's turn if person lost the chance to swing first. Serves him right! + } elseif ( $chancetoswingfirst == 0 ) { + $pagearray["yourturn"] = "Le monstre attaque avant que vous soyez prêt!<br /><br />"; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + +$pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivez l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + } else { + $pagearray["yourturn"] = ""; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . "";$pagearray["monsterturn"] = ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + +} + + $newmonster = $userrow["currentmonster"]; + + $newmonsterhp = $userrow["currentmonsterhp"]; + $newmonstersleep = $userrow["currentmonstersleep"]; + $newmonsterimmune = $userrow["currentmonsterimmune"]; + $newuberdamage = $userrow["currentuberdamage"]; + $newuberdefense = $userrow["currentuberdefense"]; + $newfight = $userrow["currentfight"] + 1; + $newhp = $userrow["currenthp"]; + $newmp = $userrow["currentmp"]; + +if ($playerisdead != 1) { +$pagearray["command"] = <<<END +Que voulez vous faire?<br /><br /> +<form action="index.php?do=fight" method="post"> +<img src=./images/pic2.gif /> <input type="submit" name="fight" value="Attaquer" /><br /><br /> +<img src=./images/pic2.gif /><select name="userspell"><option value="0">Les Sorts</option>$magiclist</select><input type="submit" name="spell" value="Exécuter" /><br /><br /> +<img src=./images/pic2.gif /> <input type="submit" name="run" value="Fuir le combat" /><br /><br /> +</form> +END; + $updatequery = doquery("UPDATE {{table}} SET currentaction='En combat',currenthp='$newhp',currentmp='$newmp',currentfight='$newfight',currentmonster='$newmonster',currentmonsterhp='$newmonsterhp',currentmonstersleep='$newmonstersleep',currentmonsterimmune='$newmonsterimmune',currentuberdamage='$newuberdamage',currentuberdefense='$newuberdefense' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +} else { + $pagearray["command"] = "<b>Vous êtes mort.</b><br /><br />En conséquence, vous avez perdu la moitié de vos gils. Cependant, vous avez gardé une partie de vos points hit, pour continuer votre voyage.<br /><br />Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>, et nous espéront que vous ferez mieux la prochaine fois."; +} + + // Finalize page and display it. + $template = gettemplate("fight"); + $page = parsetemplate($template,$pagearray); + + display($page, "En combat"); + +} + +function victory() { -function fight() { // One big long function that determines the outcome of the fight. - - global $userrow, $controlrow; - $pagearray = array(); - $playerisdead = 0; - - $pagearray["magiclist"] = ""; - $userspells = explode(",",$userrow["spells"]); - $spellquery = doquery("SELECT id,name FROM {{table}}", "spells"); - while ($spellrow = mysql_fetch_array($spellquery)) { - $spell = false; - foreach ($userspells as $a => $b) { - if ($b == $spellrow["id"]) { $spell = true; } - } - if ($spell == true) { - $pagearray["magiclist"] .= "<option value=\"".$spellrow["id"]."\">".$spellrow["name"]."</option>\n"; - } - unset($spell); - } - if ($pagearray["magiclist"] == "") { $pagearray["magiclist"] = "<option value=\"0\">None</option>\n"; } - $magiclist = $pagearray["magiclist"]; - - $chancetoswingfirst = 1; +global $userrow, $controlrow; - // First, check to see if we need to pick a monster. - if ($userrow["currentfight"] == 1) { - - if ($userrow["latitude"] < 0) { $userrow["latitude"] *= -1; } // Equalize negatives. - if ($userrow["longitude"] < 0) { $userrow["longitude"] *= -1; } // Ditto. - $maxlevel = floor(max($userrow["latitude"]+5, $userrow["longitude"]+5) / 5); // One mlevel per five spaces. - if ($maxlevel < 1) { $maxlevel = 1; } - $minlevel = $maxlevel - 2; - if ($minlevel < 1) { $minlevel = 1; } - - - // Pick a monster. - $monsterquery = doquery("SELECT * FROM {{table}} WHERE level>='$minlevel' AND level<='$maxlevel' ORDER BY RAND() LIMIT 1", "monsters"); - $monsterrow = mysql_fetch_array($monsterquery); - $userrow["currentmonster"] = $monsterrow["id"]; - $userrow["currentmonsterhp"] = rand((($monsterrow["maxhp"]/5)*4),$monsterrow["maxhp"]); - if ($userrow["difficulty"] == 2) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff3mod"]); } - $userrow["currentmonstersleep"] = 0; - $userrow["currentmonsterimmune"] = $monsterrow["immune"]; - - $chancetoswingfirst = rand(1,10) + ceil(sqrt($userrow["dexterity"])); - if ($chancetoswingfirst > (rand(1,7) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetoswingfirst = 1; } else { $chancetoswingfirst = 0; } - - unset($monsterquery); - unset($monsterrow); - - } - - // Next, get the monster statistics. - $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); - $monsterrow = mysql_fetch_array($monsterquery); - $pagearray["monstername"] = $monsterrow["name"]; - - // Do run stuff. - if (isset($_POST["run"])) { +if ($userrow["currentmonsterhp"] != 0) { header("Location: index.php?do=fight"); die(); } +if ($userrow["currentfight"] == 0) { header("Location: index.php"); die(); } - $chancetorun = rand(4,10) + ceil(sqrt($userrow["dexterity"])); - if ($chancetorun > (rand(1,5) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetorun = 1; } else { $chancetorun = 0; } - - if ($chancetorun == 0) { - $pagearray["yourturn"] = "You tried to run away, but were blocked in front!<br /><br />"; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br /><br />"; - $pagearray["monsterturn"] = ""; - if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. - $chancetowake = rand(1,15); - if ($chancetowake > $userrow["currentmonstersleep"]) { - $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.<br />"; - } else { - $pagearray["monsterturn"] .= "The monster is still asleep.<br />"; - } - } - if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. - $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); - if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } - $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); - $tododge = rand(1,150); - if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.<br />"; - $persondamage = 0; - } else { - $persondamage = $tohit - $toblock; - if ($persondamage < 1) { $persondamage = 1; } - if ($userrow["currentuberdefense"] != 0) { - $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); - } - if ($persondamage < 1) { $persondamage = 1; } - } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.<br /><br />"; - $userrow["currenthp"] -= $persondamage; - if ($userrow["currenthp"] <= 0) { - $newgold = ceil($userrow["gold"]/2); - $newhp = ceil($userrow["maxhp"]/4); - $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $playerisdead = 1; - } - } - } +$monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); +$monsterrow = mysql_fetch_array($monsterquery); - $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - header("Location: index.php"); - die(); - - // Do fight stuff. - } elseif (isset($_POST["fight"])) { - - // Your turn. - $pagearray["yourturn"] = ""; - $tohit = ceil(rand($userrow["attackpower"]*.75,$userrow["attackpower"])/3); - $toexcellent = rand(1,150); - if ($toexcellent <= sqrt($userrow["strength"])) { $tohit *= 2; $pagearray["yourturn"] .= "Excellent hit!<br />"; } - $toblock = ceil(rand($monsterrow["armor"]*.75,$monsterrow["armor"])/3); - $tododge = rand(1,200); - if ($tododge <= sqrt($monsterrow["armor"])) { - $tohit = 0; $pagearray["yourturn"] .= "The monster is dodging. No damage has been scored.<br />"; - $monsterdamage = 0; - } else { - $monsterdamage = $tohit - $toblock; - if ($monsterdamage < 1) { $monsterdamage = 1; } - if ($userrow["currentuberdamage"] != 0) { - $monsterdamage += ceil($monsterdamage * ($userrow["currentuberdamage"]/100)); - } - } - $pagearray["yourturn"] .= "You attack the monster for $monsterdamage damage.<br /><br />"; - $userrow["currentmonsterhp"] -= $monsterdamage; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br /><br />"; - if ($userrow["currentmonsterhp"] <= 0) { - $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - header("Location: index.php?do=victory"); - die(); - } - - // Monster's turn. - $pagearray["monsterturn"] = ""; - if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. - $chancetowake = rand(1,15); - if ($chancetowake > $userrow["currentmonstersleep"]) { - $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.<br />"; - } else { - $pagearray["monsterturn"] .= "The monster is still asleep.<br />"; - } - } - if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. - $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); - if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } - $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); - $tododge = rand(1,150); - if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.<br />"; - $persondamage = 0; - } else { - $persondamage = $tohit - $toblock; - if ($persondamage < 1) { $persondamage = 1; } - if ($userrow["currentuberdefense"] != 0) { - $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); - } - if ($persondamage < 1) { $persondamage = 1; } - } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.<br /><br />"; - $userrow["currenthp"] -= $persondamage; - if ($userrow["currenthp"] <= 0) { - $newgold = ceil($userrow["gold"]/2); - $newhp = ceil($userrow["maxhp"]/4); - $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $playerisdead = 1; - } - } - - // Do spell stuff. - } elseif (isset($_POST["spell"])) { - - // Your turn. - $pickedspell = $_POST["userspell"]; - if ($pickedspell == 0) { display("You must select a spell first. Please go back and try again.", "Error"); die(); } - - $newspellquery = doquery("SELECT * FROM {{table}} WHERE id='$pickedspell' LIMIT 1", "spells"); - $newspellrow = mysql_fetch_array($newspellquery); - $spell = false; - foreach($userspells as $a => $b) { - if ($b == $pickedspell) { $spell = true; } - } - if ($pickedspell != true) { display("You have not yet learned this spell. Please go back and try again.", "Error"); die(); } - if ($userrow["currentmp"] < $newspellrow["mp"]) { display("You do not have enough Magic Points to cast this spell. Please go back and try again.", "Error"); die(); } - - if ($newspellrow["type"] == 1) { // Heal spell. - $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; - if ($userrow["maxhp"] < $newhp) { $newspellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; } - $userrow["currenthp"] = $newhp; - $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and gained ".$newspellrow["attribute"]." Hit Points.<br /><br />"; - } elseif ($newspellrow["type"] == 2) { // Hurt spell. - if ($userrow["currentmonsterimmune"] == 0) { - $monsterdamage = rand((($newspellrow["attribute"]/6)*5), $newspellrow["attribute"]); - $userrow["currentmonsterhp"] -= $monsterdamage; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell for $monsterdamage damage.<br /><br />"; - } else { - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.<br /><br />"; - } - $userrow["currentmp"] -= $newspellrow["mp"]; - } elseif ($newspellrow["type"] == 3) { // Sleep spell. - if ($userrow["currentmonsterimmune"] != 2) { - $userrow["currentmonstersleep"] = $newspellrow["attribute"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell. The monster is asleep.<br /><br />"; - } else { - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, but the monster is immune to it.<br /><br />"; - } - $userrow["currentmp"] -= $newspellrow["mp"]; - } elseif ($newspellrow["type"] == 4) { // +Damage spell. - $userrow["currentuberdamage"] = $newspellrow["attribute"]; - $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% damage until the end of this fight.<br /><br />"; - } elseif ($newspellrow["type"] == 5) { // +Defense spell. - $userrow["currentuberdefense"] = $newspellrow["attribute"]; - $userrow["currentmp"] -= $newspellrow["mp"]; - $pagearray["yourturn"] = "You have cast the ".$newspellrow["name"]." spell, and will gain ".$newspellrow["attribute"]."% defense until the end of this fight.<br /><br />"; - } - - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br /><br />"; - if ($userrow["currentmonsterhp"] <= 0) { - $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - header("Location: index.php?do=victory"); - die(); - } - - // Monster's turn. - $pagearray["monsterturn"] = ""; - if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. - $chancetowake = rand(1,15); - if ($chancetowake > $userrow["currentmonstersleep"]) { - $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.<br />"; - } else { - $pagearray["monsterturn"] .= "The monster is still asleep.<br />"; - } - } - if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. - $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); - if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } - $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); - $tododge = rand(1,150); - if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.<br />"; - $persondamage = 0; - } else { - if ($tohit <= $toblock) { $tohit = $toblock + 1; } - $persondamage = $tohit - $toblock; - if ($userrow["currentuberdefense"] != 0) { - $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); - } - if ($persondamage < 1) { $persondamage = 1; } - } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.<br /><br />"; - $userrow["currenthp"] -= $persondamage; - if ($userrow["currenthp"] <= 0) { - $newgold = ceil($userrow["gold"]/2); - $newhp = ceil($userrow["maxhp"]/4); - $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $playerisdead = 1; - } - } - - // Do a monster's turn if person lost the chance to swing first. Serves him right! - } elseif ( $chancetoswingfirst == 0 ) { - $pagearray["yourturn"] = "The monster attacks before you are ready!<br /><br />"; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br /><br />"; - $pagearray["monsterturn"] = ""; - if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. - $chancetowake = rand(1,15); - if ($chancetowake > $userrow["currentmonstersleep"]) { - $userrow["currentmonstersleep"] = 0; - $pagearray["monsterturn"] .= "The monster has woken up.<br />"; - } else { - $pagearray["monsterturn"] .= "The monster is still asleep.<br />"; - } - } - if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. - $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); - if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } - $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); - $tododge = rand(1,150); - if ($tododge <= sqrt($userrow["dexterity"])) { - $tohit = 0; $pagearray["monsterturn"] .= "You dodge the monster's attack. No damage has been scored.<br />"; - $persondamage = 0; - } else { - $persondamage = $tohit - $toblock; - if ($persondamage < 1) { $persondamage = 1; } - if ($userrow["currentuberdefense"] != 0) { - $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); - } - if ($persondamage < 1) { $persondamage = 1; } - } - $pagearray["monsterturn"] .= "The monster attacks you for $persondamage damage.<br /><br />"; - $userrow["currenthp"] -= $persondamage; - if ($userrow["currenthp"] <= 0) { - $newgold = ceil($userrow["gold"]/2); - $newhp = ceil($userrow["maxhp"]/4); - $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='In Town',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $playerisdead = 1; - } - } +$exp = rand((($monsterrow["maxexp"]/6)*5),$monsterrow["maxexp"]); +if ($exp < 1) { $exp = 1; } +if ($userrow["difficulty"] == 2) { $exp = ceil($exp * $controlrow["diff2mod"]); } +if ($userrow["difficulty"] == 3) { $exp = ceil($exp * $controlrow["diff3mod"]); } +if ($userrow["expbonus"] != 0) { $exp += ceil(($userrow["expbonus"]/100)*$exp); } +$gold = rand((($monsterrow["maxgold"]/6)*5),$monsterrow["maxgold"]); +if ($gold < 1) { $gold = 1; } +if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); } +if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); } +if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); } +if ($userrow["experience"] + $exp < 16777215) { $newexp = $userrow["experience"] + $exp; $warnexp = ""; } else { $newexp = $userrow["experience"]; $exp = 0; $warnexp = "You have maxed out your experience points."; } +if ($userrow["gold"] + $gold < 16777215) { $newgold = $userrow["gold"] + $gold; $warngold = ""; } else { $newgold = $userrow["gold"]; $gold = 0; $warngold = "You have maxed out your experience points."; } - } else { - $pagearray["yourturn"] = ""; - $pagearray["monsterhp"] = "Monster's HP: " . $userrow["currentmonsterhp"] . "<br /><br />"; - $pagearray["monsterturn"] = ""; - } - - $newmonster = $userrow["currentmonster"]; +$levelquery = doquery("SELECT * FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); +if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); } - $newmonsterhp = $userrow["currentmonsterhp"]; - $newmonstersleep = $userrow["currentmonstersleep"]; - $newmonsterimmune = $userrow["currentmonsterimmune"]; - $newuberdamage = $userrow["currentuberdamage"]; - $newuberdefense = $userrow["currentuberdefense"]; - $newfight = $userrow["currentfight"] + 1; - $newhp = $userrow["currenthp"]; - $newmp = $userrow["currentmp"]; - -if ($playerisdead != 1) { -$pagearray["command"] = <<<END -Command?<br /><br /> -<form action="index.php?do=fight" method="post"> -<input type="submit" name="fight" value="Fight" /><br /><br /> -<select name="userspell"><option value="0">Choose One</option>$magiclist</select> <input type="submit" name="spell" value="Spell" /><br /><br /> -<input type="submit" name="run" value="Run" /><br /><br /> -</form> -END; - $updatequery = doquery("UPDATE {{table}} SET currentaction='Fighting',currenthp='$newhp',currentmp='$newmp',currentfight='$newfight',currentmonster='$newmonster',currentmonsterhp='$newmonsterhp',currentmonstersleep='$newmonstersleep',currentmonsterimmune='$newmonsterimmune',currentuberdamage='$newuberdamage',currentuberdefense='$newuberdefense' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); -} else { - $pagearray["command"] = "<b>You have died.</b><br /><br />As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.<br /><br />You may now continue back to <a href=\"index.php\">town</a>, and we hope you fair better next time."; -} - - // Finalize page and display it. - $template = gettemplate("fight"); - $page = parsetemplate($template,$pagearray); - - display($page, "Fighting"); - -} +if ($userrow["level"] < 100) { +if ($newexp >= $levelrow[$userrow["charclass"]."_exp"]) { +$newhp = $userrow["maxhp"] + $levelrow[$userrow["charclass"]."_hp"]; +$newmp = $userrow["maxmp"] + $levelrow[$userrow["charclass"]."_mp"]; +$newtp = $userrow["maxtp"] + $levelrow[$userrow["charclass"]."_tp"]; +$newstrength = $userrow["strength"] + $levelrow[$userrow["charclass"]."_strength"]; +$newdexterity = $userrow["dexterity"] + $levelrow[$userrow["charclass"]."_dexterity"]; +$newattack = $userrow["attackpower"] + $levelrow[$userrow["charclass"]."_strength"]; +$newdefense = $userrow["defensepower"] + $levelrow[$userrow["charclass"]."_dexterity"]; +$pointlvl = $userrow["pointlvl"] + 10; +$newlevel = $levelrow["id"]; -function victory() { - - global $userrow, $controlrow; - - if ($userrow["currentmonsterhp"] != 0) { header("Location: index.php?do=fight"); die(); } - if ($userrow["currentfight"] == 0) { header("Location: index.php"); die(); } - - $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); - $monsterrow = mysql_fetch_array($monsterquery); - - $exp = rand((($monsterrow["maxexp"]/6)*5),$monsterrow["maxexp"]); - if ($exp < 1) { $exp = 1; } - if ($userrow["difficulty"] == 2) { $exp = ceil($exp * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $exp = ceil($exp * $controlrow["diff3mod"]); } - if ($userrow["expbonus"] != 0) { $exp += ceil(($userrow["expbonus"]/100)*$exp); } - $gold = rand((($monsterrow["maxgold"]/6)*5),$monsterrow["maxgold"]); - if ($gold < 1) { $gold = 1; } - if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); } - if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); } - if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); } - if ($userrow["experience"] + $exp < 16777215) { $newexp = $userrow["experience"] + $exp; $warnexp = ""; } else { $newexp = $userrow["experience"]; $exp = 0; $warnexp = "You have maxed out your experience points."; } - if ($userrow["gold"] + $gold < 16777215) { $newgold = $userrow["gold"] + $gold; $warngold = ""; } else { $newgold = $userrow["gold"]; $gold = 0; $warngold = "You have maxed out your experience points."; } - - $levelquery = doquery("SELECT * FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); - if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); } - - if ($userrow["level"] < 100) { - if ($newexp >= $levelrow[$userrow["charclass"]."_exp"]) { - $newhp = $userrow["maxhp"] + $levelrow[$userrow["charclass"]."_hp"]; - $newmp = $userrow["maxmp"] + $levelrow[$userrow["charclass"]."_mp"]; - $newtp = $userrow["maxtp"] + $levelrow[$userrow["charclass"]."_tp"]; - $newstrength = $userrow["strength"] + $levelrow[$userrow["charclass"]."_strength"]; - $newdexterity = $userrow["dexterity"] + $levelrow[$userrow["charclass"]."_dexterity"]; - $newattack = $userrow["attackpower"] + $levelrow[$userrow["charclass"]."_strength"]; - $newdefense = $userrow["defensepower"] + $levelrow[$userrow["charclass"]."_dexterity"]; - $newlevel = $levelrow["id"]; - - if ($levelrow[$userrow["charclass"]."_spells"] != 0) { - $userspells = $userrow["spells"] . ",".$levelrow[$userrow["charclass"]."_spells"]; - $newspell = "spells='$userspells',"; - $spelltext = "You have learned a new spell.<br />"; - } else { $spelltext = ""; $newspell=""; } - - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience. $warnexp <br />You gain $gold gold. $warngold <br /><br /><b>You have gained a level!</b><br /><br />You gain ".$levelrow[$userrow["charclass"]."_hp"]." hit points.<br />You gain ".$levelrow[$userrow["charclass"]."_mp"]." magic points.<br />You gain ".$levelrow[$userrow["charclass"]."_tp"]." travel points.<br />You gain ".$levelrow[$userrow["charclass"]."_strength"]." strength.<br />You gain ".$levelrow[$userrow["charclass"]."_dexterity"]." dexterity.<br />$spelltext<br />You can now continue <a href=\"index.php\">exploring</a>."; - $title = "Courage and Wit have served thee well!"; - $dropcode = ""; - } else { - $newhp = $userrow["maxhp"]; - $newmp = $userrow["maxmp"]; - $newtp = $userrow["maxtp"]; - $newstrength = $userrow["strength"]; - $newdexterity = $userrow["dexterity"]; - $newattack = $userrow["attackpower"]; - $newdefense = $userrow["defensepower"]; - $newlevel = $userrow["level"]; - $newspell = ""; - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".<br />You gain $exp experience. $warnexp <br />You gain $gold gold. $warngold <br /><br />"; - - if (rand(1,30) == 1) { - $dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops"); - $droprow = mysql_fetch_array($dropquery); - $dropcode = "dropcode='".$droprow["id"]."',"; - $page .= "This monster has dropped an item. <a href=\"index.php?do=drop\">Click here</a> to reveal and equip the item, or you may also move on and continue <a href=\"index.php\">exploring</a>."; - } else { - $dropcode = ""; - $page .= "You can now continue <a href=\"index.php\">exploring</a>."; - } +if ($levelrow[$userrow["charclass"]."_spells"] != 0) { +$userspells = $userrow["spells"] . ",".$levelrow[$userrow["charclass"]."_spells"]; +$newspell = "spells='$userspells',"; +$spelltext = "Vous avez appris un nouveau sort<br />"; +} else { $spelltext = ""; $newspell=""; } - $title = "Victory!"; - } - } - - $updatequery = doquery("UPDATE {{table}} SET currentaction='Exploring',level='$newlevel',maxhp='$newhp',maxmp='$newmp',maxtp='$newtp',strength='$newstrength',dexterity='$newdexterity',attackpower='$newattack',defensepower='$newdefense', $newspell currentfight='0',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentuberdamage='0',currentuberdefense='0',$dropcode experience='$newexp',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - +$page = "<center> <br> Trop drôle, l'autre va avoir mal à la tête pendant un bon moment !!!!<br> <br> <img src=./images/vainqueur.gif /> <br> <br> Félicitation. Vous avez battu le ".$monsterrow["name"].".<br />Vous gagnez $exp d'expérience. $warnexp <br />Vous gagnez $gold gils. $warngold <br /><br /><b>Vous avez gagné 1 niveau!</b><br /><br />Vous avez 10 point a <a href='index.php?do=point'>Distribuer</a>.<br />Vous pouvez maintenant continuer à <br> <a href='index.php'>explorer le monde</a>."; +$title = "Le courage et le bon esprit vous ont bien servi!"; +$dropcode = ""; +} else { +$newhp = $userrow["maxhp"]; +$newmp = $userrow["maxmp"]; +$newtp = $userrow["maxtp"]; +$newstrength = $userrow["strength"]; +$newdexterity = $userrow["dexterity"]; +$newattack = $userrow["attackpower"]; +$newdefense = $userrow["defensepower"]; +$newlevel = $userrow["level"]; +$newspell = ""; +$page = "<center> <br> Trop drôle, l'autre va avoir mal à la tête pendant un bon moment !!!!<br> <br> <img src=./images/vainqueur.gif /> <br> <br> Félicitation. Vous avez battu le ".$monsterrow["name"].".<br />Vous gagnez $exp points d'experience. $warnexp <br />Vous gagnez $gold gils. $warngold <br /><br />"; - display($page, $title); - +if (rand(1,30) == 1) { +$dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops"); +$droprow = mysql_fetch_array($dropquery); +$dropcode = "dropcode='".$droprow["id"]."',"; +$page .= "Ce monstre a laisser tomber un objet. <a href='index.php?do=drop'>Cliquez ici</a> pour le rammasser et vous équiper de cet article, ou vous pouvez également passer et continuer à <br> <a href='index.php'>explorer le monde</a>."; +} else { +$dropcode = ""; +$page .= "Vous pouvez maintenant continuer à <br> <a href='index.php'>explorer le monde</a>.</center> "; } -function drop() { - - global $userrow; - - if ($userrow["dropcode"] == 0) { header("Location: index.php"); die(); } - - $dropquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["dropcode"]."' LIMIT 1", "drops"); - $droprow = mysql_fetch_array($dropquery); - - if (isset($_POST["submit"])) { - - $slot = $_POST["slot"]; - - if ($slot == 0) { display("Please go back and select an inventory slot to continue.","Error"); } - - if ($userrow["slot".$slot."id"] != 0) { - - $slotquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["slot".$slot."id"]."' LIMIT 1", "drops"); - $slotrow = mysql_fetch_array($slotquery); - - $old1 = explode(",",$slotrow["attribute1"]); - if ($slotrow["attribute2"] != "X") { $old2 = explode(",",$slotrow["attribute2"]); } else { $old2 = array(0=>"maxhp",1=>0); } - $new1 = explode(",",$droprow["attribute1"]); - if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } - - $userrow[$old1[0]] -= $old1[1]; - $userrow[$old2[0]] -= $old2[1]; - if ($old1[0] == "strength") { $userrow["attackpower"] -= $old1[1]; } - if ($old1[0] == "dexterity") { $userrow["defensepower"] -= $old1[1]; } - if ($old2[0] == "strength") { $userrow["attackpower"] -= $old2[1]; } - if ($old2[0] == "dexterity") { $userrow["defensepower"] -= $old2[1]; } - - $userrow[$new1[0]] += $new1[1]; - $userrow[$new2[0]] += $new2[1]; - if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } - if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } - if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } - if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } - - if ($userrow["currenthp"] > $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } - if ($userrow["currentmp"] > $userrow["maxmp"]) { $userrow["currentmp"] = $userrow["maxmp"]; } - if ($userrow["currenttp"] > $userrow["maxtp"]) { $userrow["currenttp"] = $userrow["maxtp"]; } - - $newname = addslashes($droprow["name"]); - $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$old1[0]='".$userrow[$old1[0]]."',$old2[0]='".$userrow[$old2[0]]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."',currenttp='".$userrow["currenttp"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - - } else { - - $new1 = explode(",",$droprow["attribute1"]); - if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } - - $userrow[$new1[0]] += $new1[1]; - $userrow[$new2[0]] += $new2[1]; - if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } - if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } - if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } - if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } - - $newname = addslashes($droprow["name"]); - $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - - } - $page = "The item has been equipped. You can now continue <a href=\"index.php\">exploring</a>."; - display($page, "Item Drop"); - - } - - $attributearray = array("maxhp"=>"Max HP", - "maxmp"=>"Max MP", - "maxtp"=>"Max TP", - "defensepower"=>"Defense Power", - "attackpower"=>"Attack Power", - "strength"=>"Strength", - "dexterity"=>"Dexterity", - "expbonus"=>"Experience Bonus", - "goldbonus"=>"Gold Bonus"); - - $page = "The monster dropped the following item: <b>".$droprow["name"]."</b><br /><br />"; - $page .= "This item has the following attribute(s):<br />"; - - $attribute1 = explode(",",$droprow["attribute1"]); - $page .= $attributearray[$attribute1[0]]; - if ($attribute1[1] > 0) { $page .= " +" . $attribute1[1] . "<br />"; } else { $page .= $attribute1[1] . "<br />"; } - - if ($droprow["attribute2"] != "X") { - $attribute2 = explode(",",$droprow["attribute2"]); - $page .= $attributearray[$attribute2[0]]; - if ($attribute2[1] > 0) { $page .= " +" . $attribute2[1] . "<br />"; } else { $page .= $attribute2[1] . "<br />"; } - } - - $page .= "<br />Select an inventory slot from the list below to equip this item. If the inventory slot is already full, the old item will be discarded."; - $page .= "<form action=\"index.php?do=drop\" method=\"post\"><select name=\"slot\"><option value=\"0\">Choose One</option><option value=\"1\">Slot 1: ".$userrow["slot1name"]."</option><option value=\"2\">Slot 2: ".$userrow["slot2name"]."</option><option value=\"3\">Slot 3: ".$userrow["slot3name"]."</option></select> <input type=\"submit\" name=\"submit\" value=\"Submit\" /></form>"; - $page .= "You may also choose to just continue <a href=\"index.php\">exploring</a> and give up this item."; - - display($page, "Item Drop"); - +$title = "Victoire!"; } - +} + +//Ajout de la fonction Quete type='1' : Tuer des Monstres +$requete=mysql_query("select quete from rpg_users where id='".$userrow["id"]."'"); +while($row=mysql_fetch_array($requete)) {$quete_en_cours=$row[0];} +if($quete_en_cours>0) +{ +$requete=mysql_query("select * from rpg_quete WHERE id='$quete_en_cours'"); +while($row=mysql_fetch_array($requete)) +{ +if($row[4] == '1') //C bien une quete de monstre +{ +//On verifie si le monstre tué correspond à la quete et on incremente le compteur de monstre tué +if($monsterrow["name"]==$row[5]) +{ +mysql_query("UPDATE rpg_users SET monstrequete=monstrequete+1 WHERE id='".$userrow["id"]."'"); +$monstre=$userrow["monstrequete"]+1; +$requete1=mysql_query("SELECT listquest FROM rpg_users WHERE id='".$userrow["id"]."'"); +while($reque=mysql_fetch_array($requete1)) {$prev=$reque[0]; } +if($monstre==$row[6]) +{ +$page = "Vous avez résolu la quête nommée $row[1] ! Félicitation. Vous gagnez :<br>"; +$page .= "$row[10] points d'Expérience et $row[11] Gils !"; +mysql_query("UPDATE rpg_users SET experience=experience+$row[10], gold=gold+$row[11], quete='0', monstrequete='0',listquest='listquest," .$quete_en_cours ."' WHERE id='".$userrow["id"]."'"); +display($page, "Quête Résolue"); +die(); +} +} +} +} +} +//Fin Ajout -function dead() { - - $page = "<b>You have died.</b><br /><br />As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.<br /><br />You may now continue back to <a href=\"index.php\">town</a>, and we hope you fair better next time."; - -} +$updatequery = doquery("UPDATE {{table}} SET currentaction='En exploration',level='$newlevel', +attackpower='$newattack',defensepower='$newdefense', +$newspell currentfight='0',currentmonster='0', +currentmonsterhp='0', +currentmonstersleep='0', +currentmonsterimmune='0', +currentuberdamage='0',currentuberdefense='0',$dropcode experience='$newexp',gold='$newgold',pointlvl='$pointlvl' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +display($page, $title); +} + +function drop() { + + global $userrow; + + if ($userrow["dropcode"] == 0) { header("Location: index.php"); die(); } + + $dropquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["dropcode"]."' LIMIT 1", "drops"); + $droprow = mysql_fetch_array($dropquery); + + if (isset($_POST["submit"])) { + + $slot = $_POST["slot"]; + + if ($slot == 0) { display("Veuillez retourner et choisir une fente de l'inventaire pour continuer.","Erreur"); } + + if ($userrow["slot".$slot."id"] != 0) { + + $slotquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["slot".$slot."id"]."' LIMIT 1", "drops"); + $slotrow = mysql_fetch_array($slotquery); + + $old1 = explode(",",$slotrow["attribute1"]); + if ($slotrow["attribute2"] != "X") { $old2 = explode(",",$slotrow["attribute2"]); } else { $old2 = array(0=>"maxhp",1=>0); } + $new1 = explode(",",$droprow["attribute1"]); + if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } + + $userrow[$old1[0]] -= $old1[1]; + $userrow[$old2[0]] -= $old2[1]; + if ($old1[0] == "strength") { $userrow["attackpower"] -= $old1[1]; } + if ($old1[0] == "dexterity") { $userrow["defensepower"] -= $old1[1]; } + if ($old2[0] == "strength") { $userrow["attackpower"] -= $old2[1]; } + if ($old2[0] == "dexterity") { $userrow["defensepower"] -= $old2[1]; } + + $userrow[$new1[0]] += $new1[1]; + $userrow[$new2[0]] += $new2[1]; + if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } + if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } + if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } + if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } + + if ($userrow["currenthp"] > $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } + if ($userrow["currentmp"] > $userrow["maxmp"]) { $userrow["currentmp"] = $userrow["maxmp"]; } + if ($userrow["currenttp"] > $userrow["maxtp"]) { $userrow["currenttp"] = $userrow["maxtp"]; } + + $newname = addslashes($droprow["name"]); + $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$old1[0]='".$userrow[$old1[0]]."',$old2[0]='".$userrow[$old2[0]]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."',currenttp='".$userrow["currenttp"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + } else { + + $new1 = explode(",",$droprow["attribute1"]); + if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } + + $userrow[$new1[0]] += $new1[1]; + $userrow[$new2[0]] += $new2[1]; + if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } + if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } + if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } + if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } + + $newname = addslashes($droprow["name"]); + $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + } + $page = "L'objet a été équipé. Vous pouvez maintenant continuer à <a href=\"index.php\">explorer le monde</a>.</center> "; + display($page, "Item Drop"); + + } + + $attributearray = array("maxhp"=>"HP Max", + "maxmp"=>"MP Max", + "maxtp"=>"TP Max", + "defensepower"=>"Pouvoir de défense", + "attackpower"=>"Pouvoir d'attaque", + "strength"=>"Force", + "dexterity"=>"Dextérité", + "expbonus"=>"Experience Bonus", + "goldbonus"=>"Gils Bonus"); + + $page = "Le monstre a fait tomber l'objet suivant: <b>".$droprow["name"]."</b><br /><br />"; + $page .= "Cet objet a l'attribut(s) suivant:<br />"; + + $attribute1 = explode(",",$droprow["attribute1"]); + $page .= $attributearray[$attribute1[0]]; + if ($attribute1[1] > 0) { $page .= " +" . $attribute1[1] . "<br />"; } else { $page .= $attribute1[1] . "<br />"; } + + if ($droprow["attribute2"] != "X") { + $attribute2 = explode(",",$droprow["attribute2"]); + $page .= $attributearray[$attribute2[0]]; + if ($attribute2[1] > 0) { $page .= " +" . $attribute2[1] . "<br />"; } else { $page .= $attribute2[1] . "<br />"; } + } + + $page .= "<br />Choisissez une fente dans l'inventaire à partir de la liste ci-dessous pour vous équiper de cet objet. Si la fente de l'inventaire est déja pleine, l'ancien objet sera jeté."; + $page .= "<form action=\"index.php?do=drop\" method=\"post\"><select name=\"slot\"><option value=\"0\">Les Fentes</option><option value=\"1\">Fente 1: ".$userrow["slot1name"]."</option><option value=\"2\">Fente 2: ".$userrow["slot2name"]."</option><option value=\"3\">Fente 3: ".$userrow["slot3name"]."</option></select> <input type=\"submit\" name=\"submit\" value=\"Valider\" /></form>"; + $page .= "Vous pouvez également choisir de continuer à <a href=\"index.php\">explorer le monde</a> et renoncer à cet objet."; + + display($page, "Item Drop"); + +} + + +function dead() { + + $page = "<b>Vous êtes mort.</b><br /><br />En conséquence, vous avez perdu la moitié de vos gils. Cependant, vous avez gardé une partie de vos points hit, pour continuer votre voyage.<br /><br />Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>, et nous espérons que vous ferez mieux la prochaine fois."; + +} + + + ?> \ No newline at end of file diff --git a/forum.php b/forum.php @@ -1,97 +1,199 @@ -<?php // forum.php :: Internal forums script for the game. - -include('lib.php'); -include('cookies.php'); -$link = opendb(); -$userrow = checkcookies(); -if ($userrow == false) { display("The forum is for registered players only.", "Forum"); die(); } -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); - -if ($controlrow["gameopen"] == 0) { display("The game is currently closed for maintanence. Please check back later.","Game Closed"); die(); } - -if (isset($_GET["do"])) { - $do = explode(":",$_GET["do"]); - - if ($do[0] == "thread") { showthread($do[1], $do[2]); } - elseif ($do[0] == "new") { newthread(); } - elseif ($do[0] == "reply") { reply(); } - elseif ($do[0] == "list") { donothing($do[1]); } - -} else { donothing(0); } - -function donothing($start=0) { - - $query = doquery("SELECT * FROM {{table}} WHERE parent='0' ORDER BY newpostdate DESC LIMIT 20", "forum"); - $page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><th colspan=\"3\" style=\"background-color:#dddddd;\"><center><a href=\"forum.php?do=new\">New Thread</a></center></th></tr><tr><th width=\"50%\" style=\"background-color:#dddddd;\">Thread</th><th width=\"10%\" style=\"background-color:#dddddd;\">Replies</th><th style=\"background-color:#dddddd;\">Last Post</th></tr>\n"; - $count = 1; - if (mysql_num_rows($query) == 0) { - $page .= "<tr><td style=\"background-color:#ffffff;\" colspan=\"3\"><b>No threads in forum.</b></td></tr>\n"; - } else { - while ($row = mysql_fetch_array($query)) { - if ($count == 1) { - $page .= "<tr><td style=\"background-color:#ffffff;\"><a href=\"forum.php?do=thread:".$row["id"].":0\">".$row["title"]."</a></td><td style=\"background-color:#ffffff;\">".$row["replies"]."</td><td style=\"background-color:#ffffff;\">".$row["newpostdate"]."</td></tr>\n"; - $count = 2; - } else { - $page .= "<tr><td style=\"background-color:#eeeeee;\"><a href=\"forum.php?do=thread:".$row["id"].":0\">".$row["title"]."</a></td><td style=\"background-color:#eeeeee;\">".$row["replies"]."</td><td style=\"background-color:#eeeeee;\">".$row["newpostdate"]."</td></tr>\n"; - $count = 1; - } - } - } - $page .= "</table></td></tr></table>"; - - display($page, "Forum"); - -} - -function showthread($id, $start) { - - $query = doquery("SELECT * FROM {{table}} WHERE id='$id' OR parent='$id' ORDER BY id LIMIT $start,15", "forum"); - $query2 = doquery("SELECT title FROM {{table}} WHERE id='$id' LIMIT 1", "forum"); - $row2 = mysql_fetch_array($query2); - $page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#dddddd;\"><b><a href=\"forum.php\">Forum</a> :: ".$row2["title"]."</b></td></tr>\n"; - $count = 1; - while ($row = mysql_fetch_array($query)) { - if ($count == 1) { - $page .= "<tr><td width=\"25%\" style=\"background-color:#ffffff; vertical-align:top;\"><span class=\"small\"><b>".$row["author"]."</b><br /><br />".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\">".nl2br($row["content"])."</td></tr>\n"; - $count = 2; - } else { - $page .= "<tr><td width=\"25%\" style=\"background-color:#eeeeee; vertical-align:top;\"><span class=\"small\"><b>".$row["author"]."</b><br /><br />".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#eeeeee; vertical-align:top;\">".nl2br($row["content"])."</td></tr>\n"; - $count = 1; - } - } - $page .= "</table></td></tr></table><br />"; - $page .= "<table width=\"100%\"><tr><td><b>Reply To This Thread:</b><br /><form action=\"forum.php?do=reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"$id\" /><input type=\"hidden\" name=\"title\" value=\"Re: ".$row2["title"]."\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>"; - - display($page, "Forum"); - -} - -function reply() { - - global $userrow; - extract($_POST); - $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["charname"]."',parent='$parent',replies='0',title='$title',content='$content'", "forum"); - $query2 = doquery("UPDATE {{table}} SET newpostdate=NOW(),replies=replies+1 WHERE id='$parent' LIMIT 1", "forum"); - header("Location: forum.php?do=thread:$parent:0"); - die(); - -} - -function newthread() { - - global $userrow; - - if (isset($_POST["submit"])) { - extract($_POST); - $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["charname"]."',parent='0',replies='0',title='$title',content='$content'", "forum"); - header("Location: forum.php"); - die(); - } - - $page = "<table width=\"100%\"><tr><td><b>Make A New Post:</b><br /><br/ ><form action=\"forum.php?do=new\" method=\"post\">Title:<br /><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"50\" /><br /><br />Message:<br /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><br /><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>"; - display($page, "Forum"); - -} - +<?php // forum.php :: Forum interne du script. + +include('lib.php'); +include('cookies.php'); +include('bbcode.php'); +$link = opendb(); +$userrow = checkcookies(); +if ($userrow == false) { display("Le forum est réservé aux joueurs enregistrés.", "Forum"); die(); } +$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$controlrow = mysql_fetch_array($controlquery); + +if ($controlrow["gameopen"] == 0) { display("<p class='Style5'>Le jeu est actuellement fermé pour cause de maintenance. Merci de revenir plus tard.","Jeu fermé"); die(); } + +if (isset($_GET["do"])) { +$do = explode(":",$_GET["do"]); + +if ($do[0] == "thread") { showthread($do[1], $do[2]); } +elseif ($do[0] == "forum") { forum(); } +elseif ($do[0] == "new") { newthread($do[1]); } +elseif ($do[0] == "reply") { reply($do[1]); } +elseif ($do[0] == "list") { donothing($do[1]); } + +} else { donothing(0); } + +function donothing($id) { + +$query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='$id' ORDER BY newpostdate DESC LIMIT 200", "forum"); +$page = "<center><img src='images/forum.jpg'></center><p><center><div class='bloc_droite2'><p class='Style5'> + <u> La ligne de conduite </u><br><br>Ce forum a été crée pour que tous les joueurs puissent discuter entre eux. +Il faut donc garder une conduite exempliare ici. Toutes insultes, tentative de hacking (essayez vous allez bien rigolez aprés), +et j'allait oubliez il est formellement interdit d'echanger vos adresses emails sur le site. +L'equipe de Rpg Illusion 1.2c espere que vous passerai du bon temps sur notre jeu. +</div><center><table width=\"100%\"><tr><br><br><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><th colspan=\"3\" style=\"background-color:#cdbca3;\"><center><p class='Style5'><a href=\"forum.php?do=new\">Nouveau sujet</a></center></th></tr><tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style2'>Sujets</th><th width=\"10%\" style=\"background-color:#cdbca3;\"><p class='Style2'>Réponses</th><th style=\"background-color:#cdbca3;\"><p class='Style2'>Derniers Post</th></tr>\n"; +$count = 1; +if (mysql_num_rows($query) == 0) { +$page .= "<tr><td style=\"background-color:#cdbca3;\" colspan=\"3\"><p class='Style5'><b>Aucun sujet dans le forum.</b></td></tr>\n"; +} else { +while ($row = mysql_fetch_array($query)) { +if ($count == 1) { +$page .= "<tr><td style=\"background-color:#cdbca3;\"><p class='Style5'><a href=\"forum.php?do=thread:".$row["id"].":0\">".$row["title"]."</a></td><td style=\"background-color:#ffffff;\"><p class='Style2'>".$row["replies"]."</td><td style=\"background-color:#ffffff;\"><p class='Style2'>".$row["newpostdate"]."</td></tr>\n"; +$count = 2; +} else { +$page .= "<tr><td style=\"background-color:#cdbca3;\"><p class='Style5'><a href=\"forum.php?do=thread:".$row["id"].":0\">".$row["title"]."</a></td><td style=\"background-color:#ffffff;\"><p class='Style2'>".$row["replies"]."</td><td style=\"background-color:#ffffff;\"><p class='Style2'>".$row["newpostdate"]."</td></tr>\n"; +$count = 1; +} +} +} +$page .= "</table></td></tr></table></center><p class='Style5'><a href='forum.php?do=forum'><<< Retourner a l'aceuil du forum</a>"; + +display($page, "Forum"); + +} + +function forum() { + +$forum1query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='1' LIMIT 200", "forum"); +$forum1 = "" . mysql_num_rows($forum1query) . ""; +$forum2query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='2' LIMIT 200", "forum"); +$forum2 = "" . mysql_num_rows($forum2query) . ""; +$forum3query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='3' LIMIT 200", "forum"); +$forum3 = "" . mysql_num_rows($forum3query) . ""; +$forum4query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='4' LIMIT 200", "forum"); +$forum4 = "" . mysql_num_rows($forum4query) . ""; +$forum5query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='5' LIMIT 200", "forum"); +$forum5 = "" . mysql_num_rows($forum5query) . ""; +$forum6query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='6' LIMIT 200", "forum"); +$forum6 = "" . mysql_num_rows($forum6query) . ""; +$forum7query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='7' LIMIT 200", "forum"); +$forum7 = "" . mysql_num_rows($forum7query) . ""; +$forum8query = doquery("SELECT * FROM {{table}} WHERE parent='0' AND type='8' LIMIT 200", "forum"); +$forum8 = "" . mysql_num_rows($forum8query) . ""; +$mess1query = doquery("SELECT * FROM {{table}} WHERE type='1' LIMIT 200", "forum"); +$mess1 = "" . mysql_num_rows($mess1query) . ""; +$mess2query = doquery("SELECT * FROM {{table}} WHERE type='2' LIMIT 200", "forum"); +$mess2 = "" . mysql_num_rows($mess2query) . ""; +$mess3query = doquery("SELECT * FROM {{table}} WHERE type='3' LIMIT 200", "forum"); +$mess3 = "" . mysql_num_rows($mess3query) . ""; +$mess4query = doquery("SELECT * FROM {{table}} WHERE type='4' LIMIT 200", "forum"); +$mess4 = "" . mysql_num_rows($mess4query) . ""; +$mess5query = doquery("SELECT * FROM {{table}} WHERE type='5' LIMIT 200", "forum"); +$mess5 = "" . mysql_num_rows($mess5query) . ""; +$mess6query = doquery("SELECT * FROM {{table}} WHERE type='6' LIMIT 200", "forum"); +$mess6 = "" . mysql_num_rows($mess6query) . ""; +$mess7query = doquery("SELECT * FROM {{table}} WHERE type='7' LIMIT 200", "forum"); +$mess7 = "" . mysql_num_rows($mess7query) . ""; +$mess8query = doquery("SELECT * FROM {{table}} WHERE type='8' LIMIT 200", "forum"); +$mess8 = "" . mysql_num_rows($mess8query) . ""; + +$page = "<center><img src='images/forum.jpg'></center><p><center><div class='bloc_droite2'><p class='Style5'> + <u> La ligne de conduite </u><br><br>Ce forum a été crée pour que tous les joueurs puissent discuter entre eux. +Il faut donc garder une conduite exempliare ici. Toutes insultes, tentative de hacking (essayez vous allez bien rigolez aprés), +et j'allait oubliez il est formellement interdit d'echanger vos adresses emails sur le site. +L'equipe de Rpg Illusion 1.2c espere que vous passerai du bon temps sur notre jeu. +</div><center><table width=\"100%\"><tr><br><br><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><th colspan=\"3\" style=\"background-color:#cdbca3;\"><center><p class='Style5'>Bienvenue sur le forum de Rpg Illusion 1.2c</center></th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> Sujet :</th><th width=\"20%\" style=\"background-color:#cdbca3;\"><p class='Style5'>Topic :</th><th style=\"background-color:#cdbca3;\"><p class='Style5'>Moderateur :</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:1'>News</a><br>Parler ici des differantes nouvelles de Rpg Illusion 1.2c.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum1 sujet(s)<br>$mess1 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:2'>Forum General</a><br>Parler de tous ce qui concerne le site.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum2 sujet(s)<br>$mess2 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:3'>Sondage</a><br>Donner votre avis sur Rpg Illusion 1.2c et ses choix.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum3 sujet(s)<br>$mess3 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:4'>Recrutement ou creation de clan</a><br>Ceci est le forum des clans.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum4 sujet(s)<br>$mess4 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:5'>Le bar de Rpg Illusion 1.2c</a><br>Parler de tous et de tous.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum5 sujet(s)<br>$mess5 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:6'>Aidez-nous !!!</a><br>Un bug ? Dite le nous pour qu'on puisse le corriger.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum6 sujet(s)<br>$mess6 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:7'>La prison</a><br>Attention, si vous etes attraper en train de tricher ou autres, tous le monde va le savoir.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum7 sujet(s)<br>$mess7 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +<tr><th width=\"50%\" style=\"background-color:#cdbca3;\"><p class='Style5'> <a href='forum.php?do=list:8'>RPG-Illusion</a><br>Créer votre propre rpg en php.</th><th width=\"10%\" style=\"background-color:#FFFFFF;\"><p class='Style5'>$forum8 sujet(s)<br>$mess8 message(s)</th><th style=\"background-color:#FFFFFF;\"><p class='Style5'>Admin</th></tr> +\n"; + +$page .= "</table></td></tr></table></center><p class='Style5'><a href='index.php'><<< Retourner au jeu</a>"; + +display($page, "Forum"); + +} + +function showthread($id, $start) { + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' OR parent='$id' ORDER BY id LIMIT $start,200", "forum"); +$query2 = doquery("SELECT title,type,avatar,id,signature FROM {{table}} WHERE id='$id' LIMIT 1", "forum"); +$row2 = mysql_fetch_array($query2); +$query3 = doquery("SELECT level,avatar,charclass FROM {{table}} WHERE id='3' ORDER BY id LIMIT 1", "users"); +$info = mysql_fetch_array($query3); +$texte = new texte(); +$auteur = $row["authorid"]; +$type = $row2["type"]; +$page = "<center><img src='images/forum.jpg'></center><p><table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#cdbca3;\"><p class='Style5'><b><a href=\"forum.php?do=forum\">Forum</a> :: ".$row2["title"]."</b></td></tr>\n"; +$count = 1; +while ($row = mysql_fetch_array($query)) { +if ($count == 1) { +$page .= "<tr><td width=\"25%\" style=\"background-color:#cdbca3; vertical-align:top;\"><p class='Style5'><span class=\"small\"><a href=\"index.php?do=onlinechar:".$row["id2"]."\"><b>".$row["author"]."</b></a><br /><img src='images/avatar/".$row["avatar"]."'><br />".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\"><p class='Style5'>".$texte->ms_format(htmlentities($row["content"]))."<p>--------------------------------------------<br>".$texte->ms_format($row["signature"])."</td></tr>\n"; +$count = 2; +} else { +$page .= "<tr><td width=\"25%\" style=\"background-color:#cdbca3; vertical-align:top;\"><p class='Style5'><span class=\"small\"><a href=\"index.php?do=onlinechar:".$row["id2"]."\"><b>".$row["author"]."</b></a><br /><img src='images/avatar/".$row["avatar"]."'><br />".prettyforumdate($row["postdate"])."</td><td style=\"background-color:#ffffff; vertical-align:top;\"><p class='Style5'>".$texte->ms_format(htmlentities($row["content"]))."<p>--------------------------------------------<br>".$texte->ms_format($row["signature"])."</td></tr>\n"; +$count = 1; +} +} +$page .= "</table></td></tr></table><br />"; +$page .= "[b]Gras[/b] / [i]Italique[/i] / [u]Souligné[/u] / [img]Image[\img] / [url]Lien[/url] <br> + <img src='images/smileys/1.jpg'> :1: / + <img src='images/smileys/2.jpg'> :2: / + <img src='images/smileys/3.jpg'> :3: / + <img src='images/smileys/4.jpg'> :4: / + <img src='images/smileys/5.jpg'> :5: / + <img src='images/smileys/6.jpg'> :6: / + <img src='images/smileys/7.jpg'> :7: / + <img src='images/smileys/8.jpg'> :8: / +<table width=\"100%\"><tr><td><p class='Style5'><b>Répondre à ce sujet:</b><br /><form action=\"forum.php?do=reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"$id\" /><input type=\"hidden\" name=\"point\" value=\"$type\" /><input type=\"hidden\" name=\"title\" value=\"Re: ".$row2["title"]."\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><input type=\"submit\" name=\"submit\" value=\"Valider\" /><a href='index.php'> Retourner au jeu</a></form></td></tr></table>"; + +display($page, "Forum"); + +} + +function reply($id) { + +$query2 = doquery("SELECT avatar,id,signature FROM {{table}} WHERE id='$id' LIMIT 1", "users"); +$userrow = mysql_fetch_array($query2); + +global $userrow; +extract($_POST); +$query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["charname"]."',signature='".$userrow["signature"]."',avatar='".$userrow["avatar"]."',id2='".$userrow["id"]."',parent='$parent',replies='0',title='$title',content='$content',type='$point'", "forum"); +$query2 = doquery("UPDATE {{table}} SET newpostdate=NOW(),replies=replies+1 WHERE id='$parent' LIMIT 1", "forum"); +header("Location: forum.php?do=thread:$parent:0"); +die(); + +} + +function newthread() { + +$query2 = doquery("SELECT avatar,id,signature FROM {{table}} WHERE id='$id' LIMIT 1", "users"); +$userrow = mysql_fetch_array($query2); + +global $userrow; + +if (isset($_POST["submit"])) { +extract($_POST); +$query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["charname"]."',signature='".$userrow["signature"]."',avatar='".$userrow["avatar"]."',id2='".$userrow["id"]."',parent='0',replies='0',title='$title',content='$content',type='$type'", "forum"); +header("Location: forum.php?do=forum"); +die(); +} + +$page = "<center><img src='images/forum.jpg'></center>Gras : [b][/b] / Italique : [i][/i] / Souligné : [u][/u] / Image : [img][\img] / Lien : [url][/url] + <img src='images/smileys/1.jpg'> :1: / + <img src='images/smileys/2.jpg'> :2: / + <img src='images/smileys/3.jpg'> :3: / + <img src='images/smileys/4.jpg'> :4: / + <img src='images/smileys/5.jpg'> :5: / + <img src='images/smileys/6.jpg'> :6: / + <img src='images/smileys/7.jpg'> :7: / + <img src='images/smileys/8.jpg'> :8: / +<table width=\"100%\"><tr><td><p class='Style5'><b>Nouveau sujet:</b><br /><br/ > +<form action=\"forum.php?do=new\" method=\"post\"> +Forum : <select name='type'><option value='1'> News</option><option value='2'> Forum general</option><option value='3'> Sondage</option> +<option value='4'> Forum clan</option><option value='5'> Le bar</option><option value='6'> Aidez-nous !!!</option> +<option value='7'> La prison</option><option value='8'> RPG Illusion</option></select><br /><br /> +Titre:<br /><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"50\" /><br /><br /> +Message:<br /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><br /> +<input type=\"submit\" name=\"submit\" value=\"Valider\" /> +<input type=\"reset\" name=\"reset\" value=\"Annuler\" /></form></td></tr></table>"; +display($page, "Forum"); + +} + ?> \ No newline at end of file diff --git a/guide.php b/guide.php @@ -0,0 +1,42 @@ +<?php // login.php :: Handles logins and cookies. + +include('lib_log.php'); +if (isset($_GET["do"])) { + if ($_GET["do"] == "login") { login(); } + elseif ($_GET["do"] == "logout") { logout(); } +} + +function login() { + + include('config.php'); + $link = opendb(); + + if (isset($_POST["submit_x"])) { + + $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } + $row = mysql_fetch_array($query); + if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } + $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; + setcookie("dkgame", $cookie, $expiretime, "/", "", 0); + header("Location: index.php"); + die(); + + } + + $page = gettemplate("guide"); + $title = "Guide du jeu"; + display($page, $title, false, true, false); + +} + + +function logout() { + + setcookie("dkgame", "", time()-100000, "/", "", 0); + header("Location: login.php?do=login"); + die(); + +} + +?> +\ No newline at end of file diff --git a/heal.php b/heal.php @@ -1,33 +1,33 @@ -<?php // heal.php :: Handles stuff from the Quick Spells menu. (Healing spells only... other spells are handled in fight.php.) - -function healspells($id) { - - global $userrow; - - $userspells = explode(",",$userrow["spells"]); - $spellquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "spells"); - $spellrow = mysql_fetch_array($spellquery); - - // All the various ways to error out. - $spell = false; - foreach ($userspells as $a => $b) { - if ($b == $id) { $spell = true; } - } - if ($spell != true) { display("You have not yet learned this spell. Please go back and try again.", "Error"); die(); } - if ($spellrow["type"] != 1) { display("This is not a healing spell. Please go back and try again.", "Error"); die(); } - if ($userrow["currentmp"] < $spellrow["mp"]) { display("You do not have enough Magic Points to cast this spell. Please go back and try again.", "Error"); die(); } - if ($userrow["currentaction"] == "Fighting") { display("You cannot use the Quick Spells list during a fight. Please go back and select the Healing Spell you wish to use from the Spells box on the main fighting screen to continue.", "Error"); die(); } - if ($userrow["currenthp"] == $userrow["maxhp"]) { display("Your Hit Points are already full. You don't need to use a Healing spell now.", "Error"); die(); } - - $newhp = $userrow["currenthp"] + $spellrow["attribute"]; - if ($userrow["maxhp"] < $newhp) { $spellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $spellrow["attribute"]; } - $newmp = $userrow["currentmp"] - $spellrow["mp"]; - - $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp', currentmp='$newmp' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - - display("You have cast the ".$spellrow["name"]." spell, and gained ".$spellrow["attribute"]." Hit Points. You can now continue <a href=\"index.php\">exploring</a>.", "Healing Spell"); - die(); - -} - +<?php // heal.php :: Handles stuff from the Quick Spells menu. (Healing spells only... other spells are handled in fight.php.) + +function healspells($id) { + + global $userrow; + + $userspells = explode(",",$userrow["spells"]); + $spellquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "spells"); + $spellrow = mysql_fetch_array($spellquery); + + // All the various ways to error out. + $spell = false; + foreach ($userspells as $a => $b) { + if ($b == $id) { $spell = true; } + } + if ($spell != true) { display("Vous n'avez pas encore appris ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + if ($spellrow["type"] != 1) { display("Ce n'est pas un sort qui guérit. Veuiller retourner et recommencer.", "Erreur"); die(); } + if ($userrow["currentmp"] < $spellrow["mp"]) { display("Vous n'avez pas assez de points de magie pour éxécuter ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + if ($userrow["currentaction"] == "En combat") { display("Vous ne pouvez pas utiliser la liste des sorts rapide pendant un combat. Veuillez retourner et choisir le sort guérisseur que vous souhaitez utiliser.", "Erreur"); die(); } + if ($userrow["currenthp"] == $userrow["maxhp"]) { display("Vos points hit sont déja pleins. Vous n'avez pas besoin d'utiliser un sort guérisseur maintenant.", "Erreur"); die(); } + + $newhp = $userrow["currenthp"] + $spellrow["attribute"]; + if ($userrow["maxhp"] < $newhp) { $spellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $spellrow["attribute"]; } + $newmp = $userrow["currentmp"] - $spellrow["mp"]; + + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp', currentmp='$newmp' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + display("Vous avez éxécuté le sort ".$spellrow["name"]." , et gagné ".$spellrow["attribute"]." points Hit. Vous pouvez maintenant continuer à <a href=\"index.php\">explorer le monde</a>.", "Sort,guérisseur"); + die(); + +} + ?> \ No newline at end of file diff --git a/help.php b/help.php @@ -1,323 +1,42 @@ -<?php -include('lib.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); -ob_start("ob_gzhandler"); -?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title><? echo $controlrow["gamename"]; ?> Help</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body> -<a name="top"></a> -<h1><? echo $controlrow["gamename"]; ?> Help</h1> -[ <a href="index.php">Return to the game</a> ] - -<br /><br /><hr /> - -<h3>Table of Contents</h3> -<ul> -<li /><a href="#intro">Introduction</a> -<li /><a href="#classes">Character Classes</a> -<li /><a href="#difficulties">Difficulty Levels</a> -<li /><a href="#intown">Playing The Game: In Town</a> -<li /><a href="#exploring">Playing The Game: Exploring & Fighting</a> -<li /><a href="#status">Playing The Game: Status Panels</a> -<li /><a href="#items">Spoilers: Items & Drops</a> -<li /><a href="#monsters">Spoilers: Monsters</a> -<li /><a href="#spells">Spoilers: Spells</a> -<li /><a href="#levels">Spoilers: Levels</a> -<li /><a href="#credits">Credits</a> -</ul> - -<hr /> - -<h3><a name="intro"></a>Introduction</h3> -Firstly, I'd like to say thank you for playing my game. The <i>Dragon Knight</i> game engine is the result of several months of -planning, coding and testing. The original idea was to create a web-based tribute to the NES game, <i>Dragon -Warrior</i>. In its current iteration, only the underlying fighting system really resembles that game, as almost -everything else in DK has been made bigger and better. But you should still recognize bits and pieces as stemming -from <i>Dragon Warrior</i> and other RPGs of old.<br /><br /> -This is the first game I've ever written, and it has definitely been a positive experience. It got difficult at -times, admittedly, but it was still a lot of fun to write, and even more fun to play. And I hope to use this -experience so that if I ever want to create another game it will be even better than this one.<br /><br /> -If you are a site administrator, and would like to install a copy of DK on your own server, you may visit the -<a href="http://dragon.se7enet.com/dev.php" target="_new">development site</a> for <i>Dragon Knight</i>. This page -includes the downloadable game souce code, as well as some other resources that developers and administrators may -find valuable.<br /><br /> -Once again, thanks for playing!<br /><br /> -<i>Jamin Seven</i><br /> -<i>Dragon Knight creator</i><br /> -<a href="http://www.se7enet.com" target="_new">My Homepage</a><br /> -<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight Homepage</a><br ><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="classes"></a>Character Classes</h3> -There are three character classes in the game. The main differences between the classes are what spells you get -access to, the speed with which you level up, and the amount of HP/MP/strength/dexterity you gain per level. Below -is a basic outline of each of the character classes. For more detailed information about the characters, please -view the Levels table at the bottom of this page. Also, note that the outline below refers to the stock class setup -for the game. If your administrator has used his/her own class setup, this information may not be accurate.<br /><br /> -<b><? echo $controlrow["class1name"]; ?></b> -<ul> -<li />Fast level-ups -<li />High hit points -<li />High magic points -<li />Low strength -<li />Low dexterity -<li />5 heal spells -<li />5 hurt spells -<li />3 sleep spells -<li />3 +defense spells -<li />0 +attack spells -</ul> -<b><? echo $controlrow["class2name"]; ?></b> -<ul> -<li />Medium level-ups -<li />Medium hit points -<li />Low magic points -<li />High strength -<li />Low dexterity -<li />3 heal spells -<li />3 hurt spells -<li />2 sleep spells -<li />3 +defense spells -<li />3 +attack spells -</ul> -<b><? echo $controlrow["class3name"]; ?></b> -<ul> -<li />Slow level-ups -<li />Medium hit points -<li />Medium magic points -<li />Low strength -<li />High dexterity -<li />4 heal spells -<li />4 hurt spells -<li />3 sleep spells -<li />2 +defense spells -<li />2 +attack spells -</ul> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="difficulties"></a>Difficulty Levels</h3> -<i><? echo $controlrow["gamename"]; ?></i> includes the ability to play using one of three difficulty levels. -All monster statistics in the game are set at a base number. However, using a difficulty multiplier, certain statistics -are increased. The amount of hit points a monster has goes up, which means it will take longer to kill. But the amount -of experience and gold you gain from killing it also goes up. So the game is a little bit harder, but it is also more -rewarding. The following are the three difficulty levels and their statistic multiplier, which applies to the monster's -HP, experience drop, and gold drop. -<ul> -<li /><? echo $controlrow["diff1name"] . ": <b>" . $controlrow["diff1mod"] . "</b>"; ?> -<li /><? echo $controlrow["diff2name"] . ": <b>" . $controlrow["diff2mod"] . "</b>"; ?> -<li /><? echo $controlrow["diff3name"] . ": <b>" . $controlrow["diff3mod"] . "</b>"; ?> -</ul> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="intown"></a>Playing The Game: In Town</h3> -When you begin a new game, the first thing you see is the Town screen. Towns serve four primary functions: healing, buying items, -buying maps, and displaying game information.<br /><br /> -To heal yourself, click the "Rest at the Inn" link at the top of the town screen. Each town's Inn has a different price - some towns -are cheap, others are expensive. No matter what town you're in, the Inns always serve the same function: they restore your current -hit points, magic points, and travel points to their maximum amounts. Out in the field, you are free to use healing spells to restore -your hit points, but when you run low on magic points, the only way to restore them is at an Inn.<br /><br /> -Buying weapons and armor is accomplished through the appropriately-named "Buy Weapons/Armor" link. Not every item is available in -every town, so in order to get the most powerful items, you'll need to explore some of the outer towns. Once you've clicked the link, -you are presented with a list of items available in this town's store. To the left of each item is an icon that represents its type: -weapon, armor or shield. The amount of attack/defense power, as well as the item's price, are displayed to the right of the item name. -You'll notice that some items have a red asterisk (<span class="highlight">*</span>) next to their names. These are items that come -with special attributes that modify other parts of your character profile. See the Items & Drops table at the bottom of this page for -more information about special items.<br /><br /> -Maps are the third function in towns. Buying a map to a town places the town in your Travel To box in the left status panel. Once -you've purchased a town's map, you can click its name from your Travel To box and you will jump to that town. Travelling this way -costs travel points, though, and you'll only be able to visit towns if you have enough travel points.<br /><br /> -The final function in towns is displaying game information and statistics. This includes the latest news post made by the game -administrator, a list of players who have been online recently, and the Babble Box.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="exploring"></a>Playing The Game: Exploring & Fighting</h3> -Once you're done in town, you are free to start exploring the world. Use the compass buttons on the left status panel to move around. -The game world is basically a big square, divided into four quadrants. Each quadrant is <? echo $controlrow["gamesize"]; ?> spaces -square. The first town is usually located at (0N,0E). Click the North button from the first town, and now you'll be at (1N,0E). -Likewise, if you now click the West button, you'll be at (1N,1W). Monster levels increase with every 5 spaces you move outward -from (0N,0E).<br /><br /> -While you're exploring, you will occasionally run into monsters. As in pretty much any other RPG game, you and the monster take turns -hitting each other in an attempt to reduce each other's hit points to zero. Once you run into a monster, the Exploring screen changes -to the Fighting screen.<br /><br /> -When a fight begins, you'll see the monster's name and hit points, and the game will ask you for your first command. You then get to -pick whether you want to fight, use a spell, or run away. Note, though, that sometimes the monster has the chance to hit you -first.<br /><br /> -The Fight button is pretty straightforward: you attack the monster, and the amount of damage dealt is based on your attack power and -the monster's armor. On top of that, there are two other things that can happen: an Excellent Hit, which doubles your total attack -damage; and a monster dodge, which results in you doing no damage to the monster.<br /><br /> -The Spell button allows you to pick an available spell and cast it. See the Spells list at the bottom of this page for more information -about spells.<br /><br /> -Finally, there is the Run button, which lets you run away from a fight if the monster is too powerful. Be warned, though: it is -possible for the monster to block you from running and attack you. So if your hit points are low, you may fare better by staying -around monsters that you know can't do much damage to you.<br /><br /> -Once you've had your turn, the monster also gets his turn. It is also possible for you to dodge the monster's attack and take no -damage.<br /><br /> -The end result of a fight is either you or the monster being knocked down to zero hit points. If you win, the monster dies and will -give you a certain amount of experience and gold. There is also a chance that the monster will drop an item, which you can put into -one of the three inventory slots to give you extra points in your character profile. If you lose and die, half of your gold is taken -away - however, you are given back a few hit points to help you make it back to town (for example, if you don't have enough gold to -pay for an Inn, and need to kill a couple low-level monsters to get the money).<br /><br /> -When the fight is over, you can continue exploring until you find another monster to beat into submission.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="status"></a>Playing The Game: Status Panels</h3> -There are two status panels on the game screen: left and right.<br /><br /> -The left panel inclues your current location and play status (In Town, Exploring, Fighting), compass buttons for movement, and the -Travel To list for jumping between towns. At the bottom of the left panel is also a list of game functions.<br /><br /> -The right panel displays some character statistics, your inventory, and quick spells.<br /><br /> -The Character section shows the most important character statistics. It also displays the status bars for your current hit points, -magic points and travel points. These status bars are colored either green, yellow or red depending on your current amount of each -stat. There is also a link to pop up your list of extended statistics, which shows more detailed character information.<br /><br /> -The Fast Spells section lists any Heal spells you've learned. You may use these links any time you are in town or exploring to cast -the heal spell. These may not be used during fights, however - you have to use the Spells box on the fight screen for that. -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="items"></a>Spoilers: Items & Drops</h3> -<a href="help_items.php">Click here</a> for the Items & Drops spoiler page.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="monsters"></a>Spoilers: Monsters</h3> -<a href="help_monsters.php">Click here</a> for the Monsters spoiler page.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="spells"></a>Spoilers: Spells</h3> -<a href="help_spells.php">Click here</a> for the Spells spoiler page.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="levels"></a>Spoilers: Levels</h3> -<a href="help_levels.php">Click here</a> for the Levels spoiler page.<br /><br /> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /> - -<h3><a name="credits"></a>Credits</h3> -<ul> -<li /><b>All program code and stock graphics for the game were created by Jamin Seven</b>.<br /><br /> -<li />Major props go to a few people on the PHP manual site, for help with various chunks of code. The specific people are listed in the source code.<br /><br /> -<li />Super monkey love goes to Enix and the developers of <i>Dragon Warrior</i>. If it weren't for you guys, my game never would have been made.<br /><br /> -<li />Mega props go to Dalez from GameFAQs for his DW3 experience chart, which was where I got my experience levels from.<br /><br /> -<li />Mad crazy ninja love goes to the following people for help and support throughout the development process:<br /><br /> -<b>Ideas:</b> (whether they got used or not) -<ul> -<li />kushet -<li />lghtning -<li />Ebolamonkey3000 -<li />Crimson Scythe -<li />SilDeath -</ul><br /> -<b>Beta Testing:</b> (forums name if applicable, character name otherwise) -<ul> -<li />Ebolamonkey3000 -<li />lisi -<li />Junglist -<li />Crimson Scythe -<li />Sk8erpunk69 -<li />lghtning -<li />kushet -<li />SilDeath -<li />lowrider4life -<li />dubiin -<li />Sam Wise The Great -</ul><br /> -<li />Apologies and lots of happy naked love to anyone I forgot.<br /><br /> -<li />And of course, thanks to <b>you</b> for playing my game!<br /><br /> -<li /><a href="../index.php?do=ninja">NINJA!</a> -</ul> -[ <a href="#top">Top</a> ] - -<br /><br /><hr /><br /> - -Please visit the following sites for more information:<br /> -<a href="http://www.se7enet.com" target="_new">Se7enet</a> (Jamin's homepage)<br /> -<a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a> (official DK homepage)<br /> -<a href="http://se7enet.com/eve" target="_new">Forums</a> (official DK forums)<br /><br /> -All original coding and graphics for the <i>Dragon Knight</i> game engine are © 2003-2004 by Jamin Seven.<br /><br /> -[ <a href="#top">Top</a> ] -<br /><br /> -<table class="copyright" width="100%"><tr> -<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2004 by renderse7en</td> -</tr></table> -</body> -</html> -\ No newline at end of file +<?php // login.php :: Handles logins and cookies. + +include('lib_log.php'); +if (isset($_GET["do"])) { + if ($_GET["do"] == "login") { login(); } + elseif ($_GET["do"] == "logout") { logout(); } +} + +function login() { + + include('config.php'); + $link = opendb(); + + if (isset($_POST["submit_x"])) { + + $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } + $row = mysql_fetch_array($query); + if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } + $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; + setcookie("dkgame", $cookie, $expiretime, "/", "", 0); + header("Location: index.php"); + die(); + + } + + $page = gettemplate("help"); + $title = "Nous aider"; + display($page, $title, false, true, false); + +} + + +function logout() { + + setcookie("dkgame", "", time()-100000, "/", "", 0); + header("Location: login.php?do=login"); + die(); + +} + +?> +\ No newline at end of file diff --git a/help_items.php b/help_items.php @@ -1,155 +0,0 @@ -<?php -include('lib.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); -ob_start("ob_gzhandler"); -?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title><? echo $controlrow["gamename"]; ?> Help</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body> -<a name="top"></a> -<h1><? echo $controlrow["gamename"]; ?> Help: Items & Drops</h1> -[ <a href="help.php">Return to Help</a> | <a href="index.php">Return to the game</a> ] - -<br /><br /><hr /> - -<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="5" bgcolor="#ffffff"><center><b>Items</b></center></td></tr> -<tr><td><b>Type</b></td><td><b>Name</b></td><td><b>Cost</b></td><td><b>Attribute</b></td><td><b>Special</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "items"); -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["type"] == 1) { $image = "weapon"; $power = "Attack"; } elseif ($itemsrow["type"] == 2) { $image = "armor"; $power = "Defense"; } else { $image = "shield"; $power = "Defense"; } - if ($itemsrow["special"] != "X") { - $special = explode(",",$itemsrow["special"]); - if ($special[0] == "maxhp") { $attr = "Max HP"; } - elseif ($special[0] == "maxmp") { $attr = "Max MP"; } - elseif ($special[0] == "maxtp") { $attr = "Max TP"; } - elseif ($special[0] == "goldbonus") { $attr = "Gold Bonus (%)"; } - elseif ($special[0] == "expbonus") { $attr = "Experience Bonus (%)"; } - elseif ($special[0] == "strength") { $attr = "Strength"; } - elseif ($special[0] == "dexterity") { $attr = "Dexterity"; } - elseif ($special[0] == "attackpower") { $attr = "Attack Power"; } - elseif ($special[0] == "defensepower") { $attr = "Defense Power"; } - else { $attr = $special[0]; } - if ($special[1] > 0) { $stat = "+" . $special[1]; } else { $stat = $special[1]; } - $bigspecial = "$attr $stat"; - } else { $bigspecial = "<span class=\"light\">None</span>"; } - echo "<tr><td $color width=\"5%\"><img src=\"images/icon_$image.gif\" alt=\"$image\"></td><td $color width=\"30%\">".$itemsrow["name"]."</td><td $color width=\"20%\">".$itemsrow["buycost"]." Gold</td><td $color width=\"20%\">".$itemsrow["attribute"]." $power Power</td><td $color width=\"25%\">$bigspecial</td></tr>\n"; -} -?> -</table> -<br /> -<br /> -<table width="60%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="4" bgcolor="#ffffff"><center><b>Drops</b></center></td></tr> -<tr><td><b>Name</b></td><td><b>Monster Level</b></td><td><b>Attribute 1</b></td><td><b>Attribute 2</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "drops"); -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["attribute1"] != "X") { - $special1 = explode(",",$itemsrow["attribute1"]); - if ($special1[0] == "maxhp") { $attr1 = "Max HP"; } - elseif ($special1[0] == "maxmp") { $attr1 = "Max MP"; } - elseif ($special1[0] == "maxtp") { $attr1 = "Max TP"; } - elseif ($special1[0] == "goldbonus") { $attr1 = "Gold Bonus (%)"; } - elseif ($special1[0] == "expbonus") { $attr1 = "Experience Bonus (%)"; } - elseif ($special1[0] == "strength") { $attr1 = "Strength"; } - elseif ($special1[0] == "dexterity") { $attr1 = "Dexterity"; } - elseif ($special1[0] == "attackpower") { $attr1 = "Attack Power"; } - elseif ($special1[0] == "defensepower") { $attr1 = "Defense Power"; } - else { $attr1 = $special1[0]; } - if ($special1[1] > 0) { $stat1 = "+" . $special1[1]; } else { $stat1 = $special1[1]; } - $bigspecial1 = "$attr1 $stat1"; - } else { $bigspecial1 = "<span class=\"light\">None</span>"; } - if ($itemsrow["attribute2"] != "X") { - $special2 = explode(",",$itemsrow["attribute2"]); - if ($special2[0] == "maxhp") { $attr2 = "Max HP"; } - elseif ($special2[0] == "maxmp") { $attr2 = "Max MP"; } - elseif ($special2[0] == "maxtp") { $attr2 = "Max TP"; } - elseif ($special2[0] == "goldbonus") { $attr2 = "Gold Bonus (%)"; } - elseif ($special2[0] == "expbonus") { $attr2 = "Experience Bonus (%)"; } - elseif ($special2[0] == "strength") { $attr2 = "Strength"; } - elseif ($special2[0] == "dexterity") { $attr2 = "Dexterity"; } - elseif ($special2[0] == "attackpower") { $attr2 = "Attack Power"; } - elseif ($special2[0] == "defensepower") { $attr2 = "Defense Power"; } - else { $attr2 = $special2[0]; } - if ($special2[1] > 0) { $stat2 = "+" . $special2[1]; } else { $stat2 = $special2[1]; } - $bigspecial2 = "$attr2 $stat2"; - } else { $bigspecial2 = "<span class=\"light\">None</span>"; } - echo "<tr><td $color width=\"25%\">".$itemsrow["name"]."</td><td $color width=\"15%\">".$itemsrow["mlevel"]."</td><td $color width=\"30%\">$bigspecial1</td><td $color width=\"30%\">$bigspecial2</td></tr>\n"; -} -?> -</table> -<br /> -<table class="copyright" width="100%"><tr> -<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2004 by renderse7en</td> -</tr></table> -</body> -</html> -\ No newline at end of file diff --git a/help_levels.php b/help_levels.php @@ -1,141 +0,0 @@ -<?php -include('lib.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); -ob_start("ob_gzhandler"); -?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title><? echo $controlrow["gamename"]; ?> Help</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body> -<a name="top"></a> -<h1><? echo $controlrow["gamename"]; ?> Help: Levels</h1> -[ <a href="help.php">Return to Help</a> | <a href="index.php">Return to the game</a> ] - -<br /><br /><hr /> - -<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class1name"]; ?> Levels</b></center></td></tr> -<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT id,1_exp,1_hp,1_mp,1_tp,1_strength,1_dexterity,1_spells FROM {{table}} ORDER BY id", "levels"); -$spellsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells"); -$spells = array(); -while ($spellsrow = mysql_fetch_array($spellsquery)) { - $spells[$spellsrow["id"]] = $spellsrow; -} -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["1_spells"] != 0) { $spell = $spells[$itemsrow["1_spells"]]["name"]; } else { $spell = "<span class=\"light\">None</span>"; } - if ($itemsrow["id"] != 100) { echo "<tr><td $color width=\"12%\">".$itemsrow["id"]."</td><td $color width=\"12%\">".number_format($itemsrow["1_exp"])."</td><td $color width=\"12%\">".$itemsrow["1_hp"]."</td><td $color width=\"12%\">".$itemsrow["1_mp"]."</td><td $color width=\"12%\">".$itemsrow["1_tp"]."</td><td $color width=\"12%\">".$itemsrow["1_strength"]."</td><td $color width=\"12%\">".$itemsrow["1_dexterity"]."</td><td $color width=\"12%\">$spell</td></tr>\n"; } -} -?> -</table> -<br /><br /> -<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class2name"]; ?> Levels</b></center></td></tr> -<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT id,2_exp,2_hp,2_mp,2_tp,2_strength,2_dexterity,2_spells FROM {{table}} ORDER BY id", "levels"); -$spellsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells"); -$spells = array(); -while ($spellsrow = mysql_fetch_array($spellsquery)) { - $spells[$spellsrow["id"]] = $spellsrow; -} -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["2_spells"] != 0) { $spell = $spells[$itemsrow["2_spells"]]["name"]; } else { $spell = "<span class=\"light\">None</span>"; } - if ($itemsrow["id"] != 100) { echo "<tr><td $color width=\"12%\">".$itemsrow["id"]."</td><td $color width=\"12%\">".number_format($itemsrow["2_exp"])."</td><td $color width=\"12%\">".$itemsrow["2_hp"]."</td><td $color width=\"12%\">".$itemsrow["2_mp"]."</td><td $color width=\"12%\">".$itemsrow["2_tp"]."</td><td $color width=\"12%\">".$itemsrow["2_strength"]."</td><td $color width=\"12%\">".$itemsrow["2_dexterity"]."</td><td $color width=\"12%\">$spell</td></tr>\n"; } -} -?> -</table> -<br /><br /> -<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="8" bgcolor="#ffffff"><center><b><? echo $controlrow["class3name"]; ?> Levels</b></center></td></tr> -<tr><td><b>Level</b><td><b>Exp.</b></td><td><b>HP</b></td><td><b>MP</b></td><td><b>TP</b></td><td><b>Strength</b></td><td><b>Dexterity</b></td><td><b>Spell</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT id,3_exp,3_hp,3_mp,3_tp,3_strength,3_dexterity,3_spells FROM {{table}} ORDER BY id", "levels"); -$spellsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells"); -$spells = array(); -while ($spellsrow = mysql_fetch_array($spellsquery)) { - $spells[$spellsrow["id"]] = $spellsrow; -} -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["3_spells"] != 0) { $spell = $spells[$itemsrow["3_spells"]]["name"]; } else { $spell = "<span class=\"light\">None</span>"; } - if ($itemsrow["id"] != 100) { echo "<tr><td $color width=\"12%\">".$itemsrow["id"]."</td><td $color width=\"12%\">".number_format($itemsrow["3_exp"])."</td><td $color width=\"12%\">".$itemsrow["3_hp"]."</td><td $color width=\"12%\">".$itemsrow["3_mp"]."</td><td $color width=\"12%\">".$itemsrow["3_tp"]."</td><td $color width=\"12%\">".$itemsrow["3_strength"]."</td><td $color width=\"12%\">".$itemsrow["3_dexterity"]."</td><td $color width=\"12%\">$spell</td></tr>\n"; } -} -?> -</table> -<br /> -Experience points listed are total values up until that point. All other values are just the new amount that you gain for each level. -<br /><br /> -<table class="copyright" width="100%"><tr> -<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2004 by renderse7en</td> -</tr></table> -</body> -</html> -\ No newline at end of file diff --git a/help_monsters.php b/help_monsters.php @@ -1,96 +0,0 @@ -<?php -include('lib.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); -ob_start("ob_gzhandler"); -?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title><? echo $controlrow["gamename"]; ?> Help</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body> -<a name="top"></a> -<h1><? echo $controlrow["gamename"]; ?> Help: Monsters</h1> -[ <a href="help.php">Return to Help</a> | <a href="index.php">Return to the game</a> ] - -<br /><br /><hr /> - -<table width="75%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="8" bgcolor="#ffffff"><center><b>Monsters</b></center></td></tr> -<tr><td><b>Name</b></td><td><b>Max HP</b></td><td><b>Max Damage</b></td><td><b>Armor</b></td><td><b>Level</b></td><td><b>Max Exp.</b></td><td><b>Max Gold</b></td><td><b>Immunity</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "monsters"); -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["immune"] == 0) { $immune = "<span class=\"light\">None</span>"; } elseif ($itemsrow["immune"] == 1) { $immune = "Hurt"; } else { $immune = "Hurt & Sleep"; } - echo "<tr><td $color width=\"30%\">".$itemsrow["name"]."</td><td $color width=\"10%\">".$itemsrow["maxhp"]."</td><td $color width=\"10%\">".$itemsrow["maxdam"]."</td><td $color width=\"10%\">".$itemsrow["armor"]."</td><td $color width=\"10%\">".$itemsrow["level"]."</td><td $color width=\"10%\">".$itemsrow["maxexp"]."</td><td $color width=\"10%\">".$itemsrow["maxgold"]."</td><td $color width=\"20%\">$immune</td></tr>\n"; -} -?> -</table> -<br /> -<table class="copyright" width="100%"><tr> -<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2004 by renderse7en</td> -</tr></table> -</body> -</html> -\ No newline at end of file diff --git a/help_spells.php b/help_spells.php @@ -1,106 +0,0 @@ -<?php -include('lib.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); -ob_start("ob_gzhandler"); -?> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title><? echo $controlrow["gamename"]; ?> Help</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body> -<a name="top"></a> -<h1><? echo $controlrow["gamename"]; ?> Help: Spells</h1> -[ <a href="help.php">Return to Help</a> | <a href="index.php">Return to the game</a> ] - -<br /><br /><hr /> - -<table width="50%" style="border: solid 1px black" cellspacing="0" cellpadding="0"> -<tr><td colspan="8" bgcolor="#ffffff"><center><b>Spells</b></center></td></tr> -<tr><td><b>Name</b></td><td><b>Cost</b></td><td><b>Type</b></td><td><b>Attribute</b></td></tr> -<? -$count = 1; -$itemsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells"); -while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($count == 1) { $color = "bgcolor=\"#ffffff\""; $count = 2; } else { $color = ""; $count = 1; } - if ($itemsrow["type"] == 1) { $type = "Heal"; } - elseif ($itemsrow["type"] == 2) { $type = "Hurt"; } - elseif ($itemsrow["type"] == 3) { $type = "Sleep"; } - elseif ($itemsrow["type"] == 4) { $type = "+Damage (%)"; } - elseif ($itemsrow["type"] == 5) { $type = "+Defense (%)"; } - echo "<tr><td $color width=\"25%\">".$itemsrow["name"]."</td><td $color width=\"25%\">".$itemsrow["mp"]."</td><td $color width=\"25%\">$type</td><td $color width=\"25%\">".$itemsrow["attribute"]."</td></tr>\n"; -} -?> -</table> -<ul> -<li /><b>Heal</b> spells always give you the maximum amount possible, until your current HP is full. -<li /><b>Hurt</b> spells deal X damage (not always the maximum) to the monster, regardless of the monster's armor. -<li /><b>Sleep</b> spells put the monster to sleep. The monster has an X in 15 chance of remaining asleep each turn. -<li /><b>+Damage</b> spells increase your total attack damage by X percent until the end of the fight. -<li /><b>+Defense</b> spells reduce the total damage you take from the monster by X percent until the end of each fight. -</ul> -<table class="copyright" width="100%"><tr> -<td width="50%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="50%" align="center">© 2003-2004 by renderse7en</td> -</tr></table> -</body> -</html> -\ No newline at end of file diff --git a/home.php b/home.php @@ -0,0 +1,174 @@ +<?php // towns.php :: Handles all actions you can do in town. + +function travelto($id, $usepoints=true) { // Send a user to a town from the Travel To menu. + +global $userrow, $numqueries; + +$homequery = doquery("SELECT name,latitude,longitude FROM {{table}} WHERE id='$id' LIMIT 1", "maison"); +$homerow = mysql_fetch_array($homequery); + +if ($usepoints==true) { +if ($userrow["currenttp"] < 1) { +display("<img src=././images/desole.gif><br>Vous n'avez pas assez de TP pour vous rendre à cette maison. <br>Veuillez retourner et essayer encore quand vous aurez plus de PT.", "Se rendre à"); die(); +} +} + +if (($userrow["latitude"] == $homerow["latitude"]) && ($userrow["longitude"] == $homerow["longitude"])) { display("<img src=././images/bienvenue.gif/><br>Vous êtes déjà dans cette maison. <br><a href=index.php>Cliquez ici</a> pour retourner au menu principal de cette ville.", "Se rendre à"); die(); } + +if ($usepoints == true) { $newtp = $userrow["currenttp"] - $homerow["travelpoints"]; } else { $newtp = $userrow["currenttp"]; } + +$newlat = $homerow["latitude"]; +$newlon = $homerow["longitude"]; +$newid = $userrow["id"]; + +// If they got here by exploring, add this town to their map. +$mapped = explode(",",$userrow["towns"]); +$town = false; +foreach($mapped as $a => $b) { +if ($b == $id) { $town = true; } +} +$mapped = implode(",",$mapped); +if ($town == false) { +$mapped .= ",$id"; +$mapped = "towns='".$mapped."',"; +} else { +$mapped = "towns='".$mapped."',"; +} + +$updatequery = doquery("UPDATE {{table}} SET currentaction='En maison',$mapped currenttp='$newtp',latitude='$newlat',longitude='$newlon' WHERE id='$newid' LIMIT 1", "users"); + +$page = "<img src=././images/bienvenue.gif><br>Bienvenue dans la maison de ".$homerow["name"].". <br>Vous pouvez maintenant <a href=index.php>entrer chez lui</a>"; +$page .= "<center><iframe src=./map.php name=carte width=500 height=440 align=middle scrolling=No frameborder=0 allowtransparency=true></iframe></center>"; +display($page, "Se rendre à"); + +} + +function reposhome() { // Staying at the inn resets all expendable stats to their max values. + +global $userrow, $numqueries; + +$homequery = doquery("SELECT name,innprice,proprio FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "maison"); +$homerow = mysql_fetch_array($homequery); + +if ($userrow["gold"] < $homerow["innprice"]) { display("Vous n'avez pas assez de gils pour dormir dans cette maison ce soir.<br /><br />Vous pouvez <a href=index.php>retourner à l'accueil</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Dormir dans la chambre"); die(); } + +if (isset($_POST["submit"])) { + +$newgold = $userrow["gold"] - $homerow["innprice"]; +$newgold2 = $userrow["gold"] + $homerow["innprice"]; +$query = doquery("UPDATE {{table}} SET gold='$newgold',currenthp='".$userrow["maxhp"]."',currentmp='".$userrow["maxmp"]."',currenttp='".$userrow["maxtp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$query = doquery("UPDATE {{table}} SET gold='$newgold2' WHERE id='".$homerow["proprio"]."' LIMIT 1", "users"); +$title = "Auberge"; +$page = "Vous vous êtes réveillé avec le sentiment d'être régénéré. Vous êtes prêt pour le combat! <br /><br />Vous pouvez <a href=index.php>retourner à l'accueil</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde."; + +} elseif (isset($_POST["cancel"])) { + +header("Location: index.php"); die(); + +} else { + +$title = "Auberge"; +$page = "Le repos dans la chambre remplira vos barres de HP, MP, et TP à leurs niveaux maximum.<br /><br /> +"; +$page .= "Une nuit dans cette chambre vous coûtera <b>" . $homerow["innprice"] . " gils</b>. Est ce que vous acceptez?<br /><br /> +"; +$page .= "<form action=index.php?do=reposhome method='post'> +"; +$page .= "<input type='submit' name='submit' value='Oui' /> <input type='submit' name='cancel' value='Non' /> +"; +$page .= "</form> +"; +$page .= "<br><center><img src=././images/auberge.gif/></center> +"; +} + +display($page, $title); + +} + +function bierrehome() { // Staying at the inn resets all expendable stats to their max values. + +global $userrow, $numqueries; + +$homequery = doquery("SELECT name,buvette,proprio FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "maison"); +$homerow = mysql_fetch_array($homequery); + +if ($userrow["gold"] < $homerow["buvette"]) { display("Vous n'avez pas assez de gils pour acheter une bierre ce soir ce soir.<br /><br />Vous pouvez <a href=index.php>retourner à l'accueil</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Boire une bierre"); die(); } + +if (isset($_POST["submit"])) { + +$newgold = $userrow["gold"] - $homerow["buvette"]; +$newgold2 = $userrow["gold"] + $homerow["buvette"]; +$query = doquery("UPDATE {{table}} SET gold='$newgold',currenthp='".$userrow["maxhp"]."',currentmp='".$userrow["maxmp"]."',currenttp='".$userrow["maxtp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$query = doquery("UPDATE {{table}} SET gold='$newgold2' WHERE id='".$homerow["proprio"]."' LIMIT 1", "users"); +$title = "Auberge"; +$page = "Une bonne bierre et vous etes pret a reprendre la route. Vous êtes prêt pour le combat! <br /><br />Vous pouvez <a href=index.php>retourner à l'accueil</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde."; + +} elseif (isset($_POST["cancel"])) { + +header("Location: index.php"); die(); + +} else { + +$title = "Auberge"; +$page = "Boire une bierre vous remplira votre barre de TP à son niveau maximum.<br /><br /> +"; +$page .= "La bierre vous coûtera <b>" . $homerow["buvette"] . " gils</b>. Est ce que vous acceptez?<br /><br /> +"; +$page .= "<form action=index.php?do=bierrehome method='post'> +"; +$page .= "<input type='submit' name='submit' value='Oui' /> <input type='submit' name='cancel' value='Non' /> +"; +$page .= "</form> +"; +$page .= "<br><center><img src=././images/auberge.gif></center> +"; +} + +display($page, $title); + +} + +function msg() { + +global $userrow; + +$homequery = doquery("SELECT proprio FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "maison"); +$homerow = mysql_fetch_array($homequery); + +if (isset($_POST["msg"])) { + +$sender = $userrow["id"]; +$owner = $homerow["proprio"]; + +extract($_POST); +$errors = 0; +$errorlist = ""; +if ($reciever == $sender) { $errors++; $errorlist .= "There is no need to be sending gold to yourself."; } + +if ($errors == 0) { +$query = doquery("INSERT INTO {{table}} SET destinataire='$owner', message='$messa', envoyeur='$sender', titre='$title', date='NOW()', id=''","msg"); +display("Message envoyer.<br /><br /><a href='index.php'>Retourner en ville.</a>","Envoyer un message"); +} else { +display("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Merci de cliquer sur precedant et de recommancer.<br /><a href='index.php?do=msg'>Retour</a><br /></table>", "Envoyer un message"); +} + +} +$page .= "<b><u>Envoyer un message au proprietaire</u></b><br />Vous pouvez envoyez un message au proprietaire.<br /><table width='100%'><form method='post' action='index.php?do=msg'><tr><td width='30%'>Titre:</td><td><input name='title' type='text' size='30' maxlength='12' /> <br /></td></tr><tr><td width='30%'>message:</td><td><input name='messa' type='text' size='80' /><br /></td></tr><tr><td width='30%'><input name='msg' type='submit' value='Submit' /></form><tr><td colspan='2'><a href='index.php'>Retourner en ville</a></td></tr></table></table> +"; + + +display($page,"Envoyer un message"); +} + +function admin_maison() { global $userrow, $numqueries; if (isset($_POST["submit"])) { extract($_POST); if ( $nuit == "" ) {display("Mettre une valeur pour la nuit SVP !!!"); die(); } if ($userrow["currentaction"] == "En maison" ) { + $texte = new texte(); $query = doquery("UPDATE {{table}} SET innprice='$nuit',bloghome='".htmlentities($bloghome)."',buvette='$buvette' WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' AND name='".$userrow["charname"]."' LIMIT 1", "maison"); + $texte = new texte(); + $title = "Admin. maison"; $page .= "La mise a jour a bien été effectué : <br><br>Prix de la nuit : <strong>".$nuit."</strong> gils<br><br>Prix de la buvette : <strong>".$buvette."</strong> gils<br><br>MessageBlog : <strong>".$texte->ms_format(htmlentities($bloghome))."</strong><br><br><a href=\"index.php\">retourner dans la maison</a>."; } else {display("C'est pas bien de vouloir tricher.", "Tricheur !!"); die(); } } elseif (isset($_POST["cancel"])) { header("Location: index.php"); die(); } else { $maisonquery = doquery("SELECT innprice,bloghome,buvette FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' AND name='".$userrow["charname"]."' LIMIT 1", "maison"); $texte = new texte(); + $maisonrow = mysql_fetch_array($maisonquery); $title = "Admin. maison"; $page .= "Bienvenue dans l'aministration de votre maison.<br>Vous pouvez editer les prix et avoir un petit blog dans votre maison.<br><br>"; $page .= "<form name=\"form1\" method=\"post\" action=\"\">"; $page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"; $page .= "<td width=\"159\">Prix de la nuit : </td><td width=\"30\"></td>"; $page .= "<td width=\"28\"><input type=\"text\" name=\"nuit\" size=\"5\" value=\"".$maisonrow["innprice"]."\" > gils</td></tr><tr>"; + $page .= "<td width=\"159\">Prix de la buvette : </td><td width=\"30\"></td>"; + $page .= "<td width=\"28\"><input type=\"text\" name=\"buvette\" size=\"5\" value=\"".$maisonrow["buvette"]."\" > gils</td></tr><tr>"; + $page .= "<td width=\"159\">MessageBlog : </td><td width=\"30\"></td>"; + $page .= "<td width=\"28\"><textarea name=\"bloghome\" size=\"600\">".$texte->ms_format(htmlentities($maisonrow["bloghome"]))."</textarea></td></tr><tr>"; + $page .= "</tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td>"; $page .= "<td align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Valide\">"; $page .= "</td></tr></table></form>"; } display($page, $title); } +?> +\ No newline at end of file diff --git a/images/allopass.jpg b/images/allopass.jpg Binary files differ. diff --git a/images/arme.gif b/images/arme.gif Binary files differ. diff --git a/images/armure.gif b/images/armure.gif Binary files differ. diff --git a/images/aub.gif b/images/aub.gif Binary files differ. diff --git a/images/auberge.gif b/images/auberge.gif Binary files differ. diff --git a/images/avatar/1.gif b/images/avatar/1.gif Binary files differ. diff --git a/images/avatar/num-0.gif b/images/avatar/num-0.gif Binary files differ. diff --git a/images/avatar/num-1.gif b/images/avatar/num-1.gif Binary files differ. diff --git a/images/avatar/num-10.gif b/images/avatar/num-10.gif Binary files differ. diff --git a/images/avatar/num-11.gif b/images/avatar/num-11.gif Binary files differ. diff --git a/images/avatar/num-12.gif b/images/avatar/num-12.gif Binary files differ. diff --git a/images/avatar/num-13.gif b/images/avatar/num-13.gif Binary files differ. diff --git a/images/avatar/num-14.gif b/images/avatar/num-14.gif Binary files differ. diff --git a/images/avatar/num-15.gif b/images/avatar/num-15.gif Binary files differ. diff --git a/images/avatar/num-16.gif b/images/avatar/num-16.gif Binary files differ. diff --git a/images/avatar/num-17.gif b/images/avatar/num-17.gif Binary files differ. diff --git a/images/avatar/num-18.gif b/images/avatar/num-18.gif Binary files differ. diff --git a/images/avatar/num-19.gif b/images/avatar/num-19.gif Binary files differ. diff --git a/images/avatar/num-2.gif b/images/avatar/num-2.gif Binary files differ. diff --git a/images/avatar/num-20.gif b/images/avatar/num-20.gif Binary files differ. diff --git a/images/avatar/num-21.gif b/images/avatar/num-21.gif Binary files differ. diff --git a/images/avatar/num-22.gif b/images/avatar/num-22.gif Binary files differ. diff --git a/images/avatar/num-23.gif b/images/avatar/num-23.gif Binary files differ. diff --git a/images/avatar/num-24.gif b/images/avatar/num-24.gif Binary files differ. diff --git a/images/avatar/num-25.gif b/images/avatar/num-25.gif Binary files differ. diff --git a/images/avatar/num-26.gif b/images/avatar/num-26.gif Binary files differ. diff --git a/images/avatar/num-27.gif b/images/avatar/num-27.gif Binary files differ. diff --git a/images/avatar/num-28.gif b/images/avatar/num-28.gif Binary files differ. diff --git a/images/avatar/num-29.gif b/images/avatar/num-29.gif Binary files differ. diff --git a/images/avatar/num-3.gif b/images/avatar/num-3.gif Binary files differ. diff --git a/images/avatar/num-30.gif b/images/avatar/num-30.gif Binary files differ. diff --git a/images/avatar/num-4.gif b/images/avatar/num-4.gif Binary files differ. diff --git a/images/avatar/num-5.gif b/images/avatar/num-5.gif Binary files differ. diff --git a/images/avatar/num-6.gif b/images/avatar/num-6.gif Binary files differ. diff --git a/images/avatar/num-7.gif b/images/avatar/num-7.gif Binary files differ. diff --git a/images/avatar/num-8.gif b/images/avatar/num-8.gif Binary files differ. diff --git a/images/avatar/num-9.gif b/images/avatar/num-9.gif Binary files differ. diff --git a/images/background.gif b/images/background.gif Binary files differ. diff --git a/images/background.jpg b/images/background.jpg Binary files differ. diff --git a/images/banmini10.gif b/images/banmini10.gif Binary files differ. diff --git a/images/barre.gif b/images/barre.gif Binary files differ. diff --git a/images/bb03.png b/images/bb03.png Binary files differ. diff --git a/images/bienvenue.gif b/images/bienvenue.gif Binary files differ. diff --git a/images/blog.gif b/images/blog.gif Binary files differ. diff --git a/images/bouclier.gif b/images/bouclier.gif Binary files differ. diff --git a/images/bouton_effacer.gif b/images/bouton_effacer.gif Binary files differ. diff --git a/images/bouton_envoyer.gif b/images/bouton_envoyer.gif Binary files differ. diff --git a/images/button_character.gif b/images/button_character.gif Binary files differ. diff --git a/images/button_fastspells.gif b/images/button_fastspells.gif Binary files differ. diff --git a/images/button_functions.gif b/images/button_functions.gif Binary files differ. diff --git a/images/button_help.gif b/images/button_help.gif Binary files differ. diff --git a/images/button_inventory.gif b/images/button_inventory.gif Binary files differ. diff --git a/images/button_location.gif b/images/button_location.gif Binary files differ. diff --git a/images/button_login.gif b/images/button_login.gif Binary files differ. diff --git a/images/button_logout.gif b/images/button_logout.gif Binary files differ. diff --git a/images/button_register.gif b/images/button_register.gif Binary files differ. diff --git a/images/button_shoutbox.gif b/images/button_shoutbox.gif Binary files differ. diff --git a/images/button_spells.gif b/images/button_spells.gif Binary files differ. diff --git a/images/button_status.gif b/images/button_status.gif Binary files differ. diff --git a/images/button_towns.gif b/images/button_towns.gif Binary files differ. diff --git a/images/carte.gif b/images/carte.gif Binary files differ. diff --git a/images/classement/avatar-1.jpg b/images/classement/avatar-1.jpg Binary files differ. diff --git a/images/classement/avatar-2.jpg b/images/classement/avatar-2.jpg Binary files differ. diff --git a/images/classement/avatar-3.jpg b/images/classement/avatar-3.jpg Binary files differ. diff --git a/images/classement/bg1_best.gif b/images/classement/bg1_best.gif Binary files differ. diff --git a/images/classement/bg2_best.gif b/images/classement/bg2_best.gif Binary files differ. diff --git a/images/classement/bg3_best.gif b/images/classement/bg3_best.gif Binary files differ. diff --git a/images/classement/bouton_infos.gif b/images/classement/bouton_infos.gif Binary files differ. diff --git a/images/classement/class-1.gif b/images/classement/class-1.gif Binary files differ. diff --git a/images/classement/class-2.gif b/images/classement/class-2.gif Binary files differ. diff --git a/images/classement/class-3.gif b/images/classement/class-3.gif Binary files differ. diff --git a/images/classement/espace.gif b/images/classement/espace.gif Binary files differ. diff --git a/images/classement/num-1.gif b/images/classement/num-1.gif Binary files differ. diff --git a/images/classement/num-10.gif b/images/classement/num-10.gif Binary files differ. diff --git a/images/classement/num-2.gif b/images/classement/num-2.gif Binary files differ. diff --git a/images/classement/num-3.gif b/images/classement/num-3.gif Binary files differ. diff --git a/images/classement/num-4.gif b/images/classement/num-4.gif Binary files differ. diff --git a/images/classement/num-5.gif b/images/classement/num-5.gif Binary files differ. diff --git a/images/classement/num-6.gif b/images/classement/num-6.gif Binary files differ. diff --git a/images/classement/num-7.gif b/images/classement/num-7.gif Binary files differ. diff --git a/images/classement/num-8.gif b/images/classement/num-8.gif Binary files differ. diff --git a/images/classement/num-9.gif b/images/classement/num-9.gif Binary files differ. diff --git a/images/classement/tirets.gif b/images/classement/tirets.gif Binary files differ. diff --git a/images/compass_01.gif b/images/compass_01.gif Binary files differ. diff --git a/images/compass_02.gif b/images/compass_02.gif Binary files differ. diff --git a/images/compass_03.gif b/images/compass_03.gif Binary files differ. diff --git a/images/compass_04.gif b/images/compass_04.gif Binary files differ. diff --git a/images/desole.gif b/images/desole.gif Binary files differ. diff --git a/images/dkforumsbutton.gif b/images/dkforumsbutton.gif Binary files differ. diff --git a/images/felicitation.gif b/images/felicitation.gif Binary files differ. diff --git a/images/fond_carte.gif b/images/fond_carte.gif Binary files differ. diff --git a/images/fond_carte.png b/images/fond_carte.png Binary files differ. diff --git a/images/fond_menu.jpg b/images/fond_menu.jpg Binary files differ. diff --git a/images/forum.jpg b/images/forum.jpg Binary files differ. diff --git a/images/gold.gif b/images/gold.gif Binary files differ. diff --git a/images/help_exploring.jpg b/images/help_exploring.jpg Binary files differ. diff --git a/images/help_fighting.jpg b/images/help_fighting.jpg Binary files differ. diff --git a/images/ico.ico b/images/ico.ico Binary files differ. diff --git a/images/icon_amulet.gif b/images/icon_amulet.gif Binary files differ. diff --git a/images/icon_drink.gif b/images/icon_drink.gif Binary files differ. diff --git a/images/icon_news.gif b/images/icon_news.gif Binary files differ. diff --git a/images/icon_parchment.gif b/images/icon_parchment.gif Binary files differ. diff --git a/images/icon_paxe.gif b/images/icon_paxe.gif Binary files differ. diff --git a/images/icon_potion.gif b/images/icon_potion.gif Binary files differ. diff --git a/images/icon_sac.gif b/images/icon_sac.gif Binary files differ. diff --git a/images/icon_shield.gif b/images/icon_shield.gif Binary files differ. diff --git a/images/icon_weapon.gif b/images/icon_weapon.gif Binary files differ. diff --git a/images/im_admin.gif b/images/im_admin.gif Binary files differ. diff --git a/images/intro_login.gif b/images/intro_login.gif Binary files differ. diff --git a/images/leftnav_log/bouton_resultats.gif b/images/leftnav_log/bouton_resultats.gif Binary files differ. diff --git a/images/leftnav_log/bouton_voter.gif b/images/leftnav_log/bouton_voter.gif Binary files differ. diff --git a/images/leftnav_log/click-guide.gif b/images/leftnav_log/click-guide.gif Binary files differ. diff --git a/images/leftnav_log/log_valid.gif b/images/leftnav_log/log_valid.gif Binary files differ. diff --git a/images/lesencheres.jpg b/images/lesencheres.jpg Binary files differ. diff --git a/images/ligne.gif b/images/ligne.gif Binary files differ. diff --git a/images/logo.gif b/images/logo.gif Binary files differ. diff --git a/images/maison.gif b/images/maison.gif Binary files differ. diff --git a/images/map.gif b/images/map.gif Binary files differ. diff --git a/images/marche.gif b/images/marche.gif Binary files differ. diff --git a/images/messagerie.jpg b/images/messagerie.jpg Binary files differ. diff --git a/images/monstre/1.gif b/images/monstre/1.gif Binary files differ. diff --git a/images/monstre/10.gif b/images/monstre/10.gif Binary files differ. diff --git a/images/monstre/100.gif b/images/monstre/100.gif Binary files differ. diff --git a/images/monstre/101.gif b/images/monstre/101.gif Binary files differ. diff --git a/images/monstre/102.gif b/images/monstre/102.gif Binary files differ. diff --git a/images/monstre/103.gif b/images/monstre/103.gif Binary files differ. diff --git a/images/monstre/104.gif b/images/monstre/104.gif Binary files differ. diff --git a/images/monstre/105.gif b/images/monstre/105.gif Binary files differ. diff --git a/images/monstre/106.gif b/images/monstre/106.gif Binary files differ. diff --git a/images/monstre/107.gif b/images/monstre/107.gif Binary files differ. diff --git a/images/monstre/108.gif b/images/monstre/108.gif Binary files differ. diff --git a/images/monstre/109.gif b/images/monstre/109.gif Binary files differ. diff --git a/images/monstre/11.gif b/images/monstre/11.gif Binary files differ. diff --git a/images/monstre/110.gif b/images/monstre/110.gif Binary files differ. diff --git a/images/monstre/111.gif b/images/monstre/111.gif Binary files differ. diff --git a/images/monstre/112.gif b/images/monstre/112.gif Binary files differ. diff --git a/images/monstre/113.gif b/images/monstre/113.gif Binary files differ. diff --git a/images/monstre/114.gif b/images/monstre/114.gif Binary files differ. diff --git a/images/monstre/115.gif b/images/monstre/115.gif Binary files differ. diff --git a/images/monstre/116.gif b/images/monstre/116.gif Binary files differ. diff --git a/images/monstre/117.gif b/images/monstre/117.gif Binary files differ. diff --git a/images/monstre/118.gif b/images/monstre/118.gif Binary files differ. diff --git a/images/monstre/119.gif b/images/monstre/119.gif Binary files differ. diff --git a/images/monstre/12.gif b/images/monstre/12.gif Binary files differ. diff --git a/images/monstre/120.gif b/images/monstre/120.gif Binary files differ. diff --git a/images/monstre/121.gif b/images/monstre/121.gif Binary files differ. diff --git a/images/monstre/122.gif b/images/monstre/122.gif Binary files differ. diff --git a/images/monstre/123.gif b/images/monstre/123.gif Binary files differ. diff --git a/images/monstre/124.gif b/images/monstre/124.gif Binary files differ. diff --git a/images/monstre/125.gif b/images/monstre/125.gif Binary files differ. diff --git a/images/monstre/126.gif b/images/monstre/126.gif Binary files differ. diff --git a/images/monstre/127.gif b/images/monstre/127.gif Binary files differ. diff --git a/images/monstre/128.gif b/images/monstre/128.gif Binary files differ. diff --git a/images/monstre/129.gif b/images/monstre/129.gif Binary files differ. diff --git a/images/monstre/13.gif b/images/monstre/13.gif Binary files differ. diff --git a/images/monstre/130.gif b/images/monstre/130.gif Binary files differ. diff --git a/images/monstre/131.gif b/images/monstre/131.gif Binary files differ. diff --git a/images/monstre/132.gif b/images/monstre/132.gif Binary files differ. diff --git a/images/monstre/133.gif b/images/monstre/133.gif Binary files differ. diff --git a/images/monstre/134.gif b/images/monstre/134.gif Binary files differ. diff --git a/images/monstre/135.gif b/images/monstre/135.gif Binary files differ. diff --git a/images/monstre/136.gif b/images/monstre/136.gif Binary files differ. diff --git a/images/monstre/137.gif b/images/monstre/137.gif Binary files differ. diff --git a/images/monstre/138.gif b/images/monstre/138.gif Binary files differ. diff --git a/images/monstre/139.gif b/images/monstre/139.gif Binary files differ. diff --git a/images/monstre/14.gif b/images/monstre/14.gif Binary files differ. diff --git a/images/monstre/140.gif b/images/monstre/140.gif Binary files differ. diff --git a/images/monstre/141.gif b/images/monstre/141.gif Binary files differ. diff --git a/images/monstre/142.gif b/images/monstre/142.gif Binary files differ. diff --git a/images/monstre/143.gif b/images/monstre/143.gif Binary files differ. diff --git a/images/monstre/144.gif b/images/monstre/144.gif Binary files differ. diff --git a/images/monstre/145.gif b/images/monstre/145.gif Binary files differ. diff --git a/images/monstre/146.gif b/images/monstre/146.gif Binary files differ. diff --git a/images/monstre/147.gif b/images/monstre/147.gif Binary files differ. diff --git a/images/monstre/148.gif b/images/monstre/148.gif Binary files differ. diff --git a/images/monstre/149.gif b/images/monstre/149.gif Binary files differ. diff --git a/images/monstre/15.gif b/images/monstre/15.gif Binary files differ. diff --git a/images/monstre/150.gif b/images/monstre/150.gif Binary files differ. diff --git a/images/monstre/151.gif b/images/monstre/151.gif Binary files differ. diff --git a/images/monstre/16.gif b/images/monstre/16.gif Binary files differ. diff --git a/images/monstre/17.gif b/images/monstre/17.gif Binary files differ. diff --git a/images/monstre/18.gif b/images/monstre/18.gif Binary files differ. diff --git a/images/monstre/19.gif b/images/monstre/19.gif Binary files differ. diff --git a/images/monstre/2.gif b/images/monstre/2.gif Binary files differ. diff --git a/images/monstre/20.gif b/images/monstre/20.gif Binary files differ. diff --git a/images/monstre/21.gif b/images/monstre/21.gif Binary files differ. diff --git a/images/monstre/22.gif b/images/monstre/22.gif Binary files differ. diff --git a/images/monstre/23.gif b/images/monstre/23.gif Binary files differ. diff --git a/images/monstre/24.gif b/images/monstre/24.gif Binary files differ. diff --git a/images/monstre/25.gif b/images/monstre/25.gif Binary files differ. diff --git a/images/monstre/26.gif b/images/monstre/26.gif Binary files differ. diff --git a/images/monstre/27.gif b/images/monstre/27.gif Binary files differ. diff --git a/images/monstre/28.gif b/images/monstre/28.gif Binary files differ. diff --git a/images/monstre/29.gif b/images/monstre/29.gif Binary files differ. diff --git a/images/monstre/3.gif b/images/monstre/3.gif Binary files differ. diff --git a/images/monstre/30.gif b/images/monstre/30.gif Binary files differ. diff --git a/images/monstre/31.gif b/images/monstre/31.gif Binary files differ. diff --git a/images/monstre/32.gif b/images/monstre/32.gif Binary files differ. diff --git a/images/monstre/33.gif b/images/monstre/33.gif Binary files differ. diff --git a/images/monstre/34.gif b/images/monstre/34.gif Binary files differ. diff --git a/images/monstre/35.gif b/images/monstre/35.gif Binary files differ. diff --git a/images/monstre/36.gif b/images/monstre/36.gif Binary files differ. diff --git a/images/monstre/37.gif b/images/monstre/37.gif Binary files differ. diff --git a/images/monstre/38.gif b/images/monstre/38.gif Binary files differ. diff --git a/images/monstre/39.gif b/images/monstre/39.gif Binary files differ. diff --git a/images/monstre/4.gif b/images/monstre/4.gif Binary files differ. diff --git a/images/monstre/40.gif b/images/monstre/40.gif Binary files differ. diff --git a/images/monstre/41.gif b/images/monstre/41.gif Binary files differ. diff --git a/images/monstre/42.gif b/images/monstre/42.gif Binary files differ. diff --git a/images/monstre/43.gif b/images/monstre/43.gif Binary files differ. diff --git a/images/monstre/44.gif b/images/monstre/44.gif Binary files differ. diff --git a/images/monstre/45.gif b/images/monstre/45.gif Binary files differ. diff --git a/images/monstre/46.gif b/images/monstre/46.gif Binary files differ. diff --git a/images/monstre/47.gif b/images/monstre/47.gif Binary files differ. diff --git a/images/monstre/48.gif b/images/monstre/48.gif Binary files differ. diff --git a/images/monstre/49.gif b/images/monstre/49.gif Binary files differ. diff --git a/images/monstre/5.gif b/images/monstre/5.gif Binary files differ. diff --git a/images/monstre/50.gif b/images/monstre/50.gif Binary files differ. diff --git a/images/monstre/51.gif b/images/monstre/51.gif Binary files differ. diff --git a/images/monstre/52.gif b/images/monstre/52.gif Binary files differ. diff --git a/images/monstre/53.gif b/images/monstre/53.gif Binary files differ. diff --git a/images/monstre/54.gif b/images/monstre/54.gif Binary files differ. diff --git a/images/monstre/55.gif b/images/monstre/55.gif Binary files differ. diff --git a/images/monstre/56.gif b/images/monstre/56.gif Binary files differ. diff --git a/images/monstre/57.gif b/images/monstre/57.gif Binary files differ. diff --git a/images/monstre/58.gif b/images/monstre/58.gif Binary files differ. diff --git a/images/monstre/59.gif b/images/monstre/59.gif Binary files differ. diff --git a/images/monstre/6.gif b/images/monstre/6.gif Binary files differ. diff --git a/images/monstre/60.gif b/images/monstre/60.gif Binary files differ. diff --git a/images/monstre/61.gif b/images/monstre/61.gif Binary files differ. diff --git a/images/monstre/62.gif b/images/monstre/62.gif Binary files differ. diff --git a/images/monstre/63.gif b/images/monstre/63.gif Binary files differ. diff --git a/images/monstre/64.gif b/images/monstre/64.gif Binary files differ. diff --git a/images/monstre/65.gif b/images/monstre/65.gif Binary files differ. diff --git a/images/monstre/66.gif b/images/monstre/66.gif Binary files differ. diff --git a/images/monstre/67.gif b/images/monstre/67.gif Binary files differ. diff --git a/images/monstre/68.gif b/images/monstre/68.gif Binary files differ. diff --git a/images/monstre/69.gif b/images/monstre/69.gif Binary files differ. diff --git a/images/monstre/7.gif b/images/monstre/7.gif Binary files differ. diff --git a/images/monstre/70.gif b/images/monstre/70.gif Binary files differ. diff --git a/images/monstre/71.gif b/images/monstre/71.gif Binary files differ. diff --git a/images/monstre/72.gif b/images/monstre/72.gif Binary files differ. diff --git a/images/monstre/73.gif b/images/monstre/73.gif Binary files differ. diff --git a/images/monstre/74.gif b/images/monstre/74.gif Binary files differ. diff --git a/images/monstre/75.gif b/images/monstre/75.gif Binary files differ. diff --git a/images/monstre/76.gif b/images/monstre/76.gif Binary files differ. diff --git a/images/monstre/77.gif b/images/monstre/77.gif Binary files differ. diff --git a/images/monstre/78.gif b/images/monstre/78.gif Binary files differ. diff --git a/images/monstre/79.gif b/images/monstre/79.gif Binary files differ. diff --git a/images/monstre/8.gif b/images/monstre/8.gif Binary files differ. diff --git a/images/monstre/80.gif b/images/monstre/80.gif Binary files differ. diff --git a/images/monstre/81.gif b/images/monstre/81.gif Binary files differ. diff --git a/images/monstre/82.gif b/images/monstre/82.gif Binary files differ. diff --git a/images/monstre/83.gif b/images/monstre/83.gif Binary files differ. diff --git a/images/monstre/84.gif b/images/monstre/84.gif Binary files differ. diff --git a/images/monstre/85.gif b/images/monstre/85.gif Binary files differ. diff --git a/images/monstre/86.gif b/images/monstre/86.gif Binary files differ. diff --git a/images/monstre/87.gif b/images/monstre/87.gif Binary files differ. diff --git a/images/monstre/88.gif b/images/monstre/88.gif Binary files differ. diff --git a/images/monstre/89.gif b/images/monstre/89.gif Binary files differ. diff --git a/images/monstre/9.gif b/images/monstre/9.gif Binary files differ. diff --git a/images/monstre/90.gif b/images/monstre/90.gif Binary files differ. diff --git a/images/monstre/91.gif b/images/monstre/91.gif Binary files differ. diff --git a/images/monstre/92.gif b/images/monstre/92.gif Binary files differ. diff --git a/images/monstre/93.gif b/images/monstre/93.gif Binary files differ. diff --git a/images/monstre/94.gif b/images/monstre/94.gif Binary files differ. diff --git a/images/monstre/95.gif b/images/monstre/95.gif Binary files differ. diff --git a/images/monstre/96.gif b/images/monstre/96.gif Binary files differ. diff --git a/images/monstre/97.gif b/images/monstre/97.gif Binary files differ. diff --git a/images/monstre/98.gif b/images/monstre/98.gif Binary files differ. diff --git a/images/monstre/99.gif b/images/monstre/99.gif Binary files differ. diff --git a/images/msg_archiv.gif b/images/msg_archiv.gif Binary files differ. diff --git a/images/msg_delete.gif b/images/msg_delete.gif Binary files differ. diff --git a/images/nomaison.jpg b/images/nomaison.jpg Binary files differ. diff --git a/images/personnages/banquier.gif b/images/personnages/banquier.gif Binary files differ. diff --git a/images/personnages/banquier2.gif b/images/personnages/banquier2.gif Binary files differ. diff --git a/images/personnages/banquier3.gif b/images/personnages/banquier3.gif Binary files differ. diff --git a/images/personnages/banquier4.gif b/images/personnages/banquier4.gif Binary files differ. diff --git a/images/personnages/magicienne.gif b/images/personnages/magicienne.gif Binary files differ. diff --git a/images/personnages/magicienne2.gif b/images/personnages/magicienne2.gif Binary files differ. diff --git a/images/personnages/magicienne3.gif b/images/personnages/magicienne3.gif Binary files differ. diff --git a/images/personnages/marche.gif b/images/personnages/marche.gif Binary files differ. diff --git a/images/personnages/marche2.gif b/images/personnages/marche2.gif Binary files differ. diff --git a/images/personnages/marche3.gif b/images/personnages/marche3.gif Binary files differ. diff --git a/images/personnages/soeur.gif b/images/personnages/soeur.gif Binary files differ. diff --git a/images/personnages/soeur3.gif b/images/personnages/soeur3.gif Binary files differ. diff --git a/images/pic_est.gif b/images/pic_est.gif Binary files differ. diff --git a/images/pic_nord.gif b/images/pic_nord.gif Binary files differ. diff --git a/images/pic_ouest.gif b/images/pic_ouest.gif Binary files differ. diff --git a/images/pic_sud.gif b/images/pic_sud.gif Binary files differ. diff --git a/images/puce1.gif b/images/puce1.gif Binary files differ. diff --git a/images/puce4.gif b/images/puce4.gif Binary files differ. diff --git a/images/rpg.gif b/images/rpg.gif Binary files differ. diff --git a/images/rpg.jpg b/images/rpg.jpg Binary files differ. diff --git a/images/sac.gif b/images/sac.gif Binary files differ. diff --git a/images/shop.gif b/images/shop.gif Binary files differ. diff --git a/images/site/background.jpg b/images/site/background.jpg Binary files differ. diff --git a/images/site/contenu_fond.jpg b/images/site/contenu_fond.jpg Binary files differ. diff --git a/images/site/fond.gif b/images/site/fond.gif Binary files differ. diff --git a/images/site/footer_contenu.jpg b/images/site/footer_contenu.jpg Binary files differ. diff --git a/images/site/footer_menu.jpg b/images/site/footer_menu.jpg Binary files differ. diff --git a/images/site/header.jpg b/images/site/header.jpg Binary files differ. diff --git a/images/site/main_nav.jpg b/images/site/main_nav.jpg Binary files differ. diff --git a/images/site/main_nav2.jpg b/images/site/main_nav2.jpg Binary files differ. diff --git a/images/site/main_nav3.jpg b/images/site/main_nav3.jpg Binary files differ. diff --git a/images/site/main_nav4.jpg b/images/site/main_nav4.jpg Binary files differ. diff --git a/images/site/main_nav5.jpg b/images/site/main_nav5.jpg Binary files differ. diff --git a/images/site/menu_fond.jpg b/images/site/menu_fond.jpg Binary files differ. diff --git a/images/site/news_and_content.jpg b/images/site/news_and_content.jpg Binary files differ. diff --git a/images/site/pic.gif b/images/site/pic.gif Binary files differ. diff --git a/images/site/pic2.gif b/images/site/pic2.gif Binary files differ. diff --git a/images/site/tirets_news.gif b/images/site/tirets_news.gif Binary files differ. diff --git a/images/smileys/1.jpg b/images/smileys/1.jpg Binary files differ. diff --git a/images/smileys/2.jpg b/images/smileys/2.jpg Binary files differ. diff --git a/images/smileys/3.jpg b/images/smileys/3.jpg Binary files differ. diff --git a/images/smileys/4.jpg b/images/smileys/4.jpg Binary files differ. diff --git a/images/smileys/5.jpg b/images/smileys/5.jpg Binary files differ. diff --git a/images/smileys/6.jpg b/images/smileys/6.jpg Binary files differ. diff --git a/images/smileys/7.jpg b/images/smileys/7.jpg Binary files differ. diff --git a/images/smileys/8.jpg b/images/smileys/8.jpg Binary files differ. diff --git a/images/sol/-8.jpg b/images/sol/-8.jpg Binary files differ. diff --git a/images/sol/10.jpg b/images/sol/10.jpg Binary files differ. diff --git a/images/sol/11.jpg b/images/sol/11.jpg Binary files differ. diff --git a/images/sol/12.jpg b/images/sol/12.jpg Binary files differ. diff --git a/images/sol/13.jpg b/images/sol/13.jpg Binary files differ. diff --git a/images/sol/14.jpg b/images/sol/14.jpg Binary files differ. diff --git a/images/sol/15.jpg b/images/sol/15.jpg Binary files differ. diff --git a/images/sol/17.jpg b/images/sol/17.jpg Binary files differ. diff --git a/images/sol/18.jpg b/images/sol/18.jpg Binary files differ. diff --git a/images/sol/19.jpg b/images/sol/19.jpg Binary files differ. diff --git a/images/sol/20.jpg b/images/sol/20.jpg Binary files differ. diff --git a/images/sol/21.jpg b/images/sol/21.jpg Binary files differ. diff --git a/images/sol/3.jpg b/images/sol/3.jpg Binary files differ. diff --git a/images/sol/3d_town[1].png b/images/sol/3d_town[1].png Binary files differ. diff --git a/images/sol/4.jpg b/images/sol/4.jpg Binary files differ. diff --git a/images/sol/5.jpg b/images/sol/5.jpg Binary files differ. diff --git a/images/sol/8-.jpg b/images/sol/8-.jpg Binary files differ. diff --git a/images/sol/8.jpg b/images/sol/8.jpg Binary files differ. diff --git a/images/sol/9.jpg b/images/sol/9.jpg Binary files differ. diff --git a/images/sol/Cub%20Tete%20de%20mort[1].gif b/images/sol/Cub%20Tete%20de%20mort[1].gif Binary files differ. diff --git a/images/sol/arbre.jpg b/images/sol/arbre.jpg Binary files differ. diff --git a/images/sol/chien.jpg b/images/sol/chien.jpg Binary files differ. diff --git a/images/sol/desert[1].jpg b/images/sol/desert[1].jpg Binary files differ. diff --git a/images/sol/dino.jpg b/images/sol/dino.jpg Binary files differ. diff --git a/images/sol/fleur1.jpg b/images/sol/fleur1.jpg Binary files differ. diff --git a/images/sol/fond_carte.jpg b/images/sol/fond_carte.jpg Binary files differ. diff --git a/images/sol/g.jpg b/images/sol/g.jpg Binary files differ. diff --git a/images/sol/maison.jpg b/images/sol/maison.jpg Binary files differ. diff --git a/images/sol/maison1.jpg b/images/sol/maison1.jpg Binary files differ. diff --git a/images/sol/marais[1].jpg b/images/sol/marais[1].jpg Binary files differ. diff --git a/images/sol/mort.jpg b/images/sol/mort.jpg Binary files differ. diff --git a/images/sol/sol/1.jpg b/images/sol/sol/1.jpg Binary files differ. diff --git a/images/sol/sol/110.jpg b/images/sol/sol/110.jpg Binary files differ. diff --git a/images/sol/sol/2.gif b/images/sol/sol/2.gif Binary files differ. diff --git a/images/sol/sol/2.jpg b/images/sol/sol/2.jpg Binary files differ. diff --git a/images/sol/sol/33.JPG b/images/sol/sol/33.JPG Binary files differ. diff --git a/images/sol/sol/Untitled.jpg b/images/sol/sol/Untitled.jpg Binary files differ. diff --git a/images/sol/sol/arbre.jpg b/images/sol/sol/arbre.jpg Binary files differ. diff --git a/images/sol/sol/arbres.jpg b/images/sol/sol/arbres.jpg Binary files differ. diff --git a/images/sol/sol/avatar/num-1.gif b/images/sol/sol/avatar/num-1.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-10.gif b/images/sol/sol/avatar/num-10.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-2.gif b/images/sol/sol/avatar/num-2.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-3.gif b/images/sol/sol/avatar/num-3.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-4.gif b/images/sol/sol/avatar/num-4.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-5.gif b/images/sol/sol/avatar/num-5.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-6.gif b/images/sol/sol/avatar/num-6.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-7.gif b/images/sol/sol/avatar/num-7.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-8.gif b/images/sol/sol/avatar/num-8.gif Binary files differ. diff --git a/images/sol/sol/avatar/num-9.gif b/images/sol/sol/avatar/num-9.gif Binary files differ. diff --git a/images/sol/sol/butte.jpg b/images/sol/sol/butte.jpg Binary files differ. diff --git a/images/sol/sol/chat1.jpg b/images/sol/sol/chat1.jpg Binary files differ. diff --git a/images/sol/sol/chat2.jpg b/images/sol/sol/chat2.jpg Binary files differ. diff --git a/images/sol/sol/chien.jpg b/images/sol/sol/chien.jpg Binary files differ. diff --git a/images/sol/sol/dino.jpg b/images/sol/sol/dino.jpg Binary files differ. diff --git a/images/sol/sol/feuille_morte.jpg b/images/sol/sol/feuille_morte.jpg Binary files differ. diff --git a/images/sol/sol/fleur.jpg b/images/sol/sol/fleur.jpg Binary files differ. diff --git a/images/sol/sol/fleur1.jpg b/images/sol/sol/fleur1.jpg Binary files differ. diff --git a/images/sol/sol/fond_carte2.png b/images/sol/sol/fond_carte2.png Binary files differ. diff --git a/images/sol/sol/lapin1.jpg b/images/sol/sol/lapin1.jpg Binary files differ. diff --git a/images/sol/sol/lave.jpg b/images/sol/sol/lave.jpg Binary files differ. diff --git a/images/sol/sol/m.jpg b/images/sol/sol/m.jpg Binary files differ. diff --git a/images/sol/sol/maison1.jpg b/images/sol/sol/maison1.jpg Binary files differ. diff --git a/images/sol/sol/mer.jpg b/images/sol/sol/mer.jpg Binary files differ. diff --git a/images/sol/sol/mort.jpg b/images/sol/sol/mort.jpg Binary files differ. diff --git a/images/sol/sol/pave.jpg b/images/sol/sol/pave.jpg Binary files differ. diff --git a/images/sol/sol/pave_lave.jpg b/images/sol/sol/pave_lave.jpg Binary files differ. diff --git a/images/sol/sol/peage1.jpg b/images/sol/sol/peage1.jpg Binary files differ. diff --git a/images/sol/sol/pierre.jpg b/images/sol/sol/pierre.jpg Binary files differ. diff --git a/images/sol/sol/rocher.jpg b/images/sol/sol/rocher.jpg Binary files differ. diff --git a/images/sol/sol/rocher2.jpg b/images/sol/sol/rocher2.jpg Binary files differ. diff --git a/images/sol/sol/sable.jpg b/images/sol/sol/sable.jpg Binary files differ. diff --git a/images/sol/sol/tapi.jpg b/images/sol/sol/tapi.jpg Binary files differ. diff --git a/images/sol/sol/terre+pave.jpg b/images/sol/sol/terre+pave.jpg Binary files differ. diff --git a/images/sol/sol/terre.jpg b/images/sol/sol/terre.jpg Binary files differ. diff --git a/images/sol/sol/tron1.jpg b/images/sol/sol/tron1.jpg Binary files differ. diff --git a/images/sol/sol/tron2.jpg b/images/sol/sol/tron2.jpg Binary files differ. diff --git a/images/sol/space.gif b/images/sol/space.gif Binary files differ. diff --git a/images/sondage/barresondage.gif b/images/sondage/barresondage.gif Binary files differ. diff --git a/images/sondage/persosondage.jpg b/images/sondage/persosondage.jpg Binary files differ. diff --git a/images/space_bulle.gif b/images/space_bulle.gif Binary files differ. diff --git a/images/title_eglise.gif b/images/title_eglise.gif Binary files differ. diff --git a/images/title_exploring.gif b/images/title_exploring.gif Binary files differ. diff --git a/images/title_fighting.gif b/images/title_fighting.gif Binary files differ. diff --git a/images/title_magicienne.gif b/images/title_magicienne.gif Binary files differ. diff --git a/images/titre_news.gif b/images/titre_news.gif Binary files differ. diff --git a/images/town_1.gif b/images/town_1.gif Binary files differ. diff --git a/images/town_2.gif b/images/town_2.gif Binary files differ. diff --git a/images/town_3.gif b/images/town_3.gif Binary files differ. diff --git a/images/town_4.gif b/images/town_4.gif Binary files differ. diff --git a/images/town_5.gif b/images/town_5.gif Binary files differ. diff --git a/images/town_6.gif b/images/town_6.gif Binary files differ. diff --git a/images/town_7.gif b/images/town_7.gif Binary files differ. diff --git a/images/town_8.gif b/images/town_8.gif Binary files differ. diff --git a/images/trans.gif b/images/trans.gif Binary files differ. diff --git a/images/travail/apothicaires.jpg b/images/travail/apothicaires.jpg Binary files differ. diff --git a/images/travail/auberge.jpg b/images/travail/auberge.jpg Binary files differ. diff --git a/images/travail/buche.jpg b/images/travail/buche.jpg Binary files differ. diff --git a/images/travail/forge.jpg b/images/travail/forge.jpg Binary files differ. diff --git a/images/travail/ichikaku.gif b/images/travail/ichikaku.gif Binary files differ. diff --git a/images/travail/tane.jpg b/images/travail/tane.jpg Binary files differ. diff --git a/images/vainqueur.gif b/images/vainqueur.gif Binary files differ. diff --git a/images/vide.jpg b/images/vide.jpg Binary files differ. diff --git a/images/ville/chat.gif b/images/ville/chat.gif Binary files differ. diff --git a/images/ville/enligne.gif b/images/ville/enligne.gif Binary files differ. diff --git a/images/ville/options_villes.gif b/images/ville/options_villes.gif Binary files differ. diff --git a/images/ville/town_1.gif b/images/ville/town_1.gif Binary files differ. diff --git a/images/ville/town_2.gif b/images/ville/town_2.gif Binary files differ. diff --git a/images/ville/town_3.gif b/images/ville/town_3.gif Binary files differ. diff --git a/images/ville/town_4.gif b/images/ville/town_4.gif Binary files differ. diff --git a/images/ville/town_5.gif b/images/ville/town_5.gif Binary files differ. diff --git a/images/ville/town_6.gif b/images/ville/town_6.gif Binary files differ. diff --git a/images/ville/town_7.gif b/images/ville/town_7.gif Binary files differ. diff --git a/images/ville/town_8.gif b/images/ville/town_8.gif Binary files differ. diff --git a/images/ville/ville_1.jpg b/images/ville/ville_1.jpg Binary files differ. diff --git a/images/ville/ville_2.jpg b/images/ville/ville_2.jpg Binary files differ. diff --git a/images/ville/ville_3.jpg b/images/ville/ville_3.jpg Binary files differ. diff --git a/images/ville/ville_4.jpg b/images/ville/ville_4.jpg Binary files differ. diff --git a/images/ville/ville_5.jpg b/images/ville/ville_5.jpg Binary files differ. diff --git a/images/ville/ville_6.jpg b/images/ville/ville_6.jpg Binary files differ. diff --git a/images/ville/ville_7.jpg b/images/ville/ville_7.jpg Binary files differ. diff --git a/images/ville/ville_8.jpg b/images/ville/ville_8.jpg Binary files differ. diff --git a/images/ville/ville_9.jpg b/images/ville/ville_9.jpg Binary files differ. diff --git a/index.php b/index.php @@ -1,110 +1,217 @@ -<?php // index.php :: Primary program script, evil alien overlord, you decide. - -if (file_exists('install.php')) { die("Please delete <b>install.php</b> from your Dragon Knight directory before continuing."); } -include('lib.php'); -include('cookies.php'); -$link = opendb(); -$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); -$controlrow = mysql_fetch_array($controlquery); - -// Login (or verify) if not logged in. -$userrow = checkcookies(); -if ($userrow == false) { - if (isset($_GET["do"])) { - if ($_GET["do"] == "verify") { header("Location: users.php?do=verify"); die(); } - } - header("Location: login.php?do=login"); die(); -} -// Close game. -if ($controlrow["gameopen"] == 0) { display("The game is currently closed for maintanence. Please check back later.","Game Closed"); die(); } -// Force verify if the user isn't verified yet. -if ($controlrow["verifyemail"] == 1 && $userrow["verify"] != 1) { header("Location: users.php?do=verify"); die(); } -// Block user if he/she has been banned. -if ($userrow["authlevel"] == 2) { die("Your account has been blocked. Please try back later."); } - -if (isset($_GET["do"])) { - $do = explode(":",$_GET["do"]); - - // Town functions. - if ($do[0] == "inn") { include('towns.php'); inn(); } - elseif ($do[0] == "buy") { include('towns.php'); buy(); } - elseif ($do[0] == "buy2") { include('towns.php'); buy2($do[1]); } - elseif ($do[0] == "buy3") { include('towns.php'); buy3($do[1]); } - elseif ($do[0] == "sell") { include('towns.php'); sell(); } - elseif ($do[0] == "maps") { include('towns.php'); maps(); } - elseif ($do[0] == "maps2") { include('towns.php'); maps2($do[1]); } - elseif ($do[0] == "maps3") { include('towns.php'); maps3($do[1]); } - elseif ($do[0] == "gotown") { include('towns.php'); travelto($do[1]); } - - // Exploring functions. - elseif ($do[0] == "move") { include('explore.php'); move(); } - - // Fighting functions. - elseif ($do[0] == "fight") { include('fight.php'); fight(); } - elseif ($do[0] == "victory") { include('fight.php'); victory(); } - elseif ($do[0] == "drop") { include('fight.php'); drop(); } - elseif ($do[0] == "dead") { include('fight.php'); dead(); } - - // Misc functions. - elseif ($do[0] == "verify") { header("Location: users.php?do=verify"); die(); } - elseif ($do[0] == "spell") { include('heal.php'); healspells($do[1]); } - elseif ($do[0] == "showchar") { showchar(); } - elseif ($do[0] == "onlinechar") { onlinechar($do[1]); } - elseif ($do[0] == "showmap") { showmap(); } - elseif ($do[0] == "babblebox") { babblebox(); } - elseif ($do[0] == "ninja") { ninja(); } - -} else { donothing(); } - -function donothing() { - - global $userrow; - - if ($userrow["currentaction"] == "In Town") { - $page = dotown(); - $title = "In Town"; - } elseif ($userrow["currentaction"] == "Exploring") { - $page = doexplore(); - $title = "Exploring"; - } elseif ($userrow["currentaction"] == "Fighting") { - $page = dofight(); - $title = "Fighting"; - } - - display($page, $title); - -} - -function dotown() { // Spit out the main town page. - - global $userrow, $controlrow, $numqueries; - - $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); - if (mysql_num_rows($townquery) == 0) { display("There is an error with your user account, or with the town data. Please try again.","Error"); } - $townrow = mysql_fetch_array($townquery); - - // News box. Grab latest news entry and display it. Something a little more graceful coming soon maybe. - if ($controlrow["shownews"] == 1) { - $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); +<?php // index.php :: Page principal. + +header('P3P: CP="NON ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); + +if (file_exists('install.php')) { die("Merci d'éffacer <b>install.php</b> pour pouvoir continuer."); } +include('lib.php'); +include('cookies.php'); +include('bbcode.php'); +$link = opendb(); +$controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$controlrow = mysql_fetch_array($controlquery); + +// Vérification si vous êtes logé ou pas. +$userrow = checkcookies(); +if ($userrow == false) { + if (isset($_GET["do"])) { + if ($_GET["do"] == "verify") { header("Location: users.php?do=verify"); die(); } + } + header("Location: login.php?do=login"); die(); +} +// Jeu fermé ou en maintenance. +if ($controlrow["gameopen"] == 0 && $userrow["authlevel"] == 0) { display("<center></center><br><br>Le jeu est actuellement fermé pour cause de maintenance. Merci de revenir plus tard.","Jeu fermé"); die(); } +// Forcer la vérification de l'utilisateur. +if ($controlrow["verifyemail"] == 1 && $userrow["verify"] != 1) { header("Location: users.php?do=verify"); die(); } +// Bloquer/bannir un utilisateur. +if ($userrow["authlevel"] == 2) { die("votre compte a été bloqué. Veuillez réessayer plus tard."); } + +if (isset($_GET["do"])) { + $do = explode(":",$_GET["do"]); + + + // Fonction villes. + if ($do[0] == "inn") { include('towns.php'); inn(); } + elseif ($do[0] == "enchanteur") {include('towns.php'); enchanteur(); } + elseif ($do[0] == "pretre") {include('towns.php'); pretre(); } + elseif ($do[0] == "cheatbanque") {include('towns.php'); cheatbanque(); } + elseif ($do[0] == "cheatniveau") {include('towns.php'); cheatniveau(); } + elseif ($do[0] == "cheatptlevel") {include('towns.php'); cheatptlevel(); } + elseif ($do[0] == "cheatxp") {include('towns.php'); cheatxp(); } + elseif ($do[0] == "post_comment") { include('comments_mod.php'); addpost($do[1]); } + elseif ($do[0] == "comments") { include('comments_mod.php'); read($do[1]); } + elseif ($do[0] == "bank") { include('towns.php'); bank(); } + elseif ($do[0] == "service") { include('towns.php'); service(); } + elseif ($do[0] == "sell") { include('towns.php'); sell(); } + elseif ($do[0] == "gotown") { include('towns.php'); travelto($do[1]); } + elseif ($do[0] == "towninf") { include('towninf.php'); towninf(); } + elseif ($do[0] == "metier") { include('anpe.php'); metier();} + elseif ($do[0] == "travail") { include('anpe.php'); travail();} + + // Fonction enchères + elseif ($do[0] == "encheres") { include('encheres.php'); encheres(); } + elseif ($do[0] == "vente2") { include('encheres.php'); vente2($do[1]); } + elseif ($do[0] == "vente3") { include('encheres.php'); vente3($do[1]); } + elseif ($do[0] == "afficheencheres") { include('encheres.php'); afficheencheres(); } + elseif ($do[0] == "encheres2") { include('encheres.php'); encheres2($do[1]); } + elseif ($do[0] == "encheres3") { include('encheres.php'); encheres3($do[1]); } + + // Fontion joueurs. + elseif ($do[0] == "delete") { include('delete.php'); delete();} + elseif ($do[0] == "deleteuser") { include('delete.php'); deleteuser();} + elseif ($do[0] == "point") { include('towns.php'); point($do[1]); } + elseif ($do[0] == "profil") { include('towns.php'); profil();} + elseif ($do[0] == "classement") { include('classement.php'); classement($do[1]); } + elseif ($do[0] == "av") { include('towns.php'); av(); } + + + // Fontion quete. + elseif ($do[0] == "affaire") { include('quete.php'); liste(); } + elseif ($do[0] == "journal") { include('quete.php'); journal(); } + elseif ($do[0] == "accept") { include('quete.php'); accept(); } + + // Fontion magasin. + elseif ($do[0] == "marche") { include('towns.php'); marche($do[1]); } + elseif ($do[0] == "marche2") { include('towns.php'); marche2($do[1]); } + elseif ($do[0] == "marche3") { include('towns.php'); marche3($do[1]); } + elseif ($do[0] == "maps") { include('towns.php'); maps(); } + elseif ($do[0] == "maps2") { include('towns.php'); maps2($do[1]); } + elseif ($do[0] == "maps3") { include('towns.php'); maps3($do[1]); } + elseif ($do[0] == "buy") { include('towns.php'); buy(); } + elseif ($do[0] == "buy2") { include('towns.php'); buy2($do[1]); } + elseif ($do[0] == "buy3") { include('towns.php'); buy3($do[1]); } + elseif ($do[0] == "revente") { include('towns.php'); revente(); } + elseif ($do[0] == "mag") { include('towns.php'); mag(); } + elseif ($do[0] == "mag2") { include('towns.php'); mag2($do[1]); } + elseif ($do[0] == "mag3") { include('towns.php'); mag3($do[1]); } + + // Fontion de la banque. + elseif ($do[0] == "stockobjets") { include('bank.php'); stockobjets(); } + elseif ($do[0] == "stockobjets31") { include('bank.php'); stockobjets31(); } + elseif ($do[0] == "stockobjets32") { include('bank.php'); stockobjets32(); } + elseif ($do[0] == "stockobjets33") { include('bank.php'); stockobjets33(); } + elseif ($do[0] == "stockobjets21") { include('bank.php'); stockobjets21(); } + elseif ($do[0] == "stockobjets22") { include('bank.php'); stockobjets22(); } + elseif ($do[0] == "stockobjets23") { include('bank.php'); stockobjets23(); } + elseif ($do[0] == "sendgold") { include('bank.php'); sendgold(); } + elseif ($do[0] == "sendpotion") { include('bank.php'); sendpotion(); } + elseif ($do[0] == "sendeat") { include('bank.php'); sendeat(); } + + // Fontion clans. + elseif ($do[0] == "lahku") { include('clan.php'); lahku(); } + elseif ($do[0] == "teekamp") { include('clan.php'); teekamp(); } + elseif ($do[0] == "auaste") { include('clan.php'); auaste($do[1]); } + elseif ($do[0] == "kick") { include('clan.php'); kick($do[1]); } + elseif ($do[0] == "yes") { include('clan.php'); yes($do[1]); } + elseif ($do[0] == "no") { include('clan.php'); no($do[1]); } + elseif ($do[0] == "liitu") { include('clan.php'); liitu($do[1]); } + elseif ($do[0] == "kamp") { include('clan.php'); kamp(); } + elseif ($do[0] == "suppr") { include('clan.php'); suppr(); } + + // Fontion maison. + elseif ($do[0] == "home") { include('towns.php'); home(); } + elseif ($do[0] == "reposhome") { include('home.php'); reposhome(); } + elseif ($do[0] == "bierrehome") { include('home.php'); bierrehome(); } + elseif ($do[0] == "trainhome") { include('home.php'); trainhome(); } + elseif ($do[0] == "msg") { include('home.php'); msg(); } + elseif ($do[0] == "admin_maison") { include('home.php'); admin_maison(); } + + // Fontion exploration. + elseif ($do[0] == "move") { include('explore.php'); move(); } + elseif ($do[0] == "chat") { include('explore.php'); chat(); } + elseif ($do[0] == "sacados") { sacados(); } + elseif ($do[0] == "cherche") { include('explore.php'); cherche(); } + elseif ($do[0] == "potionsoins") { include('explore.php'); potionsoins(); } + elseif ($do[0] == "nourriture") { include('explore.php'); nourriture(); } + elseif ($do[0] == "potiontp") { include('explore.php'); potiontp(); } + elseif ($do[0] == "move2") {include('explore.php'); move2(); } + + // Fonction Entraînement + elseif ($do[0] == "train") { include('train.php'); fight(); } + elseif ($do[0] == "trainvictory") { include('train.php'); trainvictory(); } + elseif ($do[0] == "traindrop") { include('train.php'); drop(); } + elseif ($do[0] == "traindead") { include('train.php'); dead(); } + + // Fonction combat. + elseif ($do[0] == "fight") { include('fight.php'); fight(); } + elseif ($do[0] == "victory") { include('fight.php'); victory(); } + elseif ($do[0] == "drop") { include('fight.php'); drop(); } + elseif ($do[0] == "dead") { include('fight.php'); dead(); } + + // Fonction magie. + elseif ($do[0] == "verify") { header("Location: users.php?do=verify"); die(); } + elseif ($do[0] == "spell") { include('heal.php'); healspells($do[1]); } + elseif ($do[0] == "showchar") { showchar(); } + elseif ($do[0] == "onlinechar") { onlinechar($do[1]); } + elseif ($do[0] == "showmap") { showmap(); } + elseif ($do[0] == "babblebox") { babblebox(); } + elseif ($do[0] == "ninja") { ninja(); } + +} else { donothing(); } + + +function donothing() { + + global $userrow; + + if ($userrow["currentaction"] == "En ville") { + $page = dotown(); + $title = "En ville"; + } elseif ($userrow["currentaction"] == "En exploration") { + $page = doexplore(); + $title = "En exploration"; + } elseif ($userrow["currentaction"] == "En maison") { + $page = dohome(); + $title = "En maison"; + } elseif ($userrow["currentaction"] == "En combat") { + $page = dofight(); + $title = "En combat"; + } + + display($page, $title); + +} + +function dotown() { // Les 2 modules du bas de l'index. + + global $userrow, $controlrow, $numqueries; + + $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + if (mysql_num_rows($townquery) == 0) { display("Il y a une erreur avec votre compte d'utilisateur, ou avec les données de la ville. Veuillez réessayer encore.","Erreur"); } + $townrow = mysql_fetch_array($townquery); + + + // Dernières nouvelles - affichage de la dernière news dans toutes les villes . +if ($controlrow["shownews"] == 1) { + $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); + $texte = new texte(); $newsrow = mysql_fetch_array($newsquery); - $townrow["news"] = "<table width=\"95%\"><tr><td class=\"title\">Latest News</td></tr><tr><td>\n"; - $townrow["news"] .= "<span class=\"light\">[".prettydate($newsrow["postdate"])."]</span><br />".nl2br($newsrow["content"]); - $townrow["news"] .= "</td></tr></table>\n"; - } else { $townrow["news"] = ""; } - - // Who's Online. Currently just members. Guests maybe later. - if ($controlrow["showonline"] == 1) { - $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' ORDER BY charname", "users"); - $townrow["whosonline"] = "<table width=\"95%\"><tr><td class=\"title\">Who's Online</td></tr><tr><td>\n"; - $townrow["whosonline"] .= "There are <b>" . mysql_num_rows($onlinequery) . "</b> user(s) online within the last 10 minutes: "; - while ($onlinerow = mysql_fetch_array($onlinequery)) { $townrow["whosonline"] .= "<a href=\"index.php?do=onlinechar:".$onlinerow["id"]."\">".$onlinerow["charname"]."</a>" . ", "; } - $townrow["whosonline"] = rtrim($townrow["whosonline"], ", "); - $townrow["whosonline"] .= "</td></tr></table>\n"; - } else { $townrow["whosonline"] = ""; } + $townrow["news"] = "<table width=\"500px\"><tr><td class=\"title\"> <img src=\"././images/titre_news.gif\" alt=\"Dernière news\" /></td></tr><tr><td>\n"; + $townrow["news"] .= "<span class=\"light\">[".prettydate($newsrow["postdate"])."]</span><br />".$texte->ms_format($newsrow["content"]); + $townrow["news"] .= "<br><br>Posté par: <b><i>".$newsrow["author"]."</b></u></td></tr></table>\n"; + $numquery = doquery("SELECT * FROM {{table}} WHERE topic=".$newsrow['id']."", "comments"); + $comments = mysql_num_rows($numquery); + $townrow["news"] .= "<br /><a href=index.php?do=comments:".$newsrow['id'].">Commentaires</a> ($comments)"; + } else { $townrow["news"] = ""; } + + // Qui est en ligne? - affichage des membres qui sont actullement en ligne. + if ($controlrow["showonline"] == 1) { + $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' ORDER BY charname", "users"); + $townrow["whosonline"] = "<table width=\"210px\"><tr><td class=\"title\"><img src=\"././images/ville/enligne.gif\" /></td></tr><tr><td>\n"; + $townrow["whosonline"] .= "Il y a <b>" . mysql_num_rows($onlinequery) . "</b> joueur(s) en ligne: "; + while ($onlinerow = mysql_fetch_array($onlinequery)) + { + if($onlinerow[authlevel] == "1"){ $color = "#CC0000"; } + elseif($onlinerow[authlevel] == "0") { $color = "#000000"; } + elseif($onlinerow[authlevel] == "3") { $color = "#009966"; } + $townrow["whosonline"] .= "<a href=\"index.php?do=onlinechar:".$onlinerow["id"]."\"><font color='".$color."'>".$onlinerow["charname"]."</a></font>" . ", "; + } + $townrow["whosonline"] = rtrim($townrow["whosonline"], ", "); + $townrow["whosonline"] .= "</td></tr></table>\n"; + } else { $townrow["whosonline"] = ""; } if ($controlrow["showbabble"] == 1) { - $townrow["babblebox"] = "<table width=\"95%\"><tr><td class=\"title\">Babble Box</td></tr><tr><td>\n"; - $townrow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"100%\" height=\"250\" frameborder=\"0\" id=\"bbox\">Your browser does not support inline frames! The Babble Box will not be available until you upgrade to a newer <a href=\"http://www.mozilla.org\" target=\"_new\">browser</a>.</iframe>"; + $townrow["babblebox"] = "<table width=\"210px\"><tr><td class=\"title\"><img src=\"././images/ville/chat.gif\" /></td></tr><tr><td>\n"; + $townrow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"210px\" height=\"360\" frameborder=\"0\" id=\"bbox\">Votre navigateur ne supporte pas les frames! La boite de dialogue n'est pas disponible pour vous. Nous vous conseillons d'utiliser ce <a href=\"http://www.mozilla.org\" target=\"_new\">Navigateur gratuit</a>.</iframe>"; $townrow["babblebox"] .= "</td></tr></table>\n"; } else { $townrow["babblebox"] = ""; } @@ -112,177 +219,271 @@ function dotown() { // Spit out the main town page. $page = parsetemplate($page, $townrow); return $page; - -} - -function doexplore() { // Just spit out a blank exploring page. - - // Exploring without a GET string is normally when they first log in, or when they've just finished fighting. - -$page = <<<END -<table width="100%"> -<tr><td class="title"><img src="images/title_exploring.gif" alt="Exploring" /></td></tr> -<tr><td> -You are exploring the map, and nothing has happened. Continue exploring using the direction buttons or the Travel To menus. -</td></tr> + } + +// Fonction pour afficher le menu des ville + chat box +function dohome() { + + global $userrow, $controlrow, $numqueries; + + $homequery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "maison"); + if (mysql_num_rows($homequery) == 0) { display("Il y a une erreur avec votre compte d'utilisateur, ou avec les données de la maison. Veuillez réessayer encore.","Erreur"); } + $homerow = mysql_fetch_array($homequery); + + + // Dernières nouvelles - affichage de la dernière news dans toutes les villes . + if ($controlrow["shownews"] == 1) { + $newsquery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 1", "news"); + $newsrow = mysql_fetch_array($newsquery); + $homerow["news"] = "<center><table width=\"500px\"><tr><td class=\"title\"> <img src=\"././images/titre_news.gif\" alt=\"Dernière news\" /></td></tr><tr><td>\n"; + $homerow["news"] .= "<span class=\"light\">[".prettydate($newsrow["postdate"])."]</span><br />".nl2br($newsrow["content"]); + $homerow["news"] .= "</td></tr></table>\n"; + $numquery = doquery("SELECT * FROM {{table}} WHERE topic=".$newsrow['id']."", "comments"); + $comments = mysql_num_rows($numquery); + $homerow["news"] .= "<br /><a href=index.php?do=comments:".$newsrow['id'].">Commentaires</a> ($comments)"; + } else { $homerow["news"] = ""; } + + // Qui est en ligne? - affichage des membres qui sont actullement en ligne. + if ($controlrow["showonline"] == 1) { + $onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' ORDER BY charname", "users"); + $homerow["whosonline"] = "<table width=\"210px\"><tr><td class=\"title\"><img src=\"././images/ville/enligne.gif\" /></td></tr><tr><td>\n"; + $homerow["whosonline"] .= "Il y a <b>" . mysql_num_rows($onlinequery) . "</b> joueur(s) en ligne: "; + while ($onlinerow = mysql_fetch_array($onlinequery)) { $homerow["whosonline"] .= "<a href=\"index.php?do=onlinechar:".$onlinerow["id"]."\">".$onlinerow["charname"]."</a>" . ", "; } + $homerow["whosonline"] = rtrim($homerow["whosonline"], ", "); + $homerow["whosonline"] .= "</td></tr></table>\n"; + } else { $homerow["whosonline"] = ""; } + + if ($controlrow["showbabble"] == 1) { + $homerow["babblebox"] = "<table width=\"210px\"><tr><td class=\"title\"><img src=\"././images/ville/chat.gif\" /></td></tr><tr><td>\n"; + $homerow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"210px\" height=\"360\" frameborder=\"0\" id=\"bbox\">Votre navigateur ne supporte pas les frames! La boite de dialogue n'est pas disponible pour vous. Nous vous conseillons d'utiliser ce <a href=\"http://www.mozilla.org\" target=\"_new\">Navigateur gratuit</a>.</iframe>"; + $homerow["babblebox"] .= "</td></tr></table>\n"; + } else { $homerow["babblebox"] = ""; } + + $page = gettemplate("home"); + $page = parsetemplate($page, $homerow); + + return $page; + + } + + function chat() {///Affichage du chat + $townrow["babblebox"] = "<table width=\"210px\"><tr><td class=\"title\"><img src=\"././images/ville/chat.gif\" /></td></tr><tr><td>\n"; + $townrow["babblebox"] .= "<iframe src=\"index.php?do=babblebox\" name=\"sbox\" width=\"210px\" height=\"360\" frameborder=\"0\" id=\"bbox\">Votre navigateur ne supporte pas les frames! La boite de dialogue n'est pas disponible pour vous. Nous vous conseillons d'utiliser ce <a href=\"http://www.mozilla.org\" target=\"_new\">Navigateur gratuit</a>.</iframe>"; + $townrow["babblebox"] .= "</td></tr></table>\n"; +} + +function doexplore() { // Affichage lors de l'exploration. + + // Affichage normal de l'exploration sans aucuns évenements particulier. + +$page = <<<END +<table width="120px"> +<tr><td class="title"><img src="images/title_exploring.gif" alt="En exploration" /></td></tr> +<tr><td> +<tr><td><center><a href="index.php?do=cherche">Chercher des ressources</a> - <a href="index.php?do=potionsoins">Prendre une Potion de soins</a> - <a href="index.php?do=nourriture">Manger</a> - <a href="index.php?do=potiontp">Recuperer les TP</a></center></tr></td> +</td></tr> +</table> +<center><iframe src="./map.php" name="carte" width="490" height="550" align="middle" scrolling="No" frameborder="0" allowtransparency="true"></iframe><center> +<br> +<iframe src="index.php?do=babblebox" width=\"400px\" height=\"800\" frameborder=\"0\"></iframe> + +END; + return $page; + +} + +function dofight() { // Redirection pour le combat. + + header("Location: index.php?do=fight"); + +} + +function showchar() { + + global $userrow, $controlrow; + + // Récompense rubis/bonus en fonction de plusieurs paramètres. + $userrow["experience"] = number_format($userrow["experience"]); + $userrow["gold"] = number_format($userrow["gold"]); + if ($userrow["expbonus"] > 0) { + $userrow["plusexp"] = "<span class=\"light\">(+".$userrow["expbonus"]."%)</span>"; + } elseif ($userrow["expbonus"] < 0) { + $userrow["plusexp"] = "<span class=\"light\">(".$userrow["expbonus"]."%)</span>"; + } else { $userrow["plusexp"] = ""; } + if ($userrow["goldbonus"] > 0) { + $userrow["plusgold"] = "<span class=\"light\">(+".$userrow["goldbonus"]."%)</span>"; + } elseif ($userrow["goldbonus"] < 0) { + $userrow["plusgold"] = "<span class=\"light\">(".$userrow["goldbonus"]."%)</span>"; + } else { $userrow["plusgold"] = ""; } + + $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); + $levelrow = mysql_fetch_array($levelquery); + if ($userrow["level"] < 99) { $userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); } else { $userrow["nextlevel"] = "<span class=\"light\">Aucun</span>"; } + + if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } + elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } + elseif ($userrow["charclass"] == 3) { $userrow["charclass"] = $controlrow["class3name"]; } + + if ($userrow["difficulty"] == 1) { $userrow["difficulty"] = $controlrow["diff1name"]; } + elseif ($userrow["difficulty"] == 2) { $userrow["difficulty"] = $controlrow["diff2name"]; } + elseif ($userrow["difficulty"] == 3) { $userrow["difficulty"] = $controlrow["diff3name"]; } + + $spellquery = doquery("SELECT id,name FROM {{table}}","spells"); + $userspells = explode(",",$userrow["spells"]); + $userrow["magiclist"] = ""; + while ($spellrow = mysql_fetch_array($spellquery)) { + $spell = false; + foreach($userspells as $a => $b) { + if ($b == $spellrow["id"]) { $spell = true; } + } + if ($spell == true) { + $userrow["magiclist"] .= $spellrow["name"]."<br />"; + } + } + if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "Aucun"; } + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $charsheet = gettemplate("showchar"); + $page = $xml . gettemplate("minimal"); + $array = array("content"=>parsetemplate($charsheet, $userrow), "title"=>"Infos du personnage"); + echo parsetemplate($page, $array); + die(); + +} + +function onlinechar($id) { + + global $controlrow; + $userquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + if (mysql_num_rows($userquery) == 1) { $userrow = mysql_fetch_array($userquery); } else { display("Votre ID n'est pas reconnu.", "Erreur"); } + + // Récompense rubis/bonus en fonction de plusieurs paramètres. + $userrow["experience"] = number_format($userrow["experience"]); + $userrow["gold"] = number_format($userrow["gold"]); + if ($userrow["expbonus"] > 0) { + $userrow["plusexp"] = "<span class=\"light\">(+".$userrow["expbonus"]."%)</span>"; + } elseif ($userrow["expbonus"] < 0) { + $userrow["plusexp"] = "<span class=\"light\">(".$userrow["expbonus"]."%)</span>"; + } else { $userrow["plusexp"] = ""; } + if ($userrow["goldbonus"] > 0) { + $userrow["plusgold"] = "<span class=\"light\">(+".$userrow["goldbonus"]."%)</span>"; + } elseif ($userrow["goldbonus"] < 0) { + $userrow["plusgold"] = "<span class=\"light\">(".$userrow["goldbonus"]."%)</span>"; + } else { $userrow["plusgold"] = ""; } + + $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); + $levelrow = mysql_fetch_array($levelquery); + $userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); + + if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } + elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } + elseif ($userrow["charclass"] == 3) { $userrow["charclass"] = $controlrow["class3name"]; } + + if ($userrow["difficulty"] == 1) { $userrow["difficulty"] = $controlrow["diff1name"]; } + elseif ($userrow["difficulty"] == 2) { $userrow["difficulty"] = $controlrow["diff2name"]; } + elseif ($userrow["difficulty"] == 3) { $userrow["difficulty"] = $controlrow["diff3name"]; } + + $charsheet = gettemplate("onlinechar"); + $page = parsetemplate($charsheet, $userrow); + display($page, "Informations du personnage"); + +} + +function showmap() { + + global $userrow; + + // Make page tags for XHTML validation. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; + + $page = $xml . gettemplate("minimal"); + $time = time(); + $array = array("content"=>"<div id=\"map\"><img src=\"index.php?do=makemap&time=$time\" alt=\"Map\" border=\"0\" /></div></center>", "title"=>"Map"); + echo parsetemplate($page, $array); + die(); + +} + +if ($do[0] == "makemap") { makemap(); } +function makemap() { + global $userrow, $controlrow; + $latitude = $userrow["latitude"]; + $longitude = $userrow["longitude"]; + $map = imageCreate(500,500); + $magenta = ImageColorAllocate($map, 255, 0, 255); + $red = imageColorAllocate($map, 211, 0, 0); + ImageColorTransparent($map, $magenta); + imageFilledEllipse($map, ($longitude + 250), (-$latitude + 250), 10, 10, $red); + header("Content-type: image/png"); + imagePNG($map); + imageDestroy($map); +} + +function babblebox() { + + global $userrow; + + if (isset($_POST["submit_x"])) { + $safecontent = my_htmlspecialchars($_POST["babble"]); + if ($safecontent == "" || $safecontent == " ") { // Post de la boite de dialogues. + } else { $insert = doquery("INSERT INTO {{table}} SET id='',posttime=NOW(),author='".$userrow["charname"]."',babble='$safecontent'", "babble"); } + header("Location: index.php?do=babblebox"); + die(); + } + $texte = new texte(); + $babblebox = array("content"=>""); + $bg = 1; + $babblequery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 20", "babble"); + while ($babblerow = mysql_fetch_array($babblequery)) { + if ($bg == 1) { $new = "<center><div style=\"width:185px; background-color:#eeeeee;\">[<b>".$babblerow["author"]."</b>] ".$texte->ms_format($babblerow["babble"])."</div></center>\n"; $bg = 2; } + else { $new = "<center><div style=\"width:185px; background-color:#ffffff;\">[<b>".$babblerow["author"]."</b>] ".$texte->ms_format(stripslashes($babblerow["babble"]))."</div></center>\n"; $bg = 1; } + $babblebox["content"] = $new . $babblebox["content"]; + } + $babblebox["content"] .= "<center><form action=\"index.php?do=babblebox\" method=\"post\"><input type=\"text\" name=\"babble\" size=\"27\" maxlength=\"110\" /><input type=\"image\" style=\"background-color:#E0E0E0\" name=\"submit\" src=\"././images/bouton_envoyer.gif\" value=\"Envoyer\" /><input type=\"image\" style=\"background-color:#E0E0E0\" name=\"reset\" src=\"././images/bouton_effacer.gif\" value=\"Effacer\" /></form></center>"; + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + $page = $xml . gettemplate("babblebox"); + echo parsetemplate($page, $babblebox); + die(); + +} + +function ninja() { + header("Location: ././images/intro.gif"); +} + +function sacados() { +global $userrow, $page, $title; +$page ='<center><img src="images/sac.gif"></center> +<center>Voici le contenu de votre sac à dos pour<br> utiliser ces objet alez en exploration et regarder au dessus de la carte :</center><br><br><br> +<center></center> +<center><table> +<tr><td width="180px"><b>Objets:</b></td></tr> +<tr><td><img src="images/pic.gif" alt="Nouriture" title="Nouriture" />Nouriture :</td><td >x'.$userrow["itemsac6qt"].'</a></td> +<tr><td><img src="images/pic.gif" alt="Potion Soin" title="Potion Soin" />Potion de Soin :</td><td >x'.$userrow["itemsac1qt"].'</a></td> +<tr><td><img src="images/pic.gif" alt="Potion Mana" title="Potion Mana" />Restauration de Mana :</td><td >x'.$userrow["itemsac2qt"].'</a></td> +<tr><td><img src="images/pic.gif" alt="Antidote" title="Antidode" />Antidote :</td><td >x'.$userrow["itemsac4qt"].'</a></td></tr> +<tr><td><img src="images/pic.gif" alt="Potion de Vigueur" title="Potion de Vigueur" />Potion de Tp :</td><td >x'.$userrow["itemsac5qt"].'</a></td></tr> +<tr><td><img src="images/pic.gif" alt="item6" title="objet6" />Pioche</td><td >'.$userrow["itemsac3qt"].'</td></tr> </table> -END; - - return $page; - -} - -function dofight() { // Redirect to fighting. - - header("Location: index.php?do=fight"); - -} - -function showchar() { - - global $userrow, $controlrow; - - // Format various userrow stuffs. - $userrow["experience"] = number_format($userrow["experience"]); - $userrow["gold"] = number_format($userrow["gold"]); - if ($userrow["expbonus"] > 0) { - $userrow["plusexp"] = "<span class=\"light\">(+".$userrow["expbonus"]."%)</span>"; - } elseif ($userrow["expbonus"] < 0) { - $userrow["plusexp"] = "<span class=\"light\">(".$userrow["expbonus"]."%)</span>"; - } else { $userrow["plusexp"] = ""; } - if ($userrow["goldbonus"] > 0) { - $userrow["plusgold"] = "<span class=\"light\">(+".$userrow["goldbonus"]."%)</span>"; - } elseif ($userrow["goldbonus"] < 0) { - $userrow["plusgold"] = "<span class=\"light\">(".$userrow["goldbonus"]."%)</span>"; - } else { $userrow["plusgold"] = ""; } - - $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); - $levelrow = mysql_fetch_array($levelquery); - if ($userrow["level"] < 99) { $userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); } else { $userrow["nextlevel"] = "<span class=\"light\">None</span>"; } - - if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } - elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } - elseif ($userrow["charclass"] == 3) { $userrow["charclass"] = $controlrow["class3name"]; } - - if ($userrow["difficulty"] == 1) { $userrow["difficulty"] = $controlrow["diff1name"]; } - elseif ($userrow["difficulty"] == 2) { $userrow["difficulty"] = $controlrow["diff2name"]; } - elseif ($userrow["difficulty"] == 3) { $userrow["difficulty"] = $controlrow["diff3name"]; } - - $spellquery = doquery("SELECT id,name FROM {{table}}","spells"); - $userspells = explode(",",$userrow["spells"]); - $userrow["magiclist"] = ""; - while ($spellrow = mysql_fetch_array($spellquery)) { - $spell = false; - foreach($userspells as $a => $b) { - if ($b == $spellrow["id"]) { $spell = true; } - } - if ($spell == true) { - $userrow["magiclist"] .= $spellrow["name"]."<br />"; - } - } - if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "None"; } - - // Make page tags for XHTML validation. - $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" - . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" - . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; - - $charsheet = gettemplate("showchar"); - $page = $xml . gettemplate("minimal"); - $array = array("content"=>parsetemplate($charsheet, $userrow), "title"=>"Character Information"); - echo parsetemplate($page, $array); - die(); - -} - -function onlinechar($id) { - - global $controlrow; - $userquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); - if (mysql_num_rows($userquery) == 1) { $userrow = mysql_fetch_array($userquery); } else { display("No such user.", "Error"); } - - // Format various userrow stuffs. - $userrow["experience"] = number_format($userrow["experience"]); - $userrow["gold"] = number_format($userrow["gold"]); - if ($userrow["expbonus"] > 0) { - $userrow["plusexp"] = "<span class=\"light\">(+".$userrow["expbonus"]."%)</span>"; - } elseif ($userrow["expbonus"] < 0) { - $userrow["plusexp"] = "<span class=\"light\">(".$userrow["expbonus"]."%)</span>"; - } else { $userrow["plusexp"] = ""; } - if ($userrow["goldbonus"] > 0) { - $userrow["plusgold"] = "<span class=\"light\">(+".$userrow["goldbonus"]."%)</span>"; - } elseif ($userrow["goldbonus"] < 0) { - $userrow["plusgold"] = "<span class=\"light\">(".$userrow["goldbonus"]."%)</span>"; - } else { $userrow["plusgold"] = ""; } - - $levelquery = doquery("SELECT ". $userrow["charclass"]."_exp FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); - $levelrow = mysql_fetch_array($levelquery); - $userrow["nextlevel"] = number_format($levelrow[$userrow["charclass"]."_exp"]); - - if ($userrow["charclass"] == 1) { $userrow["charclass"] = $controlrow["class1name"]; } - elseif ($userrow["charclass"] == 2) { $userrow["charclass"] = $controlrow["class2name"]; } - elseif ($userrow["charclass"] == 3) { $userrow["charclass"] = $controlrow["class3name"]; } - - if ($userrow["difficulty"] == 1) { $userrow["difficulty"] = $controlrow["diff1name"]; } - elseif ($userrow["difficulty"] == 2) { $userrow["difficulty"] = $controlrow["diff2name"]; } - elseif ($userrow["difficulty"] == 3) { $userrow["difficulty"] = $controlrow["diff3name"]; } - - $charsheet = gettemplate("onlinechar"); - $page = parsetemplate($charsheet, $userrow); - display($page, "Character Information"); - -} - -function showmap() { - - global $userrow; - - // Make page tags for XHTML validation. - $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" - . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" - . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; - - $page = $xml . gettemplate("minimal"); - $array = array("content"=>"<center><img src=\"images/map.gif\" alt=\"Map\" /></center>", "title"=>"Map"); - echo parsetemplate($page, $array); - die(); - -} - -function babblebox() { - - global $userrow; - - if (isset($_POST["submit"])) { - $safecontent = my_htmlspecialchars($_POST["babble"]); - if ($safecontent == "" || $safecontent == " ") { //blank post. do nothing. - } else { $insert = doquery("INSERT INTO {{table}} SET id='',posttime=NOW(),author='".$userrow["charname"]."',babble='$safecontent'", "babble"); } - header("Location: index.php?do=babblebox"); - die(); - } - - $babblebox = array("content"=>""); - $bg = 1; - $babblequery = doquery("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 20", "babble"); - while ($babblerow = mysql_fetch_array($babblequery)) { - if ($bg == 1) { $new = "<div style=\"width:98%; background-color:#eeeeee;\">[<b>".$babblerow["author"]."</b>] ".$babblerow["babble"]."</div>\n"; $bg = 2; } - else { $new = "<div style=\"width:98%; background-color:#ffffff;\">[<b>".$babblerow["author"]."</b>] ".stripslashes($babblerow["babble"])."</div>\n"; $bg = 1; } - $babblebox["content"] = $new . $babblebox["content"]; - } - $babblebox["content"] .= "<center><form action=\"index.php?do=babblebox\" method=\"post\"><input type=\"text\" name=\"babble\" size=\"15\" maxlength=\"120\" /><br /><input type=\"submit\" name=\"submit\" value=\"Babble\" /> <input type=\"reset\" name=\"reset\" value=\"Clear\" /></form></center>"; - - // Make page tags for XHTML validation. - $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" - . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" - . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; - $page = $xml . gettemplate("babblebox"); - echo parsetemplate($page, $babblebox); - die(); - -} - -function ninja() { - header("Location: http://www.se7enet.com/img/shirtninja.jpg"); -} - -?> -\ No newline at end of file +<br><br><br> +<table> +<tr><td width="180px"><b>Ressources:</b></td></tr> +<tr><td><img src="images/pic.gif" alt="cuivre" title="cuivre" />Cuivre :</td><td >'.$userrow["cuivre"].'</td></tr> +<tr><td><img src="images/pic.gif" alt="fer" title="cuivre" />Fer :</td><td >'.$userrow["fer"].'</td></tr> +<tr><td><img src="images/pic.gif" alt="argent" title="argent" />Argent :</td><td >'.$userrow["argent"].'</td></tr> +<tr><td><img src="images/pic.gif" alt="fer" title="platine" />Platine :</td><td >'.$userrow["platine"].'</td></tr> +</table>'; +$title = 'Votre sac à dos'; +display($page, $title); + } +?> diff --git a/infobulle.js b/infobulle.js @@ -0,0 +1,44 @@ +Xoffset=10; +Yoffset= 3; + +var old,skn,iex=(document.all),yyy=-1000; + +var ns4=document.layers +var ns6=document.getElementById&&!document.all +var ie4=document.all + +if (ns4) +skn=document.dek +else if (ns6) +skn=document.getElementById("dek").style +else if (ie4) +skn=document.all.dek.style +if(ns4)document.captureEvents(Event.MOUSEMOVE); +else{ +skn.visibility="visible" +skn.display="none" +} +document.onmousemove=get_mouse; + +function popup(msg,bak){ +var content="<table width=200 border=0 bordercolor=#000000 cellpadding=0 cellspacing=0 "+ +"bgcolor="+bak+"><td><font color=#000000 valign=top font-size: 9pt; align=left>"+msg+"</font></td></table>"; +yyy=Yoffset; + if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"} + if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''} + if(ie4){document.all("dek").innerHTML=content;skn.display=''} +} + +function get_mouse(e){ +var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft; +skn.left=x+Xoffset; +var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop; +skn.top=y+yyy; +} + +function kill(){ +yyy=-1000; +if(ns4){skn.visibility="hidden";} +else if (ns6||ie4) +skn.display="none" +} +\ No newline at end of file diff --git a/install.php b/install.php @@ -1,812 +1,1849 @@ -<?php // install.php :: creates/populates database tables on a new installation. - -include('config.php'); -include('lib.php'); -$link = opendb(); -$start = getmicrotime(); - -if (isset($_GET["page"])) { - $page = $_GET["page"]; - if ($page == 2) { second(); } - elseif ($page == 3) { third(); } - elseif ($page == 4) { fourth(); } - elseif ($page == 5) { fifth(); } - else { first(); } -} else { first(); } - -// Thanks to Predrag Supurovic from php.net for this function! -function dobatch ($p_query) { - $query_split = preg_split ("/[;]+/", $p_query); - foreach ($query_split as $command_line) { - $command_line = trim($command_line); - if ($command_line != '') { - $query_result = mysql_query($command_line); - if ($query_result == 0) { - break; - }; - }; - }; - return $query_result; -} - -function first() { // First page - show warnings and gather info. - -$page = <<<END -<html> -<head> -<title>Dragon Knight Installation</title> -</head> -<body> -<b>Dragon Knight Installation: Page One</b><br /><br /> -<b>NOTE:</b> Please ensure you have filled in the correct values in config.php before continuing. Installation will fail if these values are not correct. Also, the MySQL database needs to already exist. This installer script will take care of setting up its structure and content, but the database itself must already exist on your MySQL server before the installer will work.<br /><br /> -Installation for Dragon Knight is a simple two-step process: set up the database tables, then create the admin user. After that, you're done.<br /><br /> -You have two options for database setup: complete or partial. -<ul> -<li /><b>Complete Setup</b> includes table structure and all default data (items, drops, monsters, levels, spells, towns) - after complete setup, the game is totally ready to run. -<li /><b>Partial Setup</b> only creates the table structure, it does not populate the tables - use this if you are going to be creating and importing your own customized game data later. -</ul> -Click the appropriate button below for your preferred installation method.<br /><br /> -<form action="install.php?page=2" method="post"> -<input type="submit" name="complete" value="Complete Setup" /><br /> - OR - <br /><input type="submit" name="partial" value="Partial Setup" /> -</form> -</body> +<?php // install.php :: création/complétation des tables. + +include('config.php'); +include('lib.php'); +$link = opendb(); +$start = getmicrotime(); + +if (isset($_GET["page"])) { + $page = $_GET["page"]; + if ($page == 2) { second(); } + elseif ($page == 3) { third(); } + elseif ($page == 4) { fourth(); } + elseif ($page == 5) { quatre(); } + elseif ($page == 6) { cinq(); } + elseif ($page == 7) { fifth(); } + else { first(); } +} else { first(); } + +// Merci à Predrag Supurovic from php.net pour cette function! +function dobatch ($p_query) { + $query_split = preg_split ("/[;]+/", $p_query); + foreach ($query_split as $command_line) { + $command_line = trim($command_line); + if ($command_line != '') { + $query_result = mysql_query($command_line); + if ($query_result == 0) { + break; + }; + }; + }; + return $query_result; +} + +function first() { // Première page - infos et avertissements sur l'installation. + +$page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 1</b></font><br /><br /> +<font face="verdana" size="2"><b>NOTE:</b> Veuillez vous assurer que les infos dans config.php, ont été complétées correctement avant de continuer. L'installation échouera si ces infos ne sont pas correctes. En outre, la base de données de MySQL doit exister déjà. Ce script d'installation prendra soin d'installer la structure et le contenu du jeu, mais la base de données elle-même doit déjà exister sur votre serveur de MySQL avant d'éxécuter l'installation.<br /><br /> +L'Installation de RPG illusion 1.2c est un processus en trois étapes simple: installez les tables de la base de données, puis créez l'utilisateur d'administration, et enfin les réglages principaux. Après ces trois étape le jeu sera totalement installé.<br /><br /> +Vous avez le choix entre 2 types d'installation: +<ul> +<li /><b>L'installation complète</b> crée toutes les tables de la base données, et elle les complètent par défault - après l'installation complète, le jeu est prêt à fonctionner. +<li /><b>L'installation partielle</b> crée seulement les tables de la base données. Elle ne les complètent pas - employez cette installation si vous pensez modifier le script plus tard. +</ul> +Cliquez le bouton d'installation qui vous convient.<br /><br /> +<form action="install.php?page=2" method="post"> +<input type="submit" name="complete" style="font-family:Verdana; font-size:10pt" value="Installation complète" /><br /> - OU - <br /><input type="submit" name="partial" style="font-family:Verdana; font-size:10pt" value="Installation partielle" /></font> +</form> +</body> </html> -END; -echo $page; -die(); - -} - -function second() { // Second page - set up the database tables. - - global $dbsettings; - echo "<html><head><title>Dragon Knight Installation</title></head><body><b>Dragon Knight Installation: Page Two</b><br /><br />"; - $prefix = $dbsettings["prefix"]; - $babble = $prefix . "_babble"; - $control = $prefix . "_control"; - $drops = $prefix . "_drops"; - $forum = $prefix . "_forum"; - $items = $prefix . "_items"; - $levels = $prefix . "_levels"; - $monsters = $prefix . "_monsters"; - $news = $prefix . "_news"; - $spells = $prefix . "_spells"; - $towns = $prefix . "_towns"; - $users = $prefix . "_users"; - - if (isset($_POST["complete"])) { $full = true; } else { $full = false; } - -$query = <<<END -CREATE TABLE `$babble` ( - `id` int(10) unsigned NOT NULL auto_increment, - `posttime` time NOT NULL default '00:00:00', - `author` varchar(30) NOT NULL default '', - `babble` varchar(120) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Babble Box table created.<br />"; } else { echo "Error creating Babble Box table."; } -unset($query); - -$query = <<<END -CREATE TABLE `$control` ( - `id` tinyint(3) unsigned NOT NULL auto_increment, - `gamename` varchar(50) NOT NULL default '', - `gamesize` smallint(5) unsigned NOT NULL default '0', - `gameopen` tinyint(3) unsigned NOT NULL default '0', - `gameurl` varchar(200) NOT NULL default '', - `adminemail` varchar(100) NOT NULL default '', - `forumtype` tinyint(3) unsigned NOT NULL default '0', - `forumaddress` varchar(200) NOT NULL default '', - `class1name` varchar(50) NOT NULL default '', - `class2name` varchar(50) NOT NULL default '', - `class3name` varchar(50) NOT NULL default '', - `diff1name` varchar(50) NOT NULL default '', - `diff1mod` float unsigned NOT NULL default '0', - `diff2name` varchar(50) NOT NULL default '', - `diff2mod` float unsigned NOT NULL default '0', - `diff3name` varchar(50) NOT NULL default '', - `diff3mod` float unsigned NOT NULL default '0', - `compression` tinyint(3) unsigned NOT NULL default '0', - `verifyemail` tinyint(3) unsigned NOT NULL default '0', - `shownews` tinyint(3) unsigned NOT NULL default '0', - `showbabble` tinyint(3) unsigned NOT NULL default '0', - `showonline` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; - -END; -if (dobatch($query) == 1) { echo "Control table created.<br />"; } else { echo "Error creating Control table."; } -unset($query); - -$query = <<<END -INSERT INTO `$control` VALUES (1, 'Dragon Knight', 250, 1, '', '', 1, '', 'Mage', 'Warrior', 'Paladin', 'Easy', '1', 'Medium', '1.2', 'Hard', '1.5', 1, 1, 1, 1, 1); -END; -if (dobatch($query) == 1) { echo "Control table populated.<br />"; } else { echo "Error populating Control table."; } -unset($query); - -$query = <<<END -CREATE TABLE `$drops` ( - `id` mediumint(8) unsigned NOT NULL auto_increment, - `name` varchar(30) NOT NULL default '', - `mlevel` smallint(5) unsigned NOT NULL default '0', - `type` smallint(5) unsigned NOT NULL default '0', - `attribute1` varchar(30) NOT NULL default '', - `attribute2` varchar(30) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Drops table created.<br />"; } else { echo "Error creating Drops table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$drops` VALUES (1, 'Life Pebble', 1, 1, 'maxhp,10', 'X'); -INSERT INTO `$drops` VALUES (2, 'Life Stone', 10, 1, 'maxhp,25', 'X'); -INSERT INTO `$drops` VALUES (3, 'Life Rock', 25, 1, 'maxhp,50', 'X'); -INSERT INTO `$drops` VALUES (4, 'Magic Pebble', 1, 1, 'maxmp,10', 'X'); -INSERT INTO `$drops` VALUES (5, 'Magic Stone', 10, 1, 'maxmp,25', 'X'); -INSERT INTO `$drops` VALUES (6, 'Magic Rock', 25, 1, 'maxmp,50', 'X'); -INSERT INTO `$drops` VALUES (7, 'Dragon\'s Scale', 10, 1, 'defensepower,25', 'X'); -INSERT INTO `$drops` VALUES (8, 'Dragon\'s Plate', 30, 1, 'defensepower,50', 'X'); -INSERT INTO `$drops` VALUES (9, 'Dragon\'s Claw', 10, 1, 'attackpower,25', 'X'); -INSERT INTO `$drops` VALUES (10, 'Dragon\'s Tooth', 30, 1, 'attackpower,50', 'X'); -INSERT INTO `$drops` VALUES (11, 'Dragon\'s Tear', 35, 1, 'strength,50', 'X'); -INSERT INTO `$drops` VALUES (12, 'Dragon\'s Wing', 35, 1, 'dexterity,50', 'X'); -INSERT INTO `$drops` VALUES (13, 'Demon\'s Sin', 35, 1, 'maxhp,-50', 'strength,50'); -INSERT INTO `$drops` VALUES (14, 'Demon\'s Fall', 35, 1, 'maxmp,-50', 'strength,50'); -INSERT INTO `$drops` VALUES (15, 'Demon\'s Lie', 45, 1, 'maxhp,-100', 'strength,100'); -INSERT INTO `$drops` VALUES (16, 'Demon\'s Hate', 45, 1, 'maxmp,-100', 'strength,100'); -INSERT INTO `$drops` VALUES (17, 'Angel\'s Joy', 25, 1, 'maxhp,25', 'strength,25'); -INSERT INTO `$drops` VALUES (18, 'Angel\'s Rise', 30, 1, 'maxhp,50', 'strength,50'); -INSERT INTO `$drops` VALUES (19, 'Angel\'s Truth', 35, 1, 'maxhp,75', 'strength,75'); -INSERT INTO `$drops` VALUES (20, 'Angel\'s Love', 40, 1, 'maxhp,100', 'strength,100'); -INSERT INTO `$drops` VALUES (21, 'Seraph\'s Joy', 25, 1, 'maxmp,25', 'dexterity,25'); -INSERT INTO `$drops` VALUES (22, 'Seraph\'s Rise', 30, 1, 'maxmp,50', 'dexterity,50'); -INSERT INTO `$drops` VALUES (23, 'Seraph\'s Truth', 35, 1, 'maxmp,75', 'dexterity,75'); -INSERT INTO `$drops` VALUES (24, 'Seraph\'s Love', 40, 1, 'maxmp,100', 'dexterity,100'); -INSERT INTO `$drops` VALUES (25, 'Ruby', 50, 1, 'maxhp,150', 'X'); -INSERT INTO `$drops` VALUES (26, 'Pearl', 50, 1, 'maxmp,150', 'X'); -INSERT INTO `$drops` VALUES (27, 'Emerald', 50, 1, 'strength,150', 'X'); -INSERT INTO `$drops` VALUES (28, 'Topaz', 50, 1, 'dexterity,150', 'X'); -INSERT INTO `$drops` VALUES (29, 'Obsidian', 50, 1, 'attackpower,150', 'X'); -INSERT INTO `$drops` VALUES (30, 'Diamond', 50, 1, 'defensepower,150', 'X'); -INSERT INTO `$drops` VALUES (31, 'Memory Drop', 5, 1, 'expbonus,10', 'X'); -INSERT INTO `$drops` VALUES (32, 'Fortune Drop', 5, 1, 'goldbonus,10', 'X'); -END; -if (dobatch($query) == 1) { echo "Drops table populated.<br />"; } else { echo "Error populating Drops table."; } -unset($query); -} - -$query = <<<END -CREATE TABLE `$forum` ( - `id` int(11) NOT NULL auto_increment, - `postdate` datetime NOT NULL default '0000-00-00 00:00:00', - `newpostdate` datetime NOT NULL default '0000-00-00 00:00:00', - `author` varchar(30) NOT NULL default '', - `parent` int(11) NOT NULL default '0', - `replies` int(11) NOT NULL default '0', - `title` varchar(100) NOT NULL default '', - `content` text NOT NULL, - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Forum table created.<br />"; } else { echo "Error creating Forum table."; } -unset($query); - -$query = <<<END -CREATE TABLE `$items` ( + +END; +echo $page; +die(); + +} + + function second() { // Deuxième page - Installation des tables mysql. + + global $dbsettings; + echo "<html><head><title>Installation de RPG illusion 1.2c </title></head><body><b>Installation de RPG illusion 1.2c : page 2</b><br /><br />"; + $prefix = $dbsettings["prefix"]; + $clans = $prefix . "_clans"; + $kambauudised = $prefix . "_kambauudised"; + $liitujad = $prefix . "_liitujad"; + $quete = $prefix . "_quete"; + $sondage = $prefix . "_sondage"; + $sondage_ip = $prefix . "_sondage_ip"; + $resultats = $prefix . "_resultats"; + $encheres = $prefix . "_encheres"; + $babble = $prefix . "_babble"; + $blocs = $prefix . "_blocs"; + $control = $prefix . "_control"; + $comments = $prefix . "_comments"; + $drops = $prefix . "_drops"; + $forum = $prefix . "_forum"; + $items = $prefix . "_items"; + $items2 = $prefix . "_items2"; + $levels = $prefix . "_levels"; + $monsters = $prefix . "_monsters"; + $msg = $prefix . "_msg"; + $news = $prefix . "_news"; + $newsaccueil = $prefix . "_newsaccueil"; + $spells = $prefix . "_spells"; + $towns = $prefix . "_towns"; + $maison = $prefix . "_maison"; + $sol = $prefix . "_sol"; + $users = $prefix . "_users"; + $map = $prefix . "_map"; + if (isset($_POST["complete"])) { $full = true; } else { $full = false; } + + $query = <<<END +CREATE TABLE `$msg` ( + `id` int(11) NOT NULL auto_increment, + `titre` varchar(80) NOT NULL default '', + `message` text NOT NULL, + `date` int(15) NOT NULL default '0', + `envoyeur` int(10) NOT NULL default '0', + `destinataire` int(10) NOT NULL default '0', + `statut` enum('Lu','Non lu','Archivé') NOT NULL default 'Lu', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Msg a été crée.<br />"; } else { echo "Erreur de création de la table MSg."; } +unset($query); + +$query = <<<END +CREATE TABLE `$clans` ( + `id` int(10) unsigned NOT NULL auto_increment, + `nimi` text collate latin1_general_ci NOT NULL, + `name` varchar(30) collate latin1_general_ci NOT NULL default '', + `logo` varchar(120) collate latin1_general_ci NOT NULL default '', + `kuulsus` mediumint(8) NOT NULL default '0', + `omanik` mediumint(8) NOT NULL default '0', + `kambaid` smallint(2) NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table CLans a été crée.<br />"; } else { echo "Erreur de création de la table Clans."; } +unset($query); + +$query = <<<END +CREATE TABLE `$kambauudised` ( + `id` bigint(255) NOT NULL auto_increment, + `kambaid` smallint(2) NOT NULL default '0', + `lisajaid` bigint(255) NOT NULL default '0', + `lisajanimi` text collate latin1_general_ci NOT NULL, + `sisu` text collate latin1_general_ci NOT NULL, + UNIQUE KEY `id` (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table kambauudised a été crée.<br />"; } else { echo "Erreur de création de la table kambauudised."; } +unset($query); + +$query = <<<END +CREATE TABLE `$liitujad` ( + `id` int(10) unsigned NOT NULL auto_increment, + `kambaid` smallint(2) NOT NULL default '0', + `kuulsus` mediumint(8) NOT NULL default '0', + `liitujaid` mediumint(8) NOT NULL default '0', + `liitujanimi` varchar(30) NOT NULL, + UNIQUE KEY `id` (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table liitujad a été crée.<br />"; } else { echo "Erreur de création de la table liitujad."; } +unset($query); + +$query = <<<END +CREATE TABLE `$quete` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `description` longtext NOT NULL, + `level` int(3) NOT NULL default '0', + `type` tinyint(1) NOT NULL default '0', + `monster` varchar(30) default NULL, + `number` int(5) default NULL, + `longi` int(5) NOT NULL default '0', + `lati` int(5) NOT NULL default '0', + `town` varchar(30) NOT NULL default '', + `experience` int(11) NOT NULL default '0', + `gils` int(11) NOT NULL default '0', + `prolongation` smallint(6) NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Quete a été crée.<br />"; } else { echo "Erreur de création de la table Quete."; } +unset($query); + + $query = <<<END +CREATE TABLE `$sondage_ip` ( + `numero` varchar(10) NOT NULL default '', + `ip` varchar(100) NOT NULL default '' +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table sondage_ip a été crée.<br />"; } else { echo "Erreur de création de la table sondage_ip."; } +unset($query); + + $query = <<<END +CREATE TABLE `$resultats` ( + `numero` int(6) NOT NULL default '0', + `reponse` varchar(200) NOT NULL default '' +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table resultats a été crée.<br />"; } else { echo "Erreur de création de la table resultats."; } +unset($query); + +$query = +"CREATE TABLE `$sondage`( + `id` int(6) NOT NULL auto_increment, + `question` varchar(200) NOT NULL default '', + `reponse1` varchar(200) NOT NULL default '', + `reponse2` varchar(200) NOT NULL default '', + `reponse3` varchar(200) NOT NULL default '', + `reponse4` varchar(200) NOT NULL default '', + PRIMARY KEY(id) +)"; + if (dobatch($query) == 1) { echo "La table sondage a été crée.<br />"; } else { echo "Erreur de création de la table sondage"; } +unset($query); +$query = <<<END +INSERT INTO `$sondage` VALUES (1, 'Comment vous trouvez le jeu?', 'Génial', 'Moyen', 'Bof', 'Nul'); +END; +if (dobatch($query) == 1) { echo "La table sondage a été complétée.<br />"; } else { echo "Erreur lorsque la table sondage a été complétée."; } +unset($query); + +$query = <<<END + CREATE TABLE `$encheres` ( + id int(10) unsigned NOT NULL auto_increment, + posttime int(255) unsigned NOT NULL default '0', + proprietaire varchar(30) NOT NULL default '', + acheteur varchar(120) NOT NULL default 'Aucuns', + datefin int(255) unsigned NOT NULL default '0', + type tinyint(3) unsigned NOT NULL default '0', + idobjet tinyint(3) unsigned NOT NULL default '0', + name varchar(30) NOT NULL default'' , + buycost smallint(5) unsigned NOT NULL default '0', + attribute smallint(5) unsigned NOT NULL default '0', + special varchar(50) NOT NULL default '', + image tinyint(3) unsigned NOT NULL default '0', + description varchar(100) NOT NULL default 'Aucunes', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Enchere a été crée.<br />"; } else { echo "Erreur de création de la table Enchere."; } +unset($query); + + $query = <<<END +CREATE TABLE `$babble` ( + `id` int(10) unsigned NOT NULL auto_increment, + `posttime` time NOT NULL default '00:00:00', + `author` varchar(30) NOT NULL default '', + `babble` varchar(120) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Babble Box a été crée.<br />"; } else { echo "Erreur de création de la table Babble Box."; } +unset($query); + +$query = +"CREATE TABLE `$blocs`( +`id` int(6) NOT NULL auto_increment, +`bloc1` VARCHAR(200) NOT NULL default '', +`bloc2` VARCHAR(200) NOT NULL default '', +`bloc3` VARCHAR(200) NOT NULL default '', +`bloc4` VARCHAR(200) NOT NULL default '', +`bloc5` VARCHAR(200) NOT NULL default '', + PRIMARY KEY(id) +)"; + if (dobatch($query) == 1) { echo "La table blocs a été crée.<br />"; } else { echo "Erreur de création de la table blocs"; } +unset($query); + +$query = <<<END +INSERT INTO `$blocs` VALUES (1,'./image/rpg.jpg','./image/rpg.gif','© <a href="http://rpgillusion.franceserv.com"><u>RPG Illusion</u></a>', '© RPG Illusion 1.2c', '<center>2005-2006 <br><center>All right reserved'); +END; +if (dobatch($query) == 1) { echo "La table blocs a été complétée.<br />"; } else { echo "Erreur lorsque la table blocs a été complétée."; } +unset($query); + +$query = <<<END +CREATE TABLE `$control` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `gamename` varchar(50) NOT NULL default '', + `gamesize` smallint(5) unsigned NOT NULL default '0', + `gameopen` tinyint(3) unsigned NOT NULL default '0', + `gameurl` varchar(200) NOT NULL default '', + `adminemail` varchar(100) NOT NULL default '', + `forumtype` tinyint(3) unsigned NOT NULL default '0', + `forumaddress` varchar(200) NOT NULL default '', + `class1name` varchar(50) NOT NULL default '', + `class2name` varchar(50) NOT NULL default '', + `class3name` varchar(50) NOT NULL default '', + `diff1name` varchar(50) NOT NULL default '', + `diff1mod` float unsigned NOT NULL default '0', + `diff2name` varchar(50) NOT NULL default '', + `diff2mod` float unsigned NOT NULL default '0', + `diff3name` varchar(50) NOT NULL default '', + `diff3mod` float unsigned NOT NULL default '0', + `compression` tinyint(3) unsigned NOT NULL default '0', + `verifyemail` tinyint(3) unsigned NOT NULL default '0', + `shownews` tinyint(3) unsigned NOT NULL default '0', + `showbabble` tinyint(3) unsigned NOT NULL default '0', + `showonline` tinyint(3) unsigned NOT NULL default '0', + `register` tinyint(3) unsigned NOT NULL default '0', + `monnaie` varchar(50) NOT NULL default 'Darkmore', + PRIMARY KEY (`id`) +) TYPE=MyISAM; + +END; +if (dobatch($query) == 1) { echo "La table Control a été crée.<br />"; } else { echo "Erreur de création de la table Control."; } +unset($query); + +$query = <<<END +INSERT INTO `$control` VALUES (1, 'RPG illusion v1.2c', 250, 1, '', '', 1, '', 'Mage', 'Guerrier', 'Paladin', 'Facile', '1', 'Moyen', '1.2', 'Dur', '1.5', 1, 1, 1, 1, 1,1,'Darkmore'); +END; +if (dobatch($query) == 1) { echo "La table Control a été complétée.<br />"; } else { echo "Erreur lorsque la table Control a été complétée."; } +unset($query); + +$query = <<<END +CREATE TABLE `$comments` ( + `id` bigint(255) NOT NULL auto_increment, + `topic` bigint(255) NOT NULL default '0', + `time` datetime NOT NULL default '0000-00-00 00:00:00', + `poster` bigint(255) NOT NULL default '0', + `post` text NOT NULL, + UNIQUE KEY `id` (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table comments a été crée.<br />"; } else { echo "Erreur de création de la table comments."; } +unset($query); + +$query = <<<END +CREATE TABLE `$drops` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `name` varchar(30) NOT NULL default '', + `mlevel` smallint(5) unsigned NOT NULL default '0', + `type` smallint(5) unsigned NOT NULL default '0', + `attribute1` varchar(30) NOT NULL default '', + `attribute2` varchar(30) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Drops a été crée.<br />"; } else { echo "Erreur de création de la table Drops."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$drops` VALUES (1, 'Life Pebble', 1, 1, 'maxhp,10', 'X'); +INSERT INTO `$drops` VALUES (2, 'Life Stone', 10, 1, 'maxhp,25', 'X'); +INSERT INTO `$drops` VALUES (3, 'Life Rock', 25, 1, 'maxhp,50', 'X'); +INSERT INTO `$drops` VALUES (4, 'Magic Pebble', 1, 1, 'maxmp,10', 'X'); +INSERT INTO `$drops` VALUES (5, 'Magic Stone', 10, 1, 'maxmp,25', 'X'); +INSERT INTO `$drops` VALUES (6, 'Magic Rock', 25, 1, 'maxmp,50', 'X'); +INSERT INTO `$drops` VALUES (7, 'Dragon\'s Scale', 10, 1, 'defensepower,25', 'X'); +INSERT INTO `$drops` VALUES (8, 'Dragon\'s Plate', 30, 1, 'defensepower,50', 'X'); +INSERT INTO `$drops` VALUES (9, 'Dragon\'s Claw', 10, 1, 'attackpower,25', 'X'); +INSERT INTO `$drops` VALUES (10, 'Dragon\'s Tooth', 30, 1, 'attackpower,50', 'X'); +INSERT INTO `$drops` VALUES (11, 'Dragon\'s Tear', 35, 1, 'strength,50', 'X'); +INSERT INTO `$drops` VALUES (12, 'Dragon\'s Wing', 35, 1, 'dexterity,50', 'X'); +INSERT INTO `$drops` VALUES (13, 'Demon\'s Sin', 35, 1, 'maxhp,-50', 'strength,50'); +INSERT INTO `$drops` VALUES (14, 'Demon\'s Fall', 35, 1, 'maxmp,-50', 'strength,50'); +INSERT INTO `$drops` VALUES (15, 'Demon\'s Lie', 45, 1, 'maxhp,-100', 'strength,100'); +INSERT INTO `$drops` VALUES (16, 'Demon\'s Hate', 45, 1, 'maxmp,-100', 'strength,100'); +INSERT INTO `$drops` VALUES (17, 'Angel\'s Joy', 25, 1, 'maxhp,25', 'strength,25'); +INSERT INTO `$drops` VALUES (18, 'Angel\'s Rise', 30, 1, 'maxhp,50', 'strength,50'); +INSERT INTO `$drops` VALUES (19, 'Angel\'s Truth', 35, 1, 'maxhp,75', 'strength,75'); +INSERT INTO `$drops` VALUES (20, 'Angel\'s Love', 40, 1, 'maxhp,100', 'strength,100'); +INSERT INTO `$drops` VALUES (21, 'Seraph\'s Joy', 25, 1, 'maxmp,25', 'dexterity,25'); +INSERT INTO `$drops` VALUES (22, 'Seraph\'s Rise', 30, 1, 'maxmp,50', 'dexterity,50'); +INSERT INTO `$drops` VALUES (23, 'Seraph\'s Truth', 35, 1, 'maxmp,75', 'dexterity,75'); +INSERT INTO `$drops` VALUES (24, 'Seraph\'s Love', 40, 1, 'maxmp,100', 'dexterity,100'); +INSERT INTO `$drops` VALUES (25, 'Ruby', 50, 1, 'maxhp,150', 'X'); +INSERT INTO `$drops` VALUES (26, 'Pearl', 50, 1, 'maxmp,150', 'X'); +INSERT INTO `$drops` VALUES (27, 'Emerald', 50, 1, 'strength,150', 'X'); +INSERT INTO `$drops` VALUES (28, 'Topaz', 50, 1, 'dexterity,150', 'X'); +INSERT INTO `$drops` VALUES (29, 'Obsidian', 50, 1, 'attackpower,150', 'X'); +INSERT INTO `$drops` VALUES (30, 'Diamond', 50, 1, 'defensepower,150', 'X'); +INSERT INTO `$drops` VALUES (31, 'Memory Drop', 5, 1, 'expbonus,10', 'X'); +INSERT INTO `$drops` VALUES (32, 'Fortune Drop', 5, 1, 'goldbonus,10', 'X'); +END; +if (dobatch($query) == 1) { echo "La table Drops a été complétée.<br />"; } else { echo "Erreur lorsque la table Drops table a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$forum` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(255) NOT NULL default '0', + `type` smallint(5) NOT NULL default '0', + `postdate` datetime NOT NULL default '00-00-0000 00:00:00', + `newpostdate` datetime NOT NULL default '00-00-0000 00:00:00', + `author` varchar(30) NOT NULL default '', + `parent` int(11) NOT NULL default '0', + `replies` int(11) NOT NULL default '0', + `title` varchar(100) NOT NULL default '', + `avatar` varchar(255) NOT NULL default '0', + `signature` varchar(255) NOT NULL default 'Aucune', + `content` text NOT NULL, + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Forum a été crée.<br />"; } else { echo "Erreur de création de la table Forum."; } +unset($query); + + +$query = <<<END +CREATE TABLE `$items` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `type` tinyint(3) unsigned NOT NULL default '0', + `name` varchar(30) NOT NULL default '', + `buycost` smallint(5) unsigned NOT NULL default '0', + `attribute` smallint(5) unsigned NOT NULL default '0', + `special` varchar(50) NOT NULL default '', + `image` tinyint(3) unsigned NOT NULL default '0', + `description` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Items a été crée.<br />"; } else { echo "Erreur de création de la table Items."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$items` VALUES (1, 1, 'Branche', 10, 2, 'Aucun',1, 'Aucune description'); +INSERT INTO `$items` VALUES (2, 1, 'Bilboquet', 30, 4, 'Aucun',2, 'Aucune description'); +INSERT INTO `$items` VALUES (3, 1, 'Epée sacrée', 35, 5, 'Aucun',3, 'Aucune description'); +INSERT INTO `$items` VALUES (4, 1, 'Épée Soleil', 200, 9, 'Aucun',4, 'Aucune description'); +INSERT INTO `$items` VALUES (5, 1, 'Épée Volca', 650, 13, 'maxhp,-8',5, 'Aucune description'); +INSERT INTO `$items` VALUES (6, 1, 'Hache', 200, 16, 'Aucun',8, 'Aucune description'); +INSERT INTO `$items` VALUES (7, 1, 'Bombes rechargeable', 300, 25, 'Aucun',7, 'Aucune description'); +INSERT INTO `$items` VALUES (8, 3, 'Pull anti flames', 50, 4, 'Aucun',8, 'Aucune description'); +INSERT INTO `$items` VALUES (9, 3, 'Manteau de proction', 120, 5, 'Aucun',9, 'Aucune description'); +INSERT INTO `$items` VALUES (10, 2, 'Carapace', 1200, 20, 'maxhp,60',10, 'Aucune description'); +INSERT INTO `$items` VALUES (11, 2, 'Casque millitaire', 190, 6, 'Aucun',11, 'Aucune description'); +INSERT INTO `$items` VALUES (12, 2, 'Super casque', 3000, 56, 'expbonus,100',12, 'Aucune description'); +INSERT INTO `$items` VALUES (13, 2, 'Casque taureau', 4500, 90, 'goldbonus,120',13, 'Aucune description'); +INSERT INTO `$items` VALUES (14, 1, 'Baguette magique', 6000, 200, 'expbonus,230',14, 'Aucune description'); +INSERT INTO `$items` VALUES (15, 3, 'Pantalon millitaire', 420, 12, 'Aucun',15, 'Aucune description'); +INSERT INTO `$items` VALUES (16, 3, 'Pantalon de Génoa', 850, 15, 'Aucun',16, 'Aucune description'); +INSERT INTO `$items` VALUES (17, 2, 'Cobra de Gobi', 6000, 220, 'goldbonus,210',17, 'Aucune description'); +INSERT INTO `$items` VALUES (18, 1, 'Pierre', 120, 5, 'Aucun',18, 'Aucune description'); +INSERT INTO `$items` VALUES (19, 1, 'Arc', 360, 10, 'Aucun',19, 'Aucune description'); +INSERT INTO `$items` VALUES (20, 1, 'Super arc', 960, 16, 'maxtp,18',20, 'Aucune description'); +INSERT INTO `$items` VALUES (21, 3, 'Lunette anti-éclairs', 300, 11, 'Aucun',21, 'Aucune description'); +INSERT INTO `$items` VALUES (22, 3, 'Gans', 310, 11, 'Aucun',22, 'Aucune description'); +INSERT INTO `$items` VALUES (23, 3, 'Super gans', 752, 14, 'Aucun',23, 'Aucune description'); +INSERT INTO `$items` VALUES (24, 1, 'Masse ronde', 800, 17, 'maxhp,-20',24, 'Aucune description'); +INSERT INTO `$items` VALUES (25, 1, 'Dent de requin', 60, 4, 'expbonus,-2',25, 'Aucune description'); +INSERT INTO `$items` VALUES (26, 1, 'Couteau sacré', 180, 8, 'expbonus,2',26, 'Aucune description'); +INSERT INTO `$items` VALUES (27, 1, 'Marteau', 500, 200, 'dexterity,-10',27, 'Aucune description'); +INSERT INTO `$items` VALUES (28, 2, 'Botte de Stella', 2500, 86, 'maxtp,200',28, 'Aucune description'); +INSERT INTO `$items` VALUES (29, 3, 'Chaussure de randonnée', 100, 4, 'maxtp,2',29, 'Aucune description'); +INSERT INTO `$items` VALUES (30, 3, 'Bonnet', 90, 2, 'Aucun',30, 'Aucune description'); +INSERT INTO `$items` VALUES (31, 1, 'Pioche', 750, 8, 'Aucun',31, 'Aucune description'); +INSERT INTO `$items` VALUES (32, 1, 'Poison foudroyant', 1000, 60, 'Aucun',32, 'Aucune description'); +INSERT INTO `$items` VALUES (33, 3, 'Potion blanche', 95, 100, 'maxhp,50',33, 'Aucune description'); +INSERT INTO `$items` VALUES (34, 3, 'Potion bleu', 120, 100, 'maxhp,50',34, 'Aucune description'); +INSERT INTO `$items` VALUES (35, 3, 'Potion rouge', 155, 100, 'maxhp,50',35, 'Aucune description'); +END; +if (dobatch($query) == 1) { echo "La table Items a été complétée.<br />"; } else { echo "Erreur lorsque la table Items a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$items2` ( `id` smallint(5) unsigned NOT NULL auto_increment, `type` tinyint(3) unsigned NOT NULL default '0', `name` varchar(30) NOT NULL default '', `buycost` smallint(5) unsigned NOT NULL default '0', `attribute` smallint(5) unsigned NOT NULL default '0', `special` varchar(50) NOT NULL default '', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Items table created.<br />"; } else { echo "Error creating Items table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$items` VALUES (1, 1, 'Stick', 10, 2, 'X'); -INSERT INTO `$items` VALUES (2, 1, 'Branch', 30, 4, 'X'); -INSERT INTO `$items` VALUES (3, 1, 'Club', 40, 5, 'X'); -INSERT INTO `$items` VALUES (4, 1, 'Dagger', 90, 8, 'X'); -INSERT INTO `$items` VALUES (5, 1, 'Hatchet', 150, 12, 'X'); -INSERT INTO `$items` VALUES (6, 1, 'Axe', 200, 16, 'X'); -INSERT INTO `$items` VALUES (7, 1, 'Brand', 300, 25, 'X'); -INSERT INTO `$items` VALUES (8, 1, 'Poleaxe', 500, 35, 'X'); -INSERT INTO `$items` VALUES (9, 1, 'Broadsword', 800, 45, 'X'); -INSERT INTO `$items` VALUES (10, 1, 'Battle Axe', 1200, 50, 'X'); -INSERT INTO `$items` VALUES (11, 1, 'Claymore', 2000, 60, 'X'); -INSERT INTO `$items` VALUES (12, 1, 'Dark Axe', 3000, 100, 'expbonus,-5'); -INSERT INTO `$items` VALUES (13, 1, 'Dark Sword', 4500, 125, 'expbonus,-10'); -INSERT INTO `$items` VALUES (14, 1, 'Bright Sword', 6000, 100, 'expbonus,10'); -INSERT INTO `$items` VALUES (15, 1, 'Magic Sword', 10000, 150, 'maxmp,50'); -INSERT INTO `$items` VALUES (16, 1, 'Destiny Blade', 50000, 250, 'strength,50'); -INSERT INTO `$items` VALUES (17, 2, 'Skivvies', 25, 2, 'goldbonus,10'); -INSERT INTO `$items` VALUES (18, 2, 'Clothes', 50, 5, 'X'); -INSERT INTO `$items` VALUES (19, 2, 'Leather Armor', 75, 10, 'X'); -INSERT INTO `$items` VALUES (20, 2, 'Hard Leather Armor', 150, 25, 'X'); -INSERT INTO `$items` VALUES (21, 2, 'Chain Mail', 300, 30, 'X'); -INSERT INTO `$items` VALUES (22, 2, 'Bronze Plate', 900, 50, 'X'); -INSERT INTO `$items` VALUES (23, 2, 'Iron Plate', 2000, 100, 'X'); -INSERT INTO `$items` VALUES (24, 2, 'Magic Armor', 4000, 125, 'maxmp,50'); -INSERT INTO `$items` VALUES (25, 2, 'Dark Armor', 5000, 150, 'expbonus,-10'); -INSERT INTO `$items` VALUES (26, 2, 'Bright Armor', 10000, 175, 'expbonus,10'); -INSERT INTO `$items` VALUES (27, 2, 'Destiny Raiment', 50000, 200, 'dexterity,50'); -INSERT INTO `$items` VALUES (28, 3, 'Reed Shield', 50, 2, 'X'); -INSERT INTO `$items` VALUES (29, 3, 'Buckler', 100, 4, 'X'); -INSERT INTO `$items` VALUES (30, 3, 'Small Shield', 500, 10, 'X'); -INSERT INTO `$items` VALUES (31, 3, 'Large Shield', 2500, 30, 'X'); -INSERT INTO `$items` VALUES (32, 3, 'Silver Shield', 10000, 60, 'X'); -INSERT INTO `$items` VALUES (33, 3, 'Destiny Aegis', 25000, 100, 'maxhp,50'); -END; -if (dobatch($query) == 1) { echo "Items table populated.<br />"; } else { echo "Error populating Items table."; } -unset($query); -} - -$query = <<<END -CREATE TABLE `$levels` ( - `id` smallint(5) unsigned NOT NULL auto_increment, - `1_exp` mediumint(8) unsigned NOT NULL default '0', - `1_hp` smallint(5) unsigned NOT NULL default '0', - `1_mp` smallint(5) unsigned NOT NULL default '0', - `1_tp` smallint(5) unsigned NOT NULL default '0', - `1_strength` smallint(5) unsigned NOT NULL default '0', - `1_dexterity` smallint(5) unsigned NOT NULL default '0', - `1_spells` tinyint(3) unsigned NOT NULL default '0', - `2_exp` mediumint(8) unsigned NOT NULL default '0', - `2_hp` smallint(5) unsigned NOT NULL default '0', - `2_mp` smallint(5) unsigned NOT NULL default '0', - `2_tp` smallint(5) unsigned NOT NULL default '0', - `2_strength` smallint(5) unsigned NOT NULL default '0', - `2_dexterity` smallint(5) unsigned NOT NULL default '0', - `2_spells` tinyint(3) unsigned NOT NULL default '0', - `3_exp` mediumint(8) unsigned NOT NULL default '0', - `3_hp` smallint(5) unsigned NOT NULL default '0', - `3_mp` smallint(5) unsigned NOT NULL default '0', - `3_tp` smallint(5) unsigned NOT NULL default '0', - `3_strength` smallint(5) unsigned NOT NULL default '0', - `3_dexterity` smallint(5) unsigned NOT NULL default '0', - `3_spells` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Levels table created.<br />"; } else { echo "Error creating Levels table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$levels` VALUES (1, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0); -INSERT INTO `$levels` VALUES (2, 15, 2, 5, 1, 0, 1, 1, 18, 2, 4, 1, 2, 1, 1, 20, 2, 5, 1, 0, 2, 1); -INSERT INTO `$levels` VALUES (3, 45, 3, 4, 2, 1, 2, 0, 54, 2, 3, 2, 3, 2, 0, 60, 2, 3, 2, 1, 3, 0); -INSERT INTO `$levels` VALUES (4, 105, 3, 3, 2, 1, 2, 6, 126, 2, 3, 2, 3, 2, 0, 140, 2, 4, 2, 1, 3, 0); -INSERT INTO `$levels` VALUES (5, 195, 2, 5, 2, 0, 1, 0, 234, 2, 4, 2, 2, 1, 6, 260, 2, 4, 2, 0, 2, 6); -INSERT INTO `$levels` VALUES (6, 330, 4, 5, 2, 2, 3, 0, 396, 3, 4, 2, 4, 3, 0, 440, 3, 5, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (7, 532, 3, 4, 2, 1, 2, 11, 639, 2, 3, 2, 3, 2, 0, 710, 2, 3, 2, 1, 3, 0); -INSERT INTO `$levels` VALUES (8, 835, 2, 4, 2, 0, 1, 0, 1003, 2, 3, 2, 2, 1, 11, 1115, 2, 4, 2, 0, 2, 11); -INSERT INTO `$levels` VALUES (9, 1290, 5, 3, 2, 3, 4, 2, 1549, 4, 2, 2, 5, 4, 0, 1722, 4, 2, 2, 3, 5, 0); -INSERT INTO `$levels` VALUES (10, 1973, 10, 3, 2, 4, 3, 0, 2369, 10, 2, 2, 6, 3, 0, 2633, 10, 3, 2, 4, 4, 0); -INSERT INTO `$levels` VALUES (11, 2997, 5, 2, 2, 3, 4, 0, 3598, 4, 1, 2, 5, 4, 2, 3999, 4, 1, 2, 3, 5, 2); -INSERT INTO `$levels` VALUES (12, 4533, 4, 2, 2, 2, 3, 7, 5441, 4, 1, 2, 4, 3, 0, 6047, 4, 2, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (13, 6453, 4, 3, 2, 2, 3, 0, 7745, 4, 2, 2, 4, 3, 0, 8607, 4, 2, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (14, 8853, 5, 4, 2, 3, 4, 17, 10625, 4, 3, 2, 5, 4, 7, 11807, 4, 4, 2, 3, 5, 7); -INSERT INTO `$levels` VALUES (15, 11853, 5, 5, 2, 3, 4, 0, 14225, 4, 4, 2, 5, 4, 0, 15808, 4, 4, 2, 3, 5, 0); -INSERT INTO `$levels` VALUES (16, 15603, 5, 3, 2, 3, 4, 0, 18725, 5, 2, 2, 5, 4, 0, 20807, 5, 3, 2, 3, 5, 0); -INSERT INTO `$levels` VALUES (17, 20290, 4, 2, 2, 2, 3, 12, 24350, 4, 1, 2, 4, 3, 0, 27057, 4, 1, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (18, 25563, 4, 2, 2, 2, 3, 0, 30678, 3, 1, 2, 4, 3, 14, 34869, 3, 2, 2, 2, 4, 17); -INSERT INTO `$levels` VALUES (19, 31495, 4, 5, 2, 2, 3, 0, 37797, 3, 4, 2, 4, 3, 0, 43657, 3, 4, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (20, 38169, 10, 6, 2, 3, 3, 0, 45805, 10, 5, 2, 5, 3, 0, 53543, 10, 6, 2, 3, 4, 0); -INSERT INTO `$levels` VALUES (21, 45676, 4, 4, 2, 2, 3, 0, 54814, 4, 3, 2, 4, 3, 0, 64664, 4, 3, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (22, 54121, 5, 5, 2, 3, 4, 0, 64949, 4, 4, 2, 5, 4, 12, 77175, 4, 5, 2, 3, 5, 12); -INSERT INTO `$levels` VALUES (23, 63622, 5, 3, 2, 3, 4, 0, 76350, 4, 2, 2, 5, 4, 0, 91250, 4, 2, 2, 3, 5, 0); -INSERT INTO `$levels` VALUES (24, 74310, 5, 5, 2, 3, 4, 0, 89176, 4, 4, 2, 5, 4, 0, 107083, 4, 5, 2, 3, 5, 0); -INSERT INTO `$levels` VALUES (25, 86334, 4, 4, 2, 2, 3, 3, 103605, 3, 3, 2, 4, 3, 17, 124895, 3, 3, 2, 2, 4, 14); -INSERT INTO `$levels` VALUES (26, 99861, 6, 3, 2, 4, 5, 0, 119837, 5, 2, 2, 6, 5, 0, 144933, 5, 3, 2, 4, 6, 0); -INSERT INTO `$levels` VALUES (27, 115078, 6, 2, 2, 4, 5, 0, 138098, 5, 1, 2, 6, 5, 0, 167475, 5, 1, 2, 4, 6, 0); -INSERT INTO `$levels` VALUES (28, 132197, 4, 2, 2, 2, 3, 0, 158641, 4, 1, 2, 4, 3, 0, 192835, 4, 2, 2, 2, 4, 0); -INSERT INTO `$levels` VALUES (29, 151456, 6, 3, 2, 4, 5, 0, 181751, 5, 2, 2, 6, 5, 3, 221365, 5, 2, 2, 4, 6, 3); -INSERT INTO `$levels` VALUES (30, 173121, 10, 4, 3, 4, 4, 0, 207749, 10, 3, 3, 6, 4, 0, 253461, 10, 4, 3, 4, 5, 0); -INSERT INTO `$levels` VALUES (31, 197494, 5, 5, 3, 3, 4, 8, 236996, 4, 3, 3, 5, 4, 0, 289568, 4, 3, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (32, 224913, 6, 4, 3, 4, 5, 0, 269898, 5, 3, 3, 6, 5, 0, 330188, 5, 4, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (33, 255758, 5, 4, 3, 3, 4, 0, 306912, 5, 3, 3, 5, 4, 0, 375885, 5, 3, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (34, 290458, 6, 4, 3, 4, 5, 0, 348552, 5, 3, 3, 6, 5, 8, 427294, 5, 4, 3, 4, 6, 8); -INSERT INTO `$levels` VALUES (35, 329495, 5, 3, 3, 3, 4, 0, 395397, 4, 2, 3, 5, 4, 0, 485126, 4, 2, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (36, 373412, 4, 3, 3, 2, 3, 18, 448097, 5, 2, 3, 4, 3, 0, 550188, 5, 3, 3, 2, 4, 0); -INSERT INTO `$levels` VALUES (37, 422818, 5, 4, 3, 3, 4, 0, 507384, 5, 3, 3, 5, 4, 0, 623383, 5, 3, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (38, 478399, 6, 5, 3, 4, 5, 0, 574081, 5, 4, 3, 6, 5, 15, 705726, 5, 5, 3, 4, 6, 18); -INSERT INTO `$levels` VALUES (39, 540927, 6, 4, 3, 4, 5, 0, 649115, 5, 3, 3, 6, 5, 0, 798362, 5, 3, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (40, 611271, 15, 3, 3, 5, 5, 13, 733528, 15, 2, 3, 7, 5, 0, 902577, 15, 3, 3, 5, 6, 0); -INSERT INTO `$levels` VALUES (41, 690408, 7, 3, 3, 5, 2, 0, 828492, 6, 2, 3, 7, 2, 0, 1019818, 6, 2, 3, 5, 3, 0); -INSERT INTO `$levels` VALUES (42, 779437, 7, 4, 3, 5, 6, 0, 935326, 6, 3, 3, 7, 6, 0, 1151714, 6, 4, 3, 5, 7, 0); -INSERT INTO `$levels` VALUES (43, 879592, 8, 5, 3, 6, 7, 0, 1055514, 7, 4, 3, 8, 7, 0, 1300096, 7, 4, 3, 6, 8, 0); -INSERT INTO `$levels` VALUES (44, 992268, 6, 3, 3, 4, 5, 0, 1190725, 5, 2, 3, 6, 5, 0, 1448478, 5, 3, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (45, 1119028, 5, 8, 3, 3, 4, 4, 1325936, 5, 8, 3, 5, 4, 18, 1596860, 5, 8, 3, 3, 5, 4); -INSERT INTO `$levels` VALUES (46, 1245788, 6, 5, 3, 4, 5, 0, 1461147, 5, 4, 3, 6, 5, 0, 1745242, 5, 5, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (47, 1372548, 7, 4, 3, 5, 6, 0, 1596358, 6, 3, 3, 7, 6, 0, 1893624, 6, 3, 3, 5, 7, 0); -INSERT INTO `$levels` VALUES (48, 1499308, 6, 4, 3, 4, 5, 0, 1731569, 5, 3, 3, 6, 5, 0, 2042006, 5, 4, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (49, 1626068, 5, 3, 3, 3, 4, 0, 1866780, 4, 2, 3, 5, 4, 0, 2190388, 4, 2, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (50, 1752828, 15, 3, 3, 5, 5, 0, 2001991, 15, 2, 3, 7, 5, 0, 2338770, 15, 3, 3, 5, 6, 0); -INSERT INTO `$levels` VALUES (51, 1879588, 6, 2, 3, 4, 5, 9, 2137202, 5, 1, 3, 6, 5, 13, 2487152, 5, 1, 3, 4, 6, 13); -INSERT INTO `$levels` VALUES (52, 2006348, 7, 2, 3, 5, 6, 0, 2272413, 6, 1, 3, 7, 6, 0, 2635534, 6, 2, 3, 5, 7, 0); -INSERT INTO `$levels` VALUES (53, 2133108, 8, 2, 3, 6, 7, 0, 2407624, 7, 1, 3, 8, 7, 0, 2783916, 7, 1, 3, 6, 8, 0); -INSERT INTO `$levels` VALUES (54, 2259868, 8, 4, 3, 6, 7, 0, 2542835, 7, 3, 3, 8, 7, 0, 2932298, 7, 4, 3, 6, 8, 0); -INSERT INTO `$levels` VALUES (55, 2386628, 7, 4, 3, 5, 6, 0, 2678046, 6, 3, 3, 7, 6, 0, 3080680, 6, 3, 3, 5, 7, 0); -INSERT INTO `$levels` VALUES (56, 2513388, 7, 4, 3, 5, 6, 0, 2813257, 6, 3, 3, 7, 6, 0, 3229062, 6, 4, 3, 5, 7, 9); -INSERT INTO `$levels` VALUES (57, 2640148, 6, 5, 3, 4, 5, 0, 2948468, 6, 4, 3, 6, 5, 0, 3377444, 6, 4, 3, 4, 6, 0); -INSERT INTO `$levels` VALUES (58, 2766908, 5, 5, 3, 3, 4, 0, 3083679, 5, 4, 3, 5, 4, 19, 3525826, 5, 5, 3, 3, 5, 0); -INSERT INTO `$levels` VALUES (59, 2893668, 8, 3, 3, 6, 7, 0, 3218890, 7, 2, 3, 8, 7, 0, 3674208, 7, 2, 3, 6, 8, 0); -INSERT INTO `$levels` VALUES (60, 3020428, 15, 4, 4, 6, 6, 19, 3354101, 15, 3, 4, 8, 6, 0, 3822590, 15, 4, 4, 6, 7, 15); -INSERT INTO `$levels` VALUES (61, 3147188, 8, 5, 4, 6, 7, 0, 3489312, 7, 4, 4, 8, 7, 0, 3970972, 7, 4, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (62, 3273948, 8, 4, 4, 6, 7, 0, 3624523, 7, 3, 4, 8, 7, 0, 4119354, 7, 4, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (63, 3400708, 9, 5, 4, 7, 8, 0, 3759734, 8, 4, 4, 9, 8, 0, 4267736, 8, 4, 4, 7, 9, 0); -INSERT INTO `$levels` VALUES (64, 3527468, 5, 5, 4, 3, 4, 0, 3894945, 5, 4, 4, 5, 4, 0, 4416118, 5, 5, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (65, 3654228, 6, 4, 4, 4, 5, 0, 4030156, 6, 3, 4, 6, 5, 0, 4564500, 6, 3, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (66, 3780988, 8, 4, 4, 6, 7, 0, 4165367, 8, 3, 4, 8, 7, 0, 4712882, 8, 4, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (67, 3907748, 7, 3, 4, 5, 6, 0, 4300578, 7, 2, 4, 7, 6, 0, 4861264, 7, 2, 4, 5, 7, 0); -INSERT INTO `$levels` VALUES (68, 4034508, 9, 3, 4, 7, 8, 0, 4435789, 8, 2, 4, 9, 8, 0, 5009646, 8, 3, 4, 7, 9, 0); -INSERT INTO `$levels` VALUES (69, 4161268, 5, 4, 4, 3, 4, 0, 4571000, 5, 3, 4, 5, 4, 0, 5158028, 5, 3, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (70, 4288028, 20, 4, 4, 6, 6, 5, 4706211, 20, 3, 4, 8, 6, 16, 5306410, 20, 4, 4, 6, 7, 0); -INSERT INTO `$levels` VALUES (71, 4414788, 5, 5, 4, 3, 4, 0, 4841422, 5, 4, 4, 5, 4, 0, 5454792, 5, 4, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (72, 4541548, 6, 2, 4, 4, 5, 0, 4976633, 5, 1, 4, 6, 5, 0, 5603174, 5, 2, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (73, 4668308, 8, 4, 4, 6, 7, 0, 5111844, 8, 3, 4, 8, 7, 0, 5751556, 8, 3, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (74, 4795068, 7, 5, 4, 5, 6, 0, 5247055, 6, 4, 4, 7, 6, 0, 5899938, 6, 5, 4, 5, 7, 0); -INSERT INTO `$levels` VALUES (75, 4921828, 5, 3, 4, 3, 4, 0, 5382266, 5, 2, 4, 5, 4, 0, 6048320, 5, 2, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (76, 5048588, 6, 3, 4, 4, 5, 0, 5517477, 6, 2, 4, 6, 5, 0, 6196702, 6, 3, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (77, 5175348, 6, 4, 4, 4, 5, 0, 5652688, 7, 3, 4, 6, 5, 0, 6345084, 7, 3, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (78, 5302108, 7, 4, 4, 5, 6, 0, 5787899, 7, 3, 4, 7, 6, 0, 6493466, 7, 4, 4, 5, 7, 0); -INSERT INTO `$levels` VALUES (79, 5428868, 8, 4, 4, 6, 7, 10, 5923110, 7, 3, 4, 8, 7, 0, 6641848, 7, 3, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (80, 5555628, 20, 5, 4, 6, 7, 0, 6058321, 20, 4, 4, 8, 7, 0, 6790230, 20, 5, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (81, 5682388, 7, 3, 4, 5, 6, 0, 6193532, 7, 2, 4, 7, 6, 0, 6938612, 7, 2, 4, 5, 7, 0); -INSERT INTO `$levels` VALUES (82, 5809148, 6, 4, 4, 4, 5, 0, 6328743, 5, 3, 4, 6, 5, 0, 7086994, 5, 4, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (83, 5935908, 6, 2, 4, 4, 5, 0, 6463954, 6, 1, 4, 6, 5, 0, 7235376, 6, 1, 4, 4, 6, 0); -INSERT INTO `$levels` VALUES (84, 6062668, 5, 4, 4, 3, 4, 0, 6599165, 5, 3, 4, 5, 4, 0, 7383758, 5, 4, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (85, 6189428, 7, 4, 4, 5, 6, 0, 6734376, 6, 3, 4, 7, 6, 0, 7532140, 6, 3, 4, 5, 7, 0); -INSERT INTO `$levels` VALUES (86, 6316188, 8, 5, 4, 6, 7, 0, 6869587, 8, 4, 4, 8, 7, 0, 7680522, 8, 5, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (87, 6442948, 8, 4, 4, 6, 7, 0, 7004798, 7, 3, 4, 8, 7, 0, 7828904, 7, 3, 4, 6, 8, 0); -INSERT INTO `$levels` VALUES (88, 6569708, 9, 5, 4, 7, 8, 0, 7140009, 8, 4, 4, 9, 8, 0, 7977286, 8, 5, 4, 7, 9, 0); -INSERT INTO `$levels` VALUES (89, 6696468, 5, 2, 4, 3, 4, 0, 7275220, 5, 1, 4, 5, 4, 0, 8125668, 5, 1, 4, 3, 5, 0); -INSERT INTO `$levels` VALUES (90, 6823228, 20, 2, 5, 7, 8, 0, 7410431, 20, 1, 5, 9, 8, 0, 8274050, 20, 2, 5, 7, 9, 0); -INSERT INTO `$levels` VALUES (91, 6949988, 5, 3, 5, 3, 4, 0, 7545642, 5, 2, 5, 5, 4, 0, 8422432, 5, 2, 5, 3, 5, 0); -INSERT INTO `$levels` VALUES (92, 7076748, 6, 3, 5, 4, 5, 0, 7680853, 4, 2, 5, 6, 5, 0, 8570814, 4, 3, 5, 4, 6, 0); -INSERT INTO `$levels` VALUES (93, 7203508, 8, 4, 5, 6, 7, 0, 7816064, 6, 2, 5, 8, 7, 0, 8719196, 6, 2, 5, 6, 8, 0); -INSERT INTO `$levels` VALUES (94, 7330268, 4, 4, 5, 3, 3, 0, 7951275, 4, 3, 5, 5, 3, 0, 8867578, 4, 4, 5, 3, 4, 0); -INSERT INTO `$levels` VALUES (95, 7457028, 3, 3, 5, 5, 2, 0, 8086486, 4, 2, 5, 7, 2, 0, 9015960, 4, 2, 5, 5, 3, 0); -INSERT INTO `$levels` VALUES (96, 7583788, 5, 3, 5, 4, 3, 0, 8221697, 5, 2, 5, 7, 3, 0, 9164342, 5, 3, 5, 4, 4, 0); -INSERT INTO `$levels` VALUES (97, 7710548, 5, 4, 5, 4, 5, 0, 8356908, 5, 3, 5, 7, 5, 0, 9312724, 5, 3, 5, 4, 6, 0); -INSERT INTO `$levels` VALUES (98, 7837308, 4, 5, 5, 4, 3, 0, 8492119, 4, 3, 5, 7, 3, 0, 9461106, 4, 4, 5, 4, 4, 0); -INSERT INTO `$levels` VALUES (99, 7964068, 50, 5, 5, 6, 5, 0, 8627330, 50, 3, 5, 9, 5, 0, 9609488, 50, 4, 5, 6, 6, 0); -INSERT INTO `$levels` VALUES (100, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0); -END; -if (dobatch($query) == 1) { echo "Levels table populated.<br />"; } else { echo "Error populating Levels table."; } -unset($query); -} - -$query = <<<END -CREATE TABLE `$monsters` ( - `id` smallint(5) unsigned NOT NULL auto_increment, - `name` varchar(50) NOT NULL default '', - `maxhp` smallint(5) unsigned NOT NULL default '0', - `maxdam` smallint(5) unsigned NOT NULL default '0', - `armor` smallint(5) unsigned NOT NULL default '0', - `level` smallint(5) unsigned NOT NULL default '0', - `maxexp` smallint(5) unsigned NOT NULL default '0', - `maxgold` smallint(5) unsigned NOT NULL default '0', - `immune` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Monsters table created.<br />"; } else { echo "Error creating Monsters table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$monsters` VALUES (1, 'Blue Slime', 4, 3, 1, 1, 1, 1, 0); -INSERT INTO `$monsters` VALUES (2, 'Red Slime', 6, 5, 1, 1, 2, 1, 0); -INSERT INTO `$monsters` VALUES (3, 'Critter', 6, 5, 2, 1, 4, 2, 0); -INSERT INTO `$monsters` VALUES (4, 'Creature', 10, 8, 2, 2, 4, 2, 0); -INSERT INTO `$monsters` VALUES (5, 'Shadow', 10, 9, 3, 2, 6, 2, 1); -INSERT INTO `$monsters` VALUES (6, 'Drake', 11, 10, 3, 2, 8, 3, 0); -INSERT INTO `$monsters` VALUES (7, 'Shade', 12, 10, 3, 3, 10, 3, 1); -INSERT INTO `$monsters` VALUES (8, 'Drakelor', 14, 12, 4, 3, 10, 3, 0); -INSERT INTO `$monsters` VALUES (9, 'Silver Slime', 15, 100, 200, 30, 15, 1000, 2); -INSERT INTO `$monsters` VALUES (10, 'Scamp', 16, 13, 5, 4, 15, 5, 0); -INSERT INTO `$monsters` VALUES (11, 'Raven', 16, 13, 5, 4, 18, 6, 0); -INSERT INTO `$monsters` VALUES (12, 'Scorpion', 18, 14, 6, 5, 20, 7, 0); -INSERT INTO `$monsters` VALUES (13, 'Illusion', 20, 15, 6, 5, 20, 7, 1); -INSERT INTO `$monsters` VALUES (14, 'Nightshade', 22, 16, 6, 6, 24, 8, 0); -INSERT INTO `$monsters` VALUES (15, 'Drakemal', 22, 18, 7, 6, 24, 8, 0); -INSERT INTO `$monsters` VALUES (16, 'Shadow Raven', 24, 18, 7, 6, 26, 9, 1); -INSERT INTO `$monsters` VALUES (17, 'Ghost', 24, 20, 8, 6, 28, 9, 0); -INSERT INTO `$monsters` VALUES (18, 'Frost Raven', 26, 20, 8, 7, 30, 10, 0); -INSERT INTO `$monsters` VALUES (19, 'Rogue Scorpion', 28, 22, 9, 7, 32, 11, 0); -INSERT INTO `$monsters` VALUES (20, 'Ghoul', 29, 24, 9, 7, 34, 11, 0); -INSERT INTO `$monsters` VALUES (21, 'Magician', 30, 24, 10, 8, 36, 12, 0); -INSERT INTO `$monsters` VALUES (22, 'Rogue', 30, 25, 12, 8, 40, 13, 0); -INSERT INTO `$monsters` VALUES (23, 'Drakefin', 32, 26, 12, 8, 40, 13, 0); -INSERT INTO `$monsters` VALUES (24, 'Shimmer', 32, 26, 14, 8, 45, 15, 1); -INSERT INTO `$monsters` VALUES (25, 'Fire Raven', 34, 28, 14, 9, 45, 15, 0); -INSERT INTO `$monsters` VALUES (26, 'Dybbuk', 34, 28, 14, 9, 50, 17, 0); -INSERT INTO `$monsters` VALUES (27, 'Knave', 36, 30, 15, 9, 52, 17, 0); -INSERT INTO `$monsters` VALUES (28, 'Goblin', 36, 30, 15, 10, 54, 18, 0); -INSERT INTO `$monsters` VALUES (29, 'Skeleton', 38, 30, 18, 10, 58, 19, 0); -INSERT INTO `$monsters` VALUES (30, 'Dark Slime', 38, 32, 18, 10, 62, 21, 0); -INSERT INTO `$monsters` VALUES (31, 'Silver Scorpion', 30, 160, 350, 40, 63, 2000, 2); -INSERT INTO `$monsters` VALUES (32, 'Mirage', 40, 32, 20, 11, 64, 21, 1); -INSERT INTO `$monsters` VALUES (33, 'Sorceror', 41, 33, 22, 11, 68, 23, 0); -INSERT INTO `$monsters` VALUES (34, 'Imp', 42, 34, 22, 12, 70, 23, 0); -INSERT INTO `$monsters` VALUES (35, 'Nymph', 43, 35, 22, 12, 70, 23, 0); -INSERT INTO `$monsters` VALUES (36, 'Scoundrel', 43, 35, 22, 12, 75, 25, 0); -INSERT INTO `$monsters` VALUES (37, 'Megaskeleton', 44, 36, 24, 13, 78, 26, 0); -INSERT INTO `$monsters` VALUES (38, 'Grey Wolf', 44, 36, 24, 13, 82, 27, 0); -INSERT INTO `$monsters` VALUES (39, 'Phantom', 46, 38, 24, 14, 85, 28, 1); -INSERT INTO `$monsters` VALUES (40, 'Specter', 46, 38, 24, 14, 90, 30, 0); -INSERT INTO `$monsters` VALUES (41, 'Dark Scorpion', 48, 40, 26, 15, 95, 32, 1); -INSERT INTO `$monsters` VALUES (42, 'Warlock', 48, 40, 26, 15, 100, 33, 1); -INSERT INTO `$monsters` VALUES (43, 'Orc', 49, 42, 28, 15, 104, 35, 0); -INSERT INTO `$monsters` VALUES (44, 'Sylph', 49, 42, 28, 15, 106, 35, 0); -INSERT INTO `$monsters` VALUES (45, 'Wraith', 50, 45, 30, 16, 108, 36, 0); -INSERT INTO `$monsters` VALUES (46, 'Hellion', 50, 45, 30, 16, 110, 37, 0); -INSERT INTO `$monsters` VALUES (47, 'Bandit', 52, 45, 30, 16, 114, 38, 0); -INSERT INTO `$monsters` VALUES (48, 'Ultraskeleton', 52, 46, 32, 16, 116, 39, 0); -INSERT INTO `$monsters` VALUES (49, 'Dark Wolf', 54, 47, 36, 17, 120, 40, 1); -INSERT INTO `$monsters` VALUES (50, 'Troll', 56, 48, 36, 17, 120, 40, 0); -INSERT INTO `$monsters` VALUES (51, 'Werewolf', 56, 48, 38, 17, 124, 41, 0); -INSERT INTO `$monsters` VALUES (52, 'Hellcat', 58, 50, 38, 18, 128, 43, 0); -INSERT INTO `$monsters` VALUES (53, 'Spirit', 58, 50, 38, 18, 132, 44, 0); -INSERT INTO `$monsters` VALUES (54, 'Nisse', 60, 52, 40, 19, 132, 44, 0); -INSERT INTO `$monsters` VALUES (55, 'Dawk', 60, 54, 40, 19, 136, 45, 0); -INSERT INTO `$monsters` VALUES (56, 'Figment', 64, 55, 42, 19, 140, 47, 1); -INSERT INTO `$monsters` VALUES (57, 'Hellhound', 66, 56, 44, 20, 140, 47, 0); -INSERT INTO `$monsters` VALUES (58, 'Wizard', 66, 56, 44, 20, 144, 48, 0); -INSERT INTO `$monsters` VALUES (59, 'Uruk', 68, 58, 44, 20, 146, 49, 0); -INSERT INTO `$monsters` VALUES (60, 'Siren', 68, 400, 800, 50, 10000, 50, 2); -INSERT INTO `$monsters` VALUES (61, 'Megawraith', 70, 60, 46, 21, 155, 52, 0); -INSERT INTO `$monsters` VALUES (62, 'Dawkin', 70, 60, 46, 21, 155, 52, 0); -INSERT INTO `$monsters` VALUES (63, 'Grey Bear', 70, 62, 48, 21, 160, 53, 0); -INSERT INTO `$monsters` VALUES (64, 'Haunt', 72, 62, 48, 22, 160, 53, 0); -INSERT INTO `$monsters` VALUES (65, 'Hellbeast', 74, 64, 50, 22, 165, 55, 0); -INSERT INTO `$monsters` VALUES (66, 'Fear', 76, 66, 52, 23, 165, 55, 0); -INSERT INTO `$monsters` VALUES (67, 'Beast', 76, 66, 52, 23, 170, 57, 0); -INSERT INTO `$monsters` VALUES (68, 'Ogre', 78, 68, 54, 23, 170, 57, 0); -INSERT INTO `$monsters` VALUES (69, 'Dark Bear', 80, 70, 56, 24, 175, 58, 1); -INSERT INTO `$monsters` VALUES (70, 'Fire', 80, 72, 56, 24, 175, 58, 0); -INSERT INTO `$monsters` VALUES (71, 'Polgergeist', 84, 74, 58, 25, 180, 60, 0); -INSERT INTO `$monsters` VALUES (72, 'Fright', 86, 76, 58, 25, 180, 60, 0); -INSERT INTO `$monsters` VALUES (73, 'Lycan', 88, 78, 60, 25, 185, 62, 0); -INSERT INTO `$monsters` VALUES (74, 'Terra Elemental', 88, 80, 62, 25, 185, 62, 1); -INSERT INTO `$monsters` VALUES (75, 'Necromancer', 90, 80, 62, 26, 190, 63, 0); -INSERT INTO `$monsters` VALUES (76, 'Ultrawraith', 90, 82, 64, 26, 190, 63, 0); -INSERT INTO `$monsters` VALUES (77, 'Dawkor', 92, 82, 64, 26, 195, 65, 0); -INSERT INTO `$monsters` VALUES (78, 'Werebear', 92, 84, 65, 26, 195, 65, 0); -INSERT INTO `$monsters` VALUES (79, 'Brute', 94, 84, 65, 27, 200, 67, 0); -INSERT INTO `$monsters` VALUES (80, 'Large Beast', 96, 88, 66, 27, 200, 67, 0); -INSERT INTO `$monsters` VALUES (81, 'Horror', 96, 88, 68, 27, 210, 70, 0); -INSERT INTO `$monsters` VALUES (82, 'Flame', 100, 90, 70, 28, 210, 70, 0); -INSERT INTO `$monsters` VALUES (83, 'Lycanthor', 100, 90, 70, 28, 210, 70, 0); -INSERT INTO `$monsters` VALUES (84, 'Wyrm', 100, 92, 72, 28, 220, 73, 0); -INSERT INTO `$monsters` VALUES (85, 'Aero Elemental', 104, 94, 74, 29, 220, 73, 1); -INSERT INTO `$monsters` VALUES (86, 'Dawkare', 106, 96, 76, 29, 220, 73, 0); -INSERT INTO `$monsters` VALUES (87, 'Large Brute', 108, 98, 78, 29, 230, 77, 0); -INSERT INTO `$monsters` VALUES (88, 'Frost Wyrm', 110, 100, 80, 30, 230, 77, 0); -INSERT INTO `$monsters` VALUES (89, 'Knight', 110, 102, 80, 30, 240, 80, 0); -INSERT INTO `$monsters` VALUES (90, 'Lycanthra', 112, 104, 82, 30, 240, 80, 0); -INSERT INTO `$monsters` VALUES (91, 'Terror', 115, 108, 84, 31, 250, 83, 0); -INSERT INTO `$monsters` VALUES (92, 'Blaze', 118, 108, 84, 31, 250, 83, 0); -INSERT INTO `$monsters` VALUES (93, 'Aqua Elemental', 120, 110, 90, 31, 260, 87, 1); -INSERT INTO `$monsters` VALUES (94, 'Fire Wyrm', 120, 110, 90, 32, 260, 87, 0); -INSERT INTO `$monsters` VALUES (95, 'Lesser Wyvern', 122, 110, 92, 32, 270, 90, 0); -INSERT INTO `$monsters` VALUES (96, 'Doomer', 124, 112, 92, 32, 270, 90, 0); -INSERT INTO `$monsters` VALUES (97, 'Armor Knight', 130, 115, 95, 33, 280, 93, 0); -INSERT INTO `$monsters` VALUES (98, 'Wyvern', 134, 120, 95, 33, 290, 97, 0); -INSERT INTO `$monsters` VALUES (99, 'Nightmare', 138, 125, 100, 33, 300, 100, 0); -INSERT INTO `$monsters` VALUES (100, 'Fira Elemental', 140, 125, 100, 34, 310, 103, 1); -INSERT INTO `$monsters` VALUES (101, 'Megadoomer', 140, 128, 105, 34, 320, 107, 0); -INSERT INTO `$monsters` VALUES (102, 'Greater Wyvern', 145, 130, 105, 34, 335, 112, 0); -INSERT INTO `$monsters` VALUES (103, 'Advocate', 148, 132, 108, 35, 350, 117, 0); -INSERT INTO `$monsters` VALUES (104, 'Strong Knight', 150, 135, 110, 35, 365, 122, 0); -INSERT INTO `$monsters` VALUES (105, 'Liche', 150, 135, 110, 35, 380, 127, 0); -INSERT INTO `$monsters` VALUES (106, 'Ultradoomer', 155, 140, 115, 36, 395, 132, 0); -INSERT INTO `$monsters` VALUES (107, 'Fanatic', 160, 140, 115, 36, 410, 137, 0); -INSERT INTO `$monsters` VALUES (108, 'Green Dragon', 160, 140, 115, 36, 425, 142, 0); -INSERT INTO `$monsters` VALUES (109, 'Fiend', 160, 145, 120, 37, 445, 148, 0); -INSERT INTO `$monsters` VALUES (110, 'Greatest Wyvern', 162, 150, 120, 37, 465, 155, 0); -INSERT INTO `$monsters` VALUES (111, 'Lesser Devil', 164, 150, 120, 37, 485, 162, 0); -INSERT INTO `$monsters` VALUES (112, 'Liche Master', 168, 155, 125, 38, 505, 168, 0); -INSERT INTO `$monsters` VALUES (113, 'Zealot', 168, 155, 125, 38, 530, 177, 0); -INSERT INTO `$monsters` VALUES (114, 'Serafiend', 170, 155, 125, 38, 555, 185, 0); -INSERT INTO `$monsters` VALUES (115, 'Pale Knight', 175, 160, 130, 39, 580, 193, 0); -INSERT INTO `$monsters` VALUES (116, 'Blue Dragon', 180, 160, 130, 39, 605, 202, 0); -INSERT INTO `$monsters` VALUES (117, 'Obsessive', 180, 160, 135, 40, 630, 210, 0); -INSERT INTO `$monsters` VALUES (118, 'Devil', 184, 164, 135, 40, 666, 222, 0); -INSERT INTO `$monsters` VALUES (119, 'Liche Prince', 190, 168, 138, 40, 660, 220, 0); -INSERT INTO `$monsters` VALUES (120, 'Cherufiend', 195, 170, 140, 41, 690, 230, 0); -INSERT INTO `$monsters` VALUES (121, 'Red Dragon', 200, 180, 145, 41, 720, 240, 0); -INSERT INTO `$monsters` VALUES (122, 'Greater Devil', 200, 180, 145, 41, 750, 250, 0); -INSERT INTO `$monsters` VALUES (123, 'Renegade', 205, 185, 150, 42, 780, 260, 0); -INSERT INTO `$monsters` VALUES (124, 'Archfiend', 210, 190, 150, 42, 810, 270, 0); -INSERT INTO `$monsters` VALUES (125, 'Liche Lord', 210, 190, 155, 42, 850, 283, 0); -INSERT INTO `$monsters` VALUES (126, 'Greatest Devil', 215, 195, 160, 43, 890, 297, 0); -INSERT INTO `$monsters` VALUES (127, 'Dark Knight', 220, 200, 160, 43, 930, 310, 0); -INSERT INTO `$monsters` VALUES (128, 'Giant', 220, 200, 165, 43, 970, 323, 0); -INSERT INTO `$monsters` VALUES (129, 'Shadow Dragon', 225, 200, 170, 44, 1010, 337, 0); -INSERT INTO `$monsters` VALUES (130, 'Liche King', 225, 205, 170, 44, 1050, 350, 0); -INSERT INTO `$monsters` VALUES (131, 'Incubus', 230, 205, 175, 44, 1100, 367, 1); -INSERT INTO `$monsters` VALUES (132, 'Traitor', 230, 205, 175, 45, 1150, 383, 0); -INSERT INTO `$monsters` VALUES (133, 'Demon', 240, 210, 180, 45, 1200, 400, 0); -INSERT INTO `$monsters` VALUES (134, 'Dark Dragon', 245, 215, 180, 45, 1250, 417, 1); -INSERT INTO `$monsters` VALUES (135, 'Insurgent', 250, 220, 190, 46, 1300, 433, 0); -INSERT INTO `$monsters` VALUES (136, 'Leviathan', 255, 225, 190, 46, 1350, 450, 0); -INSERT INTO `$monsters` VALUES (137, 'Grey Daemon', 260, 230, 190, 46, 1400, 467, 0); -INSERT INTO `$monsters` VALUES (138, 'Succubus', 265, 240, 200, 47, 1460, 487, 1); -INSERT INTO `$monsters` VALUES (139, 'Demon Prince', 270, 240, 200, 47, 1520, 507, 0); -INSERT INTO `$monsters` VALUES (140, 'Black Dragon', 275, 250, 205, 47, 1580, 527, 1); -INSERT INTO `$monsters` VALUES (141, 'Nihilist', 280, 250, 205, 47, 1640, 547, 0); -INSERT INTO `$monsters` VALUES (142, 'Behemoth', 285, 260, 210, 48, 1700, 567, 0); -INSERT INTO `$monsters` VALUES (143, 'Demagogue', 290, 260, 210, 48, 1760, 587, 0); -INSERT INTO `$monsters` VALUES (144, 'Demon Lord', 300, 270, 220, 48, 1820, 607, 0); -INSERT INTO `$monsters` VALUES (145, 'Red Daemon', 310, 280, 230, 48, 1880, 627, 0); -INSERT INTO `$monsters` VALUES (146, 'Colossus', 320, 300, 240, 49, 1940, 647, 0); -INSERT INTO `$monsters` VALUES (147, 'Demon King', 330, 300, 250, 49, 2000, 667, 0); -INSERT INTO `$monsters` VALUES (148, 'Dark Daemon', 340, 320, 260, 49, 2200, 733, 1); -INSERT INTO `$monsters` VALUES (149, 'Titan', 360, 340, 270, 50, 2400, 800, 0); -INSERT INTO `$monsters` VALUES (150, 'Black Daemon', 400, 400, 280, 50, 3000, 1000, 1); -INSERT INTO `$monsters` VALUES (151, 'Lucifuge', 600, 600, 400, 50, 10000, 10000, 2); -END; -if (dobatch($query) == 1) { echo "Monsters table populated.<br />"; } else { echo "Error populating Monsters table."; } -unset($query); -} - -$query = <<<END -CREATE TABLE `$news` ( - `id` mediumint(8) unsigned NOT NULL auto_increment, - `postdate` datetime NOT NULL default '0000-00-00 00:00:00', - `content` text NOT NULL, - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "News table created.<br />"; } else { echo "Error creating News table."; } -unset($query); - -$query = <<<END -INSERT INTO `$news` VALUES (1, '2004-01-01 12:00:00', 'This is the first news post. Please use the admin control panel to add another one and make this one go away.'); -END; -if (dobatch($query) == 1) { echo "News table populated.<br />"; } else { echo "Error populating News table."; } -unset($query); - -$query = <<<END -CREATE TABLE `$spells` ( - `id` smallint(5) unsigned NOT NULL auto_increment, - `name` varchar(30) NOT NULL default '', - `mp` smallint(5) unsigned NOT NULL default '0', - `attribute` smallint(5) unsigned NOT NULL default '0', - `type` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Spells table created.<br />"; } else { echo "Error creating Spells table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$spells` VALUES (1, 'Heal', 5, 10, 1); -INSERT INTO `$spells` VALUES (2, 'Revive', 10, 25, 1); -INSERT INTO `$spells` VALUES (3, 'Life', 25, 50, 1); -INSERT INTO `$spells` VALUES (4, 'Breath', 50, 100, 1); -INSERT INTO `$spells` VALUES (5, 'Gaia', 75, 150, 1); -INSERT INTO `$spells` VALUES (6, 'Hurt', 5, 15, 2); -INSERT INTO `$spells` VALUES (7, 'Pain', 12, 35, 2); -INSERT INTO `$spells` VALUES (8, 'Maim', 25, 70, 2); -INSERT INTO `$spells` VALUES (9, 'Rend', 40, 100, 2); -INSERT INTO `$spells` VALUES (10, 'Chaos', 50, 130, 2); -INSERT INTO `$spells` VALUES (11, 'Sleep', 10, 5, 3); -INSERT INTO `$spells` VALUES (12, 'Dream', 30, 9, 3); -INSERT INTO `$spells` VALUES (13, 'Nightmare', 60, 13, 3); -INSERT INTO `$spells` VALUES (14, 'Craze', 10, 10, 4); -INSERT INTO `$spells` VALUES (15, 'Rage', 20, 25, 4); -INSERT INTO `$spells` VALUES (16, 'Fury', 30, 50, 4); -INSERT INTO `$spells` VALUES (17, 'Ward', 10, 10, 5); -INSERT INTO `$spells` VALUES (18, 'Fend', 20, 25, 5); -INSERT INTO `$spells` VALUES (19, 'Barrier', 30, 50, 5); -END; -if (dobatch($query) == 1) { echo "Spells table populated.<br />"; } else { echo "Error populating Spells table."; } -unset($query); -} - -$query = <<<END -CREATE TABLE `$towns` ( - `id` tinyint(3) unsigned NOT NULL auto_increment, - `name` varchar(30) NOT NULL default '', + `image` tinyint(3) unsigned NOT NULL default '0', + `description` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Items2 a été crée.<br />"; } else { echo "Erreur de création de la table Items2."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `rpg_items2` VALUES (1, 7, 'potion', 5, 5, '', 0, ''); +INSERT INTO `rpg_items2` VALUES (3, 8, 'potion de magie', 5, 0, '', 0, ''); +INSERT INTO `rpg_items2` VALUES (4, 11, 'potion de vigeur', 2, 0, '', 0, ''); +INSERT INTO `rpg_items2` VALUES (5, 12, 'pomme', 2, 0, '', 0, ''); +INSERT INTO `rpg_items2` VALUES (6, 9, 'pioche', 5, 5, '', 0, ''); +END; +if (dobatch($query) == 1) { echo "La table Items2 a été complétée.<br />"; } else { echo "Erreur lorsque la table Items2 a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$levels` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `1_exp` mediumint(8) unsigned NOT NULL default '0', + `1_hp` smallint(5) unsigned NOT NULL default '0', + `1_mp` smallint(5) unsigned NOT NULL default '0', + `1_tp` smallint(5) unsigned NOT NULL default '0', + `1_strength` smallint(5) unsigned NOT NULL default '0', + `1_dexterity` smallint(5) unsigned NOT NULL default '0', + `1_spells` tinyint(3) unsigned NOT NULL default '0', + `2_exp` mediumint(8) unsigned NOT NULL default '0', + `2_hp` smallint(5) unsigned NOT NULL default '0', + `2_mp` smallint(5) unsigned NOT NULL default '0', + `2_tp` smallint(5) unsigned NOT NULL default '0', + `2_strength` smallint(5) unsigned NOT NULL default '0', + `2_dexterity` smallint(5) unsigned NOT NULL default '0', + `2_spells` tinyint(3) unsigned NOT NULL default '0', + `3_exp` mediumint(8) unsigned NOT NULL default '0', + `3_hp` smallint(5) unsigned NOT NULL default '0', + `3_mp` smallint(5) unsigned NOT NULL default '0', + `3_tp` smallint(5) unsigned NOT NULL default '0', + `3_strength` smallint(5) unsigned NOT NULL default '0', + `3_dexterity` smallint(5) unsigned NOT NULL default '0', + `3_spells` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Levels a été crée.<br />"; } else { echo "Erreur de création de la table Levels."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$levels` VALUES (1, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0, 0, 15, 0, 5, 5, 5, 0); +INSERT INTO `$levels` VALUES (2, 15, 2, 5, 1, 0, 1, 1, 18, 2, 4, 1, 2, 1, 1, 20, 2, 5, 1, 0, 2, 1); +INSERT INTO `$levels` VALUES (3, 45, 3, 4, 2, 1, 2, 0, 54, 2, 3, 2, 3, 2, 0, 60, 2, 3, 2, 1, 3, 0); +INSERT INTO `$levels` VALUES (4, 105, 3, 3, 2, 1, 2, 6, 126, 2, 3, 2, 3, 2, 0, 140, 2, 4, 2, 1, 3, 0); +INSERT INTO `$levels` VALUES (5, 195, 2, 5, 2, 0, 1, 0, 234, 2, 4, 2, 2, 1, 6, 260, 2, 4, 2, 0, 2, 6); +INSERT INTO `$levels` VALUES (6, 330, 4, 5, 2, 2, 3, 0, 396, 3, 4, 2, 4, 3, 0, 440, 3, 5, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (7, 532, 3, 4, 2, 1, 2, 11, 639, 2, 3, 2, 3, 2, 0, 710, 2, 3, 2, 1, 3, 0); +INSERT INTO `$levels` VALUES (8, 835, 2, 4, 2, 0, 1, 0, 1003, 2, 3, 2, 2, 1, 11, 1115, 2, 4, 2, 0, 2, 11); +INSERT INTO `$levels` VALUES (9, 1290, 5, 3, 2, 3, 4, 2, 1549, 4, 2, 2, 5, 4, 0, 1722, 4, 2, 2, 3, 5, 0); +INSERT INTO `$levels` VALUES (10, 1973, 10, 3, 2, 4, 3, 0, 2369, 10, 2, 2, 6, 3, 0, 2633, 10, 3, 2, 4, 4, 0); +INSERT INTO `$levels` VALUES (11, 2997, 5, 2, 2, 3, 4, 0, 3598, 4, 1, 2, 5, 4, 2, 3999, 4, 1, 2, 3, 5, 2); +INSERT INTO `$levels` VALUES (12, 4533, 4, 2, 2, 2, 3, 7, 5441, 4, 1, 2, 4, 3, 0, 6047, 4, 2, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (13, 6453, 4, 3, 2, 2, 3, 0, 7745, 4, 2, 2, 4, 3, 0, 8607, 4, 2, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (14, 8853, 5, 4, 2, 3, 4, 17, 10625, 4, 3, 2, 5, 4, 7, 11807, 4, 4, 2, 3, 5, 7); +INSERT INTO `$levels` VALUES (15, 11853, 5, 5, 2, 3, 4, 0, 14225, 4, 4, 2, 5, 4, 0, 15808, 4, 4, 2, 3, 5, 0); +INSERT INTO `$levels` VALUES (16, 15603, 5, 3, 2, 3, 4, 0, 18725, 5, 2, 2, 5, 4, 0, 20807, 5, 3, 2, 3, 5, 0); +INSERT INTO `$levels` VALUES (17, 20290, 4, 2, 2, 2, 3, 12, 24350, 4, 1, 2, 4, 3, 0, 27057, 4, 1, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (18, 25563, 4, 2, 2, 2, 3, 0, 30678, 3, 1, 2, 4, 3, 14, 34869, 3, 2, 2, 2, 4, 17); +INSERT INTO `$levels` VALUES (19, 31495, 4, 5, 2, 2, 3, 0, 37797, 3, 4, 2, 4, 3, 0, 43657, 3, 4, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (20, 38169, 10, 6, 2, 3, 3, 0, 45805, 10, 5, 2, 5, 3, 0, 53543, 10, 6, 2, 3, 4, 0); +INSERT INTO `$levels` VALUES (21, 45676, 4, 4, 2, 2, 3, 0, 54814, 4, 3, 2, 4, 3, 0, 64664, 4, 3, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (22, 54121, 5, 5, 2, 3, 4, 0, 64949, 4, 4, 2, 5, 4, 12, 77175, 4, 5, 2, 3, 5, 12); +INSERT INTO `$levels` VALUES (23, 63622, 5, 3, 2, 3, 4, 0, 76350, 4, 2, 2, 5, 4, 0, 91250, 4, 2, 2, 3, 5, 0); +INSERT INTO `$levels` VALUES (24, 74310, 5, 5, 2, 3, 4, 0, 89176, 4, 4, 2, 5, 4, 0, 107083, 4, 5, 2, 3, 5, 0); +INSERT INTO `$levels` VALUES (25, 86334, 4, 4, 2, 2, 3, 3, 103605, 3, 3, 2, 4, 3, 17, 124895, 3, 3, 2, 2, 4, 14); +INSERT INTO `$levels` VALUES (26, 99861, 6, 3, 2, 4, 5, 0, 119837, 5, 2, 2, 6, 5, 0, 144933, 5, 3, 2, 4, 6, 0); +INSERT INTO `$levels` VALUES (27, 115078, 6, 2, 2, 4, 5, 0, 138098, 5, 1, 2, 6, 5, 0, 167475, 5, 1, 2, 4, 6, 0); +INSERT INTO `$levels` VALUES (28, 132197, 4, 2, 2, 2, 3, 0, 158641, 4, 1, 2, 4, 3, 0, 192835, 4, 2, 2, 2, 4, 0); +INSERT INTO `$levels` VALUES (29, 151456, 6, 3, 2, 4, 5, 0, 181751, 5, 2, 2, 6, 5, 3, 221365, 5, 2, 2, 4, 6, 3); +INSERT INTO `$levels` VALUES (30, 173121, 10, 4, 3, 4, 4, 0, 207749, 10, 3, 3, 6, 4, 0, 253461, 10, 4, 3, 4, 5, 0); +INSERT INTO `$levels` VALUES (31, 197494, 5, 5, 3, 3, 4, 8, 236996, 4, 3, 3, 5, 4, 0, 289568, 4, 3, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (32, 224913, 6, 4, 3, 4, 5, 0, 269898, 5, 3, 3, 6, 5, 0, 330188, 5, 4, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (33, 255758, 5, 4, 3, 3, 4, 0, 306912, 5, 3, 3, 5, 4, 0, 375885, 5, 3, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (34, 290458, 6, 4, 3, 4, 5, 0, 348552, 5, 3, 3, 6, 5, 8, 427294, 5, 4, 3, 4, 6, 8); +INSERT INTO `$levels` VALUES (35, 329495, 5, 3, 3, 3, 4, 0, 395397, 4, 2, 3, 5, 4, 0, 485126, 4, 2, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (36, 373412, 4, 3, 3, 2, 3, 18, 448097, 5, 2, 3, 4, 3, 0, 550188, 5, 3, 3, 2, 4, 0); +INSERT INTO `$levels` VALUES (37, 422818, 5, 4, 3, 3, 4, 0, 507384, 5, 3, 3, 5, 4, 0, 623383, 5, 3, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (38, 478399, 6, 5, 3, 4, 5, 0, 574081, 5, 4, 3, 6, 5, 15, 705726, 5, 5, 3, 4, 6, 18); +INSERT INTO `$levels` VALUES (39, 540927, 6, 4, 3, 4, 5, 0, 649115, 5, 3, 3, 6, 5, 0, 798362, 5, 3, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (40, 611271, 15, 3, 3, 5, 5, 13, 733528, 15, 2, 3, 7, 5, 0, 902577, 15, 3, 3, 5, 6, 0); +INSERT INTO `$levels` VALUES (41, 690408, 7, 3, 3, 5, 2, 0, 828492, 6, 2, 3, 7, 2, 0, 1019818, 6, 2, 3, 5, 3, 0); +INSERT INTO `$levels` VALUES (42, 779437, 7, 4, 3, 5, 6, 0, 935326, 6, 3, 3, 7, 6, 0, 1151714, 6, 4, 3, 5, 7, 0); +INSERT INTO `$levels` VALUES (43, 879592, 8, 5, 3, 6, 7, 0, 1055514, 7, 4, 3, 8, 7, 0, 1300096, 7, 4, 3, 6, 8, 0); +INSERT INTO `$levels` VALUES (44, 992268, 6, 3, 3, 4, 5, 0, 1190725, 5, 2, 3, 6, 5, 0, 1448478, 5, 3, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (45, 1119028, 5, 8, 3, 3, 4, 4, 1325936, 5, 8, 3, 5, 4, 18, 1596860, 5, 8, 3, 3, 5, 4); +INSERT INTO `$levels` VALUES (46, 1245788, 6, 5, 3, 4, 5, 0, 1461147, 5, 4, 3, 6, 5, 0, 1745242, 5, 5, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (47, 1372548, 7, 4, 3, 5, 6, 0, 1596358, 6, 3, 3, 7, 6, 0, 1893624, 6, 3, 3, 5, 7, 0); +INSERT INTO `$levels` VALUES (48, 1499308, 6, 4, 3, 4, 5, 0, 1731569, 5, 3, 3, 6, 5, 0, 2042006, 5, 4, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (49, 1626068, 5, 3, 3, 3, 4, 0, 1866780, 4, 2, 3, 5, 4, 0, 2190388, 4, 2, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (50, 1752828, 15, 3, 3, 5, 5, 0, 2001991, 15, 2, 3, 7, 5, 0, 2338770, 15, 3, 3, 5, 6, 0); +INSERT INTO `$levels` VALUES (51, 1879588, 6, 2, 3, 4, 5, 9, 2137202, 5, 1, 3, 6, 5, 13, 2487152, 5, 1, 3, 4, 6, 13); +INSERT INTO `$levels` VALUES (52, 2006348, 7, 2, 3, 5, 6, 0, 2272413, 6, 1, 3, 7, 6, 0, 2635534, 6, 2, 3, 5, 7, 0); +INSERT INTO `$levels` VALUES (53, 2133108, 8, 2, 3, 6, 7, 0, 2407624, 7, 1, 3, 8, 7, 0, 2783916, 7, 1, 3, 6, 8, 0); +INSERT INTO `$levels` VALUES (54, 2259868, 8, 4, 3, 6, 7, 0, 2542835, 7, 3, 3, 8, 7, 0, 2932298, 7, 4, 3, 6, 8, 0); +INSERT INTO `$levels` VALUES (55, 2386628, 7, 4, 3, 5, 6, 0, 2678046, 6, 3, 3, 7, 6, 0, 3080680, 6, 3, 3, 5, 7, 0); +INSERT INTO `$levels` VALUES (56, 2513388, 7, 4, 3, 5, 6, 0, 2813257, 6, 3, 3, 7, 6, 0, 3229062, 6, 4, 3, 5, 7, 9); +INSERT INTO `$levels` VALUES (57, 2640148, 6, 5, 3, 4, 5, 0, 2948468, 6, 4, 3, 6, 5, 0, 3377444, 6, 4, 3, 4, 6, 0); +INSERT INTO `$levels` VALUES (58, 2766908, 5, 5, 3, 3, 4, 0, 3083679, 5, 4, 3, 5, 4, 19, 3525826, 5, 5, 3, 3, 5, 0); +INSERT INTO `$levels` VALUES (59, 2893668, 8, 3, 3, 6, 7, 0, 3218890, 7, 2, 3, 8, 7, 0, 3674208, 7, 2, 3, 6, 8, 0); +INSERT INTO `$levels` VALUES (60, 3020428, 15, 4, 4, 6, 6, 19, 3354101, 15, 3, 4, 8, 6, 0, 3822590, 15, 4, 4, 6, 7, 15); +INSERT INTO `$levels` VALUES (61, 3147188, 8, 5, 4, 6, 7, 0, 3489312, 7, 4, 4, 8, 7, 0, 3970972, 7, 4, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (62, 3273948, 8, 4, 4, 6, 7, 0, 3624523, 7, 3, 4, 8, 7, 0, 4119354, 7, 4, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (63, 3400708, 9, 5, 4, 7, 8, 0, 3759734, 8, 4, 4, 9, 8, 0, 4267736, 8, 4, 4, 7, 9, 0); +INSERT INTO `$levels` VALUES (64, 3527468, 5, 5, 4, 3, 4, 0, 3894945, 5, 4, 4, 5, 4, 0, 4416118, 5, 5, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (65, 3654228, 6, 4, 4, 4, 5, 0, 4030156, 6, 3, 4, 6, 5, 0, 4564500, 6, 3, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (66, 3780988, 8, 4, 4, 6, 7, 0, 4165367, 8, 3, 4, 8, 7, 0, 4712882, 8, 4, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (67, 3907748, 7, 3, 4, 5, 6, 0, 4300578, 7, 2, 4, 7, 6, 0, 4861264, 7, 2, 4, 5, 7, 0); +INSERT INTO `$levels` VALUES (68, 4034508, 9, 3, 4, 7, 8, 0, 4435789, 8, 2, 4, 9, 8, 0, 5009646, 8, 3, 4, 7, 9, 0); +INSERT INTO `$levels` VALUES (69, 4161268, 5, 4, 4, 3, 4, 0, 4571000, 5, 3, 4, 5, 4, 0, 5158028, 5, 3, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (70, 4288028, 20, 4, 4, 6, 6, 5, 4706211, 20, 3, 4, 8, 6, 16, 5306410, 20, 4, 4, 6, 7, 0); +INSERT INTO `$levels` VALUES (71, 4414788, 5, 5, 4, 3, 4, 0, 4841422, 5, 4, 4, 5, 4, 0, 5454792, 5, 4, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (72, 4541548, 6, 2, 4, 4, 5, 0, 4976633, 5, 1, 4, 6, 5, 0, 5603174, 5, 2, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (73, 4668308, 8, 4, 4, 6, 7, 0, 5111844, 8, 3, 4, 8, 7, 0, 5751556, 8, 3, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (74, 4795068, 7, 5, 4, 5, 6, 0, 5247055, 6, 4, 4, 7, 6, 0, 5899938, 6, 5, 4, 5, 7, 0); +INSERT INTO `$levels` VALUES (75, 4921828, 5, 3, 4, 3, 4, 0, 5382266, 5, 2, 4, 5, 4, 0, 6048320, 5, 2, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (76, 5048588, 6, 3, 4, 4, 5, 0, 5517477, 6, 2, 4, 6, 5, 0, 6196702, 6, 3, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (77, 5175348, 6, 4, 4, 4, 5, 0, 5652688, 7, 3, 4, 6, 5, 0, 6345084, 7, 3, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (78, 5302108, 7, 4, 4, 5, 6, 0, 5787899, 7, 3, 4, 7, 6, 0, 6493466, 7, 4, 4, 5, 7, 0); +INSERT INTO `$levels` VALUES (79, 5428868, 8, 4, 4, 6, 7, 10, 5923110, 7, 3, 4, 8, 7, 0, 6641848, 7, 3, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (80, 5555628, 20, 5, 4, 6, 7, 0, 6058321, 20, 4, 4, 8, 7, 0, 6790230, 20, 5, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (81, 5682388, 7, 3, 4, 5, 6, 0, 6193532, 7, 2, 4, 7, 6, 0, 6938612, 7, 2, 4, 5, 7, 0); +INSERT INTO `$levels` VALUES (82, 5809148, 6, 4, 4, 4, 5, 0, 6328743, 5, 3, 4, 6, 5, 0, 7086994, 5, 4, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (83, 5935908, 6, 2, 4, 4, 5, 0, 6463954, 6, 1, 4, 6, 5, 0, 7235376, 6, 1, 4, 4, 6, 0); +INSERT INTO `$levels` VALUES (84, 6062668, 5, 4, 4, 3, 4, 0, 6599165, 5, 3, 4, 5, 4, 0, 7383758, 5, 4, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (85, 6189428, 7, 4, 4, 5, 6, 0, 6734376, 6, 3, 4, 7, 6, 0, 7532140, 6, 3, 4, 5, 7, 0); +INSERT INTO `$levels` VALUES (86, 6316188, 8, 5, 4, 6, 7, 0, 6869587, 8, 4, 4, 8, 7, 0, 7680522, 8, 5, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (87, 6442948, 8, 4, 4, 6, 7, 0, 7004798, 7, 3, 4, 8, 7, 0, 7828904, 7, 3, 4, 6, 8, 0); +INSERT INTO `$levels` VALUES (88, 6569708, 9, 5, 4, 7, 8, 0, 7140009, 8, 4, 4, 9, 8, 0, 7977286, 8, 5, 4, 7, 9, 0); +INSERT INTO `$levels` VALUES (89, 6696468, 5, 2, 4, 3, 4, 0, 7275220, 5, 1, 4, 5, 4, 0, 8125668, 5, 1, 4, 3, 5, 0); +INSERT INTO `$levels` VALUES (90, 6823228, 20, 2, 5, 7, 8, 0, 7410431, 20, 1, 5, 9, 8, 0, 8274050, 20, 2, 5, 7, 9, 0); +INSERT INTO `$levels` VALUES (91, 6949988, 5, 3, 5, 3, 4, 0, 7545642, 5, 2, 5, 5, 4, 0, 8422432, 5, 2, 5, 3, 5, 0); +INSERT INTO `$levels` VALUES (92, 7076748, 6, 3, 5, 4, 5, 0, 7680853, 4, 2, 5, 6, 5, 0, 8570814, 4, 3, 5, 4, 6, 0); +INSERT INTO `$levels` VALUES (93, 7203508, 8, 4, 5, 6, 7, 0, 7816064, 6, 2, 5, 8, 7, 0, 8719196, 6, 2, 5, 6, 8, 0); +INSERT INTO `$levels` VALUES (94, 7330268, 4, 4, 5, 3, 3, 0, 7951275, 4, 3, 5, 5, 3, 0, 8867578, 4, 4, 5, 3, 4, 0); +INSERT INTO `$levels` VALUES (95, 7457028, 3, 3, 5, 5, 2, 0, 8086486, 4, 2, 5, 7, 2, 0, 9015960, 4, 2, 5, 5, 3, 0); +INSERT INTO `$levels` VALUES (96, 7583788, 5, 3, 5, 4, 3, 0, 8221697, 5, 2, 5, 7, 3, 0, 9164342, 5, 3, 5, 4, 4, 0); +INSERT INTO `$levels` VALUES (97, 7710548, 5, 4, 5, 4, 5, 0, 8356908, 5, 3, 5, 7, 5, 0, 9312724, 5, 3, 5, 4, 6, 0); +INSERT INTO `$levels` VALUES (98, 7837308, 4, 5, 5, 4, 3, 0, 8492119, 4, 3, 5, 7, 3, 0, 9461106, 4, 4, 5, 4, 4, 0); +INSERT INTO `$levels` VALUES (99, 7964068, 50, 5, 5, 6, 5, 0, 8627330, 50, 3, 5, 9, 5, 0, 9609488, 50, 4, 5, 6, 6, 0); +INSERT INTO `$levels` VALUES (100, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0, 16777215, 0, 0, 0, 0, 0, 0); +END; +if (dobatch($query) == 1) { echo "La table Levels a été complétée.<br />"; } else { echo "Erreur lorsque la table Levels a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$monsters` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `maxhp` smallint(5) unsigned NOT NULL default '0', + `maxdam` smallint(5) unsigned NOT NULL default '0', + `armor` smallint(5) unsigned NOT NULL default '0', + `level` smallint(5) unsigned NOT NULL default '0', + `maxexp` smallint(5) unsigned NOT NULL default '0', + `maxgold` smallint(5) unsigned NOT NULL default '0', + `immune` tinyint(3) unsigned NOT NULL default '0', + `image` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Monsters a été crée.<br />"; } else { echo "Erreur de création de la table Monsters."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$monsters` VALUES (1, 'Blue Slime', 4, 3, 1, 1, 1, 1, 0, 1); +INSERT INTO `$monsters` VALUES (2, 'Red Slime', 6, 5, 1, 1, 2, 1, 0, 2); +INSERT INTO `$monsters` VALUES (3, 'Critter', 6, 5, 2, 1, 4, 2, 0, 3); +INSERT INTO `$monsters` VALUES (4, 'Creature', 10, 8, 2, 2, 4, 2, 0, 4); +INSERT INTO `$monsters` VALUES (5, 'Shadow', 10, 9, 3, 2, 6, 2, 1, 5); +INSERT INTO `$monsters` VALUES (6, 'Drake', 11, 10, 3, 2, 8, 3, 0, 6); +INSERT INTO `$monsters` VALUES (7, 'Shade', 12, 10, 3, 3, 10, 3, 1, 7); +INSERT INTO `$monsters` VALUES (8, 'Drakelor', 14, 12, 4, 3, 10, 3, 0, 8); +INSERT INTO `$monsters` VALUES (9, 'Silver Slime', 15, 100, 200, 30, 15, 1000, 2, 9); +INSERT INTO `$monsters` VALUES (10, 'Scamp', 16, 13, 5, 4, 15, 5, 0, 10); +INSERT INTO `$monsters` VALUES (11, 'Raven', 16, 13, 5, 4, 18, 6, 0, 11); +INSERT INTO `$monsters` VALUES (12, 'Scorpion', 18, 14, 6, 5, 20, 7, 0, 12); +INSERT INTO `$monsters` VALUES (13, 'Illusion', 20, 15, 6, 5, 20, 7, 1, 13); +INSERT INTO `$monsters` VALUES (14, 'Nightshade', 22, 16, 6, 6, 24, 8, 0, 14); +INSERT INTO `$monsters` VALUES (15, 'Drakemal', 22, 18, 7, 6, 24, 8, 0, 15); +INSERT INTO `$monsters` VALUES (16, 'Shadow Raven', 24, 18, 7, 6, 26, 9, 1, 16); +INSERT INTO `$monsters` VALUES (17, 'Ghost', 24, 20, 8, 6, 28, 9, 0, 17); +INSERT INTO `$monsters` VALUES (18, 'Frost Raven', 26, 20, 8, 7, 30, 10, 0, 18); +INSERT INTO `$monsters` VALUES (19, 'Rogue Scorpion', 28, 22, 9, 7, 32, 11, 0, 19); +INSERT INTO `$monsters` VALUES (20, 'Ghoul', 29, 24, 9, 7, 34, 11, 0, 20); +INSERT INTO `$monsters` VALUES (21, 'Magician', 30, 24, 10, 8, 36, 12, 0, 21); +INSERT INTO `$monsters` VALUES (22, 'Rogue', 30, 25, 12, 8, 40, 13, 0, 22); +INSERT INTO `$monsters` VALUES (23, 'Drakefin', 32, 26, 12, 8, 40, 13, 0, 23); +INSERT INTO `$monsters` VALUES (24, 'Shimmer', 32, 26, 14, 8, 45, 15, 1, 24); +INSERT INTO `$monsters` VALUES (25, 'Fire Raven', 34, 28, 14, 9, 45, 15, 0, 25); +INSERT INTO `$monsters` VALUES (26, 'Dybbuk', 34, 28, 14, 9, 50, 17, 0, 26); +INSERT INTO `$monsters` VALUES (27, 'Knave', 36, 30, 15, 9, 52, 17, 0, 27); +INSERT INTO `$monsters` VALUES (28, 'Goblin', 36, 30, 15, 10, 54, 18, 0, 28); +INSERT INTO `$monsters` VALUES (29, 'Skeleton', 38, 30, 18, 10, 58, 19, 0, 29); +INSERT INTO `$monsters` VALUES (30, 'Dark Slime', 38, 32, 18, 10, 62, 21, 0, 30); +INSERT INTO `$monsters` VALUES (31, 'Silver Scorpion', 30, 160, 350, 40, 63, 2000, 2, 31); +INSERT INTO `$monsters` VALUES (32, 'Mirage', 40, 32, 20, 11, 64, 21, 1, 32); +INSERT INTO `$monsters` VALUES (33, 'Sorceror', 41, 33, 22, 11, 68, 23, 0, 33); +INSERT INTO `$monsters` VALUES (34, 'Imp', 42, 34, 22, 12, 70, 23, 0, 34); +INSERT INTO `$monsters` VALUES (35, 'Nymph', 43, 35, 22, 12, 70, 23, 0, 35); +INSERT INTO `$monsters` VALUES (36, 'Scoundrel', 43, 35, 22, 12, 75, 25, 0, 36); +INSERT INTO `$monsters` VALUES (37, 'Megaskeleton', 44, 36, 24, 13, 78, 26, 0, 37); +INSERT INTO `$monsters` VALUES (38, 'Grey Wolf', 44, 36, 24, 13, 82, 27, 0, 38); +INSERT INTO `$monsters` VALUES (39, 'Phantom', 46, 38, 24, 14, 85, 28, 1, 39); +INSERT INTO `$monsters` VALUES (40, 'Specter', 46, 38, 24, 14, 90, 30, 0, 40); +INSERT INTO `$monsters` VALUES (41, 'Dark Scorpion', 48, 40, 26, 15, 95, 32, 1, 41); +INSERT INTO `$monsters` VALUES (42, 'Warlock', 48, 40, 26, 15, 100, 33, 1, 42); +INSERT INTO `$monsters` VALUES (43, 'Orc', 49, 42, 28, 15, 104, 35, 0, 43); +INSERT INTO `$monsters` VALUES (44, 'Sylph', 49, 42, 28, 15, 106, 35, 0, 44); +INSERT INTO `$monsters` VALUES (45, 'Wraith', 50, 45, 30, 16, 108, 36, 0, 45); +INSERT INTO `$monsters` VALUES (46, 'Hellion', 50, 45, 30, 16, 110, 37, 0, 46); +INSERT INTO `$monsters` VALUES (47, 'Bandit', 52, 45, 30, 16, 114, 38, 0, 47); +INSERT INTO `$monsters` VALUES (48, 'Ultraskeleton', 52, 46, 32, 16, 116, 39, 0, 48); +INSERT INTO `$monsters` VALUES (49, 'Dark Wolf', 54, 47, 36, 17, 120, 40, 1, 49); +INSERT INTO `$monsters` VALUES (50, 'Troll', 56, 48, 36, 17, 120, 40, 0, 50); +INSERT INTO `$monsters` VALUES (51, 'Werewolf', 56, 48, 38, 17, 124, 41, 0, 51); +INSERT INTO `$monsters` VALUES (52, 'Hellcat', 58, 50, 38, 18, 128, 43, 0, 52); +INSERT INTO `$monsters` VALUES (53, 'Spirit', 58, 50, 38, 18, 132, 44, 0, 53); +INSERT INTO `$monsters` VALUES (54, 'Nisse', 60, 52, 40, 19, 132, 44, 0, 54); +INSERT INTO `$monsters` VALUES (55, 'Dawk', 60, 54, 40, 19, 136, 45, 0, 55); +INSERT INTO `$monsters` VALUES (56, 'Figment', 64, 55, 42, 19, 140, 47, 1, 56); +INSERT INTO `$monsters` VALUES (57, 'Hellhound', 66, 56, 44, 20, 140, 47, 0, 57); +INSERT INTO `$monsters` VALUES (58, 'Wizard', 66, 56, 44, 20, 144, 48, 0, 58); +INSERT INTO `$monsters` VALUES (59, 'Uruk', 68, 58, 44, 20, 146, 49, 0, 59); +INSERT INTO `$monsters` VALUES (60, 'Siren', 68, 400, 800, 50, 10000, 50, 2, 60); +INSERT INTO `$monsters` VALUES (61, 'Megawraith', 70, 60, 46, 21, 155, 52, 0, 61); +INSERT INTO `$monsters` VALUES (62, 'Dawkin', 70, 60, 46, 21, 155, 52, 0, 62); +INSERT INTO `$monsters` VALUES (63, 'Grey Bear', 70, 62, 48, 21, 160, 53, 0, 63); +INSERT INTO `$monsters` VALUES (64, 'Haunt', 72, 62, 48, 22, 160, 53, 0, 64); +INSERT INTO `$monsters` VALUES (65, 'Hellbeast', 74, 64, 50, 22, 165, 55, 0, 65); +INSERT INTO `$monsters` VALUES (66, 'Fear', 76, 66, 52, 23, 165, 55, 0, 66); +INSERT INTO `$monsters` VALUES (67, 'Beast', 76, 66, 52, 23, 170, 57, 0, 67); +INSERT INTO `$monsters` VALUES (68, 'Ogre', 78, 68, 54, 23, 170, 57, 0, 68); +INSERT INTO `$monsters` VALUES (69, 'Dark Bear', 80, 70, 56, 24, 175, 58, 1, 69); +INSERT INTO `$monsters` VALUES (70, 'Fire', 80, 72, 56, 24, 175, 58, 0, 70); +INSERT INTO `$monsters` VALUES (71, 'Polgergeist', 84, 74, 58, 25, 180, 60, 0, 71); +INSERT INTO `$monsters` VALUES (72, 'Fright', 86, 76, 58, 25, 180, 60, 0, 72); +INSERT INTO `$monsters` VALUES (73, 'Lycan', 88, 78, 60, 25, 185, 62, 0, 73); +INSERT INTO `$monsters` VALUES (74, 'Terra Elemental', 88, 80, 62, 25, 185, 62, 1, 74); +INSERT INTO `$monsters` VALUES (75, 'Necromancer', 90, 80, 62, 26, 190, 63, 0, 75); +INSERT INTO `$monsters` VALUES (76, 'Ultrawraith', 90, 82, 64, 26, 190, 63, 0, 76); +INSERT INTO `$monsters` VALUES (77, 'Dawkor', 92, 82, 64, 26, 195, 65, 0, 77); +INSERT INTO `$monsters` VALUES (78, 'Werebear', 92, 84, 65, 26, 195, 65, 0, 78); +INSERT INTO `$monsters` VALUES (79, 'Brute', 94, 84, 65, 27, 200, 67, 0, 79); +INSERT INTO `$monsters` VALUES (80, 'Large Beast', 96, 88, 66, 27, 200, 67, 0, 80); +INSERT INTO `$monsters` VALUES (81, 'Horror', 96, 88, 68, 27, 210, 70, 0, 81); +INSERT INTO `$monsters` VALUES (82, 'Flame', 100, 90, 70, 28, 210, 70, 0, 82); +INSERT INTO `$monsters` VALUES (83, 'Lycanthor', 100, 90, 70, 28, 210, 70, 0, 83); +INSERT INTO `$monsters` VALUES (84, 'Wyrm', 100, 92, 72, 28, 220, 73, 0, 84); +INSERT INTO `$monsters` VALUES (85, 'Aero Elemental', 104, 94, 74, 29, 220, 73, 1, 85); +INSERT INTO `$monsters` VALUES (86, 'Dawkare', 106, 96, 76, 29, 220, 73, 0, 86); +INSERT INTO `$monsters` VALUES (87, 'Large Brute', 108, 98, 78, 29, 230, 77, 0, 87); +INSERT INTO `$monsters` VALUES (88, 'Frost Wyrm', 110, 100, 80, 30, 230, 77, 0, 88); +INSERT INTO `$monsters` VALUES (89, 'Knight', 110, 102, 80, 30, 240, 80, 0, 89); +INSERT INTO `$monsters` VALUES (90, 'Lycanthra', 112, 104, 82, 30, 240, 80, 0, 90); +INSERT INTO `$monsters` VALUES (91, 'Terror', 115, 108, 84, 31, 250, 83, 0, 91); +INSERT INTO `$monsters` VALUES (92, 'Blaze', 118, 108, 84, 31, 250, 83, 0, 92); +INSERT INTO `$monsters` VALUES (93, 'Aqua Elemental', 120, 110, 90, 31, 260, 87, 1, 93); +INSERT INTO `$monsters` VALUES (94, 'Fire Wyrm', 120, 110, 90, 32, 260, 87, 0, 94); +INSERT INTO `$monsters` VALUES (95, 'Lesser Wyvern', 122, 110, 92, 32, 270, 90, 0, 95); +INSERT INTO `$monsters` VALUES (96, 'Doomer', 124, 112, 92, 32, 270, 90, 0, 96); +INSERT INTO `$monsters` VALUES (97, 'Armor Knight', 130, 115, 95, 33, 280, 93, 0, 97); +INSERT INTO `$monsters` VALUES (98, 'Wyvern', 134, 120, 95, 33, 290, 97, 0, 98); +INSERT INTO `$monsters` VALUES (99, 'Nightmare', 138, 125, 100, 33, 300, 100, 0, 99); +INSERT INTO `$monsters` VALUES (100, 'Fira Elemental', 140, 125, 100, 34, 310, 103, 1, 100); +INSERT INTO `$monsters` VALUES (101, 'Megadoomer', 140, 128, 105, 34, 320, 107, 0, 101); +INSERT INTO `$monsters` VALUES (102, 'Greater Wyvern', 145, 130, 105, 34, 335, 112, 0, 102); +INSERT INTO `$monsters` VALUES (103, 'Advocate', 148, 132, 108, 35, 350, 117, 0, 103); +INSERT INTO `$monsters` VALUES (104, 'Strong Knight', 150, 135, 110, 35, 365, 122, 0, 104); +INSERT INTO `$monsters` VALUES (105, 'Liche', 150, 135, 110, 35, 380, 127, 0, 105); +INSERT INTO `$monsters` VALUES (106, 'Ultradoomer', 155, 140, 115, 36, 395, 132, 0, 106); +INSERT INTO `$monsters` VALUES (107, 'Fanatic', 160, 140, 115, 36, 410, 137, 0, 107); +INSERT INTO `$monsters` VALUES (108, 'Green Dragon', 160, 140, 115, 36, 425, 142, 0, 108); +INSERT INTO `$monsters` VALUES (109, 'Fiend', 160, 145, 120, 37, 445, 148, 0, 109); +INSERT INTO `$monsters` VALUES (110, 'Greatest Wyvern', 162, 150, 120, 37, 465, 155, 0, 110); +INSERT INTO `$monsters` VALUES (111, 'Lesser Devil', 164, 150, 120, 37, 485, 162, 0, 111); +INSERT INTO `$monsters` VALUES (112, 'Liche Master', 168, 155, 125, 38, 505, 168, 0, 112); +INSERT INTO `$monsters` VALUES (113, 'Zealot', 168, 155, 125, 38, 530, 177, 0, 113); +INSERT INTO `$monsters` VALUES (114, 'Serafiend', 170, 155, 125, 38, 555, 185, 0, 114); +INSERT INTO `$monsters` VALUES (115, 'Pale Knight', 175, 160, 130, 39, 580, 193, 0, 115); +INSERT INTO `$monsters` VALUES (116, 'Blue Dragon', 180, 160, 130, 39, 605, 202, 0, 116); +INSERT INTO `$monsters` VALUES (117, 'Obsessive', 180, 160, 135, 40, 630, 210, 0, 117); +INSERT INTO `$monsters` VALUES (118, 'Devil', 184, 164, 135, 40, 666, 222, 0, 118); +INSERT INTO `$monsters` VALUES (119, 'Liche Prince', 190, 168, 138, 40, 660, 220, 0, 119); +INSERT INTO `$monsters` VALUES (120, 'Cherufiend', 195, 170, 140, 41, 690, 230, 0, 120); +INSERT INTO `$monsters` VALUES (121, 'Red Dragon', 200, 180, 145, 41, 720, 240, 0, 121); +INSERT INTO `$monsters` VALUES (122, 'Greater Devil', 200, 180, 145, 41, 750, 250, 0, 122); +INSERT INTO `$monsters` VALUES (123, 'Renegade', 205, 185, 150, 42, 780, 260, 0, 123); +INSERT INTO `$monsters` VALUES (124, 'Archfiend', 210, 190, 150, 42, 810, 270, 0, 124); +INSERT INTO `$monsters` VALUES (125, 'Liche Lord', 210, 190, 155, 42, 850, 283, 0, 125); +INSERT INTO `$monsters` VALUES (126, 'Greatest Devil', 215, 195, 160, 43, 890, 297, 0, 126); +INSERT INTO `$monsters` VALUES (127, 'Dark Knight', 220, 200, 160, 43, 930, 310, 0, 127); +INSERT INTO `$monsters` VALUES (128, 'Giant', 220, 200, 165, 43, 970, 323, 0, 128); +INSERT INTO `$monsters` VALUES (129, 'Shadow Dragon', 225, 200, 170, 44, 1010, 337, 0, 129); +INSERT INTO `$monsters` VALUES (130, 'Liche King', 225, 205, 170, 44, 1050, 350, 0, 130); +INSERT INTO `$monsters` VALUES (131, 'Incubus', 230, 205, 175, 44, 1100, 367, 1, 131); +INSERT INTO `$monsters` VALUES (132, 'Traitor', 230, 205, 175, 45, 1150, 383, 0, 132); +INSERT INTO `$monsters` VALUES (133, 'Demon', 240, 210, 180, 45, 1200, 400, 0, 133); +INSERT INTO `$monsters` VALUES (134, 'Dark Dragon', 245, 215, 180, 45, 1250, 417, 1, 134); +INSERT INTO `$monsters` VALUES (135, 'Insurgent', 250, 220, 190, 46, 1300, 433, 0, 135); +INSERT INTO `$monsters` VALUES (136, 'Leviathan', 255, 225, 190, 46, 1350, 450, 0, 136); +INSERT INTO `$monsters` VALUES (137, 'Grey Daemon', 260, 230, 190, 46, 1400, 467, 0, 137); +INSERT INTO `$monsters` VALUES (138, 'Succubus', 265, 240, 200, 47, 1460, 487, 1, 138); +INSERT INTO `$monsters` VALUES (139, 'Demon Prince', 270, 240, 200, 47, 1520, 507, 0, 139); +INSERT INTO `$monsters` VALUES (140, 'Black Dragon', 275, 250, 205, 47, 1580, 527, 1, 140); +INSERT INTO `$monsters` VALUES (141, 'Nihilist', 280, 250, 205, 47, 1640, 547, 0, 141); +INSERT INTO `$monsters` VALUES (142, 'Behemoth', 285, 260, 210, 48, 1700, 567, 0, 142); +INSERT INTO `$monsters` VALUES (143, 'Demagogue', 290, 260, 210, 48, 1760, 587, 0, 143); +INSERT INTO `$monsters` VALUES (144, 'Demon Lord', 300, 270, 220, 48, 1820, 607, 0, 144); +INSERT INTO `$monsters` VALUES (145, 'Red Daemon', 310, 280, 230, 48, 1880, 627, 0, 145); +INSERT INTO `$monsters` VALUES (146, 'Colossus', 320, 300, 240, 49, 1940, 647, 0, 146); +INSERT INTO `$monsters` VALUES (147, 'Demon King', 330, 300, 250, 49, 2000, 667, 0, 147); +INSERT INTO `$monsters` VALUES (148, 'Dark Daemon', 340, 320, 260, 49, 2200, 733, 1, 148); +INSERT INTO `$monsters` VALUES (149, 'Titan', 360, 340, 270, 50, 2400, 800, 0, 149); +INSERT INTO `$monsters` VALUES (150, 'Black Daemon', 400, 400, 280, 50, 3000, 1000, 1, 150); +INSERT INTO `$monsters` VALUES (151, 'Lucifuge', 600, 600, 400, 50, 10000, 10000, 2, 151); +END; +if (dobatch($query) == 1) { echo "La table Monsters a été complétée.<br />"; } else { echo "Erreur lorsque la table Monsters a été complétée."; } +unset($query); +} + + +$query = <<<END +CREATE TABLE `$news` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `postdate` datetime NOT NULL default '00-00-0000 00:00:00', + `content` text NOT NULL, + `author` varchar(50) NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table News a été crée.<br />"; } else { echo "Erreur de création de la table News."; } +unset($query); + +$query = <<<END +INSERT INTO `$news` VALUES (1, '2005-01-01 12:00:00', 'Ceci est la dernière nouvelle . Veuillez employer le menu d\'administration pour additionner une autre et faire disparaitre celle-ci.','Darkmore'); +END; +if (dobatch($query) == 1) { echo "La table News a été complétée.<br />"; } else { echo "Erreur lorsque la table News a été complétée."; } +unset($query); + +$query = +"CREATE TABLE `$newsaccueil`( +`id` int(6) NOT NULL auto_increment, +`postdate` datetime NOT NULL default '00-00-0000 00:00:00', +`titre` text NOT NULL, +`content` text NOT NULL, +`auteur` text NOT NULL, + PRIMARY KEY(id) +)"; + + if (dobatch($query) == 1) { echo "La table newsaccueil a été crée.<br />"; } else { echo "Erreur de création de la table newsaccueil"; } +unset($query); + +$query = <<<END +INSERT INTO `$newsaccueil` VALUES (1, '2005-11-11 12:00:00', 'Bienvenue sur RPG illusion 1.2c !','Bienvenue sur RPG illusion v1.2c . Vous pouvez également la télécharger pour votre site à cette adresse : http//www.rpgillusion.net','Darkmore'); +END; +if (dobatch($query) == 1) { echo "La table Newsaccueil a été complétée.<br />"; } else { echo "Erreur lorsque la table Newsaccueil a été complétée."; } +unset($query); + +$query = <<<END +CREATE TABLE `$spells` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `name` varchar(30) NOT NULL default '', + `mp` smallint(5) unsigned NOT NULL default '0', + `attribute` smallint(5) unsigned NOT NULL default '0', + `type` smallint(5) unsigned NOT NULL default '0', + `price` varchar(30) NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Spells a été crée.<br />"; } else { echo "Erreur de création de la table Spells."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$spells` VALUES (1, 'Heal', 5, 10, 1 , 5); +INSERT INTO `$spells` VALUES (2, 'Revive', 10, 25, 1, 10); +INSERT INTO `$spells` VALUES (3, 'Life', 25, 50, 1, 15); +INSERT INTO `$spells` VALUES (4, 'Breath', 50, 100, 1, 20); +INSERT INTO `$spells` VALUES (5, 'Gaia', 75, 150, 1, 25); +INSERT INTO `$spells` VALUES (6, 'Hurt', 5, 15, 2, 30); +INSERT INTO `$spells` VALUES (7, 'Pain', 12, 35, 2, 35); +INSERT INTO `$spells` VALUES (8, 'Maim', 25, 70, 2, 40); +INSERT INTO `$spells` VALUES (9, 'Rend', 40, 100, 2, 45); +INSERT INTO `$spells` VALUES (10, 'Chaos', 50, 130, 2, 50); +INSERT INTO `$spells` VALUES (11, 'Sleep', 10, 5, 3, 55); +INSERT INTO `$spells` VALUES (12, 'Dream', 30, 9, 3, 60); +INSERT INTO `$spells` VALUES (13, 'Nightmare', 60, 13, 3, 65); +INSERT INTO `$spells` VALUES (14, 'Craze', 10, 10, 4, 70); +INSERT INTO `$spells` VALUES (15, 'Rage', 20, 25, 4, 75); +INSERT INTO `$spells` VALUES (16, 'Fury', 30, 50, 4, 80); +INSERT INTO `$spells` VALUES (17, 'Ward', 10, 10, 5, 85); +INSERT INTO `$spells` VALUES (18, 'Fend', 20, 25, 5, 90); +INSERT INTO `$spells` VALUES (19, 'Barrier', 30, 50, 5, 95); +END; +if (dobatch($query) == 1) { echo "La table Spells a été complétée.<br />"; } else { echo "Erreur lorsque la table Spells a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$towns` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `name` varchar(30) NOT NULL default '', + `codebanque` text NOT NULL default '', + `codeniveau` text NOT NULL default '', + `codexp` text NOT NULL default '', + `codeptlevel` text NOT NULL default '', + `interets` smallint(200) NOT NULL default '0', + `chiffrebanque` smallint(200) NOT NULL default '0', + `chiffreniveau` smallint(200) NOT NULL default '0', + `chiffrexp` smallint(200) NOT NULL default '0', + `chiffreptlevel` smallint(200) NOT NULL default '0', + `latitude` smallint(6) NOT NULL default '0', + `longitude` smallint(6) NOT NULL default '0', + `innprice` tinyint(4) NOT NULL default '0', + `mapprice` smallint(6) NOT NULL default '0', + `homeprice` smallint(6) NOT NULL default '0', + `travelpoints` smallint(5) unsigned NOT NULL default '0', + `itemslist` text NOT NULL, + `itemslistb` text NOT NULL, + `prixenchanteur` smallint(5) NOT NULL default '0', + `prixsoigneur` mediumint(5) NOT NULL default '0', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Towns a été crée.<br />"; } else { echo "Erreur de création de la table Towns."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$towns` VALUES (1, 'Midworld','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03, 5000, 5, 5000, 100, 0, 0, 5, 0, 1000, 0, '1,2,3,17,18,19,28,29','1,2,3,4,5,6',2,2); +INSERT INTO `$towns` VALUES (2, 'Roma','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, 30, 30, 10, 25, 800, 5, '2,3,4,18,19,29','1,2,3,4,5,6',4,4); +INSERT INTO `$towns` VALUES (3, 'Bris','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, 70, -70, 25, 50, 700, 15, '2,3,4,5,18,19,20,29.30','1,2,3,4,5,6',6,6); +INSERT INTO `$towns` VALUES (4, 'Kalle','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, -100, 100, 40, 100, 900, 30, '5,6,8,10,12,21,22,23,29,30','1,2,3,4,5,6',8,8); +INSERT INTO `$towns` VALUES (5, 'Narcissa','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, -130, -130, 60, 500, 600, 50, '4,7,9,11,13,21,22,23,29,30,31','1,2,3,4,5,6',10,10); +INSERT INTO `$towns` VALUES (6, 'Hambry','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, 170, 170, 90, 1000, 500, 80, '10,11,12,13,14,23,24,30,31','1,2,3,4,5,6',12,12); +INSERT INTO `$towns` VALUES (7, 'Gilead','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, 200, -200, 100, 3000, 500, 110, '12,13,14,15,24,25,26,32','1,2,3,4,5,6',14,14); +INSERT INTO `$towns` VALUES (8, 'Endworld','Service non disponible','Service non disponible','Service non disponible','Service non disponible',0.03,5000,5, 100, 5000, -250, -250, 125, 9000, 300, 160, '16,27,33','1,2,3,4,5,6',16,16); + +END; +if (dobatch($query) == 1) { echo "La table Towns a été complétée.<br />"; } else { echo "Erreur lorsque la table Towns a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$maison` ( + `id` int(6) NOT NULL auto_increment, + `name` varchar(200) NOT NULL default '', `latitude` smallint(6) NOT NULL default '0', `longitude` smallint(6) NOT NULL default '0', + `buvette` tinyint(3) NOT NULL default '1', `innprice` tinyint(4) NOT NULL default '0', - `mapprice` smallint(6) NOT NULL default '0', - `travelpoints` smallint(5) unsigned NOT NULL default '0', - `itemslist` text NOT NULL, - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Towns table created.<br />"; } else { echo "Error creating Towns table."; } -unset($query); - -if ($full == true) { -$query = <<<END -INSERT INTO `$towns` VALUES (1, 'Midworld', 0, 0, 5, 0, 0, '1,2,3,17,18,19,28,29'); -INSERT INTO `$towns` VALUES (2, 'Roma', 30, 30, 10, 25, 5, '2,3,4,18,19,29'); -INSERT INTO `$towns` VALUES (3, 'Bris', 70, -70, 25, 50, 15, '2,3,4,5,18,19,20,29.30'); -INSERT INTO `$towns` VALUES (4, 'Kalle', -100, 100, 40, 100, 30, '5,6,8,10,12,21,22,23,29,30'); -INSERT INTO `$towns` VALUES (5, 'Narcissa', -130, -130, 60, 500, 50, '4,7,9,11,13,21,22,23,29,30,31'); -INSERT INTO `$towns` VALUES (6, 'Hambry', 170, 170, 90, 1000, 80, '10,11,12,13,14,23,24,30,31'); -INSERT INTO `$towns` VALUES (7, 'Gilead', 200, -200, 100, 3000, 110, '12,13,14,15,24,25,26,32'); -INSERT INTO `$towns` VALUES (8, 'Endworld', -250, -250, 125, 9000, 160, '16,27,33'); -END; -if (dobatch($query) == 1) { echo "Towns table populated.<br />"; } else { echo "Error populating Towns table."; } -unset($query); -} + `training` tinyint(4) NOT NULL default '0', + `msg` varchar(200) NOT NULL default '', + `proprio` varchar(250) NOT NULL, + `proprioname` varchar(250) NOT NULL, + `bloghome` varchar(255) NOT NULL default 'Aucune', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Maison a été crée.<br />"; } else { echo "Erreur de création de la table Maison."; } +unset($query); + +$query = <<<END +CREATE TABLE `$sol` ( + `id` int(6) NOT NULL auto_increment, + `lati` int(5) NOT NULL default '0', + `longi` int(5) NOT NULL default '0', + `passable` tinyint(1) NOT NULL default '1', + `peage` tinyint(1) NOT NULL default '0', + `type` varchar(25) NOT NULL default '', + `prix` tinyint(4) NOT NULL default '0', + `nom` varchar(25) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM AUTO_INCREMENT=697 ; +END; +if (dobatch($query) == 1) { echo "La table Sol a été crée.<br />"; } else { echo "Erreur de création de la table Sol."; } +unset($query); + +if ($full == true) { +$query = <<<END +INSERT INTO `$sol` VALUES (81, 6, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (68, 2, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (67, -2, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (66, -2, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (65, 2, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (273, 8, 0, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (63, -1, -4, 1, 0, '', 0, 'peage1'); +INSERT INTO `$sol` VALUES (61, -2, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (60, -1, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (59, 1, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (58, 2, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (57, 2, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (56, 1, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (55, -1, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (54, -2, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (53, 3, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (52, 3, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (51, 3, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (50, 3, -1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (49, 3, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (48, 3, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (47, -3, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (46, -3, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (45, -3, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (44, -3, -1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (43, -3, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (42, -3, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (80, 7, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (77, 10, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (79, 8, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (78, 9, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (82, 5, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (83, 4, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (84, 10, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (85, 9, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (86, 9, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (87, 8, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (88, 7, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (89, 6, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (90, 5, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (91, 10, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (92, 9, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (93, 8, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (94, 7, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (95, 6, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (96, 5, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (97, 5, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (98, 5, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (99, 5, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (100, 6, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (101, 6, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (102, 6, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (103, 7, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (104, 7, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (105, 7, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (106, 8, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (107, 8, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (108, 8, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (109, 9, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (110, 9, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (111, 9, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (112, 10, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (113, 10, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (114, 10, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (115, 10, 11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (116, 9, 11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (117, 8, 11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (118, 9, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (119, 10, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (120, 2, 19, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (121, 2, 18, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (122, 2, 17, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (123, 2, 16, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (124, 2, 15, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (125, 3, 15, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (126, 4, 17, 1, 0, '', 0, 'maison1'); +INSERT INTO `$sol` VALUES (127, 4, 15, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (128, 5, 15, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (129, 6, 15, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (130, 6, 16, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (131, 6, 17, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (132, 3, 19, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (133, 4, 19, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (134, 5, 19, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (135, 6, 19, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (136, 6, 18, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (137, 11, 11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (138, 11, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (139, 12, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (140, 12, 11, 1, 0, '', 0, 'maison1'); +INSERT INTO `$sol` VALUES (141, 14, 14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (142, 12, 17, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (143, 12, 14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (144, 17, 17, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (145, 18, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (146, 14, 20, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (147, 15, 17, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (148, 20, 17, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (149, 12, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (150, 12, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (151, 11, 7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (152, 11, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (153, 11, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (154, 13, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (155, 16, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (156, 18, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (157, 14, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (158, 20, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (159, 16, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (160, 14, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (161, 12, 6, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (162, 11, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (163, 13, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (164, 18, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (165, 20, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (166, 19, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (167, 20, 0, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (168, 8, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (169, 4, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (170, 5, 2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (171, 4, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (172, 5, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (173, 2, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (174, 20, 1, 1, 0, '', 0, 'maison1'); +INSERT INTO `$sol` VALUES (175, 0, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (176, 3, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (177, 7, 3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (178, 0, 17, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (179, 8, 18, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (180, 1, 13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (181, 9, 15, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (274, 9, 0, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (183, 4, 13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (184, 10, 20, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (185, 1, 20, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (186, 7, 21, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (187, 9, 23, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (188, 6, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (189, 5, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (190, 7, 28, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (191, 4, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (192, 6, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (193, 5, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (194, 4, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (195, 6, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (196, 5, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (197, 4, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (198, 5, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (199, 4, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (200, 4, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (201, 3, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (202, 2, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (203, 1, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (204, 1, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (205, 2, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (206, 3, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (207, 3, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (208, 2, 24, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (209, 3, 25, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (210, 1, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (211, 2, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (212, 3, 26, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (213, 2, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (214, 1, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (215, 1, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (216, 5, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (217, 6, 22, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (218, 6, 23, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (219, 1, 27, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (220, 2, 27, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (221, 3, 27, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (222, 4, 27, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (223, 5, 27, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (224, 6, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (225, 7, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (226, 9, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (227, 0, 30, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (228, 3, 29, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (229, 0, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (230, 0, 22, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (231, 3, 21, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (232, 5, 28, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (233, 5, 29, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (234, 4, 28, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (235, 4, 29, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (236, 5, 30, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (237, 2, 28, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (238, 2, 29, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (239, 4, 30, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (240, 3, 30, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (241, 2, 30, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (242, 1, 28, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (243, 1, 29, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (244, 1, 30, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (245, 6, 31, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (246, 6, 32, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (247, 5, 32, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (248, 5, 31, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (249, 4, 32, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (250, 3, 32, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (251, 4, 31, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (252, 3, 31, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (253, 6, 33, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (254, 6, 34, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (255, 5, 34, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (256, 7, 33, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (257, 7, 34, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (258, 7, 35, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (259, 6, 35, 1, 0, '', 0, 'mer'); +INSERT INTO `$sol` VALUES (260, 12, 5, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (265, 10, 0, 1, 0, '', 0, 'pierre'); +INSERT INTO `$sol` VALUES (696, 3, 0, 1, 0, '', 0, 'peage1'); +INSERT INTO `$sol` VALUES (271, 7, 1, 1, 0, '', 0, 'rocher2'); +INSERT INTO `$sol` VALUES (289, 30, 10, 1, 0, '', 0, 'arbres'); +INSERT INTO `$sol` VALUES (279, 10, 1, 1, 0, '', 0, 'pierre'); +INSERT INTO `$sol` VALUES (277, 9, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (287, 2, 4, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (288, 6, 2, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (290, 30, 11, 1, 0, '', 0, 'arbres'); +INSERT INTO `$sol` VALUES (291, 30, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (292, 29, 11, 1, 0, '', 0, 'rocher'); +INSERT INTO `$sol` VALUES (293, 29, 10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (294, 28, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (295, 30, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (296, 29, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (297, 26, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (298, 27, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (299, 28, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (300, 26, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (301, 26, 28, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (302, 27, 11, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (303, 26, 29, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (304, 25, 29, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (305, 27, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (306, 29, 24, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (307, 24, 22, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (308, 27, 23, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (309, 25, 24, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (310, 27, 12, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (311, 26, 21, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (312, 29, 22, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (313, 22, 24, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (314, 28, 13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (315, 24, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (316, 21, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (317, 24, 25, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (318, 27, 25, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (319, 25, 23, 1, 0, '', 0, 'rocher'); +INSERT INTO `$sol` VALUES (320, 22, 30, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (321, 25, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (322, 28, 15, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (323, 28, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (324, 29, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (325, 30, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (326, 30, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (327, 30, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (328, 29, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (329, 28, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (330, 27, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (331, 29, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (332, 28, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (333, 27, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (334, 26, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (335, 27, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (336, 28, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (338, 29, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (339, 31, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (340, 32, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (341, 33, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (342, 34, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (343, 35, 26, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (344, 35, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (345, 34, 27, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (346, 35, 29, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (347, 35, 28, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (348, 35, 31, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (349, 35, 32, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (350, 35, 33, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (351, 34, 33, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (352, 31, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (353, 30, 14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (354, 32, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (355, 33, 27, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (356, 34, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (357, 33, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (358, 32, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (359, 31, 28, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (360, 35, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (361, 34, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (362, 34, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (363, 33, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (364, 33, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (365, 32, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (366, 31, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (367, 30, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (368, 31, 29, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (369, 27, 13, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (370, 32, 30, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (372, 27, 14, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (373, 34, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (374, 33, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (375, 32, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (376, 31, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (377, 29, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (378, 25, 31, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (379, 26, 31, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (380, 26, 32, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (381, 26, 12, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (382, 28, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (383, 27, 31, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (384, 27, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (385, 28, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (386, 29, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (387, 30, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (388, 31, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (389, 32, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (390, 33, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (391, 34, 32, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (396, 32, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (393, 35, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (394, 34, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (395, 33, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (397, 31, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (398, 30, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (399, 29, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (400, 28, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (401, 27, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (402, 26, 34, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (403, 26, 33, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (404, 27, 33, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (405, 28, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (406, 29, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (407, 30, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (408, 31, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (409, 32, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (410, 33, 33, 1, 0, '', 0, 'pave'); +INSERT INTO `$sol` VALUES (411, 26, 11, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (412, 28, 11, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (413, 33, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (414, 32, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (415, 28, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (416, 29, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (417, 30, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (418, 31, 25, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (419, 33, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (420, 28, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (421, 29, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (422, 30, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (423, 31, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (424, 32, 35, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (425, 26, 35, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (426, 34, 35, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (427, 25, 26, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (428, 25, 28, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (429, 26, 13, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (430, 26, 14, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (431, 28, 14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (432, 28, 16, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (433, 27, 15, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (450, 5, -4, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (546, -3, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (436, 35, 25, 1, 0, '', 0, 'tron1'); +INSERT INTO `$sol` VALUES (437, 26, 16, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (438, 25, 12, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (439, 25, 13, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (440, 25, 14, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (441, 25, 15, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (442, 25, 11, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (443, 25, 16, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (444, 24, 12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (445, 24, 13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (446, 24, 11, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (447, 24, 14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (448, 24, 15, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (451, -4, -5, 1, 0, '', 0, 'rocher'); +INSERT INTO `$sol` VALUES (452, 2, -5, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (453, 5, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (454, -5, -3, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (455, -2, -7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (456, -6, -7, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (457, -4, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (458, -2, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (459, -2, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (460, -3, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (461, -3, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (462, -3, -12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (463, -2, -12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (464, -2, -13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (465, -3, -13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (466, -4, -13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (467, -5, -13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (468, -5, -12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (469, -4, -12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (470, -4, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (471, -5, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (472, -4, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (473, -5, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (474, -6, -13, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (475, -6, -12, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (476, -6, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (477, -6, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (478, -2, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (479, -3, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (480, -5, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (481, -6, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (568, -15, -10, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (484, 0, -9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (485, -4, -15, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (486, 0, -14, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (487, -9, -12, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (488, -10, -8, 1, 0, '', 0, 'dino'); +INSERT INTO `$sol` VALUES (489, -13, -11, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (490, -8, -15, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (491, -9, -14, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (492, -2, -15, 1, 0, '', 0, 'rocher2'); +INSERT INTO `$sol` VALUES (493, -13, -14, 1, 0, '', 0, 'butte'); +INSERT INTO `$sol` VALUES (494, -14, -14, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (495, -13, -8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (496, -11, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (497, -8, -10, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (498, -12, -4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (499, -9, -8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (500, 127, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (501, 127, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (502, 127, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (503, 127, -55, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (504, 127, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (505, 4, 5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (569, 13, 6, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (508, 127, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (509, 127, -53, 1, 0, '', 0, 'lave'); +INSERT INTO `$sol` VALUES (510, 127, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (511, 127, -54, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (512, 127, -51, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (513, 169, -51, 1, 0, '', 0, 'terre'); +INSERT INTO `$sol` VALUES (514, 183, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (515, 183, -51, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (516, 183, -52, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (517, 183, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (518, 182, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (519, 181, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (520, 182, -55, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (521, 181, -55, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (522, 180, -55, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (523, 179, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (524, 179, -54, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (525, 179, -55, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (526, 178, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (527, 177, -53, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (528, 177, -52, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (529, 177, -51, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (530, 177, -50, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (531, 183, -49, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (532, 183, -48, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (533, 183, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (534, 182, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (535, 181, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (536, 180, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (537, 177, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (538, 179, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (539, 178, -47, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (540, 177, -48, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (541, 177, -49, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (542, 185, -51, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (543, 175, -54, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (544, 181, -45, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (545, 185, -54, 1, 0, '', 0, 'dino'); +INSERT INTO `$sol` VALUES (547, 7, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (548, 8, -4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (549, 10, -2, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (550, 6, 0, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (551, -5, 1, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (552, 10, -5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (553, 6, -5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (554, -1, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (555, 0, -5, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (556, 1, 8, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (557, -4, 6, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (558, -5, 9, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (559, 0, -2, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (571, -39, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (561, -4, -4, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (562, 6, -2, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (563, -2, 5, 1, 0, '', 0, 'feuille_morte'); +INSERT INTO `$sol` VALUES (564, -1, 8, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (565, -3, 10, 1, 0, '', 0, 'rocher'); +INSERT INTO `$sol` VALUES (566, -5, 4, 0, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (567, -5, 7, 1, 0, '', 0, 'arbres'); +INSERT INTO `$sol` VALUES (572, -37, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (573, -38, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (574, -36, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (575, -40, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (576, -40, 44, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (577, -40, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (578, -36, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (579, -35, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (580, -34, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (581, -35, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (582, -35, 42, 1, 0, '', 0, 'maison1'); +INSERT INTO `$sol` VALUES (583, -36, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (584, -36, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (585, -36, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (586, -35, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (587, -34, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (588, -38, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (589, -38, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (590, -40, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (591, -40, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (592, -38, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (593, -40, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (594, -38, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (595, -37, 38, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (596, -40, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (597, -33, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (598, -39, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (599, -40, 38, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (600, -38, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (601, -36, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (602, -36, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (603, -36, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (604, -37, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (605, -39, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (606, -40, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (607, -40, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (608, -40, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (609, -38, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (610, -39, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (612, -39, 33, 1, 0, '', 0, 'chien'); +INSERT INTO `$sol` VALUES (613, -34, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (614, -34, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (615, -33, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (616, -34, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (617, -32, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (618, -36, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (619, -34, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (620, -34, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (621, -36, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (622, -33, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (623, -35, 31, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (624, -36, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (627, -34, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (628, -33, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (629, -32, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (630, -31, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (631, -30, 31, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (632, -29, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (633, -29, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (634, -32, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (635, -31, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (636, -31, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (638, -32, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (639, -29, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (640, -30, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (641, -29, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (642, -31, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (643, -32, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (644, -31, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (645, -30, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (646, -29, 38, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (647, -28, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (648, -27, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (649, -27, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (650, -28, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (651, -27, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (652, -26, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (653, -25, 30, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (654, -25, 31, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (655, -25, 32, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (656, -25, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (657, -27, 33, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (658, -25, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (659, -27, 34, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (660, -27, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (661, -25, 37, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (662, -25, 35, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (663, -25, 36, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (664, -26, 38, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (665, -27, 39, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (666, -28, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (667, -29, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (668, -34, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (669, -34, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (670, -33, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (671, -32, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (672, -31, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (673, -31, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (674, -30, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (676, -25, 40, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (677, -26, 41, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (678, -29, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (679, -27, 42, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (680, -26, 43, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (681, -25, 44, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (682, -26, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (684, -32, 36, 1, 0, '', 0, 'peage1'); +INSERT INTO `$sol` VALUES (685, -32, 44, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (686, -31, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (687, -33, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (688, -30, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (689, -29, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (690, -26, 44, 1, 0, '', 0, 'fleur'); +INSERT INTO `$sol` VALUES (691, -27, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (692, -28, 45, 1, 0, '', 0, 'arbre'); +INSERT INTO `$sol` VALUES (693, -27, 44, 1, 0, '', 0, 'fleur1'); +INSERT INTO `$sol` VALUES (694, -27, 43, 1, 0, '', 0, 'pierre'); +INSERT INTO `$sol` VALUES (695, 0, -1, 1, 0, '', 0, 'arbre'); +END; +if (dobatch($query) == 1) { echo "La table Towns a été complétée.<br />"; } else { echo "Erreur lorsque la table Towns a été complétée."; } +unset($query); +} + +$query = <<<END +CREATE TABLE `$users` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `username` varchar(30) NOT NULL default '', + `password` varchar(32) NOT NULL default '', + `email` varchar(100) NOT NULL default '', + `verify` varchar(8) NOT NULL default '0', + `charname` varchar(30) NOT NULL default '', + `regdate` datetime NOT NULL default '00-00-0000 00:00:00', + `onlinetime` datetime NOT NULL default '00-00-0000 00:00:00', + `authlevel` tinyint(3) unsigned NOT NULL default '0', + `latitude` smallint(6) NOT NULL default '0', + `longitude` smallint(6) NOT NULL default '0', + `difficulty` tinyint(3) unsigned NOT NULL default '0', + `avatar` varchar(255) NOT NULL default '0', + `bank` smallint(255) unsigned NOT NULL default '0', + `miniavatar` tinyint(4) unsigned NOT NULL default '0', + `charclass` tinyint(4) unsigned NOT NULL default '0', + `currentaction` varchar(50) NOT NULL default 'En ville', + `currentfight` tinyint(4) unsigned NOT NULL default '0', + `currentmonster` smallint(6) unsigned NOT NULL default '0', + `currentmonsterhp` smallint(6) unsigned NOT NULL default '0', + `currentmonstersleep` tinyint(3) unsigned NOT NULL default '0', + `currentmonsterimmune` tinyint(4) NOT NULL default '0', + `currentuberdamage` tinyint(3) unsigned NOT NULL default '0', + `currentuberdefense` tinyint(3) unsigned NOT NULL default '0', + `currenthp` smallint(6) unsigned NOT NULL default '15', + `currentmp` smallint(6) unsigned NOT NULL default '0', + `currenttp` smallint(6) unsigned NOT NULL default '10', + `maxhp` smallint(6) unsigned NOT NULL default '15', + `maxmp` smallint(6) unsigned NOT NULL default '1', + `maxtp` smallint(6) unsigned NOT NULL default '10', + `level` smallint(5) unsigned NOT NULL default '1', + `gold` mediumint(8) unsigned NOT NULL default '100', + `experience` mediumint(8) unsigned NOT NULL default '0', + `goldbonus` smallint(5) NOT NULL default '0', + `expbonus` smallint(5) NOT NULL default '0', + `strength` smallint(5) unsigned NOT NULL default '5', + `dexterity` smallint(5) unsigned NOT NULL default '5', + `attackpower` smallint(5) unsigned NOT NULL default '5', + `defensepower` smallint(5) unsigned NOT NULL default '5', + `weaponid` smallint(5) unsigned NOT NULL default '0', + `armorid` smallint(5) unsigned NOT NULL default '0', + `shieldid` smallint(5) unsigned NOT NULL default '0', + `slot1id` smallint(5) unsigned NOT NULL default '0', + `slot2id` smallint(5) unsigned NOT NULL default '0', + `slot3id` smallint(5) unsigned NOT NULL default '0', + `weaponname` varchar(30) NOT NULL default 'Aucun', + `armorname` varchar(30) NOT NULL default 'Aucun', + `shieldname` varchar(30) NOT NULL default 'Aucun', + `slot1name` varchar(30) NOT NULL default 'Aucun', + `slot2name` varchar(30) NOT NULL default 'Aucun', + `slot3name` varchar(30) NOT NULL default 'Aucun', + `dropcode` mediumint(8) unsigned NOT NULL default '0', + `spells` varchar(50) NOT NULL default '0', + `towns` varchar(50) NOT NULL default '0', + `kambaid` VARCHAR(2) NOT NULL, + `kambajuht` VARCHAR(2) NOT NULL, + `liikmestaatus` VARCHAR(2) NOT NULL, + `liitumine` VARCHAR(2) NOT NULL, + `stock1name` varchar(30) NOT NULL default 'aucun', + `stock2name` varchar(30) NOT NULL default 'aucun', + `stock3name` varchar(30) NOT NULL default 'aucun', + `stock1id` varchar(30) NOT NULL default '0', + `stock2id` varchar(30) NOT NULL default '0', + `stock3id` varchar(30) NOT NULL default '0', + `itemsac1qt` bigint(255) unsigned NOT NULL default '0', + `itemsac2qt` bigint(255) unsigned NOT NULL default '0', + `itemsac3qt` bigint(255) unsigned NOT NULL default '0', + `itemsac4qt` bigint(255) unsigned NOT NULL default '0', + `itemsac5qt` bigint(255) unsigned NOT NULL default '0', + `itemsac6qt` bigint(255) unsigned NOT NULL default '0', + `cuivre` bigint(255) unsigned NOT NULL default '0', + `fer` bigint(255) unsigned NOT NULL default '0', + `argent` bigint(255) unsigned NOT NULL default '0', + `platine` bigint(255) unsigned NOT NULL default '0', + `pointlvl` varchar(255) collate latin1_general_ci default '0', + `ptmetier` varchar(255) collate latin1_general_ci NOT NULL default '1', + `metier` varchar(255) collate latin1_general_ci NOT NULL default '0', + `quete` INT(5) NOT NULL DEFAULT '0', + `monstrequete` INT NOT NULL DEFAULT '0', + `listquest` varchar(255) NOT NULL default '0', + `age` varchar(4) NOT NULL default '0', + `signature` varchar(255) NOT NULL default 'Aucune', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Users a été crée.<br />"; } else { echo "Erreur de création de la table Users."; } +unset($query); + +$query = <<<END +CREATE TABLE `$map` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `name` varchar(30) NOT NULL default '', + `longitude` smallint(6) NOT NULL default '0', + `latitude` smallint(6) NOT NULL default '0', + `decor` varchar(30) NOT NULL default '', + PRIMARY KEY (`id`) +) TYPE=MyISAM; +END; +if (dobatch($query) == 1) { echo "La table Map a été crée.<br />"; } else { echo "Erreur de création de la table Map."; } +unset($query); + + global $start; + $time = round((getmicrotime() - $start), 4); + echo "<br />Tables Mysql crées en $time secondes.<br /><br /><a href=\"install.php?page=3\">Cliquez ici pour poursuivre l'installation.</a></body></html>"; + die(); + +} + +function third() { // Troisième page: Récupération des infos du futur admin. + +$page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 3</b></font><br /><br /> +<font face="verdana" size="2">Maintenant vous devez créer un compte d\'administrateur ainsi vous pourrez employer le menu d\'administration du jeu. Complétez les champs ci-dessous pour créer votre compte. Vous pourrez modifier vos infos par la suite dans le menu d'administration.<br /><br /> +<form action="install.php?page=4" method="post"> +<table width="50%"> +<tr><td width="20%" style="vertical-align:top; font-family:Verdana; font-size:10pt;">ID:</td><td><input type="text" name="username" style="font-family:Verdana; font-size:10pt" size="30" maxlength="30" /><br><br></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">PW:</td><td><input type="password" name="password1" style="font-family:Verdana; font-size:10pt" size="30" maxlength="30" /></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Retapez PW:</td><td><input type="password" name="password2" style="font-family:Verdana; font-size:10pt" size="30" maxlength="30" /><br><br></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Votre Email:</td><td><input type="text" name="email1" style="font-family:Verdana; font-size:10pt" size="30" maxlength="100" /></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Retapez Email:</td><td><input type="text" name="email2" style="font-family:Verdana; font-size:10pt" size="30" maxlength="100" /><br><br></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Nom du perso:</td><td><input type="text" name="charname" style="font-family:Verdana; font-size:10pt" size="30" maxlength="30" /></td></tr> +<table><tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Avatar du perso:</td><td><select name="avatar" ><option value="num-1.gif">numéro 1</option><option value="num-2.gif">numéro 2</option><option value="num-3.gif">numéro 3</option><option value="num-4.gif">numéro 4</option><option value="num-5.gif">numéro 5</option><option value="num-6.gif">numéro 6</option><option value="num-7.gif">numéro 7</option><option value="num-8.gif">numéro 8</option><option value="num-9.gif">numéro 9</option><option value="num-10.gif">numéro 10</option></select></td><td></td></tr><tr><td colspan="2" style="vertical-align:top; font-family:Verdana; font-size:10pt">Pour voir tous les avatars <A HREF="#" onClick="window.open('avatar.php','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=400, height=265');return(false)">cliquez ici.</A><br /></td></tr></table> +<table><tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Classe du perso:</td><td><select name="charclass" style="vertical-align:top; font-family:Verdana; font-size:10pt;"><option value="1">Mage</option><option value="2">Guerrier</option><option value="3">Paladin</option></select></td></tr> +<tr><td style="vertical-align:top; font-family:Verdana; font-size:10pt;">Difficultée:</td><td><select name="difficulty" style="vertical-align:top; font-family:Verdana; font-size:10pt;"><option value="1">Facile</option><option value="2">Moyen</option><option value="3">Dur</option></select></td></tr> +<tr><td colspan="2"><input type="submit" name="submit" style="font-family:Verdana; font-size:10pt" value="Valider" /> <input type="reset" name="reset" style="font-family:Verdana; font-size:10pt" value="Annuler" /></td></tr></table> + +</font> +</form> +</body> +</html> +END; +echo $page; +die(); +} + + +function fourth() { // Page demi-final : inserer un nouveau utilisateur, et le féliciter en cas de réussite. + + + extract($_POST); + if (!isset($username)) { die("L'ID doit être renseigné."); } + if (!isset($password1)) { die("Le PW doit être renseigné."); } + if (!isset($password2)) { die("Retapez PW doit être renseigné."); } + if ($password1 != $password2) { die("Les PW ne correspondent pas."); } + if (!isset($email1)) { die("L'Email doit être renseigné."); } + if (!isset($email2)) { die("Retapez Email doit être renseigné."); } + if ($email1 != $email2) { die("Les Emails ne correspondent pas."); } + if (!isset($charname)) { die("Le Nom du perso doit être renseigné."); } + $password = md5($password1); + + global $dbsettings; + $users = $dbsettings["prefix"] . "_users"; + $query = mysql_query("INSERT INTO $users SET id='1',username='$username',password='$password',email='$email1',verify='1',charname='$charname',miniavatar='$avatar',charclass='$charclass',avatar='$avatar',regdate=NOW(),onlinetime=NOW(),authlevel='1'") or die(mysql_error()); + +$page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 4</b></font><br /><br /> +<font face="verdana" size="2">Votre compte dadministrateur a été crée avec succès. Il reste une dernière chose à complété.<br /><br /> +Vous devez complété les réglage principaux.<br /><br /> +<a href="install.php?page=5">Cliquez ici</a></font>. +</body> +</html> +END; + + echo $page; + die(); + +} + +function quatre() { + + $page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 5</b></font><br /><br /> +<font face="verdana" size="2">Votre compte dadministrateur a été crée avec succès. Il reste une dernière chose à complété.<br /><br /> +Vous devez complété les réglage principaux.<br /><br /> +</body> +</html> +END; extract($_POST); $query2 = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $row = mysql_fetch_array($query2); $title = "Réglage Principaux"; + $page .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>"; $page .= "<form action='install.php?page=6' method='post'>"; $page .= "<tr> + <tr><td width='20%'><span class='highlight'>Statut du jeu:</span></td><td><select name='gameopen'><option value='1' {{open1select}}>Ouvert</option><option value='0' {{open0select}}>Fermé</option></select><br /><span class='small'>Fermez le jeu si vous êtes faites de la maintance dessus.</span> + <tr><td width='20%'><span class='highlight'>Inscription:</span></td><td><select name='register'><option value='1' {{open1select}}>Ouvert</option><option value='0' {{open0select}}>Fermée</option></select><br /><span class='small'>Fermez les inscriptions si vous estimez que le nombre d'inscris est suffisant.</span><br> + <tr><td width='20%'>Nom du jeu:</td><td><input type='text' name='gamename' size='30' maxlength='50' value=\"".$row["gamename"]."\" /><br /><span class='small'>Le nom du jeu par default est 'RPG illusion'. Mais vous pouvez librement le modifier.</span><br> <tr><td width='20%'>URL du jeu:</td><td><input type='text' name='gameurl' size='50' maxlength='100' value=\"".$row["gameurl"]."\" /><br /><span class='small'>Veuillez indiquer l'URL complète du jeu('http://www.votre_site.com/repertoire_du_jeu/index.php').</span><br> + <tr><td width='20%'> Email de l'admin:</td><td><input type='text' name='adminemail' size='30' maxlength='100' value=\"".$row["adminemail"]."\"/><br /><span class='small'>Veuillez indiquer votre adresse email. Les utilisateurs qui auront besoin d'aide utiliseront cette adresse pour vous écrire.</span><br> + <tr><td width='20%'> Taille de la carte:</td><td><input type='text' name='gamesize' size='3' maxlength='3' value=\"".$row["gamesize"]."\" /><br /><span class='small'>250 par défault. C'est la taille de la carte en longitude et en latitude. Notez aussi que les niveaux des monstres augmentent tous les 5 espaces, ainsi vous devriez vous assurer que la valeur actuelle de la carte est supérieur à 5. Sinon il y aura quasiment aucun monstre. Avec une taille de carte de 250, vous devriez avoir le total de 50 niveaux de monstre.</span><br> + <tr><td width='20%'>Type du forum:</td><td><select name='forumtype'><option value='0' {{selecttype0}}>Aucun</option><option value='1' {{selecttype1}}>Interne</option><option value='2' {{selecttype2}}>Externe</option></select><br /><span class='small'>'Aucun' retire le forum du jeu. 'Interne' utilise le forum inclus dans RPG illusion. 'Externe' utilise un forum qui se situe à l'exterieur du jeu. Pour cela vous devrez indiquer une URL ci dessous.</span><br> + <tr><td width='20%'> Forum externe:</td><td><input type='text' name='forumaddress' size='30' maxlength='200' value=\"".$row["forumaddress"]."\"/><br /><span class='small'>Si la valeur ci-dessus est placée à 'Externe,' veuillez indiquer l'URL complète du forum externe.</span></td></tr><br> + <tr><td width='20%'> Pages compressée:</td><td><select name='compression'><option value='0' {{selectcomp0}}>Aucune</option><option value='1' {{selectcomp1}}>Activé</option></select><br /><span class='small'>Si vous compressez les pages du jeu, ceci réduira considérablement la quantité de largeur de bande passante exigée par le jeu.</span><br> + <tr><td width='20%'>Email de vérification:</td><td><select name='verifyemail'><option value='0' {{selectverify0}}>Aucun</option><option value='1' {{selectverify1}}>Activé</option></select><br /><span class='small'>Incitez les utilisateurs à vérifier leur adresse email pour plus de sécuritée.</span> "; + + $page .= '<tr><td width="20%">Afficher la nouvelle:</td><td><select name="shownews"><option value="0" {{selectnews0}}>Non</option><option value="1" {{selectnews1}}>Oui</option></select><br /><span class="small">Afficher la dernière nouvelle dans les villes.</td></tr> + <tr><td width="20%">Afficher "Qui est en ligne?":</td><td><select name="showonline"><option value="0" {{selectonline0}}>Non</option><option value="1" {{selectonline1}}>Oui</option></select><br /><span class="small">Afficher "Qui est en ligne?" dans les villes.</span></td></tr> + <tr><td width="20%">Afficher la boite de dialogue:</td><td><select name="showbabble"><option value="0" {{selectbabble0}}>Non</option><option value="1" {{selectbabble1}}>Oui</option></select><br /><span class="small">Afficher la boite de dialogue dans les villes.</span></td></tr> + <tr><td width="20%">Nom de la classe 1:</td><td><input type="text" name="class1name" size="20" maxlength="50" value='.$row["class1name"].' /><br /></td></tr> + <tr><td width="20%">Nom de la classe 2:</td><td><input type="text" name="class2name" size="20" maxlength="50" value='.$row["class2name"].' /><br /></td></tr> + <tr><td width="20%">Nom de la classe 3:</td><td><input type="text" name="class3name" size="20" maxlength="50" value='.$row["class3name"].' /><br /></td></tr> + <tr><td width="20%">Nom de la difficulté 1:</td><td><input type="text" name="diff1name" size="20" maxlength="50" value='.$row["diff1name"].' /><br /></td></tr> + <tr><td width="20%">Nom de la difficulté 2:</td><td><input type="text" name="diff2name" size="20" maxlength="50" value='.$row["diff2name"].' /><br /></td></tr> + <tr><td width="20%">Valeur de la difficulté 1:</td><td><input type="text" name="diff2mod" size="3" maxlength="3" value='.$row["diff1mod"].' /><br /><span class="small">1.2 par défault. Indiquez une valeur pour la difficultée moyenne ici.</span></td></tr> + <tr><td width="20%">Nom de la difficulté 3:</td><td><input type="text" name="diff3name" size="20" maxlength="50" value='.$row["diff3name"].' /><br /></td></tr> + <tr><td width="20%">Valeur De la difficulté 3:</td><td><input type="text" name="diff3mod" size="3" maxlength="3" value='.$row["diff3mod"].' /><br /><span class="small">1.5 par défault. Indiquez une valeur pour la difficultée la plus haute ici.</span></td></tr>'; + $page .= '<tr><td colspan="2"><input type="submit" name="submit" style="font-family:Verdana; font-size:10pt" value="Valider" /> <input type="reset" name="reset" style="font-family:Verdana; font-size:10pt" value="Annuler" /></td></tr></table>'; $page .= "</td></tr></table></form>"; echo $page; +die(); +} + +function cinq() { // Page final : inserer un nouveau utilisateur, et le féliciter en cas de réussite. + + extract($_POST); + if ($gamename == "") { $errors++; $errorlist .= "Le nom de jeu est exigé.<br />"; } + if (($gamesize % 5) != 0) { $errors++; $errorlist .= "La taille de carte doit être divisible par cinq.<br />"; } + if (!is_numeric($gamesize)) { $errors++; $errorlist .= "La taille de la carte doit être un nombre.<br />"; } + if ($forumtype == 2 && $forumaddress == "") { $errors++; $errorlist .= "Vous devez indiquer l'adresse du forum externe.<br />"; } + if ($class1name == "") { $errors++; $errorlist .= "Le nom du Village 1 est exigé.<br />"; } + if ($class2name == "") { $errors++; $errorlist .= "Le nom du Village 2 est exigé.<br />"; } + if ($class3name == "") { $errors++; $errorlist .= "Le nom du Village 3 est exigé.<br />"; } + if ($diff1name == "") { $errors++; $errorlist .= "Le nom de la difficulté 1 est exigé.<br />"; } + if ($diff2name == "") { $errors++; $errorlist .= "Le nom de la difficulté 2 est exigé.<br />"; } + if ($diff3name == "") { $errors++; $errorlist .= "Le nom de la difficulté 3 est exigé.<br />"; } + if ($diff2mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 2 est exigée.<br />"; } + if ($diff3mod == "") { $errors++; $errorlist .= "La valeur de la difficulté 3 est exigée.<br />"; } -$query = <<<END -CREATE TABLE `$users` ( - `id` smallint(5) unsigned NOT NULL auto_increment, - `username` varchar(30) NOT NULL default '', - `password` varchar(32) NOT NULL default '', - `email` varchar(100) NOT NULL default '', - `verify` varchar(8) NOT NULL default '0', - `charname` varchar(30) NOT NULL default '', - `regdate` datetime NOT NULL default '0000-00-00 00:00:00', - `onlinetime` datetime NOT NULL default '0000-00-00 00:00:00', - `authlevel` tinyint(3) unsigned NOT NULL default '0', - `latitude` smallint(6) NOT NULL default '0', - `longitude` smallint(6) NOT NULL default '0', - `difficulty` tinyint(3) unsigned NOT NULL default '0', - `charclass` tinyint(4) unsigned NOT NULL default '0', - `currentaction` varchar(30) NOT NULL default 'In Town', - `currentfight` tinyint(4) unsigned NOT NULL default '0', - `currentmonster` smallint(6) unsigned NOT NULL default '0', - `currentmonsterhp` smallint(6) unsigned NOT NULL default '0', - `currentmonstersleep` tinyint(3) unsigned NOT NULL default '0', - `currentmonsterimmune` tinyint(4) NOT NULL default '0', - `currentuberdamage` tinyint(3) unsigned NOT NULL default '0', - `currentuberdefense` tinyint(3) unsigned NOT NULL default '0', - `currenthp` smallint(6) unsigned NOT NULL default '15', - `currentmp` smallint(6) unsigned NOT NULL default '0', - `currenttp` smallint(6) unsigned NOT NULL default '10', - `maxhp` smallint(6) unsigned NOT NULL default '15', - `maxmp` smallint(6) unsigned NOT NULL default '0', - `maxtp` smallint(6) unsigned NOT NULL default '10', - `level` smallint(5) unsigned NOT NULL default '1', - `gold` mediumint(8) unsigned NOT NULL default '100', - `experience` mediumint(8) unsigned NOT NULL default '0', - `goldbonus` smallint(5) NOT NULL default '0', - `expbonus` smallint(5) NOT NULL default '0', - `strength` smallint(5) unsigned NOT NULL default '5', - `dexterity` smallint(5) unsigned NOT NULL default '5', - `attackpower` smallint(5) unsigned NOT NULL default '5', - `defensepower` smallint(5) unsigned NOT NULL default '5', - `weaponid` smallint(5) unsigned NOT NULL default '0', - `armorid` smallint(5) unsigned NOT NULL default '0', - `shieldid` smallint(5) unsigned NOT NULL default '0', - `slot1id` smallint(5) unsigned NOT NULL default '0', - `slot2id` smallint(5) unsigned NOT NULL default '0', - `slot3id` smallint(5) unsigned NOT NULL default '0', - `weaponname` varchar(30) NOT NULL default 'None', - `armorname` varchar(30) NOT NULL default 'None', - `shieldname` varchar(30) NOT NULL default 'None', - `slot1name` varchar(30) NOT NULL default 'None', - `slot2name` varchar(30) NOT NULL default 'None', - `slot3name` varchar(30) NOT NULL default 'None', - `dropcode` mediumint(8) unsigned NOT NULL default '0', - `spells` varchar(50) NOT NULL default '0', - `towns` varchar(50) NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Users table created.<br />"; } else { echo "Error creating Users table."; } -unset($query); - - global $start; - $time = round((getmicrotime() - $start), 4); - echo "<br />Database setup complete in $time seconds.<br /><br /><a href=\"install.php?page=3\">Click here to continue with installation.</a></body></html>"; - die(); - +$gamename = addslashes($gamename); + + global $dbsettings; + $control = $dbsettings["prefix"] . "_control"; + $query = mysql_query("Update $control SET gamename='$gamename',gamesize='$gamesize',forumtype='$forumtype',forumaddress='$forumaddress',compression='$compression',class1name='$class1name',class2name='$class2name',class3name='$class3name',diff1name='$diff1name',diff2name='$diff2name',diff3name='$diff3name',diff2mod='$diff2mod',diff3mod='$diff3mod',gameopen='$gameopen',verifyemail='$verifyemail',gameurl='$gameurl',adminemail='$adminemail',shownews='$shownews',showonline='$showonline',showbabble='$showbabble',register='$register'") or die(mysql_error()); + +$page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 6</b></font><br /><br /> +<font face="verdana" size="2">Vos réglage principaux ont été crées avec succès. l'installation est terminée.<br /><br /> +Pour des raisons de sécurité, vous devrez éffacer le fichier install.php pour continuer<br /><br /> +Vous être maintenant prêt à <a href="index.php">jouer au jeu</a>. Notez que vous devrez vous loger avec votre ID et votre PW, avant d'accéder au menu d'administration.<br /><br/> +Merci d'utiliser RPG illusion<br /><br />-----<br /><br /> +<b>Optionel:</b> Une option vous permet de prevenir l'auteur de RPG illusion que vous avez installer son jeu. Pour utiliser cette option, +<a href="install.php?page=7">cliquez ici</a></font>. +</body> +</html> +END; + + echo $page; + die(); + +} + +function fifth() { // Appelle de l'auteur de jeu. + + $url = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + if (mail("webmaster@rpgillusion.com" and "thomas_220991@hotmail.com", "", "$url") != true) { die("L'ajout de votre URL a échouée, vous pouvez recommencer ou terminer l'installation <a href=\"index.php\">du jeu</a>."); } + +$page = <<<END +<html> +<head> +<title>Installation de RPG illusion 1.2c </title> +</head> +<body> +<font face="verdana" size="3"><b>Installation de RPG illusion 1.2c : page 7</b></font><br /><br /> +<font face="verdana" size="2">Merci de votre contribution <br /><br /> +Vous desormais <a href="index.php">jouer au jeu</a>. Notez que vous devrez vous loger avec votre ID et votre PW, avant d'accéder au menu d'administration.</font> +</body> +</html> +END; + + echo $page; + die(); + } -function third() { // Third page: gather user info for admin account. - -$page = <<<END -<html> -<head> -<title>Dragon Knight Installation</title> -</head> -<body> -<b>Dragon Knight Installation: Page Three</b><br /><br /> -Now you must create an administrator account so you can use the control panel. Fill out the form below to create your account. You will be able to customize the class names through the control panel once your admin account is created.<br /><br /> -<form action="install.php?page=4" method="post"> -<table width="50%"> -<tr><td width="20%" style="vertical-align:top;">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /><br /><br /><br /></td></tr> -<tr><td style="vertical-align:top;">Password:</td><td><input type="password" name="password1" size="30" maxlength="30" /></td></tr> -<tr><td style="vertical-align:top;">Verify Password:</td><td><input type="password" name="password2" size="30" maxlength="30" /><br /><br /><br /></td></tr> -<tr><td style="vertical-align:top;">Email Address:</td><td><input type="text" name="email1" size="30" maxlength="100" /></td></tr> -<tr><td style="vertical-align:top;">Verify Email:</td><td><input type="text" name="email2" size="30" maxlength="100" /><br /><br /><br /></td></tr> -<tr><td style="vertical-align:top;">Character Name:</td><td><input type="text" name="charname" size="30" maxlength="30" /></td></tr> -<tr><td style="vertical-align:top;">Character Class:</td><td><select name="charclass"><option value="1">Mage</option><option value="2">Warrior</option><option value="3">Paladin</option></select></td></tr> -<tr><td style="vertical-align:top;">Difficulty:</td><td><select name="difficulty"><option value="1">Easy</option><option value="2">Medium</option><option value="3">Hard</option></select></td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr> -</table> -</form> -</body> -</html> -END; -echo $page; -die(); - -} - -function fourth() { // Final page: insert new user row, congratulate the person on a job well done. - - extract($_POST); - if (!isset($username)) { die("Username is required."); } - if (!isset($password1)) { die("Password is required."); } - if (!isset($password2)) { die("Verify Password is required."); } - if ($password1 != $password2) { die("Passwords don't match."); } - if (!isset($email1)) { die("Email is required."); } - if (!isset($email2)) { die("Verify Email is required."); } - if ($email1 != $email2) { die("Emails don't match."); } - if (!isset($charname)) { die("Character Name is required."); } - $password = md5($password1); - - global $dbsettings; - $users = $dbsettings["prefix"] . "_users"; - $query = mysql_query("INSERT INTO $users SET id='1',username='$username',password='$password',email='$email1',verify='1',charname='$charname',charclass='$charclass',regdate=NOW(),onlinetime=NOW(),authlevel='1'") or die(mysql_error()); - -$page = <<<END -<html> -<head> -<title>Dragon Knight Installation</title> -</head> -<body> -<b>Dragon Knight Installation: Page Four</b><br /><br /> -Your admin account was created successfully. Installation is complete.<br /><br /> -Be sure to delete install.php from your Dragon Knight directory for security purposes.<br /><br /> -You are now ready to <a href="index.php">play the game</a>. Note that you must log in through the public section before being allowed into the control panel. Once logged in, an "Admin" link will appear in the Functions box of the left sidebar panel.<br /><br/> -Thank you for using Dragon Knight!<br /><br />-----<br /><br /> -<b>Optional:</b> Dragon Knight is a free product, and does not require registration of any sort. However, there is an -optional "call home" function in the installer, which notifies the author of your game installation. The ONLY information -transmitted with this function is the URL to your game. This is included mainly to satisfy the author's curiosity about -how many copies of the game are being installed and used. If you choose to submit your URL to the author, please -<a href="install.php?page=5">click here</a>. -</body> -</html> -END; - - echo $page; - die(); - -} - -function fifth() { // Call Home function. - - $url = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; - if (mail("jamin@se7enet.com", "Dragon Knight Call Home", "$url") != true) { die("Dragon Knight was unable to send your URL. Please go back and try again, or just continue on to <a href=\"index.php\">the game</a>."); } - -$page = <<<END -<html> -<head> -<title>Dragon Knight Installation</title> -</head> -<body> -<b>Dragon Knight Installation: Page Five</b><br /><br /> -Thank you for submitting your URL!<br /><br /> -You are now ready to <a href="index.php">play the game</a>. Note that you must log in through the public section before being allowed into the control panel. Once logged in, an "Admin" link will appear in the Functions box of the left sidebar panel. -</body> -</html> -END; - - echo $page; - die(); - -} + + +?> -?> -\ No newline at end of file + +\ No newline at end of file diff --git a/items.php b/items.php @@ -0,0 +1,187 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. +include("config.php"); + +$link = opendb(); + +$query = doquery ("SELECT * FROM {{table}} ORDER by buycost DESC ","items"); + +echo" <div id=\"dek\"></div> +<script language=\"javascript\" type=\"text/javascript\" src=\"infobulle.js\"></script> "; + +echo" <script language=\"javascript\"> + +function menuLink(linkLoc){ + + if (linkLoc != \"\"){ + + window.location=linkLoc; + + } +} +</script>"; + +// Début de l'affichage du tableau. + +$row = "0"; +for ( $count = 1 ; $count <= 11 && $row != null ; $count ++ ) { + $row = mysql_fetch_array($query); + + + if (($count % 11) === 1 && $count >= 1) { + + echo " <table width=\"58px\" height=\"58px\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"bottom\" background=\"././images/items/bg_items.gif\"> + + <tr> + <td class=\"items2\" width=\"58px\" height=\"58px\" valign=\"bottom\"><center><img src=\"././images/items/space_items.gif\" valign=\"bottom\"/></center></td> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items2\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" valign=\"bottom\"/></center></td> + + </table>"; + } + + if (($count % 11) === 2 && $count >= 1) { + + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"bottom\" background=\"././images/items/bg_items.gif\"> + + <tr> + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items2\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" valign=\"bottom\"/></center></td> + + </table>"; + } + + if (($count % 11) === 3 && $count >= 1) { + + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"bottom\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items2\" width=\"58px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" valign=\"bottom\"/></center></td> + + </table>"; + } + + if (($count % 11) === 4 && $count >= 1) { + + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"bottom\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items2\" width=\"58px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" valign=\"bottom\"/></center></td> + + </table>"; + } + + if (($count % 11) === 5 && $count >= 1) { + + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"bottom\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items2\" width=\"58px\" height=\"58px\"><center><img src=\"././images/items/space_items.gif\" valign=\"bottom\"/></center></td> + + </table>"; + } + + if (($count % 11) === 5 && $count >= 1) { + + echo " <table width=\"284px\" height=\"1px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"clear: both;\" align=\"bottom\"> + + <tr> + + <td class=\"items\" width=\"284px\" height=\"1px\"><center><img src=\"././images/items/middle_items.gif\" align=\"center\" align=\"top\"/></center></td> + + </tr> + + </table>"; + + + } + + if (($count % 11) === 6 && $count >= 1) { + + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"top\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items\" width=\"2px\" height=\"58px\"><center><img src=\"././images/items/space_items.gif\" valign=\"top\"/></center></td> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" align=\"center\" align=\"top\"/></center></td> + + </table>"; +} + +if (($count % 11) === 7 && $count >= 1) { + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"top\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" align=\"center\" align=\"top\"/></center></td> + + </table>"; +} + + if (($count % 11) === 8 && $count >= 1) { + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"top\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" align=\"center\" align=\"top\"/></center></td> + + </table>"; +} + + if (($count % 11) === 9 && $count >= 1) { + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"top\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items\" width=\"1px\" height=\"58px\"><center><img src=\"././images/items/top_items.gif\" align=\"center\" align=\"top\"/></center></td> + + </table>"; +} + + if (($count % 11) === 10 && $count >= 1) { + + echo " <table width=\"58px\" height=\"58px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"margin-right: 0px\" valign=\"top\" background=\"././images/items/bg_items.gif\"> + + <tr> + + <td class=\"items2\" width=\"59px\" height=\"58px\"><center><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["name"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br><b>Prix:</b> " . $row["buycost"] . " rubis<br><b>Arme de type:</b> " . $row["type"] . "<br><b>Description:</b> " .addslashes(htmlspecialchars($row["description"])) ." ','#FFFFF9')\" onMouseOut=kill() ;><img src=\"././images/items/" . $row["image"] . ".gif\" valign=\"bottom\"/></a></center></td> + + <td class=\"items\" width=\"2px\" height=\"58px\"><center><img src=\"././images/items/space_items.gif\" valign=\"top\"/></center></td> + + </table>"; +} + +} + +?> + + diff --git a/lib.php b/lib.php @@ -1,255 +1,307 @@ -<?php // lib.php :: Common functions used throughout the program. - -$starttime = getmicrotime(); -$numqueries = 0; -$version = "1.1.3a"; -$build = ""; - -function opendb() { // Open database connection. - - include('config.php'); - extract($dbsettings); - $link = mysql_connect($server, $user, $pass) or die(mysql_error()); - mysql_select_db($name) or die(mysql_error()); - return $link; - -} - -function doquery($query, $table) { // Something of a tiny little database abstraction layer. - - include('config.php'); - global $numqueries; - $sqlquery = mysql_query(str_replace("{{table}}", $dbsettings["prefix"] . "_" . $table, $query)) or die(mysql_error()); - $numqueries++; - return $sqlquery; - -} - -function gettemplate($templatename) { // SQL query for the template. - - $filename = "templates/" . $templatename . ".php"; - include("$filename"); - return $template; - -} - -function parsetemplate($template, $array) { // Replace template with proper content. - - foreach($array as $a => $b) { - $template = str_replace("{{{$a}}}", $b, $template); - } - return $template; - -} - -function getmicrotime() { // Used for timing script operations. - - list($usec, $sec) = explode(" ",microtime()); - return ((float)$usec + (float)$sec); - -} - -function prettydate($uglydate) { // Change the MySQL date format (YYYY-MM-DD) into something friendlier. - - return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); - -} - -function prettyforumdate($uglydate) { // Change the MySQL date format (YYYY-MM-DD) into something friendlier. - - return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); - -} - -function is_email($email) { // Thanks to "mail(at)philipp-louis.de" from php.net! - - return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); - -} - -function my_htmlspecialchars($text) { // Thanks to "etymxris at yahoo dot com" from php.net! - - $ALLOWABLE_TAGS = array("b", "i", "u", "p", "blockquote", "ol", "ul", "li"); - static $PATTERNS = array(); - static $REPLACEMENTS = array(); - if (count($PATTERNS) == 0) { - foreach ($ALLOWABLE_TAGS as $tag) { - $PATTERNS[] = "/<$tag>/i"; - $PATTERNS[] = "/<\/$tag>/i"; - $REPLACEMENTS[] = "<$tag>"; - $REPLACEMENTS[] = "</$tag>"; - } - } - - $result = str_replace(array(">", "<", "\"", "'"), - array(">", "<", """, "'"), - $text); - - $result = preg_replace($PATTERNS, $REPLACEMENTS, $result); - - return $result; - -} - -function admindisplay($content, $title) { // Finalize page and output to browser. - - global $numqueries, $userrow, $controlrow, $starttime, $version, $build; - if (!isset($controlrow)) { - $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); - $controlrow = mysql_fetch_array($controlquery); - } - - $template = gettemplate("admin"); - - // Make page tags for XHTML validation. - $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" - . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" - . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; - - $finalarray = array( - "title"=>$title, - "content"=>$content, - "totaltime"=>round(getmicrotime() - $starttime, 4), - "numqueries"=>$numqueries, - "version"=>$version, - "build"=>$build); - $page = parsetemplate($template, $finalarray); - $page = $xml . $page; - - if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } - echo $page; - die(); - -} - -function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, $badstart=false) { // Finalize page and output to browser. - - global $numqueries, $userrow, $controlrow, $version, $build; - if (!isset($controlrow)) { - $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); - $controlrow = mysql_fetch_array($controlquery); - } - if ($badstart == false) { global $starttime; } else { $starttime = $badstart; } - - // Make page tags for XHTML validation. - $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" - . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n" - . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; - - $template = gettemplate("primary"); - - if ($rightnav == true) { $rightnav = gettemplate("rightnav"); } else { $rightnav = ""; } - if ($leftnav == true) { $leftnav = gettemplate("leftnav"); } else { $leftnav = ""; } - if ($topnav == true) { - $topnav = "<a href=\"login.php?do=logout\"><img src=\"images/button_logout.gif\" alt=\"Log Out\" title=\"Log Out\" border=\"0\" /></a> <a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" title=\"Help\" border=\"0\" /></a>"; - } else { - $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Log In\" title=\"Log In\" border=\"0\" /></a> <a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"Register\" title=\"Register\" border=\"0\" /></a> <a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" title=\"Help\" border=\"0\" /></a>"; - } - - if (isset($userrow)) { - - // Get userrow again, in case something has been updated. - $userquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - unset($userrow); - $userrow = mysql_fetch_array($userquery); - - // Current town name. - if ($userrow["currentaction"] == "In Town") { - $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); - $userrow["currenttown"] = "Welcome to <b>".$townrow["name"]."</b>.<br /><br />"; - } else { - $userrow["currenttown"] = ""; - } - - if ($controlrow["forumtype"] == 0) { $userrow["forumslink"] = ""; } - elseif ($controlrow["forumtype"] == 1) { $userrow["forumslink"] = "<a href=\"forum.php\">Forum</a><br />"; } - elseif ($controlrow["forumtype"] == 2) { $userrow["forumslink"] = "<a href=\"".$controlrow["forumaddress"]."\">Forum</a><br />"; } - - // Format various userrow stuffs... - if ($userrow["latitude"] < 0) { $userrow["latitude"] = $userrow["latitude"] * -1 . "S"; } else { $userrow["latitude"] .= "N"; } - if ($userrow["longitude"] < 0) { $userrow["longitude"] = $userrow["longitude"] * -1 . "W"; } else { $userrow["longitude"] .= "E"; } - $userrow["experience"] = number_format($userrow["experience"]); - $userrow["gold"] = number_format($userrow["gold"]); - if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "<a href=\"admin/admin.php\">Admin</a><br />"; } else { $userrow["adminlink"] = ""; } - - // HP/MP/TP bars. - $stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100); - if ($userrow["maxmp"] != 0) { $statmp = ceil($userrow["currentmp"] / $userrow["maxmp"] * 100); } else { $statmp = 0; } - $stattp = ceil($userrow["currenttp"] / $userrow["maxtp"] * 100); - $stattable = "<table width=\"100\"><tr><td width=\"33%\">\n"; - $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; - if ($stathp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } - if ($stathp < 66 && $stathp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } - if ($stathp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } - $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; - $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; - if ($statmp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } - if ($statmp < 66 && $statmp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } - if ($statmp < 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } - $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; - $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; - if ($stattp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } - if ($stattp < 66 && $stattp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } - if ($stattp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } - $stattable .= "</td></tr></table></td>\n"; - $stattable .= "</tr><tr><td>HP</td><td>MP</td><td>TP</td></tr></table>\n"; - $userrow["statbars"] = $stattable; - - // Now make numbers stand out if they're low. - if ($userrow["currenthp"] <= ($userrow["maxhp"]/5)) { $userrow["currenthp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currenthp"]."*</b></span></blink>"; } - if ($userrow["currentmp"] <= ($userrow["maxmp"]/5)) { $userrow["currentmp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currentmp"]."*</b></span></blink>"; } - - $spellquery = doquery("SELECT id,name,type FROM {{table}}","spells"); - $userspells = explode(",",$userrow["spells"]); - $userrow["magiclist"] = ""; - while ($spellrow = mysql_fetch_array($spellquery)) { - $spell = false; - foreach($userspells as $a => $b) { - if ($b == $spellrow["id"] && $spellrow["type"] == 1) { $spell = true; } - } - if ($spell == true) { - $userrow["magiclist"] .= "<a href=\"index.php?do=spell:".$spellrow["id"]."\">".$spellrow["name"]."</a><br />"; - } - } - if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "None"; } - - // Travel To list. - $townslist = explode(",",$userrow["towns"]); - $townquery2 = doquery("SELECT * FROM {{table}} ORDER BY id", "towns"); - $userrow["townslist"] = ""; - while ($townrow2 = mysql_fetch_array($townquery2)) { - $town = false; - foreach($townslist as $a => $b) { - if ($b == $townrow2["id"]) { $town = true; } - } - if ($town == true) { - $userrow["townslist"] .= "<a href=\"index.php?do=gotown:".$townrow2["id"]."\">".$townrow2["name"]."</a><br />\n"; - } - } - - } else { - $userrow = array(); - } - - $finalarray = array( - "dkgamename"=>$controlrow["gamename"], - "title"=>$title, - "content"=>$content, - "rightnav"=>parsetemplate($rightnav,$userrow), - "leftnav"=>parsetemplate($leftnav,$userrow), - "topnav"=>$topnav, - "totaltime"=>round(getmicrotime() - $starttime, 4), - "numqueries"=>$numqueries, - "version"=>$version, - "build"=>$build); - $page = parsetemplate($template, $finalarray); - $page = $xml . $page; - - if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } - echo $page; - die(); - -} - +<?php // lib.php :: Les fontions essentielles au script. + +$starttime = getmicrotime(); +$numqueries = 0; +$version = "1.2a"; +$build = ""; + +function opendb() { // Ouverture de la bdd. + + include('config.php'); + extract($dbsettings); + $link = mysql_connect($server, $user, $pass) or die(mysql_error()); + mysql_select_db($name) or die(mysql_error()); + return $link; + +} + +function doquery($query, $table) { // Selection des tables. + + include('config.php'); + global $numqueries; + $sqlquery = mysql_query(str_replace("{{table}}", $dbsettings["prefix"] . "_" . $table, $query)) or die(mysql_error()); + $numqueries++; + return $sqlquery; + +} + +function gettemplate($templatename) { // SQL query pour les templates. + + $filename = "templates/" . $templatename . ".php"; + include("$filename"); + return $template; + +} + +function parsetemplate($template, $array) { // Replacement des templates avec proper content. + + foreach($array as $a => $b) { + $template = str_replace("{{{$a}}}", $b, $template); + } + return $template; + +} + +function getmicrotime() { // Fontion pour les opérations temporelles. + + list($usec, $sec) = explode(" ",microtime()); + return ((float)$usec + (float)$sec); + +} + +function prettydate($uglydate) { // Format de la date (YYYY-MM-DD). + + return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); + +} + +function prettyforumdate($uglydate) { // Format de la date (YYYY-MM-DD). + + return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); + +} + +function is_email($email) { // Merci à "mail@philipp-louis.de" de php.net! + + return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); + +} + +function my_htmlspecialchars($text) { // Merci à "etymxris at yahoo dot com" de php.net! + + $ALLOWABLE_TAGS = array("b", "i", "u", "p", "blockquote", "ol", "ul", "li"); + static $PATTERNS = array(); + static $REPLACEMENTS = array(); + if (count($PATTERNS) == 0) { + foreach ($ALLOWABLE_TAGS as $tag) { + $PATTERNS[] = "/<$tag>/i"; + $PATTERNS[] = "/<\/$tag>/i"; + $REPLACEMENTS[] = "<$tag>"; + $REPLACEMENTS[] = "</$tag>"; + } + } + + $result = str_replace(array(">", "<", "\"", "'"), + array(">", "<", """, "'"), + $text); + + $result = preg_replace($PATTERNS, $REPLACEMENTS, $result); + + return $result; + +} + +function mododisplay($content, $title) { // Page en fonction du navagateur. + + global $numqueries, $userrow, $controlrow, $starttime, $version, $build; + if (!isset($controlrow)) { + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysql_fetch_array($controlquery); + } + + $template = gettemplate("modo"); + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $finalarray = array( + "title"=>$title, + "content"=>$content, + "totaltime"=>round(getmicrotime() - $starttime, 4), + "numqueries"=>$numqueries, + "version"=>$version, + "build"=>$build); + $page = parsetemplate($template, $finalarray); + $page = $xml . $page; + + if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } + echo $page; + die(); + +} + +function admindisplay($content, $title) { // Page en fonction du navagateur. + + global $numqueries, $userrow, $controlrow, $starttime, $version, $build; + if (!isset($controlrow)) { + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysql_fetch_array($controlquery); + } + + $template = gettemplate("admin"); + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $finalarray = array( + "title"=>$title, + "content"=>$content, + "totaltime"=>round(getmicrotime() - $starttime, 4), + "numqueries"=>$numqueries, + "version"=>$version, + "build"=>$build); + $page = parsetemplate($template, $finalarray); + $page = $xml . $page; + + if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } + echo $page; + die(); + +} + +function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, $badstart=false) { // Page en fonction du navagateur. + + global $numqueries, $userrow, $controlrow, $version, $build; + if (!isset($controlrow)) { + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysql_fetch_array($controlquery); + } + if ($badstart == false) { global $starttime; } else { $starttime = $badstart; } + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $template = gettemplate("primary"); + + if ($rightnav == true) { $rightnav = gettemplate("rightnav"); } else { $rightnav = ""; } + if ($leftnav == true) { $leftnav = gettemplate("leftnav"); } else { $leftnav = ""; } + if ($topnav == true) { + $topnav = ""; + } else { + $topnav = ""; + } + + if (isset($userrow)) { + + // Obtenir userrow en fonction de la mise à jour. + $userquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + unset($userrow); + $userrow = mysql_fetch_array($userquery); + + // Affichage de la ville en cours. + if ($userrow["currentaction"] == "En ville") { + $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $userrow["currenttown"] = "Bienvenue à <b>".$townrow["name"]."</b>.<br /><br />"; + } else { + $userrow["currenttown"] = ""; + } + + if ($controlrow["forumtype"] == 0) { $userrow["forumslink"] = ""; } + elseif ($controlrow["forumtype"] == 1) { $userrow["forumslink"] = "<a href=\"forum.php?do=forum\">Forum</a><br />"; } + elseif ($controlrow["forumtype"] == 2) { $userrow["forumslink"] = "<a href=\"".$controlrow["forumaddress"]."\">Forum</a><br />"; } + + // Formats lettres de déplacement. + if ($userrow["latitude"] < 0) { $userrow["latitude"] = $userrow["latitude"] * -1 . "S"; } else { $userrow["latitude"] .= "N"; } + if ($userrow["longitude"] < 0) { $userrow["longitude"] = $userrow["longitude"] * -1 . "W"; } else { $userrow["longitude"] .= "E"; } + $userrow["experience"] = number_format($userrow["experience"]); + $userrow["gold"] = number_format($userrow["gold"]); + if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "<img src=\"images/site/pic.gif\"/> <a href=\"admin/admin.php\">Admin</a><br />"; } else { $userrow["adminlink"] = ""; } + if ($userrow["authlevel"] == 3) { $userrow["modolink"] = "<img src=\"images/site/pic.gif\"/> <a href=\"admin/modo.php\">Modo</a><br />"; } else { $userrow["modolink"] = ""; } + + // Barres HP/MP/TP. + $stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100); + if ($userrow["maxmp"] != 0) { $statmp = ceil($userrow["currentmp"] / $userrow["maxmp"] * 100); } else { $statmp = 0; } + $stattp = ceil($userrow["currenttp"] / $userrow["maxtp"] * 100); + $stattable = "<table width=\"100\"><tr><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($stathp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($stathp < 66 && $stathp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($stathp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($statmp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($statmp < 66 && $statmp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($statmp < 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($stattp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($stattp < 66 && $stattp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($stattp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td>\n"; + $stattable .= "</tr><tr><td>HP</td><td>MP</td><td>TP</td></tr></table>\n"; + $userrow["statbars"] = $stattable; + + // Création des barres en fonction des nombres. + if ($userrow["currenthp"] <= ($userrow["maxhp"]/5)) { $userrow["currenthp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currenthp"]."*</b></span></blink>"; } + if ($userrow["currentmp"] <= ($userrow["maxmp"]/5)) { $userrow["currentmp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currentmp"]."*</b></span></blink>"; } + + $spellquery = doquery("SELECT id,name,type FROM {{table}}","spells"); + $userspells = explode(",",$userrow["spells"]); + $userrow["magiclist"] = ""; + while ($spellrow = mysql_fetch_array($spellquery)) { + $spell = false; + foreach($userspells as $a => $b) { + if ($b == $spellrow["id"] && $spellrow["type"] == 1) { $spell = true; } + } + if ($spell == true) { + $userrow["magiclist"] .= "<a href=\"index.php?do=spell:".$spellrow["id"]."\">".$spellrow["name"]."</a><br />"; + } + } + if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "Aucun"; } + + // Liste des villes disponible au téléportement. + $townslist = explode(",",$userrow["towns"]); + $townquery2 = doquery("SELECT * FROM {{table}} ORDER BY id", "towns"); + $userrow["townslist"] = ""; + while ($townrow2 = mysql_fetch_array($townquery2)) { + $town = false; + foreach($townslist as $a => $b) { + if ($b == $townrow2["id"]) { $town = true; } + } + if ($town == true) { + $userrow["townslist"] .= "<img src=\"images/site/pic.gif\"/> <a href=\"index.php?do=gotown:".$townrow2["id"]."\">".$townrow2["name"]."</a><br />\n"; + } + } + + $nb0 = doquery("SELECT * FROM {{table}} WHERE destinataire='".$userrow[id]."' AND statut='Non lu'", "msg"); + $nb = mysql_num_rows($nb0); + $userrow["nb"] .= "$nb"; + + + } else { + $userrow = array(); + } + + $newmsg = doquery("SELECT id FROM {{table}} WHERE destinataire='$userrow[id]' AND statut='Non lu'","msg"); + $nummsg = mysql_num_rows($newmsg); + + if($nummsg > 0) + { + $msglink = '<a href="messagerie.php" style="color:red;"> Messagerie</a><br /><br />'; + } + else + { + $msglink = '<a href="messagerie.php"> Messagerie</a><br /><br /> +'; + } + + + $finalarray = array( + "dkgamename"=>$controlrow["gamename"], + "title"=>$title, + "content"=>$content, + "rightnav"=>parsetemplate($rightnav,$userrow), + "leftnav"=>parsetemplate($leftnav,$userrow), + "topnav"=>$topnav, + "totaltime"=>round(getmicrotime() - $starttime, 4), + "numqueries"=>$numqueries, + "version"=>$version, + "msglink"=>$msglink, + "build"=>$build); + $page = parsetemplate($template, $finalarray); + $page = $xml . $page; + + if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } + echo $page; + die(); + +} + ?> \ No newline at end of file diff --git a/lib_log.php b/lib_log.php @@ -0,0 +1,263 @@ +<?php // lib.php :: Les fontions essentielles au script modifié pour leftnav_log.php. + +header('P3P: CP="NON ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); + +$starttime = getmicrotime(); +$numqueries = 0; +$version = "1.2a"; +$build = ""; + +function opendb() { // Ouverture de la bdd. + + include('config.php'); + extract($dbsettings); + $link = mysql_connect($server, $user, $pass) or die(mysql_error()); + mysql_select_db($name) or die(mysql_error()); + return $link; + +} + +function doquery($query, $table) { // Selection des tables. + + include('config.php'); + global $numqueries; + $sqlquery = mysql_query(str_replace("{{table}}", $dbsettings["prefix"] . "_" . $table, $query)) or die(mysql_error()); + $numqueries++; + return $sqlquery; + +} + +function gettemplate($templatename) { // SQL query pour les templates. + + $filename = "templates/" . $templatename . ".php"; + include("$filename"); + return $template; + +} + +function prettydatenews($uglydate) { // Format de la date (DD-MM-YYYY pour les news de l'accueil). + + return date("d.m.Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); + +} + +function parsetemplate($template, $array) { // Replacement des templates avec proper content. + + foreach($array as $a => $b) { + $template = str_replace("{{{$a}}}", $b, $template); + } + return $template; + +} + +function getmicrotime() { // Fontion pour les opérations temporelles. + + list($usec, $sec) = explode(" ",microtime()); + return ((float)$usec + (float)$sec); + +} + +function prettydate($uglydate) { // Format de la date (YYYY-MM-DD). + + return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); + +} + +function prettyforumdate($uglydate) { // Format de la date (YYYY-MM-DD). + + return date("F j, Y", mktime(0,0,0,substr($uglydate, 5, 2),substr($uglydate, 8, 2),substr($uglydate, 0, 4))); + +} + +function is_email($email) { // Merci à "mail@philipp-louis.de" de php.net! + + return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); + +} + +function my_htmlspecialchars($text) { // Merci à "etymxris at yahoo dot com" de php.net! + + $ALLOWABLE_TAGS = array("b", "i", "u", "p", "blockquote", "ol", "ul", "li"); + static $PATTERNS = array(); + static $REPLACEMENTS = array(); + if (count($PATTERNS) == 0) { + foreach ($ALLOWABLE_TAGS as $tag) { + $PATTERNS[] = "/<$tag>/i"; + $PATTERNS[] = "/<\/$tag>/i"; + $REPLACEMENTS[] = "<$tag>"; + $REPLACEMENTS[] = "</$tag>"; + } + } + + $result = str_replace(array(">", "<", "\"", "'"), + array(">", "<", """, "'"), + $text); + + $result = preg_replace($PATTERNS, $REPLACEMENTS, $result); + + return $result; + +} + +function admindisplay($content, $title) { // Page en fonction du navagateur. + + global $numqueries, $userrow, $controlrow, $starttime, $version, $build; + if (!isset($controlrow)) { + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysql_fetch_array($controlquery); + } + + $template = gettemplate("admin"); + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $finalarray = array( + "title"=>$title, + "content"=>$content, + "totaltime"=>round(getmicrotime() - $starttime, 4), + "numqueries"=>$numqueries, + "version"=>$version, + "build"=>$build); + $page = parsetemplate($template, $finalarray); + $page = $xml . $page; + + if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } + echo $page; + die(); + +} + +function display($content, $title, $topnav=true, $leftnav=true, $rightnav=true, $badstart=false) { // Page en fonction du navigateur. + + global $numqueries, $userrow, $controlrow, $version, $build; + if (!isset($controlrow)) { + $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $controlrow = mysql_fetch_array($controlquery); + } + if ($badstart == false) { global $starttime; } else { $starttime = $badstart; } + + // Tags pour la validation XHTML. + $xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + . "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//FR\" \"DTD/xhtml1-transitional.dtd\">\n" + . "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\"fr\">\n"; + + $template = gettemplate("primary_log"); + + if ($rightnav == true) { $rightnav = gettemplate("rightnav"); } else { $rightnav = ""; } + if ($leftnav == true) { $leftnav = gettemplate("leftnav_log"); } else { $leftnav = ""; } + if ($topnav == true) { + $topnav = ""; + } else { + $topnav = ""; + } + + if (isset($userrow)) { + + // Obtenir userrow en fonction de la mise à jour. + $userquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + unset($userrow); + $userrow = mysql_fetch_array($userquery); + + // Affichage de la ville en cours. + if ($userrow["currentaction"] == "En ville") { + $townquery = doquery("SELECT * FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $userrow["currenttown"] = "Bienvenue à <b>".$townrow["name"]."</b>.<br /><br />"; + } else { + $userrow["currenttown"] = ""; + } + + if ($controlrow["forumtype"] == 0) { $userrow["forumslink"] = ""; } + elseif ($controlrow["forumtype"] == 1) { $userrow["forumslink"] = "<a href=\"forum.php\">Forum</a><br />"; } + elseif ($controlrow["forumtype"] == 2) { $userrow["forumslink"] = "<a href=\"".$controlrow["forumaddress"]."\">Forum</a><br />"; } + + // Formats lettres de déplacement. + if ($userrow["latitude"] < 0) { $userrow["latitude"] = $userrow["latitude"] * -1 . "S"; } else { $userrow["latitude"] .= "N"; } + if ($userrow["longitude"] < 0) { $userrow["longitude"] = $userrow["longitude"] * -1 . "W"; } else { $userrow["longitude"] .= "E"; } + $userrow["experience"] = number_format($userrow["experience"]); + $userrow["gold"] = number_format($userrow["gold"]); + if ($userrow["authlevel"] == 1) { $userrow["adminlink"] = "<a href=\"admin.php\">Admin</a><br />"; } else { $userrow["adminlink"] = ""; } + + // Barres HP/MP/TP. + $stathp = ceil($userrow["currenthp"] / $userrow["maxhp"] * 100); + if ($userrow["maxmp"] != 0) { $statmp = ceil($userrow["currentmp"] / $userrow["maxmp"] * 100); } else { $statmp = 0; } + $stattp = ceil($userrow["currenttp"] / $userrow["maxtp"] * 100); + $stattable = "<table width=\"100\"><tr><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($stathp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($stathp < 66 && $stathp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($stathp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stathp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($statmp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($statmp < 66 && $statmp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($statmp < 33) { $stattable .= "<div style=\"padding:0px; height:".$statmp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td><td width=\"33%\">\n"; + $stattable .= "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"padding:0px; width:15px; height:100px; border:solid 1px black; vertical-align:bottom;\">\n"; + if ($stattp >= 66) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_green.gif);\"><img src=\"images/bars_green.gif\" alt=\"\" /></div>"; } + if ($stattp < 66 && $stattp >= 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_yellow.gif);\"><img src=\"images/bars_yellow.gif\" alt=\"\" /></div>"; } + if ($stattp < 33) { $stattable .= "<div style=\"padding:0px; height:".$stattp."px; border-top:solid 1px black; background-image:url(images/bars_red.gif);\"><img src=\"images/bars_red.gif\" alt=\"\" /></div>"; } + $stattable .= "</td></tr></table></td>\n"; + $stattable .= "</tr><tr><td>HP</td><td>MP</td><td>TP</td></tr></table>\n"; + $userrow["statbars"] = $stattable; + + // Création des barres en fonction des nombres. + if ($userrow["currenthp"] <= ($userrow["maxhp"]/5)) { $userrow["currenthp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currenthp"]."*</b></span></blink>"; } + if ($userrow["currentmp"] <= ($userrow["maxmp"]/5)) { $userrow["currentmp"] = "<blink><span class=\"highlight\"><b>*".$userrow["currentmp"]."*</b></span></blink>"; } + + $spellquery = doquery("SELECT id,name,type FROM {{table}}","spells"); + $userspells = explode(",",$userrow["spells"]); + $userrow["magiclist"] = ""; + while ($spellrow = mysql_fetch_array($spellquery)) { + $spell = false; + foreach($userspells as $a => $b) { + if ($b == $spellrow["id"] && $spellrow["type"] == 1) { $spell = true; } + } + if ($spell == true) { + $userrow["magiclist"] .= "<a href=\"index.php?do=spell:".$spellrow["id"]."\">".$spellrow["name"]."</a><br />"; + } + } + if ($userrow["magiclist"] == "") { $userrow["magiclist"] = "Aucun"; } + + // Liste des villes disponible au téléportement. + $townslist = explode(",",$userrow["towns"]); + $townquery2 = doquery("SELECT * FROM {{table}} ORDER BY id", "towns"); + $userrow["townslist"] = ""; + while ($townrow2 = mysql_fetch_array($townquery2)) { + $town = false; + foreach($townslist as $a => $b) { + if ($b == $townrow2["id"]) { $town = true; } + } + if ($town == true) { + $userrow["townslist"] .= "<a href=\"index.php?do=gotown:".$townrow2["id"]."\">".$townrow2["name"]."</a><br />\n"; + } + } + + } else { + $userrow = array(); + } + + $finalarray = array( + "dkgamename"=>$controlrow["gamename"], + "title"=>$title, + "content"=>$content, + "rightnav"=>parsetemplate($rightnav,$userrow), + "leftnav_log"=>parsetemplate($leftnav,$userrow), + "topnav"=>$topnav, + "totaltime"=>round(getmicrotime() - $starttime, 4), + "numqueries"=>$numqueries, + "version"=>$version, + "build"=>$build); + $page = parsetemplate($template, $finalarray); + $page = $xml . $page; + + if ($controlrow["compression"] == 1) { ob_start("ob_gzhandler"); } + echo $page; + die(); + +} + +?> +\ No newline at end of file diff --git a/login.php b/login.php @@ -1,20 +1,46 @@ -<?php // login.php :: Handles logins and cookies. - -include('lib.php'); -if (isset($_GET["do"])) { - if ($_GET["do"] == "login") { login(); } - elseif ($_GET["do"] == "logout") { logout(); } -} - -function login() { +<?php // login.php :: Fonctions pour se loger et quitter. +header('P3P: CP="NON ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); +include('lib_log.php'); +if (isset($_GET["do"])) { + if ($_GET["do"] == "login") { login(); } + elseif ($_GET["do"] == "login2") { login2(); } + elseif ($_GET["do"] == "login4") { login4(); } + elseif ($_GET["do"] == "logout") { logout(); } +} + +function login() { + + include('config.php'); + $link = opendb(); + + if (isset($_POST["submit_x"])) { + + $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } + $row = mysql_fetch_array($query); + if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } + $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; + setcookie("dkgame", $cookie, $expiretime, "/", "", 0); + header("Location: index.php"); + die(); + + } + + $page = gettemplate("login"); + $title = "Bienvenue sur RPG illusion"; + display($page, $title, false, true, false); + +} + +function login2() { include('config.php'); $link = opendb(); - if (isset($_POST["submit"])) { + if (isset($_POST["submit_x"])) { $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); - if (mysql_num_rows($query) != 1) { die("Invalid username or password. Please go back and try again."); } + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } $row = mysql_fetch_array($query); if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; @@ -24,19 +50,42 @@ function login() { } - $page = gettemplate("login"); - $title = "Log In"; - display($page, $title, false, false, false, false); + $page = gettemplate("login2"); + $title = "Rpg illusion 1.2c"; + display($page, $title, false, true, false); -} +} + +function login4() { - -function logout() { + include('config.php'); + $link = opendb(); + + if (isset($_POST["submit_x"])) { + + $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } + $row = mysql_fetch_array($query); + if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } + $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; + setcookie("dkgame", $cookie, $expiretime, "/", "", 0); + header("Location: index.php"); + die(); + + } - setcookie("dkgame", "", time()-100000, "/", "", 0); - header("Location: login.php?do=login"); - die(); + $page = gettemplate("login4"); + $title = "Rpg illusion 1.2c"; + display($page, $title, false, true, false); -} - +} + +function logout() { + + setcookie("dkgame", "", time()-100000, "/", "", 0); + header("Location: login.php?do=login"); + die(); + +} + ?> \ No newline at end of file diff --git a/map.php b/map.php @@ -0,0 +1,159 @@ +<meta http-equiv="refresh" content="240"> +<body style="background-color:transparent"> +<bgsound src="./musiques/map.mid" autostart="true" loop="50000000000000000000000000000000000000000000000000"> +<table width="478" height="454" style="background-image:url(images/sol/fond_carte.jpg)" border="0" > + <tr> + <td align="center" valign="middle"> +<?php + + +include('lib.php'); +include('config.php'); +include('cookies.php'); +$link = opendb(); +$userrow = checkcookies(); + +global $userrow; + +if (isset($_COOKIE["dkgame"])) { + +// Format du cookies: +// {ID} {USERNAME} {PASSWORDHASH} {REMEMBERME} +$theuser = explode(" ",$_COOKIE["dkgame"]); +$username= $theuser[1]; +$id = $theuser[0]; +} +$query2 = doquery("SELECT latitude,longitude FROM rpg_towns WHERE id='$id' LIMIT 1", "towns"); +$query = doquery("SELECT latitude,longitude FROM rpg_users WHERE id='$id' LIMIT 1", "users"); +$query2 = doquery("SELECT lati,longi FROM rpg_sol WHERE id='$id' LIMIT 1", "sol"); +$query2 = doquery("SELECT latitude,longitude,name FROM rpg_maison WHERE id='$id' LIMIT 1", "maison"); + +$deplaquery = doquery("SELECT id FROM rpg_users WHERE latitude='$latitude' AND longitude='$longitude' LIMIT 1", "users"); +$tabl = mysql_fetch_array($query); + + +$latmax = $tabl['latitude'] + 5; +$longmax = $tabl['longitude'] + 6; +$latmin = $tabl['latitude'] - 5; +$longmin = $tabl['longitude'] - 6; + +$hp = 100 / $userrow['maxhp']; +$hp2 = $hp * $userrow['currenthp']; +$tp = 100 / $userrow['maxtp']; +$tp2 = $tp * $userrow['currenttp']; +$mp = 100 / $userrow['maxmp']; +$mp2 = $mp * $userrow['currentmp']; + +$latitude = $latmax; +echo "<body><center><table>\n"; +while ($latitude >= $latmin ) { +echo "<tr>\n\n"; +$longitude = $longmin; +while ($longitude <= $longmax) { +$sql = "SELECT username, id, avatar FROM rpg_users WHERE latitude='$latitude' AND longitude='$longitude'"; +$query = mysql_query($sql); +$fetch = mysql_fetch_array($query); +$username = $fetch['username']; +$avatar = $fetch['avatar']; +$id = $fetch['id']; + +$sql = "SELECT nimi FROM rpg_clans WHERE omanik='$id'"; +$query = mysql_query($sql); +$fetch = mysql_fetch_array($query); +$nimi = $fetch['nimi']; + +$sqll = "SELECT nom FROM rpg_sol WHERE lati='$latitude' AND longi='$longitude'"; +$query = mysql_query($sqll); +$fetch = mysql_fetch_array($query); +$sol = $fetch['nom']; + +$sqll = "SELECT name FROM rpg_maison WHERE latitude='$latitude' AND longitude='$longitude'"; +$query = mysql_query($sqll); +$fetch = mysql_fetch_array($query); +$maison = $fetch['name']; + +$sqll = "SELECT name FROM rpg_towns WHERE latitude='$latitude' AND longitude='$longitude'"; +$query = mysql_query($sqll); +$fetch = mysql_fetch_array($query); +$villes = $fetch['name']; +if($villes !='') +{echo "<td style=\"background-image:url(images/sol/maison1.jpg)\" width=\"40\" height=\"40\"><img src=\"./images/sol/maison1.jpg\" width=\"35\" height=\"40\" border=\"0\" title=\"".$villes."\"></td>"; } +else { +if($avatar!='') { +echo "<td><img src=\"./images/avatar/".$avatar."\" width=\"35\" height=\"35\" border=\"0\" title=\"Id :".$id."/Pseudo:".$username."/Clan: ".$nimi."/Position:(".$longitude." , ".$latitude.")\"></td>"; +} else { +if($maison !='') +{echo "<td style=\"background-image:url(images/sol/maison.jpg)\" width=\"40\" height=\"40\"><img src=\"./images/sol/maison.jpg\" width=\"35\" height=\"40\" border=\"0\" title=\"Maison de ".$maison."\"></td>"; } +else { +if($sol !='') { +echo "<td style=\"background-image:url(./images/sol/".$sol.".jpg)\" width=\"35\" height=\"35\"></td>"; } +else { +echo "<td style=\"background-image:url(./images/avatar/.gif)\" width=\"35\" height=\"35\"></td>\n"; +} +} +} +} +$longitude++; +} +echo "</tr>"; +$latitude--; +} +echo '</table></center></body>'; + +echo '<div id="Layer1" style="position:absolute; left:36; top:30; width:99; height:71; z-index:1"> +<table width="1" height="1" border="0" cellspacing="2" cellpadding="0"> +<tr> +<td width="6%" height="2"><span class="blancmap"><b><font size="2">HP</font></b></span></td> +<td width="98"><span class="blancmap2"><div align="right"><font size="2">'.$userrow['currenthp'].'/ '.$userrow['maxhp'].'</font></div></span> +<table width="100"height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#000000"> +<td> +<table width="'.$hp2.'" height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#DA4A12"> +<td></td> +</tr> +</table> +</td> +</tr> +</table> +</td> +</tr> +<tr> +<td width="6%" height="2"><span class="blancmap"><b><font size="2">TP</font></b></span></td> +<td width="98"><span class="blancmap2"><div align="right"><font size="2">'.$userrow['currenttp'].'/ '.$userrow['maxtp'].'</font></div></span> +<table width="100" height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#000000"> +<td> +<table width="'.$tp2.'" height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#CC00CC"> +<td></td> +</tr> +</table> +</td> +</tr> +</table> +</td> +</tr> +<tr> +<td width="6%" height="2"><span class="blancmap"><b><font size="2">MP</font></b></span></td> +<td width="98"><span class="blancmap2"><div align="right"><font size="2">'.$userrow['currentmp'].'/ '.$userrow['maxmp'].'</font></div></span> +<table width="100" height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#000000"> +<td> +<table width="'.$mp2.'" height="2" border="0" cellspacing="0" cellpadding="0"> +<tr bgcolor="#810FF5"> +<td></td> +</tr> +</table> +</td> +</tr> +</table> +</td> +</tr> +</table> +</div>'; +?> +</td> + </tr> +</table> + diff --git a/messagerie.php b/messagerie.php @@ -0,0 +1,292 @@ +<? +################################################################################# +## Mod Messagerie +## Dévellopé par Tsunami <http://zfusion.free.fr/illusion/> +## Le 20 Janvier 2005 +## Inclut envoi et réception, statut(lu,non lu, archivé), gestion(suppression, modification..) des messages +################################################################################# + +// Inclusion des fichiers neccessaires au script +include('lib.php'); +include('cookies.php'); + +opendb(); + +// Informations du joueur +$userrow = checkcookies(); + +$doex = explode(':', $_GET['do']); + +if($_GET['do'] == "Reception") +{ + $messtitle = 'Boîte de réception'; +} +elseif($doex[0] == "Envoi") +{ + $messtitle = 'Envoyer un message'; +} +elseif($_GET['do'] == "Archives") +{ + $messtitle = 'Archives'; +} +elseif($doex[0] == "Lect") +{ + $messtitle = 'Lire un message'; +} +elseif($doex[0] == "Read") // lire un message archivé +{ + $messtitle = 'Lire un message'; +} +elseif($doex[0] == "Suppr") +{ + $messtitle = 'Supprimer un message'; +} +elseif($doex[0] == "Archiver") +{ + $messtitle = 'Archiver un message'; +} +elseif($doex[0] == "Envoi") +{ + $messtitle = 'Boîte d\'envoi'; +} +else +{ + $messtitle = 'Boîte de réception'; +} + +// Affichage du titre de la messagerie +$page = '<table cellspacing="0" cellpadding="0" height="40" width="90%" align="center"> +<img src="images/messagerie.jpg"> +<tr> +<td background="images/bg_1.1.png" width="6"> +</td> +<td width="98%" background="images/bg_1.2.png"> +<center> +<b>'.$messtitle.'</b> +<br /> +<a href="?do=Archives" alt="Archives">Archives</a> - <a href="?do=Benvoi">Boîte d\'envoi</a>/<a href="?do=Reception">réception</a> - <a href="?do=Envoi">Envoyer un message</a></center> +</td> +<td background="images/bg_1.3.png" width="6"> +</td> +<tr> +</table>'; + +if(empty($_GET['do'])) +{ + header("location: ?do=Reception"); +} + +if($_GET['do'] == 'Reception' || empty($_GET['do'])) +{ + + // Lister les messages dont le destinataire est l'utilisateur + $msglist = doquery("SELECT * FROM {{table}} WHERE destinataire='$userrow[id]' AND statut!='Archivé' ORDER BY date DESC","msg"); + + $page .= '<table width="90%" align="center"><tr><td width="30%"><b>Titre</b></td><td width="20%"><b>Envoyeur</td><td width="30%"><center><b>Date</td><td width="20%"><center><b>Actions</td></tr>'; + while($msg = mysql_fetch_assoc($msglist)) + { + $env = doquery("SELECT username FROM {{table}} WHERE id='$msg[envoyeur]'","users"); + $env = mysql_fetch_assoc($env); + + if($msg['statut'] == "Non lu") + { + $attributecolor = 'style="color:red;"'; + } + + $date = date("j/m/Y à G:i",$msg['date']); + + $page .= '<tr><td><a '.$attributecolor.' href="?do=Lect:'.$msg['id'].'">'.$msg['titre'].'</a></td><td>'.$env['username'].'</td><td>'.$date.'</td><td><center><a href="?do=Suppr:'.$msg['id'].'"><img border="0" src="images/msg_delete.gif" alt="S" /> <a href="?do=Archiver:'.$msg['id'].'"><img border="0" src="images/msg_archiv.gif" alt="- A" /></td></tr>'; + } + $page .= '</table>'; + + $page .= '<br /><br /><a href="?do=Suppr:All"><img style="float:left;" border="0" src="images/msg_delete.gif" alt="Supprimer tout">Supprimer tout les messages</a>'; +} +elseif($doex[0] == 'Lect') +{ + $msg1 = doquery("SELECT * FROM {{table}} WHERE id='$doex[1]' AND destinataire='$userrow[id]'","msg"); + $msg = mysql_fetch_assoc($msg1); + + if($msg['statut'] == "Non lu") + { + $update = doquery("UPDATE {{table}} SET statut='Lu' WHERE id='$msg[id]' AND destinataire='$userrow[id]'","msg"); + } + $date = date("j/m/Y à G:i",$msg['date']); + + $env = doquery("SELECT username FROM {{table}} WHERE id='$msg[envoyeur]'","users"); + $env = mysql_fetch_assoc($env); + + $page .= '<table width="80%" align="center"><tr><td><b>'.$msg['titre'].'</b></td><td width="40%">- '.$date.'<br /> - '.$env['username'].'</td></tr> + <tr> + <td colspan="2" style="border:1px black dotted;padding:10px;" height="200"> + '.nl2br(stripslashes($msg['message'])).' + </td> + </tr> + </table>'; + $page .= '<br /><br /><center>[<a href="?do=Envoi:'.$msg['id'].'">Répondre à ce message</a> - <a href="?do=Suppr:'.$msg['id'].'">Supprimer</a> - <a href="?do=Archiver:'.$msg['id'].'">Archiver</a>]'; + +} +elseif($doex[0] == 'Read') +{ + $msg1 = doquery("SELECT * FROM {{table}} WHERE id='$doex[1]' AND envoyeur='$userrow[id]'","msg"); + $msg = mysql_fetch_assoc($msg1); + + + $date = date("j/m/Y à G:i",$msg['date']); + + $env = doquery("SELECT username FROM {{table}} WHERE id='$msg[destinataire]'","users"); + $env = mysql_fetch_assoc($env); + + $page .= '<table width="80%" align="center"><tr><td><b>'.$msg['titre'].'</b></td><td width="40%">- '.$date.'<br /> - A '.$env['username'].'</td></tr> + <tr> + <td colspan="2" style="border:1px black dotted;padding:10px;" height="200"> + '.nl2br(stripslashes($msg['message'])).' + </td> + </tr> + </table>'; + $page .= '<br /><br /><center>[<a href="?do=Envoi:'.$msg['id'].'">Répondre à ce message</a> - <a href="?do=Suppr:'.$msg['id'].'">Supprimer</a>]'; + +} +elseif($doex[0] == "Envoi") +{ + + if(empty($_POST['message']) || empty($_POST['pseudo']) || empty($_POST['titre'])) + { + if(isset($doex[1])) + { + $infen = doquery("SELECT envoyeur,titre FROM {{table}} WHERE id='$doex[1]'","msg"); + $infen = mysql_fetch_assoc($infen); + + $env = doquery("SELECT username FROM {{table}} WHERE id='$infen[envoyeur]'","users"); + $env = mysql_fetch_assoc($env); + + (substr_count($infen['titre'],'Re:' ) == 0) ? $pre = 'Re: ' : $pre = ''; + } + + $page .= '<form method="post"><table align="center" width="80%"> + <tr> + <td width="100"> + Pseudo: + </td> + <td> + <input type="text" value="'.$env['username'].'" name="pseudo" size="60"> + </td> + </tr> + <tr> + <td width="100"> + Titre: + </td> + <td> + <input type="text" name="titre" value="'.$pre.$infen['titre'].'" size="60"> + </td> + </tr> + <tr> + <td colspan="2"> + <textarea name="message" cols="50" rows="10"></textarea> + </td> + </tr> + <tr> + <td colspan="2"> + <center><input type="submit" value="Poster" /></center> + </td> + </tr> + </table></form>'; + } + else + { + $ide = doquery("SELECT id FROM {{table}} WHERE username='$_POST[pseudo]'","users"); + + $error = 0; + + if(mysql_num_rows($ide) == 0) + { + $page .= '<center>Le joueur indiqué n\'existe pas.'; + $error++; + } + + $ide = mysql_fetch_assoc($ide); + $ides = $ide['id']; + + $message = addslashes($_POST['message']); + $time = time(); + + if($error == 0) + { + doquery("INSERT INTO {{table}} ( `id` , `titre` , `message` , `date` , `envoyeur` , `destinataire` , `statut` ) VALUES('', '$_POST[titre]', '$message', '$time', '$userrow[id]', '$ides', 'Non lu')","msg"); + $page .= '<center><br />Votre message pour '.$_POST['pseudo'].' a bien été envoyé à la poste.<br /><br /><a href="messagerie.php">Boite de réception</a>'; + } + + + } +} +elseif($doex[0] == "Suppr") +{ + if($doex[1] == "All") + { + doquery("DELETE FROM {{table}} WHERE destinataire='$userrow[id]' AND statut!='Archivé'","msg"); + $page .= '<center><br />Tous les messages présents dans votre boîte de réception ont étés supprimés.<br /><br /><a href="?do=Reception">Boîte de réception</a>'; + } + else + { + doquery("DELETE FROM {{table}} WHERE destinataire='$userrow[id]' AND id='$doex[1]'","msg"); + $page .= '<center><br />Ce message présent dans votre boîte de réception a été supprimé.<br /><br /><a href="?do=Reception">Boîte de réception</a>'; + } +} +elseif($doex[0] == "Archiver") +{ + $nbar = doquery("SELECT id FROM {{table}} WHERE statut='Archivé'","msg"); + $nbar = mysql_num_rows($nbar); + + if($nbar >= 25) // 25 :: nombre max d'éléments archivés + { + $page .= '<center>Désolé, mais vous avez atteind le nombre maximum de lettres archivées.<br /><br /><a href="?do=Reception">Boîte de réception</a>'; + } + elseif($doex[1] == "All") + { + doquery("UPDATE {{table}} SET statut='Archivé' WHERE statut!='Archivé' AND destinataire='$userrow[id]'","msg"); + $page .= '<center><br />Tous les messages présents dans votre boîte de réception ont étés archivés.<br /><br /><a href="?do=Reception">Boîte de réception</a>'; + } + else + { + doquery("UPDATE {{table}} SET statut='Archivé' WHERE statut!='Archivé' AND destinataire='$userrow[id]' AND id='$doex[1]'","msg"); + $page .= '<center><br />Ce message présent dans votre boîte de réception a été archivé.<br /><br /><a href="?do=Reception">Boîte de réception</a>'; + } +} +elseif($doex[0] == "Archives") +{ + + // Lister les messages dont le destinataire est l'utilisateur + $msglist = doquery("SELECT * FROM {{table}} WHERE destinataire='$userrow[id]' AND statut='Archivé' ORDER BY date DESC","msg"); + + $page .= '<table width="90%" align="center"><tr><td width="30%"><b>Titre</b></td><td width="20%"><b>Envoyeur</td><td width="30%"><center><b>Date</td><td width="20%"><center><b>Actions</td></tr>'; + while($msg = mysql_fetch_assoc($msglist)) + { + $env = doquery("SELECT username FROM {{table}} WHERE id='$msg[envoyeur]'","users"); + $env = mysql_fetch_assoc($env); + + $date = date("j/m/Y à G:i",$msg['date']); + + $page .= '<tr><td><a href="?do=Read:'.$msg['id'].'">'.$msg['titre'].'</a></td><td>'.$env['username'].'</td><td>'.$date.'</td><td><center><a href="?do=Suppr:'.$msg['id'].'"><img border="0" src="images/msg_delete.gif" alt="S" /></td></tr>'; + } + $page .= '</table>'; + +} +elseif($doex[0] == "Benvoi") // Boite d'envoi - messages envoyés +{ + // Lister les messages dont l'nvoyeur est le membre + $msglist = doquery("SELECT * FROM {{table}} WHERE envoyeur='$userrow[id]' AND statut='Non lu' ORDER BY date DESC","msg"); + + $page .= '<table width="90%" align="center"><tr><td width="30%"><b>Titre</b></td><td width="20%"><b>Envoyeur</td><td width="30%"><center><b>Date</td><td width="20%"><center><b>Actions</td></tr>'; + while($msg = mysql_fetch_assoc($msglist)) + { + $env = doquery("SELECT username FROM {{table}} WHERE id='$msg[destinataire]'","users"); + $env = mysql_fetch_assoc($env); + + $date = date("j/m/Y à G:i",$msg['date']); + + $page .= '<tr><td><a href="?do=Lect:'.$msg['id'].'">'.$msg['titre'].'</a></td><td>'.$env['destinataire'].'</td><td>'.$date.'</td><td><center><a href="?do=Suppr:'.$msg['id'].'"><img border="0" src="images/msg_delete.gif" alt="S" /> <a href="?do=Archiver:'.$msg['id'].'"><img border="0" src="images/msg_archiv.gif" alt="- A" /></td></tr>'; + } + $page .= '</table>'; + + $page .= '<br /><br /><a href="?do=Suppr:All"><img style="float:left;" border="0" src="images/msg_delete.gif" alt="Supprimer tout">Supprimer tout les messages</a>'; +} +display($page,"Messagerie"); +\ No newline at end of file diff --git a/musiques/026-Town04.mid b/musiques/026-Town04.mid Binary files differ. diff --git a/musiques/map.mid b/musiques/map.mid Binary files differ. diff --git a/newsaccueil.php b/newsaccueil.php @@ -0,0 +1,32 @@ +<?php +// On ouvre pas la base de donnée, car elle sera ouverte dans dans la page login.php. + +include("config.php"); + + $query = doquery ("SELECT * FROM {{table}} ORDER by id DESC","newsaccueil"); + + echo " <table width=\"344px\" height=\"154px \" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; + //Initialisation pour une valeur de départ non null pour rentrer dans la boucle + $row = "0"; + + for ( $count = 1 ; $count <= 5 && $row != null ; $count ++ ) { + $row = mysql_fetch_array($query); + + //N'affiche pas la ligne si il n'y a plus d'enregistrements. + if ( $row != null ) { + + echo " <tr>"; + echo " <td height=\"1px \"align=\"center\" class=\"login\" ><img src=\"././images/icon_news.gif\" border=\"0\"></td>"; + echo " <td width=\"333px\" height=\"1px align=\"left\" ><font color=\"fe7314\">" . prettydatenews($row["postdate"]). " </font><a onMouseOver=\"popup('<font color=#CC0099><u><b>" . $count . "/ " .addslashes(htmlspecialchars($row["titre"])) ."</b></u></font><br><img src=././images/space_bulle.gif><br>" .addslashes(htmlspecialchars($row["content"])) ." ','#FFFFF9')\" onMouseOut=\"kill();\"> + +<a href='viewnews.php?news=".$row["id"]."'>" . $row["titre"] . "</a></td>"; + echo " </tr>"; + echo " <tr>"; + echo " <td height=\"1px><img src=\"././images/classement/espace.gif\" width=\"24px\" height=\"3\"></td>"; + echo " <td height=\"1px><img src=\"././images/tirets_login.gif\" width=\"310px\" height=\"3\"></td>"; + echo " </tr>"; + } +} + echo " </table>"; +?> + diff --git a/quete.php b/quete.php @@ -0,0 +1,63 @@ +<?php + +function liste () { //Listage des Quetes disponibles +global $userrow ; +if($userrow["quete"] > '0') +{ +$page .= "Vous avez déjà une quête en cours. Finissez là avant d'en choisir une autre !<br>Regardez dans votre journal de quête."; +display($page, "Quête en cours"); +} +else +{ +$page .= 'Bonjour !<br>'; +$page .= 'Vous venez pour nous aider je supppose ? Alors consultez le tableau ci dessous, celui ci vous donnera tous les renseignements necessaires pour les quêtes de votre niveau.<br>'; +$page .= '<table border="1"><tr><td>Quete</td><td>Description</td><td>Experience Gagnée </td><td>Gils Gagnés </td><td>Accepter</td></tr>'; +//recuperation nom ville +$query=mysql_query("SELECT name from rpg_towns WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."'"); +while($row=mysql_fetch_array($query)) { $ville=$row[0] ; } +//recuperation quete +$query=mysql_query("SELECT * from rpg_quete WHERE level>='".$userrow["level"]."' AND town='$ville'"); +while ($row=mysql_fetch_array($query)) +{ +$fait=0; +if(ereg($row[0],$userrow["listquest"])) {$page .= ''; $fait=1;} //Déjà faite on l'affiche pas +elseif($row[12]<>'0' AND ereg($row[12],$userrow["listquest"])) //Quete prolongee et quete avant deja faite +{ +$page .= '<tr><form action="index.php?do=accept" method="POST"><td>'.$row[1].'</td><td>'.$row[2].'</td><td>'.$row[10].'</td><td>'.$row[11].'</td><td><input type="hidden" name="quest" value="'.$row[0].'"><input type="submit" value="Oui"></form></td></tr>'; +} +//if($row[12]=='0' AND $fait=='0' ) //pas de quete prolongee et pas faite +elseif($row[12]=='0') +{ +$page .= '<tr><form action="index.php?do=accept" method="POST"><td>'.$row[1].'</td><td>'.$row[2].'</td><td>'.$row[10].'</td><td>'.$row[11].'</td><td><input type="hidden" name="quest" value="'.$row[0].'"><input type="submit" value="Oui"></form></td></tr>'; +} +} +$page .= '</table>'; +display($page, "Quêtes Réalisable"); +} +} + +function journal() { //Affichage du journal de la Quete en Cours +global $userrow ; +$requete=mysql_query("SELECT quete FROM rpg_users WHERE id='" .$userrow["id"] ."'"); +while($row=mysql_fetch_array($requete)) { $queteid=$row[0];} +$requete=mysql_query("SELECT * FROM rpg_quete WHERE id='". $queteid ."'"); +$page .= '<div align="center"><strong>Journal de Quete</strong></div><br>'; +$page .= '<table border="1"><tr><td>Quete</td><td>Description</td><td>Experience Gagnée </td><td>Gils Gagnés </td></tr>'; +while ($row=mysql_fetch_array($requete)) +{ +$page .="<tr><td>$row[1]</td><td>$row[2]</td><td>$row[10]</td><td>$row[11]</td></tr>"; +} +$page .= '</table>'; +display($page, "Quête En Cours"); +} + +function accept() { //Acceptation de Quete +global $userrow; +extract($_POST); +mysql_query("UPDATE rpg_users SET quete='$quest' WHERE id='". $userrow["id"] ."'"); +$page = 'Merci de nous aider ! <br> Je vous souhaite bonne chance !<br>(consulter le journal des quêtes)'; +display($page, "Quête Acceptée"); + +} + +?> +\ No newline at end of file diff --git a/resultvote.php b/resultvote.php @@ -0,0 +1,112 @@ + +<? +include("config.php"); +include("lib.php"); +$link = opendb(); + + echo" <style type=\"text/css\"> +body { + color: black; + font: 11px verdana; + background-color:#F8FDF1;</style>"; + +$query = doquery ( "SELECT * FROM {{table}} WHERE numero='$id' AND ip='$REMOTE_ADDR'","sondage_ip"); + +$lignes = mysql_num_rows($query); +if($lignes == 0) +{ +$query = doquery ("INSERT INTO {{table}} VALUES('$id','$REMOTE_ADDR')","sondage_ip"); + +$query = doquery ( "INSERT INTO {{table}} VALUES('$id', '$reponse')","resultats"); + +echo 'Merci d\'avoir voté !'; + +} +else +{ +echo '<span class="alerte">Vous avez déjà voté !</span>'; + +} + +$query = doquery ("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 0,1", "sondage"); +$resultat = mysql_fetch_array($query); +{ +$id_sondage = $resultat[id]; + +$re_1 = $resultat[reponse1]; +$re_2 = $resultat[reponse2]; +$re_3 = $resultat[reponse3]; +$re_4 = $resultat[reponse4]; + + +$query2 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage'", "resultats"); +$votes = mysql_num_rows($query2); +if($votes == 0) +{ +$votes = 1; +} +$query3 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage' AND reponse='1'", "resultats"); +$rep1 = mysql_num_rows($query3); +$query4 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage' AND reponse='2'", "resultats"); +$rep2 = mysql_num_rows($query4); +$query5 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage' AND reponse='3'", "resultats"); +$rep3 = mysql_num_rows($query5); +$query6 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage' AND reponse='4'", "resultats"); +$rep4 = mysql_num_rows($query6); + + + $deb1 = 100*$rep1; + $fin1 = $deb1 / $votes; + $deb2 = 100*$rep2; + $fin2 = $deb2 / $votes; + $deb3 = 100*$rep3; + $fin3 = $deb3 / $votes; + $deb4 = 100*$rep4; + $fin4 = $deb4 / $votes; + +echo '<script language="javascript"> +reponse1 = Math.round('.$fin1.'); +reponse2 = Math.round('.$fin2.'); +reponse3 = Math.round('.$fin3.'); +reponse4 = Math.round('.$fin4.'); + +nombre1 = ('.$rep1.'); +nombre2 = ('.$rep2.'); +nombre3 = ('.$rep3.'); +nombre4 = ('.$rep4.'); +'; +$query7 = doquery ("SELECT * FROM {{table}} WHERE numero='$id_sondage' AND ip='$REMOTE_ADDR'", "sondage_ip"); +$lignes = mysql_num_rows($query7); +if($lignes == 1) +{ + +if(!empty($re_1)) +{ +echo ' +document.write(\'<br><br><b>'.$re_1.'</b> <img border="0" src="images/sondage/barresondage.gif" height=7 WIDTH="\'+reponse1+\'"><b> \'+reponse1+\'%</b> (\'+nombre1+\')<br>\'); +'; +} +if(!empty($re_2)) +{ +echo ' +document.write(\'<b>'.$re_2.'</b> <img border="0" src="images/sondage/barresondage.gif" height=7 WIDTH="\'+reponse2+\'"> <b> \'+reponse2+\'%</b> (\'+nombre2+\')<br>\'); +'; +} +if(!empty($re_3)) +{ +echo ' +document.write(\'<b>'.$re_3.'</b> <img border="0" src="images/sondage/barresondage.gif" height=7 WIDTH="\'+reponse3+\'"> <b> \'+reponse3+\'%</b> (\'+nombre3+\')<br>\'); +'; +} +if(!empty($re_4)) +{ +echo ' +document.write(\'<b>'.$re_4.'</b> <img border="0" src="images/sondage/barresondage.gif" height=7 WIDTH="\'+reponse4+\'"> <b> \'+reponse4+\'%</b> (\'+nombre4+\')<br>\'); +'; +} +echo '</script>'; +echo '<br> <img border="0" src="images/sondage/persosondage.jpg">'; +} +} +?> + diff --git a/smile.php b/smile.php @@ -0,0 +1,86 @@ +<style type="text/css"> +body { + background-image: url(images/background.jpg); + color: black; + font: 11px verdana; +} +table { + border-style: none; + padding: 0px; + font: 11px verdana; +} + +td { + border-style: none; + padding: 3px; + vertical-align: top; +} +td.top { + width: 889px; + border-bottom: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-right: solid 0px black; +} +td.left { + width: 180px; + border-right: solid 1px black; + border-style:dotted; + border-left: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +td.right { + width: 205px; + border-left: solid 1px black; + border-style:dotted; + border-right: solid 0px white; + border-top: solid 0px white; + border-bottom: solid 0px white; +} +a { + color: #663300; + text-decoration: none; + font-weight: bold; +} +a:hover { + color: #330000; +} +.small { + font: 10px verdana; +} +.highlight { + color: red; +} +.light { + color: #999999; +} +.title { + padding: 1px; + margin: 0px; +} +.location { + border: solid 1px white; + padding: 5px; + margin: 0px; +} +.copyright { + border: solid 1px black; + background-color: #eeeeee; + font: 10px verdana; +} +</style> +<body oncontextmenu="return false"><script language="JavaScript"> +</script> <table width="200" align="center"> +<center>[b]Gras[/b] / [i]Italique[/i] / [u]Souligné[/u] / [img]Image[\img] / [url]Lien[/url] <br> + <img src='images/smileys/1.jpg'> :1: / + <img src='images/smileys/2.jpg'> :2: / + <img src='images/smileys/3.jpg'> :3: / + <img src='images/smileys/4.jpg'> :4: / + <img src='images/smileys/5.jpg'> :5: / + <img src='images/smileys/6.jpg'> :6: / + <img src='images/smileys/7.jpg'> :7: / + <img src='images/smileys/8.jpg'> :8: / +</table> +<p align="center"><a href="javascript:window.close();">Fermer</a></body> +\ No newline at end of file diff --git a/style.css b/style.css @@ -0,0 +1,143 @@ +body { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} +p { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +td { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +div { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +table { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +ul { + list-style-type: none; + padding: 0; + margin-left: 0px; +} + +textarea { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + background-color : #CDBCA3; + border : 1px solid #A79985; +} + +input { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + background-color : #CDBCA3; + text-align : center; +} + +select { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + background-color : #CDBCA3; + border : 1px solid #A79985; +} + +span#menu { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #7C6355; + text-align : normal; +} + +div#menu { + font-size : 12px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +div#menu2 { + font-size : 10px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #514741; + text-align : normal; +} + +div#copyright { + font-size : 9px; + font-family : Verdana, Arial, Helvetica, sans-serif; + color : #A79985; + text-align : normal; +} + +h1 { + font-family: arial; + font-size: 2em; + color:#514741; + margin-bottom: 5px; + border-bottom: 1px solid #514741; + } + +.titre_news { + font-size : 12px; + font-weight : bold; +} + +.date_news { + font-size : 9px; +} + +.foot_news { + font-size : 9px; +} + +/* Liens */ + +A#copyright:link { + FONT-SIZE: 9px; COLOR: #A79985; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A#copyright:visited { + FONT-SIZE: 9px; COLOR: #A79985; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A#copyright:active { + FONT-SIZE: 9px; COLOR: #A79985; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A#copyright:hover { + FONT-SIZE: 9px; COLOR: #A79985; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A:link { + FONT-SIZE: 10px; COLOR: #7C6355; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A:visited { + FONT-SIZE: 10px; COLOR: #7C6355; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A:active { + FONT-SIZE: 10px; COLOR: #7C6355; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} + +A:hover { + FONT-SIZE: 10px; COLOR: #FFFFFF; FONT-FAMILY: verdana, arial, sans-serif; TEXT-DECORATION: none +} diff --git a/templates/admin.php b/templates/admin.php @@ -1,78 +1,137 @@ <?php + +ob_start(); +include '../blocs.php'; +$blocs = ob_get_contents(); + ob_end_clean(); + ob_start(); + $template = <<<THEVERYENDOFYOU <head> <title>{{title}}</title> -<style type="text/css"> -body { - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> +</script> </head> -<body><center> -<table width="90%"><tr> -<td width="150" style="border-right: solid 1px black;"> -<b><u>DK Administration</u></b><br /><br /> -<b>Links:</b><br /> -<a href="admin.php">Admin Home</a><br /> -<a href="../index.php">Game Home</a><br /><br /> -<b>Primary Data:</b><br /> -<a href="admin.php?do=main">Main Settings</a><br /> -<a href="admin.php?do=news">Add News Post</a><br /> -<a href="admin.php?do=users">Edit Users</a><br /><br /> -<b>Game Data:</b><br /> -<a href="admin.php?do=items">Edit Items</a><br /> -<a href="admin.php?do=drops">Edit Drops</a><br /> -<a href="admin.php?do=towns">Edit Towns</a><br /> -<a href="admin.php?do=monsters">Edit Monsters</a><br /> -<a href="admin.php?do=levels">Edit Levels</a><br /> -<a href="admin.php?do=spells">Edit Spells</a><br /> -</td><td> -{{content}} -</td></tr></table> -<br /> -<table class="copyright" width="90%"><tr> -<td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">© 2003 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}} {{build}}</td> -</center></body> +<head> +<title>RPG Illusion ++ => bienvenue ;)</title> +<h2 id="up"></h2> + <link title="style" type="text/css" rel="stylesheet" href="../style.css"> +</head> +<body topmargin="0" bottommargin="0" style="background-image: url(../images/site//fond.gif);"> +<table align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td><a href="index.php" title="RPG ILLUSION ++"><img src="../images/site//header.jpg" alt="RPG Illusion ++ => le portail 100% RPG Illusion" border="0"></a></td> + </tr> + </tbody> +</table> +<table valign="top" align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td background="../images/site//menu_fond.jpg" bgcolor="#cdbca3" valign="top" width="182"> + <table border="0" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td width="184"><img src="../images/site//main_nav.jpg" height="22" width="182"></td> + </tr> + <tr> + <td valign="top" width="182"> + <table valign="top" align="center" width="150"> + <tbody> + <tr> + <td> + + <!-- Navigation! --> + + <div id="menu"> </div> + +<b><u>Administration</u></b><br /><br /> +<b>Les liens:</b><br /> +<a href="admin.php">Page d'Admin</a><br /> +<a href="../index.php">Index du jeu</a><br /> +<a href="admin.php?do=stats">Statistiques du jeu</a><br /><br /> + +<b>Données principal:</b><br /> +<a href="admin.php?do=main">Réglages principaux</a><br /> +<a href="admin.php?do=news">Ajouter nouvelle</a><br /> +<a href="admin.php?do=newsaccueil">Ajouter news</a><br /> +<a href="admin.php?do=message">Envoyer un mail</a><br /> +<a href="admin.php?do=users">Editer utilisateurs</a><br /> +<a href="admin.php?do=blocs">Editer les blocs</a><br /> +<a href="admin.php?do=forum">Editer le forum</a><br /> +<a href="admin.php?do=babble">Vider le chatbox</a><br /> +<a href="admin.php?do=comment">Vider les comments</a><br /> +<a href="admin.php?do=historique">Vider l'historique</a><br /> +<a href="admin.php?do=message2">Vider les messageries</a><br /><br /> + +<b>Données du jeu:</b><br /> +<a href="admin.php?do=items">Editer objets</a><br /> +<a href="admin.php?do=drops">Editer objets perdus</a><br /> +<a href="admin.php?do=items2">Editer objets marché</a><br /> +<a href="admin.php?do=monsters">Editer monstres</a><br /> +<a href="admin.php?do=levels">Editer niv. du jeu</a><br /> +<a href="admin.php?do=maisons">Editer maisons</a><br /> +<a href="admin.php?do=addsort">Ajout de Sort</a><br /> +<a href="admin.php?do=spells">Editer sorts</a><br /> +<a href="admin.php?do=addville">Ajout de villes</a><br /> +<a href="admin.php?do=towns">Editer villes</a><br /> +<a href="admin.php?do=quete">Création de Quête</a><br /> +<a href="admin.php?do=quetes">Edition de Quête</a><br /> +<a href="admin.php?do=villenatal">Teleporter</a><br /> +<a href="admin.php?do=interet">Déclencher les interets</a><br /> +<a href="admin.php?do=metier">Déclencher les métiers</a><br /><br /> +<b>Mises à jours:</b><br /> +<a href="http://rpgillusion.franceserv.com/forum/?cat=3&id=18">Vérifier les maj</a><br /> + + + +$blocs +Dévelopé par Darkmore +<!-- Fin Navigation! --> + </td> + </tr> + </tbody> + </table> </tr> + </tbody> + </table> </td> + <td background="../images/site//contenu_fond.jpg" valign="top"> + <table valign="top" align="center" bgcolor="#cdbca3" cellpadding="0" cellspacing="0"> + <tbody> + </tbody> + </table> + <table valign="top" align="left" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td height="28"><img src="../images/site//news_and_content.jpg" alt=""></td> + </tr> + <tr> + <td align="center" valign="top"> + <table valign="top" style="border-style: none solid solid; border-color: rgb(167, 153, 133); border-width: 0px 1px 1px; margin-left: 18px;" bgcolor="#e2d9c7" cellpadding="0" cellspacing="0" width="512"> + <tbody> + <tr> + <td valign="top"><br> + {{content}} +<!-- Fin Parti texte! --> </td> + </tr> + </tbody> + </table> </td> + </tr> + </tbody> + </table> </td> + </tr> + <tr> + <td background="../images/site//menu_fond.jpg" bgcolor="#cdbca3" valign="top"><img src="../images/site//footer_menu.jpg"></td> + <td background="../images/site//contenu_fond.jpg" valign="top"><img src="../images/site//footer_contenu.jpg"></td> + </tr> + </tbody> + </table> +</td> +</table> +</body> + + + +</body> </html> THEVERYENDOFYOU; + ?> \ No newline at end of file diff --git a/templates/aide.php b/templates/aide.php @@ -0,0 +1,42 @@ +<?php // login.php :: Handles logins and cookies. + +include('lib_log.php'); +if (isset($_GET["do"])) { + if ($_GET["do"] == "login") { login(); } + elseif ($_GET["do"] == "logout") { logout(); } +} + +function login() { + + include('config.php'); + $link = opendb(); + + if (isset($_POST["submit_x"])) { + + $query = doquery("SELECT * FROM {{table}} WHERE username='".$_POST["username"]."' AND password='".md5($_POST["password"])."' LIMIT 1", "users"); + if (mysql_num_rows($query) != 1) { die("ID ou PW invalide, veuillez vous reloger avec vos bon identifiants."); } + $row = mysql_fetch_array($query); + if (isset($_POST["rememberme"])) { $expiretime = time()+31536000; $rememberme = 1; } else { $expiretime = 0; $rememberme = 0; } + $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme; + setcookie("dkgame", $cookie, $expiretime, "/", "", 0); + header("Location: index.php"); + die(); + + } + + $page = gettemplate("aide"); + $title = "Aidez nous!"; + display($page, $title, false, true, false); + +} + + +function logout() { + + setcookie("dkgame", "", time()-100000, "/", "", 0); + header("Location: login.php?do=login"); + die(); + +} + +?> +\ No newline at end of file diff --git a/templates/babblebox.php b/templates/babblebox.php @@ -1,34 +1,36 @@ -<?php -$template = <<<THEVERYENDOFYOU -<head> -<title>shoutbox</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; - margins: 0px; - padding: 0px; -} -div { - padding: 2px; - border: solid 1px black; - margin: 2px; - text-align: left; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -</style> -</head> -<body onload="window.scrollTo(0,99999)"> -{{content}} -</body> -</html> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<head> +<title>Boite de dialogue</title> +<style type="text/css"> +body { + background-image: url(images/site/background.jpg); + color: black; + font: 11px verdana; + margins: 0px; + padding: 0px; +} +div { + padding: 2px; + border: solid 1px black; + margin: 2px; + text-align: left; +} +a { + color: #663300; + text-decoration: none; + font-weight: bold; +} +a:hover { + color: #330000; +} +</style> +</head> +<body onload="window.scrollTo(0,99999)"> +{{content}} +<center><A HREF="#" onClick="window.open('smile.php','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=100');return(false)">Smile et Bbcode</A><br /></td></tr> + +</body> +</html> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/changepassword.php b/templates/changepassword.php @@ -1,14 +1,14 @@ -<?php -$template = <<<THEVERYENDOFYOU -<form action="users.php?do=changepassword" method="post"> -<table width="100%"> -<tr><td colspan="2">Use the form below to change your password. All fields are required. New passwords must be 10 alphanumeric characters or less.</td></tr> -<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr> -<tr><td>Old Password:</td><td><input type="password" name="oldpass" size="20" /></td></tr> -<tr><td>New Password:</td><td><input type="password" name="newpass1" size="20" maxlength="10" /></td></tr> -<tr><td>Verify New Password:</td><td><input type="password" name="newpass2" size="20" maxlength="10" /><br /><br /><br /></td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr> -</table> -</form> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<form action="users.php?do=changepassword" method="post"> +<table width="100%"> +<tr><td colspan="2">Veuillez remplir les champs ci-dessous pour changer votre PW. Tous les champs sont exigés. Les nouveaux PW ne doivent pas faire plus de 10 caractères alphanumériques.</td></tr> +<tr><td width="20%">id:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr> +<tr><td>Ancien PW:</td><td><input type="password" name="oldpass" size="20" /></td></tr> +<tr><td>Nouveau PW:</td><td><input type="password" name="newpass1" size="20" maxlength="10" /></td></tr> +<tr><td>Retapez le PW:</td><td><input type="password" name="newpass2" size="20" maxlength="10" /><br /><br /><br /></td></tr> +<tr><td colspan="2"><input type="submit" name="submit" value="Valider" /> <input type="submit" name="submit" value="Annuler" /></td></tr> +</table> +</form> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/fight.php b/templates/fight.php @@ -1,14 +1,47 @@ <?php $template = <<<THEVERYENDOFYOU -<table width="100%"> -<tr><td class="title"><img src="images/title_fighting.gif" alt="Fighting" /></td></tr> -<tr><td> -You are fighting a <b>{{monstername}}</b><br /><br /> -{{monsterhp}} -{{yourturn}} -{{monsterturn}} -{{command}} -</td></tr> +<table border="0" width="61"> + + <tr> + <img src="images/title_fighting.gif"/><br><br> + <td width="359" height="121" background="images/bb03.png"> + <table border="0" width="359" align="center"> + <tr> + <td width="118" height="149" align="center" valign="bottom"> + <p align="center"> </p> + <p align="center"><img src="images/avatar/{{image2}}" style="vertical-align: top; "></p> + <p align="center"> </p> + </td> + <td width="86" height="149"> + <p> </p> + </td> + <td width="133" height="149" valign="bottom"> + <p align="center"> </p> + <p align="center"> </p> + <p align="center"><img src="images/monstre/{{image}}.gif" style="vertical-align: top; "></p> + <p align="center"> </p> + </td> + </tr> + </table> + </td> + + <p><p> Vous combattez un : <b>{{monstername}}</b> .<b><br> </b>De + level : <b>{{levelmonstre}}</b> .<br>Avec : <b>{{monsterhp}}</b> + de vie .<br>{{immunecontre}}</p> + </td> + </tr> + <tr> + <td width="0" height="275"> + <p> </p> + </td> + + {{yourturn}} {{monsterturn}}</p> + + + {{command}}</p> + </td> + </tr> </table> THEVERYENDOFYOU; -?> -\ No newline at end of file +?> + diff --git a/templates/guide.php b/templates/guide.php @@ -0,0 +1,291 @@ +<?php + + +$template = <<<THEVERYENDOFYOU + + + <td class=middle height="1664"> + <table width=280 align=center border=0> + <tbody> + <tr> + <td width=280 height=7> + <p><img src=./images/pic2.gif /> <a href="login.php?do=login">Retour à l'accueil + </a></p> + </td> + </tr> + + </tbody> + </table> + <br> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td bgcolor=#f0d4b0 colspan=2 height=7> + <p align=center><a name=0></a><a>1- Dictionaire</a></p> + </td> + </tr> + <tr> + <td height=5> + <p align=right>Gils :</p> + </td> + <td height=5> + <p>Monnais du jeu</p> + </td> + </tr> + <tr> + <td height=11> + <p align=right>ID :</p> + </td> + <td height=11> + <p>Pseudo</p> + </td> + </tr> + <tr> + <td width=281 height=10> + <p align=right>PW :</p> + </td> + <td width=283 height=10> + <p>Mot de passe</p> + </td> + </tr> + <tr> + <td width=281 height=5> + <p align=right>HP :</p> + </td> + <td width=283 height=5> + <p>Point de vie</p> + </td> + </tr> + <tr> + <td width=281 height=8> + <p align=right>TP :</p> + </td> + <td width=283 height=8> + <p>Point de voyage</p> + </td> + </tr> + <tr> + <td width=281 height=10> + <p align=right>MP :</p> + </td> + <td width=283 height=10> + <p>Point de magie</p> + </td> + </tr> + <tr> + <td width=281 height=16> + <p align=right>EXP :</p> + </td> + <td width=283 height=16> + <p>Point d'experience</p> + </td> + </tr> + <tr> + <td width=281 height=12> + <p align=right>LVL :</p> + </td> + <td width=283 height=12> + <p>Niveau</p> + </td> + </tr> + <tr> + <td width=281 height=9> + <p align=right>NIV :</p> + </td> + <td width=283 height=9> + <p>Niveau</p> + </td> + </tr> + </tbody> + </table> + <p align=center> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=2></a></a><a>1- Comment se + déplacé</a></p> + </td> + </tr> + <tr> + <td width=280 height=5> + <p align=center>En haut à gauche vous avez sans doute remarqué qu'il + y a les points cardinaux.<br> + Vous n'avez qu'à cliquer sur l'un d'eux pour aller dans la direction + désirée.<br> + Pour savoir où vous vous situez en haut des points cardinaux sont + marqués votre position.<br> + Au besoin, référez-vous à la carte qui se situe juste en dessous + de vos coordonnées. </p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table height=77 width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=3></a></a><a>2- Comment combattre</a></p> + </td> + </tr> + <tr> + <td width=280 height=38> + <p align=center>Déplacez-vous aléatoirement et au bout de quelques + déplacement vous devriez tombé sur un monstre plus ou moins fort, + comparez son niveau au votre et si vous jugez que vous êtes à la + hauteur:<br> + <br> + cliquez sur ''Attaquer''<br> + <br> + Si vous ne tuez pas le monstre répétez l'opération jusqu'à la victoire, + si le monstre a le dessus sur vous vous pouvez toujours utilisé + l'option :<br> + <br> + ''S'enfuir''<br> + <br> + </p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=4></a></a><a>3- Comment acheter</a></p> + </td> + </tr> + <tr> + <td width=280 height=7> + <p align=center>Il suffit de se rendre dans une ville.<br> + Les villes se situe sur la "map", vous pouvez vous y rendre à <a + href="guide.php?do=login#2">pied</a> + ou bien vous pouvez aussi vous <a + href="guide.php?do=login#7">téléportez</a> + et donc, vous rendre sur une des 8 villes.<br> + De là vous cliquez sur :<br> + <br> + ''Acheter armures/armes''<br> + <br> + </p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=5></a></a><a>4- Comment se + soigner</a></p> + </td> + </tr> + <tr> + <td width=280 height=7> + <p align=center>Il suffit de vous rendre sur une des villes se situant + sur la "map" et de cliquer sur :</p> + <p align=center>" Se reposer à l'auberge "</p> + <p align=center>puis , payez la "nuit" et puis voila !</p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=6></a></a><a>5- Comment utiliser + un sort</a></p> + </td> + </tr> + <tr> + <td width=280 height=7> + <p align=center>Lorsque vous <a + href="guide.php?do=login#3">combattez</a>, + vous pouvez selectionné les sorts.<br> + Sélectionné un sort plus ou moin efficace et cliquez sur :<br> + <br> + ''Exécuté''</p> + <p align=center>Les sorts s'acquierent avec les niveaux. Lorsque vous + changez de niveau, avec un peu de chance vous aurez droit a un nouveau + sort. Chaque sort a ses fonctions:<br> + <br> + defense, attaque, heal etc...<br> + </p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=7></a></a><a>6- Comment se + téléporter</a></p> + </td> + </tr> + <tr> + <td width=280 height=5> + <p align=center>il suffit d'acheter <a + href="guide.php?do=login#8">les cartes</a> + d'abord ! </p> + <p align=center>Au début vous ne pourrez que vous téléportez à Midworld<br> + mais bien vite d'autre "map" s'ouvriront à vous .</p> + <p align=center>Attention ! vous ne pouvez pas vous téléporter autant + que vous le voulez ! qaund on se téléporte on perd des <a + href="guide.php?do=login#1">TP</a> + ! pour les remetre au maximum il suffit de se <a + href="guide.php?do=login#5">soigner</a> + à une ville</p> + </td> + </tr> + </tbody> + </table> + <p align=center> <a + href="guide.php?do=login#">Retour en haut + </a></p> + <table width=280 align=center bgcolor=#fff0d8 border=1> + <tbody> + <tr> + <td width=280 bgcolor=#f0d4b0 height=7> + <p align=center><a target=_top><a name=8></a></a><a>7- Comment acheter + des cartes</a></p> + </td> + </tr> + <tr> + <td width=280 height=5> + <p align=center>Il suffit de vous rendre à une ville et de cliquer + sur :</p> + <p align=center>" Acheter cartes "</p> + <p align=center>et de choisir la carte à acheter.</p> + </td> + </tr> + </tbody> + </table> + <p align=center><a + href="guide.php?do=login#">Retour en haut + </a></p> + </td> + +THEVERYENDOFYOU; + + +?> +\ No newline at end of file diff --git a/templates/help.php b/templates/help.php @@ -0,0 +1,30 @@ +<?php + + +$template = <<<THEVERYENDOFYOU + +<center><b>Cliquez sur +la bannière pour nous aider dans le <br> +develloppement de RPG illusion. Merci</b></center></b><br> +<br> +<center><!-- Tag PromoBenef site membre N°30713--> +<script type="text/javascript"> +<!-- +var promobenef_site = "30713"; +var promobenef_minipub = "1"; +var promobenef_format = "1"; +//--> +</script> +<script type="text/javascript" src="http://www.promobenef.com/pub/"></script> +<noscript><a href="http://www.promobenef.com/">PromoBenef : régie publicitaire<img src="http://www.promobenef.com/no_js/?sid=30713&fid=1" width="0" height="0" border="0" /></a></noscript></center><br><br><center><b>Vous pouvez également faire des dons sécurisés</b></center><br><center><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> +<input type="hidden" name="cmd" value="_s-xclick"> +<input type="image" src="https://www.paypal.com/fr_FR/i/btn/x-click-but21.gif" border="0" name="submit" alt="Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée !"> +<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHHgYJKoZIhvcNAQcEoIIHDzCCBwsCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCQnpvHclvwifG43woCbbo2FpB0HlyYOLGW8FGIzlmEZAL9SIcYHk3P3hgNKo8OGkwluXke9D7AHYGTt7qsOxnOiciNZ8VS+1Mbwh+8WfW+rbFDQD75HJq0HWmhIojYAOp+NP+yewjz/3hIrr5CH4lEbCONAqgBYMu6ia9wyMNyuDELMAkGBSsOAwIaBQAwgZsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIWsLEMuYTAlGAeOSypyOeJ48dpsfXSn1zXnnrNWFD7BcM0fpJy920NFnQARQDP4+D1jvLjOXJmCIgginBeczOWtpGBcLBrCxmZYIiggfP4Ox2P1NwMifM9uLk4ZPzlYkhwjLNkrCm2UrnWLj2jU1L1Ulr/3PTPZJX63j0D2HspIHJoKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA1MDcwNzIzMDMxMFowIwYJKoZIhvcNAQkEMRYEFPFKpYwEtBmhwL+Er+19GwXEbLxOMA0GCSqGSIb3DQEBAQUABIGASJ5sFn2x5k5XM0B6fLrVcdlJCWXzi1PnRiPosRCNHCEnI3U93mqlcJi+x6FX8iN2oagfSgaLYkrFMNHcZ1l+U0+8IiJyeSFfIUea1sWl9IayNBhCf/kwAPzPbeiaSe1qTko+TODy2LeIgTNRoe2cqtj53KoAR1A+G6TZ9xapeg4=-----END PKCS7----- +"> +</form></center> + + +THEVERYENDOFYOU; + + +?> +\ No newline at end of file diff --git a/templates/home.php b/templates/home.php @@ -0,0 +1,20 @@ +<?php +$template = <<<THEVERYENDOFYOU +<table width="100%"> +<tr><td class="title"><img src="images/maison.gif" alt="La maison de {{name}}" title="La maison de {{name}}" /></td></tr> +<tr><td> +<ul> + <img src="././images/site/pic2.gif" /><a href="index.php?do=reposhome"> Se reposer à la maison</a><br> + <img src="././images/site/pic2.gif" /><a href="index.php?do=bierrehome"> Boire une bierre</a><br> + <img src="././images/site/pic2.gif" /><a href="index.php?do=msg"> Laisser un message</a><br> + <img src="././images/site/pic2.gif" /><a href="index.php?do=admin_maison"> Administrer ta maison</a><br> +</ul> +</td></tr> +<tr><td><img src="././images/blog.gif" /><br> +{{bloghome}} + +<br /> +</td></tr> +</table> +THEVERYENDOFYOU; +?> +\ No newline at end of file diff --git a/templates/leftnav.php b/templates/leftnav.php @@ -1,40 +1,51 @@ <?php +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); +$monnaie = $townrow3["monnaie"]; $template = <<<THEVERYENDOFYOU -<table width="100%"> -<tr><td class="title"><img src="images/button_location.gif" alt="Location" title="Location" /></td></tr> -<tr><td> -Currently: {{currentaction}}<br /> -Latitude: {{latitude}}<br /> -Longitude: {{longitude}}<br /> -<a href="javascript:openmappopup()">View Map</a><br /><br /> + +<table width="30px" height="32px" background="images/site/dr.gif"><tr><td> +<br> +<table width="95%"> +<tr><td width="90%"><img src="images/avatar/{{avatar}}"><br> +<a href="javascript:opencharpopup()"><b> {{charname}}</b></a><br /> +Niveau: {{level}}<br /> +<a href="javascript:openmappopup()"><b>Po:</b></a> {{latitude}}/{{longitude}}<br /> +Exp: {{experience}}<br /> +$monnaie: {{gold}}<br /> +Age: {{age}}<br /> +HP: {{currenthp}}<br /> +MP: {{currentmp}}<br /> +TP: {{currenttp}}</br /> +</td><td> +</table> + +<br><img src="images/site/main_nav5.jpg"> <form action="index.php?do=move" method="post"> -<center> -<input name="north" type="submit" value="North" /><br /> -<input name="west" type="submit" value="West" /><input name="east" type="submit" value="East" /><br /> -<input name="south" type="submit" value="South" /> -</center> +<center><input name="north" type="image" src="././images/pic_nord.gif"/><br /> +<input name="west" type="image" src="././images/pic_ouest.gif"/><input name="east" type="image" src="././images/pic_est.gif"/><br /> +<input name="south" type="image" src="././images/pic_sud.gif" /></center> </form> -</td></tr> -</table><br /> -<table width="100%"> -<tr><td class="title"><img src="images/button_towns.gif" alt="Towns" title="Towns" /></td></tr> -<tr><td> -{{currenttown}} -Travel To:<br /> -{{townslist}} -</td></tr> -</table><br /> + +<img src="images/site/main_nav3.jpg"><br> +{{townslist}} + + +<br><img src="images/site/main_nav4.jpg"><br> +{{adminlink}}{{modolink}} +<img src="././images/site/pic.gif"> {{forumslink}} +<img src="././images/site/pic.gif"/>({{nb}}){{msglink}} +<img src="././images/site/pic.gif"><a href=index.php?do=sacados> Sac a Dos</a><br> +<img src="././images/site/pic.gif"><a href="index.php?do=kamp"> QG de votre Clan</a><br> +<img src="././images/site/pic.gif"><a href="index.php?do=journal"> JournalQuetes</a><br> +<img src="././images/site/pic.gif"><a href="index.php?do=point"> PointPerso</a><br> +<img src="././images/site/pic.gif"><a href="index.php?do=profil"> Profil</a><br> +<img src="././images/site/pic.gif"><a href="index.php?do=classement"> Classement</a><br> +<img src="././images/site/pic.gif"/><a href="help.php?do=login" > Nous aider</a><br> +<img src="././images/site/pic.gif"/><a href="guide.php?do=login"> Guide</a><br> +<img src="././images/site/pic.gif"><a href="login.php?do=logout"> Quitter</a><br /> +</table><br> -<table width="100%"> -<tr><td class="title"><img src="images/button_functions.gif" alt="Functions" title="Functions" /></td></tr> -<tr><td> -{{forumslink}} -{{adminlink}} -<a href="users.php?do=changepassword">Change Password</a><br /> -<a href="login.php?do=logout">Log Out</a><br /> -<a href="help.php">Help</a> -</td></tr> -</table><br /> THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/leftnav_log.php b/templates/leftnav_log.php @@ -0,0 +1,124 @@ +<?php +ob_start(); +include 'vote.php'; +$vote = ob_get_contents(); + ob_end_clean(); + ob_start(); + +// Lister les derniers inscrits +$di = doquery("SELECT username FROM {{table}} WHERE verify='1' ORDER BY id DESC LIMIT 5","users"); +$dinum = mysql_num_rows($di); + +while($arr = mysql_fetch_assoc($di)) +{ +$dins .= $arr['username']; +$num++; +if($num == ($dinum - 1)) +{ +$dins .= ' et '; +} +elseif($num == $dinum) +{ +$dins .= '.'; +} +else +{ +$dins .= ', '; +} +} + +// Nombre de joueurs inscrits +$di2 = doquery("SELECT id FROM {{table}} WHERE verify='1' ORDER BY id DESC LIMIT 1","users"); +$dinum2 = mysql_num_rows($di2); + +while($arr = mysql_fetch_assoc($di2)) +{ +$dins2 .= $arr['id']; +$num++; +if($num == ($dinum - 1)) +{ +$dins2 .= ''; +} +elseif($num == $dinum) +{ +$dins2 .= ''; +} +else +{ +$dins2 .= ''; +} +} + +// Nombre de joueurs connécté +$onlinequery = doquery("SELECT * FROM {{table}} WHERE UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' ORDER BY charname", "users"); +$online = mysql_num_rows($onlinequery); + +if($online == 1) $mbr_s = "Membre connecté"; +if($online > 1) $mbr_s = "Membres connectés"; +if($online < 1) $mbr_s = "Pas de connectés"; + +while($onn = mysql_fetch_assoc($onlinequery)) +{ +$ons .=$onn['charname']; +$nu++; +if($nu == ($online - 1)) +{ +$ons .= ' <img src="images/site/ligne.gif"><br/> +'; +} +elseif($nu == $online) +{ +$ons .= ' <img src="images/site/ligne.gif"><br/>'; +} +else +{ +$ons .= ' <img src="images/site/ligne.gif"><br/> +'; +} +} + +$template = <<<THEVERYENDOFYOU + +<br> + +<table width="150px" height="62px"><tr><td> +<center><form action="login.php?do=login" method="post"> +<table align="left" > + <tr> + <td>ID: <input type="text" size="20" name="username" style="font-family:Verdana; font-size:7pt"/></td> + </tr> + <tr> + <td>PW: <input type="password" size="20" name="password" style="font-family:Verdana; font-size:7pt"/></td> + </tr> +</table> +<center> + <tr><td><center><input type="image" name="submit" src="././images/leftnav_log/log_valid.gif" alt="Ok" border="0"/></center> +</td> </tr> + +</form> +</center></td></tr> +<table width="150px" height="61px" valign="top"> + <tr> + <td> +<img src="././images/site/pic.gif"/> <a href="users.php?do=register">Créer un personnage</a> +<br><img src="././images/site/pic.gif"/> <a href="users.php?do=lostpassword">Password oublié ?</a> +<br><img src="././images/site/pic.gif"/> <a href="users.php?do=changepassword">Changer de password</a><br> +<br> <img src="././images/site/pic.gif"/><b>Il y a :</b> $dins2 <b>joueurs.</b><br> +<img src="././images/site/pic.gif"/><b>Derniers inscrits :</b> <br> $dins +<br><img src="././images/site/pic.gif"/><b>$mbr_s:</b> +<br>$ons +$vote + +</td> + </tr> + + + <tr> + <td> + </tr> +</table> + + + +THEVERYENDOFYOU; +?> +\ No newline at end of file diff --git a/templates/login.php b/templates/login.php @@ -1,13 +1,40 @@ <?php +ob_start(); +include 'classe_best.php'; +$classe_best = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe.php'; +$classe = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe2.php'; +$classe2 = ob_get_contents(); + ob_end_clean(); + ob_start(); + + ob_start(); +include 'newsaccueil.php'; +$news = ob_get_contents(); + ob_end_clean(); + ob_start(); + $template = <<<THEVERYENDOFYOU -<form action="login.php?do=login" method="post"> -<table width="75%"> -<tr><td width="30%">Username:</td><td><input type="text" size="30" name="username" /></td></tr> -<tr><td>Password:</td><td><input type="password" size="30" name="password" /></td></tr> -<tr><td>Remember me?</td><td><input type="checkbox" name="rememberme" value="yes" /> Yes</td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Log In" /></td></tr> -<tr><td colspan="2">Checking the "Remember Me" option will store your login information in a cookie so you don't have to enter it next time you get online.<br /><br />Want to play? You gotta <a href="users.php?do=register">register your own character.</a><br /><br />You may also <a href="users.php?do=changepassword">change your password</a>, or <a href="users.php?do=lostpassword">request a new one</a> if you've lost yours.</td></tr> + +<table width="70%"> +<tr><td width="50%"><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><b>Classement joueurs</b> <a href="login.php?do=login2"><font color=\"OOOOOO\"> Classement guildes</a> </a><br></table><br><table width="100%"> +<tr><td width="40%"> +$classe_best</td><td>$classe </td></tr> +</table></td><td></table><br><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><b>Les dernieres news</b> <a href="login.php?do=login4"><font color=\"OOOOOO\"> L'histoire ...</a><br></table><br> +<table width="95%"><tr><td width="50%"> +$news </table> -</form> + THEVERYENDOFYOU; + + ?> \ No newline at end of file diff --git a/templates/login2.php b/templates/login2.php @@ -0,0 +1,40 @@ +<?php +ob_start(); +include 'classe_best2.php'; +$classe_best = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe.php'; +$classe = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe2.php'; +$classe2 = ob_get_contents(); + ob_end_clean(); + ob_start(); + + ob_start(); +include 'newsaccueil.php'; +$news = ob_get_contents(); + ob_end_clean(); + ob_start(); + +$template = <<<THEVERYENDOFYOU + +<table width="70%"> +<tr><td width="50%"><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><b><a href="login.php?do=login"><font color=\"OOOOOO\">Classement joueurs</b> <font color=\"OOOOOO\">Classement guildes </a><br></table><br><table width="100%"> +<tr><td width="40%"> +$classe_best</td><td>$classe2 </td></tr> +</table></td><td></table><br><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><b>Les dernieres news</b> <a href="login.php?do=login4"><font color=\"OOOOOO\"> L'histoire ...</a><br></table> +<table width="95%"><tr><td width="50%"> +$news +</table> + +THEVERYENDOFYOU; + + +?> +\ No newline at end of file diff --git a/templates/login4.php b/templates/login4.php @@ -0,0 +1,41 @@ +<?php +ob_start(); +include 'classe_best.php'; +$classe_best = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe.php'; +$classe = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe2.php'; +$classe2 = ob_get_contents(); + ob_end_clean(); + ob_start(); + + ob_start(); +include 'newsaccueil.php'; +$news = ob_get_contents(); + ob_end_clean(); + ob_start(); + +$template = <<<THEVERYENDOFYOU + +<table width="70%"> +<tr><td width="50%"><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><b>Classement joueurs</b> <a href="login.php?do=login2"><font color=\"OOOOOO\"> Classement guildes</a> </a><br></table><br><table width="70%"> +<tr><td width="60%"> +$classe_best</td><td>$classe </td></tr> +</table></td><td></table><br><table width="300px" height="10px" background="././images/cellpic3.jpg"><tr><td><a href="login.php?do=login"><font color=\"OOOOOO\">Les dernieres news</a></font> <b> L'histoire ...</b><br></table> +<br><br> +<table width="95%"><tr><td width="50%"> +<b><u>Bienvenue sur rpg illusion 1.2c.</u></b><br><br> L'histoire commence bien avant notre ère, 8 villages se lancent dans une grande guerre, pour devenir le pays le plus puissant. Devenez citoyen de Midworld, de Roma, de Bris, de Kalle, de Narcissa, de Hambry, de Gilead et de Endworld.<br><br> Dans ce jeu, vous pouvez soit explorer le monde enorme de rpg illsuion 1.2c ou soit effectuer des quetes pour gagner des gils pour vous et pour votre village, ou sinon plus radicalement attaquer les villages voisins et leurs voler des gils. Il est aussi possible de faire l'aventure acompagner d'un animal.<br>Si ce n'est pas encore fait <a href="users.php?do=register">inscrivez-vous</a>. +</table> + +THEVERYENDOFYOU; + + +?> +\ No newline at end of file diff --git a/templates/lostpassword.php b/templates/lostpassword.php @@ -1,11 +1,11 @@ -<?php -$template = <<<THEVERYENDOFYOU -<form action="users.php?do=lostpassword" method="post"> -<table width="80%"> -<tr><td colspan="2">If you've lost your password, enter your email address below and you will be sent a new one.</td></tr> -<tr><td width="20%">Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr> -</table> -</form> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<form action="users.php?do=lostpassword" method="post"> +<table width="80%"> +<tr><td colspan="2">Si vous avez perdu votre PW, écrivez votre adresse email ci-dessous. Un nouveau vous sera envoyé.</td></tr> +<tr><td width="20%">Adresse email:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr> +<tr><td colspan="2"><input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /></td></tr> +</table> +</form> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/minimal.php b/templates/minimal.php @@ -1,68 +1,73 @@ -<?php -$template = <<<THEVERYENDOFYOU -<head> -<title>{{title}}</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 150px; - border-right: solid 2px black; -} -td.right { - width: 150px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> -</head> -<body><center> -{{content}} -</center></body> -</html> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<head> +<title>{{title}}</title> +<style type="text/css"> +body { + background-image: url(images/background.jpg); + color: black; + font: 11px verdana; +} +table { + border-style: none; + padding: 0px; + font: 11px verdana; +} +td { + border-style: none; + padding: 3px; + vertical-align: top; +} +td.top { + border-bottom: solid 2px black; +} +td.left { + width: 150px; + border-right: solid 2px black; +} +td.right { + width: 150px; + border-left: solid 2px black; +} +a { + color: #663300; + text-decoration: none; + font-weight: bold; +} +a:hover { + color: #330000; +} +.small { + font: 10px verdana; +} +.highlight { + color: red; +} +.light { + color: #999999; +} +.title { + border: solid 1px black; + background-color: #eeeeee; + font-weight: bold; + padding: 5px; + margin: 3px; +} +.copyright { + border: solid 1px black; + background-color: #eeeeee; + font: 10px verdana; +} +#map { + width: 501px; + height: 501px; + background-image: url(images/map.gif); +} +</style> +</head> +<body><center> +{{content}} +</center></body> +</html> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/modo.php b/templates/modo.php @@ -0,0 +1,108 @@ +<?php + +ob_start(); +include './blocs.php'; +$blocs = ob_get_contents(); + ob_end_clean(); + ob_start(); + +$template = <<<THEVERYENDOFYOU +<head> +<title>{{title}}</title> +</script> +</head> +<head> +<title>RPG Illusion ++ => bienvenue ;)</title> +<h2 id="up"></h2> + <link title="style" type="text/css" rel="stylesheet" href="../style.css"> +</head> +<body topmargin="0" bottommargin="0" style="background-image: url(../images/site/fond.gif);"> +<table align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td><a href="index.php" title="RPG ILLUSION ++"><img src="../images/site/header.jpg" alt="RPG Illusion ++ => le portail 100% RPG Illusion" border="0"></a></td> + </tr> + </tbody> +</table> +<table valign="top" align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td background="../images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top" width="182"> + <table border="0" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td width="184"><img src="../images/site/main_nav.jpg" height="22" width="182"></td> + </tr> + <tr> + <td valign="top" width="182"> + <table valign="top" align="center" width="150"> + <tbody> + <tr> + <td> + + <!-- Navigation! --> + + <div id="menu"> </div> + +<b><u>Moderation</u></b><br /><br /> +<b>Les liens:</b><br /> +<a href="modo.php">Page de modo</a><br /> +<a href="../index.php">Index du jeu</a><br /><br /> +<b>Données principal:</b><br /> +<a href="modo.php?do=news">Ajouter nouvelle</a><br /> +<a href="modo.php?do=users">Editer utilisateurs</a><br /> +<a href="modo.php?do=babble">Vider le chatbox</a><br /> +<a href="modo.php?do=message">Editer un mail</a><br /> +<a href="modo.php?do=newsaccueil">Editer les news</a><br /><br /> + +$blocs +Dévelopé par Darkmore +<!-- Fin Navigation! --> + </td> + </tr> + </tbody> + </table> </tr> + </tbody> + </table> </td> + <td background="../images/site/contenu_fond.jpg" valign="top"> + <table valign="top" align="center" bgcolor="#cdbca3" cellpadding="0" cellspacing="0"> + <tbody> + </tbody> + </table> + <table valign="top" align="left" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td height="28"><img src="../images/site/news_and_content.jpg" alt=""></td> + </tr> + <tr> + <td align="center" valign="top"> + <table valign="top" style="border-style: none solid solid; border-color: rgb(167, 153, 133); border-width: 0px 1px 1px; margin-left: 18px;" bgcolor="#e2d9c7" cellpadding="0" cellspacing="0" width="512"> + <tbody> + <tr> + <td valign="top"><br> + {{content}} +<!-- Fin Parti texte! --> </td> + </tr> + </tbody> + </table> </td> + </tr> + </tbody> + </table> </td> + </tr> + <tr> + <td background="../images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top"><img src="../images/site/footer_menu.jpg"></td> + <td background="../images/site/contenu_fond.jpg" valign="top"><img src="../images/site/footer_contenu.jpg"></td> + </tr> + </tbody> + </table> +</td> +</table> +</body> + + + +</body> +</html> +THEVERYENDOFYOU; + +?> +\ No newline at end of file diff --git a/templates/news_accueil.php b/templates/news_accueil.php @@ -0,0 +1,79 @@ +<?php +ob_start(); +include 'classe_best.php'; +$classe_best = ob_get_contents(); + ob_end_clean(); + ob_start(); + +ob_start(); +include 'classe.php'; +$classe = ob_get_contents(); + ob_end_clean(); + ob_start(); + + ob_start(); +include 'items.php'; +$items = ob_get_contents(); + ob_end_clean(); + ob_start(); + +include('./bbcode.php'); + +if(isset($_GET['news'])) +{ + // News System + $rownews = doquery("SELECT * FROM {{table}} WHERE id='$_GET[news]' LIMIT 1","newsaccueil"); + $texte = new texte(); + $numnews = mysql_num_rows($rownews); + $news = mysql_fetch_assoc($rownews); + + if($numnews != 1) + { + $contenu_news = 'Cette news n\'existe pas.'; + } + else + { + //Affichage du contenu... + $contenu_news = ' <font size="1">Le <b>'.$news['postdate'].'</b> [<a href="index.php">Retour</a>]</font><br /><br />'.nl2br($texte->ms_format($news['content'])).' <br><br><u>Posté par </u>: <b><i>'.$news['auteur'].'</b></i>'; + } +} +else +{ + $contenu_news = 'La news sélectionnée n\'existe pas.'; +} +$template = <<<THEVERYENDOFYOU + + + + + +<table> + <tr> + <td><center></td> + </tr> +</table> + +<div> +<div> + +<table> +<td> +<table width="357px" height="38px" alt="Les news" title="News"><tr><td> +</td></tr> +</table> +<table width="357px" height="1px"> +<tr> +<td width="344px" height="125px">$contenu_news</TD> +</tr> +</table> <table width="357px" height="10px"><tr><td> +</td></tr> +</table> + +</table> + + + +THEVERYENDOFYOU; + + +?> +\ No newline at end of file diff --git a/templates/onlinechar.php b/templates/onlinechar.php @@ -1,41 +1,22 @@ -<?php -$template = <<<THEVERYENDOFYOU -Here is the character profile for <b>{{charname}}</b>.<br /><br /> -When you're finished, you may <a href="index.php">return to town</a>.<br /><br /> -<table width="200"> -<tr><td class="title"><img src="images/button_character.gif" alt="Character" title="Character" /></td></tr> -<tr><td> -<b>{{charname}}</b><br /><br /> - -Difficulty: {{difficulty}}<br /> -Class: {{charclass}}<br /><br /> - -Level: {{level}}<br /> -Experience: {{experience}}<br /> -Gold: {{gold}}<br /> -Hit Points: {{currenthp}} / {{maxhp}}<br /> -Magic Points: {{currentmp}} / {{maxmp}}<br /> -Travel Points: {{currenttp}} / {{maxtp}}<br /><br /> - -Strength: {{strength}}<br /> -Dexterity: {{dexterity}}<br /> -Attack Power: {{attackpower}}<br /> -Defense Power: {{defensepower}}<br /> -</td></tr> -</table><br /> - -<table width="200"> -<tr><td class="title"><img src="images/button_inventory.gif" alt="Inventory" title="Inventory" /></td></tr> -<tr><td> -<table width="100%"> -<tr><td><img src="images/icon_weapon.gif" alt="Weapon" title="Weapon" /></td><td width="100%">Weapon: {{weaponname}}</td></tr> -<tr><td><img src="images/icon_armor.gif" alt="Armor" title="Armor" /></td><td width="100%">Armor: {{armorname}}</td></tr> -<tr><td><img src="images/icon_shield.gif" alt="Shield" title="Shield" /></td><td width="100%">Shield: {{shieldname}}</td></tr> -</table> -Slot 1: {{slot1name}}<br /> -Slot 2: {{slot2name}}<br /> -Slot 3: {{slot3name}} -</td></tr> -</table><br /> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +Voici le profile du personnage nommé <b>{{charname}}</b>.<br /><br /> +Quand vous avez fini, vous pouvez <a href="index.php">retourner à la ville</a>.<br /><br /> +<table width="200"> +<tr><td class="title"><img src="images/button_character.gif" alt="Personnage" title="Personnage" /></td></tr> +<tr><td> +<b>{{charname}}</b><br /><br /> +<img src="././images/avatar/{{avatar}}" width="71" height="66"><br /><br /> +<b>Id :</b> {{id}}<br> +<b>Classe :</b> {{charclass}}<br /> +<b>Niveau :</b> {{level}}<br /> +<b>Experience :</b> {{experience}}<br /> +<b>Age :</b> {{age}}<br /> +<b>Position:</b> :{{latitude}}/{{longitude}}<br /> + + + +</td></tr> +</table><br /> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/primary.php b/templates/primary.php @@ -1,64 +1,28 @@ <?php + +ob_start(); +include './blocs.php'; +$blocs = ob_get_contents(); + ob_end_clean(); + ob_start(); + $template = <<<THEVERYENDOFYOU <head> <title>{{title}}</title> -<style type="text/css"> -body { - background-image: url(images/background.jpg); - color: black; - font: 11px verdana; -} -table { - border-style: none; - padding: 0px; - font: 11px verdana; -} -td { - border-style: none; - padding: 3px; - vertical-align: top; -} -td.top { - border-bottom: solid 2px black; -} -td.left { - width: 180px; - border-right: solid 2px black; -} -td.right { - width: 180px; - border-left: solid 2px black; -} -a { - color: #663300; - text-decoration: none; - font-weight: bold; -} -a:hover { - color: #330000; -} -.small { - font: 10px verdana; -} -.highlight { - color: red; -} -.light { - color: #999999; -} -.title { - border: solid 1px black; - background-color: #eeeeee; - font-weight: bold; - padding: 5px; - margin: 3px; -} -.copyright { - border: solid 1px black; - background-color: #eeeeee; - font: 10px verdana; -} -</style> + +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name='Description' content='RPG illusion est un rpg entierement gratuit en php. Téléchargez le pour votre site. Free php online www.rpgillusion.net'> +<meta name='Keywords' content='free, php, free hosting, rpg, free game, rpg online, online, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii, tactics, lengend, mmorg, mystic, free mmorpg, ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8, ff9, ff10, ff11, ff12, film, the, spirits, within, creatures, esprit, square, squaresoft, actualite, news, nouvelles, solution, soluce, walthrough, guides, faq, astuces, tips, cheats, codes, action, replay, game, shark, quetes, armes, chocobos, objets, discussion, forum, ezboard, avatars, chat, irc, script, livre, or, downloads, fonds, ecran, bureau, wallpapers, skins, winamp, icq, musique, midi, spc, nobuo, uematsu, en, francais, francaises, fr, triple, triad, online, en, ligne, runic, police, font, icones, ecrand, veille, sreensavers, images, videos, str, lecteur, fans, fanarts, fanfics, annuaire, portail, liens, taquin, histoire, historique, phenomene, japon, creation, genese, paroles, lyrics, goodies, pc, playstation, psx, psx2, sony, nintendo, super, famicom, jeux, video, games, top, topjv, classement, sites'> +<meta name="Author" content='Mick'> +<meta name='Identifier-URL' content='http://www.rpgillusion.net'> +<meta name='Reply-to' content='webmaster@rpgillusion.net'> +<meta name='revisit-after' content='1 days'> +<meta name='robots' content='index, follow'> +<meta name='Generator' content='Wordpad'> +<meta name='Copyright' content='RPGillusion'> +<LINK REL="shortcut icon" HREF="../images/site/ico.ico"> + + <script> function opencharpopup(){ var popurl="index.php?do=showchar" @@ -70,21 +34,90 @@ winpops=window.open(popurl,"","width=520,height=520,scrollbars") } </script> </head> -<body><center> -<table cellspacing="0" width="90%"><tr> -<td class="top" colspan="3"> - <table width="100%"><tr><td><img src="images/logo.gif" alt="{{dkgamename}}" title="{{dkgamename}}" border="0" /></td><td style="text-align:right; vertical-align:middle;">{{topnav}}</td></tr></table> +<head> + +<h2 id="up"></h2> + <link title="style" type="text/css" rel="stylesheet" href="style.css"> +</head> +<body topmargin="0" bottommargin="0" style="background-image: url(images/site/fond.gif);"> +<table align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td><a href="index.php" title="Rpg Illusion 1.2c"><img src="images/site/header.jpg" alt="Rpg Illusion 1.2c" border="0"></a></td> + </tr> + </tbody> +</table> +<table valign="top" align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td background="images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top" width="182"> + <table border="0" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td width="184"><img src="images/site/main_nav.jpg" height="22" width="182"></td> + </tr> + <tr> + <td valign="top" width="182"> + <table valign="top" align="center" width="150"> + <tbody> + <tr> + <td> + + <!-- Navigation! --> + + <div id="menu"> </div> + +{{leftnav}} + + +$blocs +Dévelopé par Darkmore +<!-- Fin Navigation! --> + </td> + </tr> + </tbody> + </table> </tr> + </tbody> + </table> </td> + <td background="images/site/contenu_fond.jpg" valign="top"> + <table valign="top" align="center" bgcolor="#cdbca3" cellpadding="0" cellspacing="0"> + <tbody> + </tbody> + </table> + <table valign="top" align="left" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td height="28"><img src="images/site/news_and_content.jpg" alt=""></td> + </tr> + <tr> + <td align="center" valign="top"> + <table valign="top" style="border-style: none solid solid; border-color: rgb(167, 153, 133); border-width: 0px 1px 1px; margin-left: 18px;" bgcolor="#e2d9c7" cellpadding="0" cellspacing="0" width="512"> + <tbody> + <tr> + <td valign="top"><br> + {{content}} +<!-- Fin Parti texte! --> </td> + </tr> + </tbody> + </table> </td> + </tr> + </tbody> + </table> </td> + </tr> + <tr> + <td background="images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top"><img src="images/site/footer_menu.jpg"></td> + <td background="images/site/contenu_fond.jpg" valign="top"><img src="images/site/footer_contenu.jpg"></td> + </tr> + </tbody> + </table> </td> -</tr><tr> -<td class="left">{{leftnav}}</td> -<td class="middle">{{content}}</td> -<td class="right">{{rightnav}}</td> -</tr> -</table><br /> -<table class="copyright" width="90%"><tr> -<td width="25%" align="center">Powered by <a href="http://dragon.se7enet.com/dev.php" target="_new">Dragon Knight</a></td><td width="25%" align="center">© 2003-2004 by renderse7en</td><td width="25%" align="center">{{totaltime}} Seconds, {{numqueries}} Queries</td><td width="25%" align="center">Version {{version}} {{build}}</td> -</tr></table> -</center></body> +</table> +</body> + + + +</body> </html> THEVERYENDOFYOU; + ?> \ No newline at end of file diff --git a/templates/primary_log.php b/templates/primary_log.php @@ -0,0 +1,122 @@ +<?php + +ob_start(); +include './blocs.php'; +$blocs = ob_get_contents(); + ob_end_clean(); + ob_start(); + +$template = <<<THEVERYENDOFYOU +<head> +<title>{{title}}</title> + +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<meta name='Description' content='RPG illusion est un rpg entierement gratuit en php. Téléchargez le pour votre site. Free php online www.rpgillusion.net'> +<meta name='Keywords' content='free, php, free hosting, rpg, free game, rpg online, online, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii, tactics, lengend, mmorg, mystic, free mmorpg, ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8, ff9, ff10, ff11, ff12, film, the, spirits, within, creatures, esprit, square, squaresoft, actualite, news, nouvelles, solution, soluce, walthrough, guides, faq, astuces, tips, cheats, codes, action, replay, game, shark, quetes, armes, chocobos, objets, discussion, forum, ezboard, avatars, chat, irc, script, livre, or, downloads, fonds, ecran, bureau, wallpapers, skins, winamp, icq, musique, midi, spc, nobuo, uematsu, en, francais, francaises, fr, triple, triad, online, en, ligne, runic, police, font, icones, ecrand, veille, sreensavers, images, videos, str, lecteur, fans, fanarts, fanfics, annuaire, portail, liens, taquin, histoire, historique, phenomene, japon, creation, genese, paroles, lyrics, goodies, pc, playstation, psx, psx2, sony, nintendo, super, famicom, jeux, video, games, top, topjv, classement, sites'> +<meta name="Author" content='Mick'> +<meta name='Identifier-URL' content='http://www.rpgillusion.net'> +<meta name='Reply-to' content='webmaster@rpgillusion.net'> +<meta name='revisit-after' content='1 days'> +<meta name='robots' content='index, follow'> +<meta name='Generator' content='Wordpad'> +<meta name='Copyright' content='RPGillusion'> +<LINK REL="shortcut icon" HREF="../images/site/ico.ico"> + + +<script> +function opencharpopup(){ +var popurl="index.php?do=showchar" +winpops=window.open(popurl,"","width=210,height=500,scrollbars") +} +function openmappopup(){ +var popurl="index.php?do=showmap" +winpops=window.open(popurl,"","width=520,height=520,scrollbars") +} +</script> +</head> +<head> +<h2 id="up"></h2> + <link title="style" type="text/css" rel="stylesheet" href="style.css"> +</head> +<body topmargin="0" bottommargin="0" style="background-image: url(images/site/fond.gif);"> +<table align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td><a href="index.php" title="Rpg Illusion 1.2c"><img src="images/site/header.jpg" alt="Rpg Illusion 1.2c" border="0"></a></td> + </tr> + </tbody> +</table> +<table valign="top" align="center" border="0" cellpadding="0" cellspacing="0" width="744"> + <tbody> + <tr> + <td background="images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top" width="182"> + <table border="0" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td width="184"><img src="images/site/main_nav.jpg" height="22" width="182"></td> + </tr> + <tr> + <td valign="top" width="182"> + <table valign="top" align="center" width="150"> + <tbody> + <tr> + <td> + + <!-- Navigation! --> + + <div id="menu"> </div> + +{{leftnav_log}} + + +$blocs +Dévelopé par Darkmore +<!-- Fin Navigation! --> + </td> + </tr> + </tbody> + </table> </tr> + </tbody> + </table> </td> + <td background="images/site/contenu_fond.jpg" valign="top"> + <table valign="top" align="center" bgcolor="#cdbca3" cellpadding="0" cellspacing="0"> + <tbody> + </tbody> + </table> + <table valign="top" align="left" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td height="28"><img src="images/site/news_and_content.jpg" alt=""></td> + </tr> + <tr> + <td align="center" valign="top"> + <table valign="top" style="border-style: none solid solid; border-color: rgb(167, 153, 133); border-width: 0px 1px 1px; margin-left: 18px;" bgcolor="#e2d9c7" cellpadding="0" cellspacing="0" width="512"> + <tbody> + <tr> + <td valign="top"><br> + {{content}} +<!-- Fin Parti texte! --> </td> + </tr> + </tbody> + </table> </td> + </tr> + </tbody> + </table> </td> + </tr> + <tr> + <td background="images/site/menu_fond.jpg" bgcolor="#cdbca3" valign="top"><img src="images/site/footer_menu.jpg"></td> + <td background="images/site/contenu_fond.jpg" valign="top"><img src="images/site/footer_contenu.jpg"></td> + </tr> + </tbody> + </table> +</td> +</table> +</body> + + + +</body> +</html> +THEVERYENDOFYOU; + +?> +\ No newline at end of file diff --git a/templates/register.php b/templates/register.php @@ -1,18 +1,25 @@ -<?php -$template = <<<THEVERYENDOFYOU -<form action="users.php?do=register" method="post"> -<table width="80%"> -<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /><br />Usernames must be 30 alphanumeric characters or less.<br /><br /><br /></td></tr> -<tr><td>Password:</td><td><input type="password" name="password1" size="30" maxlength="10" /></td></tr> -<tr><td>Verify Password:</td><td><input type="password" name="password2" size="30" maxlength="10" /><br />Passwords must be 10 alphanumeric characters or less.<br /><br /><br /></td></tr> -<tr><td>Email Address:</td><td><input type="text" name="email1" size="30" maxlength="100" /></td></tr> -<tr><td>Verify Email:</td><td><input type="text" name="email2" size="30" maxlength="100" />{{verifytext}}<br /><br /><br /></td></tr> -<tr><td>Character Name:</td><td><input type="text" name="charname" size="30" maxlength="30" /></td></tr> -<tr><td>Character Class:</td><td><select name="charclass"><option value="1">{{class1name}}</option><option value="2">{{class2name}}</option><option value="3">{{class3name}}</option></select></td></tr> -<tr><td>Difficulty:</td><td><select name="difficulty"><option value="1">{{diff1name}}</option><option value="2">{{diff2name}}</option><option value="3">{{diff3name}}</option></select></td></tr> -<tr><td colspan="2">See <a href="help.php">Help</a> for more information about character classes and difficulty levels.<br /><br /></td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr> -</table> -</form> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<form enctype="multipart/form-data" action="users.php?do=register" method="post"> +<table width="80%"> +<tr><td width="20%">ID:</td><td><input type="text" name="username" size="30" maxlength="30" /><br />Votre ID ne doit pas faire plus de 30 caractères alphanumériques.<br /><br /><br /></td></tr> +<tr><td>PW:</td><td><input type="password" name="password1" size="30" maxlength="10" /></td></tr> +<tr><td>Retaper PW:</td><td><input type="password" name="password2" size="30" maxlength="10" /><br />Votre PW ne doit pas faire plus de 30 caractères alphanumériques.<br /><br /><br /></td></tr> +<tr><td>Adresse Email:</td><td><input type="text" name="email1" size="30" maxlength="100" /></td></tr> +<tr><td>Retapez Email:</td><td><input type="text" name="email2" size="30" maxlength="100" />{{verifytext}}<br /><br /><br /></td></tr> +<tr><td>Nom du perso:</td><td><input type="text" name="charname" size="30" maxlength="30" /></td></tr> +<tr><td>Age du perso:</td><td><input type="text" name="age" size="30" maxlength="10" /></td></tr> +<tr><td>Avatar du perso:</td><td><select name="avatar" ><option value="num-1.gif">numéro 1</option><option value="num-2.gif">numéro 2</option><option value="num-3.gif">numéro 3</option><option value="num-4.gif">numéro 4</option><option value="num-5.gif">numéro 5</option><option value="num-6.gif">numéro 6</option><option value="num-7.gif">numéro 7</option><option value="num-8.gif">numéro 8</option><option value="num-9.gif">numéro 9</option><option value="num-10.gif">numéro 10</option> +<option value="num-11.gif">numéro 11</option><option value="num-12.gif">numéro 12</option><option value="num-13.gif">numéro 13</option><option value="num-14.gif">numéro 14</option><option value="num-15.gif">numéro 15</option><option value="num-16.gif">numéro 16</option><option value="num-17.gif">numéro 17</option><option value="num-18.gif">numéro 18</option><option value="num-19.gif">numéro 19</option><option value="num-20.gif">numéro 20</option> +<option value="num-21.gif">numéro 21</option><option value="num-22.gif">numéro 22</option><option value="num-23.gif">numéro 23</option><option value="num-24.gif">numéro 24</option><option value="num-25.gif">numéro 25</option><option value="num-26.gif">numéro 26</option><option value="num-27.gif">numéro 27</option><option value="num-28.gif">numéro 28</option><option value="num-29.gif">numéro 29</option> +<option value="num-30.gif">numéro 30</option></select></td><td></td></tr> +<tr><td colspan="2">Pour voir tous les avatars <A HREF="#" onClick="window.open('avatar.php','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=400, height=565');return(false)">cliquez ici.</A><br /></td></tr> +<tr><td>Classe du perso:</td><td><select name="charclass"><option value="1">{{class1name}}</option><option value="2">{{class2name}}</option><option value="3">{{class3name}}</option></select></td></tr> +<tr><td>Difficulté:</td><td><select name="difficulty"><option value="1">{{diff1name}}</option><option value="2">{{diff2name}}</option><option value="3">{{diff3name}}</option></select></td></tr> +<tr><td>Parain:</td><td><input type="text" name="parain" size="30" maxlength="100" /><br /><br /><br /></td></tr> +<tr><td colspan="2">Voir la rubrique <a href="guide.php?do=login">Guide</a> pour avoir plus d'informations sur les personnages, les classes et les niveaux de difficulté.<br /><br /></td></tr> +<tr><td colspan="2"><input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /></td></tr> +</table> +</form> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/rightnav.php b/templates/rightnav.php @@ -1,39 +1,39 @@ -<?php -$template = <<<THEVERYENDOFYOU -<table width="100%"> -<tr><td class="title"><img src="images/button_character.gif" alt="Character" title="Character" /></td></tr> -<tr><td> -<b>{{charname}}</b><br /> -Level: {{level}}<br /> -Exp: {{experience}}<br /> -Gold: {{gold}}<br /> -HP: {{currenthp}}<br /> -MP: {{currentmp}}<br /> -TP: {{currenttp}}<br /> -{{statbars}}<br /> -<a href="javascript:opencharpopup()">Extended Stats</a> -</td></tr> -</table><br /> - -<table width="100%"> -<tr><td class="title"><img src="images/button_inventory.gif" alt="Inventory" title="Inventory" /></td></tr> -<tr><td> -<table width="100%"> -<tr><td><img src="images/icon_weapon.gif" alt="Weapon" title="Weapon" /></td><td width="100%">Weapon: {{weaponname}}</td></tr> -<tr><td><img src="images/icon_armor.gif" alt="Armor" title="Armor" /></td><td width="100%">Armor: {{armorname}}</td></tr> -<tr><td><img src="images/icon_shield.gif" alt="Shield" title="Shield" /></td><td width="100%">Shield: {{shieldname}}</td></tr> -</table> -Slot 1: {{slot1name}}<br /> -Slot 2: {{slot2name}}<br /> -Slot 3: {{slot3name}} -</td></tr> -</table><br /> - -<table width="100%"> -<tr><td class="title"><img src="images/button_fastspells.gif" alt="Fast Spells" title="Fast Spells" /></td></tr> -<tr><td> -{{magiclist}} -</td></tr> -</table><br /> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<table width="205px" height="60px" background="././images/bg7.gif"> +<tr><td class=""></td></tr></table> +<table width="205px" height="287px" background="././images/bg8.gif"><tr><td> +<b>{{charname}}</b><br /> +Niveau: {{level}}<br /> +Exp: {{experience}}<br /> +Gils: {{gold}}<br /> +HP: {{currenthp}}<br /> +MP: {{currentmp}}<br /> +TP: {{currenttp}}<br /> +{{statbars}}<br /> +<img src="././images/pic.gif"/><a href="javascript:opencharpopup()"> Stats détaillés</a> +</td></tr> +</table><br /> + +<table width="205px" height="56px" background="././images/bg9.gif"> +<tr><td></td></tr></table> +<table width="205px" height="100%" background="././images/bg9-b.gif"><tr><td> +<td width="205px"><img src="././images/pic.gif"><a href=index.php?do=sacados> Sac a Dos</a><br> +<tr><td><img src="images/icon_weapon.gif" alt="Arme" title="Weapon" /></td><td width="205px">Arme: {{weaponname}}</td></tr> +<tr><td><img src="images/icon_armor.gif" alt="Armure" title="Armor" /></td><td width="205px">Armure: {{armorname}}</td></tr> +<tr><td><img src="images/icon_shield.gif" alt="Protection" title="Shield" /></td><td width="205px">Protection: {{shieldname}}</td></tr></table> +<table width="205px" height="73px" background="././images/bg9-c.gif"><tr><td> +Fente 1: {{slot1name}}<br> +Fente 2: {{slot2name}}<br> +Fente 3: {{slot3name}} +</tr></td> +</table> + +<table width="205px" height="54px" background="././images/bg11.gif"> +<tr><td class="title"></td></tr></table> +<table width="205px" height="74px" background="././images/bg12.gif"><tr><td> +{{magiclist}} +</td></tr> +</table><br /> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/showchar.php b/templates/showchar.php @@ -1,47 +1,48 @@ -<?php -$template = <<<THEVERYENDOFYOU -<table width="100%"> -<tr><td class="title"><img src="images/button_character.gif" alt="Character" title="Character" /></td></tr> -<tr><td> -<b>{{charname}}</b><br /><br /> - -Difficulty: {{difficulty}}<br /> -Class: {{charclass}}<br /><br /> - -Level: {{level}}<br /> -Experience: {{experience}} {{plusexp}}<br /> -Next Level: {{nextlevel}}<br /> -Gold: {{gold}} {{plusgold}}<br /> -Hit Points: {{currenthp}} / {{maxhp}}<br /> -Magic Points: {{currentmp}} / {{maxmp}}<br /> -Travel Points: {{currenttp}} / {{maxtp}}<br /><br /> - -Strength: {{strength}}<br /> -Dexterity: {{dexterity}}<br /> -Attack Power: {{attackpower}}<br /> -Defense Power: {{defensepower}}<br /> -</td></tr> -</table><br /> - -<table width="100%"> -<tr><td class="title"><img src="images/button_inventory.gif" alt="Inventory" title="Inventory" /></td></tr> -<tr><td> -<table width="100%"> -<tr><td><img src="images/icon_weapon.gif" alt="Weapon" title="Weapon" /></td><td width="100%">Weapon: {{weaponname}}</td></tr> -<tr><td><img src="images/icon_armor.gif" alt="Armor" title="Armor" /></td><td width="100%">Armor: {{armorname}}</td></tr> -<tr><td><img src="images/icon_shield.gif" alt="Shield" title="Shield" /></td><td width="100%">Shield: {{shieldname}}</td></tr> -</table> -Slot 1: {{slot1name}}<br /> -Slot 2: {{slot2name}}<br /> -Slot 3: {{slot3name}} -</td></tr> -</table><br /> - -<table width="100%"> -<tr><td class="title"><img src="images/button_spells.gif" alt="Spells" title="Spells" /></td></tr> -<tr><td> -{{magiclist}} -</td></tr> -</table><br /> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<table width="100%"> +<tr><td class="title"><img src="images/button_character.gif" alt="Personnage" title="Personnage" /></td></tr> +<tr><td> +<b>{{charname}}</b><br /><br /> +<img src="././images/avatar/{{avatar}}" width="71" height="66"><br /><br /> + +Difficulté: {{difficulty}}<br /> +Classe: {{charclass}}<br /><br /> + +Niveau: {{level}}<br /> +Experience: {{experience}} {{plusexp}}<br /> +Prochain niveau: {{nextlevel}}<br /> +Gils: {{gold}} {{plusgold}}<br /> +Points hit: {{currenthp}} / {{maxhp}}<br /> +Points de magies: {{currentmp}} / {{maxmp}}<br /> +Points de voyages: {{currenttp}} / {{maxtp}}<br /><br /> + +Force: {{strength}}<br /> +Dextérité: {{dexterity}}<br /> +Pouvoir d'attaque: {{attackpower}}<br /> +Pouvoir de défense: {{defensepower}}<br /> +</td></tr> +</table><br /> + +<table width="100%"> +<tr><td class="title"><img src="images/button_inventory.gif" alt="Inventaire" title="Inventaire" /></td></tr> +<tr><td> +<table width="100%"> +<tr><td><img src="images/icon_weapon.gif" alt="Arme" title="Weapon" /></td><td width="100%">Arme: {{weaponname}}</td></tr> +<tr><td><img src="images/icon_armor.gif" alt="Armure" title="Armor" /></td><td width="100%">Armure: {{armorname}}</td></tr> +<tr><td><img src="images/icon_shield.gif" alt="Protection" title="Shield" /></td><td width="100%">Protection: {{shieldname}}</td></tr> +</table> +Fente 1: {{slot1name}}<br /> +Fente 2: {{slot2name}}<br /> +Fente 3: {{slot3name}} +</td></tr> +</table><br /> + +<table width="100%"> +<tr><td class="title"><img src="images/button_spells.gif" alt="Sorts" title="Spells" /></td></tr> +<tr><td> +{{magiclist}} +</td></tr> +</table><br /> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/templates/towns.php b/templates/towns.php @@ -1,26 +1,42 @@ -<?php -$template = <<<THEVERYENDOFYOU -<table width="100%"> -<tr><td class="title"><img src="images/town_{{id}}.gif" alt="Welcome to {{name}}" title="Welcome to {{name}}" /></td></tr> -<tr><td> -<b>Town Options:</b><br /> -<ul> -<li /><a href="index.php?do=inn">Rest at the Inn</a> -<li /><a href="index.php?do=buy">Buy Weapons/Armor</a> -<li /><a href="index.php?do=maps">Buy Maps</a> -</ul> -</td></tr> -<tr><td><center> -{{news}} -<br /> -<table width="95%"> -<tr><td width="50%"> -{{whosonline}} -</td><td> -{{babblebox}} -</td></tr> -</table> -</td></tr> -</table> -THEVERYENDOFYOU; -?> -\ No newline at end of file +<?php +$template = <<<THEVERYENDOFYOU +<table width="100%"> +<tr><td class="title"><img src="images/ville/town_{{id}}.gif" alt="Bienvenue à {{name}}" title="Bienvenue à {{name}}" /></td></tr> +<tr><td> +<table width="75%"> +<tr><td width="50%"> +<img src="images/ville/ville_{{id}}.jpg" height=220></td><td> +<b><img src="././images/ville/options_villes.gif" /></b><br /> +<img src="././images/site/pic2.gif" /><a href="index.php?do=inn"> Se reposer à l'auberge</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=bank"> Passer à la Banque</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=buy"> Acheter amures/armes</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=service"> Services allopass</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=maps"> Acheter cartes</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=home"> Créer sa maison</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=train"> S'entraîner</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=kamp"> QG de votre Clan</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=teekamp"> Créer un Clan</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=marche"> Allez au Marché</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=revente"> Vendre votre minerais</a> <br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=pretre"> Allez à l'église</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=enchanteur"> Allez chez la magicienne</a> <br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=metier"> ANPE</a> <br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=mag"> Achetez des sort</a><br> +<img src="././images/site/pic2.gif" /><a href="index.php?do=affaire"> Bureau des Affaires</a><br> +<img src="././images/site/pic2.gif" /> <a href="index.php?do=afficheencheres">Salle d'enchère</a><br> +</td></tr> +</table> +<tr><td><center> +{{news}} +<br /> +<table width="95%"> +<tr><td width="50%"> +{{babblebox}} +</td><td> +{{whosonline}} +</td></tr> +</table> +</td></tr> +</table> +THEVERYENDOFYOU; +?> diff --git a/templates/verify.php b/templates/verify.php @@ -1,14 +1,13 @@ -<?php -$template = <<<THEVERYENDOFYOU -<form action="users.php?do=verify" method="post"> -<table width="80%"> -<tr><td colspan="2">Thank you for registering a character. Please enter your username, email address, and the verification code -that was emailed to you to unlock your character.</td></tr> -<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr> -<tr><td>Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr> -<tr><td>Verification Code:</td><td><input type="text" name="verify" size="10" maxlength="8" /><br /><br /><br /></td></tr> -<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr> -</table> -</form> -THEVERYENDOFYOU; +<?php +$template = <<<THEVERYENDOFYOU +<form action="users.php?do=verify" method="post"> +<table width="80%"> +<tr><td colspan="2">Merci de votre inscription. Maintenant veuillez inscrire votre id, adresse email, et le code de validation présent dans l'email que nous vous avons envoyé.</td></tr> +<tr><td width="20%">ID:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr> +<tr><td>Adresse Email:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr> +<tr><td>Code de Validation:</td><td><input type="text" name="verify" size="10" maxlength="8" /><br /><br /><br /></td></tr> +<tr><td colspan="2"><input type="submit" name="submit" value="Valider" /> <input type="reset" name="reset" value="Annuler" /></td></tr> +</table> +</form> +THEVERYENDOFYOU; ?> \ No newline at end of file diff --git a/towns.php b/towns.php @@ -1,375 +1,1319 @@ -<?php // towns.php :: Handles all actions you can do in town. - -function inn() { // Staying at the inn resets all expendable stats to their max values. - - global $userrow, $numqueries; - - $townquery = doquery("SELECT name,innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); +<?php // towns.php :: Handles all actions you can do in town. + +function service() { // Modules service allopass officiel ! - if ($userrow["gold"] < $townrow["innprice"]) { display("You do not have enough gold to stay at this Inn tonight.<br /><br />You may return to <a href=\"index.php\">town</a>, or use the direction buttons on the left to start exploring.", "Inn"); die(); } - - if (isset($_POST["submit"])) { - - $newgold = $userrow["gold"] - $townrow["innprice"]; - $query = doquery("UPDATE {{table}} SET gold='$newgold',currenthp='".$userrow["maxhp"]."',currentmp='".$userrow["maxmp"]."',currenttp='".$userrow["maxtp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $title = "Inn"; - $page = "You wake up feeling refreshed and ready for action.<br /><br />You may return to <a href=\"index.php\">town</a>, or use the direction buttons on the left to start exploring."; - - } elseif (isset($_POST["cancel"])) { - - header("Location: index.php"); die(); - - } else { - - $title = "Inn"; - $page = "Resting at the inn will refill your current HP, MP, and TP to their maximum levels.<br /><br />\n"; - $page .= "A night's sleep at this Inn will cost you <b>" . $townrow["innprice"] . " gold</b>. Is that ok?<br /><br />\n"; - $page .= "<form action=\"index.php?do=inn\" method=\"post\">\n"; - $page .= "<input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" />\n"; - $page .= "</form>\n"; - - } + global $userrow, $numqueries; - display($page, $title); + $townquery = doquery("SELECT name,chiffreptlevel, codeptlevel, chiffrexp, codexp, chiffrebanque, codebanque, chiffreniveau, codeniveau, interets, innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br>"; + $page .= "<table width=\"490\"><tr><td>Bienvenue dans la rubrique des cheats. Ici vous allez pouvoir améliorer votre personnage via un simple appel téléphonique.<br>Voici les étapes à suivre:<br><br>1- Appelez le 08 97 12 59 39<br>2- Ecoutez et marquez (pour ne pas l'oublier) le code que l'on vous donnera<br>3- Enfin entrez le code que l'on vous a donné, dans le cheat que vous désirez activer<br><br><br></td></tr></table>"; + $page .= "<table width=\"490\"><tr><td><b>» Recevoir " .$townrow["chiffrebanque"] ." ".$townrow3["monnaie"]." du banquier:</b><br><br>Le banquier est de très bonne humeur ces jours ci. Il a l'intention de vous offrir <b>" .$townrow["chiffrebanque"] ." ".$townrow3["monnaie"]."</b>. <br>Pour les recevoir entrer le code ci dessous:<br><br>"; + $page .= "<font color=\"cc0000\">" .$townrow["codebanque"] ."</font></td></tr></table><br><br>"; + $page .= "<table width=\"490\"><tr><td><b>» Augmenter de " .$townrow["chiffreniveau"] ." niveaux le personnage:</b><br><br>Vous pouvez faire gagner à votre personnage <b>" .$townrow["chiffreniveau"] ." niveaux</b>. Pour cela entrez le code ci dessous:<br><br>"; + $page .= "<font color=\"cc0000\">" .$townrow["codeniveau"] ."</font></td></tr></table>"; + $page .= "<p><table width=\"490\"><tr><td><b>» Augmenter de " .$townrow["chiffrexp"] ." xp le personnage:</b><br><br>Vous pouvez faire gagner à votre personnage <b>" .$townrow["chiffrexp"] ." xp</b>. Pour cela entrez le code ci dessous:<br><br>"; + $page .= "<font color=\"cc0000\">" .$townrow["codexp"] ."</font></td></tr></table>"; + $page .= "<p><table width=\"490\"><tr><td><b>» Augmenter de " .$townrow["chiffreptlevel"] ." pointniveaux le personnage:</b><br><br>Vous pouvez faire gagner à votre personnage <b>" .$townrow["chiffreptlevel"] ." pointniveaux</b>. Pour cela entrez le code ci dessous:<br><br>"; + $page .= "<font color=\"cc0000\">" .$townrow["codeptlevel"] ."</font></td></tr></table>"; + $page .= "<br><br><a href=\"index.php\">» Retour au sommaire de la ville</a>"; + + + display($page, "Les cheats"); +} + +function cheatniveau() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT level,id FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + $townquery2 = doquery("SELECT name,innprice, chiffreniveau FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townrow2 = mysql_fetch_array($townquery2); + + if (isset($_POST["submit"])) { + if ($userrow["currentaction"] == "En ville" ) { + + + $newlevel = $userrow["level"] + $townrow2["chiffreniveau"]; + $query = doquery("UPDATE {{table}} SET level='$newlevel' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $title = "Bravo"; + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Bravo, vous venez de recevoir vos ".$townrow3["monnaie"]."<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>"; + } else {display("<table width=\"490\"><tr><td>C'est pas bien de vouloir tricher<br><br><br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>", "Auberge"); die(); } + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Validez votre code"; + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Votre code a été validé avec succès!<br><br>Pour augmenter votre personnage de <b>" .$townrow2["chiffreniveau"] ." niveaux</b> vous devez accepter. Dans le cas contraire cliquez sur refuser.</td></tr></table><br><br>\n"; + $page .= "<form action=\"index.php?do=cheatniveau\" method=\"post\">\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Accepter\" /> <input type=\"submit\" name=\"cancel\" value=\"Refuser\" />\n"; + $page .= "</form>\n"; + + } + + display($page, $title); + + } + + function cheatptlevel() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT pointlvl,id FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + $townquery2 = doquery("SELECT name,innprice, chiffreptlevel FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townrow2 = mysql_fetch_array($townquery2); + + if (isset($_POST["submit"])) { + if ($userrow["currentaction"] == "En ville" ) { + + + $newlevel = $userrow["pointlvl"] + $townrow2["chiffreptlevel"]; + $query = doquery("UPDATE {{table}} SET pointlvl='$newlevel' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $title = "Bravo"; + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Bravo, vous venez de recevoir vos pointlevel<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>"; + } else {display("<table width=\"490\"><tr><td>C'est pas bien de vouloir tricher<br><br><br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>", "Auberge"); die(); } + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Validez votre code"; + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Votre code a été validé avec succès!<br><br>Pour augmenter votre personnage de <b>" .$townrow2["chiffreptlevel"] ." point perso</b> vous devez accepter. Dans le cas contraire cliquez sur refuser.</td></tr></table><br><br>\n"; + $page .= "<form action=\"index.php?do=cheatptlevel\" method=\"post\">\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Accepter\" /> <input type=\"submit\" name=\"cancel\" value=\"Refuser\" />\n"; + $page .= "</form>\n"; + + } + + display($page, $title); + + } + + function cheatxp() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT experience,id FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + $townquery2 = doquery("SELECT name,innprice, chiffrexp FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townrow2 = mysql_fetch_array($townquery2); + + if (isset($_POST["submit"])) { + if ($userrow["currentaction"] == "En ville" ) { + + + $newlevel = $userrow["experience"] + $townrow2["chiffrexp"]; + $query = doquery("UPDATE {{table}} SET experience='$newlevel' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $title = "Bravo"; + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Bravo, vous venez de recevoir vos xp<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>"; + } else {display("<table width=\"490\"><tr><td>C'est pas bien de vouloir tricher<br><br><br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>", "Auberge"); die(); } + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Validez votre code"; + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Votre code a été validé avec succès!<br><br>Pour augmenter votre personnage de <b>" .$townrow2["chiffrexp"] ." xp</b> vous devez accepter. Dans le cas contraire cliquez sur refuser.</td></tr></table><br><br>\n"; + $page .= "<form action=\"index.php?do=cheatxp\" method=\"post\">\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Accepter\" /> <input type=\"submit\" name=\"cancel\" value=\"Refuser\" />\n"; + $page .= "</form>\n"; + + } + + display($page, $title); + + } + +function cheatbanque() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT gold,id FROM {{table}} WHERE id='$id' LIMIT 1", "users"); + $townquery2 = doquery("SELECT name,innprice, chiffrebanque FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townrow2 = mysql_fetch_array($townquery2); + + if (isset($_POST["submit"])) { + if ($userrow["currentaction"] == "En ville" ) { + + + $newbank = $userrow["bank"] + $townrow2["chiffrebanque"]; + $query = doquery("UPDATE {{table}} SET bank='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $title = "Bravo"; + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Bravo, vous venez de recevoir vos ".$townrow3["monnaie"]."<br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>"; + } else {display("<table width=\"490\"><tr><td>C'est pas bien de vouloir tricher<br><br><br><br>Maintenant vous pouvez:<br><br><a href=\"index.php\">» retourner au sommaire de la ville</a></td></tr></table>", "Auberge"); die(); } + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Validez votre code"; + + $page = "<table height=\"1\"><tr><td><img src=\"images/allopass.jpg\"/></td></tr></table><br><table width=\"490\"><tr><td>Votre code a été validé avec succès!<br><br>Pour obtenir vos <b>" .$townrow2["chiffrebanque"] ." ".$townrow3["monnaie"]."</b> vous devez accepter le don du banquier. Dans le cas contraire cliquez sur refuser.</td></tr></table><br><br>\n"; + $page .= "<form action=\"index.php?do=cheatbanque\" method=\"post\">\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Accepter\" /> <input type=\"submit\" name=\"cancel\" value=\"Refuser\" />\n"; + $page .= "</form>\n"; + + } + + display($page, $title); + + } + + function bank() { // system de gestion de compte simple, retrait, depots. + + global $userrow, $numqueries; + $townquery = doquery("SELECT name,innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + if (mysql_num_rows($townquery) != 1) { display("Tentative de Triche detectée.<br /><br />Bannissement proche , attention.<br /><br />", "Error"); } + + if (isset($_POST['bank'])) { + $title = "Bank"; + + if ($_POST['withdraw']) { + if ($_POST['withdraw'] <= 0) + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><img src=\"images/gold.gif\" alt=\"banque\" /><center><img src=\"images/gold.jpg\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier4.gif\" alt=\"Banquier\" /></center><br><center> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + elseif ($_POST['withdraw'] > $userrow['bank']) + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><img src=\"images/gold.gif\" alt=\"banque\" /><center><img src=\"images/gold.jpg\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier4.gif\" alt=\"Banquier\" /></center><br><center> Vous n'avez pas autant sur votre compte!<br>Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + else { + $newgold = $userrow['gold'] + $_POST['withdraw']; + $newbank = $userrow['bank'] - $_POST['withdraw']; + doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + doquery("UPDATE {{table}} SET bank='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><center><img src=\"images/gold.jpg\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier2.gif\" alt=\"Banquier\" /></center><br><center> Vous retirez $_POST[withdraw] ".$townrow3["monnaie"]." de votre compte!"; + $page .="Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + } + + } elseif ($_POST['deposit']) { + if ($_POST['deposit'] <= 0) + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><center><img src=\"images/gold.gif\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier4.gif\" alt=\"Banquier\" /></center><br><center> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + elseif ($_POST['deposit'] > $userrow['gold']) + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><center><img src=\"images/gold.gif\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier4.gif\" alt=\"Banquier\" /></center><br><center> Vous ne possédez pas autant ".$townrow3["monnaie"]." sur vous!<br>Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + else { + $newgold = $userrow['gold'] - $_POST['deposit']; + $newbank = $userrow['bank'] + $_POST['deposit']; + doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + doquery("UPDATE {{table}} SET bank='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $page = "<bgsound src=\"music/026-Town04.mid\" loop=10><center><img src=\"images/gold.gif\" alt=\"banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier3.gif\" alt=\"Banquier\" /></center><br><center> Vous déposez $_POST[deposit] ".$townrow3["monnaie"]." sur votre compte!"; + $page .="Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=bank\">Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + } + } + } else { + $title = "Banque"; + $page = "<bgsound src=\"musiques/026-Town04.mid\" loop=10><center><img src=\"images/gold.gif\" alt=\"Banque\" /></center><br><br><br><center><img src=\"images/personnages/banquier.gif\" alt=\"Banquier\" /></center><br />"; + $page .= "<center>Vous possedez $userrow[bank] ".$townrow3["monnaie"]." sur votre compte."; + $page .= "<form action=index.php?do=bank method=post><br />"; + $page .= "Deposer :<input type=text name=deposit><br />"; + $page .= "Retirer :<input type=text name=withdraw><br />"; + $page .= "<input type=submit value=Valider name=bank></form><br>"; + $page .= "<br>Vous pouvez aussi déposer des objets dans <a href='index.php?do=stockobjets'>les coffres de la banque</a>, <a href='index.php?do=sendgold'>Envoyé de l'argent</a>,<a href='index.php?do=sendeat'>Envoyé des pommes</a>,<a href='index.php?do=sendpotion'>Envoyé Potion</a> ou retourner en <a href=\"index.php\">Ville</a>, Ou utiliser le menu de gauche pour repartir en exploration.</center>"; + } + + display($page, $title); + +} + + + + + +function inn() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT name,innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + if ($userrow["gold"] < $townrow["innprice"]) { display("<center><img src=\"././/images/aub.gif\"/></center><br> Vous n'avez pas assez de ".$townrow3["monnaie"]." pour dormir dans cette auberge ce soir.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Auberge"); die(); } + + if (isset($_POST["submit"])) { + if ($userrow["currentaction"] == "En ville" ) { + + + $newgold = $userrow["gold"] - $townrow["innprice"]; + $query = doquery("UPDATE {{table}} SET gold='$newgold',currenthp='".$userrow["maxhp"]."',currentmp='".$userrow["maxmp"]."',currenttp='".$userrow["maxtp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $title = "Auberge"; + $page = "<img src=\"././/images/aub.gif\"/><br>Vous vous êtes réveillé avec le sentiment d'être régénéré. Vous êtes prêt pour le combat! <br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde."; + } else {display("C'est pas bien de vouloir tricher<br /><br />Utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Auberge"); die(); } + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Auberge"; + $page = "<img src=\"././/images/aub.gif\"/><br>Le repos à l'auberge remplira vos barres de HP, MP, et TP à leurs niveaux maximum.<br /><br />\n"; + $page .= "Une nuit dans cette auberge vous coûtera <b>" . $townrow["innprice"] . " ".$townrow3["monnaie"]."</b>. Est ce que vous acceptez?<br /><br />\n"; + $page .= "<form action=\"index.php?do=inn\" method=\"post\">\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" />\n"; + $page .= "</form>\n"; + $page .= "<br><center><img src=\"././images/auberge.gif\"/></center>\n"; + } + + display($page, $title); + + } + + +function home() { // Staying at the inn resets all expendable stats to their max values. + + global $userrow, $numqueries; + $townquery = doquery("SELECT name,homeprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + if ($userrow["gold"] < $townrow["homeprice"]) { display("<center><img src=\"images/nomaison.jpg\"/></center><br> Vous n'avez pas assez de ".$townrow3["monnaie"]." pour créer cette maison.<br />Il faut impérativement " . $townrow["homeprice"] . " ".$townrow3["monnaie"]." pour en créer une.<br><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Créer une maison"); die(); } + + + if (isset($_POST["submit"])) { + + extract($_POST); + $errors = 0; + $errorlist = ""; + if ($name == "") { $errors++; $errorlist .= "Le nom est obligatoire.<br />"; } + if ($longitude == "") { $errors++; $errorlist .= "La latitude est obligatoire.<br />"; } + if ($latitude == "") { $errors++; $errorlist .= "La longitude est obligatoire.<br />"; } + + + + if ($errors == 0) { + + $newgold = $userrow["gold"] - $townrow["homeprice"]; + $query = doquery("UPDATE {{table}} SET gold='$newgold' LIMIT 1", "users"); + $query = doquery("INSERT INTO {{table}} SET id='',name='$name',buvette='$buvette',innprice='$innprice',msg='$msg',longitude='$longitude',latitude='$latitude'", "maison"); + $title = "Auberge"; + } $page = "Votre maison à été crée avec succès! <br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde."; + + } elseif (isset($_POST["cancel"])) { + + header("Location: index.php"); die(); + + } else { + + $title = "Créer sa maison"; + $page = "Ici vous avez la possiblité de créer votre propre maison pour " . $townrow["homeprice"] . " ".$townrow3["monnaie"]." et de gagner grace à elle des ".$townrow3["monnaie"]."<BR><br />\n"; + $page .= "<form action=\"index.php?do=home\" method=\"post\">\n"; + $page .= "Votre pseudo: <input type=\"text\" name=\"name\" size=\"12\"><br />\n"; + $page .= "Cout de la chambre: <input type=\"text\" name=\"innprice\" size=\"2\"><br />\n"; + $page .= "Cout de la buvette: <input type=\"text\" name=\"buvette\" size=\"2\"><br />\n"; + $page .= "Latitude choisie: <input type=\"text\" name=\"latitude\" size=\"4\"><br />\n"; + $page .= "Longitude choisie: <input type=\"text\" name=\"longitude\" size=\"4\"><br />\n"; + $page .= "Cout d'un entrainement chez vous: <input type=\"text\" name=\"training\" size=\"2\"><br />\n"; + $page .= "<input type=\"submit\" name=\"submit\" value=\"Créer\"><input type=\"submit\" name=\"reset\" value=\"Annuler\"></form>\n"; + + } + + display($page, $title); + +} + +function buy() { // Displays a list of available items for purchase. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT name,itemslist FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + $itemslist = explode(",",$townrow["itemslist"]); + $querystring = ""; + foreach($itemslist as $a=>$b) { + $querystring .= "id='$b' OR "; + } + $querystring = rtrim($querystring, " OR "); + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE $querystring ORDER BY id", "items"); + $page = "<img src=\"././images/shop.gif\"/><br>En achetant des armes, vous augmenterez votre pouvoir d'attaque et lorsque vous acheterez des armures ou des protections vous augmenterez votre pouvoir de défense.<br /><br />Cliquez sur le nom d'un objet pour l'acheter.<br /><br />Les objets suivants sont disponibles dans cette ville:<br /><br />\n"; + $page .= "<table width=\"80%\">\n"; + while ($itemsrow = mysql_fetch_array($itemsquery)) { + if ($itemsrow["type"] == 1) { $attrib = "Pouvoir d'attaque:"; } else { $attrib = "Pouvoir de défense:"; } + $page .= "<tr><td width=\"4%\">"; + if ($itemsrow["type"] == 1) { $page .= "<img src=\"images/icon_weapon.gif\" alt=\"arme\" /></td>"; } + if ($itemsrow["type"] == 2) { $page .= "<img src=\"images/icon_armor.gif\" alt=\"armure\" /></td>"; } + if ($itemsrow["type"] == 3) { $page .= "<img src=\"images/icon_shield.gif\" alt=\"protection\" /></td>"; } + if ($userrow["weaponid"] == $itemsrow["id"] || $userrow["armorid"] == $itemsrow["id"] || $userrow["shieldid"] == $itemsrow["id"]) { + $page .= "<td width=\"32%\"><span class=\"light\">".$itemsrow["name"]."</span></td><td width=\"32%\"><span class=\"light\">$attrib ".$itemsrow["attribute"]."</span></td><td width=\"32%\"><span class=\"light\">Déjà acheté</span></td></tr>\n"; + } else { + if ($itemsrow["special"] != "Aucun") { $specialdot = "<span class=\"highlight\">*</span>"; } else { $specialdot = ""; } + $page .= "<td width=\"32%\"><b><a href=\"index.php?do=buy2:".$itemsrow["id"]."\">".$itemsrow["name"]."</a>$specialdot</b></td><td width=\"32%\">$attrib <b>".$itemsrow["attribute"]."</b></td><td width=\"32%\">Prix: <b>".$itemsrow["buycost"]." ".$townrow3["monnaie"]."</b></td></tr><tr><br><td colspan=4><b>Description: </b>".$itemsrow["description"]."</td></tr>\n"; } + } + $page .= "</table><br />\n"; + $page .= "Si vous avez changé d'avis, vous pouvez également <a href=\"index.php\">retourner à la ville</a>.\n"; + $title = "Acheter des objets"; + + display($page, $title); + +} + +function buy2($id) { // Confirm user's intent to purchase item. + + global $userrow, $numqueries; + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); + $itemsrow = mysql_fetch_array($itemsquery); + + if ($userrow["gold"] < $itemsrow["buycost"]) { display("<img src=\"././images/shop.gif\"/><br>Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter cet objet.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=buy\">au magasin</a>, ou utilisez les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter objets"); die(); } + + if ($itemsrow["type"] == 1) { + if ($userrow["weaponid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["weaponid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + $page = "<img src=\"././images/shop.gif\"/><br>Si vous achetez le ".$itemsrow["name"].", alors j'achèterai le votre ".$itemsrow2["name"]." pour ".ceil($itemsrow2["buycost"]/2)." ".$townrow3["monnaie"].". Vous êtes d'accord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } else { + $page = "<img src=\"././images/shop.gif\"/><br>Vous allez acheter ".$itemsrow["name"].", vous êtes d'accord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } + } elseif ($itemsrow["type"] == 2) { + if ($userrow["armorid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["armorid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + $page = "<img src=\"././images/shop.gif\"/><br>Si vous achetez le ".$itemsrow["name"].", alors j'achèterai le votre ".$itemsrow2["name"]." pour ".ceil($itemsrow2["buycost"]/2)." ".$townrow3["monnaie"].". Vous êtes d'acord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } else { + $page = "<img src=\"././images/shop.gif\"/><br>Vous allez acheter ".$itemsrow["name"].", vous êtes d'accord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } + } elseif ($itemsrow["type"] == 3) { + if ($userrow["shieldid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["shieldid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + $page = "<img src=\"././images/shop.gif\"/><br>Si vous achetez le ".$itemsrow["name"].", alors j'achèterai le votre ".$itemsrow2["name"]." pour ".ceil($itemsrow2["buycost"]/2)." ".$townrow3["monnaie"].". Vous êtes d'accord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } else { + $page = "<img src=\"././images/shop.gif\"/><br>Vous allez acheter ".$itemsrow["name"].", vous êtes d'accord?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + } + } + + $title = "Acheter objets"; + display($page, $title); + +} + +function buy3($id) { // Update user profile with new item & stats. + + if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } + + global $userrow; + + $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); + $itemsrow = mysql_fetch_array($itemsquery); + + if ($userrow["gold"] < $itemsrow["buycost"]) { display("<img src=\"././images/shop.gif\"/><br>Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter cet objet.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=buy\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter objets"); die(); } + + if ($itemsrow["type"] == 1) { // weapon + + // Check if they already have an item in the slot. + if ($userrow["weaponid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["weaponid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + } else { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $userrow[$tochange] = $userrow[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$userrow[$tochange]."',"; + if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } + } + if ($itemsrow2["special"] != "Aucun") { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; + if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } + } + + // New stats. + $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; + $newattack = $userrow["attackpower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $userrow["id"]; + if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } + if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } + if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } + + // Final update. + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', attackpower='$newattack', weaponid='$newid', weaponname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + + } elseif ($itemsrow["type"] == 2) { // Armor + + // Check if they already have an item in the slot. + if ($userrow["armorid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["armorid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + } else { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $userrow[$tochange] = $userrow[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$userrow[$tochange]."',"; + if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } + } + if ($itemsrow2["special"] != "Aucun") { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; + if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } + } + + // New stats. + $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; + $newdefense = $userrow["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $userrow["id"]; + if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } + if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } + if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } + + // Final update. + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', armorid='$newid', armorname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + + } elseif ($itemsrow["type"] == 3) { // Shield + + // Check if they already have an item in the slot. + if ($userrow["shieldid"] != 0) { + $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["shieldid"]."' LIMIT 1", "items"); + $itemsrow2 = mysql_fetch_array($itemsquery2); + } else { + $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"Aucun"); + } + + // Special item fields. + $specialchange1 = ""; + $specialchange2 = ""; + if ($itemsrow["special"] != "Aucun") { + $special = explode(",",$itemsrow["special"]); + $tochange = $special[0]; + $userrow[$tochange] = $userrow[$tochange] + $special[1]; + $specialchange1 = "$tochange='".$userrow[$tochange]."',"; + if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } + if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } + } + if ($itemsrow2["special"] != "Aucun") { + $special2 = explode(",",$itemsrow2["special"]); + $tochange2 = $special2[0]; + $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; + $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; + if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } + if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } + } + + // New stats. + $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; + $newdefense = $userrow["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; + $newid = $itemsrow["id"]; + $newname = $itemsrow["name"]; + $userid = $userrow["id"]; + if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } + if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } + if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } + + // Final update. + $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', shieldid='$newid', shieldname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); + + } + + display("<img src=\"././images/shop.gif\"/><br>Merci d'avoir acheté cet objet.<br /><br />Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=buy\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter objets"); + +} + +function maps() { // List maps the user can buy. + + global $userrow, $numqueries; + + $mappedtowns = explode(",",$userrow["towns"]); + + $page = "<img src=\"././images/carte.gif\"/><br>Lorsque vous achetez la carte d'une ville, vous pourrez par la suite vous téléporter à cette endroit lorsque vous le souhaiterez. Cela vous coutera moins de TP que lorsque vous êtes à pied.<br /><br />\n"; + $page .= "Cliquez sur le nom d'un ville pour acheter sa carte.<br /><br />\n"; + $page .= "<table width=\"90%\">\n"; + + $townquery = doquery("SELECT * FROM {{table}} ORDER BY id", "towns"); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + while ($townrow = mysql_fetch_array($townquery)) { + + if ($townrow["latitude"] >= 0) { $latitude = $townrow["latitude"] . "N,"; } else { $latitude = ($townrow["latitude"]*-1) . "S,"; } + if ($townrow["longitude"] >= 0) { $longitude = $townrow["longitude"] . "E"; } else { $longitude = ($townrow["longitude"]*-1) . "O"; } + + $mapped = false; + foreach($mappedtowns as $a => $b) { + if ($b == $townrow["id"]) { $mapped = true; } + } + if ($mapped == false) { + $page .= "<tr><td width=\"25%\"><a href=\"index.php?do=maps2:".$townrow["id"]."\">".$townrow["name"]."</a></td><td width=\"25%\">Prix: ".$townrow["mapprice"]." ".$townrow3["monnaie"]."</td><td width=\"50%\" colspan=\"2\">Achetez la carte pour avoir des infos.</td></tr>\n"; + } else { + $page .= "<tr><td width=\"25%\"><span class=\"light\">".$townrow["name"]."</span></td><td width=\"25%\"><span class=\"light\">Déja acheté.</span></td><td width=\"35%\"><span class=\"light\">Location: $latitude $longitude</span></td><td width=\"15%\"><span class=\"light\">TP: ".$townrow["travelpoints"]."</span></td></tr>\n"; + } + + } + + $page .= "</table><br />\n"; + $page .= "<br>Si vous avez changé d'avis, vous pouvez également <a href=\"index.php\">retourner à la ville</a>.\n"; + + display($page, "Acheter cartes"); + +} + +function maps2($id) { // Confirm user's intent to purchase map. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT name,mapprice FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + if ($userrow["gold"] < $townrow["mapprice"]) { display("Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter cette carte.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=maps\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter cartes"); die(); } + + $page = "<img src=\"././images/carte.gif\"/><br>Vous allez acheter la carte de ".$townrow["name"]." . Vous êtes d'accord?<br /><br /><form action=\"index.php?do=maps3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; + + display($page, "Acheter cartes"); + +} + +function maps3($id) { // Add new map to user's profile. + + if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } + + global $userrow, $numqueries; + + $townquery = doquery("SELECT name,mapprice FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + + if ($userrow["gold"] < $townrow["mapprice"]) { display("Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter cette carte.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=maps\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter cartes"); die(); } + + $mappedtowns = $userrow["towns"].",$id"; + $newgold = $userrow["gold"] - $townrow["mapprice"]; + + $updatequery = doquery("UPDATE {{table}} SET towns='$mappedtowns',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + display("<br>Merci pour l'achat de cette carte.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=maps\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.", "Acheter carte"); + +} + +function travelto($id, $usepoints=true) { // Send a user to a town from the Travel To menu. + + global $userrow, $numqueries; + + $townquery = doquery("SELECT name,travelpoints,latitude,longitude FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); + $townrow = mysql_fetch_array($townquery); + + if ($usepoints==true) { + if ($userrow["currenttp"] < $townrow["travelpoints"]) { + display("<img src=\"././images/desole.gif\"/><br>Vous n'avez pas assez de TP pour vous téléporter dans cette ville. <br>Veuillez retourner et essayer encore quand vous aurez plus de TP.", "Se téléporter à"); die(); + } + } + + if (($userrow["latitude"] == $townrow["latitude"]) && ($userrow["longitude"] == $townrow["longitude"])) { display("<img src=\"././images/bienvenue.gif\"/><br>Vous êtes déjà dans cette ville. <br><a href=\"index.php\">Cliquez ici</a> pour retourner au menu principal de cette ville.", "Se téléporter à"); die(); } + + if ($usepoints == true) { $newtp = $userrow["currenttp"] - $townrow["travelpoints"]; } else { $newtp = $userrow["currenttp"]; } + + $newlat = $townrow["latitude"]; + $newlon = $townrow["longitude"]; + $newid = $userrow["id"]; + + // If they got here by exploring, add this town to their map. + $mapped = explode(",",$userrow["towns"]); + $town = false; + foreach($mapped as $a => $b) { + if ($b == $id) { $town = true; } + } + $mapped = implode(",",$mapped); + if ($town == false) { + $mapped .= ",$id"; + $mapped = "towns='".$mapped."',"; + } else { + $mapped = "towns='".$mapped."',"; + } + + $updatequery = doquery("UPDATE {{table}} SET currentaction='En ville',$mapped currenttp='$newtp',latitude='$newlat',longitude='$newlon' WHERE id='$newid' LIMIT 1", "users"); + + $page = "<img src=\"././images/bienvenue.gif\"/><br>Bienvenue à ".$townrow["name"].". <br>Vous pouvez maintenant <a href=\"index.php\">entrer dans cette ville</a>."; + display($page, "Se téléporter à"); + +} + +function marche() { // affiche la liste des différents objets disponibles. + +global $userrow, $numqueries; + +$townquery = doquery("SELECT name,itemslistb FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); +if (mysql_num_rows($townquery) != 1) { display("Tentative de triche detectée.<br /><br />attention le bannissement n'est pas loin.", "Error"); } +$townrow = mysql_fetch_array($townquery); + +$itemslistb = explode(",",$townrow["itemslistb"]); +$querystring = ""; +foreach($itemslistb as $a=>$b) { +$querystring .= "id='$b' OR "; } +$querystring = rtrim($querystring, " OR "); -function buy() { // Displays a list of available items for purchase. - - global $userrow, $numqueries; - - $townquery = doquery("SELECT name,itemslist FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); - - $itemslist = explode(",",$townrow["itemslist"]); - $querystring = ""; - foreach($itemslist as $a=>$b) { - $querystring .= "id='$b' OR "; - } - $querystring = rtrim($querystring, " OR "); - - $itemsquery = doquery("SELECT * FROM {{table}} WHERE $querystring ORDER BY id", "items"); - $page = "Buying weapons will increase your Attack Power. Buying armor and shields will increase your Defense Power.<br /><br />Click an item name to purchase it.<br /><br />The following items are available at this town:<br /><br />\n"; - $page .= "<table width=\"80%\">\n"; - while ($itemsrow = mysql_fetch_array($itemsquery)) { - if ($itemsrow["type"] == 1) { $attrib = "Attack Power:"; } else { $attrib = "Defense Power:"; } - $page .= "<tr><td width=\"4%\">"; - if ($itemsrow["type"] == 1) { $page .= "<img src=\"images/icon_weapon.gif\" alt=\"weapon\" /></td>"; } - if ($itemsrow["type"] == 2) { $page .= "<img src=\"images/icon_armor.gif\" alt=\"armor\" /></td>"; } - if ($itemsrow["type"] == 3) { $page .= "<img src=\"images/icon_shield.gif\" alt=\"shield\" /></td>"; } - if ($userrow["weaponid"] == $itemsrow["id"] || $userrow["armorid"] == $itemsrow["id"] || $userrow["shieldid"] == $itemsrow["id"]) { - $page .= "<td width=\"32%\"><span class=\"light\">".$itemsrow["name"]."</span></td><td width=\"32%\"><span class=\"light\">$attrib ".$itemsrow["attribute"]."</span></td><td width=\"32%\"><span class=\"light\">Already purchased</span></td></tr>\n"; - } else { - if ($itemsrow["special"] != "X") { $specialdot = "<span class=\"highlight\">*</span>"; } else { $specialdot = ""; } - $page .= "<td width=\"32%\"><b><a href=\"index.php?do=buy2:".$itemsrow["id"]."\">".$itemsrow["name"]."</a>$specialdot</b></td><td width=\"32%\">$attrib <b>".$itemsrow["attribute"]."</b></td><td width=\"32%\">Price: <b>".$itemsrow["buycost"]." gold</b></td></tr>\n"; - } - } - $page .= "</table><br />\n"; - $page .= "If you've changed your mind, you may also return back to <a href=\"index.php\">town</a>.\n"; - $title = "Buy Items"; - - display($page, $title); - +$itemsquery = doquery("SELECT * FROM {{table}} WHERE $querystring ORDER BY id", "items2"); +$page = "<bgsound src=\"musiques/030-Town08.mid\" loop=2>"; +$page .= "<img src=\"images/marche.gif\" alt=\"marché\" /><br><br><br><img src=\"images/personnages/marche.gif\" alt=\"Vendeuse\" /><br>Bienvenu sur le marché, ici vous trouverez toutes sortes de produits. De la nourriture en passant par des objets magiques.<br /><br />Cliquez sur le nom d'un objet pour l'acheter.<br /><br />Les objets suivants sont disponibles ici:<br /><br />\n"; +$page .= "<table width=\"80%\">\n"; +while ($itemsrow = mysql_fetch_array($itemsquery)) { +if ($itemsrow["type"] == 1) { $attrib = "Type:"; } else { $attrib = "Type:"; } +$page .= "<tr><td width=\"4%\">"; +if ($itemsrow["type"] == 7) { $page .= "<img src=\"images/icon_potion.gif\" alt=\"Potion\" /></td>"; } +if ($itemsrow["type"] == 8) { $page .= "<img src=\"images/icon_parchment.gif\" alt=\"sort\" /></td>"; } +if ($itemsrow["type"] == 9) { $page .= "<img src=\"images/icon_paxe.gif\" alt=\"Outil\" /></td>"; } +if ($itemsrow["type"] == 10) { $page .= "<img src=\"images/icon_ring.gif\" alt=\"Anneau\" /></td>"; } +if ($itemsrow["type"] == 11) { $page .= "<img src=\"images/icon_amulet.gif\" alt=\"Amulettes\" /></td>"; } +if ($itemsrow["type"] == 12) { $page .= "<img src=\"images/icon_drink.gif\" alt=\"Nourriture\" /></td>"; } +if ($itemsrow["special"] != "X") { $specialdot = "<span class=\"highlight\">*</span>"; } else { $specialdot = ""; } +$page .= "<td width=\"32%\"><b><a href=\"index.php?do=marche2:".$itemsrow["id"]."\">".$itemsrow["name"]."</a>$specialdot</b></td><td width=\"32%\">$attrib <b>".$itemsrow["genre"]."</b></td><td width=\"32%\">Prix: <b>".$itemsrow["buycost"]." ".$townrow3["monnaie"]."</b></td></tr>\n"; } +$page .= "</table><br />\n"; +$page .= "Si vous changez d'avis, vous pouvez retourner en <a href=\"index.php\">Ville</a>.\n"; +$title = "Buy Items"; -function buy2($id) { // Confirm user's intent to purchase item. - - global $userrow, $numqueries; - - $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); - $itemsrow = mysql_fetch_array($itemsquery); - - if ($userrow["gold"] < $itemsrow["buycost"]) { display("You do not have enough gold to buy this item.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=buy\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Items"); die(); } - - if ($itemsrow["type"] == 1) { - if ($userrow["weaponid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["weaponid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - $page = "If you are buying the ".$itemsrow["name"].", then I will buy your ".$itemsrow2["name"]." for ".ceil($itemsrow2["buycost"]/2)." gold. Is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } else { - $page = "You are buying the ".$itemsrow["name"].", is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } - } elseif ($itemsrow["type"] == 2) { - if ($userrow["armorid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["armorid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - $page = "If you are buying the ".$itemsrow["name"].", then I will buy your ".$itemsrow2["name"]." for ".ceil($itemsrow2["buycost"]/2)." gold. Is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } else { - $page = "You are buying the ".$itemsrow["name"].", is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } - } elseif ($itemsrow["type"] == 3) { - if ($userrow["shieldid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["shieldid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - $page = "If you are buying the ".$itemsrow["name"].", then I will buy your ".$itemsrow2["name"]." for ".ceil($itemsrow2["buycost"]/2)." gold. Is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } else { - $page = "You are buying the ".$itemsrow["name"].", is that ok?<br /><br /><form action=\"index.php?do=buy3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; - } - } - - $title = "Buy Items"; - display($page, $title); - +display($page, $title); } -function buy3($id) { // Update user profile with new item & stats. - - if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } - - global $userrow; - - $itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items"); - $itemsrow = mysql_fetch_array($itemsquery); - - if ($userrow["gold"] < $itemsrow["buycost"]) { display("You do not have enough gold to buy this item.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=buy\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Items"); die(); } - - if ($itemsrow["type"] == 1) { // weapon - - // Check if they already have an item in the slot. - if ($userrow["weaponid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["weaponid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - } else { - $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"X"); - } - - // Special item fields. - $specialchange1 = ""; - $specialchange2 = ""; - if ($itemsrow["special"] != "X") { - $special = explode(",",$itemsrow["special"]); - $tochange = $special[0]; - $userrow[$tochange] = $userrow[$tochange] + $special[1]; - $specialchange1 = "$tochange='".$userrow[$tochange]."',"; - if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } - if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } - } - if ($itemsrow2["special"] != "X") { - $special2 = explode(",",$itemsrow2["special"]); - $tochange2 = $special2[0]; - $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; - $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; - if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } - if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } - } - - // New stats. - $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; - $newattack = $userrow["attackpower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; - $newid = $itemsrow["id"]; - $newname = $itemsrow["name"]; - $userid = $userrow["id"]; - if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } - if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } - if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } - - // Final update. - $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', attackpower='$newattack', weaponid='$newid', weaponname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); - - } elseif ($itemsrow["type"] == 2) { // Armor - - // Check if they already have an item in the slot. - if ($userrow["armorid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["armorid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - } else { - $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"X"); - } - - // Special item fields. - $specialchange1 = ""; - $specialchange2 = ""; - if ($itemsrow["special"] != "X") { - $special = explode(",",$itemsrow["special"]); - $tochange = $special[0]; - $userrow[$tochange] = $userrow[$tochange] + $special[1]; - $specialchange1 = "$tochange='".$userrow[$tochange]."',"; - if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } - if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } - } - if ($itemsrow2["special"] != "X") { - $special2 = explode(",",$itemsrow2["special"]); - $tochange2 = $special2[0]; - $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; - $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; - if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } - if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } - } - - // New stats. - $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; - $newdefense = $userrow["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; - $newid = $itemsrow["id"]; - $newname = $itemsrow["name"]; - $userid = $userrow["id"]; - if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } - if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } - if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } - - // Final update. - $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', armorid='$newid', armorname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); - - } elseif ($itemsrow["type"] == 3) { // Shield - - // Check if they already have an item in the slot. - if ($userrow["shieldid"] != 0) { - $itemsquery2 = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["shieldid"]."' LIMIT 1", "items"); - $itemsrow2 = mysql_fetch_array($itemsquery2); - } else { - $itemsrow2 = array("attribute"=>0,"buycost"=>0,"special"=>"X"); - } - - // Special item fields. - $specialchange1 = ""; - $specialchange2 = ""; - if ($itemsrow["special"] != "X") { - $special = explode(",",$itemsrow["special"]); - $tochange = $special[0]; - $userrow[$tochange] = $userrow[$tochange] + $special[1]; - $specialchange1 = "$tochange='".$userrow[$tochange]."',"; - if ($tochange == "strength") { $userrow["attackpower"] += $special[1]; } - if ($tochange == "dexterity") { $userrow["defensepower"] += $special[1]; } - } - if ($itemsrow2["special"] != "X") { - $special2 = explode(",",$itemsrow2["special"]); - $tochange2 = $special2[0]; - $userrow[$tochange2] = $userrow[$tochange2] - $special2[1]; - $specialchange2 = "$tochange2='".$userrow[$tochange2]."',"; - if ($tochange2 == "strength") { $userrow["attackpower"] -= $special2[1]; } - if ($tochange2 == "dexterity") { $userrow["defensepower"] -= $special2[1]; } - } - - // New stats. - $newgold = $userrow["gold"] + ceil($itemsrow2["buycost"]/2) - $itemsrow["buycost"]; - $newdefense = $userrow["defensepower"] + $itemsrow["attribute"] - $itemsrow2["attribute"]; - $newid = $itemsrow["id"]; - $newname = $itemsrow["name"]; - $userid = $userrow["id"]; - if ($userrow["currenthp"] > $userrow["maxhp"]) { $newhp = $userrow["maxhp"]; } else { $newhp = $userrow["currenthp"]; } - if ($userrow["currentmp"] > $userrow["maxmp"]) { $newmp = $userrow["maxmp"]; } else { $newmp = $userrow["currentmp"]; } - if ($userrow["currenttp"] > $userrow["maxtp"]) { $newtp = $userrow["maxtp"]; } else { $newtp = $userrow["currenttp"]; } - - // Final update. - $updatequery = doquery("UPDATE {{table}} SET $specialchange1 $specialchange2 gold='$newgold', defensepower='$newdefense', shieldid='$newid', shieldname='$newname', currenthp='$newhp', currentmp='$newmp', currenttp='$newtp' WHERE id='$userid' LIMIT 1", "users"); - - } - - display("Thank you for purchasing this item.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=buy\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Items"); +function marche2($id) { // Confirme le choix de l'achat. + +global $userrow, $numqueries; + +$townquery = doquery("SELECT name,itemslistb FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); +if (mysql_num_rows($townquery) != 1) { display("Tentative de Triche.<br /><br />Bannissement imminent.", "Error"); } +$townrow = mysql_fetch_array($townquery); +$townitems = explode(",",$townrow["itemslistb"]); +if (! in_array($id, $townitems)) { display("Tentative de Triche.<br /><br />Bannissement imminent.", "Error"); } + +$itemsquery = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "items2"); +$itemsrow = mysql_fetch_array($itemsquery); + +if ($userrow["gold"] < $itemsrow["buycost"]) { display("<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche1.gif\" alt=\"Vendeuse\" /><br><br /><br />Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=marche\">Au magasin</a>, Ou utiliser le menu de gauche pour repartir en exploration.", "Buy Items"); die(); } + +if ($itemsrow["type"] == 7) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela ?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; +} elseif ($itemsrow["type"] == 8) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form>"; +} elseif ($itemsrow["type"] == 9) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non \" /></form>"; +} elseif ($itemsrow["type"] == 10) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non \" /></form>"; +} elseif ($itemsrow["type"] == 11) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela ?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non \" /></form>"; +} elseif ($itemsrow["type"] == 12) { +$page = "<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche2.gif\" alt=\"Vendeuse\" /><br>Vous voulez acheter un ".$itemsrow["name"].", C'est cela ?<br /><br /><form action=\"index.php?do=marche3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non \" /></form>"; +} +$title = "Buy Items"; +display($page, $title); } +function marche3($id) { // Ajoute l'objet a votre sac. + +if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } + +global $userrow, $numqueries; + +$itemquery = doquery("SELECT name,buycost,type FROM {{table}} WHERE id='$id' LIMIT 1", "items2"); +$itemsrow = mysql_fetch_array($itemquery); + +if ($userrow["gold"] < $itemrow["buycost"]) { display("<img src=\"././images/marche.gif\"/><br><br /><br><br><br><img src=\"images/personnages/marche.gif\" alt=\"Vendeuse\" /><br><br /><br />Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=marche\">Au marche</a>, ou partir en exploration grace au menu de gauche.", "Acheter cartes"); die(); } + +$newgold = $userrow["gold"] - $itemsrow["buycost"]; + +if ($itemsrow["type"] == 7) { $userrow["itemsac1qt"] = $userrow["itemsac1qt"] + 1; +} elseif ($itemsrow["type"] == 8) { $userrow["itemsac2qt"] = $userrow["itemsac2qt"] + 1; +} elseif ($itemsrow["type"] == 9) { $userrow["itemsac3qt"] = $userrow["itemsac3qt"] + 1; +} elseif ($itemsrow["type"] == 10) { $userrow["itemsac4qt"] = $userrow["itemsac4qt"] + 1; +} elseif ($itemsrow["type"] == 11) { $userrow["itemsac5qt"] = $userrow["itemsac5qt"] + 1; +} elseif ($itemsrow["type"] == 12) { $userrow["itemsac6qt"] = $userrow["itemsac6qt"] + 1; +} +$item1 = $userrow["itemsac1qt"]; +$item2 = $userrow["itemsac2qt"]; +$item3 = $userrow["itemsac3qt"]; +$item4 = $userrow["itemsac4qt"]; +$item5 = $userrow["itemsac5qt"]; +$item6 = $userrow["itemsac6qt"]; + +$updatequery = doquery("UPDATE {{table}} SET itemsac1qt='$item1',itemsac2qt='$item2',itemsac3qt='$item3',itemsac4qt='$item4',itemsac5qt='$item5',itemsac6qt='$item6',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + +display("<img src=\"images/marche.gif\" alt=\"Marché\" /><br><br><br><img src=\"images/personnages/marche3.gif\" alt=\"Vendeuse\" /><br><br /><br />Vous pouvez retourner en <a href=\"index.php\">Ville</a>, <a href=\"index.php?do=marche\">Au marche</a>, ou partir en exploration grace au menu de gauche.", "Acheter items"); + +} + +function revente () { // revente de votre minerais + +global $userrow, $numqueries; +$townquery = doquery("SELECT name,innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); + +if (isset($_POST['bank'])) { +$title = "Bank"; + +if ($_POST['cuivre']) { +if ($_POST['cuivre'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['cuivre'] > $userrow['cuivre']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de Cuivre!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['gold'] + $_POST['cuivre'] * 20; +$newbank = $userrow['argent'] - $_POST['cuivre']; +doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET cuivre='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +} +elseif ($_POST['fer']) { +if ($_POST['fer'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['fer'] > $userrow['fer']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous ne possédez pas autant de Fer sur vous!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['gold'] + $_POST['fer'] * 30; +$newbank = $userrow['argent'] - $_POST['fer']; +doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET fer='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +} elseif ($_POST['argent']) { +if ($_POST['argent'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['argent'] > $userrow['argent']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous ne possédez pas autant d' Argent sur vous!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['gold'] + $_POST['argent'] * 40; +$newbank = $userrow['argent'] - $_POST['argent']; +doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET argent='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + + +} elseif ($_POST['platine']) { +if ($_POST['platine'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['platine'] > $userrow['platine']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br> Vous ne possédez pas autant de Platine sur vous!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['gold'] + $_POST['platine'] * 50; +$newbank = $userrow['argent'] - $_POST['platine']; +doquery("UPDATE {{table}} SET gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET platine='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=revente'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +} +} else { +$title = "Banque"; +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><br><br><br><br />"; +$page .= " + +<div align='center'> +<table width='343' border='1'> +<tr> +<td width='74'> </td> +<td width='55'>Cuivre</td> +<td width='54'>Fer</td> +<td width='58'>Argent</td> +<td width='68'>Platine</td> +</tr> +<tr> +<td>Prix a l'unité </td> +<td><div align='center'>20</div></td> +<td><div align='center'>30</div></td> +<td><div align='center'>40</div></td> +<td><div align='center'>50</div></td> +</tr> +</table> +</div> + +"; +$page .= "<div align='center'>"; +$page .= "<form action=index.php?do=revente method=post><br />"; +$page .= "Cuivre :<input type=text name=cuivre><br />"; +$page .= "Fer :<input type=text name=fer><br />"; +$page .= "Argent :<input type=text name=argent><br />"; +$page .= "Platine :<input type=text name=platine><br />"; +$page .= "<input type=submit value=Valider name=bank></form><br>"; +$page .= "</div>"; + +$page .= "<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +display($page, $title); + +} + +function pretre() { // Passer chez le soigneur vous rends tous vos PV pour 3 gold. + +global $userrow, $numqueries; + +$townquery = doquery("SELECT name,prixsoigneur FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); +if (mysql_num_rows($townquery) != 1) { display("Tentative de triche detectée.<br /><br />attention le bannissement n'est pas loin.", "Error"); } +$townrow = mysql_fetch_array($townquery); + +if ($userrow["gold"] < $townrow["prixsoigneur"]) { display("<img src=\"images/church.jpg\" alt=\"Eglise\" /><br><br><br><img src=\"images/personnages/soeur1.gif\" alt=\"soeur\" /><br>Vous avez besoin de 3 ".$townrow3["monnaie"]." pour des soins.<br /><br />Vous pouvez retourner en <a href=\"index.php\">Ville</a>, ou utiliser le menu de gauche pour explorer.", "Inn"); die(); } + +if (isset($_POST['submit'])) { + +$newgold = $userrow["gold"] - $townrow["prixsoigneur"]; +$query = doquery("UPDATE {{table}} SET gold='$newgold',currenthp='".$userrow["maxhp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Soigneur"; +$page = "<img src=\"images/title_eglise.gif\" alt=\"Eglise\" /><br><br><br><img src=\"images/personnages/soeur3.gif\" alt=\"soeur\" /><br /><br />Vous pouvez retourner <a href=\"index.php\">En ville</a>, Ou partir directement en exploration en utilisant le menu de gauche (directions)."; + +} elseif (isset($_POST["cancel"])) { + +header("Location: index.php"); die(); -function maps() { // List maps the user can buy. +} else { + +$title = "Pretre"; +$page = "<bgsound src=\"musiques/032-Church01.mid\" loop=2>"; +$page .= "<img src=\"images/title_eglise.gif\" alt=\"Eglise\" /><br><br><br><img src=\"images/personnages/soeur.gif\" alt=\"Soeur\" /><br> Cela vous coutera 3 ".$townrow3["monnaie"]." le soin complet<br><br /><br />\n"; +$page .= "<form action=\"index.php?do=pretre\" method=\"post\">\n"; +$page .= "<input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" />\n"; +$page .= "</form>\n"; + + +} + +display($page, $title); +} + +function enchanteur() { // Passer chez l'enchanteur vous rends tous vos PM pour X gold. + +global $userrow, $numqueries; + +$townquery = doquery("SELECT name,prixenchanteur FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); +$townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); +$townrow3 = mysql_fetch_array($townquery3); +if (mysql_num_rows($townquery) != 1) { display("Tentative de triche detectée.<br /><br />attention le bannissement n'est pas loin.", "Error"); } +$townrow = mysql_fetch_array($townquery); + +if ($userrow["gold"] < $townrow["prixenchanteur"]) { display("<bgsound src=\"musiques/029-Town07.mid\" loop=10><img src=\"images/title_magicienne.gif\" alt=\"Maison de la magicienne\" /><br><br><br><img src=\"images/personnages/magicienne2.gif\" alt=\"magicienne\" /><br>Vous avez besoin de 3 ".$townrow3["monnaie"]." pour reccuperer vos PM.<br /><br />Vous pouvez retourner en <a href=\"index.php\">Ville</a>, ou utiliser le menu de gauche pour explorer.", "Inn"); die(); } + +if (isset($_POST['submit'])) { + +$newgold = $userrow["gold"] - $townrow["prixenchanteur"]; +$query = doquery("UPDATE {{table}} SET gold='$newgold',currentmp='".$userrow["maxmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$title = "Soigneur"; +$page = "<bgsound src=\"musiques/029-Town07.mid\" loop=10><img src=\"images/title_magicienne.gif\" alt=\"Maison de la magicienne\" /><br><br><br><img src=\"images/personnages/magicienne3.gif\" alt=\"Magicienne\" /><br /><br />Vous pouvez retourner <a href=\"index.php\">En ville</a>, Ou partir directement en exploration en utilisant le menu de gauche (directions)."; + +} elseif (isset($_POST["cancel"])) { + +header("Location: index.php"); die(); + +} else { + +$title = "Magicienne"; +$page = "<bgsound src=\"musiques/029-Town07.mid\" loop=10><img src=\"images/title_magicienne.gif\" alt=\"Maison de la magicienne\" /><br><br><br><img src=\"images/personnages/magicienne.gif\" alt=\"Soeur\" /><br> Cela vous coutera 3 ".$townrow3["monnaie"]." reccuperer tout vos PM<br><br /><br />\n"; +$page .= "<form action=\"index.php?do=enchanteur\" method=\"post\">\n"; +$page .= "<input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" />\n"; +$page .= "</form>\n"; + + +} + +display($page, $title); + +} + +function point($id) { // Permet d'augmentez ca force et son attaque. + +global $userrow, $numqueries; +$townquery = doquery("SELECT name,innprice FROM {{table}} WHERE latitude='".$userrow["latitude"]."' AND longitude='".$userrow["longitude"]."' LIMIT 1", "towns"); + + +if (isset($_POST['bank'])) { +$title = "Bank"; + +if ($_POST['hit']) { +if ($_POST['hit'] <= 0) +$page = "<bgsound src='musique/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['hit'] > $userrow['pointlvl']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de point!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['pointlvl'] - $_POST['hit']; +$newbank = $userrow['maxhp'] + $_POST['hit']; +doquery("UPDATE {{table}} SET pointlvl='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET maxhp='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +} elseif ($_POST['magie']) { +if ($_POST['magie'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['magie'] > $userrow['pointlvl']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de point!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['pointlvl'] - $_POST['magie']; +$newbank = $userrow['maxmp'] + $_POST['magie']; +doquery("UPDATE {{table}} SET pointlvl='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET maxmp='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + + +} elseif ($_POST['travel']) { +if ($_POST['travel'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['travel'] > $userrow['pointlvl']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de point!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['pointlvl'] - $_POST['travel']; +$newbank = $userrow['maxtp'] + $_POST['travel']; +doquery("UPDATE {{table}} SET pointlvl='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET maxtp='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + + +} elseif ($_POST['dex']) { +if ($_POST['dex'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['dex'] > $userrow['pointlvl']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de point!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['pointlvl'] - $_POST['dex']; +$newbank = $userrow['dexterity'] + $_POST['dex']; +doquery("UPDATE {{table}} SET pointlvl='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET dexterity='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + + +} elseif ($_POST['force']) { +if ($_POST['force'] <= 0) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous devez entrer un montant supérieur a 0!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +elseif ($_POST['force'] > $userrow['pointlvl']) +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.gif' alt='banque' /><img src='images/gold.jpg' alt='banque' /><br><br><br><br> Vous n'avez pas autant de point!<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +else { +$newgold = $userrow['pointlvl'] - $_POST['force']; +$newbank = $userrow['strength'] + $_POST['force']; +doquery("UPDATE {{table}} SET pointlvl='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +doquery("UPDATE {{table}} SET strength='$newbank' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><img src='images/gold.jpg' alt='banque' /><br><br><br><br>"; +$page .="Vous pouvez retourner en <a href='index.php'>Ville</a>, <a href='index.php?do=point'>Au guichet</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} +} +} else { +$hit = $userrow['maxhp'] ; +$magie = $userrow['maxmp'] ; +$travel = $userrow['maxtp'] ; +$force = $userrow['strength'] ; +$dex = $userrow['dexterity'] ; +$point = $userrow['pointlvl'] ; + +$title = "Banque"; +$page = "<bgsound src='musiques/026-Town04.mid' loop=10><br><br><br><br />"; +$page .= "<div align='center'>"; +$page .= "Il vout reste encore $point à distribuer"; +$page .= " +<form action=index.php?do=point method=post> +<p><br /> +points vie : +<input name=hit type=text id='hit'> +($hit) </p> +<p>points de magie : +<input name=magie type=text id='magie'> +($magie) </p> +<p>points de voyage : +<input name=travel type=text id='travel'> +($travel) </p> +<p>points de force : +<input name=force type=text id='force'> +($force) </p> +<p> points de dextérité : +<input name=dex type=text id='dex'> +($dex)<br /> +<input type=submit value=Valider name=bank> +</p> +</form><br> +"; + +$page .= "</div>"; + +$page .= "<br>Vous pouvez retourner en <a href='index.php'>Ville</a>, Ou utiliser le menu de gauche pour repartir en exploration."; +} + +display($page, $title); +} + +function profil() { + +global $controlrow, $userrow; + +if (isset($_POST["submit"])) { + +extract($_POST); +$errors = 0; +$errorlist = ""; + +if ($avatar == "") { $errors++; $errorlist .= "Le numéro de l'avatar est exigé.<br />"; } +if ($email == "") { $errors++; $errorlist .= "L'Email est exigé.<br />"; } +if ($charname == "") { $errors++; $errorlist .= "Le nom de votre perso est exigée.<br />"; } + +if ($errors == 0) { + +$id = $userrow["id"]; +$updatequery = <<<END +UPDATE {{table}} SET +avatar="$avatar",age="$age", email="$email", charname="$charname", signature="$signature" WHERE id="$id" LIMIT 1 +END; +$query = doquery($updatequery, "users"); +display("<p class='Style5'>Votre profil à été mis à jour.<br><br> Retourner <a href='index.php'> au jeu</a>.","Profil"); +} else { +display("<b>Erreurs:</b><br /><div style='color:red;'>$errorlist</div><br />Veuillez retourner et essayer encore.", "Profil"); +} + +} + +$query = doquery("SELECT * FROM {{table}} WHERE id='$id' LIMIT 1", "users"); +$row = mysql_fetch_array($query); +$name = "".$userrow["charname"].""; +$email = "".$userrow["email"].""; +$age = "".$userrow["age"].""; +$signature = "".$userrow["signature"].""; + + +$page = <<<END +<img src='images/banmini10.gif'><br><br><p class='Style5'><b><u>Editer votre profil</u></b><br /><br /> +<table width="90%"> +<form action="index.php?do=profil" method="post"> +<tr><td width="50%"><p class='Style5'>Avatar du perso:</td><td><select name="avatar" ><option value="num-1.gif">numéro 1</option><option value="num-2.gif">numéro 2</option><option value="num-3.gif">numéro 3</option><option value="num-4.gif">numéro 4</option><option value="num-5.gif">numéro 5</option><option value="num-6.gif">numéro 6</option><option value="num-7.gif">numéro 7</option><option value="num-8.gif">numéro 8</option><option value="num-9.gif">numéro 9</option><option value="num-10.gif">numéro 10</option> +<option value="num-11.gif">numéro 11</option><option value="num-12.gif">numéro 12</option><option value="num-13.gif">numéro 13</option><option value="num-14.gif">numéro 14</option><option value="num-15.gif">numéro 15</option><option value="num-16.gif">numéro 16</option><option value="num-17.gif">numéro 17</option><option value="num-18.gif">numéro 18</option><option value="num-19.gif">numéro 19</option><option value="num-20.gif">numéro 20</option> +<option value="num-21.gif">numéro 21</option><option value="num-22.gif">numéro 22</option><option value="num-23.gif">numéro 23</option><option value="num-24.gif">numéro 24</option><option value="num-25.gif">numéro 25</option><option value="num-26.gif">numéro 26</option><option value="num-27.gif">numéro 27</option><option value="num-28.gif">numéro 28</option><option value="num-29.gif">numéro 29</option> +<option value="num-30.gif">numéro 30</option></select></td></tr> +<tr><td colspan="2"><p class='Style5'>Pour voir tous les avatars <A HREF="#" onClick="window.open('avatar.php','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=400, height=800');return(false)">cliquez ici.</A></td></tr> +<tr><td width="50%"><p class='Style5'>Nom du personnage:</td><td><input type="text" name="charname" value="$name" size="30" maxlength="30"/></td></tr> +<tr><td width="50%"><p class='Style5'>Age du personnage:</td><td><input type="text" name="age" value="$age" size="30" maxlength="30"/></td></tr> +<tr><td width="50%"><p class='Style5'>Votre email:</td><td><input type="text" name="email" value="$email" size="30" maxlength="30"/></td></tr> +<center><p class='Style5'><a href="index.php?do=av"><b><u>Uploadez votre prore avatar</b></a></td></tr> +<center><p class='Style5'><a href="index.php?do=delete"> <b><u>Supprimez votre compte</b></a><br><p></td></tr> +<tr><td width="50%"><p class='Style5'><b><u>Option Forum</b></u><br></tr></td> +<tr><td width="50%"><p class='Style5'>Votre signature:</td><td><textarea name="signature" size="30" maxlength="30"/>$signature</textarea><br><p class='Style5'><A HREF="#" onClick="window.open('smile.php','_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=500, height=100');return(false)"><b>Smile et Bbcode</b></A><br /></td></tr> +</table><p><p> +<input type="submit" name="submit" value="Valider" /> +</form> +END; + +if ($row[""] == 1) { $row[""] = "selected='selected' "; } else { $row[""] = ""; } +$page = parsetemplate($page, $row); + + $page .= "<p class='Style5'><br><a href='index.php'> Retourner au jeu.</a>"; +display($page, "Modifier votre profil"); + +} + +function mag() { // List maps the user can buy - global $userrow, $numqueries; + global $userrow, $numqueries; + - $mappedtowns = explode(",",$userrow["towns"]); + $mappedtowns = explode(",",$userrow["spells"]); - $page = "Buying maps will put the town in your Travel To box, and it won't cost you as many TP to get there.<br /><br />\n"; - $page .= "Click a town name to purchase its map.<br /><br />\n"; - $page .= "<table width=\"90%\">\n"; + $page .= "Cliquez sur le nom de la technique souhaité pour acheter son parchemin.<br /><br />\n"; + $page .= "<table width='95%'><tr><td width='50%'>\n"; - $townquery = doquery("SELECT * FROM {{table}} ORDER BY id", "towns"); - while ($townrow = mysql_fetch_array($townquery)) { + $townquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells"); + $townquery3 = doquery("SELECT monnaie FROM {{table}} WHERE id='1' LIMIT 1", "control"); + $townrow3 = mysql_fetch_array($townquery3); + while ($townrow = mysql_fetch_array($townquery)) { - if ($townrow["latitude"] >= 0) { $latitude = $townrow["latitude"] . "N,"; } else { $latitude = ($townrow["latitude"]*-1) . "S,"; } - if ($townrow["longitude"] >= 0) { $longitude = $townrow["longitude"] . "E"; } else { $longitude = ($townrow["longitude"]*-1) . "W"; } + if ($townrow["latitude"] >= 0) { $latitude = $townrow["latitude"] . "N,"; } else { $latitude = ($townrow["latitude"]*-1) . "S,"; } + if ($townrow["longitude"] >= 0) { $longitude = $townrow["longitude"] . "E"; } else { $longitude = ($townrow["longitude"]*-1) . "O"; } - $mapped = false; - foreach($mappedtowns as $a => $b) { - if ($b == $townrow["id"]) { $mapped = true; } - } - if ($mapped == false) { - $page .= "<tr><td width=\"25%\"><a href=\"index.php?do=maps2:".$townrow["id"]."\">".$townrow["name"]."</a></td><td width=\"25%\">Price: ".$townrow["mapprice"]." gold</td><td width=\"50%\" colspan=\"2\">Buy map to reveal details.</td></tr>\n"; - } else { - $page .= "<tr><td width=\"25%\"><span class=\"light\">".$townrow["name"]."</span></td><td width=\"25%\"><span class=\"light\">Already mapped.</span></td><td width=\"35%\"><span class=\"light\">Location: $latitude $longitude</span></td><td width=\"15%\"><span class=\"light\">TP: ".$townrow["travelpoints"]."</span></td></tr>\n"; - } + $mapped = false; + foreach($mappedtowns as $a => $b) { + if ($b == $townrow["id"]) { $mapped = true; } + } + if ($mapped == false) { + $page .= "<a href=\"index.php?do=mag2:".$townrow["id"]."\">- ".$townrow["name"]."</a> ".$townrow["price"]." ".$townrow3["monnaie"]."<br>\n"; + } else { + $page .= "<span class=\"light\"><b>- ".$townrow["name"]."</b></span><span class=\"light\"> (".$townrow["mp"]." cha)</span><br>\n"; + } - } + } + + $page .= "<br><br /><br><br><br /><br><br /><br>Vous pouvez <a href=\"index.php\">retourner à la ville</a>.</td><td><img src='images/dojo.jpg'><br />Attention un ninja ne peut apprendre que 18 techniques qui ne sont pas interchangable(les sorts Irou Ninjutsu et Shousen Jutsu sont des sorts de regeneration de chakra).<br><br /> + </td></tr></table>\n"; + + $page .= "</table>\n"; - $page .= "</table><br />\n"; - $page .= "If you've changed your mind, you may also return back to <a href=\"index.php\">town</a>.\n"; + display($page, "Acheter techniques"); - display($page, "Buy Maps"); - -} +} -function maps2($id) { // Confirm user's intent to purchase map. +function mag2($id) { // Confirm user's intent to purchase map. - global $userrow, $numqueries; + global $userrow, $numqueries; - $townquery = doquery("SELECT name,mapprice FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); + $townquery = doquery("SELECT name,price FROM {{table}} WHERE id='$id' LIMIT 1", "spells"); + $townrow = mysql_fetch_array($townquery); - if ($userrow["gold"] < $townrow["mapprice"]) { display("You do not have enough gold to buy this map.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=maps\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Maps"); die(); } + if ($userrow["gold"] < $townrow["price"]) { display("Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter ce parchemin.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=mag\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.</table>", "Acheter cartes"); die(); } - $page = "You are buying the ".$townrow["name"]." map. Is that ok?<br /><br /><form action=\"index.php?do=maps3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Yes\" /> <input type=\"submit\" name=\"cancel\" value=\"No\" /></form>"; + $page = "<center><br>Vous allez acheter le parchemin de ".$townrow["name"]." . Vous êtes d'accord?<br /><br /><form action=\"index.php?do=mag3:$id\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Oui\" /> <input type=\"submit\" name=\"cancel\" value=\"Non\" /></form></table>"; - display($page, "Buy Maps"); + display($page, "Acheter parchemin"); -} +} -function maps3($id) { // Add new map to user's profile. - - if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } - - global $userrow, $numqueries; +function mag3($id) { // Add new map to user's profile. - $townquery = doquery("SELECT name,mapprice FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); + if (isset($_POST["cancel"])) { header("Location: index.php"); die(); } - if ($userrow["gold"] < $townrow["mapprice"]) { display("You do not have enough gold to buy this map.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=maps\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Maps"); die(); } + global $userrow, $numqueries; - $mappedtowns = $userrow["towns"].",$id"; - $newgold = $userrow["gold"] - $townrow["mapprice"]; + $townquery = doquery("SELECT name,price FROM {{table}} WHERE id='$id' LIMIT 1", "spells"); + $townrow = mysql_fetch_array($townquery); - $updatequery = doquery("UPDATE {{table}} SET towns='$mappedtowns',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + if ($userrow["gold"] < $townrow["price"]) { display("Vous n'avez pas assez de ".$townrow3["monnaie"]." pour acheter ce parchemin.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=mag\">à l'ecole</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.</table>", "Acheter parchemin"); die(); } - display("Thank you for purchasing this map.<br /><br />You may return to <a href=\"index.php\">town</a>, <a href=\"index.php?do=maps\">store</a>, or use the direction buttons on the left to start exploring.", "Buy Maps"); + $mappedtowns = $userrow["spells"].",$id"; + $newgold = $userrow["gold"] - $townrow["price"]; -} - -function travelto($id, $usepoints=true) { // Send a user to a town from the Travel To menu. - - global $userrow, $numqueries; + $updatequery = doquery("UPDATE {{table}} SET spells='$mappedtowns',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); - $townquery = doquery("SELECT name,travelpoints,latitude,longitude FROM {{table}} WHERE id='$id' LIMIT 1", "towns"); - $townrow = mysql_fetch_array($townquery); - - if ($usepoints==true) { - if ($userrow["currenttp"] < $townrow["travelpoints"]) { - display("You do not have enough TP to travel here. Please go back and try again when you get more TP.", "Travel To"); die(); - } - } + display("<br>Merci pour l'achat de ce parchemin.<br /><br />Vous pouvez <a href=\"index.php\">retourner à la ville</a>, <a href=\"index.php?do=mag\">au magasin</a>, ou utiliser les boutons directionnel de gauche pour continuer à explorer le monde.</table>", "Acheter parchemin"); - if (($userrow["latitude"] == $townrow["latitude"]) && ($userrow["longitude"] == $townrow["longitude"])) { display("You are already in this town. <a href=\"index.php\">Click here</a> to return to the main town screen.", "Travel To"); die(); } - - if ($usepoints == true) { $newtp = $userrow["currenttp"] - $townrow["travelpoints"]; } else { $newtp = $userrow["currenttp"]; } - - $newlat = $townrow["latitude"]; - $newlon = $townrow["longitude"]; - $newid = $userrow["id"]; - - // If they got here by exploring, add this town to their map. - $mapped = explode(",",$userrow["towns"]); - $town = false; - foreach($mapped as $a => $b) { - if ($b == $id) { $town = true; } - } - $mapped = implode(",",$mapped); - if ($town == false) { - $mapped .= ",$id"; - $mapped = "towns='".$mapped."',"; - } else { - $mapped = "towns='".$mapped."',"; - } - - $updatequery = doquery("UPDATE {{table}} SET currentaction='In Town',$mapped currenttp='$newtp',latitude='$newlat',longitude='$newlon' WHERE id='$newid' LIMIT 1", "users"); - - $page = "You have travelled to ".$townrow["name"].". You may now <a href=\"index.php\">enter this town</a>."; - display($page, "Travel To"); - -} - - +} + +function av() { + +global $userrow; + +$page .= '<div style="height:auto;margin:auto;width:300px;text-align:center;">'; +$page .= '<form id="avatar" action="" method="post" enctype="multipart/form-data">'; + +(file_exists("images/avatar/".$userrow[id].".jpg") AND !file_exists("images/avatar/".$userrow[id].".gif"))? $type="jpg":$type="gif"; + +if(file_exists("images/avatar/".$userrow[id].".jpg") OR file_exists("images/avatar/".$userrow[id].".gif")) +{ +$page .= ' <br /><span class="p">Votre avatar actuel : </span><br /><br />'; +$page .= '<img style="border:0px;" alt="Votre avatar" src="images/avatar/'.$userrow[id].'.'.$type.'" />'; + +$page .= '<p><input type="submit" value="Supprimer" name="suppr" /><br /><br /></p>'; +} + +$page .= '<br /><br />'; + +$page .= 'Changer :<br /><input type="file" name="avatar" /><input type="submit" name="ok" value="Ok!" /></p></form></div>'; + +$ok = $_POST['ok']; +$typavt = $_FILES['avatar']['type']; +$sizavt = $_FILES['avatar']['size']; +$tmpavt = $_FILES['avatar']['tmp_name']; +$suppr = $_POST['suppr']; + +error_reporting(0); + +$tllavt = GetImageSize($tmpavt); + +error_reporting(1); + + +$err = ""; + +if($typavt != "image/jpeg" AND +$typavt != "image/pjpeg" AND +$typavt != "image/gif" AND +!empty($avatar)) +{ +$err .= ' Erreur : Le format de vôtre avatar est refusé !<br />'; +} + +if($sizavt > 10 * 1024) +{ +$err .= ' Erreur : la taille de vôtre avatar est supérieure à 10Ko ! <br />'; +} + +if($tllavt[0] > 128 OR +$tllavt[1] > 128) +{ +$err .= ' Erreur : vôtre avatar dépasse les dimensions maximales ( 128x128 ) ! <br />'; +} +$page .= $err; + +if($typavt == "image/pjpeg" OR $typavt == "image/jpeg") +{ +$ext_avt = ".jpg"; +} +elseif($typavt == "image/gif") +{ +$ext_avt = ".gif"; +} +@chmod ("avatar", 0777); +if(isset($suppr)) +{ +unlink('images/avatar/'.$userrow[id].'.gif'); +unlink('images/avatar/'.$userrow[id].'.jpg'); +$page .= '<span class="p" style="text-align:center;">Votre avatar a bien été supprimé ! </span>'; +} + + +if (strlen($err) < 1 && $ok == "Ok!" && !isset($suppr)) +{ + +unlink('images/avatar/'.$userrow[id].'.gif'); +unlink('images/avatar/'.$userrow[id].'.jpg'); +move_uploaded_file($tmpavt,'images/avatar/'.$userrow[id].$ext_avt); +$page .= '<br /> <span class="p" style="text-align:center;">Votre avatar a bien été remplacé ! </span>'; + +$up = mysql_query("UPDATE rpg_users SET avatar='".$userrow[id].$ext_avt."' WHERE id='".$userrow[id]."'"); + +} + +display($page, "Changer avatar"); +} + ?> \ No newline at end of file diff --git a/train.php b/train.php @@ -0,0 +1,556 @@ +<?php // train.php :: La fonction d'entraînement. (c) 2005 Aweb antoninweb@hotmail.com + +function fight() { // One big long function that determines the outcome of the fight. + + global $userrow, $controlrow; + $pagearray = array(); + $playerisdead = 0; + + $pagearray["magiclist"] = ""; + $userspells = explode(",",$userrow["spells"]); + $spellquery = doquery("SELECT id,name FROM {{table}}", "spells"); + while ($spellrow = mysql_fetch_array($spellquery)) { + $spell = false; + foreach ($userspells as $a => $b) { + if ($b == $spellrow["id"]) { $spell = true; } + } + if ($spell == true) { + $pagearray["magiclist"] .= "<option value=\"".$spellrow["id"]."\">".$spellrow["name"]."</option>\n"; + } + unset($spell); + } + if ($pagearray["magiclist"] == "") { $pagearray["magiclist"] = "<option value=\"0\">Aucun</option>\n"; } + $magiclist = $pagearray["magiclist"]; + + $chancetoswingfirst = 1; + + // First, check to see if we need to pick a monster. + if ($userrow["currentfight"] == 1) { + + if ($userrow["latitude"] < 0) { $userrow["latitude"] *= -1; } // Equalize negatives. + if ($userrow["longitude"] < 0) { $userrow["longitude"] *= -1; } // Ditto. + $maxlevel = floor(max($userrow["latitude"]+5, $userrow["longitude"]+5) / 5); // One mlevel per five spaces. + if ($maxlevel < 1) { $maxlevel = 1; } + $minlevel = $maxlevel - 2; + if ($minlevel < 1) { $minlevel = 1; } + + + // Pick a monster. + $monsterquery = doquery("SELECT * FROM {{table}} WHERE level>='$minlevel' AND level<='$maxlevel' ORDER BY RAND() LIMIT 1", "monsters"); + $monsterrow = mysql_fetch_array($monsterquery); + $userrow["currentmonster"] = $monsterrow["id"]; + $userrow["currentmonsterhp"] = rand((($monsterrow["maxhp"]/5)*4),$monsterrow["maxhp"]); + if ($userrow["difficulty"] == 2) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $userrow["currentmonsterhp"] = ceil($userrow["currentmonsterhp"] * $controlrow["diff3mod"]); } + $userrow["currentmonstersleep"] = 0; + $userrow["currentmonsterimmune"] = $monsterrow["immune"]; + + $chancetoswingfirst = rand(1,10) + ceil(sqrt($userrow["dexterity"])); + if ($chancetoswingfirst > (rand(1,7) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetoswingfirst = 1; } else { $chancetoswingfirst = 0; } + + unset($monsterquery); + unset($monsterrow); + + } + + // Next, get the monster statistics. + $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); + $monsterrow = mysql_fetch_array($monsterquery); + $pagearray["monstername"] = $monsterrow["name"]; + $pagearray["image"] = $monsterrow["image"]; + $pagearray["immunecontre"] = $monsterrow["immunecontre"]; + $pagearray["image2"] = $userrow["avatar"]; + +// Do run stuff. + if (isset($_POST["run"])) { + + $chancetorun = rand(4,10) + ceil(sqrt($userrow["dexterity"])); + if ($chancetorun > (rand(1,5) + ceil(sqrt($monsterrow["maxdam"])))) { $chancetorun = 1; } else { $chancetorun = 0; } + + if ($chancetorun == 0) { + $pagearray["yourturn"] = "Vous avez essayé de prendre la fuite, mais avez été bloqués par l'avant!<br /><br />"; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + } + + $updatequery = doquery("UPDATE {{table}} SET currentaction='En exploration' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php"); + die(); + + // Do fight stuff. + } elseif (isset($_POST["fight"])) { + + // Your turn. + $pagearray["yourturn"] = ""; + $tohit = ceil(rand($userrow["attackpower"]*.75,$userrow["attackpower"])/3); + $toexcellent = rand(1,150); + if ($toexcellent <= sqrt($userrow["strength"])) { $tohit *= 2; $pagearray["yourturn"] .= "Excellent hit!<br />"; } + $toblock = ceil(rand($monsterrow["armor"]*.75,$monsterrow["armor"])/3); + $tododge = rand(1,200); + if ($tododge <= sqrt($monsterrow["armor"])) { + $tohit = 0; $pagearray["yourturn"] .= "Le monstre à esquivé votre attaque. Aucun dommage n'a été constaté.<br />"; + $monsterdamage = 0; + } else { + $monsterdamage = $tohit - $toblock; + if ($monsterdamage < 1) { $monsterdamage = 1; } + if ($userrow["currentuberdamage"] != 0) { + $monsterdamage += ceil($monsterdamage * ($userrow["currentuberdamage"]/100)); + } + } + $pagearray["yourturn"] .= "Votre attaque sur le monstre a accasionné $monsterdamage points de dommage sur lui.<br /><br />"; + $userrow["currentmonsterhp"] -= $monsterdamage; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + + $pagearray["level"] = $userrow["level"] . "<br /><br />"; + if ($userrow["currentmonsterhp"] <= 0) { + $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php?do=trainvictory"); + die(); + } + + // Monster's turn. + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + // Do spell stuff. + } elseif (isset($_POST["spell"])) { + + // Your turn. + $pickedspell = $_POST["userspell"]; + if ($pickedspell == 0) { display("Vous devez tout d'abord choisir un sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + + $newspellquery = doquery("SELECT * FROM {{table}} WHERE id='$pickedspell' LIMIT 1", "spells"); + $newspellrow = mysql_fetch_array($newspellquery); + $spell = false; + foreach($userspells as $a => $b) { + if ($b == $pickedspell) { $spell = true; } + } + if ($pickedspell != true) { display("Vous n'avez pas encore appris ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + if ($userrow["currentmp"] < $newspellrow["mp"]) { display("Vous n'avez pas assez de points de magie pour éxécuter ce sort. Veuillez retourner et recommencer.", "Erreur"); die(); } + + if ($newspellrow["type"] == 1) { // Heal spell. + $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; + if ($userrow["maxhp"] < $newhp) { $newspellrow["attribute"] = $userrow["maxhp"] - $userrow["currenthp"]; $newhp = $userrow["currenthp"] + $newspellrow["attribute"]; } + $userrow["currenthp"] = $newhp; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "En éxécutant le sort ".$newspellrow["name"]." , vous avez gagné ".$newspellrow["attribute"]." points hit.<br /><br />"; + } elseif ($newspellrow["type"] == 2) { // Hurt spell. + if ($userrow["currentmonsterimmune"] == 0) { + $monsterdamage = rand((($newspellrow["attribute"]/6)*5), $newspellrow["attribute"]); + $userrow["currentmonsterhp"] -= $monsterdamage; + $pagearray["yourturn"] = "En éxécutant le sort".$newspellrow["name"]." , vous avez fait $monsterdamage points de dommage sur le monstre.<br /><br />"; + } else { + $pagearray["yourturn"] = "Vous avez éxécuté le sort".$newspellrow["name"]." , mais le monstre est immunisé contre ca.<br /><br />"; + } + $userrow["currentmp"] -= $newspellrow["mp"]; + } elseif ($newspellrow["type"] == 3) { // Sleep spell. + if ($userrow["currentmonsterimmune"] != 2) { + $userrow["currentmonstersleep"] = $newspellrow["attribute"]; + $pagearray["yourturn"] = "En éxécutant le sort ".$newspellrow["name"]." , le montre s'est endormi.<br /><br />"; + } else { + $pagearray["yourturn"] = "Vous avez éxécuté le sort ".$newspellrow["name"]." , mais le monstre est immunisé contre ca.<br /><br />"; + } + $userrow["currentmp"] -= $newspellrow["mp"]; + } elseif ($newspellrow["type"] == 4) { // +Damage spell. + $userrow["currentuberdamage"] = $newspellrow["attribute"]; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "Vous avez éxécuté le sort ".$newspellrow["name"]." , et vous avez eu ".$newspellrow["attribute"]."% de dommage sur vous.<br /><br />"; + } elseif ($newspellrow["type"] == 5) { // +Defense spell. + $userrow["currentuberdefense"] = $newspellrow["attribute"]; + $userrow["currentmp"] -= $newspellrow["mp"]; + $pagearray["yourturn"] = "Vous avez éxécuté le sort".$newspellrow["name"]." , et vous avez gagné ".$newspellrow["attribute"]."% de défense à la fin de ce combat.<br /><br />"; + } + + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + +if ($userrow["currentmonsterhp"] <= 0) { + $updatequery = doquery("UPDATE {{table}} SET currentmonsterhp='0',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + header("Location: index.php?do=trainvictory"); + die(); + } + + // Monster's turn. + $pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivé l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + if ($tohit <= $toblock) { $tohit = $toblock + 1; } + $persondamage = $tohit - $toblock; + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + // Do a monster's turn if person lost the chance to swing first. Serves him right! + } elseif ( $chancetoswingfirst == 0 ) { + $pagearray["yourturn"] = "Le monstre attaque avant que vous soyez prêt!<br /><br />"; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + + +$pagearray["monsterturn"] = ""; + if ($userrow["currentmonstersleep"] != 0) { // Check to wake up. + $chancetowake = rand(1,15); + if ($chancetowake > $userrow["currentmonstersleep"]) { + $userrow["currentmonstersleep"] = 0; + $pagearray["monsterturn"] .= "Le monstre s'est réveillé.<br />"; + } else { + $pagearray["monsterturn"] .= "Le monstre est encore endormi.<br />"; + } + } + if ($userrow["currentmonstersleep"] == 0) { // Only do this if the monster is awake. + $tohit = ceil(rand($monsterrow["maxdam"]*.5,$monsterrow["maxdam"])); + if ($userrow["difficulty"] == 2) { $tohit = ceil($tohit * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $tohit = ceil($tohit * $controlrow["diff3mod"]); } + $toblock = ceil(rand($userrow["defensepower"]*.75,$userrow["defensepower"])/4); + $tododge = rand(1,150); + if ($tododge <= sqrt($userrow["dexterity"])) { + $tohit = 0; $pagearray["monsterturn"] .= "Vous avez esquivez l'attaque du monstre. Il n'y a eu aucun domages.<br />"; + $persondamage = 0; + } else { + $persondamage = $tohit - $toblock; + if ($persondamage < 1) { $persondamage = 1; } + if ($userrow["currentuberdefense"] != 0) { + $persondamage -= ceil($persondamage * ($userrow["currentuberdefense"]/100)); + } + if ($persondamage < 1) { $persondamage = 1; } + } + $pagearray["monsterturn"] .= "Le monstre vous a attaqué, et a occasionné $persondamage points de dommage sur vous.<br /><br />"; + $userrow["currenthp"] -= $persondamage; + if ($userrow["currenthp"] <= 0) { + $newgold = ceil($userrow["gold"]/2); + $newhp = ceil($userrow["maxhp"]/4); + $updatequery = doquery("UPDATE {{table}} SET currenthp='$newhp',currentaction='En ville',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentfight='0',latitude='0',longitude='0',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + $playerisdead = 1; + } + } + + } else { + $pagearray["yourturn"] = ""; + $pagearray["monsterhp"] = "HP du monstre: " . $userrow["currentmonsterhp"] . "";$pagearray["monsterturn"] = ""; + $pagearray["levelmonstre"] = "Niv. du monstre: " . $monsterrow["level"] . ""; + +} + + $newmonster = $userrow["currentmonster"]; + + $newmonsterhp = $userrow["currentmonsterhp"]; + $newmonstersleep = $userrow["currentmonstersleep"]; + $newmonsterimmune = $userrow["currentmonsterimmune"]; + $newuberdamage = $userrow["currentuberdamage"]; + $newuberdefense = $userrow["currentuberdefense"]; + $newfight = $userrow["currentfight"] + 1; + $newhp = $userrow["currenthp"]; + $newmp = $userrow["currentmp"]; + +if ($playerisdead != 1) { +$pagearray["command"] = <<<END +Que voulez vous faire?<br /><br /> +<form action="index.php?do=train" method="post"> + <input type="submit" name="fight" value="Attaquer" /><br /><br /> + <select name="userspell"><option value="0">Les Sorts</option>$magiclist</select><input type="submit" name="spell" value="Exécuter" /><br /><br /> + <A HREF="index.php">S'enfuir et retourner à la ville +</A><br /><br /> +</form> +END; + $updatequery = doquery("UPDATE {{table}} SET currentaction='En combat',currenthp='$newhp',currentmp='$newmp',currentfight='$newfight',currentmonster='$newmonster',currentmonsterhp='$newmonsterhp',currentmonstersleep='$newmonstersleep',currentmonsterimmune='$newmonsterimmune',currentuberdamage='$newuberdamage',currentuberdefense='$newuberdefense' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); +} else { + $pagearray["command"] = "<b>Vous êtes mort.</b><br /><br />En conséquence, vous avez perdu la moitié de vos gils. Cependant, vous avez gardé une partie de vos points hit, pour continuer votre voyage.<br /><br />Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>, et nous espéront que vous ferez mieux la prochaine fois."; +} + + // Finalize page and display it. + $template = gettemplate("fight"); + $page = parsetemplate($template,$pagearray); + + display($page, "En combat"); + +} + +function trainvictory() { + + global $userrow, $controlrow; + + if ($userrow["currentmonsterhp"] != 0) { header("Location: index.php?do=fight"); die(); } + if ($userrow["currentfight"] == 0) { header("Location: index.php"); die(); } + + $monsterquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["currentmonster"]."' LIMIT 1", "monsters"); + $monsterrow = mysql_fetch_array($monsterquery); + + $exp = rand((($monsterrow["maxexp"]/6)*5),$monsterrow["maxexp"]); + if ($exp < 1) { $exp = 1; } + if ($userrow["difficulty"] == 2) { $exp = ceil($exp * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $exp = ceil($exp * $controlrow["diff3mod"]); } + if ($userrow["expbonus"] != 0) { $exp += ceil(($userrow["expbonus"]/100)*$exp); } + $gold = rand((($monsterrow["maxgold"]/6)*5),$monsterrow["maxgold"]); + if ($gold < 1) { $gold = 1; } + if ($userrow["difficulty"] == 2) { $gold = ceil($gold * $controlrow["diff2mod"]); } + if ($userrow["difficulty"] == 3) { $gold = ceil($gold * $controlrow["diff3mod"]); } + if ($userrow["goldbonus"] != 0) { $gold += ceil(($userrow["goldbonus"]/100)*$exp); } + if ($userrow["experience"] + $exp < 16777215) { $newexp = $userrow["experience"] + $exp; $warnexp = ""; } else { $newexp = $userrow["experience"]; $exp = 0; $warnexp = "You have maxed out your experience points."; } + if ($userrow["gold"] + $gold < 16777215) { $newgold = $userrow["gold"] + $gold; $warngold = ""; } else { $newgold = $userrow["gold"]; $gold = 0; $warngold = "You have maxed out your experience points."; } + + $levelquery = doquery("SELECT * FROM {{table}} WHERE id='".($userrow["level"]+1)."' LIMIT 1", "levels"); + if (mysql_num_rows($levelquery) == 1) { $levelrow = mysql_fetch_array($levelquery); } + + if ($userrow["level"] < 100) { + if ($newexp >= $levelrow[$userrow["charclass"]."_exp"]) { + $newhp = $userrow["maxhp"] + $levelrow[$userrow["charclass"]."_hp"]; + $newmp = $userrow["maxmp"] + $levelrow[$userrow["charclass"]."_mp"]; + $newtp = $userrow["maxtp"] + $levelrow[$userrow["charclass"]."_tp"]; + $newstrength = $userrow["strength"] + $levelrow[$userrow["charclass"]."_strength"]; + $newdexterity = $userrow["dexterity"] + $levelrow[$userrow["charclass"]."_dexterity"]; + $newattack = $userrow["attackpower"] + $levelrow[$userrow["charclass"]."_strength"]; + $newdefense = $userrow["defensepower"] + $levelrow[$userrow["charclass"]."_dexterity"]; + $newlevel = $levelrow["id"]; + + if ($levelrow[$userrow["charclass"]."_spells"] != 0) { + $userspells = $userrow["spells"] . ",".$levelrow[$userrow["charclass"]."_spells"]; + $newspell = "spells='$userspells',"; + $spelltext = "Vous avez appris un nouveau sort<br />"; + } else { $spelltext = ""; $newspell=""; } + + $page = "<center> <br> Trop drôle, l'autre va avoir mal à la tête pendant un bon moment !!!!<br> <br> <img src=./images/vainqueur.gif /> <br> <br> Félicitation. Vous avez battu le ".$monsterrow["name"].".<br />Vous gagnez $exp d'expérience. $warnexp <br />Vous gagnez $gold gils. $warngold <br /><br /><b>Vous avez gagné 1 niveau!</b><br /><br />Vous gagnez ".$levelrow[$userrow["charclass"]."_hp"]." points hit.<br />Vous gagnez ".$levelrow[$userrow["charclass"]."_mp"]." points de magie.<br />Vous gagnez ".$levelrow[$userrow["charclass"]."_tp"]." points de voyage.<br />Vous gagnez ".$levelrow[$userrow["charclass"]."_strength"]." points de force.<br />Vous gagnez ".$levelrow[$userrow["charclass"]."_dexterity"]." points de dextérité.<br />$spelltext<br />Vous pouvez maintenant <br> <a href=\"index.php\">retourner à la ville</a>.<br>Ou continuer l'entraînement"; + $title = "Le courage et le bon esprit vous ont bien servi!"; + $dropcode = ""; + } else { + $newhp = $userrow["maxhp"]; + $newmp = $userrow["maxmp"]; + $newtp = $userrow["maxtp"]; + $newstrength = $userrow["strength"]; + $newdexterity = $userrow["dexterity"]; + $newattack = $userrow["attackpower"]; + $newdefense = $userrow["defensepower"]; + $newlevel = $userrow["level"]; + $newspell = ""; + $page = "<center> <br> Trop drôle, l'autre va avoir mal à la tête pendant un bon moment !!!!<br> <br> <img src=./images/vainqueur.gif /> <br> <br> Félicitation. Vous avez battu le ".$monsterrow["name"].".<br />Vous gagnez $exp points d'experience. $warnexp <br />Vous gagnez $gold gils. $warngold <br /><br />"; + + if (rand(1,30) == 1) { + $dropquery = doquery("SELECT * FROM {{table}} WHERE mlevel <= '".$monsterrow["level"]."' ORDER BY RAND() LIMIT 1", "drops"); + $droprow = mysql_fetch_array($dropquery); + $dropcode = "dropcode='".$droprow["id"]."',"; + $page .= "Ce monstre a laisser tomber un objet. <a href=\"index.php?do=traindrop\">Cliquez ici</a> pour le rammasser et vous équiper de cet article, ou vous pouvez également passer et <br> <a href=\"index.php\">retourner à la ville</a>."; + } else { + $dropcode = ""; + $page .= "Vous pouvez maintenant <br><a href=\"index.php\">retourner à la ville</a>.</center> "; + } + + $title = "Victoire!"; + } + } + + $updatequery = doquery("UPDATE {{table}} SET currentaction='En exploration',level='$newlevel',maxhp='$newhp',maxmp='$newmp',maxtp='$newtp',strength='$newstrength',dexterity='$newdexterity',attackpower='$newattack',defensepower='$newdefense', $newspell currentfight='0',currentmonster='0',currentmonsterhp='0',currentmonstersleep='0',currentmonsterimmune='0',currentuberdamage='0',currentuberdefense='0',$dropcode experience='$newexp',gold='$newgold' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + + display($page, $title); + +} + +function drop() { + + global $userrow; + + if ($userrow["dropcode"] == 0) { header("Location: index.php"); die(); } + + $dropquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["dropcode"]."' LIMIT 1", "drops"); + $droprow = mysql_fetch_array($dropquery); + + if (isset($_POST["submit"])) { + + $slot = $_POST["slot"]; + + if ($slot == 0) { display("Veuillez retourner et choisir une fente de l'inventaire pour continuer.","Erreur"); } + + if ($userrow["slot".$slot."id"] != 0) { + + $slotquery = doquery("SELECT * FROM {{table}} WHERE id='".$userrow["slot".$slot."id"]."' LIMIT 1", "drops"); + $slotrow = mysql_fetch_array($slotquery); + + $old1 = explode(",",$slotrow["attribute1"]); + if ($slotrow["attribute2"] != "X") { $old2 = explode(",",$slotrow["attribute2"]); } else { $old2 = array(0=>"maxhp",1=>0); } + $new1 = explode(",",$droprow["attribute1"]); + if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } + + $userrow[$old1[0]] -= $old1[1]; + $userrow[$old2[0]] -= $old2[1]; + if ($old1[0] == "strength") { $userrow["attackpower"] -= $old1[1]; } + if ($old1[0] == "dexterity") { $userrow["defensepower"] -= $old1[1]; } + if ($old2[0] == "strength") { $userrow["attackpower"] -= $old2[1]; } + if ($old2[0] == "dexterity") { $userrow["defensepower"] -= $old2[1]; } + + $userrow[$new1[0]] += $new1[1]; + $userrow[$new2[0]] += $new2[1]; + if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } + if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } + if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } + if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } + + if ($userrow["currenthp"] > $userrow["maxhp"]) { $userrow["currenthp"] = $userrow["maxhp"]; } + if ($userrow["currentmp"] > $userrow["maxmp"]) { $userrow["currentmp"] = $userrow["maxmp"]; } + if ($userrow["currenttp"] > $userrow["maxtp"]) { $userrow["currenttp"] = $userrow["maxtp"]; } + + $newname = addslashes($droprow["name"]); + $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$old1[0]='".$userrow[$old1[0]]."',$old2[0]='".$userrow[$old2[0]]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',currenthp='".$userrow["currenthp"]."',currentmp='".$userrow["currentmp"]."',currenttp='".$userrow["currenttp"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + } else { + + $new1 = explode(",",$droprow["attribute1"]); + if ($droprow["attribute2"] != "X") { $new2 = explode(",",$droprow["attribute2"]); } else { $new2 = array(0=>"maxhp",1=>0); } + + $userrow[$new1[0]] += $new1[1]; + $userrow[$new2[0]] += $new2[1]; + if ($new1[0] == "strength") { $userrow["attackpower"] += $new1[1]; } + if ($new1[0] == "dexterity") { $userrow["defensepower"] += $new1[1]; } + if ($new2[0] == "strength") { $userrow["attackpower"] += $new2[1]; } + if ($new2[0] == "dexterity") { $userrow["defensepower"] += $new2[1]; } + + $newname = addslashes($droprow["name"]); + $query = doquery("UPDATE {{table}} SET slot".$_POST["slot"]."name='$newname',slot".$_POST["slot"]."id='".$droprow["id"]."',$new1[0]='".$userrow[$new1[0]]."',$new2[0]='".$userrow[$new2[0]]."',attackpower='".$userrow["attackpower"]."',defensepower='".$userrow["defensepower"]."',dropcode='0' WHERE id='".$userrow["id"]."' LIMIT 1", "users"); + + } + $page = "L'objet a été équipé. Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>.</center> "; + display($page, "Item Drop"); + + } + + $attributearray = array("maxhp"=>"HP Max", + "maxmp"=>"MP Max", + "maxtp"=>"TP Max", + "defensepower"=>"Pouvoir de défense", + "attackpower"=>"Pouvoir d'attaque", + "strength"=>"Force", + "dexterity"=>"Dextérité", + "expbonus"=>"Experience Bonus", + "goldbonus"=>"Gils Bonus"); + + $page = "Le monstre a fait tomber l'objet suivant: <b>".$droprow["name"]."</b><br /><br />"; + $page .= "Cet objet a l'attribut(s) suivant:<br />"; + + $attribute1 = explode(",",$droprow["attribute1"]); + $page .= $attributearray[$attribute1[0]]; + if ($attribute1[1] > 0) { $page .= " +" . $attribute1[1] . "<br />"; } else { $page .= $attribute1[1] . "<br />"; } + + if ($droprow["attribute2"] != "X") { + $attribute2 = explode(",",$droprow["attribute2"]); + $page .= $attributearray[$attribute2[0]]; + if ($attribute2[1] > 0) { $page .= " +" . $attribute2[1] . "<br />"; } else { $page .= $attribute2[1] . "<br />"; } + } + + $page .= "<br />Choisissez une fente dans l'inventaire à partir de la liste ci-dessous pour vous équiper de cet objet. Si la fente de l'inventaire est déja pleine, l'ancien objet sera jeté."; + $page .= "<form action=\"index.php?do=traindrop\" method=\"post\"><select name=\"slot\"><option value=\"0\">Les Fentes</option><option value=\"1\">Fente 1: ".$userrow["slot1name"]."</option><option value=\"2\">Fente 2: ".$userrow["slot2name"]."</option><option value=\"3\">Fente 3: ".$userrow["slot3name"]."</option></select> <input type=\"submit\" name=\"submit\" value=\"Valider\" /></form>"; + $page .= "Vous pouvez également choisir de <a href=\"index.php\">retourner à la ville</a> et renoncer à cet objet."; + + display($page, "Item Drop"); + +} + + +function dead() { + + $page = "<b>Vous êtes mort.</b><br /><br />En conséquence, vous avez perdu la moitié de vos gils. Cependant, vous avez gardé une partie de vos points hit, pour continuer votre voyage.<br /><br />Vous pouvez maintenant <a href=\"index.php\">retourner à la ville</a>, et nous espérons que vous ferez mieux la prochaine fois."; + +} + + + +?> +\ No newline at end of file diff --git a/upgrade_to_110.php b/upgrade_to_110.php @@ -1,96 +0,0 @@ -<? - -include('config.php'); -include('lib.php'); -$link = opendb(); -$prefix = $dbsettings["prefix"]; - -// Thanks to Predrag Supurovic from php.net for this function! -function dobatch ($p_query) { - $query_split = preg_split ("/[;]+/", $p_query); - foreach ($query_split as $command_line) { - $command_line = trim($command_line); - if ($command_line != '') { - $query_result = mysql_query($command_line); - if ($query_result == 0) { - break; - }; - }; - }; - return $query_result; -} - -if (isset($_POST["submit"])) { - -$control = $prefix . "_control"; -$users = $prefix . "_users"; -$query = <<<END -DROP TABLE IF EXISTS `$control`; -CREATE TABLE `$control` ( - `id` tinyint(3) unsigned NOT NULL auto_increment, - `gamename` varchar(50) NOT NULL default '', - `gamesize` smallint(5) unsigned NOT NULL default '0', - `gameopen` tinyint(3) unsigned NOT NULL default '0', - `gameurl` varchar(200) NOT NULL default '', - `adminemail` varchar(100) NOT NULL default '', - `forumtype` tinyint(3) unsigned NOT NULL default '0', - `forumaddress` varchar(200) NOT NULL default '', - `class1name` varchar(50) NOT NULL default '', - `class2name` varchar(50) NOT NULL default '', - `class3name` varchar(50) NOT NULL default '', - `diff1name` varchar(50) NOT NULL default '', - `diff1mod` float unsigned NOT NULL default '0', - `diff2name` varchar(50) NOT NULL default '', - `diff2mod` float unsigned NOT NULL default '0', - `diff3name` varchar(50) NOT NULL default '', - `diff3mod` float unsigned NOT NULL default '0', - `compression` tinyint(3) unsigned NOT NULL default '0', - `verifyemail` tinyint(3) unsigned NOT NULL default '0', - `shownews` tinyint(3) unsigned NOT NULL default '0', - `showbabble` tinyint(3) unsigned NOT NULL default '0', - `showonline` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`id`) -) TYPE=MyISAM; -END; -if (dobatch($query) == 1) { echo "Control table upgraded.<br />"; } else { echo "Error upgrading Control table."; } -unset($query); - -$query = <<<END -INSERT INTO `$control` VALUES (1, 'Dragon Knight', 250, 0, '', '', 1, '', 'Mage', 'Warrior', 'Paladin', 'Easy', '1', 'Medium', '1.2', 'Hard', '1.5', 1, 1, 1, 1, 1); -END; -if (dobatch($query) == 1) { echo "Control table populated.<br />"; } else { echo "Error populating Control table."; } -unset($query); - -$query = mysql_query("SELECT * FROM $users ORDER BY id") or die(mysql_error()); -$errors = 0; $errorlist = ""; -while ($row = mysql_fetch_array($query)) { - $id = $row["id"]; - $oldspells = explode(",",$row["spells"]); - $newspells = "0,"; - $oldtowns = explode(",",$row["towns"]); - $newtowns = "0,"; - foreach($oldspells as $a => $b) { - if ($b == 1) { $newspells .= "$a,"; } - } - $newspells = rtrim($newspells,","); - foreach($oldtowns as $c => $d) { - if ($d == 1) { $newtowns .= "$c,"; } - } - $newtowns = rtrim($newtowns,","); - $update = mysql_query("UPDATE $users SET spells='$newspells',towns='$newtowns',verify='1' WHERE id='$id' LIMIT 1"); - if ($update == false) { $errors++; $errorlist .= mysql_error() . "<br />"; } else { echo "User $id upgraded.<br />"; } -} -if ($errors != 0) { - echo "<br /><b><span style=\"color:red\">The following errors occurred while upgrading the users list:</span></b><br />$errorlist"; -} else { - echo "<br /><b>The upgrade completed successfully. Please log in to the game and visit the control panel to update your main game settings.<br /><br />You should also delete this file from your Dragon Knight directory for security reasons.</b>"; -} - -} else { - - echo "Click the button below to run the upgrade script.<br /><form action=\"upgrade_to_110.php\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Upgrade\" /></form>"; - die(); - -} - -?> -\ No newline at end of file diff --git a/upgrade_to_112.php b/upgrade_to_112.php @@ -1,361 +0,0 @@ -<? - -include('config.php'); -include('lib.php'); -$link = opendb(); -$prefix = $dbsettings["prefix"]; - -// Thanks to Predrag Supurovic from php.net for this function! -function dobatch ($p_query) { - $query_split = preg_split ("/[;]+/", $p_query); - foreach ($query_split as $command_line) { - $command_line = trim($command_line); - if ($command_line != '') { - $query_result = mysql_query($command_line); - if ($query_result == 0) { - break; - }; - }; - }; - return $query_result; -} - -if (isset($_POST["submit"])) { - -$users = $prefix . "_users"; - -$levels = array(1=>"",2=>"",3=>""); -$levels["1"] = array( - 1=>"0", - 2=>"0,1", - 3=>"0,1", - 4=>"0,1,6", - 5=>"0,1,6", - 6=>"0,1,6", - 7=>"0,1,6,11", - 8=>"0,1,6,11", - 9=>"0,1,6,11,2", - 10=>"0,1,6,11,2", - 11=>"0,1,6,11,2", - 12=>"0,1,6,11,2,7", - 13=>"0,1,6,11,2,7", - 14=>"0,1,6,11,2,7,17", - 15=>"0,1,6,11,2,7,17", - 16=>"0,1,6,11,2,7,17", - 17=>"0,1,6,11,2,7,17,12", - 18=>"0,1,6,11,2,7,17,12", - 19=>"0,1,6,11,2,7,17,12", - 20=>"0,1,6,11,2,7,17,12", - 21=>"0,1,6,11,2,7,17,12", - 22=>"0,1,6,11,2,7,17,12", - 23=>"0,1,6,11,2,7,17,12", - 24=>"0,1,6,11,2,7,17,12", - 25=>"0,1,6,11,2,7,17,12,3", - 26=>"0,1,6,11,2,7,17,12,3", - 27=>"0,1,6,11,2,7,17,12,3", - 28=>"0,1,6,11,2,7,17,12,3", - 29=>"0,1,6,11,2,7,17,12,3", - 30=>"0,1,6,11,2,7,17,12,3", - 31=>"0,1,6,11,2,7,17,12,3,8", - 32=>"0,1,6,11,2,7,17,12,3,8", - 33=>"0,1,6,11,2,7,17,12,3,8", - 34=>"0,1,6,11,2,7,17,12,3,8", - 35=>"0,1,6,11,2,7,17,12,3,8", - 36=>"0,1,6,11,2,7,17,12,3,8,18", - 37=>"0,1,6,11,2,7,17,12,3,8,18", - 38=>"0,1,6,11,2,7,17,12,3,8,18", - 39=>"0,1,6,11,2,7,17,12,3,8,18", - 40=>"0,1,6,11,2,7,17,12,3,8,18,13", - 41=>"0,1,6,11,2,7,17,12,3,8,18,13", - 42=>"0,1,6,11,2,7,17,12,3,8,18,13", - 43=>"0,1,6,11,2,7,17,12,3,8,18,13", - 44=>"0,1,6,11,2,7,17,12,3,8,18,13", - 45=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 46=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 47=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 48=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 49=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 50=>"0,1,6,11,2,7,17,12,3,8,18,13,4", - 51=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 52=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 53=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 54=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 55=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 56=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 57=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 58=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 59=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9", - 60=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 61=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 62=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 63=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 64=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 65=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 66=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 67=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 68=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 69=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19", - 70=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 71=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 72=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 73=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 74=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 75=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 76=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 77=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 78=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5", - 79=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 80=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 81=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 82=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 83=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 84=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 85=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 86=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 87=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 88=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 89=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 90=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 91=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 92=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 93=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 94=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 95=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 96=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 97=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 98=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10", - 99=>"0,1,6,11,2,7,17,12,3,8,18,13,4,9,19,5,10"); - -$levels["2"] = array( - 1=>"0", - 2=>"0,1", - 3=>"0,1", - 4=>"0,1", - 5=>"0,1,6", - 6=>"0,1,6", - 7=>"0,1,6", - 8=>"0,1,6,11", - 9=>"0,1,6,11", - 10=>"0,1,6,11", - 11=>"0,1,6,11,2", - 12=>"0,1,6,11,2", - 13=>"0,1,6,11,2", - 14=>"0,1,6,11,2,7", - 15=>"0,1,6,11,2,7", - 16=>"0,1,6,11,2,7", - 17=>"0,1,6,11,2,7", - 18=>"0,1,6,11,2,7,14", - 19=>"0,1,6,11,2,7,14", - 20=>"0,1,6,11,2,7,14", - 21=>"0,1,6,11,2,7,14", - 22=>"0,1,6,11,2,7,14,12", - 23=>"0,1,6,11,2,7,14,12", - 24=>"0,1,6,11,2,7,14,12", - 25=>"0,1,6,11,2,7,14,12,17", - 26=>"0,1,6,11,2,7,14,12,17", - 27=>"0,1,6,11,2,7,14,12,17", - 28=>"0,1,6,11,2,7,14,12,17", - 29=>"0,1,6,11,2,7,14,12,17,3", - 30=>"0,1,6,11,2,7,14,12,17,3", - 31=>"0,1,6,11,2,7,14,12,17,3", - 32=>"0,1,6,11,2,7,14,12,17,3", - 33=>"0,1,6,11,2,7,14,12,17,3", - 34=>"0,1,6,11,2,7,14,12,17,3,8", - 35=>"0,1,6,11,2,7,14,12,17,3,8", - 36=>"0,1,6,11,2,7,14,12,17,3,8", - 37=>"0,1,6,11,2,7,14,12,17,3,8", - 38=>"0,1,6,11,2,7,14,12,17,3,8,15", - 39=>"0,1,6,11,2,7,14,12,17,3,8,15", - 40=>"0,1,6,11,2,7,14,12,17,3,8,15", - 41=>"0,1,6,11,2,7,14,12,17,3,8,15", - 42=>"0,1,6,11,2,7,14,12,17,3,8,15", - 43=>"0,1,6,11,2,7,14,12,17,3,8,15", - 44=>"0,1,6,11,2,7,14,12,17,3,8,15", - 45=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 46=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 47=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 48=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 49=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 50=>"0,1,6,11,2,7,14,12,17,3,8,15,18", - 51=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 52=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 53=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 54=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 55=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 56=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 57=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13", - 58=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 59=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 60=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 61=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 62=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 63=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 64=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 65=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 66=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 67=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 68=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 69=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19", - 70=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 71=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 72=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 73=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 74=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 75=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 76=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 77=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 78=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 79=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 80=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 81=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 82=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 83=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 84=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 85=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 86=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 87=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 88=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 89=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 90=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 91=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 92=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 93=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 94=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 95=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 96=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 97=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 98=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16", - 99=>"0,1,6,11,2,7,14,12,17,3,8,15,18,13,19,16"); - -$levels["3"] = array( - 1=>"0", - 2=>"0,1", - 3=>"0,1", - 4=>"0,1", - 5=>"0,1,6", - 6=>"0,1,6", - 7=>"0,1,6", - 8=>"0,1,6,11", - 9=>"0,1,6,11", - 10=>"0,1,6,11", - 11=>"0,1,6,11,2", - 12=>"0,1,6,11,2", - 13=>"0,1,6,11,2", - 14=>"0,1,6,11,2,7", - 15=>"0,1,6,11,2,7", - 16=>"0,1,6,11,2,7", - 17=>"0,1,6,11,2,7", - 18=>"0,1,6,11,2,7,17", - 19=>"0,1,6,11,2,7,17", - 20=>"0,1,6,11,2,7,17", - 21=>"0,1,6,11,2,7,17", - 22=>"0,1,6,11,2,7,17,12", - 23=>"0,1,6,11,2,7,17,12", - 24=>"0,1,6,11,2,7,17,12", - 25=>"0,1,6,11,2,7,17,12,14", - 26=>"0,1,6,11,2,7,17,12,14", - 27=>"0,1,6,11,2,7,17,12,14", - 28=>"0,1,6,11,2,7,17,12,14", - 29=>"0,1,6,11,2,7,17,12,14,3", - 30=>"0,1,6,11,2,7,17,12,14,3", - 31=>"0,1,6,11,2,7,17,12,14,3", - 32=>"0,1,6,11,2,7,17,12,14,3", - 33=>"0,1,6,11,2,7,17,12,14,3", - 34=>"0,1,6,11,2,7,17,12,14,3,8", - 35=>"0,1,6,11,2,7,17,12,14,3,8", - 36=>"0,1,6,11,2,7,17,12,14,3,8", - 37=>"0,1,6,11,2,7,17,12,14,3,8", - 38=>"0,1,6,11,2,7,17,12,14,3,8,18", - 39=>"0,1,6,11,2,7,17,12,14,3,8,18", - 40=>"0,1,6,11,2,7,17,12,14,3,8,18", - 41=>"0,1,6,11,2,7,17,12,14,3,8,18", - 42=>"0,1,6,11,2,7,17,12,14,3,8,18", - 43=>"0,1,6,11,2,7,17,12,14,3,8,18", - 44=>"0,1,6,11,2,7,17,12,14,3,8,18", - 45=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 46=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 47=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 48=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 49=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 50=>"0,1,6,11,2,7,17,12,14,3,8,18,4", - 51=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13", - 52=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13", - 53=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13", - 54=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13", - 55=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13", - 56=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9", - 57=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9", - 58=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9", - 59=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9", - 60=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 61=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 62=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 63=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 64=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 65=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 66=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 67=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 68=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 69=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 70=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 71=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 72=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 73=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 74=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 75=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 76=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 77=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 78=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 79=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 80=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 81=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 82=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 83=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 84=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 85=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 86=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 87=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 88=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 89=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 90=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 91=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 92=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 93=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 94=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 95=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 96=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 97=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 98=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15", - 99=>"0,1,6,11,2,7,17,12,14,3,8,18,4,13,9,15"); - -$errors = 0; $errorlist = ""; - -$mainquery = mysql_query("SELECT id,level,charclass,spells FROM $users ORDER BY id"); -while ($mainrow = mysql_fetch_array($mainquery)) { - $level = $mainrow["level"]; - $charclass = $mainrow["charclass"]; - $newspell = $levels[$charclass][$level]; - $newquery = mysql_query("UPDATE $users SET spells='$newspell' WHERE id='".$mainrow["id"]."' LIMIT 1"); - if ($newquery != true) { - $errors++; $errorlist .= mysql_error() . "<br />"; - } -} - -$users = $prefix . "_users"; -$query = <<<END -ALTER TABLE `$users` CHANGE `towns` `towns` VARCHAR( 50 ) DEFAULT '0' NOT NULL; -ALTER TABLE `$users` CHANGE `spells` `spells` VARCHAR( 50 ) DEFAULT '0' NOT NULL; -END; -if (dobatch($query) == 1) { echo "Users table upgraded.<br />"; } else { $errors++; $errorlist .= "Error upgrading Users table.<br />"; } -unset($query); - -if ($errors == 0) { echo "<br />Upgrade finished."; } else { echo $errorlist; } - -} else { - - echo "Click the button below to run the upgrade script.<br /><form action=\"upgrade_to_112.php\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Upgrade\" /></form>"; - die(); - -} - -?> -\ No newline at end of file diff --git a/users.php b/users.php @@ -1,4 +1,4 @@ -<?php // users.php :: Handles user account functions. +<?php // users.php :: Concerne la création et la gestion des comptes. include('lib.php'); $link = opendb(); @@ -13,10 +13,12 @@ if (isset($_GET["do"])) { } -function register() { // Register a new account. +function register() { // Créer un nouveau compte. $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $controlrow = mysql_fetch_array($controlquery); + $parainquery = doquery("SELECT * FROM {{table}} WHERE username='".$_POST['parain']."' LIMIT 1", "users"); + $parainrow = mysql_fetch_array($parainquery); if (isset($_POST["submit"])) { @@ -24,22 +26,22 @@ function register() { // Register a new account. $errors = 0; $errorlist = ""; - // Process username. - if ($username == "") { $errors++; $errorlist .= "Username field is required.<br />"; } - if (preg_match("/[^A-z0-9_\-]/", $username)==1) { $errors++; $errorlist .= "Username must be alphanumeric.<br />"; } // Thanks to "Carlos Pires" from php.net! + // Processus des ID. + if ($username == "") { $errors++; $errorlist .= "Le champs 'ID' est éxigé.<br />"; } + if (preg_match("/[^A-z0-9_\-]/", $username)==1) { $errors++; $errorlist .= "Votre ID doit être écrit en caractères alphanumérique.<br />"; } // Merci à "Carlos Pires" from de.net! $usernamequery = doquery("SELECT username FROM {{table}} WHERE username='$username' LIMIT 1","users"); - if (mysql_num_rows($usernamequery) > 0) { $errors++; $errorlist .= "Username already taken - unique username required.<br />"; } - - // Process email address. - if ($email1 == "" || $email2 == "") { $errors++; $errorlist .= "Email fields are required.<br />"; } - if ($email1 != $email2) { $errors++; $errorlist .= "Emails don't match.<br />"; } - if (! is_email($email1)) { $errors++; $errorlist .= "Email isn't valid.<br />"; } + if (mysql_num_rows($usernamequery) > 0) { $errors++; $errorlist .= "L'ID est déja pris.<br />"; } + + // Processus des adresse email. + if ($email1 == "" || $email2 == "") { $errors++; $errorlist .= "Le champs 'Email' est exigé .<br />"; } + if ($email1 != $email2) { $errors++; $errorlist .= "Les 2 adresses Emails que vous avez inscrit ne sont pas indentiques.<br />"; } + if (! is_email($email1)) { $errors++; $errorlist .= "L'adresse Email que vous avez inscrit est invalide.<br />"; } $emailquery = doquery("SELECT email FROM {{table}} WHERE email='$email1' LIMIT 1","users"); - if (mysql_num_rows($emailquery) > 0) { $errors++; $errorlist .= "Email already taken - unique email address required.<br />"; } + if (mysql_num_rows($emailquery) > 0) { $errors++; $errorlist .= "L'adresse Email est déja pris.<br />"; } - // Process password. - if (preg_match("/[^A-z0-9_\-]/", $password1)==1) { $errors++; $errorlist .= "Password must be alphanumeric.<br />"; } // Thanks to "Carlos Pires" from php.net! - if ($password1 != $password2) { $errors++; $errorlist .= "Passwords don't match.<br />"; } + // Processus des PW. + if (preg_match("/[^A-z0-9_\-]/", $password1)==1) { $errors++; $errorlist .= "Votre PW doit être écrit en caractères alphanumérique.<br />"; } // Merci à "Carlos Pires" de php.net! + if ($password1 != $password2) { $errors++; $errorlist .= "Les 2 Pw que vous avez inscrit ne sont pas indentiques.<br />"; } $password = md5($password1); if ($errors == 0) { @@ -52,22 +54,24 @@ function register() { // Register a new account. } else { $verifycode='1'; } - - $query = doquery("INSERT INTO {{table}} SET id='',regdate=NOW(),verify='$verifycode',username='$username',password='$password',email='$email1',charname='$charname',charclass='$charclass',difficulty='$difficulty'", "users") or die(mysql_error()); - - if ($controlrow["verifyemail"] == 1) { + + $newpar = $parainrow["bank"] + 50 ; + $query = doquery("UPDATE {{table}} SET bank='$newpar' WHERE username='".$_POST['parain']."' ", "users") or die(mysql_error()); + $query = doquery("INSERT INTO {{table}} SET id='',regdate=NOW(),verify='$verifycode',username='$username',password='$password',email='$email1',charname='$charname',miniavatar='$avatar',avatar='$avatar',charclass='$charclass',difficulty='$difficulty',age='$age'", "users") or die(mysql_error()); + + if ($controlrow["verifyemail"] == 1) { if (sendregmail($email1, $verifycode) == true) { - $page = "Your account was created successfully.<br /><br />You should receive an Account Verification email shortly. You will need the verification code contained in that email before you are allowed to log in. Once you have received the email, please visit the <a href=\"users.php?do=verify\">Verification Page</a> to enter your code and start playing."; + $page = "Votre compte a été crée avec succès.<br /><br />Vous devriez recevoir un email de vérification de compte sous peu. Vous aurez besoin du code de vérification contenu dans l'email. Sans ce code vous ne pourrez pas jouer. Lorsque vous aurez recu cet Email allez à la page de <a href=\"users.php?do=verify\">Verification Page</a> et remplissez les champs requis."; } else { - $page = "Your account was created successfully.<br /><br />However, there was a problem sending your verification email. Please check with the game administrator to help resolve this problem."; + $page = "Votre compte a été crée avec succès.<br /><br />Cependant, il y eu un problème en envoyant votre email avec le code de validation. Veuillez contacter l'administrateur du jeu pour résoudre ce problème."; } } else { - $page = "Your account was created succesfully.<br /><br />You may now continue to the <a href=\"login.php?do=login\">Login Page</a> and continue playing ".$controlrow["gamename"]."!"; + $page = "Votre compte a été crée avec succès.<br /><br />Vous pouvez maintenant <a href=\"login.php?do=login\">vous loger</a> et commencer à jouer ".$controlrow["gamename"]."!"; } } else { - $page = "The following error(s) occurred when your account was being made:<br /><span style=\"color:red;\">$errorlist</span><br />Please go back and try again."; + $page = "L'erreur(s) suivante s'est produite lorsque votre compte a été crée:<br /><span style=\"color:red;\">$errorlist</span><br />Veuillez retourner et recommencer."; } @@ -75,7 +79,7 @@ function register() { // Register a new account. $page = gettemplate("register"); if ($controlrow["verifyemail"] == 1) { - $controlrow["verifytext"] = "<br /><span class=\"small\">A verification code will be sent to the address above, and you will not be able to log in without first entering the code. Please be sure to enter your correct email address.</span>"; + $controlrow["verifytext"] = "<br /><span class=\"small\">Un code de validation sera envoyé à l'adresse email ci-dessus. Sans ce code de validation, vous ne pourrez pas jouer . Veuillez être sûr d'écrire un adresse email correcte.</span>"; } else { $controlrow["verifytext"] = ""; } @@ -83,8 +87,8 @@ function register() { // Register a new account. } - $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" border=\"0\" /></a>"; - display($page, "Register", false, false, false); + $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Se loger\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"S'enregistrer\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Aide\" border=\"0\" /></a>"; + display($page, "S'enregistrer", false, false, false); } @@ -93,18 +97,17 @@ function verify() { if (isset($_POST["submit"])) { extract($_POST); $userquery = doquery("SELECT username,email,verify FROM {{table}} WHERE username='$username' LIMIT 1","users"); - if (mysql_num_rows($userquery) != 1) { die("No account with that username."); } + if (mysql_num_rows($userquery) != 1) { die("Il y a aucun compte existant avec cet ID."); } $userrow = mysql_fetch_array($userquery); - if ($userrow["verify"] == 1) { die("Your account is already verified."); } - if ($userrow["email"] != $email) { die("Incorrect email address."); } - if ($userrow["verify"] != $verify) { die("Incorrect verification code."); } - // If we've made it this far, should be safe to update their account. + if ($userrow["verify"] == 1) { die("Votre compte a déja été validé."); } + if ($userrow["email"] != $email) { die("Adresse email incorrecte."); } + if ($userrow["verify"] != $verify) { die("Code de validation invalide."); } $updatequery = doquery("UPDATE {{table}} SET verify='1' WHERE username='$username' LIMIT 1","users"); - display("Your account was verified successfully.<br /><br />You may now continue to the <a href=\"login.php?do=login\">Login Page</a> and start playing the game.<br /><br />Thanks for playing!","Verify Email",false,false,false); + display("Votre compte a été validé avec succès.<br /><br />Vous pouvez maintenant <a href=\"login.php?do=login\">vous loger</a> et commencer à jouer.<br /><br />Merci de participer à RPG illusion!","Vérification de l'Email",false,false,false); } $page = gettemplate("verify"); - $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" border=\"0\" /></a>"; - display($page, "Verify Email", false, false, false); + $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Se loger\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"S'enregistrer\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Aide\" border=\"0\" /></a>"; + display($page, "Vérification de l'Email", false, false, false); } @@ -113,7 +116,7 @@ function lostpassword() { if (isset($_POST["submit"])) { extract($_POST); $userquery = doquery("SELECT email FROM {{table}} WHERE email='$email' LIMIT 1","users"); - if (mysql_num_rows($userquery) != 1) { die("No account with that email address."); } + if (mysql_num_rows($userquery) != 1) { die("Aucun compte avec cette adresse email."); } $newpass = ""; for ($i=0; $i<8; $i++) { $newpass .= chr(rand(65,90)); @@ -121,15 +124,15 @@ function lostpassword() { $md5newpass = md5($newpass); $updatequery = doquery("UPDATE {{table}} SET password='$md5newpass' WHERE email='$email' LIMIT 1","users"); if (sendpassemail($email,$newpass) == true) { - display("Your new password was emailed to the address you provided.<br /><br />Once you receive it, you may <a href=\"login.php?do=login\">Log In</a> and continue playing.<br /><br />Thank you.","Lost Password",false,false,false); + display("Votre nouveau PW a été envoyé à l'adresse email que vous nous avez fournie.<br /><br />Après avoir recu votre nouveau PW, vous pouvez <a href=\"login.php?do=login\">vous loger</a> et commencer à jouer.<br /><br />Nous vous remercions.","PW perdu",false,false,false); } else { - display("There was an error sending your new password.<br /><br />Please check with the game administrator for more information.<br /><br />We apologize for the inconvience.","Lost Password",false,false,false); + display("Il y a eu un problème lors de l'envoi de votre nouveau PW.<br /><br />Veuillez contacter l'administrateur du jeu pour résoudre ce problème.<br /><br />Veuilez nous excuser de ce disfonctionnement.","PW perdu",false,false,false); } die(); } $page = gettemplate("lostpassword"); - $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" border=\"0\" /></a>"; - display($page, "Lost Password", false, false, false); + $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Se loger\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"S'enregistrer\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Aide\" border=\"0\" /></a>"; + display($page, "PW perdu", false, false, false); } @@ -138,20 +141,20 @@ function changepassword() { if (isset($_POST["submit"])) { extract($_POST); $userquery = doquery("SELECT * FROM {{table}} WHERE username='$username' LIMIT 1","users"); - if (mysql_num_rows($userquery) != 1) { die("No account with that username."); } + if (mysql_num_rows($userquery) != 1) { die("Il y a aucun compte existant avec cet ID."); } $userrow = mysql_fetch_array($userquery); - if ($userrow["password"] != md5($oldpass)) { die("The old password you provided was incorrect."); } - if (preg_match("/[^A-z0-9_\-]/", $newpass1)==1) { die("New password must be alphanumeric."); } // Thanks to "Carlos Pires" from php.net! - if ($newpass1 != $newpass2) { die("New passwords don't match."); } + if ($userrow["password"] != md5($oldpass)) { die("Le vieux PW que vous avez fournie est incorrect."); } + if (preg_match("/[^A-z0-9_\-]/", $newpass1)==1) { die("Le nouveau PW doit être écrit en caractères alphanumérique."); } // Thanks to "Carlos Pires" from php.net! + if ($newpass1 != $newpass2) { die("Les 2 PW que vous avez inscrit ne sont pas indentiques."); } $realnewpass = md5($newpass1); $updatequery = doquery("UPDATE {{table}} SET password='$realnewpass' WHERE username='$username' LIMIT 1","users"); if (isset($_COOKIE["dkgame"])) { setcookie("dkgame", "", time()-100000, "/", "", 0); } - display("Your password was changed successfully.<br /><br />You have been logged out of the game to avoid cookie errors.<br /><br />Please <a href=\"login.php?do=login\">log back in</a> to continue playing.","Change Password",false,false,false); + display("Votre PW a été changé avec succès.<br /><br />Lorsque vous vous êtes logé , une erreur de cookie s'est produite.<br /><br />Veuillez <a href=\"login.php?do=login\">vous reloger</a> pour commencer à jouer.","Changer le PW",false,false,false); die(); } $page = gettemplate("changepassword"); - $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Help\" border=\"0\" /></a>"; - display($page, "Change Password", false, false, false); + $topnav = "<a href=\"login.php?do=login\"><img src=\"images/button_login.gif\" alt=\"Se loger\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"images/button_register.gif\" alt=\"S'enregistrer\" border=\"0\" /></a><a href=\"help.php\"><img src=\"images/button_help.gif\" alt=\"Aide\" border=\"0\" /></a>"; + display($page, "Change de PW", false, false, false); } @@ -162,16 +165,19 @@ function sendpassemail($emailaddress, $password) { extract($controlrow); $email = <<<END -You or someone using your email address submitted a Lost Password application on the $gamename server, located at $gameurl. +Vous ou une personne employant votre adresse email a perdu son PW sur RPG illusion. + +Nous vous avons envoyé un nouveau PW. Ainsi vous pourrez continuer à jouer sur $gamename. -We have issued you a new password so you can log back into the game. +Votre nouveau PW est: $password -Your new password is: $password +cliquez sur lien suivant pour vous loger: $gameurl + +Merci de votre participation. -Thanks for playing. END; - $status = mymail($emailaddress, "$gamename Lost Password", $email); + $status = mymail($emailaddress, "PW perdu - RPG illusion", $email); return $status; } @@ -184,26 +190,28 @@ function sendregmail($emailaddress, $vercode) { $verurl = $gameurl . "?do=verify"; $email = <<<END -You or someone using your email address recently signed up for an account on the $gamename server, located at $gameurl. +Vous ou une personne employant votre adresse email a récement crée un compte sur RPG illusion. + +Un code de validation est join à cet Email. Sans celui-ci, vous ne pourrez pas activer votre compte sur RPG illusion + +Votre code de validation: $vercode -This email is sent to verify your registration email. In order to begin using your account, you must verify your email address. -Please visit the Verification Page ($verurl) and enter the code below to activate your account. -Verification code: $vercode +Cliquez sur le liens suivant pour activer votre compte: $verurl -If you were not the person who signed up for the game, please disregard this message. You will not be emailed again. +Si vous n/étiez pas la personne qui a signé sur RPG illusion, négligez ce méssage. Vous ne recevrez aucun autre Email de notre part. END; - $status = mymail($emailaddress, "$gamename Account Verification", $email); + $status = mymail($emailaddress, "Email de validation - RPG illusion", $email); return $status; } -function mymail($to, $title, $body, $from = '') { // thanks to arto dot PLEASE dot DO dot NOT dot SPAM at artoaaltonen dot fi. +function mymail($to, $title, $body, $from = '') { // Merci de ne pas modifier cette fonction pour en faire du spam!. $controlquery = doquery("SELECT * FROM {{table}} WHERE id='1' LIMIT 1", "control"); $controlrow = mysql_fetch_array($controlquery); extract($controlrow); - + $from = trim($from); @@ -225,13 +233,13 @@ function mymail($to, $title, $body, $from = '') { // thanks to arto dot PLEASE d $head .= "Organization: $org \r\n"; $head .= "X-Sender: $from \r\n"; $head .= "X-Priority: 3 \r\n"; - $head .= "X-Mailer: $mailer \r\n"; + $head .= "X-Mailer: .$mailer \r\n"; $body = str_replace("\r\n", "\n", $body); $body = str_replace("\n", "\r\n", $body); return mail($to, $title, $body, $head); - + } diff --git a/viewnews.php b/viewnews.php @@ -0,0 +1,15 @@ +<? +/******************************************************* +Viewnews.php ==> Vue différente des news +Dévelopée par Tsunami <http://zfusion.free.fr> +Problème? Questions? +--> http://rpgillusion.com/forums/ +--> http://zfusion.free.fr + +********************************************************/ +include('lib_log.php'); +$link = opendb(); + +$page = gettemplate("news_accueil"); +$title = "$gameinfos[gamename] :: News"; +display($page, $title, false, true, false); +\ No newline at end of file diff --git a/vote.php b/vote.php @@ -0,0 +1,71 @@ +<html> +<head> +<title>Sondage</title> +</head> + +<body> +<? + +print ' +<script language="javascript"> + + + +function sonde() +{ +newWindow=open("","Sondage","width=200,height=200,scrolling=no,resizable=no,scrollbars=yes"); +newWindow.focus(); + +} +</script>'; +include("config.php"); + +$link = opendb(); + +$query = doquery ("SELECT * FROM {{table}} ORDER BY id DESC LIMIT 0,1", "sondage"); +$resultat = mysql_fetch_array($query); +{ +$id_sondage = $resultat[id]; +print '<br><br><img src="images/main_nav2.jpg"> <table> +<form method="POST" action="resultvote.php?id='.$id_sondage.'" target="Sondage" onsubmit="sonde()" > +<b><font color="#67aa2b">'.$resultat[question].'</font></b></table> + +'; +echo ""; +$re_1 = $resultat[reponse1]; +$re_2 = $resultat[reponse2]; +$re_3 = $resultat[reponse3]; +$re_4 = $resultat[reponse4]; + + if(!empty($resultat[reponse1])) + { + print '<input type="radio" value="1" name="reponse"> '.$resultat[reponse1].'<br>'; + } + if(!empty($resultat[reponse2])) + { + print '<input type="radio" value="2" name="reponse"> '.$resultat[reponse2].'<br>'; + } + if(!empty($resultat[reponse3])) + { + print '<input type="radio" value="3" name="reponse"> '.$resultat[reponse3].'<br>'; + } + if(!empty($resultat[reponse4])) + { + print '<input type="radio" value="4" name="reponse"> '.$resultat[reponse4].'<br>'; + } +} + +print ' + +<br> +<center><input type="image" src="././images/leftnav_log/bouton_voter.gif" alt="Ok" border="0"/> +</form> +</center> + +'; + + +?> +</body> + +</html>