Owl

Create path has never been so easy

目前为 2018-04-10 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Owl
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.1.0
  5. // @description Create path has never been so easy
  6. // @author Drigtime
  7. // @match https://dofus-map.com/*
  8. // @icon64 data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK0AAACtAB0IQVDAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABt2SURBVHic7V1ndFTXtf7OvTMjpFHvYFPUkYQMCAQyCAwI0YRAFMUNl2U7jmMndhzHy3Heeg4vL3EcO4nz8pK4xQ07LhHY2BiERTEd0SRQGQk1JFRnRl1TNOXe834I0MzcO026Ery1/K2lHzp97r7nnH32/va5wPf4Ht/DOYhUDS0rKPCXG+izhNCZPCW7Du7d+YVUbd+KyMkruAuUf5QCnXKOea2oqFArRbuMFI0AgNxA3wfwG0rJfQTYlbNuy1NStX2rIXtdwRrw9AAoeYBQ8ryVYC8kerklaaSgoIDtM1AjALlNspXwZHVxUeFhKfq4VbBmTUESx9ISAMF2GYQmHvhmV91Y25dkhmi1SjnshQEAMsrQf6/MvTtZij5uBWRvuDeKY/mv4SgMAOAZpRR9SLZkOUEYAXcqe33BnePcz7hj9YaCeIaznAFI4nj2M94CAYBghtJ9Oeu3Zk9AX+OC1es3zeY5/gCA6ePd10QIBACCQXEgJ3frKwUFBewE9TlmbN++nVm1fut2nrLnATJjIvqcKIEAwwrEC31GWrw6b0vqBPY7KqzM3RJ78lzVHkrxawCyiep33DpSKOQwmy3CDIoVPCUXc9ZvfYsS8urBPYVXx2sMo0H2pk1hjJl5GiDPA9RXrIzT3yYBxk0gdy7MQFxsDN7f8QkopcJ+KZ4ilP5o5botu8CQN626rhNHjhyxjtd43IDkrNsyD4Q8BjMeAOAnWogQPPLQfahvuIKjx0+Ny0DGTSCEENxTkI8Z02/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12.4/jquery.min.js
  11. // @require https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js
  13. // @grant GM_setValue
  14. // @grant GM_getValue
  15. // ==/UserScript==
  16.  
  17. (function () {
  18. var icon = {
  19. top: {
  20. move: L.icon({
  21. iconUrl: "https://svgshare.com/i/54N.svg",
  22. className: "top-arrow"
  23. }),
  24. gather: L.icon({
  25. iconUrl: "https://svgshare.com/i/556.svg",
  26. className: "top-arrow"
  27. }),
  28. fight: L.icon({
  29. iconUrl: "https://svgshare.com/i/53n.svg",
  30. className: "top-arrow"
  31. }),
  32. bank: L.icon({
  33. iconUrl: "https://svgshare.com/i/54G.svg",
  34. className: "top-arrow"
  35. }),
  36. phoenix: L.icon({
  37. iconUrl: "https://svgshare.com/i/54x.svg",
  38. className: "top-arrow"
  39. })
  40. },
  41. left: {
  42. move: L.icon({
  43. iconUrl: "https://svgshare.com/i/54m.svg",
  44. className: "left-arrow"
  45. }),
  46. gather: L.icon({
  47. iconUrl: "https://svgshare.com/i/555.svg",
  48. className: "left-arrow"
  49. }),
  50. fight: L.icon({
  51. iconUrl: "https://svgshare.com/i/54H.svg",
  52. className: "left-arrow"
  53. }),
  54. bank: L.icon({
  55. iconUrl: "https://svgshare.com/i/54v.svg",
  56. className: "left-arrow"
  57. }),
  58. phoenix: L.icon({
  59. iconUrl: "https://svgshare.com/i/557.svg",
  60. className: "left-arrow"
  61. })
  62. },
  63. bottom: {
  64. move: L.icon({
  65. iconUrl: "https://svgshare.com/i/51x.svg",
  66. className: "bottom-arrow"
  67. }),
  68. gather: L.icon({
  69. iconUrl: "https://svgshare.com/i/54b.svg",
  70. className: "bottom-arrow"
  71. }),
  72. fight: L.icon({
  73. iconUrl: "https://svgshare.com/i/54o.svg",
  74. className: "bottom-arrow"
  75. }),
  76. bank: L.icon({
  77. iconUrl: "https://svgshare.com/i/53x.svg",
  78. className: "bottom-arrow"
  79. }),
  80. phoenix: L.icon({
  81. iconUrl: "https://svgshare.com/i/54q.svg",
  82. className: "bottom-arrow"
  83. })
  84. },
  85. right: {
  86. move: L.icon({
  87. iconUrl: "https://svgshare.com/i/53t.svg",
  88. className: "right-arrow"
  89. }),
  90. gather: L.icon({
  91. iconUrl: "https://svgshare.com/i/54p.svg",
  92. className: "right-arrow"
  93. }),
  94. fight: L.icon({
  95. iconUrl: "https://svgshare.com/i/527.svg",
  96. className: "right-arrow"
  97. }),
  98. bank: L.icon({
  99. iconUrl: "https://svgshare.com/i/54w.svg",
  100. className: "right-arrow"
  101. }),
  102. phoenix: L.icon({
  103. iconUrl: "https://svgshare.com/i/543.svg",
  104. className: "right-arrow"
  105. })
  106. },
  107. havenbag: {
  108. move: L.icon({
  109. iconUrl: "https://svgshare.com/i/58M.svg",
  110. className: "havenbag-icon"
  111. }),
  112. gather: L.icon({
  113. iconUrl: "https://svgshare.com/i/58N.svg",
  114. className: "havenbag-icon"
  115. }),
  116. fight: L.icon({
  117. iconUrl: "https://svgshare.com/i/5BW.svg",
  118. className: "havenbag-icon"
  119. }),
  120. bank: L.icon({
  121. iconUrl: "https://svgshare.com/i/5BL.svg",
  122. className: "havenbag-icon"
  123. }),
  124. phoenix: L.icon({
  125. iconUrl: "https://svgshare.com/i/5BB.svg",
  126. className: "havenbag-icon"
  127. })
  128. },
  129. hint: {
  130. phenix: L.icon({
  131. iconUrl: "https://dofusgo.com/imgs/map/hint/phoe.png",
  132. className: "hint-icon"
  133. }),
  134. bank: L.icon({
  135. iconUrl: "https://dofusgo.com/imgs/map/hint/401.png",
  136. className: "hint-icon"
  137. })
  138. }
  139. };
  140. $(function preloader() {
  141. if (document.images) {
  142. var img1 = new Image();
  143. var img2 = new Image();
  144. var img3 = new Image();
  145. var img4 = new Image();
  146. var img5 = new Image();
  147. var img6 = new Image();
  148. var img7 = new Image();
  149. var img8 = new Image();
  150. var img9 = new Image();
  151. var img10 = new Image();
  152. var img11 = new Image();
  153. var img12 = new Image();
  154. var img13 = new Image();
  155. var img14 = new Image();
  156. var img15 = new Image();
  157. var img16 = new Image();
  158. var img17 = new Image();
  159. var img18 = new Image();
  160. var img19 = new Image();
  161. var img20 = new Image();
  162. var img21 = new Image();
  163. var img22 = new Image();
  164. var img23 = new Image();
  165. var img24 = new Image();
  166. var img25 = new Image();
  167. img1.src = "https://svgshare.com/i/54N.svg";
  168. img2.src = "https://svgshare.com/i/54m.svg";
  169. img3.src = "https://svgshare.com/i/51x.svg";
  170. img4.src = "https://svgshare.com/i/53t.svg";
  171. img5.src = "https://svgshare.com/i/556.svg";
  172. img6.src = "https://svgshare.com/i/555.svg";
  173. img7.src = "https://svgshare.com/i/54b.svg";
  174. img8.src = "https://svgshare.com/i/54p.svg";
  175. img9.src = "https://svgshare.com/i/53n.svg";
  176. img10.src = "https://svgshare.com/i/54H.svg";
  177. img11.src = "https://svgshare.com/i/54o.svg";
  178. img12.src = "https://svgshare.com/i/527.svg";
  179. img13.src = "https://svgshare.com/i/54G.svg";
  180. img14.src = "https://svgshare.com/i/54w.svg";
  181. img15.src = "https://svgshare.com/i/54v.svg";
  182. img16.src = "https://svgshare.com/i/53x.svg";
  183. img17.src = "https://svgshare.com/i/54x.svg";
  184. img18.src = "https://svgshare.com/i/557.svg";
  185. img19.src = "https://svgshare.com/i/54q.svg";
  186. img20.src = "https://svgshare.com/i/543.svg";
  187. img21.src = "https://svgshare.com/i/58M.svg";
  188. img22.src = "https://svgshare.com/i/58N.svg";
  189. img23.src = "https://svgshare.com/i/5BW.svg";
  190. img24.src = "https://svgshare.com/i/5BL.svg";
  191. img25.src = "https://svgshare.com/i/5BB.svg";
  192. }
  193. });
  194. var actualMap;
  195. var pathData = [];
  196. var pathLinearData = [];
  197. var bankData = [];
  198. var phenixData = [];
  199. var havenBagData = [];
  200. var phenixPos=[{map:"12,12",cellid:"184",marker:void 0},{map:"7,36",cellid:"0",marker:void 0},{map:"22,22",cellid:"272",marker:void 0},{map:"10,19",cellid:"192",marker:void 0},{map:"5,1",cellid:"0",marker:void 0},{map:"2,-1",cellid:"0",marker:void 0},{map:"13,-7",cellid:"0",marker:void 0},{map:"5,-9",cellid:"116",marker:void 0},{map:"2,-14",cellid:"313",marker:void 0},{map:"-6,-12",cellid:"0",marker:void 0},{map:"36,10",cellid:"330",marker:void 0},{map:"25,-4",cellid:"450",marker:void 0},{map:"27,-33",cellid:"0",marker:void 0},{map:"24,-43",cellid:"245",marker:void 0},{map:"17,-36",cellid:"0",marker:void 0},{map:"-13,-29",cellid:"0",marker:void 0},{map:"-10,-54",cellid:"342",marker:void 0},{map:"-33,-56",cellid:"0",marker:void 0},{map:"-10,13",cellid:"354",marker:void 0},{map:"-14,31",cellid:"243",marker:void 0},{map:"-26,34",cellid:"0",marker:void 0},{map:"-26,36",cellid:"0",marker:void 0},{map:"-55,40",cellid:"240",marker:void 0},{map:"-58,18",cellid:"354",marker:void 0},{map:"-60,-3",cellid:"0",marker:void 0},{map:"-43,0",cellid:"259",marker:void 0},{map:"-41,-17",cellid:"0",marker:void 0},{map:"-43,-19",cellid:"0",marker:void 0},{map:"-53,-40",cellid:"0",marker:void 0},{map:"-67,-44",cellid:"219",marker:void 0},{map:"-60,-79",cellid:"0",marker:void 0}];
  201. var bankPos=[{map:"4,-18",marker:void 0},{map:"24,-36",marker:void 0},{map:"2,-2",marker:void 0},{map:"14,25",marker:void 0},{map:"-27,35",marker:void 0},{map:"-47,21",marker:void 0},{map:"-16,4",marker:void 0},{map:"-31,-54",marker:void 0},{map:"-77,-41",marker:void 0}];
  202. var ressourcesFr=[{itemId:254,itemName:"Ortie"},{itemId:255,itemName:"Sauge"},{itemId:67,itemName:"Trèfle à 5 feuilles"},{itemId:66,itemName:"Menthe Sauvage"},{itemId:68,itemName:"Orchidée Freyesque"},{itemId:61,itemName:"Edelweiss"},{itemId:112,itemName:"Graine de Pandouille"},{itemId:256,itemName:"Ginseng"},{itemId:257,itemName:"Belladone"},{itemId:258,itemName:"Mandragore"},{itemId:131,itemName:"Perce-neige"},{itemId:1,itemName:"Bois de Frêne"},{itemId:33,itemName:"Bois de Châtaignier"},{itemId:34,itemName:"Bois de Noyer"},{itemId:8,itemName:"Bois de Chêne"},{itemId:98,itemName:"Bois de Bombu"},{itemId:31,itemName:"Bois d’Erable"},{itemId:101,itemName:"Bois d’Oliviolet"},{itemId:28,itemName:"Bois d’If"},{itemId:108,itemName:"Bois de Bambou"},{itemId:35,itemName:"Bois de Merisier"},{itemId:259,itemName:"Bois de Noisetier"},{itemId:29,itemName:"Bois d’Ebène"},{itemId:121,itemName:"Bois de Kaliptus"},{itemId:32,itemName:"Bois de Charme"},{itemId:109,itemName:"Bois de Bambou Sombre"},{itemId:30,itemName:"Bois d’Orme"},{itemId:110,itemName:"Bois de Bambou Sacré"},{itemId:133,itemName:"Bois de Tremble"},{itemId:17,itemName:"Fer"},{itemId:53,itemName:"Cuivre"},{itemId:55,itemName:"Bronze"},{itemId:37,itemName:"Kobalte"},{itemId:54,itemName:"Manganèse"},{itemId:52,itemName:"Etain"},{itemId:114,itemName:"Silicate"},{itemId:24,itemName:"Argent"},{itemId:26,itemName:"Bauxite"},{itemId:25,itemName:"Or"},{itemId:113,itemName:"Dolomite"},{itemId:135,itemName:"Obsidienne"},{itemId:38,itemName:"Blé"},{itemId:43,itemName:"Orge"},{itemId:45,itemName:"Avoine"},{itemId:39,itemName:"Houblon"},{itemId:42,itemName:"Lin"},{itemId:44,itemName:"Seigle"},{itemId:111,itemName:"Riz"},{itemId:47,itemName:"Malt"},{itemId:46,itemName:"Chanvre"},{itemId:260,itemName:"Maïs"},{itemId:261,itemName:"Millet"},{itemId:134,itemName:"Frostiz"},{itemId:75,itemName:"Goujon"},{itemId:71,itemName:"Greuvette"},{itemId:74,itemName:"Truite"},{itemId:77,itemName:"Crabe Sourimi"},{itemId:76,itemName:"Poisson-Chaton"},{itemId:78,itemName:"Poisson Pané"},{itemId:79,itemName:"Carpe d’Iem"},{itemId:81,itemName:"Sardine Brillante"},{itemId:263,itemName:"Brochet"},{itemId:264,itemName:"Kralamoure"},{itemId:265,itemName:"Anguille"},{itemId:266,itemName:"Dorade Grise"},{itemId:267,itemName:"Perche"},{itemId:268,itemName:"Raie Bleue"},{itemId:269,itemName:"Lotte"},{itemId:270,itemName:"Requin Marteau-Faucille"},{itemId:271,itemName:"Bar Rikain"},{itemId:272,itemName:"Morue"},{itemId:273,itemName:"Tanche"},{itemId:274,itemName:"Espadon"},{itemId:132,itemName:"Poisskaille"}];
  203. var ressourcesEn=[{itemId:1,itemName:"Ash"},{itemId:8,itemName:"Oak"},{itemId:17,itemName:"Iron"},{itemId:24,itemName:"Silver"},{itemId:25,itemName:"Gold"},{itemId:26,itemName:"Bauxite"},{itemId:28,itemName:"Yew"},{itemId:29,itemName:"Ebony"},{itemId:30,itemName:"Elm"},{itemId:31,itemName:"Maple"},{itemId:32,itemName:"Hornbeam"},{itemId:33,itemName:"Chestnut"},{itemId:34,itemName:"Walnut"},{itemId:35,itemName:"Cherry"},{itemId:37,itemName:"Cobalt"},{itemId:38,itemName:"Wheat"},{itemId:39,itemName:"Hop"},{itemId:42,itemName:"Flax"},{itemId:43,itemName:"Barley"},{itemId:44,itemName:"Rye"},{itemId:45,itemName:"Oats"},{itemId:46,itemName:"Hemp"},{itemId:47,itemName:"Malt"},{itemId:48,itemName:"Potato heap"},{itemId:52,itemName:"Tin"},{itemId:53,itemName:"Copper"},{itemId:54,itemName:"Manganese"},{itemId:55,itemName:"Bronze"},{itemId:61,itemName:"Edelweiss"},{itemId:63,itemName:"Wheat"},{itemId:64,itemName:"Spelt"},{itemId:65,itemName:"Sorghum"},{itemId:66,itemName:"Wild Mint"},{itemId:67,itemName:"Five-Leaf Clover"},{itemId:68,itemName:"Freyesque Orchid"},{itemId:71,itemName:"Grawn"},{itemId:72,itemName:"Aggressive Salmoon"},{itemId:73,itemName:"Octopwus"},{itemId:74,itemName:"Trout"},{itemId:75,itemName:"Gudgeon"},{itemId:76,itemName:"Kittenfish"},{itemId:77,itemName:"Crab"},{itemId:78,itemName:"Breaded Fish"},{itemId:79,itemName:"Ediem Carp"},{itemId:80,itemName:"Sludgy Trout"},{itemId:81,itemName:"Shiny Sardine"},{itemId:82,itemName:"Cotton"},{itemId:84,itemName:"Well"},{itemId:98,itemName:"Bombu"},{itemId:99,itemName:"Strange shadow"},{itemId:100,itemName:"Snapper"},{itemId:101,itemName:"Oliviolet"},{itemId:102,itemName:"Strength machine"},{itemId:104,itemName:"Quaquack"},{itemId:108,itemName:"Bamboo"},{itemId:109,itemName:"Dark Bamboo"},{itemId:110,itemName:"Holy Bamboo"},{itemId:111,itemName:"Rice"},{itemId:112,itemName:"Pandkin"},{itemId:113,itemName:"Dolomite"},{itemId:114,itemName:"Silicate"},{itemId:121,itemName:"Kaliptus"},{itemId:131,itemName:"Snowdrop"},{itemId:132,itemName:"Icefish"},{itemId:133,itemName:"Aspen"},{itemId:134,itemName:"Frosteez"},{itemId:135,itemName:"Obsidian"},{itemId:136,itemName:"Shell"},{itemId:137,itemName:"Poss'Ybel's sewing machine"},{itemId:138,itemName:"Factory"},{itemId:139,itemName:"Bad Quality Kitchen Table"},{itemId:140,itemName:"Bad Quality Workshop"},{itemId:141,itemName:"Bad Quality Workbench"},{itemId:142,itemName:"Bad Quality Sewing Machine"},{itemId:143,itemName:"Toy machine"},{itemId:144,itemName:"Fish press"},{itemId:145,itemName:"Wrapping Station"},{itemId:146,itemName:"Gift Package"},{itemId:147,itemName:"Gift Wrapping Station"},{itemId:148,itemName:"Alchemists' Workshop"},{itemId:149,itemName:"Jewellers' Workshop"},{itemId:150,itemName:"Butchers' Workshop"},{itemId:151,itemName:"Butchers' and Hunters' Workshop"},{itemId:152,itemName:"Shield Smiths' Workshop"},{itemId:153,itemName:"Bakers' Workshop"},{itemId:154,itemName:"Handymen's Workshop"},{itemId:155,itemName:"Lumberjacks' Workshop"},{itemId:156,itemName:"Hunters' Workshop"},{itemId:157,itemName:"Shoemakers' Workshop"},{itemId:158,itemName:"Smithmagi's Workshop"},{itemId:159,itemName:"Smiths' Workshop"},{itemId:160,itemName:"Miners' Workshop"},{itemId:161,itemName:"Farmers' Workshop"},{itemId:162,itemName:"Fishmongers' Workshop"},{itemId:163,itemName:"Fishermen and Fishmongers' Workshop"},{itemId:164,itemName:"Fishermen's Workshop"},{itemId:165,itemName:"Carvers' Workshop"},{itemId:166,itemName:"Tailors' Workshop"},{itemId:167,itemName:"Arena"},{itemId:168,itemName:"Bank"},{itemId:169,itemName:"Bar Racuda"},{itemId:170,itemName:"Library"},{itemId:171,itemName:"Kwismas Shops"},{itemId:172,itemName:"Dojo"},{itemId:173,itemName:"Church"},{itemId:174,itemName:"Grocery Store"},{itemId:175,itemName:"Ski Maker"},{itemId:176,itemName:"Town Hall"},{itemId:177,itemName:"Profession Information Centre"},{itemId:178,itemName:"Kanojedo"},{itemId:179,itemName:"Kolossium"},{itemId:180,itemName:"Militia"},{itemId:181,itemName:"Frigost's Doctor"},{itemId:182,itemName:"Inn"},{itemId:183,itemName:"Atyu Sirvis's Inn"},{itemId:184,itemName:"Atolmond's Inn"},{itemId:185,itemName:"The Silver Tavern"},{itemId:186,itemName:"Djaul Inn"},{itemId:187,itemName:"Bagrutte's Inn"},{itemId:188,itemName:"Woodenglass Inn"},{itemId:189,itemName:"Misery Inn"},{itemId:190,itemName:"Kikim Inn"},{itemId:191,itemName:"Lisa Kaya's Tavern"},{itemId:192,itemName:"Sakai Tavern"},{itemId:193,itemName:"Bwork Inn"},{itemId:194,itemName:"Burnt Cat Inn"},{itemId:195,itemName:"Last Chance Saloon"},{itemId:196,itemName:"Swashbuckler Inn"},{itemId:197,itemName:"Feubuk Inn"},{itemId:198,itemName:"Drunken Pandawa Inn"},{itemId:199,itemName:"Frigostian Paradise Tavern"},{itemId:200,itemName:"Pinchaut Inn"},{itemId:201,itemName:"Ripate Inn"},{itemId:202,itemName:"Guild Temple"},{itemId:203,itemName:"Tower of Brakmar"},{itemId:204,itemName:"Tower of Archives"},{itemId:205,itemName:"Tower of Orders"},{itemId:206,itemName:"Foggernaut Submarine"},{itemId:207,itemName:"Altar"},{itemId:208,itemName:"Krosmaster"},{itemId:209,itemName:"Gith Smold's Workshop"},{itemId:210,itemName:"Al Shab's Workshop"},{itemId:211,itemName:"Frigostine's Workshop"},{itemId:212,itemName:"Francky's Workshop"},{itemId:213,itemName:"Dutch's Workshop"},{itemId:214,itemName:"Brokkreitri's Workshop"},{itemId:215,itemName:"Ingram Part's Workshop"},{itemId:216,itemName:"Clarisse Tocate's Workshop"},{itemId:217,itemName:"Bea Fortax's Workshop"},{itemId:218,itemName:"Carla Garfield's Workshop"},{itemId:219,itemName:"Weaver of Fortunes"},{itemId:220,itemName:"Barrel of explosives"},{itemId:221,itemName:"Sutol Flower"},{itemId:222,itemName:"Barbecue"},{itemId:223,itemName:"Fresh Cawwot"},{itemId:224,itemName:"Profession Information Centre's weathered alembic"},{itemId:225,itemName:"Bottle of Rum"},{itemId:226,itemName:"Lift"},{itemId:227,itemName:"Mushroom"},{itemId:228,itemName:"Bowisse's Table"},{itemId:229,itemName:"Meriana's Workshop"},{itemId:230,itemName:"Bwork Portal"},{itemId:231,itemName:"Automated Treasure Machine"},{itemId:232,itemName:"Portal"},{itemId:233,itemName:"Golden chest"},{itemId:234,itemName:"Ice Cube"},{itemId:235,itemName:"Go to"},{itemId:236,itemName:"Desk"},{itemId:237,itemName:"Drafting Table"},{itemId:238,itemName:"Go to instance A"},{itemId:239,itemName:"Go to instance B"},{itemId:240,itemName:"Go to instance C"},{itemId:241,itemName:"Old Chest XXIII"},{itemId:242,itemName:"Clockmaker's Workbench"},{itemId:243,itemName:"Chest XI"},{itemId:244,itemName:"Chest XXIII"},{itemId:245,itemName:"Chest XXXI"},{itemId:246,itemName:"Chest LIX"},{itemId:247,itemName:"Clock That's 2 Minutes Fast"},{itemId:248,itemName:"Clock That's 3 Minutes Slow"},{itemId:249,itemName:"Clock That's 7 Minutes Fast"},{itemId:250,itemName:"Clock That's 8 Minutes Slow"},{itemId:251,itemName:"Paxtim Eggs"},{itemId:252,itemName:"Voyagers' Workshop"},{itemId:253,itemName:"Eliotrope Portal"},{itemId:254,itemName:"Nettle"},{itemId:255,itemName:"Sage"},{itemId:256,itemName:"Ginseng"},{itemId:257,itemName:"Belladonna"},{itemId:258,itemName:"Mandrake"},{itemId:259,itemName:"Hazel"},{itemId:260,itemName:"Corn"},{itemId:261,itemName:"Millet"},{itemId:262,itemName:"Stone Block"},{itemId:263,itemName:"Pike"},{itemId:264,itemName:"Kralove"},{itemId:265,itemName:"Eel"},{itemId:266,itemName:"Grey Sea Bream"},{itemId:267,itemName:"Perch"},{itemId:268,itemName:"Ray"},{itemId:269,itemName:"Monkfish"},{itemId:270,itemName:"Sickle-Hammerhead Shark"},{itemId:271,itemName:"Lard Bass"},{itemId:272,itemName:"Cod"},{itemId:273,itemName:"Tench"},{itemId:274,itemName:"Swordfish"},{itemId:275,itemName:"Mulic Bere's Anvil"},{itemId:276,itemName:"Mulic Bere's Workbench"},{itemId:277,itemName:"Mulic Bere's Workshop"},{itemId:278,itemName:"Mulic Bere's Assembler"},{itemId:279,itemName:"Magus Ax's Workshop"},{itemId:280,itemName:"Huppermage Platform"},{itemId:281,itemName:"Four-leaf Clover"},{itemId:282,itemName:"Point out an exit"},{itemId:283,itemName:"Catuna"},{itemId:284,itemName:"Stairs"},{itemId:285,itemName:"Reinforced Door"},{itemId:286,itemName:"Unspeakable Workbench"},{itemId:287,itemName:"Mahaquany"},{itemId:288,itemName:"Salikronia"},{itemId:289,itemName:"Quisnoa"},{itemId:290,itemName:"Limpet"},{itemId:291,itemName:"Sepiolite"},{itemId:292,itemName:"Workbench"},{itemId:293,itemName:"Sepiolite"},{itemId:294,itemName:"Mahaquany"},{itemId:295,itemName:"Salikronia"},{itemId:296,itemName:"Quisnoa"},{itemId:297,itemName:"Limpet"},{itemId:298,itemName:"Natasha Manka's Workshop"},{itemId:299,itemName:"Fresh Eggs"}];
  204. var ressourcesEs=[{itemId:254,itemName:"Ortiga"},{itemId:255,itemName:"Salvia"},{itemId:67,itemName:"Trébol de 5 hojas"},{itemId:66,itemName:"Menta salvaje"},{itemId:68,itemName:"Orquídea freyesca"},{itemId:61,itemName:"Edelweiss"},{itemId:112,itemName:"Pandoja"},{itemId:256,itemName:"Ginseng"},{itemId:257,itemName:"Belladona"},{itemId:258,itemName:"Mandrágora"},{itemId:131,itemName:"Campanilla de invierno"},{itemId:1,itemName:"Madera de fresno"},{itemId:33,itemName:"Madera de castaño"},{itemId:34,itemName:"Madera de nogal"},{itemId:8,itemName:"Madera de roble"},{itemId:98,itemName:"Madera de bombú"},{itemId:31,itemName:"Madera de arce"},{itemId:101,itemName:"Madera de olivioleta"},{itemId:28,itemName:"Madera de tejo"},{itemId:108,itemName:"Madera de bambú"},{itemId:35,itemName:"Madera de cerezo"},{itemId:259,itemName:"Madera de castaño"},{itemId:29,itemName:"Madera de ébano"},{itemId:121,itemName:"Madera de kalipto"},{itemId:32,itemName:"Madera de carpe"},{itemId:109,itemName:"Madera de bambú oscuro"},{itemId:30,itemName:"Madera de olmo"},{itemId:110,itemName:"Madera de bambú sagrado"},{itemId:133,itemName:"Madera de álamo temblón"},{itemId:17,itemName:"Hierro"},{itemId:53,itemName:"Cobre"},{itemId:55,itemName:"Bronce"},{itemId:37,itemName:"Kobalto"},{itemId:54,itemName:"Manganeso"},{itemId:52,itemName:"Estaño"},{itemId:114,itemName:"Silicato"},{itemId:24,itemName:"Plata"},{itemId:26,itemName:"Bauxita"},{itemId:25,itemName:"Oro"},{itemId:113,itemName:"Dolomita"},{itemId:135,itemName:"Obsidiana"},{itemId:38,itemName:"Trigo"},{itemId:43,itemName:"Cebada"},{itemId:45,itemName:"Avena"},{itemId:39,itemName:"Lúpulo"},{itemId:42,itemName:"Lino"},{itemId:44,itemName:"Arroz"},{itemId:111,itemName:"Centeno"},{itemId:47,itemName:"Malta"},{itemId:46,itemName:"Cáñamo"},{itemId:260,itemName:"Maíz"},{itemId:261,itemName:"Mijo"},{itemId:134,itemName:"Frostizz"},{itemId:75,itemName:"Gobio"},{itemId:71,itemName:"Bamga"},{itemId:74,itemName:"Trucha"},{itemId:77,itemName:"Cangrejo surimi"},{itemId:76,itemName:"Pez gatito"},{itemId:78,itemName:"Pescado empanado"},{itemId:79,itemName:"Carpa de Iem"},{itemId:81,itemName:"Sardina brillante"},{itemId:263,itemName:"Lucio"},{itemId:264,itemName:"Kralamar"},{itemId:265,itemName:"Anguila"},{itemId:266,itemName:"Dorada exploradora"},{itemId:267,itemName:"Perca"},{itemId:268,itemName:"Raya azul"},{itemId:269,itemName:"Rape"},{itemId:270,itemName:"Tiburón Martillhoz"},{itemId:271,itemName:"Lubina mericana"},{itemId:272,itemName:"Bacaladilla"},{itemId:273,itemName:"Tenca"},{itemId:274,itemName:"Pez espada"},{itemId:132,itemName:"Inverluza"}];
  205. var loadingFile = false;
  206. var havenToggle = false;
  207.  
  208. var css = document.createElement('style');
  209. css.type = 'text/css';
  210. css.textContent = 'a:focus {text-decoration: none!important;}.toggled{background-color:#c0dcf3!important}.leaflet-touch .leaflet-bar a{text-decoration:none!important;outline:none!important}.hint-icon{width:40px;margin-top:-20px;margin-left:-20px}.checkbox.checbox-switch{padding-left:0}.checkbox.checbox-switch label,.checkbox-inline.checbox-switch{display:inline-block;position:relative;padding-left:0}.checkbox.checbox-switch label input,.checkbox-inline.checbox-switch input{display:none}.checkbox.checbox-switch label span,.checkbox-inline.checbox-switch span{width:35px;border-radius:20px;height:18px;border:1px solid #dbdbdb;background-color:#fff;border-color:#dfdfdf;box-shadow:#dfdfdf 0 0 0 0 inset;transition:border .4s ease 0s,box-shadow .4s ease 0;display:inline-block;vertical-align:middle;margin-right:5px}.checkbox.checbox-switch label span:before,.checkbox-inline.checbox-switch span:before{display:inline-block;width:16px;height:16px;border-radius:50%;background:#fff;content:" ";top:0;position:relative;left:0;transition:all .3s ease;box-shadow:0 1px 4px rgba(0,0,0,0.4)}.checkbox.checbox-switch label > input:checked + span:before,.checkbox-inline.checbox-switch > input:checked + span:before{left:17px}.checkbox.checbox-switch.switch-primary label > input:checked + span,.checkbox-inline.checbox-switch.switch-primary > input:checked + span{background-color:#0069d9;border-color:#0069d9;box-shadow:#0069d9 0 0 0 8px inset;transition:border .4s ease 0s,box-shadow .4s ease 0s,background-color 1.2s ease 0}.checkbox.checbox-switch.switch-primary label > input:checked:disabled + span,.checkbox-inline.checbox-switch.switch-primary > input:checked:disabled + span{background-color:#6da3dd;border-color:#6da3dd;box-shadow:#6da3dd 0 0 0 8px inset;transition:border .4s ease 0s,box-shadow .4s ease 0s,background-color 1.2s ease 0}#mapContainer[data-zoom="7"] .top-arrow{width:145px;margin-left:528.5px}#mapContainer[data-zoom="6"] .top-arrow{width:75px;margin-left:262.5px}#mapContainer[data-zoom="5"] .top-arrow{width:36px;margin-left:131.5px}#mapContainer[data-zoom="4"] .top-arrow{width:19px;margin-left:65.75px}#mapContainer[data-zoom="3"] .top-arrow{width:15px;margin-left:30.13px}#mapContainer[data-zoom="2"] .top-arrow{width:9.9px;margin-left:13.86px}#mapContainer[data-zoom="1"] .top-arrow{width:7px;margin-left:5.91px}#mapContainer[data-zoom="0"] .top-arrow{width:5.38px;margin-left:5.01px}#mapContainer[data-zoom="7"] .havenbag-icon{width:500.83px;margin-left:350.5833333px;margin-top:135.8px}#mapContainer[data-zoom="6"] .havenbag-icon{width:250px;margin-left:175px;margin-top:67.5px}#mapContainer[data-zoom="5"] .havenbag-icon{width:124.58px;margin-left:87.20833333px;margin-top:33.35px}#mapContainer[data-zoom="4"] .havenbag-icon{width:61.88px;margin-left:43.3125px;margin-top:16.28px}#mapContainer[data-zoom="3"] .havenbag-icon{width:30.52px;margin-left:21.36458333px;margin-top:7.74px}#mapContainer[data-zoom="2"] .havenbag-icon{width:14.84px;margin-left:10.390625px;margin-top:3.47px}#mapContainer[data-zoom="1"] .havenbag-icon{width:7.01px;margin-left:4.903645833px;margin-top:1.33px}#mapContainer[data-zoom="0"] .havenbag-icon{width:3.09px;margin-left:2.16015625px;margin-top:.27px}#mapContainer[data-zoom="7"] .left-arrow{width:324.26px;margin-top:356.5px}#mapContainer[data-zoom="6"] .left-arrow{width:161.59px;margin-top:177.75px}#mapContainer[data-zoom="5"] .left-arrow{width:80.53px;margin-top:88.38px}#mapContainer[data-zoom="4"] .left-arrow{width:40.13px;margin-top:44.19px}#mapContainer[data-zoom="3"] .left-arrow{width:30.87px;margin-top:19.34px}#mapContainer[data-zoom="2"] .left-arrow{width:23.75px;margin-top:7.42px}#mapContainer[data-zoom="1"] .left-arrow{width:18.27px;margin-top:1.86px}#mapContainer[data-zoom="0"] .left-arrow{width:14.05px;margin-top:1px}#mapContainer[data-zoom="7"] .right-arrow{width:324.26px;margin-left:878.74px;margin-top:356.5px}#mapContainer[data-zoom="6"] .right-arrow{width:161.59px;margin-left:439.41px;margin-top:177.75px}#mapContainer[data-zoom="5"] .right-arrow{width:80.53px;margin-left:219.47px;margin-top:88.38px}#mapContainer[data-zoom="4"] .right-arrow{width:40.13px;margin-left:110.37px;margin-top:44.19px}#mapContainer[data-zoom="3"] .right-arrow{width:30.87px;margin-left:43.38px;margin-top:19.34px}#mapContainer[data-zoom="2"] .right-arrow{width:23.75px;margin-left:12.88px;margin-top:7.42px}#mapContainer[data-zoom="1"] .right-arrow{width:18.27px;margin-left:1px;margin-top:1.86px}#mapContainer[data-zoom="0"] .right-arrow{width:14.05px;margin-left:1px;margin-top:1px}#mapContainer[data-zoom="7"] .bottom-arrow{width:145px;margin-left:528.5px;margin-top:648.2px}#mapContainer[data-zoom="6"] .bottom-arrow{width:75px;margin-left:262.5px;margin-top:319.5px}#mapContainer[data-zoom="5"] .bottom-arrow{width:36px;margin-left:131.5px;margin-top:160.91px}#mapContainer[data-zoom="4"] .bottom-arrow{width:19px;margin-left:65.75px;margin-top:78.02px}#mapContainer[data-zoom="3"] .bottom-arrow{width:15px;margin-left:30.13px;margin-top:31.09px}#mapContainer[data-zoom="2"] .bottom-arrow{width:9.9px;margin-left:13.86px;margin-top:11.59px}#mapContainer[data-zoom="1"] .bottom-arrow{width:7px;margin-left:5.91px;margin-top:3px}#mapContainer[data-zoom="0"] .bottom-arrow{width:5.38px;margin-left:5.01px;margin-top:0}#mapContainer[data-zoom="7"] .leaflet-popup{margin-left:601px}#mapContainer[data-zoom="6"] .leaflet-popup{margin-left:3005px}#mapContainer[data-zoom="5"] .leaflet-popup{margin-left:149.5px}#mapContainer[data-zoom="4"] .leaflet-popup{margin-left:74.25px}#mapContainer[data-zoom="3"] .leaflet-popup{margin-left:36.625px}#mapContainer[data-zoom="2"] .leaflet-popup{margin-left:17.8125px}#mapContainer[data-zoom="1"] .leaflet-popup{margin-left:8.40625px}#mapContainer[data-zoom="0"] .leaflet-popup{margin-left:3.703125px}';
  211. $('head').append(css);
  212. var contenu = '';
  213. contenu = `
  214. <link rel="stylesheet" href="//use.fontawesome.com/releases/v5.0.6/css/all.css">
  215. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css">
  216. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  217. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/flag-icon-css/2.9.0/css/flag-icon.css">
  218. <div id="path-creator-bar" class="leaflet-top leaflet-right" style="top: 150px;">
  219. </div>
  220. <!-- Modal -->
  221. <div class="modal fade" id="havenBagSetting" tabindex="-1" role="dialog" style="top: 300px;"></div>
  222. <div class="modal fade" id="setting" tabindex="-1" role="dialog" style="top: 100px;"></div>
  223. <div class="modal fade" id="pathSetting" tabindex="-1" role="dialog" style="top: 100px;"></div>`;
  224.  
  225.  
  226. $('body').append(contenu);
  227.  
  228.  
  229. function checkMaps(mapcoord, array) {
  230. for (let key = 0; key < array.length; key++) {
  231. if (array[key].map == mapcoord) {
  232. return true;
  233. }
  234. }
  235. return false;
  236. }
  237.  
  238. function getMapIndex(mapcoord, array) {
  239. for (let key = 0; key < array.length; key++) {
  240. if (array[key].map == mapcoord) {
  241. return key;
  242. }
  243. }
  244. }
  245.  
  246. function onMapClick() {
  247.  
  248. if (!loadingFile)
  249. actualMap = $('#mapCoordinates').html();
  250.  
  251. if (RegExp(/<span>/).test(actualMap)) {
  252. actualMap = $('#mapCoordinates').html().split(/<span>/)[0];
  253. }
  254.  
  255. if ($('.fa-suitcase.toggled').length > 0) {
  256. if (!havenToggle) {
  257. if (!checkMaps(actualMap.split(', ')[0] + ',' + actualMap.split(', ')[1], havenBagData)) {
  258. havenToggle = true;
  259. $('#havenBagSetting').appendTo("body").modal('show');
  260. return;
  261. } else {
  262. havenBagData.splice(getMapIndex(actualMap.split(', ')[0] + ',' + actualMap.split(', ')[1], havenBagData), 1);
  263. }
  264. } else {
  265. havenToggle = false;
  266. }
  267. }
  268. if ($('.fa-eraser.toggled').length > 0) {
  269. let deleteAll = function (array, index) {
  270. if (array[index] !== undefined) {
  271. if (array[index].top)
  272. if (array[index].top.icon) map.removeLayer(array[index].top.icon);
  273. if (array[index].bottom)
  274. if (array[index].bottom.icon) map.removeLayer(array[index].bottom.icon);
  275. if (array[index].left)
  276. if (array[index].left.icon) map.removeLayer(array[index].left.icon);
  277. if (array[index].right)
  278. if (array[index].right.icon) map.removeLayer(array[index].right.icon);
  279. if (array[index].havenbag)
  280. if (array[index].havenbag.icon) map.removeLayer(array[index].havenbag.icon);
  281. array.splice(index, 1);
  282. }
  283. };
  284. deleteAll(pathData, getMapIndex(actualMap, pathData));
  285. deleteAll(pathLinearData, getMapIndex(actualMap, pathLinearData));
  286. deleteAll(bankData, getMapIndex(actualMap, bankData));
  287. deleteAll(phenixData, getMapIndex(actualMap, phenixData));
  288. deleteAll(havenBagData, getMapIndex(actualMap, havenBagData));
  289. } else if ($(".fa-university.toggled").length > 0) {
  290. if (!checkMaps(actualMap, bankData)) {
  291. if ($(".fa-suitcase.toggled").length > 0) {
  292. if (checkMaps(actualMap, pathData)) {
  293. removeArrow(getMapIndex(actualMap, pathData), pathData);
  294. deleteEmptyPath(pathData);
  295. } else if (checkMaps(actualMap, phenixData)) {
  296. removeArrow(getMapIndex(actualMap, phenixData), phenixData);
  297. deleteEmptyPath(phenixData);
  298. }
  299. }
  300. bankData.push({
  301. map: actualMap,
  302. top: {
  303. path: false,
  304. icon: undefined
  305. },
  306. bottom: {
  307. path: false,
  308. icon: undefined
  309. },
  310. right: {
  311. path: false,
  312. icon: undefined
  313. },
  314. left: {
  315. path: false,
  316. icon: undefined
  317. },
  318. havenbag: {
  319. path: false,
  320. icon: undefined
  321. },
  322. bank: false
  323. });
  324. createMarker(getMapIndex(actualMap, bankData), bankData);
  325. deleteEmptyPath(bankData);
  326. } else {
  327. removeArrow(getMapIndex(actualMap, bankData), bankData);
  328. deleteEmptyPath(bankData);
  329. }
  330. console.clear();
  331. for (let key in bankData) {
  332. console.log(key + ', map : ' + bankData[key].map + ', top : ' + bankData[key].top.path + ', bottom : ' + bankData[key].bottom.path + ', right : ' + bankData[key].right.path + ', left : ' + bankData[key].left.path + ', havenbag : ' + bankData[key].havenbag.path);
  333. }
  334. } else if ($(".fa-fire.toggled").length > 0) {
  335. if (!checkMaps(actualMap, phenixData)) {
  336. if ($(".fa-suitcase.toggled").length > 0) {
  337. if (checkMaps(actualMap, pathData)) {
  338. removeArrow(getMapIndex(actualMap, pathData), pathData);
  339. deleteEmptyPath(pathData);
  340. } else if (checkMaps(actualMap, bankData)) {
  341. removeArrow(getMapIndex(actualMap, bankData), bankData);
  342. deleteEmptyPath(bankData);
  343. }
  344. }
  345. phenixData.push({
  346. map: actualMap,
  347. top: {
  348. path: false,
  349. icon: undefined
  350. },
  351. bottom: {
  352. path: false,
  353. icon: undefined
  354. },
  355. right: {
  356. path: false,
  357. icon: undefined
  358. },
  359. left: {
  360. path: false,
  361. icon: undefined
  362. },
  363. havenbag: {
  364. path: false,
  365. icon: undefined
  366. },
  367. phenix: false
  368. });
  369. createMarker(getMapIndex(actualMap, phenixData), phenixData);
  370. deleteEmptyPath(phenixData);
  371. } else {
  372. removeArrow(getMapIndex(actualMap, phenixData), phenixData);
  373. deleteEmptyPath(phenixData);
  374. }
  375. console.clear();
  376. for (let key in phenixData) {
  377. console.log(key + ', map : ' + phenixData[key].map + ', top : ' + phenixData[key].top.path + ', bottom : ' + phenixData[key].bottom.path + ', right : ' + phenixData[key].right.path + ', left : ' + phenixData[key].left.path + ', havenbag : ' + phenixData[key].havenbag.path);
  378. }
  379. } else {
  380. if (!checkMaps(actualMap, pathData)) {
  381. if ($(".fa-suitcase.toggled").length > 0) {
  382. if (checkMaps(actualMap, bankData)) {
  383. removeArrow(getMapIndex(actualMap, bankData), bankData);
  384. deleteEmptyPath(bankData);
  385. } else if (checkMaps(actualMap, phenixData)) {
  386. removeArrow(getMapIndex(actualMap, phenixData), phenixData);
  387. deleteEmptyPath(phenixData);
  388. }
  389. }
  390. if ($(".fa-random.toggled").length > 0) {
  391. if (!checkMaps(actualMap, pathLinearData)) {
  392. pathLinearData.push({
  393. map: actualMap,
  394. top: {
  395. index: undefined,
  396. path: false,
  397. icon: undefined
  398. },
  399. bottom: {
  400. index: undefined,
  401. path: false,
  402. icon: undefined
  403. },
  404. right: {
  405. index: undefined,
  406. path: false,
  407. icon: undefined
  408. },
  409. left: {
  410. index: undefined,
  411. path: false,
  412. icon: undefined
  413. },
  414. havenbag: {
  415. index: undefined,
  416. path: false,
  417. icon: undefined
  418. },
  419. gather: false,
  420. fight: false,
  421. index: false
  422. });
  423. createMarker(getMapIndex(actualMap, pathLinearData), pathLinearData);
  424. deleteEmptyPath(pathLinearData);
  425. } else {
  426. removeArrow(getMapIndex(actualMap, pathLinearData), pathLinearData);
  427. deleteEmptyPath(pathLinearData);
  428. }
  429. } else {
  430. pathData.push({
  431. map: actualMap,
  432. top: {
  433. path: false,
  434. icon: undefined
  435. },
  436. bottom: {
  437. path: false,
  438. icon: undefined
  439. },
  440. right: {
  441. path: false,
  442. icon: undefined
  443. },
  444. left: {
  445. path: false,
  446. icon: undefined
  447. },
  448. havenbag: {
  449. path: false,
  450. icon: undefined
  451. },
  452. gather: false,
  453. fight: false,
  454. });
  455. createMarker(getMapIndex(actualMap, pathData), pathData);
  456. deleteEmptyPath(pathData);
  457. }
  458. } else {
  459. removeArrow(getMapIndex(actualMap, pathData), pathData);
  460. deleteEmptyPath(pathData);
  461. }
  462. console.clear();
  463. for (let key in pathData) {
  464. console.log(key + ', map : ' + pathData[key].map + ', top : ' + pathData[key].top.path + ', bottom : ' + pathData[key].bottom.path + ', right : ' + pathData[key].right.path + ', left : ' + pathData[key].left.path + ', havenbag : ' + pathData[key].havenbag.path + ', gather : ' + pathData[key].gather + ', fight : ' + pathData[key].fight);
  465. }
  466. }
  467. }
  468.  
  469. function deleteEmptyPath(array) {
  470. if (!array[getMapIndex(actualMap, array)].top.path && !array[getMapIndex(actualMap, array)].bottom.path && !array[getMapIndex(actualMap, array)].left.path && !array[getMapIndex(actualMap, array)].right.path && !array[getMapIndex(actualMap, array)].havenbag.path) {
  471. array.splice(getMapIndex(actualMap, array), 1);
  472. }
  473. }
  474.  
  475. function removeArrow(key, array) {
  476. removeArrowWay(key, array, "fa-arrow-up", "top");
  477. removeArrowWay(key, array, "fa-arrow-left", "left");
  478. removeArrowWay(key, array, "fa-arrow-down", "bottom");
  479. removeArrowWay(key, array, "fa-arrow-right", "right");
  480. removeArrowWay(key, array, "fa-suitcase", "havenbag");
  481. }
  482.  
  483. function removeArrowWay(key, array, className, iconType) {
  484. if ($('.' + className + '.toggled').length > 0) {
  485. if ($(".fa-random.toggled").length > 0) {
  486. if (array[key][iconType].icon !== undefined) {
  487. if (array[key].index == 4) {
  488. if (iconType == "top") {
  489. if (array[key].top.index == 1) {
  490. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  491. if (array[key].left.index > 1) array[key].left.index -= 1;
  492. if (array[key].right.index > 1) array[key].right.index -= 1;
  493. } else if (array[key].top.index == 2) {
  494. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  495. if (array[key].left.index > 2) array[key].left.index -= 1;
  496. if (array[key].right.index > 2) array[key].right.index -= 1;
  497. } else if (array[key].top.index == 3) {
  498. if (array[key].bottom.index > 3) array[key].bottom.index -= 1;
  499. if (array[key].left.index > 3) array[key].left.index -= 1;
  500. if (array[key].right.index > 3) array[key].right.index -= 1;
  501. }
  502. } else if (iconType == "bottom") {
  503. if (array[key].bottom.index == 1) {
  504. if (array[key].top.index > 1) array[key].top.index -= 1;
  505. if (array[key].left.index > 1) array[key].left.index -= 1;
  506. if (array[key].right.index > 1) array[key].right.index -= 1;
  507. } else if (array[key].bottom.index == 2) {
  508. if (array[key].top.index > 2) array[key].top.index -= 1;
  509. if (array[key].left.index > 2) array[key].left.index -= 1;
  510. if (array[key].right.index > 2) array[key].right.index -= 1;
  511. } else if (array[key].bottom.index == 3) {
  512. if (array[key].top.index > 3) array[key].top.index -= 1;
  513. if (array[key].left.index > 3) array[key].left.index -= 1;
  514. if (array[key].right.index > 3) array[key].right.index -= 1;
  515. }
  516. } else if (iconType == "left") {
  517. if (array[key].left.index == 1) {
  518. if (array[key].top.index > 1) array[key].top.index -= 1;
  519. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  520. if (array[key].right.index > 1) array[key].right.index -= 1;
  521. } else if (array[key].left.index == 2) {
  522. if (array[key].top.index > 2) array[key].top.index -= 1;
  523. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  524. if (array[key].right.index > 2) array[key].right.index -= 1;
  525. } else if (array[key].left.index == 3) {
  526. if (array[key].top.index > 3) array[key].top.index -= 1;
  527. if (array[key].bottom.index > 3) array[key].bottom.index -= 1;
  528. if (array[key].right.index > 3) array[key].right.index -= 1;
  529. }
  530. } else if (iconType == "right") {
  531. if (array[key].right.index == 1) {
  532. if (array[key].top.index > 1) array[key].top.index -= 1;
  533. if (array[key].left.index > 1) array[key].left.index -= 1;
  534. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  535. } else if (array[key].right.index == 2) {
  536. if (array[key].top.index > 2) array[key].top.index -= 1;
  537. if (array[key].left.index > 2) array[key].left.index -= 1;
  538. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  539. } else if (array[key].right.index == 3) {
  540. if (array[key].top.index > 3) array[key].top.index -= 1;
  541. if (array[key].left.index > 3) array[key].left.index -= 1;
  542. if (array[key].bottom.index > 3) array[key].bottom.index -= 1;
  543. }
  544. }
  545. } else if (array[key].index == 3) {
  546. if (iconType == "top") {
  547. if (array[key].top.index == 1) {
  548. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  549. if (array[key].left.index > 1) array[key].left.index -= 1;
  550. if (array[key].right.index > 1) array[key].right.index -= 1;
  551. } else if (array[key].top.index == 2) {
  552. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  553. if (array[key].left.index > 2) array[key].left.index -= 1;
  554. if (array[key].right.index > 2) array[key].right.index -= 1;
  555. }
  556. } else if (iconType == "bottom") {
  557. if (array[key].bottom.index == 1) {
  558. if (array[key].top.index > 1) array[key].top.index -= 1;
  559. if (array[key].left.index > 1) array[key].left.index -= 1;
  560. if (array[key].right.index > 1) array[key].right.index -= 1;
  561. } else if (array[key].bottom.index == 2) {
  562. if (array[key].top.index > 2) array[key].top.index -= 1;
  563. if (array[key].left.index > 2) array[key].left.index -= 1;
  564. if (array[key].right.index > 2) array[key].right.index -= 1;
  565. }
  566. } else if (iconType == "left") {
  567. if (array[key].left.index == 1) {
  568. if (array[key].top.index > 1) array[key].top.index -= 1;
  569. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  570. if (array[key].right.index > 1) array[key].right.index -= 1;
  571. } else if (array[key].left.index == 2) {
  572. if (array[key].top.index > 2) array[key].top.index -= 1;
  573. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  574. if (array[key].right.index > 2) array[key].right.index -= 1;
  575. }
  576. } else if (iconType == "right") {
  577. if (array[key].right.index == 1) {
  578. if (array[key].top.index > 1) array[key].top.index -= 1;
  579. if (array[key].left.index > 1) array[key].left.index -= 1;
  580. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  581. } else if (array[key].right.index == 2) {
  582. if (array[key].top.index > 2) array[key].top.index -= 1;
  583. if (array[key].left.index > 2) array[key].left.index -= 1;
  584. if (array[key].bottom.index > 2) array[key].bottom.index -= 1;
  585. }
  586. }
  587. } else if (array[key].index == 2) {
  588. if (iconType == "top") {
  589. if (array[key].top.index == 1) {
  590. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  591. if (array[key].left.index > 1) array[key].left.index -= 1;
  592. if (array[key].right.index > 1) array[key].right.index -= 1;
  593.  
  594. }
  595. } else if (iconType == "bottom") {
  596. if (array[key].bottom.index == 1) {
  597. if (array[key].top.index > 1) array[key].top.index -= 1;
  598. if (array[key].left.index > 1) array[key].left.index -= 1;
  599. if (array[key].right.index > 1) array[key].right.index -= 1;
  600.  
  601. }
  602. } else if (iconType == "left") {
  603. if (array[key].left.index == 1) {
  604. if (array[key].top.index > 1) array[key].top.index -= 1;
  605. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  606. if (array[key].right.index > 1) array[key].right.index -= 1;
  607.  
  608. }
  609. } else if (iconType == "right") {
  610. if (array[key].right.index == 1) {
  611. if (array[key].top.index > 1) array[key].top.index -= 1;
  612. if (array[key].left.index > 1) array[key].left.index -= 1;
  613. if (array[key].bottom.index > 1) array[key].bottom.index -= 1;
  614. }
  615. }
  616. }
  617. array[key].index -= 1;
  618. array[key][iconType].index = undefined;
  619. array[key][iconType].path = false;
  620. map.removeLayer(array[key][iconType].icon);
  621. array[key][iconType].icon = undefined;
  622. } else if (iconType == "havenbag") {
  623. } else createMarkerWay(key, array, className, iconType);
  624. } else if (array[key][iconType].icon !== undefined) {
  625. array[key][iconType].path = false;
  626. map.removeLayer(array[key][iconType].icon);
  627. array[key][iconType].icon = undefined;
  628. } else if (iconType == "havenbag") {
  629. } else createMarkerWay(key, array, className, iconType);
  630. }
  631. }
  632.  
  633. function createMarker(key, array) {
  634. createMarkerWay(key, array, "fa-arrow-up", "top");
  635. createMarkerWay(key, array, "fa-arrow-left", "left");
  636. createMarkerWay(key, array, "fa-arrow-down", "bottom");
  637. createMarkerWay(key, array, "fa-arrow-right", "right");
  638. createMarkerWay(key, array, "fa-suitcase", "havenbag");
  639. }
  640.  
  641. function createMarkerWay(key, array, className, iconType) {
  642. if ($('.' + className + '.toggled').length > 0) {
  643. if ($(".fa-leaf.toggled").length > 0) {
  644. if (iconType == "havenbag") {
  645. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  646. interactive: true,
  647. zIndexOffset: 5000,
  648. icon: icon[iconType].gather
  649. }).addTo(map).bindPopup('Téléportation au zaap map : ' + havenBagData[havenBagData.length - 1].mapToGo + ' | mapID : ' + havenBagData[havenBagData.length - 1].mapidToGo);
  650. } else {
  651. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  652. interactive: false,
  653. zIndexOffset: 5000,
  654. icon: icon[iconType].gather
  655. }).addTo(map);
  656. }
  657. array[key].gather = true;
  658. } else if ($(".fa-shield-alt.toggled").length > 0) {
  659. if (iconType == "havenbag") {
  660. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  661. interactive: true,
  662. zIndexOffset: 5000,
  663. icon: icon[iconType].fight
  664. }).addTo(map).bindPopup('Téléportation au zaap map : ' + havenBagData[havenBagData.length - 1].mapToGo + ' | mapID : ' + havenBagData[havenBagData.length - 1].mapidToGo);
  665. } else {
  666. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  667. interactive: false,
  668. zIndexOffset: 5000,
  669. icon: icon[iconType].fight
  670.  
  671. }).addTo(map);
  672. }
  673. array[key].fight = true;
  674. } else if ($(".fa-university.toggled").length > 0) {
  675. if (iconType == "right" || iconType == "left") {
  676. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1] * 1 + (0.2)), {
  677. interactive: false,
  678. zIndexOffset: 4500,
  679. icon: icon[iconType].bank
  680. }).addTo(map);
  681. } else if (iconType == "top" || iconType == "bottom") {
  682. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0] * 1 + (0.1), actualMap.split(", ")[1]), {
  683. interactive: false,
  684. zIndexOffset: 4500,
  685. icon: icon[iconType].bank
  686. }).addTo(map);
  687. } else if (iconType == "havenbag") {
  688. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  689. interactive: true,
  690. zIndexOffset: 5000,
  691. icon: icon[iconType].bank
  692. }).addTo(map).bindPopup('Téléportation au zaap map : ' + havenBagData[havenBagData.length - 1].mapToGo + ' | mapID : ' + havenBagData[havenBagData.length - 1].mapidToGo);
  693. }
  694. array[key].bank = true;
  695. } else if ($(".fa-fire.toggled").length > 0) {
  696. if (iconType == "right" || iconType == "left") {
  697. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1] * 1 - (0.2)), {
  698. interactive: false,
  699. zIndexOffset: 4000,
  700. icon: icon[iconType].phoenix
  701. }).addTo(map);
  702. } else if (iconType == "top" || iconType == "bottom") {
  703. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0] * 1 - (0.1), actualMap.split(", ")[1]), {
  704. interactive: false,
  705. zIndexOffset: 4000,
  706. icon: icon[iconType].phoenix
  707. }).addTo(map);
  708. } else if (iconType == "havenbag") {
  709. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  710. interactive: true,
  711. zIndexOffset: 5000,
  712. icon: icon[iconType].phoenix
  713. }).addTo(map).bindPopup('Téléportation au zaap map : ' + havenBagData[havenBagData.length - 1].mapToGo + ' | mapID : ' + havenBagData[havenBagData.length - 1].mapidToGo);
  714. }
  715. array[key].phenix = true;
  716. } else {
  717. if (iconType == "havenbag") {
  718. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  719. interactive: true,
  720. zIndexOffset: 5000,
  721. icon: icon[iconType].move
  722. }).addTo(map).bindPopup('Téléportation au zaap map : ' + havenBagData[havenBagData.length - 1].mapToGo + ' | mapID : ' + havenBagData[havenBagData.length - 1].mapidToGo);
  723. } else {
  724. array[key][iconType].icon = L.marker(dofusXYToMapXY(actualMap.split(", ")[0], actualMap.split(", ")[1]), {
  725. interactive: false,
  726. zIndexOffset: 5000,
  727. icon: icon[iconType].move
  728. }).addTo(map);
  729. }
  730. }
  731. if ($(".fa-random.toggled").length > 0) {
  732. array[key].index += 1;
  733. array[key][iconType].index = array[key].index;
  734. array[key][iconType].path = true;
  735. } else {
  736. array[key][iconType].path = true;
  737. }
  738. }
  739. }
  740.  
  741. function pathGenerator(index, array) {
  742. var path = "";
  743. if (index !== undefined) {
  744. if (array.length !== 0) {
  745. if (array[index].havenbag.path)
  746. // && !array[index].bank)
  747. path = "havenbag";
  748. else {
  749. if (array[index].top.path)
  750. path = "top";
  751. if (array[index].bottom.path)
  752. path += (path === "" ? "" : "|") + "bottom";
  753. if (array[index].left.path)
  754. path += (path === "" ? "" : "|") + "left";
  755. if (array[index].right.path)
  756. path += (path === "" ? "" : "|") + "right";
  757. }
  758. return path;
  759. }
  760. }
  761. }
  762.  
  763. function checkPhenixPos(map) {
  764. for (let key in phenixPos) {
  765. if (map == phenixPos[key].map) {
  766. return [true, key];
  767. }
  768. }
  769. return false;
  770. }
  771.  
  772. function gatherFigh(index, array) {
  773. var path = "";
  774. if (array[index].gather)
  775. path = ", gather = true";
  776. if (array[index].fight)
  777. path += ", fight = true";
  778. return path;
  779. }
  780.  
  781. function havenbagCheck(option) {
  782. for (let index = 0; index < havenBagData.length; index++) {
  783. if (havenBagData[index][option]) {
  784. return true;
  785. }
  786. }
  787. return false;
  788. }
  789.  
  790. function getLinearAction(params, key) {
  791. if (pathLinearData[key].top.index == params) {
  792. return "top";
  793. } else if (pathLinearData[key].left.index == params) {
  794. return "left";
  795. } else if (pathLinearData[key].bottom.index == params) {
  796. return "bottom";
  797. } else if (pathLinearData[key].right.index == params) {
  798. return "right";
  799. } else if (pathLinearData[key].havenbag.index == params) {
  800. return "havenbag";
  801. }
  802. }
  803.  
  804. $('#path-creator-bar').on('click', '.fa-save', function () {
  805. var firstIf = false;
  806. var txt = "-- Generated On Dofus-Map with Drigtime's SwiftPath Script Maker --\r\n" +
  807. "-- Nom : " + $('#file-name-field').val() + "\r\n" +
  808. "-- Zone : " + $('#area-field').val() + "\r\n" +
  809. "-- Type : " + ($('#type-field').val() ? $('#type-field').val() : "") + "\r\n" +
  810. "-- Version : " + $('#version-field').val() + "\r\n" +
  811. "-- Auteur : " + $('#author-field').val() + "\r\n\r\n" +
  812. "GATHER = {" + ($('#ressources-selecter').val() ? $('#ressources-selecter').val() : "") + "}\r\n" +
  813. "OPEN_BAGS = " + $('#open-bag-checkbox').is(":checked") + "\r\n" +
  814. "AUTO_DELETE = {" + $('#auto-delete-field').val() + "}\r\n\r\n" +
  815. "MAX_MONSTERS = " + $('#max-monster').val() + "\r\n" +
  816. "MIN_MONSTERS = " + $('#min-monster').val() + "\r\n\r\n" +
  817. "FORBIDDEN_MONSTERS = {" + $('#forbidden-ennemy-field').val() + "}\r\n" +
  818. "FORCE_MONSTERS = {" + $('#mendatory-ennemy-field').val() + "}\r\n\r\n" +
  819. "" +
  820. "function hiboux()\r\n" +
  821. "\tnpc:npc(522,3)\r\n" +
  822. "\tnpc:reply(-1)\r\n" +
  823. "\texchange:putAllItems()\r\n" +
  824. "\tglobal:leaveDialog()\r\n" +
  825. "end\r\n\r\n";
  826. if (pathLinearData.length !== 0) {
  827. txt +=
  828. 'function GatherFight()\r\n' +
  829. '\tfor index, actualMap in pairs(mapsWithChangeMap) do\r\n' +
  830. '\t\tif (map:onMap(actualMap.map)) then\r\n' +
  831. '\t\t\tif actualMap.gather and actualMap.fight then\r\n' +
  832. '\t\t\t\treturn "both"\r\n' +
  833. '\t\t\telseif actualMap.gather then\r\n' +
  834. '\t\t\t\treturn "gather"\r\n' +
  835. '\t\t\telseif actualMap.forcegather then\r\n' +
  836. '\t\t\t\treturn "forcegather"\r\n' +
  837. '\t\t\telseif actualMap.fight then\r\n' +
  838. '\t\t\t\treturn "fight"\r\n' +
  839. '\t\t\telseif actualMap.forcefight then\r\n' +
  840. '\t\t\t\treturn "forcefight"\r\n' +
  841. '\t\t\tend\r\n' +
  842. '\t\t\treturn "path"\r\n' +
  843. '\t\tend\r\n' +
  844. '\tend\r\n' +
  845. '\treturn false\r\n' +
  846. 'end\r\n' +
  847. '\r\n' +
  848. '------------------\r\n' +
  849. '\r\n' +
  850. 'function move()\r\n';
  851. if (havenbagCheck('move')) {
  852. txt += "\tif map:onMap(\"0,0\") then\r\n";
  853. firstIf = false;
  854. for (let index = 0; index < havenBagData.length; index++) {
  855. if (havenBagData[index].move) {
  856. if (!firstIf) {
  857. txt += "\t\tif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  858. firstIf = true;
  859. } else
  860. txt += "\t\telseif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  861. }
  862. }
  863. txt += '\t\tend\r\n' +
  864. '\telse\r\n' +
  865. '\t\tactualMap = map:currentMap()\r\n' +
  866. '\tend\r\n';
  867. }
  868. txt +=
  869. '\tif banque then\r\n' +
  870. '\t\tfor index, actualMap in pairs(mapsWithChangeMap) do\r\n' +
  871. '\t\t\tif actualMap.doNextMap then\r\n' +
  872. '\t\t\t\tactualMap.doNextMap = "no"\r\n' +
  873. '\t\t\tend\r\n' +
  874. '\t\t\tif actualMap.doThirdMap then\r\n' +
  875. '\t\t\t\tactualMap.doThirdMap = "no"\r\n' +
  876. '\t\t\tend\r\n' +
  877. '\t\t\tif actualMap.doFourthdMap then\r\n' +
  878. '\t\t\t\tactualMap.doFourthMap = "no"\r\n' +
  879. '\t\t\tend\r\n' +
  880. '\t\tend\r\n' +
  881. '\t\tbanque = false\r\n' +
  882. '\tend\r\n' +
  883. '\tif GatherFight() == "both" then\r\n' +
  884. '\t\treturn {\r\n' +
  885. '\t\t\t{map = map:currentMap(), custom = processMap, gather = true, fight = true}\r\n' +
  886. '\t\t}\r\n' +
  887. '\telseif GatherFight() == "gather" then\r\n' +
  888. '\t\treturn {\r\n' +
  889. '\t\t\t{map = map:currentMap(), custom = processMap, gather = true}\r\n' +
  890. '\t\t}\r\n' +
  891. '\telseif GatherFight() == "forcegather" then\r\n' +
  892. '\t\treturn {\r\n' +
  893. '\t\t\t{map = map:currentMap(), custom = processMap, forcegather = true}\r\n' +
  894. '\t\t}\r\n' +
  895. '\telseif GatherFight() == "fight" then\r\n' +
  896. '\t\treturn {\r\n' +
  897. '\t\t\t{map = map:currentMap(), custom = processMap, fight = true}\r\n' +
  898. '\t\t}\r\n' +
  899. '\telseif GatherFight() == "forcefight" then\r\n' +
  900. '\t\treturn {\r\n' +
  901. '\t\t\t{map = map:currentMap(), custom = processMap, forcefight = true}\r\n' +
  902. '\t\t}\r\n' +
  903. '\telseif GatherFight() == "path" then\r\n' +
  904. '\t\treturn {\r\n' +
  905. '\t\t\t{map = map:currentMap(), custom = processMap}\r\n' +
  906. '\t\t}\r\n' +
  907. '\telse\r\n' +
  908. '\t\tglobal:printError("Aucune action sur la map : " .. map:currentMap() .. " | mapID : " .. map:currentMapId())\r\n' +
  909. '\t\tglobal:disconnect()\r\n' +
  910. '\tend\r\n' +
  911. 'end\r\n' +
  912. '\r\n' +
  913. 'mapsWithChangeMap = {\r\n';
  914. for (let key in pathLinearData) {
  915. txt += '\t{map = "' + pathLinearData[key].map.replace(' ', '') + '", changeMap = "' + getLinearAction(1, key) + '"' + (pathLinearData[key].index >= 2 ? ', nextMap = "' + getLinearAction(2, key) + '", doNextMap = "no"' : "") + (pathLinearData[key].index >= 3 ? ', thirdMap = "' + getLinearAction(3, key) + '", doThirdMap = "no"' : "") + (pathLinearData[key].index >= 4 ? ', fourthMap = "' + getLinearAction(4, key) + '", doFourthMap = "no"' : "") + gatherFigh(key, pathLinearData) + '},\r\n';
  916. }
  917. for (let key in pathData) {
  918. txt += '\t{map = "' + pathData[key].map.replace(" ", "") + '", changeMap = "' + pathGenerator(key, pathData) + '"' + gatherFigh(key, pathData) + '},\r\n';
  919. }
  920. txt += '}\r\n' +
  921. '\r\n' +
  922. 'function processMap()\r\n' +
  923. '\tfor index, actualMap in pairs(mapsWithChangeMap) do\r\n' +
  924. '\t\tif (map:onMap(actualMap.map)) then\r\n' +
  925. '\t\t\tif (actualMap.doNextMap) and (actualMap.doThirdMap) and (actualMap.doFourthMap) then\r\n' +
  926. '\t\t\t\tif (actualMap.doFourthMap) == "yes" then\r\n' +
  927. '\t\t\t\t\tactualMap.doFourthMap = "no"\r\n' +
  928. '\t\t\t\t\tif (actualMap.fourthMapDoor) then\r\n' +
  929. '\t\t\t\t\t\tactualMap.fourthMapDoor = tonumber(actualMap.fourthMapDoor)\r\n' +
  930. '\t\t\t\t\t\tmap:door(actualMap.fourthMapDoor)\r\n' +
  931. '\t\t\t\t\telseif (actualMap.fourthMapCustom) then\r\n' +
  932. '\t\t\t\t\t\treturn (actualMap.fourthMapCustom)()\r\n' +
  933. '\t\t\t\t\telse\r\n' +
  934. '\t\t\t\t\t\tmap:changeMap(actualMap.fourthMap)\r\n' +
  935. '\t\t\t\t\tend\r\n' +
  936. '\t\t\t\telseif (actualMap.doThirdMap) == "yes" then\r\n' +
  937. '\t\t\t\t\tactualMap.doThirdMap = "no"\r\n' +
  938. '\t\t\t\t\tactualMap.doFourthMap = "yes"\r\n' +
  939. '\t\t\t\t\tif (actualMap.thirdMapDoor) then\r\n' +
  940. '\t\t\t\t\t\tactualMap.thirdMapDoor = tonumber(actualMap.thirdMapDoor)\r\n' +
  941. '\t\t\t\t\t\tmap:door(actualMap.thirdMapDoor)\r\n' +
  942. '\t\t\t\t\telseif (actualMap.thirdMapCustom) then\r\n' +
  943. '\t\t\t\t\t\treturn (actualMap.thirdMapCustom)()\r\n' +
  944. '\t\t\t\t\telse\r\n' +
  945. '\t\t\t\t\t\tmap:changeMap(actualMap.thirdMap)\r\n' +
  946. '\t\t\t\t\tend\r\n' +
  947. '\t\t\t\telseif (actualMap.doNextMap == "yes") then\r\n' +
  948. '\t\t\t\t\tactualMap.doNextMap = "no"\r\n' +
  949. '\t\t\t\t\tactualMap.doThirdMap = "yes"\r\n' +
  950. '\t\t\t\t\tif (actualMap.nextMapDoor) then\r\n' +
  951. '\t\t\t\t\t\tactualMap.nextMapDoor = tonumber(actualMap.nextMapDoor)\r\n' +
  952. '\t\t\t\t\t\tmap:door(actualMap.nextMapDoor)\r\n' +
  953. '\t\t\t\t\telseif (actualMap.nextMapCustom) then\r\n' +
  954. '\t\t\t\t\t\treturn (actualMap.nextMapCustom)()\r\n' +
  955. '\t\t\t\t\telse\r\n' +
  956. '\t\t\t\t\t\tmap:changeMap(actualMap.nextMap)\r\n' +
  957. '\t\t\t\t\tend\r\n' +
  958. '\t\t\t\telseif (actualMap.changeMapDoor) then\r\n' +
  959. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  960. '\t\t\t\t\tactualMap.changeMapDoor = tonumber(actualMap.changeMapDoor)\r\n' +
  961. '\t\t\t\t\tmap:door(actualMap.changeMapDoor)\r\n' +
  962. '\t\t\t\telseif (actualMap.changeMapCustom) then\r\n' +
  963. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  964. '\t\t\t\t\treturn (actualMap.changeMapCustom)()\r\n' +
  965. '\t\t\t\telseif (actualMap.changeMap) then\r\n' +
  966. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  967. '\t\t\t\t\tmap:changeMap(actualMap.changeMap)\r\n' +
  968. '\t\t\t\tend\r\n' +
  969. '\t\t\telseif (actualMap.doNextMap) and (actualMap.doThirdMap) then\r\n' +
  970. '\t\t\t\tif (actualMap.doThirdMap) == "yes" then\r\n' +
  971. '\t\t\t\t\tactualMap.doThirdMap = "no"\r\n' +
  972. '\t\t\t\t\tif (actualMap.thirdMapDoor) then\r\n' +
  973. '\t\t\t\t\t\tactualMap.thirdMapDoor = tonumber(actualMap.thirdMapDoor)\r\n' +
  974. '\t\t\t\t\t\tmap:door(actualMap.thirdMapDoor)\r\n' +
  975. '\t\t\t\t\telseif (actualMap.thirdMapCustom) then\r\n' +
  976. '\t\t\t\t\t\treturn (actualMap.thirdMapCustom)()\r\n' +
  977. '\t\t\t\t\telse\r\n' +
  978. '\t\t\t\t\t\tmap:changeMap(actualMap.thirdMap)\r\n' +
  979. '\t\t\t\t\tend\r\n' +
  980. '\t\t\t\telseif (actualMap.doNextMap == "yes") then\r\n' +
  981. '\t\t\t\t\tactualMap.doNextMap = "no"\r\n' +
  982. '\t\t\t\t\tactualMap.doThirdMap = "yes"\r\n' +
  983. '\t\t\t\t\tif (actualMap.nextMapDoor) then\r\n' +
  984. '\t\t\t\t\t\tactualMap.nextMapDoor = tonumber(actualMap.nextMapDoor)\r\n' +
  985. '\t\t\t\t\t\tmap:door(actualMap.nextMapDoor)\r\n' +
  986. '\t\t\t\t\telseif (actualMap.nextMapCustom) then\r\n' +
  987. '\t\t\t\t\t\treturn (actualMap.nextMapCustom)()\r\n' +
  988. '\t\t\t\t\telse\r\n' +
  989. '\t\t\t\t\t\tmap:changeMap(actualMap.nextMap)\r\n' +
  990. '\t\t\t\t\tend\r\n' +
  991. '\t\t\t\telseif (actualMap.changeMapDoor) then\r\n' +
  992. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  993. '\t\t\t\t\tactualMap.changeMapDoor = tonumber(actualMap.changeMapDoor)\r\n' +
  994. '\t\t\t\t\tmap:door(actualMap.changeMapDoor)\r\n' +
  995. '\t\t\t\telseif (actualMap.changeMapCustom) then\r\n' +
  996. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  997. '\t\t\t\t\treturn (actualMap.changeMapCustom)()\r\n' +
  998. '\t\t\t\telseif (actualMap.changeMap) then\r\n' +
  999. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  1000. '\t\t\t\t\tmap:changeMap(actualMap.changeMap)\r\n' +
  1001. '\t\t\t\tend\r\n' +
  1002. '\t\t\telseif (actualMap.doNextMap) then\r\n' +
  1003. '\t\t\t\tif (actualMap.doNextMap == "yes") then\r\n' +
  1004. '\t\t\t\t\tactualMap.doNextMap = "no"\r\n' +
  1005. '\t\t\t\t\tif (actualMap.nextMapDoor) then\r\n' +
  1006. '\t\t\t\t\t\tactualMap.nextMapDoor = tonumber(actualMap.nextMapDoor)\r\n' +
  1007. '\t\t\t\t\t\tmap:door(actualMap.nextMapDoor)\r\n' +
  1008. '\t\t\t\t\telseif (actualMap.nextMapCustom) then\r\n' +
  1009. '\t\t\t\t\t\treturn (actualMap.nextMapCustom)()\r\n' +
  1010. '\t\t\t\t\telse\r\n' +
  1011. '\t\t\t\t\t\tmap:changeMap(actualMap.nextMap)\r\n' +
  1012. '\t\t\t\t\tend\r\n' +
  1013. '\t\t\t\telseif (actualMap.changeMapDoor) then\r\n' +
  1014. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  1015. '\t\t\t\t\tactualMap.changeMapDoor = tonumber(actualMap.changeMapDoor)\r\n' +
  1016. '\t\t\t\t\tmap:door(actualMap.changeMapDoor)\r\n' +
  1017. '\t\t\t\telseif (actualMap.changeMapCustom) then\r\n' +
  1018. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  1019. '\t\t\t\t\treturn (actualMap.changeMapCustom)()\r\n' +
  1020. '\t\t\t\telseif (actualMap.changeMap) then\r\n' +
  1021. '\t\t\t\t\tactualMap.doNextMap = "yes"\r\n' +
  1022. '\t\t\t\t\tmap:changeMap(actualMap.changeMap)\r\n' +
  1023. '\t\t\t\tend\r\n' +
  1024. '\t\t\telseif (actualMap.changeMapDoor) then\r\n' +
  1025. '\t\t\t\tactualMap.changeMapDoor = tonumber(actualMap.changeMapDoor)\r\n' +
  1026. '\t\t\t\tmap:door(actualMap.changeMapDoor)\r\n' +
  1027. '\t\t\telseif (actualMap.changeMapCustom) then\r\n' +
  1028. '\t\t\t\treturn (actualMap.changeMapCustom)()\r\n' +
  1029. '\t\t\telseif (actualMap.changeMap) then\r\n' +
  1030. '\t\t\t\tmap:changeMap(actualMap.changeMap)\r\n' +
  1031. '\t\t\telseif (actualMap.forcegather) then\r\n' +
  1032. '\t\t\tend\r\n' +
  1033. '\t\tend\r\n' +
  1034. '\tend\r\n' +
  1035. 'end\r\n\r\n';
  1036. } else {
  1037. txt += "\r\nfunction move()\r\n";
  1038. if (havenbagCheck('move')) {
  1039. txt += "\tif map:onMap(\"0,0\") then\r\n";
  1040. firstIf = false;
  1041. for (let index = 0; index < havenBagData.length; index++) {
  1042. if (havenBagData[index].move) {
  1043. if (!firstIf) {
  1044. txt += "\t\tif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  1045. firstIf = true;
  1046. } else
  1047. txt += "\t\telseif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  1048. }
  1049. }
  1050. txt += '\t\tend\r\n' +
  1051. '\telse\r\n' +
  1052. '\t\tactualMap = map:currentMap()\r\n' +
  1053. '\tend\r\n';
  1054. }
  1055. txt += '\treturn {\r\n' +
  1056. '\t\t{map = "192415750", path = "409"}, --Interieur banque Astrub vers Sortie--\r\n' +
  1057. '\t\t{map = "54534165", path = "424"}, --Interieur banque Frigost vers Sortie--\r\n' +
  1058. '\t\t{map = "2885641", path = "424"}, --Interieur banque Bonta vers Sortie--\r\n' +
  1059. '\t\t{map = "99095051", path = "410"}, --Interieur banque Amakna vers Sortie--\r\n' +
  1060. '\t\t{map = "8912911", path = "424"}, --Interieur banque Brakmar vers Sortie--\r\n' +
  1061. '\t\t{map = "91753985", path = "396"}, --Interieur banque Sufokia vers Sortie--\r\n' +
  1062. '\t\t{map = "86511105", door = "452"}, --Interieur banque Ottomaï vers Sortie--\r\n' +
  1063. '\t\t{map = "8129542", path = "409"}, --Interieur banque Pandala vers Sortie--\r\n' +
  1064. '\t\t{map = "84935175", path = "425"}, --Interieur banque Montagne Koalak vers Sortie--\r\n';
  1065. for (let key in pathData) {
  1066. txt += '\t\t{map = "' + pathData[key].map.replace(" ", "") + '", path = "' + pathGenerator(key, pathData) + '"' + gatherFigh(key, pathData) + '},\r\n';
  1067. }
  1068. txt += '\t}\r\nend\r\n\r\n';
  1069. }
  1070. txt += "function bank()\r\n";
  1071. if (pathLinearData.length !== 0) {
  1072. txt += '\tbanque = true\r\n';
  1073. }
  1074. if (havenbagCheck('bank')) {
  1075. txt += "\tif map:onMap(\"0,0\") then\r\n";
  1076. firstIf = false;
  1077. for (let index = 0; index < havenBagData.length; index++) {
  1078. if (havenBagData[index].bank) {
  1079. if (!firstIf) {
  1080. txt += "\t\tif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  1081. firstIf = true;
  1082. } else
  1083. txt += "\t\telseif actualMap == \"" + havenBagData[index].map + "\" then\r\n\t\t\tmap:changeMap(\"zaap(" + havenBagData[index].mapidToGo + ")\")\r\n";
  1084. }
  1085. }
  1086. txt += "\t\tend\r\n" +
  1087. "\telse\r\n" +
  1088. "\t\tactualMap = map:currentMap()\r\n" +
  1089. "\tend\r\n";
  1090. }
  1091. txt += "\treturn {\r\n";
  1092. for (let key in bankData) {
  1093. txt += '\t\t{map = "' + bankData[key].map.replace(" ", "") + '", path = "' + pathGenerator(key, bankData) + '"},\r\n';
  1094. }
  1095. txt += '\t\t{map = "191104002", door = "288"}, --Devant banque Astrub--\r\n' +
  1096. '\t\t{map = "192415750", path = "396", custom = hiboux}, --Banque Astrub--\r\n' +
  1097. '\t\t{map = "54172457", door = "358"}, --Devant banque Frigost--\r\n' +
  1098. '\t\t{map = "54534165", path = "424", npcBank = true}, --Banque Frigost--\r\n' +
  1099. '\t\t{map = "147254", door = "383"}, --Devant banque Bonta--\r\n' +
  1100. '\t\t{map = "2885641", path = "424", npcBank = true}, --Banque Bonta--\r\n' +
  1101. '\t\t{map = "88081177", door = "216"}, --Devant banque Amakna--\r\n' +
  1102. '\t\t{map = "99095051", path = "410", npcBank = true}, --Banque Amakna--\r\n' +
  1103. '\t\t{map = "144931", door = "248"}, --Devant banque Brakmar--\r\n' +
  1104. '\t\t{map = "8912911", path = "424", npcBank = true}, --Banque Brakmar--\r\n' +
  1105. '\t\t{map = "90703872", door = "302"}, --Devant banque Sufokia --\r\n' +
  1106. '\t\t{map = "91753985", path = "494", npcBank = true}, --Banque Sufokia--\r\n' +
  1107. '\t\t{map = "155157", door = "355"}, --Devant banque Ottomaï--\r\n' +
  1108. '\t\t{map = "86511105", door = "452", npcBank = true}, --Banque Ottomaï--\r\n' +
  1109. '\t\t{map = "12580", door = "284"}, --Devant banque Pandala--\r\n' +
  1110. '\t\t{map = "8129542", path = "409", npcBank = true}, --Banque Pandala--\r\n' +
  1111. '\t\t{map = "73400323", door = "330"}, --Devant banque Montagne Koalak--\r\n' +
  1112. '\t\t{map = "84935175", path = "425", npcBank = true}, --Banque Montagne Koalak--\r\n\t}\r\nend\r\n' +
  1113. '\r\n\r\nfunction phenix()\r\n';
  1114. if (havenbagCheck('phenix')) {
  1115. txt += "\tif map:onMap(\"0,0\") then\r\n";
  1116. firstIf = false;
  1117. for (let index = 0; index < havenBagData.length; index++) {
  1118. if (havenBagData[index].phenix) {
  1119. if (!firstIf) {
  1120. txt += '\t\tif actualMap == \"' + havenBagData[index].map + '\" then\r\n\t\t\tmap:changeMap(\"zaap(' + havenBagData[index].mapidToGo + ')\")\r\n';
  1121. firstIf = true;
  1122. } else
  1123. txt += '\t\telseif actualMap == \"' + havenBagData[index].map + '\" then\r\n\t\t\tmap:changeMap(\"zaap(' + havenBagData[index].mapidToGo + ')\")\r\n';
  1124. }
  1125. }
  1126. txt += '\t\tend\r\n' +
  1127. '\telse\r\n' +
  1128. '\t\tactualMap = map:currentMap()\r\n' +
  1129. '\tend\r\n';
  1130. } else if (havenbagCheck('move')) txt += '\tactualMap = map:currentMap()\r\n';
  1131. txt += "\treturn {\r\n";
  1132. for (let key in phenixData) {
  1133. if (checkPhenixPos(phenixData[key].map.replace(" ", ""))[0]) {
  1134. txt += '\t\t{map = "' + phenixPos[checkPhenixPos(phenixData[key].map.replace(" ", ""))[1]].map + '", phenix = "' + phenixPos[checkPhenixPos(phenixData[key].map.replace(" ", ""))[1]].cellid + '", path = "' + pathGenerator(key, phenixData) + '"},\r\n';
  1135. } else {
  1136. txt += '\t\t{map = "' + phenixData[key].map.replace(" ", "") + '", path = "' + pathGenerator(key, phenixData) + '"},\r\n';
  1137. }
  1138. }
  1139. txt += '\t}\r\nend\r\n';
  1140. saveTextAsFile(txt);
  1141. });
  1142.  
  1143. function saveTextAsFile(txt) {
  1144. var textToSaveAsBlob = new Blob([txt], {
  1145. type: "text/plain"
  1146. });
  1147. var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
  1148. var fileNameToSaveAs = '[' + ($('#type-field').val() ? $('#type-field').val() : "") + '][' + $('#area-field').val() + ']' + $('#file-name-field').val() + '.lua';
  1149. var downloadLink = document.createElement("a");
  1150. downloadLink.download = fileNameToSaveAs;
  1151. downloadLink.innerHTML = "Download File";
  1152. downloadLink.href = textToSaveAsURL;
  1153. downloadLink.style.display = "none";
  1154. document.body.appendChild(downloadLink);
  1155. downloadLink.click();
  1156. }
  1157.  
  1158. function languageSelector(params) {
  1159. switch (params) {
  1160. case "fr":
  1161. $('#path-creator-bar').empty().append('<div class="leaflet-bar leaflet-control path-selecter"> <a class="leaflet-control-zoom-in fas fa-arrow-up" href="#" title="Haut" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-down" href="#" title="Bas" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-left" href="#" title="Gauche" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-right" href="#" title="Droite" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-suitcase" href="#" title="Havre-sac" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control tool-selecter"> <a class="leaflet-control-zoom-in fas fa-eraser" href="#" title="Effacer une action" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-random" href="#" title="Linéaire" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control path-type-selecter"> <a class="leaflet-control-zoom-in fas fa-arrows-alt toggled" href="#" title="Deplacement" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-shield-alt" href="#" title="Combat" style="color:#d82121;"></a> <a class="leaflet-control-zoom-in fas fa-leaf" href="#" title="Récolte" style="color:#229e22;"></a> <a class="leaflet-control-zoom-in fas fa-university" href="#" title="Banque" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-fire" href="#" title="Phenix" style="color:purple;"></a> </div><div class="leaflet-bar leaflet-control path-setting"> <a class="leaflet-control-zoom-in fas fa-info-circle" href="#" title="Paramétre du trajet" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-save" href="#" title="Sauvegarder" style="color:#3a3ab9;"></a> <input type="file" id="file" title="Ouvrir" style="display: none;"> <a class="leaflet-control-zoom-in fas fa-folder-open" href="#" title="Ouvrir" style="color:#ffd228;"></a> <a class="leaflet-control-zoom-in fas fa-trash-alt" href="#" title="Supprimer tout" style="color:#4c4c4c;"></a> <a class="leaflet-control-zoom-in fas fa-cog" href="#" title="Paramétre" style="color:#4c4c4c;"></a> </div>');
  1162. $('#havenBagSetting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="myModalLabel">Zaap : </h4> </div><div class="modal-body"> <label>Zaap d\'arrivée :</label> <select class="form-control" id="sel1"> <option value=\'{"map": "4,-19", "mapid": "84674563"}\'>Astrub | 4,-19</option> <option value=\'{"map": "-32,-56", "mapid": "147768"}\'>Bonta | -32,-56</option> <option value=\'{"map": "-26,35", "mapid": "144419"}\'>Brâkmar | -26,35</option> <option value=\'{"map": "-1,13", "mapid": "88212746"}\'>Amakna (Bord de la forêt maléfique) | -1,13</option> <option value=\'{"map": "3,-5", "mapid": "68552706"}\'>Amakna (Château d\'Amakna) | 3,-5</option> <option value=\'{"map": "5,7", "mapid": "88082704"}\'>Amakna (Coins des Bouftous) | 5,7</option> <option value=\'{"map": "7,-4", "mapid": "68419587"}\'>Amakna (Port de Madrestam) | 7,-4</option> <option value=\'{"map": "-2,0", "mapid": "88213271"}\'>Amakna (Village d\'Amakna) | -2,0</option> <option value=\'{"map": "-1,24", "mapid": "88212481"}\'>Amakna (Plaîne des Scarafeuilles) | -1,24</option> <option value=\'{"map": "10,22", "mapid": "88085249"}\'>Baie de Sufokia (Rivage Sufokien) | 10,22</option> <option value=\'{"map": "13,26", "mapid": "95422468"}\'>Baie de Sufokia (Sufokia) | 13,26</option> <option value=\'{"map": "-46,18", "mapid": "154642"}\'>Île d\'Otomaïl (Village côtier) | -46,18</option> <option value=\'{"map": "-79,-41", "mapid": "54172969"}\'>Île de Frigost (La Bourgade) | -79,-41</option> <option value=\'{"map": "-77,-73", "mapid": "54172489"}\'>Île de Frigost (Village enseveli) | -77,-73</option> <option value=\'{"map": "35,12", "mapid": "156762120"}\'>Île de Moon (Plage de la Tortue) | 35,12</option> <option value=\'{"map": "-16,1", "mapid": "73400320"}\'>Montagne des Koalaks (Village des Eleveurs) | -16,1</option> <option value=\'{"map": "26,-37", "mapid": "13605"}\'>Pandala Neutre (Faubourgs de Pandala) | 26,-37</option> <option value=\'{"map": "29,-49", "mapid": "15153"}\'>Pandala Feu (Village de Feudala) | 29,-49</option> <option value=\'{"map": "-27,-36", "mapid": "142087694"}\'>Plaine de Cania (Champs de Cania) | -27,-36</option> <option value=\'{"map": "-3,-42", "mapid": "156240386"}\'>Plaine de Cania (Lac de Cania) | -3,-42</option> <option value=\'{"map": "-13,-28", "mapid": "165152263"}\'>Plaine de Cania (Massif de Cania) | -13,-28</option> <option value=\'{"map": "-5,-23", "mapid": "84806401"}\'>Plaine de Cania (Plaine des Porkass) | -5,-23</option> <option value=\'{"map": "-17,-47", "mapid": "147590153"}\'>Plaine de Cania (Plaines Rocheuses) | -17,-47</option> <option value=\'{"map": "-20,-20", "mapid": "164364304"}\'>Plaine de Cania (Route Rocailleuse) | -20,-20</option> <option value=\'{"map": "15,-58", "mapid": "173278210"}\'>Saharach (Dunes des ossements) | 15,-58</option> <option value=\'{"map": "-25,12", "mapid": "171967506"}\'>Landes de Sidimote (Route des Roulottes) | -25,12</option> </select> </div><div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button> <button type="button" class="btn btn-primary">Valider</button> </div></div></div>');
  1163. $('#pathSetting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Paramétre du trajet</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"> <a href="#informationTab" aria-controls="informationTab" role="tab" data-toggle="tab">Information</a> </li><li role="presentation"> <a href="#fightTab" aria-controls="fightTab" role="tab" data-toggle="tab">Combat</a> </li><li role="presentation"> <a href="#gatherTab" aria-controls="gatherTab" role="tab" data-toggle="tab">Récolte</a> </li><li role="presentation"> <a href="#bankTab" aria-controls="bankTab" role="tab" data-toggle="tab">Banque</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="informationTab"> <br/> <div class="row no-gutters"> <div class="col col-sm-2"> <p>Nom :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" id="file-name-field"> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Zone :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Astrub" id="area-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Type :</p></div><div class="col col-sm-10"> <select class="form-control" id="type-field"> <option disabled selected value></option> <option>Combat</option> <option>Déplacement</option> <option>Récolte</option> </select> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Version :</p></div><div class="col col-sm-10"> <input type="number" value="1.0" step="0.1" class="form-control" id="version-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Auteur :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Drigtime" id="author-field"> </div></div><br></div><div role="tabpanel" class="tab-pane" id="fightTab"> <br/> <div class="row"> <div class="col col-sm-5"> <p>Nombre de monstres minimum : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="1" id="min-monster" class="=" form-control> </div></div><div class="row"> <div class="col col-sm-5"> <p>Nombre de monstres maximum : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="8" id="max-monster" class="=" form-control> </div></div><br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Monstres interdit</div><div class="panel-body"> <div class="col col-sm-5"> <p>Liste des monstres à éviter : </p></div><div class="col col-sm-6"> <input type="text" class="form-control" placeholder="ex : 101, 98 ..." id="forbidden-ennemy-field"> </div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Monstres obligatoire</div><div class="panel-body"> <div class="col col-sm-5"> <p>Liste des monstres à avoir : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="mendatory-ennemy-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div><div role="tabpanel" class="tab-pane" id="gatherTab"> <br/> <div class="checkbox checbox-switch switch-primary"> <label> <input type="checkbox" id="open-bag-checkbox" checked=""/> <span></span> Ouverture automatique des sacs de ressources </label> </div><div class="panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Ressources à récolter</div><div class="panel-body" id="ressources-to-gather"> <div class="row"> <div class="col col-sm-5"> <p>Liste des ressources à récolter : </p></div><div class="col col-sm-7"> <select class="form-control selectpicker" data-live-search="true" multiple data-dropup-auto="false" id="ressources-selecter"> </select> </div></div><div class="ressources-selected-summary"></div></div></div></div><div role="tabpanel" class="tab-pane" id="bankTab"> <br/><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Objets à supprimer automatiquement</div><div class="panel-body"> <div class="col col-sm-5"> <p>Liste des objets à supprimer automatiquement : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="auto-delete-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/objets.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Valider</button> </div></div></div></div></div>');
  1164. $('#setting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Paramétre</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation"> <a href="#shortcutTab" aria-controls="shortcutTab" role="tab" data-toggle="tab">Raccourcis</a> </li><li role="presentation" class="active"> <a href="#languageTab" aria-controls="languageTab" role="tab" data-toggle="tab">Langue</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane" id="shortcutTab"> <br/> <table class="table table-bordered table-hover table-condensed table-responsive"> <thead> <tr> <th> Nom de l\'action </th> <th> Raccourci </th> </tr></thead> <tbody> <tr> <td> Haut </td><td> <input type="text" class="form\-control" id="shortcut-key-up" value="' + GM_getValue("shortcut-key-up", "z") + '" readonly> </td></tr><tr> <td> Bas </td><td> <input type="text" class="form\-control" id="shortcut-key-down" value="' + GM_getValue("shortcut-key-down", "s") + '" readonly> </td></tr><tr> <td> Gauche </td><td> <input type="text" class="form\-control" id="shortcut-key-left" value="' + GM_getValue("shortcut-key-left", "q") + '" readonly> </td></tr><tr> <td> Droite </td><td> <input type="text" class="form\-control" id ="shortcut-key-right" value="' + GM_getValue("shortcut-key-right", "d") + '" readonly> </td></tr><tr> <td> Havre-sac </td><td> <input type="text" class="form\-control" id="shortcut-key-havenbag" value="' + GM_getValue("shortcut-key-havenbag", "a") + '" readonly> </td></tr><tr> <td> Effacer une action </td><td> <input type="text" class="form\-control" id="shortcut-key-erase" value="' + GM_getValue("shortcut-key-erase", "e") + '" readonly> </td></tr></tbody> </table> </div><div role="tabpanel" class="tab-pane active" id="languageTab"> <br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Langue</div><div class="panel-body"> <select multiple class="form-control" id="language-selected"> <option value="fr">Français</option> <option value="en">English</option> <option value="es">Español</option> </select> </div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Valider</button> </div></div></div></div></div></div>');
  1165. $('#ressources-selecter').empty();
  1166. for (let key in ressourcesFr) {
  1167. $('#ressources-selecter').append('<option value="' + ressourcesFr[key].itemId + '">' + ressourcesFr[key].itemName + '</option>');
  1168. }
  1169. GM_setValue("language", "fr");
  1170. break;
  1171. case "en":
  1172. $('#path-creator-bar').empty().append('<div class="leaflet-bar leaflet-control path-selecter"> <a class="leaflet-control-zoom-in fas fa-arrow-up" href="#" title="Top" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-down" href="#" title="Bottom" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-left" href="#" title="Left" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-right" href="#" title="Right" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-suitcase" href="#" title="Havenbag" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control tool-selecter"> <a class="leaflet-control-zoom-in fas fa-eraser" href="#" title="Erase an action" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-random" href="#" title="Linear" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control path-type-selecter"> <a class="leaflet-control-zoom-in fas fa-arrows-alt toggled" href="#" title="Move" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-shield-alt" href="#" title="Fight" style="color:#d82121;"></a> <a class="leaflet-control-zoom-in fas fa-leaf" href="#" title="Gather" style="color:#229e22;"></a> <a class="leaflet-control-zoom-in fas fa-university" href="#" title="Bank" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-fire" href="#" title="Phoneix" style="color:purple;"></a> </div><div class="leaflet-bar leaflet-control path-setting"> <a class="leaflet-control-zoom-in fas fa-info-circle" href="#" title="Setting of the path" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-save" href="#" title="Save" style="color:#3a3ab9;"></a> <input type="file" id="file" style="display: none;"> <a class="leaflet-control-zoom-in fas fa-folder-open" href="#" title="Open" style="color:#ffd228;"></a> <a class="leaflet-control-zoom-in fas fa-trash-alt" href="#" title="Erase all" style="color:#4c4c4c;"></a> <a class="leaflet-control-zoom-in fas fa-cog" href="#" title="Setting" style="color:#4c4c4c;"></a> </div>');
  1173. $('#havenBagSetting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="myModalLabel">Zaap : </h4> </div><div class="modal-body"> <label>Zaap to go :</label> <select class="form-control" id="sel1"> <option value=\'{"map": "4,-19", "mapid": "84674563"}\'>Astrub | 4,-19</option> <option value=\'{"map": "-32,-56", "mapid": "147768"}\'>Bonta | -32,-56</option> <option value=\'{"map": "-26,35", "mapid": "144419"}\'>Brâkmar | -26,35</option> <option value=\'{"map": "-1,13", "mapid": "88212746"}\'>Amakna (Bord de la forêt maléfique) | -1,13</option> <option value=\'{"map": "3,-5", "mapid": "68552706"}\'>Amakna (Château d\'Amakna) | 3,-5</option> <option value=\'{"map": "5,7", "mapid": "88082704"}\'>Amakna (Coins des Bouftous) | 5,7</option> <option value=\'{"map": "7,-4", "mapid": "68419587"}\'>Amakna (Port de Madrestam) | 7,-4</option> <option value=\'{"map": "-2,0", "mapid": "88213271"}\'>Amakna (Village d\'Amakna) | -2,0</option> <option value=\'{"map": "-1,24", "mapid": "88212481"}\'>Amakna (Plaîne des Scarafeuilles) | -1,24</option> <option value=\'{"map": "10,22", "mapid": "88085249"}\'>Baie de Sufokia (Rivage Sufokien) | 10,22</option> <option value=\'{"map": "13,26", "mapid": "95422468"}\'>Baie de Sufokia (Sufokia) | 13,26</option> <option value=\'{"map": "-46,18", "mapid": "154642"}\'>Île d\'Otomaïl (Village côtier) | -46,18</option> <option value=\'{"map": "-79,-41", "mapid": "54172969"}\'>Île de Frigost (La Bourgade) | -79,-41</option> <option value=\'{"map": "-77,-73", "mapid": "54172489"}\'>Île de Frigost (Village enseveli) | -77,-73</option> <option value=\'{"map": "35,12", "mapid": "156762120"}\'>Île de Moon (Plage de la Tortue) | 35,12</option> <option value=\'{"map": "-16,1", "mapid": "73400320"}\'>Montagne des Koalaks (Village des Eleveurs) | -16,1</option> <option value=\'{"map": "26,-37", "mapid": "13605"}\'>Pandala Neutre (Faubourgs de Pandala) | 26,-37</option> <option value=\'{"map": "29,-49", "mapid": "15153"}\'>Pandala Feu (Village de Feudala) | 29,-49</option> <option value=\'{"map": "-27,-36", "mapid": "142087694"}\'>Plaine de Cania (Champs de Cania) | -27,-36</option> <option value=\'{"map": "-3,-42", "mapid": "156240386"}\'>Plaine de Cania (Lac de Cania) | -3,-42</option> <option value=\'{"map": "-13,-28", "mapid": "165152263"}\'>Plaine de Cania (Massif de Cania) | -13,-28</option> <option value=\'{"map": "-5,-23", "mapid": "84806401"}\'>Plaine de Cania (Plaine des Porkass) | -5,-23</option> <option value=\'{"map": "-17,-47", "mapid": "147590153"}\'>Plaine de Cania (Plaines Rocheuses) | -17,-47</option> <option value=\'{"map": "-20,-20", "mapid": "164364304"}\'>Plaine de Cania (Route Rocailleuse) | -20,-20</option> <option value=\'{"map": "15,-58", "mapid": "173278210"}\'>Saharach (Dunes des ossements) | 15,-58</option> <option value=\'{"map": "-25,12", "mapid": "171967506"}\'>Landes de Sidimote (Route des Roulottes) | -25,12</option> </select> </div><div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Validate</button> </div></div></div>');
  1174. $('#pathSetting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Setting of the path</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"> <a href="#informationTab" aria-controls="informationTab" role="tab" data-toggle="tab">Information</a> </li><li role="presentation"> <a href="#fightTab" aria-controls="fightTab" role="tab" data-toggle="tab">Fight</a> </li><li role="presentation"> <a href="#gatherTab" aria-controls="gatherTab" role="tab" data-toggle="tab">Gather</a> </li><li role="presentation"> <a href="#bankTab" aria-controls="bankTab" role="tab" data-toggle="tab">Bank</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="informationTab"> <br/> <div class="row no-gutters"> <div class="col col-sm-2"> <p>Name :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" id="file-name-field"> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Area :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Astrub" id="area-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Type :</p></div><div class="col col-sm-10"> <select class="form-control" id="type-field"> <option disabled selected value></option> <option>Fight</option> <option>Move</option> <option>Gather</option> </select> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Version :</p></div><div class="col col-sm-10"> <input type="number" value="1.0" step="0.1" class="form-control" id="version-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Autor :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Drigtime" id="author-field"> </div></div><br></div><div role="tabpanel" class="tab-pane" id="fightTab"> <br/> <div class="row"> <div class="col col-sm-5"> <p>Minimum number of monster : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="1" id="min-monster" class="=" form-control> </div></div><div class="row"> <div class="col col-sm-5"> <p>Maximum number of monster : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="8" id="max-monster" class="=" form-control> </div></div><br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Forbidden monster</div><div class="panel-body"> <div class="col col-sm-5"> <p>List of forbidden monster : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="forbidden-ennemy-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Mendatory monster</div><div class="panel-body"> <div class="col col-sm-5"> <p>List of mendatory monster : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="mendatory-ennemy-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div><div role="tabpanel" class="tab-pane" id="gatherTab"> <br/> <div class="checkbox checbox-switch switch-primary"> <label> <input type="checkbox" id="open-bag-checkbox" checked=""/> <span></span> Automatically open resource bags </label> </div><div class="panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Resources to gather</div><div class="panel-body" id="ressources-to-gather"> <div class="row"> <div class="col col-sm-5"> <p>List of resources to gather : </p></div><div class="col col-sm-7"> <select class="form-control selectpicker" data-live-search="true" multiple data-dropup-auto="false" id="ressources-selecter"> </select> </div></div><div class="ressources-selected-summary"></div></div></div></div><div role="tabpanel" class="tab-pane" id="bankTab"> <br/><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Items to delete automatically</div><div class="panel-body"> <div class="col col-sm-5"> <p>List of items to delete automatically : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="auto-delete-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/objets.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Validate</button> </div></div></div></div></div>');
  1175. $('#setting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Setting</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation"> <a href="#shortcutTab" aria-controls="shortcutTab" role="tab" data-toggle="tab">Shortcuts</a> </li><li role="presentation" class="active"> <a href="#languageTab" aria-controls="languageTab" role="tab" data-toggle="tab">Language</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane" id="shortcutTab"> <br/> <table class="table table-bordered table-hover table-condensed table-responsive"> <thead> <tr> <th> Action name </th> <th> Shortcuts </th> </tr></thead> <tbody> <tr> <td> Top </td><td> <input type="text" class="form\-control" id="shortcut-key-up" value="' + GM_getValue("shortcut-key-up", "z") + '" readonly> </td></tr><tr> <td> Bottom </td><td> <input type="text" class="form\-control" id="shortcut-key-down" value="' + GM_getValue("shortcut-key-down", "s") + '" readonly> </td></tr><tr> <td> Left </td><td> <input type="text" class="form\-control" id="shortcut-key-left" value="' + GM_getValue("shortcut-key-left", "q") + '" readonly> </td></tr><tr> <td> Right </td><td> <input type="text" class="form\-control" id ="shortcut-key-right" value="' + GM_getValue("shortcut-key-right", "d") + '" readonly> </td></tr><tr> <td> Havenbag </td><td> <input type="text" class="form\-control" id="shortcut-key-havenbag" value="' + GM_getValue("shortcut-key-havenbag", "a") + '" readonly> </td></tr><tr> <td> Erase an action </td><td> <input type="text" class="form\-control" id="shortcut-key-erase" value="' + GM_getValue("shortcut-key-erase", "e") + '" readonly> </td></tr></tbody> </table> </div><div role="tabpanel" class="tab-pane active" id="languageTab"> <br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Language</div><div class="panel-body"> <select multiple class="form-control" id="language-selected"> <option value="fr">Français</option> <option value="en">English</option> <option value="es">Español</option> </select> </div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Valider</button> </div></div></div></div></div></div>');
  1176. $('#ressources-selecter').empty();
  1177. for (let key in ressourcesEn) {
  1178. $('#ressources-selecter').append('<option value="' + ressourcesEn[key].itemId + '">' + ressourcesEn[key].itemName + '</option>');
  1179. }
  1180. GM_setValue("language", "en");
  1181. break;
  1182. case "es":
  1183. $('#path-creator-bar').empty().append('<div class="leaflet-bar leaflet-control path-selecter"> <a class="leaflet-control-zoom-in fas fa-arrow-up" href="#" title="Arriba" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-down" href="#" title="Abajo" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-left" href="#" title="Izquierda" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-arrow-right" href="#" title="Derecha" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-suitcase" href="#" title="Merkasakos" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control tool-selecter"> <a class="leaflet-control-zoom-in fas fa-eraser" href="#" title="Borrar una acción" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-random" href="#" title="Lineal" style="color:black;"></a> </div><div class="leaflet-bar leaflet-control path-type-selecter"> <a class="leaflet-control-zoom-in fas fa-arrows-alt toggled" href="#" title="Desplazamiento" style="color:black;"></a> <a class="leaflet-control-zoom-in fas fa-shield-alt" href="#" title="Lucha" style="color:#d82121;"></a> <a class="leaflet-control-zoom-in fas fa-leaf" href="#" title="Cosechar" style="color:#229e22;"></a> <a class="leaflet-control-zoom-in fas fa-university" href="#" title="Banco" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-fire" href="#" title="Fénix" style="color:purple;"></a> </div><div class="leaflet-bar leaflet-control path-setting"> <a class="leaflet-control-zoom-in fas fa-info-circle" href="#" title="Parámetro del trayecto" style="color:#3a3ab9;"></a> <a class="leaflet-control-zoom-in fas fa-save" href="#" title="salvaguardar" style="color:#3a3ab9;"></a> <input type="file" id="file" title="Ouvrir" style="display: none;"> <a class="leaflet-control-zoom-in fas fa-folder-open" href="#" title="Abrir" style="color:#ffd228;"></a> <a class="leaflet-control-zoom-in fas fa-trash-alt" href="#" title="Suprimir todo" style="color:#4c4c4c;"></a> <a class="leaflet-control-zoom-in fas fa-cog" href="#" title="Parámetro" style="color:#4c4c4c;"></a> </div>');
  1184. $('#havenBagSetting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <h4 class="modal-title" id="myModalLabel">Zaap : </h4> </div><div class="modal-body"> <label>Zaap d\'arrivée :</label> <select class="form-control" id="sel1"> <option value=\'{"map": "4,-19", "mapid": "84674563"}\'>Astrub | 4,-19</option> <option value=\'{"map": "-32,-56", "mapid": "147768"}\'>Bonta | -32,-56</option> <option value=\'{"map": "-26,35", "mapid": "144419"}\'>Brâkmar | -26,35</option> <option value=\'{"map": "-1,13", "mapid": "88212746"}\'>Amakna (Bord de la forêt maléfique) | -1,13</option> <option value=\'{"map": "3,-5", "mapid": "68552706"}\'>Amakna (Château d\'Amakna) | 3,-5</option> <option value=\'{"map": "5,7", "mapid": "88082704"}\'>Amakna (Coins des Bouftous) | 5,7</option> <option value=\'{"map": "7,-4", "mapid": "68419587"}\'>Amakna (Port de Madrestam) | 7,-4</option> <option value=\'{"map": "-2,0", "mapid": "88213271"}\'>Amakna (Village d\'Amakna) | -2,0</option> <option value=\'{"map": "-1,24", "mapid": "88212481"}\'>Amakna (Plaîne des Scarafeuilles) | -1,24</option> <option value=\'{"map": "10,22", "mapid": "88085249"}\'>Baie de Sufokia (Rivage Sufokien) | 10,22</option> <option value=\'{"map": "13,26", "mapid": "95422468"}\'>Baie de Sufokia (Sufokia) | 13,26</option> <option value=\'{"map": "-46,18", "mapid": "154642"}\'>Île d\'Otomaïl (Village côtier) | -46,18</option> <option value=\'{"map": "-79,-41", "mapid": "54172969"}\'>Île de Frigost (La Bourgade) | -79,-41</option> <option value=\'{"map": "-77,-73", "mapid": "54172489"}\'>Île de Frigost (Village enseveli) | -77,-73</option> <option value=\'{"map": "35,12", "mapid": "156762120"}\'>Île de Moon (Plage de la Tortue) | 35,12</option> <option value=\'{"map": "-16,1", "mapid": "73400320"}\'>Montagne des Koalaks (Village des Eleveurs) | -16,1</option> <option value=\'{"map": "26,-37", "mapid": "13605"}\'>Pandala Neutre (Faubourgs de Pandala) | 26,-37</option> <option value=\'{"map": "29,-49", "mapid": "15153"}\'>Pandala Feu (Village de Feudala) | 29,-49</option> <option value=\'{"map": "-27,-36", "mapid": "142087694"}\'>Plaine de Cania (Champs de Cania) | -27,-36</option> <option value=\'{"map": "-3,-42", "mapid": "156240386"}\'>Plaine de Cania (Lac de Cania) | -3,-42</option> <option value=\'{"map": "-13,-28", "mapid": "165152263"}\'>Plaine de Cania (Massif de Cania) | -13,-28</option> <option value=\'{"map": "-5,-23", "mapid": "84806401"}\'>Plaine de Cania (Plaine des Porkass) | -5,-23</option> <option value=\'{"map": "-17,-47", "mapid": "147590153"}\'>Plaine de Cania (Plaines Rocheuses) | -17,-47</option> <option value=\'{"map": "-20,-20", "mapid": "164364304"}\'>Plaine de Cania (Route Rocailleuse) | -20,-20</option> <option value=\'{"map": "15,-58", "mapid": "173278210"}\'>Saharach (Dunes des ossements) | 15,-58</option> <option value=\'{"map": "-25,12", "mapid": "171967506"}\'>Landes de Sidimote (Route des Roulottes) | -25,12</option> </select> </div><div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button> <button type="button" class="btn btn-primary">Valider</button> </div></div></div>');
  1185. $('#pathSetting').empty().append(' <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Parámetro del trayecto</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"> <a href="#informationTab" aria-controls="informationTab" role="tab" data-toggle="tab">Información</a> </li><li role="presentation"> <a href="#fightTab" aria-controls="fightTab" role="tab" data-toggle="tab">Lucha</a> </li><li role="presentation"> <a href="#gatherTab" aria-controls="gatherTab" role="tab" data-toggle="tab">Cosechar</a> </li><li role="presentation"> <a href="#bankTab" aria-controls="bankTab" role="tab" data-toggle="tab">Banco</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="informationTab"> <br/> <div class="row no-gutters"> <div class="col col-sm-2"> <p>Nombre :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" id="file-name-field"> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Zona :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Astrub" id="area-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Tipo :</p></div><div class="col col-sm-10"> <select class="form-control" id="type-field"> <option disabled selected value></option> <option>Lucha</option> <option>Desplazamiento</option> <option>Cosechar</option> </select> </div><p></p></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Versión :</p></div><div class="col col-sm-10"> <input type="number" value="1.0" step="0.1" class="form-control" id="version-field"> </div></div><div class="row no-gutters"> <div class="col col-sm-2"> <p>Autora :</p></div><div class="col col-sm-10"> <input type="text" class="form-control" placeholder="Drigtime" id="author-field"> </div></div><br></div><div role="tabpanel" class="tab-pane" id="fightTab"> <br/> <div class="row"> <div class="col col-sm-5"> <p>Número mínimo de monstruos : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="1" id="min-monster" class="=" form-control> </div></div><div class="row"> <div class="col col-sm-5"> <p>Número máximo de monstruos : </p></div><div class="col col-sm-7"> <input type="number" max="8" min="1" value="8" id="max-monster" class="=" form-control> </div></div><br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Monstruos entredicho</div><div class="panel-body"> <div class="col col-sm-5"> <p>Lista monstruos que hay que evitar : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="forbidden-ennemy-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Monstruos obligatorio</div><div class="panel-body"> <div class="col col-sm-5"> <p>Lista monstruos que hay que tener : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="mendatory-ennemy-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/monstres.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div><div role="tabpanel" class="tab-pane" id="gatherTab"> <br/> <div class="checkbox checbox-switch switch-primary"> <label> <input type="checkbox" id="open-bag-checkbox" checked=""/> <span></span> Apertura automática de las bolsas de recursos </label> </div><div class="panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Recursos para cosechar</div><div class="panel-body" id="ressources-to-gather"> <div class="row"> <div class="col col-sm-5"> <p>Lista recursos para cosechar : </p></div><div class="col col-sm-7"> <select class="form-control selectpicker" data-live-search="true" multiple data-dropup-auto="false" id="ressources-selecter"> </select> </div></div><div class="ressources-selected-summary"></div></div></div></div><div role="tabpanel" class="tab-pane" id="bankTab"> <br/><div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Objetos que hay que suprimir automáticamente</div><div class="panel-body"> <div class="col col-sm-5"> <p>Lista objetos que hay que suprimir automáticamente : </p></div><div class="col col\-sm\-6"><input type="text" class="form\-control" placeholder="ex : 101, 98 \.\.\." id="auto-delete-field"></div><div class="col col-sm-1"><a target="_blank" href="https://snowbot.eu/objets.txt" class="fas fa-info-circle" style="font-size: 32px; text-decoration: none"></a></div></div></div></div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Validar</button> </div></div></div></div></div>');
  1186. $('#setting').empty().append('<div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="myModalLabel">Parámetro</h4> </div><div class="modal-body"> <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> <li role="presentation"> <a href="#shortcutTab" aria-controls="shortcutTab" role="tab" data-toggle="tab">Atajos</a> </li><li role="presentation" class="active"> <a href="#languageTab" aria-controls="languageTab" role="tab" data-toggle="tab">Lengua</a> </li></ul> <div class="tab-content"> <div role="tabpanel" class="tab-pane" id="shortcutTab"> <br/> <table class="table table-bordered table-hover table-condensed table-responsive"> <thead> <tr> <th> Nombre de la acción </th> <th> Atajo </th> </tr></thead> <tbody> <tr> <td> Arriba </td><td> <input type="text" class="form\-control" id="shortcut-key-up" value=" ' + GM_getValue("shortcut-key-up", "z") + ' " readonly> </td></tr><tr> <td> Abajo </td><td> <input type="text" class="form\-control" id="shortcut-key-down" value=" ' + GM_getValue("shortcut-key-down", "s") + ' " readonly> </td></tr><tr> <td> Izquierda </td><td> <input type="text" class="form\-control" id="shortcut-key-left" value=" ' + GM_getValue("shortcut-key-left", "q") + ' " readonly> </td></tr><tr> <td> Derecha </td><td> <input type="text" class="form\-control" id ="shortcut-key-right" value=" ' + GM_getValue("shortcut-key-right", "d") + ' " readonly> </td></tr><tr> <td> Merkasakos </td><td> <input type="text" class="form\-control" id="shortcut-key-havenbag" value=" ' + GM_getValue("shortcut-key-havenbag", "a") + ' " readonly> </td></tr><tr> <td> Borrar una acción </td><td> <input type="text" class="form\-control" id="shortcut-key-erase" value=" ' + GM_getValue("shortcut-key-erase", "e") + ' " readonly> </td></tr></tbody> </table> </div><div role="tabpanel" class="tab-pane active" id="languageTab"> <br/> <div class="row panel panel-default" style="margin-left: 0; margin-right: 0"> <div class="panel-heading">Lengua</div><div class="panel-body"> <select multiple class="form-control" id="language-selected"> <option value="fr">Français</option> <option value="en">English</option> <option value="es">Español</option> </select> </div></div></div><div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">Validar</button> </div></div></div></div></div></div>');
  1187. $('#ressources-selecter').empty();
  1188. for (let key in ressourcesEs) {
  1189. $('#ressources-selecter').append('<option value="' + ressourcesEs[key].itemId + '">' + ressourcesEs[key].itemName + '</option>');
  1190. }
  1191. GM_setValue("language", "es");
  1192. break;
  1193. default:
  1194. break;
  1195. }
  1196. $('#language-selected').change(function () {
  1197. languageSelector($('#language-selected').val()[0]);
  1198. });
  1199. $('#shortcut-key-up, #shortcut-key-down, #shortcut-key-left, #shortcut-key-right, #shortcut-key-havenbag, #shortcut-key-erase').focusin(function(){
  1200. $(this).val("");
  1201. switch (GM_getValue("language")) {
  1202. case "fr":
  1203. $(this).attr("placeholder", "Appuyer sur une touche");
  1204. break;
  1205. case "en":
  1206. $(this).attr("placeholder", "Press a key");
  1207. break;
  1208. case "es":
  1209. $(this).attr("placeholder", "Presione una tecla");
  1210. break;
  1211. default:
  1212. break;
  1213. }
  1214. $(this).keydown(function (evt) {
  1215. GM_setValue(this.id, evt.key);
  1216. $(this).val(GM_getValue(this.id));
  1217. });
  1218. });
  1219. $('#shortcut-key-up, #shortcut-key-down, #shortcut-key-left, #shortcut-key-right, #shortcut-key-havenbag, #shortcut-key-erase').focusout(function(){
  1220. $(this).val(GM_getValue(this.id));
  1221. });
  1222. }
  1223. languageSelector(GM_getValue("language", "fr"));
  1224.  
  1225. $('#file').change(function () {
  1226. var file = this.files[0];
  1227. var content;
  1228. var reader = new FileReader();
  1229. reader.onload = function (progressEvent) {
  1230. // Entire file
  1231. content = this.result;
  1232. let regexPath = /function move\(\)[\s\S]+?return.*?{\r\n([\s\S]+?)}\r\n.*end/g;
  1233. let regexPathLinear = /mapsWithChangeMap.?=.?{\r\n([\s\S]+?)}\r\n/g;
  1234. let regexBank = /function bank\(\)[\s\S]+?return.*?{\r\n([\s\S]+?)}\r\n.*end/g;
  1235. let regexPhenix = /function phenix\(\)[\s\S]+?return.*?{\r\n([\s\S]+?)}\r\n.*end/g;
  1236. let result;
  1237. let matche = regexBank.exec(content);
  1238. loadingFile = true;
  1239. $(".path-selecter .toggled").removeClass('toggled');
  1240. if (matche !== null) {
  1241. result = matche[1];
  1242. result = result.split('\r\n');
  1243. for (let index = 0; index < result.length; index++) {
  1244. matche = /map.?=.?"(.*?)"/g.exec(result[index]);
  1245. if (matche !== null) actualMap = matche[1];
  1246. actualMap = actualMap.replace(/,/g, ", ");
  1247. if (/(-|)[0-9]+?,\s(-|)[0-9]+?/g.exec(actualMap)) {
  1248. matche = /top/g.exec(result[index]);
  1249. if (matche !== null) $(".fa-arrow-up").addClass('toggled');
  1250. matche = /left/g.exec(result[index]);
  1251. if (matche !== null) $(".fa-arrow-left").addClass('toggled');
  1252. matche = /bottom/g.exec(result[index]);
  1253. if (matche !== null) $(".fa-arrow-down").addClass('toggled');
  1254. matche = /right/g.exec(result[index]);
  1255. if (matche !== null) $(".fa-arrow-right").addClass('toggled');
  1256. $(".path-type-selecter .toggled").removeClass('toggled');
  1257. $(".fa-university").addClass('toggled');
  1258. onMapClick();
  1259. $(".path-selecter .toggled").removeClass('toggled');
  1260. $(".path-type-selecter .toggled").removeClass('toggled');
  1261. }
  1262. }
  1263. }
  1264.  
  1265. matche = regexPathLinear.exec(content);
  1266. if (matche !== null) {
  1267. result = matche[1];
  1268. result = result.split('\r\n');
  1269. $(".fa-random").addClass('toggled');
  1270. for (let index = 0; index < result.length; index++) {
  1271. matche = /map.?=.?"(.*?)"/g.exec(result[index]);
  1272. if (matche !== null) actualMap = matche[1];
  1273. actualMap = actualMap.replace(/,/g, ", ");
  1274. if (/(-|)[0-9]+?,\s(-|)[0-9]+?/g.exec(actualMap)) {
  1275. let loadAddLinearAction = function (param) {
  1276. matche = param.exec(result[index]);
  1277. if (matche !== null) {
  1278. if (matche[1] == "top") $(".fa-arrow-up").addClass('toggled');
  1279. if (matche[1] == "left") $(".fa-arrow-left").addClass('toggled');
  1280. if (matche[1] == "bottom") $(".fa-arrow-down").addClass('toggled');
  1281. if (matche[1] == "right") $(".fa-arrow-right").addClass('toggled');
  1282. }
  1283. $(".fa-arrows-alt").addClass('toggled');
  1284. matche = /gather/g.exec(result[index]);
  1285. if (matche !== null) $(".fa-leaf").addClass('toggled');
  1286. matche = /fight/g.exec(result[index]);
  1287. if (matche !== null) $(".fa-shield-alt").addClass('toggled');
  1288. onMapClick();
  1289. $(".path-selecter .toggled").removeClass('toggled');
  1290. $(".path-type-selecter .toggled").removeClass('toggled');
  1291. };
  1292. loadAddLinearAction(/changeMap.?=.?"(.+?)"/g);
  1293. loadAddLinearAction(/nextMap.?=.?"(.+?)"/g);
  1294. loadAddLinearAction(/thirdMap.?=.?"(.+?)"/g);
  1295. loadAddLinearAction(/fourthMap.?=.?"(.+?)"/g);
  1296. }
  1297. }
  1298. $(".fa-random.toggled").removeClass('toggled');
  1299. } else if ((matche = regexPath.exec(content)) !== null) {
  1300. result = matche[1];
  1301. result = result.split('\r\n');
  1302. for (let index = 0; index < result.length; index++) {
  1303. matche = /map.?=.?"(.*?)"/g.exec(result[index]);
  1304. if (matche !== null) actualMap = matche[1];
  1305. actualMap = actualMap.replace(/,/g, ", ");
  1306. if (/(-|)[0-9]+?,\s(-|)[0-9]+?/g.exec(actualMap)) {
  1307. matche = /top/g.exec(result[index]);
  1308. if (matche !== null) $(".fa-arrow-up").addClass('toggled');
  1309. matche = /left/g.exec(result[index]);
  1310. if (matche !== null) $(".fa-arrow-left").addClass('toggled');
  1311. matche = /bottom/g.exec(result[index]);
  1312. if (matche !== null) $(".fa-arrow-down").addClass('toggled');
  1313. matche = /right/g.exec(result[index]);
  1314. if (matche !== null) $(".fa-arrow-right").addClass('toggled');
  1315. $(".fa-arrows-alt").addClass('toggled');
  1316. matche = /gather/g.exec(result[index]);
  1317. if (matche !== null) $(".fa-leaf").addClass('toggled');
  1318. matche = /fight/g.exec(result[index]);
  1319. if (matche !== null) $(".fa-shield-alt").addClass('toggled');
  1320. onMapClick();
  1321. $(".path-selecter .toggled").removeClass('toggled');
  1322. $(".path-type-selecter .toggled").removeClass('toggled');
  1323. }
  1324. }
  1325. }
  1326. matche = regexPhenix.exec(content);
  1327. if (matche !== null) {
  1328. result = matche[1];
  1329. result = result.split('\r\n');
  1330. for (let index = 0; index < result.length; index++) {
  1331. matche = /map.?=.?"(.*?)"/g.exec(result[index]);
  1332. if (matche !== null) actualMap = matche[1];
  1333. actualMap = actualMap.replace(/,/g, ", ");
  1334. if (/(-|)[0-9]+?,\s(-|)[0-9]+?/g.exec(actualMap)) {
  1335. matche = /top/g.exec(result[index]);
  1336. if (matche !== null) $(".fa-arrow-up").addClass('toggled');
  1337. matche = /left/g.exec(result[index]);
  1338. if (matche !== null) $(".fa-arrow-left").addClass('toggled');
  1339. matche = /bottom/g.exec(result[index]);
  1340. if (matche !== null) $(".fa-arrow-down").addClass('toggled');
  1341. matche = /right/g.exec(result[index]);
  1342. if (matche !== null) $(".fa-arrow-right").addClass('toggled');
  1343. $(".fa-fire").addClass('toggled');
  1344. onMapClick();
  1345. $(".path-selecter .toggled").removeClass('toggled');
  1346. $(".path-type-selecter .toggled").removeClass('toggled');
  1347. }
  1348. }
  1349. }
  1350. $(".fa-arrows-alt").addClass('toggled');
  1351. loadingFile = false;
  1352. };
  1353. reader.readAsText(file);
  1354. });
  1355.  
  1356. $(document).keydown(function (evt) {
  1357. var keyCode = evt.key;
  1358. switch (keyCode) {
  1359. case GM_getValue("shortcut-key-up", "z"):
  1360. if ($(".fa-arrow-up.toggled").length > 0)
  1361. $(".fa-arrow-up.toggled").removeClass('toggled');
  1362. else {
  1363. $(".fa-arrow-up").toggleClass('toggled');
  1364. $(".fa-suitcase.toggled").removeClass('toggled');
  1365. }
  1366. break;
  1367. case GM_getValue("shortcut-key-left", "q"):
  1368. if ($(".fa-arrow-left.toggled").length > 0)
  1369. $(".fa-arrow-left.toggled").removeClass('toggled');
  1370. else {
  1371. $(".fa-arrow-left").toggleClass('toggled');
  1372. $(".fa-suitcase.toggled").removeClass('toggled');
  1373. }
  1374. break;
  1375. case GM_getValue("shortcut-key-down", "s"):
  1376. if ($(".fa-arrow-down.toggled").length > 0)
  1377. $(".fa-arrow-down.toggled").removeClass('toggled');
  1378. else {
  1379. $(".fa-arrow-down").toggleClass('toggled');
  1380. $(".fa-suitcase.toggled").removeClass('toggled');
  1381. }
  1382. break;
  1383. case GM_getValue("shortcut-key-right", "d"):
  1384. if ($(".fa-arrow-right.toggled").length > 0)
  1385. $(".fa-arrow-right.toggled").removeClass('toggled');
  1386. else {
  1387. $(".fa-arrow-right").toggleClass('toggled');
  1388. $(".fa-suitcase.toggled").removeClass('toggled');
  1389. }
  1390. break;
  1391. case GM_getValue("shortcut-key-havenbag", "a"):
  1392. if ($(".fa-suitcase.toggled").length > 0)
  1393. $(".fa-suitcase.toggled").removeClass('toggled');
  1394. else {
  1395. $(".fa-arrow-up.toggled").removeClass('toggled');
  1396. $(".fa-arrow-left.toggled").removeClass('toggled');
  1397. $(".fa-arrow-down.toggled").removeClass('toggled');
  1398. $(".fa-arrow-right.toggled").removeClass('toggled');
  1399. $(".fa-suitcase").toggleClass('toggled');
  1400. }
  1401. break;
  1402. case GM_getValue("shortcut-key-erase", "e"):
  1403. if ($(".fa-eraser.toggled").length > 0)
  1404. $(".fa-eraser.toggled").removeClass('toggled');
  1405. else {
  1406. $(".fa-eraser").toggleClass('toggled');
  1407. }
  1408. break;
  1409. default:
  1410. break;
  1411. }
  1412. });
  1413.  
  1414. $('#havenBagSetting').on('click', '.btn-primary', function () {
  1415. let e = $('#sel1 option:selected');
  1416. var objMap = JSON.parse(e.val());
  1417. if ($(".fa-arrows-alt.toggled").length > 0 || $(".fa-leaf.toggled").length > 0 || $(".fa-shield-alt.toggled").length > 0)
  1418. havenBagData.push({
  1419. map: actualMap.split(", ")[0] + "," + actualMap.split(", ")[1],
  1420. mapToGo: objMap.map,
  1421. mapidToGo: objMap.mapid,
  1422. move: true,
  1423. });
  1424. else if ($(".fa-university.toggled").length > 0)
  1425. havenBagData.push({
  1426. map: actualMap.split(", ")[0] + "," + actualMap.split(", ")[1],
  1427. mapToGo: objMap.map,
  1428. mapidToGo: objMap.mapid,
  1429. bank: true,
  1430. });
  1431. else if ($(".fa-fire.toggled").length > 0)
  1432. havenBagData.push({
  1433. map: actualMap.split(", ")[0] + "," + actualMap.split(", ")[1],
  1434. mapToGo: objMap.map,
  1435. mapidToGo: objMap.mapid,
  1436. phenix: true
  1437. });
  1438. $('#havenBagSetting').modal('hide');
  1439. onMapClick();
  1440. });
  1441.  
  1442. $('#havenBagSetting').on('click', '.btn-secondary', function () {
  1443. havenToggle = false;
  1444. $('#havenBagSetting').modal('hide');
  1445. });
  1446.  
  1447. $('#havenBagSetting').on('click', '.close', function () {
  1448. havenToggle = false;
  1449. $('#havenBagSetting').modal('hide');
  1450. });
  1451.  
  1452. function linearActualItem(index, time) {
  1453. if (GM_getValue('language') == 'fr') {
  1454. if (pathLinearData[index].top.index == time) return 'Haut';
  1455. else if (pathLinearData[index].left.index == time) return 'Gauche';
  1456. else if (pathLinearData[index].bottom.index == time) return 'Bas';
  1457. else if (pathLinearData[index].right.index == time) return 'Droite';
  1458. else if (pathLinearData[index].havenbag.index == time) return 'Havre-sac';
  1459. } else if (GM_getValue('language') == 'en') {
  1460. if (pathLinearData[index].top.index == time) return 'Top';
  1461. else if (pathLinearData[index].left.index == time) return 'Left';
  1462. else if (pathLinearData[index].bottom.index == time) return 'Bottom';
  1463. else if (pathLinearData[index].right.index == time) return 'Right';
  1464. else if (pathLinearData[index].havenbag.index == time) return 'Havenbag';
  1465. } else if (GM_getValue('language') == 'es') {
  1466. if (pathLinearData[index].top.index == time) return 'Arriba';
  1467. else if (pathLinearData[index].left.index == time) return 'Bajo';
  1468. else if (pathLinearData[index].bottom.index == time) return 'Izquierda';
  1469. else if (pathLinearData[index].right.index == time) return 'Derecha';
  1470. else if (pathLinearData[index].havenbag.index == time) return 'Merkasako';
  1471. }
  1472. }
  1473.  
  1474. function LMap() {
  1475. if (map) {
  1476. map.on('click', onMapClick);
  1477. map.on('mousemove', function () {
  1478. for (let index = 0; index < pathLinearData.length; index++) {
  1479. if (pathLinearData[index].map == $('#mapCoordinates').text()) {
  1480. if (pathLinearData[index].index == 4) {
  1481. if (GM_getValue('language') == 'fr') {
  1482. $('#mapCoordinates').append(
  1483. '<span><br />Premiére action sur la map : ' + linearActualItem(index, 1) +
  1484. '<br />Deuxiéme action sur la map : ' + linearActualItem(index, 2) +
  1485. '<br />Troisiéme action sur la map : ' + linearActualItem(index, 3) +
  1486. '<br />Quatrième action sur la map : ' + linearActualItem(index, 4) + '</span>'
  1487. );
  1488. } else if (GM_getValue('language') == 'en') {
  1489. $('#mapCoordinates').append(
  1490. '<span><br />First action on the map : ' + linearActualItem(index, 1) +
  1491. '<br />Second action on the map : ' + linearActualItem(index, 2) +
  1492. '<br />Third action on the map : ' + linearActualItem(index, 3) +
  1493. '<br />Fourth action on the map : ' + linearActualItem(index, 4) + '</span>'
  1494. );
  1495. } else if (GM_getValue('language') == 'es') {
  1496. $('#mapCoordinates').append(
  1497. '<span><br />Primera acción en el mapa: ' + linearActualItem(index, 1) +
  1498. '<br />Segunda acción en el mapa : ' + linearActualItem(index, 2) +
  1499. '<br />Tercera acción en el mapa : ' + linearActualItem(index, 3) +
  1500. '<br />Cuarta acción en el mapa : ' + linearActualItem(index, 4) + '</span>'
  1501. );
  1502. }
  1503. } else if (pathLinearData[index].index == 3) {
  1504. if (GM_getValue('language') == 'fr') {
  1505. $('#mapCoordinates').append(
  1506. '<span><br />Premiére action sur la map : ' + linearActualItem(index, 1) +
  1507. '<br />Deuxiéme action sur la map : ' + linearActualItem(index, 2) +
  1508. '<br />Troisiéme action sur la map : ' + linearActualItem(index, 3) + '</span>'
  1509. );
  1510. } else if (GM_getValue('language') == 'en') {
  1511. $('#mapCoordinates').append(
  1512. '<span><br />First action on the map : ' + linearActualItem(index, 1) +
  1513. '<br />Second action on the map : ' + linearActualItem(index, 2) +
  1514. '<br />Third action on the map : ' + linearActualItem(index, 3) + '</span>'
  1515. );
  1516. } else if (GM_getValue('language') == 'es') {
  1517. $('#mapCoordinates').append(
  1518. '<span><br />Primera acción en el mapa: ' + linearActualItem(index, 1) +
  1519. '<br />Segunda acción en el mapa : ' + linearActualItem(index, 2) +
  1520. '<br />Tercera acción en el mapa : ' + linearActualItem(index, 3) + '</span>'
  1521. );
  1522. }
  1523. } else if (pathLinearData[index].index == 2) {
  1524. if (GM_getValue('language') == 'fr') {
  1525. $('#mapCoordinates').append(
  1526. '<span><br />Premiére action sur la map : ' + linearActualItem(index, 1) +
  1527. '<br />Deuxiéme action sur la map : ' + linearActualItem(index, 2) + '</span>'
  1528. );
  1529. } else if (GM_getValue('language') == 'en') {
  1530. $('#mapCoordinates').append(
  1531. '<span><br />First action on the map : ' + linearActualItem(index, 1) +
  1532. '<br />Second action on the map : ' + linearActualItem(index, 2) + '</span>'
  1533. );
  1534. } else if (GM_getValue('language') == 'es') {
  1535. $('#mapCoordinates').append(
  1536. '<span><br />Primera acción en el mapa: ' + linearActualItem(index, 1) +
  1537. '<br />Segunda acción en el mapa : ' + linearActualItem(index, 2) + '</span>'
  1538. );
  1539. }
  1540. } else if (pathLinearData[index].index == 1) {
  1541. if (GM_getValue('language') == 'fr') {
  1542. $('#mapCoordinates').append(
  1543. '<span><br />Premiére action sur la map : ' + linearActualItem(index, 1) + '</span>'
  1544. );
  1545. } else if (GM_getValue('language') == 'en') {
  1546. $('#mapCoordinates').append(
  1547. '<span><br />PFirst action on the map : ' + linearActualItem(index, 1) + '</span>'
  1548. );
  1549. } else if (GM_getValue('language') == 'es') {
  1550. $('#mapCoordinates').append(
  1551. '<span><br />Primera acción en el mapa: ' + linearActualItem(index, 1) + '</span>'
  1552. );
  1553. }
  1554. }
  1555. }
  1556. }
  1557. });
  1558. } else {
  1559. setTimeout(function () {
  1560. LMap();
  1561. }, 50);
  1562. }
  1563. }
  1564. LMap();
  1565.  
  1566. $('#path-creator-bar').on('click', '.fa-folder-open', function () {
  1567. $('#file').trigger('click');
  1568. });
  1569.  
  1570. $('#path-creator-bar').on('click', '.fa-trash-alt', function () {
  1571. let deleteAll = function (array) {
  1572. for (let index = 0; index < array.length; index) {
  1573. if (array[index].top)
  1574. if (array[index].top.icon) map.removeLayer(array[index].top.icon);
  1575. if (array[index].bottom)
  1576. if (array[index].bottom.icon) map.removeLayer(array[index].bottom.icon);
  1577. if (array[index].left)
  1578. if (array[index].left.icon) map.removeLayer(array[index].left.icon);
  1579. if (array[index].right)
  1580. if (array[index].right.icon) map.removeLayer(array[index].right.icon);
  1581. if (array[index].havenbag)
  1582. if (array[index].havenbag.icon) map.removeLayer(array[index].havenbag.icon);
  1583. array.splice(index, 1);
  1584. }
  1585. };
  1586. deleteAll(pathData);
  1587. deleteAll(pathLinearData);
  1588. deleteAll(bankData);
  1589. deleteAll(phenixData);
  1590. deleteAll(havenBagData);
  1591. console.clear();
  1592. });
  1593.  
  1594. $('#path-creator-bar').on('click', '.fa-eraser, .fa-random', function () {
  1595. $(this).toggleClass('toggled');
  1596. if (($('.fa-random.toggled').length > 0)) {
  1597. $('.fa-arrows-alt').toggleClass('toggled');
  1598. $('.fa-fire').removeClass("toggled");
  1599. $('.fa-fire').css("background-color", "#999");
  1600. $('.fa-fire').css("pointer-events", "none");
  1601. $('.fa-university').removeClass("toggled");
  1602. $('.fa-university').css("background-color", "#999");
  1603. $('.fa-university').css("pointer-events", "none");
  1604.  
  1605. } else {
  1606. $('.fa-fire').css("background-color", "white");
  1607. $('.fa-fire').css("pointer-events", "auto");
  1608. $('.fa-university').css("background-color", "white");
  1609. $('.fa-university').css("pointer-events", "auto");
  1610. }
  1611.  
  1612. });
  1613.  
  1614. $('#path-creator-bar').on('click', '.fa-arrows-alt, .fa-shield-alt, .fa-leaf, .fa-university, .fa-fire', function () {
  1615. $(".path-type-selecter .toggled").removeClass("toggled");
  1616. $(this).toggleClass('toggled');
  1617. if ($(".fa-fire.toggled").length > 0) {
  1618. for (let key in phenixPos) {
  1619. if (phenixPos[key].marker)
  1620. map.removeLayer(phenixPos[key].marker);
  1621. phenixPos[key].marker = undefined;
  1622. }
  1623. for (let key in phenixPos) {
  1624. phenixPos[key].marker = L.marker(dofusXYToMapXY(phenixPos[key].map.split(",")[0] * 1 + 0.5, phenixPos[key].map.split(",")[1] * 1 + 0.5), {
  1625. interactive: true,
  1626. zIndexOffset: 5000,
  1627. icon: icon.hint.phenix
  1628. }).addTo(map);
  1629. }
  1630. } else {
  1631. for (let key in phenixPos) {
  1632. if (phenixPos[key].marker)
  1633. map.removeLayer(phenixPos[key].marker);
  1634. phenixPos[key].marker = undefined;
  1635. }
  1636. }
  1637. if ($(".fa-university.toggled").length > 0) {
  1638. for (let key in bankPos) {
  1639. if (bankPos[key].marker)
  1640. map.removeLayer(bankPos[key].marker);
  1641. bankPos[key].marker = undefined;
  1642. }
  1643. for (let key in bankPos) {
  1644. bankPos[key].marker = L.marker(dofusXYToMapXY(bankPos[key].map.split(",")[0] * 1 + 0.5, bankPos[key].map.split(",")[1] * 1 + 0.5), {
  1645. interactive: true,
  1646. zIndexOffset: 5000,
  1647. icon: icon.hint.bank
  1648. }).addTo(map);
  1649. }
  1650. } else {
  1651. for (let key in bankPos) {
  1652. if (bankPos[key].marker)
  1653. map.removeLayer(bankPos[key].marker);
  1654. bankPos[key].marker = undefined;
  1655. }
  1656. }
  1657. });
  1658.  
  1659. $('#path-creator-bar').on('click', '.fa-suitcase', function () {
  1660. $(".fa-arrow-up.toggled").removeClass('toggled');
  1661. $(".fa-arrow-left.toggled").removeClass('toggled');
  1662. $(".fa-arrow-down.toggled").removeClass('toggled');
  1663. $(".fa-arrow-right.toggled").removeClass('toggled');
  1664. $(this).toggleClass('toggled');
  1665. });
  1666.  
  1667. $('#path-creator-bar').on('click', '.fa-arrow-up, .fa-arrow-down, .fa-arrow-left, .fa-arrow-right', function () {
  1668. $(".fa-suitcase.toggled").removeClass("toggled");
  1669. $(this).toggleClass('toggled');
  1670. });
  1671.  
  1672. $('#path-creator-bar').on('click', '.fa-cog', function () {
  1673. $('#setting').modal('show');
  1674. });
  1675.  
  1676. $('#path-creator-bar').on('click', '.fa-info-circle', function () {
  1677. $('#pathSetting').modal('show');
  1678. $('#ressources-selecter').selectpicker('refresh');
  1679. });
  1680.  
  1681. $("#pathSetting").on('change', '#ressources-selecter',function () {
  1682. // gatherData = $('#ressources-selecter').val();
  1683. $('#ressources-to-gather .ressources-selected-summary').empty();
  1684. $("#ressources-selecter option:selected").each(function () {
  1685. $('#ressources-to-gather .ressources-selected-summary').append('<button class="btn btn-success" style="margin: 2.5px;">' + $(this).text() + '</button>');
  1686. });
  1687. });
  1688. })();