Пример #1
0
         $baseStats = [1, 2, 2, 1, 1, 2];
         break;
     case \Likedimion\Game::CLASS_ASS:
         $baseStats = [1, 2, 1, 1, 2, 1];
         break;
     default:
         $baseStats = [1, 1, 1, 1, 1, 1];
         break;
 }
 $actor = ["aid" => $_SESSION["aid"], "title" => $_POST["title"], "role" => $acc["email"] == $admin ? \Likedimion\Game::ROLE_ADMIN : \Likedimion\Game::ROLE_USER, "class" => $_POST["class"], "sex" => $_POST["sex"], "race" => \Likedimion\Game::RACE_MAN, "create" => time(), "loc" => "ld.950.250", "level" => 1, "game_status" => "alive", "base_stats" => $baseStats, "base_stats_add" => [0, 0, 0, 0, 0, 0], "war_p_skills" => [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "war_p_skills_add" => [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "war_stats" => [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "base_stats_buffs" => [], "base_stats_effects" => [], "war_p_skills_buffs" => [], "war_p_skills_effects" => [], "experience" => 0, "inventory" => [], "equip" => ["rhand" => [], "lhand" => [], "head" => [], "bodyarm" => [], "cloack" => [], "hand" => [], "gloves" => [], "leg" => [], "shoes" => []], "journal" => [], "msg" => [], "friends" => [], "config" => [], "buffs" => [], "event" => ["game" => "roller", "dId" => "start", "sId" => "start"]];
 try {
     $playerHelper = new \Likedimion\Helper\PlayerHelper($actor);
     $itemHelper = new \Likedimion\Helper\ItemHelper($ld->items);
     switch ($actor["class"]) {
         case \Likedimion\Game::CLASS_WAR:
             $playerHelper->equip('rhand', $itemHelper->getItem('i.w.snov'));
             $playerHelper->addMagic("swords.swords1", 1, $magic);
             break;
         case \Likedimion\Game::CLASS_MAG:
             $playerHelper->equip('rhand', $itemHelper->getItem('i.w.booknov'))->addMagic('fire.fire1', 1, $magic)->addMagic('earth.earth1', 1, $magic);
             break;
         case \Likedimion\Game::CLASS_ASS:
             $playerHelper->equip('rhand', $itemHelper->getItem('i.w.pairnov'));
             break;
     }
     $playerHelper->equip(\Likedimion\Helper\ItemHelper::ITEM_BODYARM, $itemHelper->getItem('i.a.bnov'))->equip(\Likedimion\Helper\ItemHelper::ITEM_LEGS, $itemHelper->getItem('i.a.lnov'))->equip(\Likedimion\Helper\ItemHelper::ITEM_SHOES, $itemHelper->getItem('i.a.snov'));
     $playerHelper->calcParams();
     $ld->players->insert($playerHelper->getPlayer());
     header("Location: /?");
 } catch (MongoException $e) {
     $page = <<<IBASE_PRP_PAGE_BUFFERS