function checkLogin()
 {
     $error = lang("ERR_NO_INPUT");
     if ($this->input->get('username') !== null && $this->input->get('password') !== null) {
         if ($user = Protection::auth($this->input->get('username'), $this->input->get('password'))) {
             echo json_encode(array('error' => 0));
             exit;
         }
         $error = lang("ERR_BAD_LOGIN");
     }
     echo json_encode(array('error' => 1, 'message' => $error));
 }
예제 #2
0
     $ids = array();
     $aventuriers = array();
     for ($a = 1; $a <= $_POST["maxID"]; $a++) {
         if (isset($_POST["aventurier" . $a])) {
             $aventurier = new Aventurier($a);
             $aventuriers[] = $aventurier;
         }
     }
     $mobs = Mob::Lister();
     $_SESSION["sim_combat_aventuriers"] = serialize($aventuriers);
     include "view/simulation_combat_mobs_selection.php";
 } else {
     if ($_GET["action"] == "creation_simulation_combat") {
         $armes = Arme::Lister();
         $equipements = Equipement::Lister();
         $protections = Protection::Lister();
         $compte = 0;
         $mobs = array();
         foreach ($_POST as $key => $value) {
             if (substr($key, 0, 3) == "mob") {
                 for ($a = 0; $a < $value; $a++) {
                     $id = substr($key, 3);
                     $mob = new Mob($id);
                     $mob->getLoot();
                     $mobs[] = $mob;
                 }
             }
         }
         $_SESSION["sim_combat_mobs"] = serialize($mobs);
         $aventuriers = unserialize($_SESSION["sim_combat_aventuriers"]);
         include "view/simulation_combat.php";
예제 #3
0
 } else {
     if (strpos($key, "nomNouvelProt") !== false) {
         $id = substr($key, 13);
         $nom = $value;
         $po = $_POST["PONouvelProt" . $id];
         $pi = $_POST["PRNouvelProt" . $id];
         $rup = $_POST["RUPNouvelProt" . $id];
         $at = $_POST["ATNouvelProt" . $id];
         $prd = $_POST["PRDNouvelProt" . $id];
         $cou = $_POST["COUNouvelProt" . $id];
         $int = $_POST["INTNouvelProt" . $id];
         $cha = $_POST["CHANouvelProt" . $id];
         $ad = $_POST["ADNouvelProt" . $id];
         $fo = $_POST["FORNouvelProt" . $id];
         $type = $_POST["TYPENouvelProt" . $id];
         $nouvelProtection = new Protection();
         $nouvelProtection->NOM = $nom;
         $nouvelProtection->PRIX = $po;
         $nouvelProtection->PI = $pi;
         $nouvelProtection->RUP = $rup;
         $nouvelProtection->AT = $at;
         $nouvelProtection->PRD = $prd;
         $nouvelProtection->COU = $cou;
         $nouvelProtection->INT = $int;
         $nouvelProtection->CHA = $cha;
         $nouvelProtection->AD = $ad;
         $nouvelProtection->FO = $fo;
         $nouvelProtection->TYPE = $type;
         $nouvelProtection->debase = 0;
         $nouvelProtection->ajouter();
         $aventurier->ajouterProtection($nouvelProtection->ID);
예제 #4
0
                             //si c'est un paladin
                             /*
                                 Choisir dieu
                             */
                             $dieux = Dieu::Lister();
                             include "view/nouvelAventurierSpecialPaladin.php";
                         } else {
                             if ($aventurier->AD > 12 && $aventurier->METIER != "Assassin" && !isset($_GET["BonusADFait"])) {
                                 include "view/nouvelAventurierSpecialAD.php";
                             } else {
                                 $aventurier = unserialize($_SESSION["birdibeuk_aventurier"]);
                                 $armes = Arme::ListerBase();
                                 $equipements = Equipement::ListerBase();
                                 $protections = Protection::ListerBase();
                                 $types_arme = Arme::ListerTypesArme();
                                 $types_protection = Protection::ListerTypesProtection();
                                 $types_equipement = Equipement::ListerTypesEquipementDeBase();
                                 include "view/nouvelAventurierEquipement.php";
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 //si c'est un ogre
 /*
     L'Ogre a le droit de retrancher jusqu'à 3 points à son score de base en ATTAQUE et/ou en PARADE
     pour en faire un bonus de dégâts (au corps à corps, toutes armes confondues). Ainsi il peut avoir +3 en dégâts en plus de ses
     autres bonus de FORCE, mais son côté bourrin le rend maladroit. Le bonus est à choisir en début de carrière et ne pourra