PageRenderTime 144ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/nacridan/conquest/conquest.php

https://gitlab.com/nacridan/Nacridan
PHP | 809 lines | 701 code | 67 blank | 41 comment | 115 complexity | 271e8ec6a52937f0c2a3afcf32e405a2 MD5 | raw file
  1. <?php
  2. /**
  3. *Gère l'ensemble du menu en mode Conquête
  4. *
  5. * Redirige sur les différentes parties du menu traitées dans les autres fichiers selon le choix du joueur.
  6. *
  7. *
  8. *@author Nacridan
  9. *@version 1.0
  10. *@package NacridanV1
  11. *@subpackage Conquest
  12. */
  13. /*
  14. * if($_SERVER['REMOTE_ADDR']!="86.66.160.171")
  15. * {
  16. *
  17. * echo "Maintenance veuillez patienter";
  18. * exit(-1);
  19. * }
  20. */
  21. require_once ("../conf/config.ini.php");
  22. require_once (HOMEPATH . "/conquest/cqdef.inc.php");
  23. // Javascript & CSS supplémentaire
  24. $js_include = array();
  25. $css_include = array();
  26. if (isset($_GET["center"]) && ($_GET["center"] == 'event')) {
  27. $js_include[] = '/javascript/page/events.js';
  28. $css_include[] = '/css/page/events.css';
  29. }
  30. require_once (HOMEPATH . "/include/game.inc.php");
  31. ini_set('display_errors', 1);
  32. error_reporting(E_ALL);
  33. // On regarde si on a besoin de forcer la session restreinte, mais pas juste quand on se connecte.
  34. if ($nacridan->sess->get('justLogged') === true) {
  35. $nacridan->sess->clear('justLogged');
  36. } else if ($curplayer->get("resurrect") != 1)
  37. {
  38. // On passe en session restreinte si on dépasse sa DLA de plus de ATB_MAX_TIMEOUT secondes
  39. $newATBTime = gmstrtotime($curplayer->get("nextatb")) - date("I") * 3600;
  40. if ($newATBTime + ATB_MAX_TIMEOUT < time()) {
  41. $ATBkey = "DLA" . $curplayer->get("id"); // Si présente, alors on est pas en session restreinte
  42. $nacridan->sess->clear($ATBkey);
  43. }
  44. }
  45. function activeATB($curplayer)
  46. {
  47. global $sess;
  48. $key = $curplayer->get("id");
  49. if ($sess->has("DLA" . $key)) {
  50. if ($sess->get("DLA" . $key) == "on") {
  51. $format = '%Y-%m-%d %H:%M:%S';
  52. $strf = strftime($format);
  53. $var = "DLA" . $key;
  54. $sess->set($var, "off");
  55. if ((gmstrtotime($curplayer->get("nextatb")) - date("I") * 3600) < time()) {
  56. $action = new ActionEvt();
  57. $action->setType(NEWATB);
  58. return $action;
  59. }
  60. }
  61. }
  62. return null;
  63. }
  64. $centerobj = null;
  65. $extra = "";
  66. $actionEvt = null;
  67. $minimap = null; // to avoid to load multiple time vue 2D
  68. $radius = SIZEAREA; // to save view2D size
  69. $isMinimapNeeded = true; // boolean to know if needed to load view even if parameter vien2D is set. Sample: in a building
  70. if ($curplayer->get("disabled") == 0) {
  71. if (($actionEvt = activeATB($curplayer)) != null) {
  72. unset($center);
  73. $action = "act";
  74. $nacridan->setRepostForm(false);
  75. $previousIdForm = "ATB";
  76. $sendIdForm = "ATB";
  77. } else {
  78. if ($curplayer->get("resurrect") == 1) {
  79. $actionEvt = new ActionEvt();
  80. $actionEvt->setType(NEWATB);
  81. unset($center);
  82. $action = "act";
  83. $nacridan->setRepostForm(false);
  84. $previousIdForm = "ATB";
  85. $sendIdForm = "ATB";
  86. }
  87. if (isset($_POST["action"])) {
  88. $actionEvt = new ActionEvt();
  89. $actionEvt->setAction($_POST);
  90. }
  91. }
  92. $move2Daction = "";
  93. if (isset($action)) {
  94. if (! $nacridan->isRepostForm()) {
  95. require_once (HOMEPATH . '/conquest/cqaction.inc.php');
  96. if (($actionEvt->getType() == ATTACK) or ($actionEvt->getType() == ARCHERY) or ($actionEvt->getType() == ATTACK_BUILDING) or ($actionEvt->getType() == CARAVAN_TERMINATE) or
  97. ($actionEvt->getType() == CONCENTRATION) or ($actionEvt->getType() == ANSWER_TO_POLL) or ($actionEvt->getType() > 100 and $actionEvt->getType() < 400) or
  98. ($actionEvt->getType() > 500))
  99. $centerobj = new CQAction($nacridan, $actionEvt, $db);
  100. else {
  101. if ($actionEvt->getType() == MOVE2D)
  102. $move2Daction = new CQAction($nacridan, $actionEvt, $db, "bottomareawidth");
  103. else
  104. $btobj = new CQAction($nacridan, $actionEvt, $db, "bottomareawidth");
  105. if (! isset($_GET["center"]))
  106. $center = "view";
  107. }
  108. } else {
  109. $btobj = eval(file_get_contents(HOMEPATH . "/include/reposterror.inc.php"));
  110. if (! isset($_GET["center"]))
  111. $center = "view";
  112. }
  113. }
  114. if (is_null($centerobj)) {
  115. if (isset($center)) {
  116. switch ($center) {
  117. case "map":
  118. require_once (HOMEPATH . '/conquest/cqmap.inc.php');
  119. $centerobj = new CQMap($nacridan, $MAIN_HEAD, $MAIN_BODY, $db);
  120. break;
  121. case "view1d":
  122. require_once (HOMEPATH . '/conquest/cqview1D.inc.php');
  123. $centerobj = new CQView($nacridan, $db);
  124. break;
  125. case "view2d":
  126. if ((isset($_POST["room"]) && ($_POST["room"] != TOWER_ROOM && $_POST["room"] != PALACE_BELL_TOWER_ROOM && $_POST["room"] != TEMPLE_ROOF_ROOM) && ($curplayer->get(
  127. "inbuilding") != 0)) || (($curplayer->get("inbuilding") != 0) &&
  128. ($curplayer->get("room") != TOWER_ROOM && $curplayer->get("room") != PALACE_BELL_TOWER_ROOM && $curplayer->get("room") != TEMPLE_ROOF_ROOM) &&
  129. ! isset($_POST["room"]))) {
  130. require_once (HOMEPATH . '/conquest/cqinsidebuilding.inc.php');
  131. $centerobj = new CQInsideBuilding($nacridan, $MAIN_BODY, $db);
  132. $minimap = $centerobj->minimap;
  133. $radius = $centerobj->radius;
  134. $isMinimapNeeded = false;
  135. } else {
  136. if (isset($_POST["room"])) {
  137. if ($_POST["room"] != $curplayer->get("room")) {
  138. $curplayer->set("room", $_POST["room"]);
  139. $curplayer->updateDBPartial("room", $db);
  140. }
  141. }
  142. require_once (HOMEPATH . '/conquest/cqview2D.inc.php');
  143. $centerview = new CQView2D($nacridan, $MAIN_BODY, $db);
  144. $minimap = $centerview->minimap;
  145. $radius = $centerview->radius;
  146. }
  147. break;
  148. case "view":
  149. if ((isset($_POST["room"]) and ($_POST["room"] != TOWER_ROOM && $_POST["room"] != TEMPLE_ROOF_ROOM && $_POST["room"] != PALACE_BELL_TOWER_ROOM)) or (($curplayer->get(
  150. "inbuilding") != 0) and
  151. ($curplayer->get("room") != TOWER_ROOM && $curplayer->get("room") != PALACE_BELL_TOWER_ROOM && $curplayer->get("room") != TEMPLE_ROOF_ROOM) and
  152. ! isset($_POST["room"]))) {
  153. require_once (HOMEPATH . '/conquest/cqinsidebuilding.inc.php');
  154. $centerobj = new CQInsideBuilding($nacridan, $MAIN_BODY, $db);
  155. } else {
  156. if (isset($_POST["room"])) {
  157. if ($_POST["room"] != $curplayer->get("room")) {
  158. $curplayer->set("room", $_POST["room"]);
  159. $curplayer->updateDBPartial("room", $db);
  160. }
  161. }
  162. if ($nacridan->auth->auth["view2d"]) {
  163. require_once (HOMEPATH . '/conquest/cqview2D.inc.php');
  164. $centerview = new CQView2D($nacridan, $MAIN_BODY, $db);
  165. $minimap = $centerview->minimap;
  166. $radius = $centerview->radius;
  167. } else {
  168. require_once (HOMEPATH . '/conquest/cqview1D.inc.php');
  169. $centerobj = new CQView($nacridan, $db);
  170. }
  171. }
  172. break;
  173. case "profile":
  174. require_once (HOMEPATH . '/conquest/cqprofile.inc.php');
  175. $centerobj = new CQProfile($nacridan, $db);
  176. break;
  177. case "equip":
  178. require_once (HOMEPATH . '/conquest/cqequip.inc.php');
  179. $extra = " style='overflow: hidden;'";
  180. $centerobj = new CQEquip($nacridan, $MAIN_HEAD, $MAIN_BODY, $db);
  181. break;
  182. case "event":
  183. require_once (HOMEPATH . '/conquest/cqevent.inc.php');
  184. $centerobj = new CQEvent($nacridan, "centerareawidth", $db);
  185. break;
  186. case "mail":
  187. require_once (HOMEPATH . '/conquest/cqmail.inc.php');
  188. $centerobj = new CQMail($nacridan, $db);
  189. break;
  190. case "compose":
  191. require_once (HOMEPATH . '/conquest/cqcompose.inc.php');
  192. $centerobj = new CQCompose($nacridan, $db);
  193. break;
  194. case "contact":
  195. require_once (HOMEPATH . '/conquest/cqcontact.inc.php');
  196. $centerobj = new CQContact($nacridan, $db);
  197. break;
  198. case "alias":
  199. require_once (HOMEPATH . '/conquest/cqalias.inc.php');
  200. $centerobj = new CQAlias($nacridan, $db);
  201. break;
  202. case "search":
  203. require_once (HOMEPATH . '/conquest/cqsearchmail.inc.php');
  204. $centerobj = new CQSearchMail($nacridan, $db);
  205. break;
  206. case "archive":
  207. require_once (HOMEPATH . '/conquest/cqarchive.inc.php');
  208. $centerobj = new CQArchive($nacridan, $db);
  209. break;
  210. case "first":
  211. require_once (HOMEPATH . '/conquest/cqfirst.inc.php');
  212. $centerobj = new CQFirst($nacridan);
  213. break;
  214. case "option":
  215. require_once (HOMEPATH . '/conquest/cqoption.inc.php');
  216. $centerobj = new CQOption($nacridan, $db);
  217. break;
  218. case "account":
  219. require_once (HOMEPATH . '/conquest/cqaccount.inc.php');
  220. $centerobj = new CQAccount($nacridan, $db);
  221. break;
  222. case "chanirc":
  223. require_once (HOMEPATH . '/conquest/cqchanirc.inc.php');
  224. $centerobj = new CQChanIRC($nacridan, $db);
  225. break;
  226. case "faq":
  227. require_once (HOMEPATH . '/conquest/cqfaq.inc.php');
  228. $centerobj = new CQFAQ($nacridan, $db);
  229. break;
  230. case "disabled":
  231. if ($curplayer->get("authlevel") > 5) {
  232. require_once (HOMEPATH . '/conquest/cqdisabled.inc.php');
  233. $centerobj = new CQDisabled($nacridan, "centerareawidth", $db);
  234. }
  235. break;
  236. case "questpanel":
  237. if ($curplayer->get("authlevel") > 1) {
  238. require_once (HOMEPATH . '/conquest/cqquestpanel.inc.php');
  239. $centerobj = new CQQuestpanel($nacridan, "centerareawidth", $db);
  240. }
  241. break;
  242. case "xprewardpanel":
  243. if ($curplayer->get("authlevel") > 5) {
  244. require_once (HOMEPATH . '/conquest/cqxprewardpanel.inc.php');
  245. $centerobj = new CQXPRewardPanel($nacridan, "centerareawidth", $db);
  246. }
  247. break;
  248. case "newspanel":
  249. if ($curplayer->get("authlevel") > 1) {
  250. require_once (HOMEPATH . '/conquest/cqnews.inc.php');
  251. $centerobj = new CQNews($nacridan, "centerareawidth", $db);
  252. }
  253. break;
  254. case "createParchment":
  255. if ($curplayer->get("authlevel") > 1) {
  256. require_once (HOMEPATH . '/conquest/actiontest/cqcreateParchment.inc.php');
  257. $centerobj = new CQCreateParchment($nacridan, $db);
  258. }
  259. break;
  260. case "pollpanel":
  261. if ($curplayer->get("authlevel") > 1) {
  262. require_once (HOMEPATH . '/conquest/cqpoll.inc.php');
  263. $centerobj = new CQPoll($nacridan, "centerareawidth", $db);
  264. }
  265. break;
  266. case "serverpanel":
  267. if ($curplayer->get("authlevel") > 1) {
  268. require_once (HOMEPATH . '/conquest/cqserver.inc.php');
  269. $centerobj = new CQServer($nacridan, "centerareawidth", $db);
  270. }
  271. break;
  272. case "globalMP":
  273. if ($curplayer->get("authlevel") > 1) {
  274. require_once (HOMEPATH . '/conquest/cqglobalMP.inc.php');
  275. $centerobj = new CQGlobalMP($nacridan, "centerareawidth", $db);
  276. }
  277. break;
  278. case "addDescription":
  279. if ($curplayer->get("authlevel") > 1) {
  280. require_once (HOMEPATH . '/conquest/cqformbasicmission.inc.php');
  281. $centerobj = new CQFormBasicMission($nacridan, $db);
  282. }
  283. break;
  284. case "monsterProfile":
  285. require_once (HOMEPATH . '/conquest/cqmonsterprofile.inc.php');
  286. $centerobj = new CQMonsterProfile($nacridan, $db);
  287. break;
  288. default:
  289. break;
  290. }
  291. // CITY
  292. if ($curplayer->get("incity") == 1) {
  293. switch ($center) {
  294. case "arms":
  295. require_once (HOMEPATH . '/conquest/cqarms.inc.php');
  296. $centerobj = new CQArms($nacridan, $db);
  297. break;
  298. case "sale":
  299. require_once (HOMEPATH . '/conquest/cqsale.inc.php');
  300. $centerobj = new CQSale($nacridan, $db);
  301. break;
  302. case "repair":
  303. require_once (HOMEPATH . '/conquest/cqrepair.inc.php');
  304. $centerobj = new CQRepair($nacridan, $db);
  305. break;
  306. case "factory":
  307. require_once (HOMEPATH . '/conquest/cqfactory.inc.php');
  308. $centerobj = new CQFactory($nacridan, $db);
  309. break;
  310. case "warehouse":
  311. require_once (HOMEPATH . '/conquest/cqwarehouse.inc.php');
  312. $centerobj = new CQWareHouse($nacridan, $db);
  313. break;
  314. case "enchant":
  315. require_once (HOMEPATH . '/conquest/cqenchant.inc.php');
  316. $centerobj = new CQEnchant($nacridan, $db);
  317. break;
  318. case "hostel":
  319. require_once (HOMEPATH . '/conquest/cqhostel.inc.php');
  320. $centerobj = new CQHostel($nacridan, $db);
  321. break;
  322. case "bank":
  323. require_once (HOMEPATH . '/conquest/cqbank.inc.php');
  324. $centerobj = new CQBank($nacridan, $db);
  325. break;
  326. case "alchemist":
  327. require_once (HOMEPATH . '/conquest/cqalchemist.inc.php');
  328. $centerobj = new CQAlchemist($nacridan, $db);
  329. break;
  330. case "magicschool":
  331. require_once (HOMEPATH . '/conquest/cqmagicschool.inc.php');
  332. $centerobj = new CQMagicSchool($nacridan, $db);
  333. break;
  334. case "abilityschool":
  335. require_once (HOMEPATH . '/conquest/cqabilityschool.inc.php');
  336. $centerobj = new CQAbilitySchool($nacridan, $db);
  337. break;
  338. default:
  339. break;
  340. }
  341. }
  342. } else {
  343. require_once (HOMEPATH . '/conquest/cqinfo.inc.php');
  344. $centerobj = new CQInfo($nacridan, $db);
  345. }
  346. }
  347. } else {
  348. if (isset($center)) {
  349. switch ($center) {
  350. case "mail":
  351. require_once (HOMEPATH . '/conquest/cqmail.inc.php');
  352. $centerobj = new CQMail($nacridan, $db);
  353. break;
  354. case "compose":
  355. require_once (HOMEPATH . '/conquest/cqcompose.inc.php');
  356. $centerobj = new CQCompose($nacridan, $db);
  357. break;
  358. case "contact":
  359. require_once (HOMEPATH . '/conquest/cqcontact.inc.php');
  360. $centerobj = new CQContact($nacridan, $db);
  361. break;
  362. case "alias":
  363. require_once (HOMEPATH . '/conquest/cqalias.inc.php');
  364. $centerobj = new CQAlias($nacridan, $db);
  365. break;
  366. default:
  367. require_once (HOMEPATH . '/conquest/cqbanned.inc.php');
  368. $centerobj = new CQBanned($nacridan, $curplayer->get("id"), $db);
  369. break;
  370. }
  371. } else {
  372. require_once (HOMEPATH . '/conquest/cqbanned.inc.php');
  373. $centerobj = new CQBanned($nacridan, $curplayer->get("id"), $db);
  374. }
  375. }
  376. if (isset($centerview)) {
  377. $MAIN_CENTER = $MAIN_BODY->addNewHTMLObject("div", "", "class='centerareaview'" . $extra);
  378. $MAIN_CENTER->add($centerview);
  379. } else {
  380. $MAIN_CENTER = $MAIN_BODY->addNewHTMLObject("div", "", "class='centerarea'" . $extra);
  381. $MAIN_CENTER->add($centerobj);
  382. }
  383. require_once (HOMEPATH . '/main/mmenu.inc.php');
  384. require_once (HOMEPATH . '/diplomacy/dtribune.inc.php');
  385. page_open(array(
  386. "sess" => "Session",
  387. "auth" => "Auth"
  388. ));
  389. $MAIN_BODY->add(new CQMMenu($nacridan, $db, $lang));
  390. if ($curplayer->get("disabled") == 0) {
  391. if ($curplayer->get("authlevel") < 4) {
  392. require_once (HOMEPATH . '/conquest/cqmenu.inc.php');
  393. $MAIN_BODY->add(new CQMenu($nacridan, $db));
  394. } else {
  395. require_once (HOMEPATH . '/conquest/cqmenuauth.inc.php');
  396. $MAIN_BODY->add(new CQMenuAuth($nacridan, $db));
  397. }
  398. $MAIN_BOTTOM = $MAIN_BODY->addNewHTMLObject("div", "", "class='bottomarea'");
  399. $btobj = isset($btobj) ? $btobj : null;
  400. if (($btobj == null) && isset($bottom)) {
  401. switch ($bottom) {
  402. case "move":
  403. require_once (HOMEPATH . '/conquest/cqmove.inc.php');
  404. $btobj = new CQMove($nacridan, $db);
  405. break;
  406. case "concentration":
  407. require_once (HOMEPATH . '/conquest/cqconcentration.inc.php');
  408. $btobj = new CQConcentration($nacridan, $db);
  409. break;
  410. case "appear":
  411. require_once (HOMEPATH . '/conquest/cqappear.inc.php');
  412. $btobj = new CQAppear($nacridan, $db);
  413. break;
  414. case "free":
  415. require_once (HOMEPATH . '/conquest/cqfree.inc.php');
  416. $btobj = new CQFree($nacridan, $db);
  417. break;
  418. /*
  419. * case "newDLA":
  420. * require_once(HOMEPATH.'/conquest/cqnewdla.inc.php');
  421. * $btobj=new CQNewDla($nacridan,$db);
  422. * break;
  423. */
  424. case "attack":
  425. require_once (HOMEPATH . '/conquest/cqattack.inc.php');
  426. $btobj = new CQAttack($nacridan, $db);
  427. break;
  428. case "blood":
  429. require_once (HOMEPATH . '/conquest/cqblood.inc.php');
  430. $btobj = new CQBlood($nacridan, $db);
  431. break;
  432. case "attackBuilding":
  433. require_once (HOMEPATH . '/conquest/cqattackbuilding.inc.php');
  434. $btobj = new CQAttackBuilding($nacridan, $db);
  435. break;
  436. case "graffiti":
  437. require_once (HOMEPATH . '/conquest/cqgraffiti.inc.php');
  438. $btobj = new CQGraffiti($nacridan, $db);
  439. break;
  440. case "continuegraffiti":
  441. require_once (HOMEPATH . '/conquest/cqcontinuegraffiti.inc.php');
  442. $btobj = new CQContinueGraffiti($nacridan, $db);
  443. break;
  444. case "consultgraffiti":
  445. require_once (HOMEPATH . '/conquest/cqconsultgraffiti.inc.php');
  446. $btobj = new CQConsultGraffiti($nacridan, $db);
  447. break;
  448. // ATTENTION CE BOUT DE CODE EST PROPRE A LA VERSION TEST
  449. case "addAP":
  450. require_once (HOMEPATH . '/conquest/actiontest/cqaddAP.inc.php');
  451. $btobj = new CQAddAP($nacridan, $db);
  452. break;
  453. case "addMoney":
  454. require_once (HOMEPATH . '/conquest/actiontest/cqaddMoney.inc.php');
  455. $btobj = new CQAddMoney($nacridan, $db);
  456. break;
  457. case "levelup":
  458. require_once (HOMEPATH . '/conquest/actiontest/cqlevelup.inc.php');
  459. $btobj = new CQLevelUp($nacridan, $db);
  460. break;
  461. case "newDLA":
  462. require_once (HOMEPATH . '/conquest/actiontest/cqnewdla.inc.php');
  463. $btobj = new CQNewDLA($nacridan, $db);
  464. break;
  465. case "renameObject":
  466. require_once (HOMEPATH . '/conquest/actiontest/cqrenameObject.inc.php');
  467. $btobj = new CQRenameObject($nacridan, $db);
  468. break;
  469. case "createExploitation":
  470. require_once (HOMEPATH . '/conquest/actiontest/cqcreateExploitation.inc.php');
  471. $btobj = new CQCreateExploitation($nacridan, $db);
  472. break;
  473. case "changeModifier":
  474. require_once (HOMEPATH . '/conquest/actiontest/cqchangeModifier.inc.php');
  475. $btobj = new CQChangeModifier($nacridan, $db);
  476. break;
  477. case "deleteChapelMalus":
  478. require_once (HOMEPATH . '/conquest/actiontest/cqdeleteChapelMalus.php');
  479. $btobj = new CQDeleteChapelMalus($nacridan, $db);
  480. break;
  481. case "createMonster":
  482. require_once (HOMEPATH . '/conquest/actiontest/cqcreateMonster.inc.php');
  483. $btobj = new CQCreateMonster($nacridan, $db);
  484. break;
  485. case "cloneMonster":
  486. require_once (HOMEPATH . '/conquest/actiontest/cqcloneMonster.inc.php');
  487. $btobj = new CQCloneMonster($nacridan, $db);
  488. break;
  489. case "playIAMonster":
  490. require_once (HOMEPATH . '/conquest/actiontest/cqplayIAMonster.inc.php');
  491. $btobj = new CQPlayIAMonster($nacridan, $db);
  492. break;
  493. case "calcSPath":
  494. require_once (HOMEPATH . '/conquest/actiontest/cqCalcShortWay.inc.php');
  495. $btobj = new CQCalcShortWay($nacridan, $db);
  496. break;
  497. case "createBuilding":
  498. require_once (HOMEPATH . '/conquest/actiontest/cqcreateBuilding.inc.php');
  499. $btobj = new CQCreateBuilding($nacridan, $db);
  500. break;
  501. case "renameBuilding":
  502. require_once (HOMEPATH . '/conquest/actiontest/cqrenameBuilding.inc.php');
  503. $btobj = new CQRenameBuilding($nacridan, $db);
  504. break;
  505. case "destroyBuilding":
  506. require_once (HOMEPATH . '/conquest/actiontest/cqdestroyBuilding.inc.php');
  507. $btobj = new CQDestroyBuilding($nacridan, $db);
  508. break;
  509. case "destroyObject":
  510. require_once (HOMEPATH . '/conquest/actiontest/cqdestroyObject.inc.php');
  511. $btobj = new CQDestroyObject($nacridan, $db);
  512. break;
  513. case "terraformCase":
  514. require_once (HOMEPATH . '/conquest/actiontest/cqTerraformation.inc.php');
  515. $btobj = new CQTerraformation($nacridan, $db);
  516. break;
  517. case "addAbilityToPNJ":
  518. require_once (HOMEPATH . '/conquest/actiontest/cqaddAbilityToPNJ.inc.php');
  519. $btobj = new CQAddAbilityToPNJ($nacridan, $db);
  520. break;
  521. case "addMagicSpellToPNJ":
  522. require_once (HOMEPATH . '/conquest/actiontest/cqaddMagicSpellToPNJ.inc.php');
  523. $btobj = new CQAddMagicSpellToPNJ($nacridan, $db);
  524. break;
  525. case "addTalentToPNJ":
  526. require_once (HOMEPATH . '/conquest/actiontest/cqaddTalentToPNJ.inc.php');
  527. $btobj = new CQAddTalentToPNJ($nacridan, $db);
  528. break;
  529. case "giveMoneyToPNJ":
  530. require_once (HOMEPATH . '/conquest/actiontest/cqgiveMoneyToPNJ.inc.php');
  531. $btobj = new CQGiveMoneyToPNJ($nacridan, $db);
  532. break;
  533. case "giveItemToPNJ":
  534. require_once (HOMEPATH . '/conquest/actiontest/cqgiveItemToPNJ.inc.php');
  535. $btobj = new CQGiveItemToPNJ($nacridan, $db);
  536. break;
  537. case "emptyBag":
  538. require_once (HOMEPATH . '/conquest/actiontest/cqemptybag.inc.php');
  539. $btobj = new CQEmptyBag($nacridan, $db);
  540. break;
  541. case "accessBDD":
  542. require_once (HOMEPATH . '/conquest/actiontest/cqaccessbdd.inc.php');
  543. $btobj = new CQAccessBDD($nacridan, $db);
  544. break;
  545. case "instantTP":
  546. require_once (HOMEPATH . '/conquest/actiontest/cqinstantTP.inc.php');
  547. $btobj = new CQInstantTP($nacridan, $db);
  548. break;
  549. case "openOrCloseDoors":
  550. require_once (HOMEPATH . '/conquest/actiontest/cqopenOrCloseDoors.inc.php');
  551. $btobj = new CQOpenOrCloseDoors($nacridan, $db);
  552. break;
  553. case "runAI":
  554. require_once (HOMEPATH . '/conquest/actiontest/cqrunAI.inc.php');
  555. $btobj = new CQRunAI($nacridan, $db);
  556. break;
  557. // FIN DU CODE DE LA VERSION TEST
  558. case "levelUp":
  559. require_once (HOMEPATH . '/conquest/cqlevelup.inc.php');
  560. $btobj = new CQLevelUp($nacridan, $db);
  561. break;
  562. case "recall":
  563. require_once (HOMEPATH . '/conquest/cqrecall.inc.php');
  564. $btobj = new CQRecall($nacridan, $db);
  565. break;
  566. case "arrest":
  567. require_once (HOMEPATH . '/conquest/cqarrest.inc.php');
  568. $btobj = new CQArrest($nacridan, $db);
  569. break;
  570. case "hustle":
  571. require_once (HOMEPATH . '/conquest/cqhustle.inc.php');
  572. $btobj = new CQHustle($nacridan, $db);
  573. break;
  574. case "leavebuilding":
  575. require_once (HOMEPATH . '/conquest/cqleavebuilding.inc.php');
  576. $btobj = new CQLeaveBuilding($nacridan, $db);
  577. break;
  578. case "disabledbravery":
  579. require_once (HOMEPATH . '/conquest/cqbravery.inc.php');
  580. $btobj = new CQBravery($nacridan, $db);
  581. break;
  582. case "disabledprotection":
  583. require_once (HOMEPATH . '/conquest/cqprotection.inc.php');
  584. $btobj = new CQProtection($nacridan, $db);
  585. break;
  586. case "revokegolem":
  587. require_once (HOMEPATH . '/conquest/cqrevoke.inc.php');
  588. $btobj = new CQRevoke($nacridan, $db);
  589. break;
  590. case "revokesoul":
  591. require_once (HOMEPATH . '/conquest/cqsoul.inc.php');
  592. $btobj = new CQSoul($nacridan, $db);
  593. break;
  594. case "turtle":
  595. require_once (HOMEPATH . '/conquest/cqturtle.inc.php');
  596. $btobj = new CQTurtle($nacridan, $db);
  597. break;
  598. case "disabledresistance":
  599. require_once (HOMEPATH . '/conquest/cqresistance.inc.php');
  600. $btobj = new CQResistance($nacridan, $db);
  601. break;
  602. case "pick":
  603. require_once (HOMEPATH . '/conquest/cqpick.inc.php');
  604. $btobj = new CQPick($nacridan, $db);
  605. break;
  606. case "drop":
  607. require_once (HOMEPATH . '/conquest/cqdrop.inc.php');
  608. $btobj = new CQDrop($nacridan, $db);
  609. break;
  610. case "give":
  611. require_once (HOMEPATH . '/conquest/cqgive.inc.php');
  612. $btobj = new CQGive($nacridan, $db);
  613. break;
  614. case "wear":
  615. require_once (HOMEPATH . '/conquest/cqwear.inc.php');
  616. $btobj = new CQWear($nacridan, $db);
  617. break;
  618. case "unwear":
  619. require_once (HOMEPATH . '/conquest/cqunwear.inc.php');
  620. $btobj = new CQUnWear($nacridan, $db);
  621. break;
  622. case "maintain":
  623. require_once (HOMEPATH . '/conquest/cqmaintain.inc.php');
  624. $btobj = new CQMaintain($nacridan, $db);
  625. break;
  626. case "store":
  627. require_once (HOMEPATH . '/conquest/cqstore.inc.php');
  628. $btobj = new CQStore($nacridan, $db);
  629. break;
  630. case "usepotion":
  631. require_once (HOMEPATH . '/conquest/cqusepotion.inc.php');
  632. $btobj = new CQUsePotion($nacridan, $db);
  633. break;
  634. case "useparchment":
  635. require_once (HOMEPATH . '/conquest/cqparchment.inc.php');
  636. $btobj = new CQParchment($nacridan, $db);
  637. break;
  638. case "givemoney":
  639. require_once (HOMEPATH . '/conquest/cqgivemoney.inc.php');
  640. $btobj = new CQGiveMoney($nacridan, $db);
  641. break;
  642. case "atbshift":
  643. require_once (HOMEPATH . '/conquest/cqatbshift.inc.php');
  644. $btobj = new CQATBShift($nacridan, $db);
  645. break;
  646. case "leavearena":
  647. require_once (HOMEPATH . '/conquest/cqleavearena.inc.php');
  648. $btobj = new CQLeaveArena($nacridan, $db);
  649. break;
  650. case "ability":
  651. require_once (HOMEPATH . '/conquest/cqability.inc.php');
  652. $btobj = new CQAbility($nacridan, $db);
  653. break;
  654. case "spell":
  655. require_once (HOMEPATH . '/conquest/cqspell.inc.php');
  656. $btobj = new CQSpell($nacridan, $db);
  657. break;
  658. case "talent":
  659. require_once (HOMEPATH . '/conquest/cqtalent.inc.php');
  660. $btobj = new CQTalent($nacridan, $db);
  661. break;
  662. case "legend":
  663. require_once (HOMEPATH . '/conquest/cqmaplegend.inc.php');
  664. $btobj = new CQMapLegend($nacridan, $db);
  665. break;
  666. case "teleport":
  667. require_once (HOMEPATH . '/conquest/inbuilding/cqteleport.inc.php');
  668. $btobj = new CQTeleport($nacridan, $db);
  669. break;
  670. case "rpaction":
  671. require_once (HOMEPATH . '/conquest/cqrpaction.inc.php');
  672. $btobj = new CQRPAction($nacridan, $db);
  673. // require_once(HOMEPATH.'/conquest/cqgivemoney.inc.php');
  674. // $btobj=new CQGiveMoney($nacridan,$db);
  675. break;
  676. case "caravane":
  677. require_once (HOMEPATH . '/conquest/inbuilding/cqcaravan.inc.php');
  678. $btobj = new CQCaravan($nacridan, $db);
  679. break;
  680. default:
  681. break;
  682. }
  683. if ($curplayer->get("inbuilding") == 1) {
  684. switch ($bottom) {
  685. case "teleport":
  686. require_once (HOMEPATH . '/conquest/inbuilding/cqteleport.inc.php');
  687. $btobj = new CQTeleport($nacridan, $db);
  688. break;
  689. case "arena":
  690. require_once (HOMEPATH . '/conquest/cqarena.inc.php');
  691. $btobj = new CQArena($nacridan, $db);
  692. break;
  693. case "caravane":
  694. require_once (HOMEPATH . '/conquest/inbuilding/cqcaravan.inc.php');
  695. $btobj = new CQCaravan(nacridan, $db);
  696. break;
  697. default:
  698. break;
  699. }
  700. }
  701. }
  702. $MAIN_BOTTOM->add($btobj);
  703. if (! isset($center))
  704. $center = "";
  705. if (($center == "view" && $nacridan->auth->auth["view2d"]) || $center == "view2d") {
  706. if (null === $minimap && $isMinimapNeeded) {
  707. require_once (HOMEPATH . '/conquest/cqview2D.inc.php');
  708. $tempview = new CQView2D($nacridan, $MAIN_BODY, $db);
  709. $minimap = $tempview->minimap;
  710. $radius = $tempview->radius;
  711. }
  712. if (null !== $minimap) {
  713. require_once (HOMEPATH . '/conquest/cqviewpanel.inc.php');
  714. $btobjmenu = new CQViewpanel($nacridan, $minimap, $move2Daction, $radius, $db);
  715. $MAIN_BOTTOM->add($btobjmenu);
  716. }
  717. }
  718. }
  719. require_once (HOMEPATH . '/conquest/cqright.inc.php');
  720. $MAIN_BODY->add(new CQRight($nacridan, $db));
  721. $str = "</div>";
  722. $MAIN_BODY->add($str);
  723. // Nouvel install de google analytic avec le compte nacridan.contact@gmail.com
  724. // Ne pas supprimer le script ci-dessous ! Voir avec Aé Li pour toute questions
  725. $google = "<script>
  726. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  727. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  728. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  729. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  730. ga('create', 'UA-68594660-1', 'auto');
  731. ga('send', 'pageview');
  732. </script>";
  733. $MAIN_BODY->add($google);
  734. $MAIN_PAGE->render();
  735. Translation::saveMessages();
  736. // profiler_stop("start");
  737. // $prof->printTimers(PROFILER_MODE);
  738. /*
  739. * mysql_query("update Player set ap='8' where id='6920'");
  740. * echo mysql_error();
  741. */
  742. ?>