Advertisement
Guest User

mapindex.c

a guest
Feb 9th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.38 KB | None | 0 0
  1. /****************************************************************************!
  2. * _ _ _ _ *
  3. * | |__ _ __ / \ | |_| |__ ___ _ __ __ _ *
  4. * | '_ \| '__/ _ \| __| '_ \ / _ \ '_ \ / _` | *
  5. * | |_) | | / ___ \ |_| | | | __/ | | | (_| | *
  6. * |_.__/|_|/_/ \_\__|_| |_|\___|_| |_|\__,_| *
  7. * *
  8. * www.brathena.org *
  9. ******************************************************************************
  10. * src/common/mapindex.c *
  11. ******************************************************************************
  12. * Copyright (c) brAthena Dev Team *
  13. * Copyright (c) Hercules Dev Team *
  14. * Copyright (c) Athena Dev Teams *
  15. * *
  16. * Licenciado sob a licença GNU GPL *
  17. * Para mais informações leia o arquivo LICENSE na raíz do emulador *
  18. *****************************************************************************/
  19.  
  20. #define BRATHENA_CORE
  21.  
  22. #include "mapindex.h"
  23.  
  24. #include "common/cbasetypes.h"
  25. #include "common/db.h"
  26. #include "common/mmo.h"
  27. #include "common/showmsg.h"
  28. #include "common/strlib.h"
  29.  
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32.  
  33. /* mapindex.c interface source */
  34. struct mapindex_interface mapindex_s;
  35. struct mapindex_interface *mapindex;
  36.  
  37. // Lista de Mapas
  38. const char *map_list[MAX_MAPINDEX] = {
  39. "alb_ship",
  40. "alb2trea",
  41. "alberta",
  42. "alberta_in",
  43. "alde_dun01",
  44. "alde_dun02",
  45. "alde_dun03",
  46. "alde_dun04",
  47. "aldeba_in",
  48. "aldebaran",
  49. "anthell01",
  50. "anthell02",
  51. "arena_room",
  52. "c_tower1",
  53. "c_tower2",
  54. "c_tower3",
  55. "c_tower4",
  56. "force_1-1",
  57. "force_1-2",
  58. "force_1-3",
  59. "force_2-1",
  60. "force_2-2",
  61. "force_2-3",
  62. "force_3-1",
  63. "force_3-2",
  64. "force_3-3",
  65. "gef_dun00",
  66. "gef_dun01",
  67. "gef_dun02",
  68. "gef_dun03",
  69. "gef_fild00",
  70. "gef_fild01",
  71. "gef_fild02",
  72. "gef_fild03",
  73. "gef_fild04",
  74. "gef_fild05",
  75. "gef_fild06",
  76. "gef_fild07",
  77. "gef_fild08",
  78. "gef_fild09",
  79. "gef_fild10",
  80. "gef_fild11",
  81. "gef_fild12",
  82. "gef_fild13",
  83. "gef_fild14",
  84. "gef_tower",
  85. "geffen",
  86. "geffen_in",
  87. "gl_cas01",
  88. "gl_cas02",
  89. "gl_church",
  90. "gl_chyard",
  91. "gl_dun01",
  92. "gl_dun02",
  93. "gl_in01",
  94. "gl_knt01",
  95. "gl_knt02",
  96. "gl_prison",
  97. "gl_prison1",
  98. "gl_sew01",
  99. "gl_sew02",
  100. "gl_sew03",
  101. "gl_sew04",
  102. "gl_step",
  103. "glast_01",
  104. "hunter_1-1",
  105. "hunter_2-1",
  106. "hunter_3-1",
  107. "in_hunter",
  108. "in_moc_16",
  109. "in_orcs01",
  110. "in_sphinx1",
  111. "in_sphinx2",
  112. "in_sphinx3",
  113. "in_sphinx4",
  114. "in_sphinx5",
  115. "iz_dun00",
  116. "iz_dun01",
  117. "iz_dun02",
  118. "iz_dun03",
  119. "iz_dun04",
  120. "job_sword1",
  121. "izlu2dun",
  122. "izlude",
  123. "izlude_in",
  124. "job_thief1",
  125. "knight_1-1",
  126. "knight_2-1",
  127. "knight_3-1",
  128. "mjo_dun01",
  129. "mjo_dun02",
  130. "mjo_dun03",
  131. "mjolnir_01",
  132. "mjolnir_02",
  133. "mjolnir_03",
  134. "mjolnir_04",
  135. "mjolnir_05",
  136. "mjolnir_06",
  137. "mjolnir_07",
  138. "mjolnir_08",
  139. "mjolnir_09",
  140. "mjolnir_10",
  141. "mjolnir_11",
  142. "mjolnir_12",
  143. "moc_castle",
  144. "moc_fild01",
  145. "moc_fild02",
  146. "moc_fild03",
  147. "moc_fild04",
  148. "moc_fild05",
  149. "moc_fild06",
  150. "moc_fild07",
  151. "moc_fild08",
  152. "moc_fild09",
  153. "moc_fild10",
  154. "moc_fild11",
  155. "moc_fild12",
  156. "moc_fild13",
  157. "moc_fild14",
  158. "moc_fild15",
  159. "moc_fild16",
  160. "moc_fild17",
  161. "moc_fild18",
  162. "moc_fild19",
  163. "moc_pryd01",
  164. "moc_pryd02",
  165. "moc_pryd03",
  166. "moc_pryd04",
  167. "moc_pryd05",
  168. "moc_pryd06",
  169. "moc_prydb1",
  170. "moc_ruins",
  171. "monk_in",
  172. "morocc",
  173. "morocc_in",
  174. "new_1-1",
  175. "new_1-2",
  176. "new_1-3",
  177. "new_1-4",
  178. "new_2-1",
  179. "new_2-2",
  180. "new_2-3",
  181. "new_2-4",
  182. "new_3-1",
  183. "new_3-2",
  184. "new_3-3",
  185. "new_3-4",
  186. "new_4-1",
  187. "new_4-2",
  188. "new_4-3",
  189. "new_4-4",
  190. "new_5-1",
  191. "new_5-2",
  192. "new_5-3",
  193. "new_5-4",
  194. "orcsdun01",
  195. "orcsdun02",
  196. "ordeal_1-1",
  197. "ordeal_1-2",
  198. //"ordeal_1-3",
  199. //"ordeal_1-4",
  200. "ordeal_2-1",
  201. "ordeal_2-2",
  202. //"ordeal_2-3",
  203. //"ordeal_2-4",
  204. "ordeal_3-1",
  205. "ordeal_3-2",
  206. //"ordeal_3-3",
  207. //"ordeal_3-4",
  208. "pay_arche",
  209. "pay_dun00",
  210. "pay_dun01",
  211. "pay_dun02",
  212. "pay_dun03",
  213. "pay_dun04",
  214. "pay_fild01",
  215. "pay_fild02",
  216. "pay_fild03",
  217. "pay_fild04",
  218. "pay_fild05",
  219. "pay_fild06",
  220. "pay_fild07",
  221. "pay_fild08",
  222. "pay_fild09",
  223. "pay_fild10",
  224. "pay_fild11",
  225. "payon",
  226. "payon_in01",
  227. "payon_in02",
  228. "priest_1-1",
  229. "priest_2-1",
  230. "priest_3-1",
  231. "prontera",
  232. "prt_are_in",
  233. "prt_are01",
  234. "pvp_room",
  235. "prt_castle",
  236. "prt_church",
  237. "prt_fild00",
  238. "prt_fild01",
  239. "prt_fild02",
  240. "prt_fild03",
  241. "prt_fild04",
  242. "prt_fild05",
  243. "prt_fild06",
  244. "prt_fild07",
  245. "prt_fild08",
  246. "prt_fild09",
  247. "prt_fild10",
  248. "prt_fild11",
  249. "prt_in",
  250. "prt_maze01",
  251. "prt_maze02",
  252. "prt_maze03",
  253. "prt_monk",
  254. "prt_sewb1",
  255. "prt_sewb2",
  256. "prt_sewb3",
  257. "prt_sewb4",
  258. "pvp_2vs2",
  259. "pvp_c_room",
  260. "pvp_n_1-1",
  261. "pvp_n_1-2",
  262. "pvp_n_1-3",
  263. "pvp_n_1-4",
  264. "pvp_n_1-5",
  265. "pvp_n_2-1",
  266. "pvp_n_2-2",
  267. "pvp_n_2-3",
  268. "pvp_n_2-4",
  269. "pvp_n_2-5",
  270. "pvp_n_3-1",
  271. "pvp_n_3-2",
  272. "pvp_n_3-3",
  273. "pvp_n_3-4",
  274. "pvp_n_3-5",
  275. "pvp_n_4-1",
  276. "pvp_n_4-2",
  277. "pvp_n_4-3",
  278. "pvp_n_4-4",
  279. "pvp_n_4-5",
  280. "pvp_n_5-1",
  281. "pvp_n_5-2",
  282. "pvp_n_5-3",
  283. "pvp_n_5-4",
  284. "pvp_n_5-5",
  285. "pvp_n_6-1",
  286. "pvp_n_6-2",
  287. "pvp_n_6-3",
  288. "pvp_n_6-4",
  289. "pvp_n_6-5",
  290. "pvp_n_7-1",
  291. "pvp_n_7-2",
  292. "pvp_n_7-3",
  293. "pvp_n_7-4",
  294. "pvp_n_7-5",
  295. "pvp_n_8-1",
  296. "pvp_n_8-2",
  297. "pvp_n_8-3",
  298. "pvp_n_8-4",
  299. "pvp_n_8-5",
  300. "pvp_n_room",
  301. "pvp_y_1-1",
  302. "pvp_y_1-2",
  303. "pvp_y_1-3",
  304. "pvp_y_1-4",
  305. "pvp_y_1-5",
  306. "pvp_y_2-1",
  307. "pvp_y_2-2",
  308. "pvp_y_2-3",
  309. "pvp_y_2-4",
  310. "pvp_y_2-5",
  311. "pvp_y_3-1",
  312. "pvp_y_3-2",
  313. "pvp_y_3-3",
  314. "pvp_y_3-4",
  315. "pvp_y_3-5",
  316. "pvp_y_4-1",
  317. "pvp_y_4-2",
  318. "pvp_y_4-3",
  319. "pvp_y_4-4",
  320. "pvp_y_4-5",
  321. "pvp_y_5-1",
  322. "pvp_y_5-2",
  323. "pvp_y_5-3",
  324. "pvp_y_5-4",
  325. "pvp_y_5-5",
  326. "pvp_y_6-1",
  327. "pvp_y_6-2",
  328. "pvp_y_6-3",
  329. "pvp_y_6-4",
  330. "pvp_y_6-5",
  331. "pvp_y_7-1",
  332. "pvp_y_7-2",
  333. "pvp_y_7-3",
  334. "pvp_y_7-4",
  335. "pvp_y_7-5",
  336. "pvp_y_8-1",
  337. "pvp_y_8-2",
  338. "pvp_y_8-3",
  339. "pvp_y_8-4",
  340. "pvp_y_8-5",
  341. "pvp_y_room",
  342. "sword_1-1",
  343. "sword_2-1",
  344. "sword_3-1",
  345. "treasure01",
  346. "treasure02",
  347. "wizard_1-1",
  348. "wizard_2-1",
  349. "wizard_3-1",
  350. "xmas",
  351. "xmas_dun01",
  352. "xmas_dun02",
  353. "xmas_fild01",
  354. "xmas_in",
  355. "beach_dun",
  356. "beach_dun2",
  357. "beach_dun3",
  358. "cmd_fild01",
  359. "cmd_fild02",
  360. "cmd_fild03",
  361. "cmd_fild04",
  362. "cmd_fild05",
  363. "cmd_fild06",
  364. "cmd_fild07",
  365. "cmd_fild08",
  366. "cmd_fild09",
  367. "cmd_in01",
  368. "cmd_in02",
  369. "comodo",
  370. "quiz_00",
  371. "quiz_01",
  372. "g_room1-1",
  373. "g_room1-2",
  374. "g_room1-3",
  375. "g_room2",
  376. "tur_dun01",
  377. "tur_dun02",
  378. "tur_dun03",
  379. "tur_dun04",
  380. "tur_dun05",
  381. "tur_dun06",
  382. "alde_gld",
  383. "aldeg_cas01",
  384. "aldeg_cas02",
  385. "aldeg_cas03",
  386. "aldeg_cas04",
  387. "aldeg_cas05",
  388. "gefg_cas01",
  389. "gefg_cas02",
  390. "gefg_cas03",
  391. "gefg_cas04",
  392. "gefg_cas05",
  393. "gld_dun01",
  394. "gld_dun02",
  395. "gld_dun03",
  396. "gld_dun04",
  397. "guild_room",
  398. "guild_vs1",
  399. "guild_vs2",
  400. "guild_vs3",
  401. "guild_vs4",
  402. "guild_vs5",
  403. "guild_vs1-1",
  404. "guild_vs1-2",
  405. "guild_vs1-3",
  406. "guild_vs1-4",
  407. "guild_vs2-1",
  408. "guild_vs2-2",
  409. "job_hunte",
  410. "job_knt",
  411. "job_prist",
  412. "job_wiz",
  413. "pay_gld",
  414. "payg_cas01",
  415. "payg_cas02",
  416. "payg_cas03",
  417. "payg_cas04",
  418. "payg_cas05",
  419. "prt_gld",
  420. "prtg_cas01",
  421. "prtg_cas02",
  422. "prtg_cas03",
  423. "prtg_cas04",
  424. "prtg_cas05",
  425. "alde_alche",
  426. "in_rogue",
  427. "job_cru",
  428. "job_duncer",
  429. "job_monk",
  430. "job_sage",
  431. "mag_dun01",
  432. "mag_dun02",
  433. "monk_test",
  434. "quiz_test",
  435. "yuno",
  436. "yuno_fild01",
  437. "yuno_fild02",
  438. "yuno_fild03",
  439. "yuno_fild04",
  440. "yuno_in01",
  441. "yuno_in02",
  442. "yuno_in03",
  443. "yuno_in04",
  444. "yuno_in05",
  445. "ama_dun01",
  446. "ama_dun02",
  447. "ama_dun03",
  448. "ama_fild01",
  449. "ama_in01",
  450. "ama_in02",
  451. "ama_test",
  452. "amatsu",
  453. "gon_dun01",
  454. "gon_dun02",
  455. "gon_dun03",
  456. "gon_fild01",
  457. "gon_in",
  458. "gon_test",
  459. "gonryun",
  460. "sec_in01",
  461. "sec_in02",
  462. "sec_pri",
  463. "umbala",
  464. "um_dun01",
  465. "um_dun02",
  466. "um_fild01",
  467. "um_fild02",
  468. "um_fild03",
  469. "um_fild04",
  470. "um_in",
  471. "niflheim",
  472. "nif_fild01",
  473. "nif_fild02",
  474. "nif_in",
  475. "yggdrasil01",
  476. "valkyrie",
  477. "himinn",
  478. "lou_in01",
  479. "lou_in02",
  480. "lou_dun03",
  481. "lou_dun02",
  482. "lou_dun01",
  483. "lou_fild01",
  484. "louyang",
  485. "siege_test",
  486. "n_castle",
  487. "nguild_gef",
  488. "nguild_prt",
  489. "nguild_pay",
  490. "nguild_alde",
  491. "jawaii",
  492. "jawaii_in",
  493. "gefenia01",
  494. "gefenia02",
  495. "gefenia03",
  496. "gefenia04",
  497. "new_zone01",
  498. "new_zone02",
  499. "new_zone03",
  500. "new_zone04",
  501. "payon_in03",
  502. "ayothaya",
  503. "ayo_in01",
  504. "ayo_in02",
  505. "ayo_fild01",
  506. "ayo_fild02",
  507. "ayo_dun01",
  508. "ayo_dun02",
  509. "que_god01",
  510. "que_god02",
  511. "yuno_fild05",
  512. "yuno_fild07",
  513. "yuno_fild08",
  514. "yuno_fild09",
  515. "yuno_fild11",
  516. "yuno_fild12",
  517. "alde_tt02",
  518. "turbo_n_1",
  519. "turbo_n_4",
  520. "turbo_n_8",
  521. "turbo_n_16",
  522. "turbo_e_4",
  523. "turbo_e_8",
  524. "turbo_e_16",
  525. "turbo_room",
  526. "airplane",
  527. "airport",
  528. "einbech",
  529. "einbroch",
  530. "ein_dun01",
  531. "ein_dun02",
  532. "ein_fild06",
  533. "ein_fild07",
  534. "ein_fild08",
  535. "ein_fild09",
  536. "ein_fild10",
  537. "ein_in01",
  538. "que_sign01",
  539. "que_sign02",
  540. "ein_fild03",
  541. "ein_fild04",
  542. "lhz_fild02",
  543. "lhz_fild03",
  544. "yuno_pre",
  545. "lhz_fild01",
  546. "lighthalzen",
  547. "lhz_in01",
  548. "lhz_in02",
  549. "lhz_in03",
  550. "lhz_que01",
  551. "lhz_dun01",
  552. "lhz_dun02",
  553. "lhz_dun03",
  554. "lhz_cube",
  555. "juperos_01",
  556. "juperos_02",
  557. "jupe_area1",
  558. "jupe_area2",
  559. "jupe_core",
  560. "jupe_ele",
  561. "jupe_ele_r",
  562. "jupe_gate",
  563. "y_airport",
  564. "lhz_airport",
  565. "airplane_01",
  566. "jupe_cave",
  567. "quiz_02",
  568. "hu_fild07",
  569. "hu_fild05",
  570. "hu_fild04",
  571. "hu_fild01",
  572. "yuno_fild06",
  573. "job_soul",
  574. "job_star",
  575. "que_job01",
  576. "que_job02",
  577. "que_job03",
  578. "abyss_01",
  579. "abyss_02",
  580. "abyss_03",
  581. "thana_step",
  582. "thana_boss",
  583. "tha_scene01",
  584. "tha_t01",
  585. "tha_t02",
  586. "tha_t03",
  587. "tha_t04",
  588. "tha_t07",
  589. "tha_t05",
  590. "tha_t06",
  591. "tha_t08",
  592. "tha_t09",
  593. "tha_t10",
  594. "tha_t11",
  595. "tha_t12",
  596. "auction_01",
  597. "auction_02",
  598. "hugel",
  599. "hu_in01",
  600. "que_bingo",
  601. "que_hugel",
  602. "p_track01",
  603. "p_track02",
  604. "odin_tem01",
  605. "odin_tem02",
  606. "odin_tem03",
  607. "hu_fild02",
  608. "hu_fild03",
  609. "hu_fild06",
  610. "ein_fild01",
  611. "ein_fild02",
  612. "ein_fild05",
  613. "yuno_fild10",
  614. "kh_kiehl02",
  615. "kh_kiehl01",
  616. "kh_dun02",
  617. "kh_dun01",
  618. "kh_mansion",
  619. "kh_rossi",
  620. "kh_school",
  621. "kh_vila",
  622. "force_map1",
  623. "force_map2",
  624. "force_map3",
  625. "job_hunter",
  626. "job_knight",
  627. "job_priest",
  628. "job_wizard",
  629. "ve_in02",
  630. "rachel",
  631. "ra_in01",
  632. "ra_fild01",
  633. "ra_fild02",
  634. "ra_fild03",
  635. "ra_fild04",
  636. "ra_fild05",
  637. "ra_fild06",
  638. "ra_fild07",
  639. "ra_fild08",
  640. "ra_fild09",
  641. "ra_fild10",
  642. "ra_fild11",
  643. "ra_fild12",
  644. "ra_fild13",
  645. "ra_san01",
  646. "ra_san02",
  647. "ra_san03",
  648. "ra_san04",
  649. "ra_san05",
  650. "ra_temin",
  651. "ra_temple",
  652. "ra_temsky",
  653. "que_rachel",
  654. "ice_dun01",
  655. "ice_dun02",
  656. "ice_dun03",
  657. "ice_dun04",
  658. "que_thor",
  659. "thor_camp",
  660. "thor_v01",
  661. "thor_v02",
  662. "thor_v03",
  663. "veins",
  664. "ve_in",
  665. "ve_fild01",
  666. "ve_fild02",
  667. "ve_fild03",
  668. "ve_fild04",
  669. "ve_fild05",
  670. "ve_fild06",
  671. "ve_fild07",
  672. "poring_c01",
  673. "poring_c02",
  674. "que_ng",
  675. "nameless_i",
  676. "nameless_n",
  677. "nameless_in",
  678. "abbey01",
  679. "abbey02",
  680. "abbey03",
  681. "poring_w01",
  682. "poring_w02",
  683. "que_san04",
  684. "moscovia",
  685. "mosk_in",
  686. "mosk_ship",
  687. "mosk_fild01",
  688. "mosk_fild02",
  689. "mosk_dun01",
  690. "mosk_dun02",
  691. "mosk_dun03",
  692. "mosk_que",
  693. "force_4-1",
  694. "force_5-1",
  695. "06guild_r",
  696. "06guild_01",
  697. "06guild_02",
  698. "06guild_03",
  699. "06guild_04",
  700. "06guild_05",
  701. "06guild_06",
  702. "06guild_07",
  703. "06guild_08",
  704. "z_agit",
  705. "que_temsky",
  706. "itemmall",
  707. "bossnia_01",
  708. "bossnia_02",
  709. "bossnia_03",
  710. "bossnia_04",
  711. "schg_cas01",
  712. "schg_cas02",
  713. "schg_cas03",
  714. "schg_cas04",
  715. "schg_cas05",
  716. "sch_gld",
  717. "cave",
  718. "moc_fild20",
  719. "moc_fild21",
  720. "moc_fild22",
  721. "que_ba",
  722. "que_moc_16",
  723. "que_moon",
  724. "arug_cas01",
  725. "arug_cas02",
  726. "arug_cas03",
  727. "arug_cas04",
  728. "arug_cas05",
  729. "aru_gld",
  730. "bat_room",
  731. "bat_a01",
  732. "bat_a02",
  733. "bat_b01",
  734. "bat_b02",
  735. "que_qsch01",
  736. "que_qsch02",
  737. "que_qsch03",
  738. "que_qsch04",
  739. "que_qsch05",
  740. "que_qaru01",
  741. "que_qaru02",
  742. "que_qaru03",
  743. "que_qaru04",
  744. "que_qaru05",
  745. "1@cata",
  746. "2@cata",
  747. "e_tower",
  748. "1@tower",
  749. "2@tower",
  750. "3@tower",
  751. "4@tower",
  752. "5@tower",
  753. "6@tower",
  754. "mid_camp",
  755. "mid_campin",
  756. "man_fild01",
  757. "man_fild03",
  758. "spl_fild02",
  759. "spl_fild03",
  760. "moc_fild22b",
  761. "que_dan01",
  762. "que_dan02",
  763. "schg_que01",
  764. "schg_dun01",
  765. "arug_que01",
  766. "arug_dun01",
  767. "1@orcs",
  768. "2@orcs",
  769. "1@nyd",
  770. "2@nyd",
  771. "nyd_dun01",
  772. "nyd_dun02",
  773. "manuk",
  774. "man_fild02",
  775. "man_in01",
  776. "splendide",
  777. "spl_fild01",
  778. "spl_in01",
  779. "spl_in02",
  780. "bat_c01",
  781. "bat_c02",
  782. "bat_c03",
  783. "moc_para01",
  784. "job3_arch01",
  785. "job3_arch02",
  786. "job3_arch03",
  787. "job3_guil01",
  788. "job3_guil02",
  789. "job3_guil03",
  790. "job3_rang01",
  791. "job3_rang02",
  792. "job3_rune01",
  793. "job3_rune02",
  794. "job3_rune03",
  795. "job3_war01",
  796. "job3_war02",
  797. "jupe_core2",
  798. "brasilis",
  799. "bra_in01",
  800. "bra_fild01",
  801. "bra_dun01",
  802. "bra_dun02",
  803. "dicastes01",
  804. "dicastes02",
  805. "dic_in01",
  806. "dic_fild01",
  807. "dic_fild02",
  808. "dic_dun01",
  809. "dic_dun02",
  810. "job3_gen01",
  811. "s_atelier",
  812. "job3_sha01",
  813. //"evt_zombie",
  814. //"evt_coke",
  815. //"ac_sl_area",
  816. //"ac_cl_hall",
  817. //"ac_cl_room",
  818. //"jp_s_dun11",
  819. "mora",
  820. "bif_fild01",
  821. "bif_fild02",
  822. "1@mist",
  823. "dewata",
  824. "dew_in01",
  825. "dew_fild01",
  826. "dew_dun01",
  827. "dew_dun02",
  828. "que_house_s",
  829. "malangdo",
  830. "mal_in01",
  831. "mal_in02",
  832. "mal_dun01",
  833. "1@pump",
  834. "2@pump",
  835. "1@cash",
  836. "iz_dun05",
  837. "evt_mobroom",
  838. "alde_tt03",
  839. "dic_dun03",
  840. //"mjolnir_04_1",
  841. //"evt_swar_b",
  842. //"evt_swar_r",
  843. //"evt_swar_s",
  844. //"evt_swar_t",
  845. "1@lhz",
  846. "lhz_dun04",
  847. "que_lhz",
  848. "gld_dun01_2",
  849. "gld_dun02_2",
  850. "gld_dun03_2",
  851. "gld_dun04_2",
  852. "gld2_ald",
  853. "gld2_gef",
  854. "gld2_pay",
  855. "gld2_prt",
  856. "malaya",
  857. "ma_fild01",
  858. "ma_fild02",
  859. "ma_scene01",
  860. "ma_in01",
  861. "ma_dun01",
  862. "1@ma_h",
  863. "1@ma_c",
  864. "1@ma_b",
  865. "ma_zif01",
  866. "ma_zif02",
  867. "ma_zif03",
  868. "ma_zif04",
  869. "ma_zif05",
  870. "ma_zif06",
  871. "ma_zif07",
  872. "ma_zif08",
  873. "ma_zif09",
  874. "job_ko",
  875. "eclage",
  876. "ecl_fild01",
  877. "ecl_in01",
  878. "ecl_in02",
  879. "ecl_in03",
  880. "ecl_in04",
  881. "1@ecl",
  882. "ecl_tdun01",
  883. "ecl_tdun02",
  884. "ecl_tdun03",
  885. "ecl_tdun04",
  886. "ecl_hub01",
  887. "que_avan01",
  888. "moc_prydn1",
  889. "moc_prydn2",
  890. "iz_int",
  891. "iz_int01",
  892. "iz_int02",
  893. "iz_int03",
  894. "iz_int04",
  895. "iz_ac01",
  896. "iz_ac02",
  897. "iz_ng01",
  898. "treasure_n1",
  899. "treasure_n2",
  900. "iz_ac01_d",
  901. "iz_ac02_d",
  902. "iz_ac01_c",
  903. "iz_ac02_c",
  904. "iz_ac01_b",
  905. "iz_ac02_b",
  906. "iz_ac01_a",
  907. "iz_ac02_a",
  908. "izlude_d",
  909. "izlude_c",
  910. "izlude_b",
  911. "izlude_a",
  912. "prt_fild08d",
  913. "prt_fild08c",
  914. "prt_fild08b",
  915. "prt_fild08a",
  916. "te_prt_gld",
  917. "te_prtcas01",
  918. "te_prtcas02",
  919. "te_prtcas03",
  920. "te_prtcas04",
  921. "te_prtcas05",
  922. "teg_dun01",
  923. "teg_dun02",
  924. "te_alde_gld",
  925. "te_aldecas1",
  926. "te_aldecas2",
  927. "te_aldecas3",
  928. "te_aldecas4",
  929. "te_aldecas5",
  930. "1@gl_k",
  931. "2@gl_k",
  932. "gl_cas02_",
  933. "gl_chyard_",
  934. "silk_lair",
  935. "evt_bomb",
  936. "1@def01",
  937. "1@def02",
  938. "1@def03",
  939. "1@face",
  940. "1@sara",
  941. "dali",
  942. "dali02",
  943. "1@tnm1",
  944. "1@tnm2",
  945. "1@tnm3",
  946. "1@ge_st",
  947. "1@gef",
  948. "1@gef_in",
  949. "1@spa",
  950. "moro_vol",
  951. "moro_cav",
  952. "1@dth1",
  953. "1@dth2",
  954. "1@dth3",
  955. "1@rev",
  956. "1@xm_d",
  957. "1@eom",
  958. "1@jtb",
  959. "c_tower2_",
  960. "c_tower3_",
  961. //"rwc01",
  962. //"rwc02",
  963. //"rwc03",
  964. //"2009rwc_f01",
  965. //"2009rwc_01",
  966. //"2009rwc_02",
  967. //"2009rwc_03",
  968. //"2009rwc_04",
  969. //"2008rwc_04",
  970. //"prontera_x",
  971. //"alberta_x",
  972. //"aldebaran_x",
  973. //"geffen_x",
  974. //"izlude_x",
  975. //"prt_church_x",
  976. //"prontera_s",
  977. //"pay_arche_s",
  978. //"xmas_old",
  979. //"ordeal_a00",
  980. //"ordeal_a02",
  981. //"fay_vilg00",
  982. //"fay_vilg01",
  983. //"gef_vilg00",
  984. //"gef_vilg01",
  985. //"moc_dugn01",
  986. //"moc_dugn02",
  987. //"moc_fild01",
  988. //"moc_fild02",
  989. //"moc_fild03",
  990. //"moc_fild04",
  991. //"moc_intr00",
  992. //"moc_intr01",
  993. //"moc_intr02",
  994. //"moc_intr04",
  995. //"moc_vilg00",
  996. //"moc_vilg01",
  997. //"moc_vilg02",
  998. //"probemap",
  999. //"probemap02",
  1000. //"prt_cstl01",
  1001. //"prt_dugn00",
  1002. //"prt_dugn01",
  1003. //"prt_fild00",
  1004. //"prt_fild01",
  1005. //"prt_fild03",
  1006. //"prt_fild04",
  1007. //"prt_fild05",
  1008. //"prt_intr01",
  1009. //"prt_intr01_a",
  1010. //"prt_intr02",
  1011. //"prt_vilg00",
  1012. //"prt_vilg01",
  1013. //"prt_vilg02",
  1014. //"tank_test",
  1015. //"tank_test2",
  1016. //"test",
  1017.  
  1018. /** Mapas Personalizados **/
  1019. //"custom_map"
  1020. };
  1021.  
  1022. /// Retrieves the map name from 'string' (removing .gat extension if present).
  1023. /// Result gets placed either into 'buf' or in a static local buffer.
  1024. const char* mapindex_getmapname(const char* string, char* output) {
  1025. static char buf[MAP_NAME_LENGTH];
  1026. char* dest = (output != NULL) ? output : buf;
  1027.  
  1028. size_t len = strnlen(string, MAP_NAME_LENGTH_EXT);
  1029. if (len == MAP_NAME_LENGTH_EXT) {
  1030. ShowWarning("(mapindex_normalize_name) Nome do mapa '%*s' muito extenso!\n", 2*MAP_NAME_LENGTH_EXT, string);
  1031. len--;
  1032. }
  1033. if (len >= 4 && stricmp(&string[len-4], ".gat") == 0)
  1034. len -= 4; // strip .gat extension
  1035.  
  1036. len = min(len, MAP_NAME_LENGTH-1);
  1037. safestrncpy(dest, string, len+1);
  1038. memset(&dest[len], '\0', MAP_NAME_LENGTH-len);
  1039.  
  1040. return dest;
  1041. }
  1042.  
  1043. /// Retrieves the map name from 'string' (adding .gat extension if not already present).
  1044. /// Result gets placed either into 'buf' or in a static local buffer.
  1045. const char* mapindex_getmapname_ext(const char* string, char* output) {
  1046. static char buf[MAP_NAME_LENGTH_EXT];
  1047. char* dest = (output != NULL) ? output : buf;
  1048.  
  1049. size_t len;
  1050.  
  1051. safestrncpy(buf,string, sizeof(buf));
  1052. sscanf(string, "%*[^#]%*[#]%15s", buf);
  1053.  
  1054. len = safestrnlen(buf, MAP_NAME_LENGTH);
  1055.  
  1056. if (len == MAP_NAME_LENGTH) {
  1057. ShowWarning("(mapindex_normalize_name) Nome do mapa '%s' muito extenso!\n", buf);
  1058. len--;
  1059. }
  1060. safestrncpy(dest, buf, len+1);
  1061.  
  1062. if (len < 4 || stricmp(&dest[len-4], ".gat") != 0) {
  1063. strcpy(&dest[len], ".gat");
  1064. len += 4; // add .gat extension
  1065. }
  1066.  
  1067. memset(&dest[len], '\0', MAP_NAME_LENGTH_EXT-len);
  1068.  
  1069. return dest;
  1070. }
  1071.  
  1072. /// Adds a map to the specified index
  1073. /// Returns 1 if successful, 0 otherwise
  1074. int mapindex_addmap(int index, const char* name) {
  1075. char map_name[MAP_NAME_LENGTH];
  1076.  
  1077. if (index == -1){
  1078. for (index = 1; index < mapindex->num; index++) {
  1079. if (mapindex->list[index].name[0] == '\0')
  1080. break;
  1081. }
  1082. }
  1083.  
  1084. if (index < 0 || index >= MAX_MAPINDEX) {
  1085. ShowError("(mapindex_add) Indice do mapa (%d) mapa \"%s\" fora do alcance (maximo %d)\n", index, name, MAX_MAPINDEX);
  1086. return 0;
  1087. }
  1088.  
  1089. mapindex->getmapname(name, map_name);
  1090.  
  1091. if (map_name[0] == '\0') {
  1092. ShowError("(mapindex_add) Nao foi possivel adicionar mapas sem nome.\n");
  1093. return 0;
  1094. }
  1095.  
  1096. if (strlen(map_name) >= MAP_NAME_LENGTH) {
  1097. ShowError("(mapindex_add) Nome do mapa %s muito extenso. Mapas sao limitados a %d caracteres.\n", map_name, MAP_NAME_LENGTH);
  1098. return 0;
  1099. }
  1100.  
  1101. if (mapindex_exists(index)) {
  1102. ShowWarning("(mapindex_add) Substituindo indice %d: mapa \"%s\" -> \"%s\"\n", index, mapindex->list[index].name, map_name);
  1103. strdb_remove(mapindex->db, mapindex->list[index].name);
  1104. }
  1105.  
  1106. safestrncpy(mapindex->list[index].name, map_name, MAP_NAME_LENGTH);
  1107. strdb_iput(mapindex->db, map_name, index);
  1108.  
  1109. if (mapindex->num <= index)
  1110. mapindex->num = index+1;
  1111.  
  1112. return index;
  1113. }
  1114.  
  1115. unsigned short mapindex_name2id(const char* name) {
  1116. int i;
  1117. char map_name[MAP_NAME_LENGTH];
  1118.  
  1119. mapindex->getmapname(name, map_name);
  1120.  
  1121. if( (i = strdb_iget(mapindex->db, map_name)) )
  1122. return i;
  1123.  
  1124. ShowDebug("mapindex_name2id: Mapa \"%s\" nao foi encontrado na lista do indice!\n", map_name);
  1125. return 0;
  1126. }
  1127.  
  1128. const char *mapindex_id2name_sub(uint16 id, const char *file, int line, const char *func) {
  1129. if (id >= MAX_MAPINDEX || !mapindex_exists(id)) {
  1130. ShowDebug("mapindex_id2name: Nome requisitado para mapa nao existente [%d] em cache. %s:%s:%d\n", id,file,func,line);
  1131. return mapindex->list[0].name; // dummy empty string so that the callee doesn't crash
  1132. }
  1133. return mapindex->list[id].name;
  1134. }
  1135.  
  1136. int mapindex_init(void) {
  1137. int i = 0;
  1138.  
  1139. mapindex->db = strdb_alloc(DB_OPT_DUP_KEY, MAP_NAME_LENGTH);
  1140.  
  1141. for (; i < ARRAYLENGTH(map_list); i++) {
  1142. if (map_list[i] == NULL)
  1143. continue;
  1144.  
  1145. mapindex->addmap((i + 1), map_list[i]);
  1146. }
  1147.  
  1148. mapindex->check_default();
  1149. return i;
  1150. }
  1151.  
  1152. bool mapindex_check_default(void)
  1153. {
  1154. if (!strdb_iget(mapindex->db, mapindex->default_map)) {
  1155. ShowError("mapindex_init: MAP_DEFAULT '%s' nao foi encontrado em cache! Modifique o valor de MAP_DEFAULT em mapindex.h!!!\n", mapindex->default_map);
  1156. return false;
  1157. }
  1158. return true;
  1159. }
  1160.  
  1161. void mapindex_removemap(int index){
  1162. strdb_remove(mapindex->db, mapindex->list[index].name);
  1163. mapindex->list[index].name[0] = '\0';
  1164. }
  1165.  
  1166. void mapindex_final(void) {
  1167. db_destroy(mapindex->db);
  1168. }
  1169.  
  1170. void mapindex_defaults(void) {
  1171. mapindex = &mapindex_s;
  1172.  
  1173. /* TODO: place it in inter-server.conf? */
  1174. snprintf(mapindex->config_file, sizeof(mapindex->config_file), "%s","db/map_index.txt");
  1175. /* */
  1176. mapindex->db = NULL;
  1177. mapindex->num = 0;
  1178. mapindex->default_map = MAP_DEFAULT;
  1179. mapindex->default_x = MAP_DEFAULT_X;
  1180. mapindex->default_y = MAP_DEFAULT_Y;
  1181. memset (&mapindex->list, 0, sizeof (mapindex->list));
  1182.  
  1183. /* */
  1184. mapindex->init = mapindex_init;
  1185. mapindex->final = mapindex_final;
  1186. /* */
  1187. mapindex->addmap = mapindex_addmap;
  1188. mapindex->removemap = mapindex_removemap;
  1189. mapindex->getmapname = mapindex_getmapname;
  1190. mapindex->getmapname_ext = mapindex_getmapname_ext;
  1191. mapindex->name2id = mapindex_name2id;
  1192. mapindex->id2name = mapindex_id2name_sub;
  1193. mapindex->check_default = mapindex_check_default;
  1194. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement