quest_warper.txt 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142
  1. //===== eAthena Script ============================================
  2. //= Quest Warper Script
  3. //===== By: =======================================================
  4. //= Old Warper 2 by Darkchild - Remade with quest format by DZeroX
  5. //= Huge Rewrite by Neouni
  6. //===== Current Version: ==========================================
  7. //= 2.1
  8. //===== Compatible With: ==========================================
  9. //= Any eAthena Version
  10. //===== Description: ==============================================
  11. //= Warper that works only after locations are unlocked
  12. //===== Warning: ==================================================
  13. // you have to set the securitycode value [1337] the same as in
  14. // functions_kafras.txt if you changed it !!
  15. //===== Additional Comments: ======================================
  16. //= 1.0 - NPCs created
  17. //= 1.1 - Add Dungeons by sturm
  18. //= 1.2 - Add All char in account unlocked by ace_killer
  19. //= 1.3 - Add new 7 towns and 7 dungeons by escoteiro
  20. // - Correct bug jawaii town by escoteiro
  21. // - Remove some excessive warpras by escoteiro
  22. //= 1.4 - Rewrite of the Warpa system [Neouni]
  23. // - Corrected some bugs caused by autoconverting the old script
  24. //= 1.4a - Rewrite of menu to be custom for each player [Neouni]
  25. // - Dungeon listing rewrite
  26. // - Town listing rewrite
  27. // - GameMaster can Customise Main menu
  28. //= 1.4b - Pricing round [Neouni]
  29. // - GM menu added for pricing
  30. // - Town Warp pricing tags added
  31. // - Dungeon Warp pricing tags added
  32. //= 1.5 - storage functions pricing [Neouni]
  33. // - storage pricing added
  34. // - kafra points setting added
  35. // - kafra storage code security added
  36. // - Healing scripts pricing added
  37. // - Heal Part script added
  38. //= 1.6 - Dungeon warp [Neouni] (beta only)
  39. // - added option to add a extra fee for going down deeper into dungeon
  40. // partly by rebuilding the dungeon warping into variable menu's
  41. //= 1.6a - alot of fixes for beta release [Neouni] (public release)
  42. // - fixed syntax problems
  43. // - fixed missing pyramid gats in @DGat$ array
  44. // - removed the culver level 5 that didn't exist
  45. // and caused quite alot of problems (i didn't check while converting)
  46. //-1.7 - Readability of Dungeon menu building increased [Neouni]
  47. // - Thanatos Tower & Louyang Dungeon added
  48. //-1.8 - changed around unlock variables [Neouni]
  49. // - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable
  50. // (warp variables are saved in login database, so all charservers have these unlocked)
  51. // - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 !
  52. // - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 !
  53. // - (max login ##variables = 16, i used 3)
  54. // - old variables are cleared on next save
  55. // - Extra Variable clear added for every character, just in case (request by Terces)
  56. //-1.8a - Show ammount of users on map [Neouni]
  57. // - Default = off, enable in GM menu
  58. // - Requested by escoteiro
  59. //-1.8b - Small typo fixed in stampcard script [Neouni]
  60. // - Reported by escoteiro
  61. //-1.9 - Making it more edit friendly [Neouni]
  62. // - Made Dungeon warp arrays more readable & editable (QWS_Darray)
  63. // - Made town warp arrays more readable & editable (QWS_Tarray)
  64. //-2.0 - Special Warp menu added [Neouni]
  65. // - when all towns and dungeons are collected a new option on the main menu will show
  66. // - it will only show when you setup the mapname of the warp !
  67. // - requested by escoteiro
  68. // - several bugs fixed
  69. //-2.0a - Dungeon Level Limit & Split dungeon fees
  70. // - Limits dungeon based on Depth, access special setup menu thru GM-Menu
  71. // - Dungeon fees split up based on Basic , Advanced & Overseas
  72. // - Old Dungeon fee system removed, all dungeon fees now set to 0
  73. //-2.0b
  74. // - Special warpname menu option name bug fixed
  75. //-2.1
  76. // - Removed Duplicates [Silent]
  77. //=================================================================
  78. //========================Function=&=Script========================
  79. function script Q_Warpra {
  80. // Quick hack for backwards compatibility pre 1.8
  81. if (##QWS_UP < 18) callfunc "QWS_BackComp";
  82. // Extra clear variables because marker is saved on all char servers and variables can be on multiple servers
  83. if (QWS_ExtraVARClear < 18) callfunc "Extra_Variable_Clear";
  84. mes "[Warpra]";
  85. mes "Hello,";
  86. mes "I can warp you to any town or dungeon, but you need to unlock them first.";
  87. mes "To unlock them, you have to visit us.";
  88. mes "What do you need?";
  89. if(getarg(0) == 0) callfunc "QWS_MMarray",0;
  90. if(getarg(0) == 1) callfunc "QWS_MMarray",1;
  91. set @MMenu,select(@Mmenulist$[0],@Mmenulist$[1],@Mmenulist$[2],@Mmenulist$[3],@Mmenulist$[4],@Mmenulist$[5],@Mmenulist$[6],@Mmenulist$[7],@Mmenulist$[8],@Mmenulist$[9],@Mmenulist$[10],@Mmenulist$[11]);
  92. switch(@Mmenuref[@MMenu-1]+1){
  93. case 1:
  94. goto GM_Menu;
  95. case 2:
  96. warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY;
  97. close2;
  98. debugmes "Please check your special warp menu settings on the Warpra";
  99. end;
  100. case 3:
  101. goto L_town;
  102. case 4:
  103. goto L_dungeon;
  104. case 5:
  105. goto L_FewWarps;
  106. case 6:
  107. goto L_NoUnlock;
  108. case 7:
  109. goto L_heal_Full;
  110. case 8:
  111. goto L_heal_Part;
  112. case 9:
  113. goto L_Storage;
  114. case 10:
  115. goto L_GStorage;
  116. case 11:
  117. goto L_end;
  118. default:
  119. goto L_end;
  120. }
  121. //=====================GM-Menu=Functions===========================
  122. GM_Menu:
  123. next;
  124. //----------------Town-Warp
  125. if ($QW_TW_OFF == 0) mes "Town warping = ^00FF00 On ^000000";
  126. if ($QW_TW_OFF == 1) mes "Town warping = ^FF0000 Off ^000000";
  127. //----------------Dungeon-Warp
  128. if ($QW_DW_OFF == 0) mes "Dungeon warping = ^00FF00 On ^000000";
  129. if ($QW_DW_OFF == 1) mes "Dungeon warping = ^FF0000 Off ^000000";
  130. //----------------Dungeon-Depth-Limit
  131. if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000";
  132. if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000";
  133. mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000";
  134. //----------------ShowMapUsers
  135. if ($QW_MapUserShow == 1) mes "Show Map Users = ^00FF00 On ^000000";
  136. if ($QW_MapUserShow == 0) mes "Show Map Users = ^FF0000 Off ^000000";
  137. //----------------Healfull
  138. if ($QW_HF == 1) mes "Healing full = ^00FF00 On ^000000";
  139. //----------------Healpart
  140. if ($QW_HP == 1) mes "Healing partly = ^00FF00 On ^000000";
  141. if (($QW_HF == 0)&&($QW_HP == 0)) mes "Healing = ^FF0000 Off ^000000";
  142. //----------------Storage
  143. if ($QW_Stor == 1) mes "Storage = ^00FF00 On ^000000";
  144. if ($QW_Stor == 0) mes "Storage = ^FF0000 Off ^000000";
  145. //----------------GuildStorage
  146. if ($QW_GStor == 1) mes "Guild Storage = ^00FF00 On ^000000";
  147. if ($QW_GStor == 0) mes "Guild Storage = ^FF0000 Off ^000000";
  148. //----------------KafraPoints
  149. if ($QW_KPoint == 1) mes "Kafra points collect = ^00FF00 On ^000000";
  150. if ($QW_KPoint == 0) mes "Kafra points collect = ^FF0000 Off ^000000";
  151. //----------------GMmenu
  152. switch(select("Town Warping","Dungeon Warping","Dungeon Level Limit","Show Map Users","Healing full","Healing partly","Storage","Guild Storage","Kafra points collect","Set Prices","Special Warp","Exit")) {
  153. // Using callsub and a small check to not make 1 part of the script set it on and the other turning it off again
  154. case 1:
  155. if ($QW_TW_OFF == 0) {
  156. set $QW_TW_OFF,1;
  157. goto GM_Menu;
  158. } else
  159. set $QW_TW_OFF,0;
  160. goto GM_Menu;
  161. case 2:
  162. if ($QW_DW_OFF == 0) {
  163. set $QW_DW_OFF,1;
  164. goto GM_Menu;
  165. } else
  166. set $QW_DW_OFF,0;
  167. goto GM_Menu;
  168. case 3:
  169. goto DungeonLevelLimit;
  170. case 4:
  171. if ($QW_MapUserShow == 0) {
  172. set $QW_MapUserShow,1;
  173. goto GM_Menu;
  174. } else
  175. set $QW_MapUserShow,0;
  176. goto GM_Menu;
  177. case 5:
  178. if ($QW_HF == 0) {
  179. set $QW_HF,1;
  180. set $QW_HP,0;
  181. goto GM_Menu;
  182. } else
  183. set $QW_HF,0;
  184. goto GM_Menu;
  185. case 6:
  186. if ($QW_HP == 0) {
  187. set $QW_HP,1;
  188. set $QW_HF,0;
  189. goto GM_Menu;
  190. } else
  191. set $QW_HP,0;
  192. goto GM_Menu;
  193. case 7:
  194. if ($QW_Stor == 0) {
  195. set $QW_Stor,1;
  196. goto GM_Menu;
  197. } else
  198. set $QW_Stor,0;
  199. goto GM_Menu;
  200. case 8:
  201. if ($QW_GStor == 0) {
  202. set $QW_GStor,1;
  203. goto GM_Menu;
  204. } else
  205. set $QW_GStor,0;
  206. goto GM_Menu;
  207. case 9:
  208. if ($QW_KPoint == 0) {
  209. set $QW_KPoint,1;
  210. goto GM_Menu;
  211. } else
  212. set $QW_KPoint,0;
  213. goto GM_Menu;
  214. case 10:
  215. goto Setprice;
  216. case 11:
  217. goto SpecialWarpMenu;
  218. default:
  219. close;
  220. end;
  221. }
  222. //======================GM-Menu=Pricing============================
  223. Setprice:
  224. if ($QW_DW_FEE != 0) set $QW_DW_FEE,0;
  225. next;
  226. mes "Scroll thru the list to see all the options";
  227. //----------------Warp-Basic-Price
  228. if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000";
  229. if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000";
  230. //----------------Warp-Advanced-Price
  231. if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000";
  232. if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000";
  233. //----------------Warp-Oversea-Price
  234. if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000";
  235. if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000";
  236. //----------------Basic-Dungeon-Level-Warp-Fee
  237. if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level";
  238. if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  239. //----------------Advanced-Dungeon-Level-Warp-Fee
  240. if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level";
  241. if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  242. //----------------Overseas-Dungeon-Level-Warp-Fee
  243. if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level";
  244. if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  245. //----------------Heal-Full
  246. if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000";
  247. if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000";
  248. //----------------Heal-Part
  249. if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point";
  250. if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000";
  251. if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point";
  252. if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000";
  253. //----------------Storage
  254. if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000";
  255. if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000";
  256. if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000";
  257. //----------------Guild-Storage
  258. if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000";
  259. if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000";
  260. switch(select("Basic - Warps","Advanced - Warps","Overseas - Warps","Basic Dungeon warp fee","Advanced Dungeon warp fee","Overseas Dungeon warp fee","Full Healing","Part Healing","Storage","Guild Storage","Back","Exit")) {
  261. case 1:
  262. next;
  263. if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000";
  264. if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000";
  265. mes "Basic - Warps are starter towns and related dungeons";
  266. input $QW_BW_PRICE;
  267. goto Setprice;
  268. case 2:
  269. next;
  270. if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000";
  271. if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000";
  272. mes "Advanced - Warps are towns and dungeons on the same island but not close to any starter town";
  273. input $QW_AW_PRICE;
  274. goto Setprice;
  275. case 3:
  276. next;
  277. if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000";
  278. if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000";
  279. mes "Overseas - Warps are towns and dungeons overseas reachable by boat from alberta";
  280. input $QW_OW_PRICE;
  281. goto Setprice;
  282. case 4:
  283. next;
  284. if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level";
  285. if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  286. mes "Basic - Warps are starter town related dungeons";
  287. mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
  288. mes "These costs are on top of the regular Warp costs";
  289. input $QW_BW_FEE;
  290. goto Setprice;
  291. case 5:
  292. next;
  293. if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level";
  294. if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  295. mes "Advanced - Warps are dungeons not close to any starter town";
  296. mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
  297. mes "These costs are on top of the regular Warp costs";
  298. input $QW_AW_FEE;
  299. goto Setprice;
  300. case 6:
  301. next;
  302. if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level";
  303. if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level";
  304. mes "Overseas - Warps are dungeons related to towns overseas reachable by boat from alberta";
  305. mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee";
  306. mes "These costs are on top of the regular Warp costs";
  307. input $QW_OW_FEE;
  308. goto Setprice;
  309. case 7:
  310. next;
  311. if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000";
  312. if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000";
  313. mes "Instant full healing 1 price";
  314. input $QW_HF_PRICE;
  315. goto Setprice;
  316. case 8:
  317. next;
  318. if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point";
  319. if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000";
  320. if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point";
  321. if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000";
  322. mes "Healing price per 1 HP";
  323. mes "Healing price per 1 SP";
  324. mes "2 inputs, first HP then SP";
  325. input $QW_HP_H_PRICE;
  326. input $QW_HP_S_PRICE;
  327. goto Setprice;
  328. case 9:
  329. next;
  330. if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000";
  331. if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000";
  332. if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000";
  333. mes "Storage cost, if set to 60 Kafra pricing will be handled";
  334. input $QW_S_PRICE;
  335. goto Setprice;
  336. case 10:
  337. next;
  338. if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000";
  339. if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000";
  340. mes "Guild Storage, free on Guild Kafras";
  341. input $QW_GS_PRICE;
  342. goto Setprice;
  343. case 11:
  344. goto GM_Menu;
  345. default:
  346. close;
  347. end;
  348. }
  349. //======================Special=Warp=Menu==========================
  350. SpecialWarpMenu:
  351. if ($QW_SP_Warpname$ == "") set $QW_SP_Warpname$,"Special Warp";
  352. next;
  353. mes "Scroll down to see all the information";
  354. mes "The Special warp menu option will show in the main menu when all towns & dungeons are unlocked";
  355. mes "And when the map for special warping has been set";
  356. mes "menu option name set to ^0000FF"+$QW_SP_Warpname$+"^000000";
  357. if ($QW_SP_WarpMap$ == "") mes "map is currently ^FF0000not^000000 set, and Special warp menu is off";
  358. if ($QW_SP_WarpMap$ != "") mes "map is currently set to ^0000FF"+$QW_SP_WarpMap$+"^000000 and Special Warp menu is on";
  359. mes "coords are set to ^0000FF"+$QW_SP_WarpX+","+$QW_SP_WarpY+"^000000";
  360. switch(select("Set Special Warp name to show in menu", "Set WarpMap","Set Coords","Go Back to GM_Menu","Exit")){
  361. case 1:
  362. next;
  363. mes "set the name to show in the menu as option";
  364. input $QW_SP_Warpname$;
  365. goto SpecialWarpMenu;
  366. case 2:
  367. next;
  368. mes "set the map in the ^0000FFmapname.gat^000000 format";
  369. mes "when this warpmap is set the option for players will show once they meet the requirments";
  370. mes "to disable Special Warp Menu option clear this !";
  371. input $QW_SP_WarpMap$;
  372. goto SpecialWarpMenu;
  373. case 3:
  374. next;
  375. mes "First input = Xcoord";
  376. mes "Second input = Ycoord";
  377. input $QW_SP_WarpX;
  378. input $QW_SP_WarpY;
  379. goto SpecialWarpMenu;
  380. case 4:
  381. goto GM_Menu;
  382. default:
  383. close;
  384. end;
  385. }
  386. //======================Dungeon=Level=Limit========================
  387. DungeonLevelLimit:
  388. next;
  389. if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000";
  390. if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000";
  391. mes "If^00FF00 On ^000000Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000";
  392. switch(select("Toggle Dungeon Depth Limit", "Set Dungeon Depth Limit","Go Back to GM_Menu","Exit")){
  393. case 1:
  394. if ($QW_DL == 0) {
  395. set $QW_DL,1;
  396. goto DungeonLevelLimit;
  397. } else
  398. set $QW_DL,0;
  399. goto DungeonLevelLimit;
  400. case 2:
  401. next;
  402. mes "set limit of Dungeon Depth 0 = entrance";
  403. mes "Depth 1 is a map connected to 0 and so on";
  404. mes "Shortest Route to map counts as depth";
  405. input $QW_DDL;
  406. goto DungeonLevelLimit;
  407. case 3:
  408. goto GM_Menu;
  409. default:
  410. close;
  411. end;
  412. }
  413. //===========================Towns=================================
  414. L_town:
  415. callfunc "QWS_Tarray";
  416. // Expected maximum is set to 25 items, if you add more options add more ",@Tmenulist$[xx]"
  417. set @TWMenu,select(@Tmenulist$[0],@Tmenulist$[1],@Tmenulist$[2],@Tmenulist$[3],@Tmenulist$[4],@Tmenulist$[5],@Tmenulist$[6],@Tmenulist$[7],@Tmenulist$[8],@Tmenulist$[9],@Tmenulist$[10],@Tmenulist$[11],@Tmenulist$[12],@Tmenulist$[13],@Tmenulist$[14],@Tmenulist$[15],@Tmenulist$[16],@Tmenulist$[17],@Tmenulist$[18],@Tmenulist$[19],@Tmenulist$[20],@Tmenulist$[21],@Tmenulist$[22],@Tmenulist$[23],@Tmenulist$[24]);
  418. if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
  419. if(Zeny<@pTprice[@Tmenuref[@TWMenu-1]]) callsub L_Short_on_zeny,0;
  420. set Zeny, Zeny-@pTprice[@Tmenuref[@TWMenu-1]];
  421. if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@pTprice[@Tmenuref[@TWMenu-1]]/16);
  422. warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]];
  423. close2; // this part safegaurds against errors/typos
  424. set Zeny, Zeny+@pTprice[@Tmenuref[@TWMenu-1]];
  425. end;
  426. //=========================Dungeons================================
  427. L_dungeon:
  428. callfunc "QWS_Darray";
  429. // Expected maximum is set to 35 items, if you add more options add more ",@Dmenulist$[xx]"
  430. set @DWMenu,select(@Dmenulist$[0],@Dmenulist$[1],@Dmenulist$[2],@Dmenulist$[3],@Dmenulist$[4],@Dmenulist$[5],@Dmenulist$[6],@Dmenulist$[7],@Dmenulist$[8],@Dmenulist$[9],@Dmenulist$[10],@Dmenulist$[11],@Dmenulist$[12],@Dmenulist$[13],@Dmenulist$[14],@Dmenulist$[15],@Dmenulist$[16],@Dmenulist$[17],@Dmenulist$[18],@Dmenulist$[19],@Dmenulist$[20],@Dmenulist$[21],@Dmenulist$[22],@Dmenulist$[23],@Dmenulist$[24],@Dmenulist$[25],@Dmenulist$[26],@Dmenulist$[27],@Dmenulist$[28],@Dmenulist$[29],@Dmenulist$[30],@Dmenulist$[31],@Dmenulist$[32],@Dmenulist$[33],@Dmenulist$[34]);
  431. if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex
  432. set @DwarpMenu, (@Dmenuref[@DWMenu-1]);
  433. callfunc "QWS_DLarray";
  434. next;
  435. mes "[Warpra]";
  436. mes "Please select where you want to go";
  437. // Expected maximum is set to 18 items, if you have dungeons with more levels add more ",@DWLmenulist$[xx]"
  438. set @DWLMenu,select(@DWLmenulist$[0], @DWLmenulist$[1], @DWLmenulist$[2], @DWLmenulist$[3], @DWLmenulist$[4], @DWLmenulist$[5], @DWLmenulist$[6], @DWLmenulist$[7], @DWLmenulist$[8], @DWLmenulist$[9], @DWLmenulist$[10], @DWLmenulist$[11], @DWLmenulist$[12], @DWLmenulist$[13], @DWLmenulist$[14], @DWLmenulist$[15], @DWLmenulist$[16], @DWLmenulist$[17]);
  439. if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex
  440. set @Darrayref, @DWLmenuref[@DWLMenu-1];
  441. set @warpprice, @pDprice[@Dmenuref[@DWMenu-1]]+(getd(@pDfee$[@Dmenuref[@DWMenu-1]])*(@DDepth[@Darrayref]));
  442. if(Zeny<@warpprice) callsub L_Short_on_zeny,1;
  443. set Zeny, Zeny-(@warpprice);
  444. if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@warpprice/16);
  445. warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref];
  446. close2; // this part safegaurds against errors/typos
  447. set Zeny, Zeny+@pTprice[@Tmenuref[@DWMenu-1]];
  448. end;
  449. //=============================Healing=============================
  450. L_heal_Full:
  451. set @healfee, $QW_HF_PRICE;
  452. if(Zeny<@healfee) callsub L_Short_on_zeny,4;
  453. set Zeny, Zeny-@healfee;
  454. if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@healfee/500);
  455. next;
  456. mes "[Warpra]";
  457. mes "Close this window and I will Heal you.";
  458. close2;
  459. percentheal 100,100;
  460. end;
  461. L_heal_Part:
  462. set @healchoice,select("Full heal","Health Points only","Skill Points only","Exit");
  463. if (@healchoice == 1) callsub PHeal,1,1;
  464. if (@healchoice == 2) callsub PHeal,1,0;
  465. if (@healchoice == 3) callsub PHeal,0,1;
  466. goto L_end;
  467. PHeal:
  468. next;
  469. set @Hp, MaxHp-Hp;
  470. set @Sp, MaxSp-Sp;
  471. set @HpPrice, @hp*$QW_HP_H_PRICE;
  472. set @SpPrice, @sp*$QW_HP_S_PRICE;
  473. mes "[Warpra]";
  474. if(getarg(0) == 1) mes ""+@HpPrice+" Zeny for "+@Hp+" health points";
  475. if(getarg(1) == 1) mes ""+@SpPrice+" Zeny for "+@Sp+" skill points";
  476. set @total, @HpPrice+@SpPrice;
  477. mes "for a total of "+@total+" zeny";
  478. if (select("Heal me","Let me see the choices again")==2) goto L_heal_Part;
  479. if(getarg(0) == 1)set @HpPrice, (MaxHp-Hp)*$QW_HP_H_PRICE;
  480. if(getarg(1) == 1)set @SpPrice, (MaxSp-Sp)*$QW_HP_S_PRICE;
  481. set @healfee, @HpPrice+@SpPrice;
  482. if (getarg(0) == 1)&&(getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_Short_Both;
  483. if (getarg(0) == 1)&&(Zeny<@healfee) goto Zeny_short_HP;
  484. if (getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_short_SP;
  485. set Zeny, Zeny-@healfee;
  486. if (getarg(0) == 1)&&(getarg(1) == 1) percentheal 100,100;
  487. if (getarg(0) == 1) percentheal 100,0;
  488. if (getarg(1) == 1) percentheal 0,100;
  489. close;
  490. end;
  491. Zeny_Short_Both:
  492. mes "[Warpra]";
  493. mes "choose another option, you can afford both.";
  494. mes "I can heal as much as you can afford too.";
  495. if (select("OK","Exit") == 2) goto L_end;
  496. goto PHeal;
  497. Zeny_short_HP:
  498. mes "[Warpra]";
  499. mes "do you want me to partly heal your HP ?";
  500. if (select("Yes","No") == 2) goto L_end;
  501. set @Hp, Zeny/$QW_HP_H_PRICE;
  502. set @HpPrice, @Hp*$QW_HP_H_PRICE;
  503. if (@Hp == 1) mes "your not worth the effort";
  504. if (@Hp == 1) goto L_end;
  505. set Zeny, Zeny-@HpPrice;
  506. heal @Hp,0;
  507. close;
  508. end;
  509. Zeny_short_SP:
  510. mes "[Warpra]";
  511. mes "do you want me to partly heal your SP ?";
  512. if (select("Yes","No") == 2) goto L_end;
  513. set @Sp, Zeny/$QW_HP_S_PRICE;
  514. set @SpPrice, @Sp*$QW_HP_S_PRICE;
  515. if (@Sp == 1) mes "your not worth the effort";
  516. if (@Sp == 1) goto L_end;
  517. set Zeny, Zeny-@SpPrice;
  518. heal 0,@Sp;
  519. close;
  520. end;
  521. //=============================Storage=============================
  522. L_Storage:
  523. next;
  524. if(basicskillcheck(0) > 0 && getskilllv(1) < 6) goto L_StorageJBlow;
  525. set @fee, $QW_S_PRICE;
  526. if ($QW_S_PRICE == 60)&&(BaseJob == Job_Novice) set @fee, 30;
  527. if ($QW_S_PRICE == 60)&&(BaseJob != Job_Novice) set @fee, 60;
  528. if(Zeny<@fee) callsub L_Short_on_zeny,2;
  529. set Zeny, Zeny-@fee;
  530. if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@fee/5);
  531. mes "[Warpra]";
  532. mes "Close this window and i will open your storage.";
  533. callsub F_CheckKafCode; //check your storage password thru kafra coding, if set
  534. close2;
  535. openstorage;
  536. end;
  537. F_CheckKafCode:
  538. // you have to set the 1337 value the same as in functions_kafras.txt if you changed it !!
  539. if(#kafra_code==0) return;
  540. mes "Enter your storage password:";
  541. set @code_,0;
  542. input @code_;
  543. if(@code_ != #kafra_code-getcharid(3)-1337) {
  544. dispbottom "Wrong storage password.";
  545. close;
  546. }
  547. set @kafcode_try,0;
  548. set @code_,0;
  549. return;
  550. L_StorageJBlow:
  551. mes "[Warpra]";
  552. mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage.";
  553. return;
  554. L_GStorage:
  555. if(@GID==0) goto L_NoGuild;
  556. if(Zeny<$QW_GS_PRICE) callsub L_Short_on_zeny,3;
  557. set Zeny, Zeny-$QW_GS_PRICE;
  558. if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + ($QW_GS_PRICE/5);
  559. next;
  560. mes "[Warpra]";
  561. mes "Close this window and i will open the ^5533FF" + GetGuildName(@GID) + "^000000 storage.";
  562. close2;
  563. guildopenstorage;
  564. end;
  565. L_NoGuild:
  566. next;
  567. mes "[Warpra]";
  568. mes "You are not a part of a guild I can't help you.";
  569. close;
  570. end;
  571. L_end:
  572. close;
  573. end;
  574. //============================Few=Warp=============================
  575. L_FewWarps:
  576. next;
  577. mes "[Warpra ]";
  578. mes "You need to unlock locations before they come available to you.";
  579. mes "To unlock a location talk to my colleagues all over the world.";
  580. mes "Each account got it's own stamp card.";
  581. mes "Want me to check what stamps you have collected so far ?.";
  582. if (select("Yes","No")==1) callsub stampcard;
  583. close;
  584. end;
  585. //============================No=Unlock============================
  586. L_NoUnlock:
  587. next;
  588. mes "[Warpra ]";
  589. mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place.";
  590. close;
  591. end;
  592. //=========================Short=On=Zeny===========================
  593. L_Short_on_zeny:
  594. next;
  595. if (getarg(0) == 0) mes "you don't seem to have "+@pTprice[@Tmenuref[@TWMenu-1]]+" zeny, to pay for the warp fee to "+@pTmenuitems$[@Tmenuref[@TWMenu-1]]+"";
  596. if (getarg(0) == 1) mes "you don't seem to have "+@warpprice+" zeny, to pay for the warp fee to "+@DLevelName$[@DWLmenuref[@DWLMenu-1]]+" at "+@pDmenuitems$[@Dmenuref[@DWMenu-1]]+"";
  597. if (getarg(0) == 2) mes "you don't seem to have "+@fee+" zeny, to pay for the storage fee";
  598. if (getarg(0) == 3) mes "you don't seem to have "+$QW_GS_PRICE+" zeny, to pay for the guild storage fee";
  599. if (getarg(0) == 4) mes "you don't seem to have "+@healfee+" zeny, to pay for your healing";
  600. close;
  601. end;
  602. //===========================Stamp=Card============================
  603. stampcard:
  604. // Counting of the ammount of places you have unlocked
  605. next;
  606. mes "Let me check what Towns you have";
  607. callfunc "QWS_TownStamps";
  608. mes "you collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns.";
  609. if (@Tstamp == 15) mes "They say there is an island you can only get to when married";
  610. if (@Tstamp == 15) emotion 18;
  611. next;
  612. mes "Let me check what dungeons you have";
  613. callfunc "QWS_DungeonStamps";
  614. mes "you collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons";
  615. mes "To unlock a dungeon, search for my colleague.";
  616. mes "You can usually find them near the middle or end of the dungeon";
  617. return;
  618. }
  619. function script QWS_TownStamps {
  620. set @Tstamp,0;
  621. set @MaxTstamp,21; //maximum number of towns
  622. set @binvalue,1;
  623. set @Tstamploop,0;
  624. do {
  625. if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1;
  626. set @binvalue, @binvalue *2;
  627. set @Tstamploop, @Tstamploop + 1;
  628. }while (@Tstamploop < @MaxTstamp);
  629. return;
  630. }
  631. function script QWS_DungeonStamps {
  632. set @Dstamp,0;
  633. set @MaxDstamp,29; //maximum number of dungeons
  634. set @binvalue,1;
  635. set @Dstamploop,0;
  636. do {
  637. if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1;
  638. set @binvalue, @binvalue *2;
  639. set @Dstamploop, @Dstamploop + 1;
  640. }while (@Dstamploop < @MaxDstamp);
  641. return;
  642. }
  643. //======================Main=Menu=Array============================
  644. function script QWS_MMarray {
  645. // Currently 9 items
  646. setarray @pMmenuitems$[0], "GameMaster Menu", $QW_SP_Warpname$, "Warp to Towns", "Warp to Dungeons", "Why so few Warps ?", "Why don't you Unlock this location ?", "Heal", "Heal", "Storage", "Guild Storage", "Cancel";
  647. set @Mi,0; // That's our loop counter.
  648. set @Mj,0; // That's the menu lines counter.
  649. //----------------GameMaster-Menu
  650. if (getgmlevel(80)) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  651. if (getgmlevel(80)) set @Mmenuref[@Mj],@Mi;
  652. if (getgmlevel(80)) set @Mj,@Mj+1;
  653. set @Mi,@Mi+1;
  654. //----------------Special-Warp
  655. callfunc "QWS_TownStamps";
  656. callfunc "QWS_DungeonStamps";
  657. if (@Tstamp == @MaxTstamp)&&(@Dstamp == @MaxDstamp)&&($QW_SP_WarpMap$ != "") {
  658. set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  659. set @Mmenuref[@Mj],@Mi;
  660. set @Mj,@Mj+1;
  661. }
  662. set @Mi,@Mi+1;
  663. //----------------Town-Warp
  664. if ($QW_TW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  665. if ($QW_TW_OFF == 0) set @Mmenuref[@Mj],@Mi;
  666. if ($QW_TW_OFF == 0) set @Mj,@Mj+1;
  667. set @Mi,@Mi+1;
  668. //----------------Dungeon-Warp
  669. if ($QW_DW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  670. if ($QW_DW_OFF == 0) set @Mmenuref[@Mj],@Mi;
  671. if ($QW_DW_OFF == 0) set @Mj,@Mj+1;
  672. set @Mi,@Mi+1;
  673. //----------------Why-So-Few-Warps
  674. set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  675. set @Mmenuref[@Mj],@Mi;
  676. set @Mj,@Mj+1;
  677. set @Mi,@Mi+1;
  678. //----------------No-Unlock
  679. if (getarg(0) == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  680. if (getarg(0) == 1) set @Mmenuref[@Mj],@Mi;
  681. if (getarg(0) == 1) set @Mj,@Mj+1;
  682. set @Mi,@Mi+1;
  683. //----------------Healfull
  684. if ($QW_HF == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  685. if ($QW_HF == 1) set @Mmenuref[@Mj],@Mi;
  686. if ($QW_HF == 1) set @Mj,@Mj+1;
  687. set @Mi,@Mi+1;
  688. //----------------Healpart
  689. if ($QW_HP == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  690. if ($QW_HP == 1) set @Mmenuref[@Mj],@Mi;
  691. if ($QW_HP == 1) set @Mj,@Mj+1;
  692. set @Mi,@Mi+1;
  693. //----------------Storage
  694. if ($QW_Stor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  695. if ($QW_Stor == 1) set @Mmenuref[@Mj],@Mi;
  696. if ($QW_Stor == 1) set @Mj,@Mj+1;
  697. set @Mi,@Mi+1;
  698. //----------------GuildStorage
  699. if ($QW_GStor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  700. if ($QW_GStor == 1) set @Mmenuref[@Mj],@Mi;
  701. if ($QW_GStor == 1) set @Mj,@Mj+1;
  702. set @Mi,@Mi+1;
  703. //----------------Cancel
  704. set @Mmenulist$[@Mj],@pMmenuitems$[@Mi];
  705. set @Mmenuref[@Mj],@Mi;
  706. return;
  707. }
  708. //======================Town=Menu=Array============================
  709. //----------------Prontera // I do this to find back sections quickly altho almost the same name is a line below it now
  710. // setarray @pTmenuitems$[@Ti], "Prontera"; // Name of Town shown in Town select Menu
  711. // setarray @pTprice[@Ti], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE)
  712. //
  713. // setarray @pTmap$[@Ti], "prontera.gat"; // mapfilename of town
  714. // setarray @pTXcoords[@Ti], 156; // X warp coords
  715. // setarray @pTYcoords[@Ti], 187; // Y warp coords
  716. //
  717. // QWS_Make_Town_Menu XXX;
  718. //
  719. // the full wap commands send out by this script for these example would be
  720. //warp example_01.gat 123 123
  721. //
  722. // use the same XXX number as you used when making your own town warpra
  723. // Read below how
  724. //
  725. // example:
  726. //
  727. //syntax:
  728. //mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{
  729. //
  730. // Full example using fake map & coords
  731. //
  732. //example_01.gat,213,213,4 script Warpra 112,{
  733. // callfunc "QWS_Town_Warpra",XXX,"A FAKE TOWN FOR EXAMPLE";
  734. // close;
  735. // }
  736. // use a free number for XXX, last used is 20, for Yuno
  737. function script QWS_Tarray {
  738. function QWS_Make_Town_Menu;
  739. set @Ti,0; // That's our loop counter.
  740. set @Tj,0; // That's the menu lines counter.
  741. //----------------Prontera
  742. setarray @pTmenuitems$[@Ti], "Prontera";
  743. setarray @pTprice[@Ti], $QW_BW_PRICE;
  744. setarray @pTmap$[@Ti], "prontera.gat";
  745. setarray @pTXcoords[@Ti], 156;
  746. setarray @pTYcoords[@Ti], 187;
  747. QWS_Make_Town_Menu 0;
  748. //----------------Alberta
  749. setarray @pTmenuitems$[@Ti], "Alberta";
  750. setarray @pTprice[@Ti], $QW_BW_PRICE;
  751. setarray @pTmap$[@Ti], "alberta.gat";
  752. setarray @pTXcoords[@Ti], 27;
  753. setarray @pTYcoords[@Ti], 236;
  754. QWS_Make_Town_Menu 1;
  755. //----------------Aldebaran
  756. setarray @pTmenuitems$[@Ti], "Aldebaran";
  757. setarray @pTprice[@Ti], $QW_AW_PRICE;
  758. setarray @pTmap$[@Ti], "aldebaran.gat";
  759. setarray @pTXcoords[@Ti], 145;
  760. setarray @pTYcoords[@Ti], 120;
  761. QWS_Make_Town_Menu 2;
  762. //----------------Amatsu:
  763. setarray @pTmenuitems$[@Ti], "Amatsu";
  764. setarray @pTprice[@Ti], $QW_OW_PRICE;
  765. setarray @pTmap$[@Ti], "amatsu.gat";
  766. setarray @pTXcoords[@Ti], 197;
  767. setarray @pTYcoords[@Ti], 86;
  768. QWS_Make_Town_Menu 3;
  769. //----------------Ayothaya:
  770. setarray @pTmenuitems$[@Ti], "Ayothaya";
  771. setarray @pTprice[@Ti], $QW_OW_PRICE;
  772. setarray @pTmap$[@Ti], "ayothaya.gat";
  773. setarray @pTXcoords[@Ti], 150;
  774. setarray @pTYcoords[@Ti], 57;
  775. QWS_Make_Town_Menu 4;
  776. //----------------Comodo:
  777. setarray @pTmenuitems$[@Ti], "Comodo";
  778. setarray @pTprice[@Ti], $QW_AW_PRICE;
  779. setarray @pTmap$[@Ti], "comodo.gat";
  780. setarray @pTXcoords[@Ti], 188;
  781. setarray @pTYcoords[@Ti], 161;
  782. QWS_Make_Town_Menu 5;
  783. //----------------Einbech:
  784. setarray @pTmenuitems$[@Ti], "Einbech";
  785. setarray @pTprice[@Ti], $QW_AW_PRICE;
  786. setarray @pTmap$[@Ti], "einbech.gat";
  787. setarray @pTXcoords[@Ti], 172;
  788. setarray @pTYcoords[@Ti], 126;
  789. QWS_Make_Town_Menu 6;
  790. //----------------Einbroch:
  791. setarray @pTmenuitems$[@Ti], "Einbroch";
  792. setarray @pTprice[@Ti], $QW_AW_PRICE;
  793. setarray @pTmap$[@Ti], "einbroch.gat";
  794. setarray @pTXcoords[@Ti], 230;
  795. setarray @pTYcoords[@Ti], 191;
  796. QWS_Make_Town_Menu 7;
  797. //----------------Geffen:
  798. setarray @pTmenuitems$[@Ti], "Geffen";
  799. setarray @pTprice[@Ti], $QW_BW_PRICE;
  800. setarray @pTmap$[@Ti], "geffen.gat";
  801. setarray @pTXcoords[@Ti], 119;
  802. setarray @pTYcoords[@Ti], 66;
  803. QWS_Make_Town_Menu 8;
  804. //----------------Gonryun:
  805. setarray @pTmenuitems$[@Ti], "Gonryun";
  806. setarray @pTprice[@Ti], $QW_OW_PRICE;
  807. setarray @pTmap$[@Ti], "gonryun.gat";
  808. setarray @pTXcoords[@Ti], 150;
  809. setarray @pTYcoords[@Ti], 130;
  810. QWS_Make_Town_Menu 9;
  811. //----------------Hugel:
  812. setarray @pTmenuitems$[@Ti], "Hugel";
  813. setarray @pTprice[@Ti], $QW_AW_PRICE;
  814. setarray @pTmap$[@Ti], "hugel.gat";
  815. setarray @pTXcoords[@Ti], 95;
  816. setarray @pTYcoords[@Ti], 121;
  817. QWS_Make_Town_Menu 10;
  818. //----------------Izlude:
  819. setarray @pTmenuitems$[@Ti], "Izlude";
  820. setarray @pTprice[@Ti], $QW_BW_PRICE;
  821. setarray @pTmap$[@Ti], "izlude.gat";
  822. setarray @pTXcoords[@Ti], 128;
  823. setarray @pTYcoords[@Ti], 111;
  824. QWS_Make_Town_Menu 11;
  825. //----------------Jawaii:
  826. setarray @pTmenuitems$[@Ti], "Jawaii";
  827. setarray @pTprice[@Ti], $QW_AW_PRICE;
  828. setarray @pTmap$[@Ti], "jawaii.gat";
  829. setarray @pTXcoords[@Ti], 243;
  830. setarray @pTYcoords[@Ti], 115;
  831. QWS_Make_Town_Menu 12;
  832. //----------------Lighthalzen:
  833. setarray @pTmenuitems$[@Ti], "Lighthalzen";
  834. setarray @pTprice[@Ti], $QW_AW_PRICE;
  835. setarray @pTmap$[@Ti], "lighthalzen.gat";
  836. setarray @pTXcoords[@Ti], 158;
  837. setarray @pTYcoords[@Ti], 110;
  838. QWS_Make_Town_Menu 13;
  839. //----------------Louyang:
  840. setarray @pTmenuitems$[@Ti], "Louyang";
  841. setarray @pTprice[@Ti], $QW_OW_PRICE;
  842. setarray @pTmap$[@Ti], "louyang.gat";
  843. setarray @pTXcoords[@Ti], 210;
  844. setarray @pTYcoords[@Ti], 108;
  845. QWS_Make_Town_Menu 14;
  846. //----------------Lutie
  847. setarray @pTmenuitems$[@Ti], "Lutie";
  848. setarray @pTprice[@Ti], $QW_AW_PRICE;
  849. setarray @pTmap$[@Ti], "xmas.gat";
  850. setarray @pTXcoords[@Ti], 148;
  851. setarray @pTYcoords[@Ti], 131;
  852. QWS_Make_Town_Menu 15;
  853. //----------------Morroc:
  854. setarray @pTmenuitems$[@Ti], "Morroc";
  855. setarray @pTprice[@Ti], $QW_BW_PRICE;
  856. setarray @pTmap$[@Ti], "morocc.gat";
  857. setarray @pTXcoords[@Ti], 159;
  858. setarray @pTYcoords[@Ti], 93;
  859. QWS_Make_Town_Menu 16;
  860. //----------------Niflheim:
  861. setarray @pTmenuitems$[@Ti], "Niflheim";
  862. setarray @pTprice[@Ti], $QW_AW_PRICE;
  863. setarray @pTmap$[@Ti], "niflheim.gat";
  864. setarray @pTXcoords[@Ti], 195;
  865. setarray @pTYcoords[@Ti], 186;
  866. QWS_Make_Town_Menu 17;
  867. //----------------Payon:
  868. setarray @pTmenuitems$[@Ti], "Payon";
  869. setarray @pTprice[@Ti], $QW_BW_PRICE;
  870. setarray @pTmap$[@Ti], "payon.gat";
  871. setarray @pTXcoords[@Ti], 152;
  872. setarray @pTYcoords[@Ti], 75;
  873. QWS_Make_Town_Menu 18;
  874. //----------------Umbala:
  875. setarray @pTmenuitems$[@Ti], "Umbala";
  876. setarray @pTprice[@Ti], $QW_AW_PRICE;
  877. setarray @pTmap$[@Ti], "umbala.gat";
  878. setarray @pTXcoords[@Ti], 130;
  879. setarray @pTYcoords[@Ti], 130;
  880. QWS_Make_Town_Menu 19;
  881. //----------------Yuno:
  882. setarray @pTmenuitems$[@Ti], "Yuno";
  883. setarray @pTprice[@Ti], $QW_AW_PRICE;
  884. setarray @pTmap$[@Ti], "yuno.gat";
  885. setarray @pTXcoords[@Ti], 160;
  886. setarray @pTYcoords[@Ti], 168;
  887. QWS_Make_Town_Menu 20;
  888. //----------------Cancel
  889. setarray @pTmenuitems$[@Ti], "Cancel";
  890. setarray @pTprice[@Ti], 0;
  891. set @Tmenulist$[@Tj],@pTmenuitems$[@Ti];
  892. set @Tmenuref[@Tj],57005; // 57005='dead' in hex
  893. return;
  894. //----------------Make Town Menu Function
  895. function QWS_Make_Town_Menu {
  896. set @temptownmenubin,1;
  897. if (getarg(0) == 0) goto menu_item;
  898. set @templooptownmenu,0;
  899. do {
  900. set @temptownmenubin, @temptownmenubin * 2;
  901. set @templooptownmenu, @templooptownmenu + 1;
  902. }while (getarg(0) > @templooptownmenu);
  903. // check marker and make menu item
  904. menu_item:
  905. if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) {
  906. set @Ti,@Ti+1;
  907. return;
  908. }
  909. if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti];
  910. if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti];
  911. if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti];
  912. if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]";
  913. set @Tmenuref[@Tj],@Ti;
  914. set @Tj,@Tj+1;
  915. set @Ti,@Ti+1;
  916. return;
  917. }
  918. }
  919. //====================Dungeon=Menu=Arrays==========================
  920. //----------------A FAKE DUNGEON FOR EXAMPLE // I do this to find back sections quickly altho almost the same name is a line below it now
  921. // setarray @pDmenuitems$[@Di], "Fake Dungeon"; // Name of Dungeon shown in Dungeon select Menu
  922. // setarray @pDprice[@Di], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE)
  923. // setarray @pDfee$[@Di], "$QW_BW_FEE"; // Identifyer for the Dungeon fee caluclation (Basic ("$QW_BW_FEE"), Advanced ("$QW_AW_FEE"), Overseas ("$QW_OW_FEE")) please use setting in relation with option above (Don't forget "")
  924. // setarray @DLevels[@Di], 2; //number of levels in dungeon (very important if set to high will shift all leveldata!!)
  925. //
  926. // setarray @DGat$[@Dref], "example_01.gat", "example_02.gat"; // mapfilename of dungeon level
  927. // setarray @DLevelName$[@Dref], "Example Level 1", "Example Level 2"; // level name shown in dungeon level select
  928. // setarray @DXcoords[@Dref], 123, 234; // X warp coords
  929. // setarray @DYcoords[@Dref], 123, 234;// Y warp coords
  930. // setarray @DDepth[@Dref], 0, 1; // relative depth to entrance to calculate extra warp fee
  931. //
  932. // QWS_Make_Dungeon_Menu XXX
  933. //
  934. // the full wap commands send out by this scripts for these examples would be
  935. // for Example Level 1:
  936. //warp example_01.gat 123 123
  937. //
  938. // for Example Level 2:
  939. //warp example_02.gat 234 234
  940. //
  941. // use the same XXX number as you used when making your own dungeon unlocker (Warpra Helper) inside the dungeon
  942. // (usually half way near a warp to next level)
  943. // Read below how
  944. //
  945. // example:
  946. //
  947. //syntax:
  948. //mapname.gat,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{
  949. //
  950. // Full example using fake map & coords
  951. //
  952. //example_01.gat,213,213,4 script Warpra Helper 112,{
  953. // callfunc "QWS_Dungeon_Warpra",XXX,"A FAKE DUNGEON FOR EXAMPLE";
  954. // close;
  955. // }
  956. // use a free number for XXX, last used is 28, for Kiel Dungeon
  957. function script QWS_Darray {
  958. function QWS_Make_Dungeon_Menu;
  959. set @Di,0;
  960. set @Dj,0;
  961. set @Dref,0;
  962. //----------------ABYSS LAKE
  963. setarray @pDmenuitems$[@Di], "Abyss Lake";
  964. setarray @pDprice[@Di], $QW_AW_PRICE;
  965. setarray @pDfee$[@Di], "$QW_AW_FEE";
  966. setarray @DLevels[@Di], 3;
  967. setarray @DGat$[@Dref], "abyss_01.gat", "abyss_02.gat", "abyss_03.gat";
  968. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  969. setarray @DXcoords[@Dref], 265, 275, 116;
  970. setarray @DYcoords[@Dref], 273, 270, 27;
  971. setarray @DDepth[@Dref], 0, 1, 2;
  972. QWS_Make_Dungeon_Menu 0;
  973. //----------------AMATSU DUNGEON
  974. setarray @pDmenuitems$[@Di], "Amatsu Dungeon";
  975. setarray @pDprice[@Di], $QW_OW_PRICE;
  976. setarray @pDfee$[@Di], "$QW_OW_FEE";
  977. setarray @DLevels[@Di], 3;
  978. setarray @DGat$[@Dref], "ama_dun01.gat", "ama_dun02.gat", "ama_dun03.gat";
  979. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  980. setarray @DXcoords[@Dref], 227, 32, 119;
  981. setarray @DYcoords[@Dref], 10, 43, 15;
  982. setarray @DDepth[@Dref], 0, 1, 2;
  983. QWS_Make_Dungeon_Menu 1;
  984. //----------------ANT HELL
  985. setarray @pDmenuitems$[@Di], "Ant Hell Dungeon";
  986. setarray @pDprice[@Di], $QW_BW_PRICE;
  987. setarray @pDfee$[@Di], "$QW_BW_FEE";
  988. setarray @DLevels[2], 2;
  989. setarray @DGat$[@Dref], "anthell01.gat", "anthell02.gat";
  990. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  991. setarray @DXcoords[@Dref], 32, 34;
  992. setarray @DYcoords[@Dref], 262, 263;
  993. setarray @DDepth[@Dref], 0, 1;
  994. QWS_Make_Dungeon_Menu 2;
  995. //----------------AYOTAYA
  996. setarray @pDmenuitems$[@Di], "Ayotaya Dungeon";
  997. setarray @pDprice[@Di], $QW_OW_PRICE;
  998. setarray @pDfee$[@Di], "$QW_OW_FEE";
  999. setarray @DLevels[3], 2;
  1000. setarray @DGat$[@Dref], "ayo_dun01.gat", "ayo_dun02.gat";
  1001. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1002. setarray @DXcoords[@Dref], 275, 150;
  1003. setarray @DYcoords[@Dref], 17, 13;
  1004. setarray @DDepth[@Dref], 0, 1;
  1005. QWS_Make_Dungeon_Menu 3;
  1006. //----------------BYALAN
  1007. setarray @pDmenuitems$[@Di], "Byalan Dungeon";
  1008. setarray @pDprice[@Di], $QW_BW_PRICE;
  1009. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1010. setarray @DLevels[4], 5;
  1011. setarray @DGat$[@Dref], "iz_dun00.gat", "iz_dun01.gat", "iz_dun02.gat", "iz_dun03.gat", "iz_dun04.gat";
  1012. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
  1013. setarray @DXcoords[@Dref], 168, 41, 236, 32, 26;
  1014. setarray @DYcoords[@Dref], 168, 37, 204, 63, 27;
  1015. setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
  1016. QWS_Make_Dungeon_Menu 4;
  1017. //----------------CLOCK TOWER
  1018. setarray @pDmenuitems$[@Di], "Clock Tower Dungeon";
  1019. setarray @pDprice[@Di], $QW_AW_PRICE;
  1020. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1021. setarray @DLevels[5], 8;
  1022. setarray @DGat$[@Dref], "c_tower1.gat", "c_tower2.gat", "c_tower3.gat", "c_tower4.gat", "alde_dun01.gat", "alde_dun02.gat", "alde_dun03.gat", "alde_dun04.gat";
  1023. setarray @DLevelName$[@Dref], "Clock Tower Level 1", "Clock Tower Level 2", "Clock Tower Level 3", "Clock Tower Level 4", "Basement 1F", "Basement 2F", "Basement 3F", "Basement 4F";
  1024. setarray @DXcoords[@Dref], 200, 268, 64, 32, 197, 262, 276, 130;
  1025. setarray @DYcoords[@Dref], 163, 26, 148, 63, 25, 41, 53, 130;
  1026. setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2, 3, 4;
  1027. QWS_Make_Dungeon_Menu 5;
  1028. //----------------COAL MINE
  1029. setarray @pDmenuitems$[@Di], "Coal Mine Dungeon";
  1030. setarray @pDprice[@Di], $QW_AW_PRICE;
  1031. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1032. setarray @DLevels[6], 3;
  1033. setarray @DGat$[@Dref], "mjo_dun01.gat", "mjo_dun02.gat", "mjo_dun03.gat";
  1034. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  1035. setarray @DXcoords[@Dref], 52, 381, 302;
  1036. setarray @DYcoords[@Dref], 17, 343, 261;
  1037. setarray @DDepth[@Dref], 0, 1, 2;
  1038. QWS_Make_Dungeon_Menu 6;
  1039. //----------------CULVERT
  1040. setarray @pDmenuitems$[@Di], "Culvert Dungeon";
  1041. setarray @pDprice[@Di], $QW_BW_PRICE;
  1042. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1043. setarray @DLevels[7], 4;
  1044. setarray @DGat$[@Dref], "prt_sewb1.gat", "prt_sewb2.gat", "prt_sewb3.gat", "prt_sewb4.gat";
  1045. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
  1046. setarray @DXcoords[@Dref], 132, 19, 180, 100;
  1047. setarray @DYcoords[@Dref], 248, 19, 169, 92;
  1048. setarray @DDepth[@Dref], 0, 1, 2, 3;
  1049. QWS_Make_Dungeon_Menu 7;
  1050. //----------------EINBECH DUNGEON
  1051. setarray @pDmenuitems$[@Di], "Einbech Dungeon";
  1052. setarray @pDprice[@Di], $QW_AW_PRICE;
  1053. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1054. setarray @DLevels[8], 2;
  1055. setarray @DGat$[@Dref], "ein_dun01.gat", "ein_dun02.gat";
  1056. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1057. setarray @DXcoords[@Dref], 22, 292;
  1058. setarray @DYcoords[@Dref], 14, 290;
  1059. setarray @DDepth[@Dref], 0, 1;
  1060. QWS_Make_Dungeon_Menu 8;
  1061. //----------------GEFENIA DUNGEON
  1062. setarray @pDmenuitems$[@Di], "Gefenia Dungeon";
  1063. setarray @pDprice[@Di], $QW_BW_PRICE;
  1064. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1065. setarray @DLevels[9], 4;
  1066. setarray @DGat$[@Dref], "gefenia01.gat", "gefenia02.gat", "gefenia03.gat", "gefenia04.gat";
  1067. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
  1068. setarray @DXcoords[@Dref], 59, 201, 264, 33;
  1069. setarray @DYcoords[@Dref], 167, 35, 236, 270;
  1070. setarray @DDepth[@Dref], 0, 1, 2, 3;
  1071. QWS_Make_Dungeon_Menu 9;
  1072. //----------------GEFFEN DUNGEON
  1073. setarray @pDmenuitems$[@Di], "Geffen Dungeon";
  1074. setarray @pDprice[@Di], $QW_BW_PRICE;
  1075. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1076. setarray @DLevels[@Di], 4;
  1077. setarray @DGat$[@Dref], "gef_dun00.gat", "gef_dun01.gat", "gef_dun02.gat", "gef_dun03.gat";
  1078. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4";
  1079. setarray @DXcoords[@Dref], 104, 115, 106, 203;
  1080. setarray @DYcoords[@Dref], 100, 236, 132, 200;
  1081. setarray @DDepth[@Dref], 0, 1, 2, 3;
  1082. QWS_Make_Dungeon_Menu 10;
  1083. //----------------GLAST HEIM
  1084. setarray @pDmenuitems$[@Di], "Glast Heim Dungeon";
  1085. setarray @pDprice[@Di], $QW_BW_PRICE;
  1086. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1087. setarray @DLevels[@Di], 17;
  1088. setarray @DGat$[@Dref], "glast_01.gat", "gl_church.gat", "gl_chyard.gat", "gl_in01.gat", "gl_cas01.gat", "gl_cas02.gat", "gl_knt01.gat", "gl_knt02.gat", "gl_prison.gat", "gl_prison1.gat", "gl_step.gat", "gl_sew01.gat", "gl_sew02.gat", "gl_sew03.gat", "gl_sew04.gat", "gl_dun01.gat", "gl_dun02.gat";
  1089. setarray @DLevelName$[@Dref], "Glast Heim Entrance", "St. Abbey", "Churchyard", "Inside Glast Heim", "Castle 1", "Castle 2", "Chivalry 1", "Chivalry 2", "Prison 1", "Prison 2", "Steps", "Sewers 1", "Sewers 2", "Sewers 3", "Sewers 4", "Lowest Cave 1", "Lowest Cave 2";
  1090. setarray @DXcoords[@Dref], 370, 156, 147, 121, 199, 104, 150, 157, 14, 150, 117, 258, 108, 171, 68, 133, 224;
  1091. setarray @DYcoords[@Dref], 300, 8, 15, 59, 29, 25, 10, 287, 70, 14, 124, 255, 291, 273, 277, 271, 274;
  1092. setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6;
  1093. QWS_Make_Dungeon_Menu 11;
  1094. //----------------GONRYUN DUNGEON
  1095. setarray @pDmenuitems$[@Di], "Gonryun Dungeon";
  1096. setarray @pDprice[@Di], $QW_OW_PRICE;
  1097. setarray @pDfee$[@Di], "$QW_OW_FEE";
  1098. setarray @DLevels[@Di], 3;
  1099. setarray @DGat$[@Dref], "gon_dun01.gat", "gon_dun02.gat", "gon_dun03.gat";
  1100. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  1101. setarray @DXcoords[@Dref], 143, 17, 68;
  1102. setarray @DYcoords[@Dref], 59, 114, 9;
  1103. setarray @DDepth[@Dref], 0, 1, 2;
  1104. QWS_Make_Dungeon_Menu 12;
  1105. //----------------HIDDEN DUNGEON
  1106. setarray @pDmenuitems$[@Di], "Hidden Dungeon";
  1107. setarray @pDprice[@Di], $QW_BW_PRICE;
  1108. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1109. setarray @DLevels[@Di], 3;
  1110. setarray @DGat$[@Dref], "prt_maze01.gat", "prt_maze02.gat", "prt_maze03.gat";
  1111. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  1112. setarray @DXcoords[@Dref], 176, 94, 23;
  1113. setarray @DYcoords[@Dref], 6, 19, 8;
  1114. setarray @DDepth[@Dref], 0, 1, 2;
  1115. QWS_Make_Dungeon_Menu 13;
  1116. //----------------JUPEROS CAVE
  1117. setarray @pDmenuitems$[@Di], "Juperos Cave";
  1118. setarray @pDprice[@Di], $QW_AW_PRICE;
  1119. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1120. setarray @DLevels[@Di], 2;
  1121. setarray @DGat$[@Dref], "juperos_01.gat", "juperos_02.gat";
  1122. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1123. setarray @DXcoords[@Dref], 53, 36;
  1124. setarray @DYcoords[@Dref], 247, 60;
  1125. setarray @DDepth[@Dref], 0, 1;
  1126. QWS_Make_Dungeon_Menu 14;
  1127. //----------------KIEL DUNGEON
  1128. setarray @pDmenuitems$[@Di], "Kiel Dungeon";
  1129. setarray @pDprice[@Di], $QW_AW_PRICE;
  1130. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1131. setarray @DLevels[@Di], 2;
  1132. setarray @DGat$[@Dref], "kh_dun01.gat", "kh_dun02.gat";
  1133. setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor";
  1134. setarray @DXcoords[@Dref], 63, 42;
  1135. setarray @DYcoords[@Dref], 10, 197;
  1136. setarray @DDepth[@Dref], 0, 1;
  1137. QWS_Make_Dungeon_Menu 28;
  1138. //----------------LIGHTHALZEN BIO LAB
  1139. setarray @pDmenuitems$[@Di], "Lighthalzen Bio Lab";
  1140. setarray @pDprice[@Di], $QW_AW_PRICE;
  1141. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1142. setarray @DLevels[@Di], 3;
  1143. setarray @DGat$[@Dref], "lhz_dun01.gat", "lhz_dun02.gat", "lhz_dun03.gat";
  1144. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3";
  1145. setarray @DXcoords[@Dref], 150, 150, 140;
  1146. setarray @DYcoords[@Dref], 287, 18, 137;
  1147. setarray @DDepth[@Dref], 0, 1, 2;
  1148. QWS_Make_Dungeon_Menu 15;
  1149. //----------------LOUYANG DUNGEON
  1150. setarray @pDmenuitems$[@Di], "Louyang Dungeon";
  1151. setarray @pDprice[@Di], $QW_OW_PRICE;
  1152. setarray @pDfee$[@Di], "$QW_OW_FEE";
  1153. setarray @DLevels[@Di], 2;
  1154. setarray @DGat$[@Dref], "lou_dun02.gat", "lou_dun03.gat";
  1155. setarray @DLevelName$[@Dref], "Royal Tomb Level 1", "Royal Tomb Level 2";
  1156. setarray @DXcoords[@Dref], 282, 165;
  1157. setarray @DYcoords[@Dref], 20, 38;
  1158. setarray @DDepth[@Dref], 0, 1;
  1159. QWS_Make_Dungeon_Menu 16;
  1160. //----------------MAGMA DUNGEON
  1161. setarray @pDmenuitems$[@Di], "Magma Dungeon";
  1162. setarray @pDprice[@Di], $QW_AW_PRICE;
  1163. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1164. setarray @DLevels[@Di], 2;
  1165. setarray @DGat$[@Dref], "mag_dun01.gat", "mag_dun02.gat";
  1166. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1167. setarray @DXcoords[@Dref], 126, 47;
  1168. setarray @DYcoords[@Dref], 69, 32;
  1169. setarray @DDepth[@Dref], 0, 1;
  1170. QWS_Make_Dungeon_Menu 17;
  1171. //----------------ODIN TEMPLE
  1172. setarray @pDmenuitems$[@Di], "Odin Temple";
  1173. setarray @pDprice[@Di], $QW_AW_PRICE;
  1174. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1175. setarray @DLevels[@Di], 1;
  1176. setarray @DGat$[@Dref], "odin_tem01.gat";
  1177. setarray @DLevelName$[@Dref], "Level 1";
  1178. setarray @DXcoords[@Dref], 96;
  1179. setarray @DYcoords[@Dref], 145;
  1180. setarray @DDepth[@Dref], 0;
  1181. QWS_Make_Dungeon_Menu 18;
  1182. //----------------ORC DUNGEON
  1183. setarray @pDmenuitems$[@Di], "Orc Dungeon";
  1184. setarray @pDprice[@Di], $QW_BW_PRICE;
  1185. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1186. setarray @DLevels[@Di], 2;
  1187. setarray @DGat$[@Dref], "orcsdun01.gat", "orcsdun02.gat";
  1188. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1189. setarray @DXcoords[@Dref], 32, 21;
  1190. setarray @DYcoords[@Dref], 169, 185;
  1191. setarray @DDepth[@Dref], 0, 1;
  1192. QWS_Make_Dungeon_Menu 19;
  1193. //----------------PAYON DUNGEON
  1194. setarray @pDmenuitems$[@Di], "Payon Dungeon";
  1195. setarray @pDprice[@Di], $QW_BW_PRICE;
  1196. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1197. setarray @DLevels[@Di], 5;
  1198. setarray @DGat$[@Dref], "pay_dun00.gat", "pay_dun01.gat", "pay_dun02.gat", "pay_dun03.gat", "pay_dun04.gat";
  1199. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
  1200. setarray @DXcoords[@Dref], 22, 19, 19, 155, 201;
  1201. setarray @DYcoords[@Dref], 180, 33, 63, 159, 204;
  1202. setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
  1203. QWS_Make_Dungeon_Menu 20;
  1204. //----------------PYRAMIDS
  1205. setarray @pDmenuitems$[@Di], "Pyramids Dungeon";
  1206. setarray @pDprice[@Di], $QW_BW_PRICE;
  1207. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1208. setarray @DLevels[@Di], 6;
  1209. setarray @DGat$[@Dref], "moc_pryd01.gat", "moc_pryd02.gat", "moc_pryd03.gat", "moc_pryd04.gat", "moc_pryd05.gat", "moc_pryd06.gat";
  1210. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2";
  1211. setarray @DXcoords[@Dref], 192, 10, 100, 181, 94, 192;
  1212. setarray @DYcoords[@Dref], 9, 192, 92, 11, 96, 8;
  1213. setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2;
  1214. QWS_Make_Dungeon_Menu 21;
  1215. //----------------SPHINX
  1216. setarray @pDmenuitems$[@Di], "Sphinx Dungeon";
  1217. setarray @pDprice[@Di], $QW_BW_PRICE;
  1218. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1219. setarray @DLevels[@Di], 5;
  1220. setarray @DGat$[@Dref], "in_sphinx1.gat", "in_sphinx2.gat", "in_sphinx3.gat", "in_sphinx4.gat", "in_sphinx5.gat";
  1221. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5";
  1222. setarray @DXcoords[@Dref], 192, 149, 210, 10, 100;
  1223. setarray @DYcoords[@Dref], 9, 81, 54, 222, 99;
  1224. setarray @DDepth[@Dref], 0, 1, 2, 3, 4;
  1225. QWS_Make_Dungeon_Menu 22;
  1226. //----------------SUNKEN SHIP
  1227. setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon";
  1228. setarray @pDprice[@Di], $QW_BW_PRICE;
  1229. setarray @pDfee$[@Di], "$QW_BW_FEE";
  1230. setarray @DLevels[@Di], 2;
  1231. setarray @DGat$[@Dref], "treasure01.gat", "treasure02.gat";
  1232. setarray @DLevelName$[@Dref], "Level 1", "Level 2";
  1233. setarray @DXcoords[@Dref], 69, 102;
  1234. setarray @DYcoords[@Dref], 24, 27;
  1235. setarray @DDepth[@Dref], 0, 1;
  1236. QWS_Make_Dungeon_Menu 23;
  1237. //----------------THANATOS TOWER
  1238. setarray @pDmenuitems$[@Di], "Thanatos Tower";
  1239. setarray @pDprice[@Di], $QW_AW_PRICE;
  1240. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1241. setarray @DLevels[@Di], 13;
  1242. setarray @DGat$[@Dref], "tha_t01.gat", "tha_t02.gat", "tha_t03.gat", "tha_t04.gat", "tha_t05.gat", "tha_t06.gat", "tha_t07.gat", "tha_t08.gat", "tha_t09.gat", "tha_t10.gat", "tha_t11.gat", "tha_t12.gat", "thana_boss.gat";
  1243. setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5", "Level 6", "Level 7", "Level 8", "Level 9", "Level 10", "Level 11", "Level 12", "Thanatos Boss";
  1244. setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85;
  1245. setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76;
  1246. setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;
  1247. QWS_Make_Dungeon_Menu 24;
  1248. //----------------TOY FACTORY
  1249. setarray @pDmenuitems$[@Di], "Toy Factory Dungeon";
  1250. setarray @pDprice[@Di], $QW_AW_PRICE;
  1251. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1252. setarray @DLevels[@Di], 2;
  1253. setarray @DGat$[@Dref], "xmas_dun01.gat", "xmas_dun02.gat";
  1254. setarray @DLevelName$[@Dref], "Factory Warehouse", "Classifying Room";
  1255. setarray @DXcoords[@Dref], 205, 129;
  1256. setarray @DYcoords[@Dref], 16, 133;
  1257. setarray @DDepth[@Dref], 0, 1;
  1258. QWS_Make_Dungeon_Menu 25;
  1259. //----------------TURTLE ISTLAND
  1260. setarray @pDmenuitems$[@Di], "Turtle Island Dungeon";
  1261. setarray @pDprice[@Di], $QW_AW_PRICE;
  1262. setarray @pDfee$[@Di], "$QW_AW_FEE";
  1263. setarray @DLevels[@Di], 4;
  1264. setarray @DGat$[@Dref], "tur_dun01.gat", "tur_dun02.gat", "tur_dun03.gat", "tur_dun04.gat";
  1265. setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3";
  1266. setarray @DXcoords[@Dref], 161, 148, 132, 100;
  1267. setarray @DYcoords[@Dref], 34, 256, 190, 192;
  1268. setarray @DDepth[@Dref], 0, 0, 1, 2;
  1269. QWS_Make_Dungeon_Menu 26;
  1270. //----------------UMBALA
  1271. setarray @pDmenuitems$[@Di], "Umbala Dungeon";
  1272. setarray @pDprice[@Di], $QW_OW_PRICE;
  1273. setarray @pDfee$[@Di], "$QW_OW_FEE";
  1274. setarray @DLevels[@Di], 3;
  1275. setarray @DGat$[@Dref], "um_dun01.gat", "um_dun02.gat", "yggdrasil01.gat";
  1276. setarray @DLevelName$[@Dref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain";
  1277. setarray @DXcoords[@Dref], 205, 48, 40;
  1278. setarray @DYcoords[@Dref], 16, 30, 63;
  1279. setarray @DDepth[@Dref], 0, 1, 2;
  1280. QWS_Make_Dungeon_Menu 27;
  1281. //----------------Cancel
  1282. setarray @pDmenuitems$[@Di], "Cancel";
  1283. setarray @pDprice[@Di], 0;
  1284. set @Dmenulist$[@Dj],@pDmenuitems$[@Di];
  1285. set @Dmenuref[@Dj],57005; // 57005='dead' in hex
  1286. return;
  1287. //----------------Make Dungeon Menu Function
  1288. function QWS_Make_Dungeon_Menu {
  1289. set @tempdungeonmenubin,1;
  1290. if (getarg(0) == 0) goto menu_item;
  1291. set @temploopdungeonmenu,0;
  1292. do {
  1293. set @tempdungeonmenubin, @tempdungeonmenubin * 2;
  1294. set @temploopdungeonmenu, @temploopdungeonmenu + 1;
  1295. }while (getarg(0) > @temploopdungeonmenu);
  1296. // check marker and make menu item
  1297. menu_item:
  1298. if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) {
  1299. setarray @DLocRef[@Di], @Dref;
  1300. set @Dref, @Dref+@DLevels[@Di];
  1301. set @Di,@Di+1;
  1302. return;
  1303. }
  1304. if ($QW_MapUserShow == 1) {
  1305. set @tempmapusers,0;
  1306. set @mapusersloop,0;
  1307. do {
  1308. set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers);
  1309. set @mapusersloop, (@mapusersloop + 1);
  1310. }while (@DLevels[@Di] > @mapusersloop);
  1311. if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di];
  1312. if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]";
  1313. set @Dmenuref[@Dj],@Di;
  1314. set @Dj,@Dj+1;
  1315. setarray @DLocRef[@Di], @Dref;
  1316. set @Dref, @Dref+@DLevels[@Di];
  1317. set @Di,@Di+1;
  1318. return;
  1319. }
  1320. if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di];
  1321. if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di];
  1322. set @Dmenuref[@Dj],@Di;
  1323. set @Dj,@Dj+1;
  1324. setarray @DLocRef[@Di], @Dref;
  1325. set @Dref, @Dref+@DLevels[@Di];
  1326. set @Di,@Di+1;
  1327. return;
  1328. }
  1329. }
  1330. function script QWS_DLarray {
  1331. //----------------Start building Menu
  1332. set @DWref,@DLocRef[@DwarpMenu]; // That's our reference to the arrays with leveldata.
  1333. set @DWi,0; // That's our loop counter.
  1334. set @DWj,0; // That's the menu lines counter.
  1335. cleararray @DWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu
  1336. do {
  1337. if ($QW_DL == 0)||($QW_DDL >= @DDepth[@DWref]) {
  1338. set @warpprice, (@pDprice[@DwarpMenu]+ (getd(@pDfee$[@DwarpMenu])*@DDepth[@DWref]));
  1339. if (@warpprice != 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice;
  1340. if (@warpprice == 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref];
  1341. if (@warpprice != 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice;
  1342. if (@warpprice == 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]";
  1343. set @DWLmenuref[@DWj],@DWref;
  1344. set @DWj,@DWj+1;
  1345. }
  1346. set @DWref, @DWref+1;
  1347. set @DWi,@DWi+1;
  1348. }while (@DWi < @DLevels[@DwarpMenu]);
  1349. set @DWLmenulist$[@DWj], "Exit";
  1350. set @DWLmenuref[@DWj],57005; // 57005='dead' in hex
  1351. return;
  1352. }
  1353. //=================Backwards=Compatibility=Pre=1.8=================
  1354. function script QWS_BackComp {
  1355. // reference where i put the towns: "Prontera"[0], "Alberta"[1], "Aldebaran"[2], "Amatsu"[3], "Ayothaya"[4], "Comodo"[5], "Einbech"[6], "Einbroch"[7], "Geffen"[8], "Gonryun"[9], "Hugel"[10], "Izlude"[11], "Jawaii"[12], "Lighthalzen"[13], "Louyang"[14], "Lutie"[15], "Morroc"[16], "Niflheim"[17], "Payon"[18], "Umbala"[19], "Yuno"[20];
  1356. // reference where i put the dungeons: "Abyss Lake"[0], "Amatsu Dungeon"[1], "Ant Hell Dungeon"[2], "Ayotaya Dungeon"[3], "Byalan Dungeon"[4], "Clock Tower Dungeon"[5], "Coal Mine Dungeon"[6], "Culvert Dungeon"[7], "Einbech Dungeon"[8], "Gefenia Dungeon"[9], "Geffen Dungeon"[10], "Glast Heim Dungeon"[11], "Gonryun Dungeon"[12], "Hidden Dungeon"[13], "Juperos Cave"[14], "Lighthalzen Bio Lab"[15], "Louyang Dungeon"[16], "Magma Dungeon"[17], "Odin Temple"[18], "Orc Dungeon"[19], "Payon Dungeon"[20], "Pyramids Dungeon"[21], "Sphinx Dungeon"[22], "Sunken Ship Dungeon"[23], "Thanatos Tower"[24], "Toy Factory Dungeon"[25], "Turtle Island Dungeon"[26], "Umbala Dungeon"[27], "Kiel Dungeon[28];
  1357. // also clears variables so that the account file variables can be used for something else variable 0 = variable delete on next save
  1358. // Towns
  1359. set @towntemp,0;
  1360. if (#prontera != 0) set @towntemp,@towntemp + 1;
  1361. if (#alberta != 0) set @towntemp,@towntemp + 2;
  1362. if (#aldebaran != 0) set @towntemp,@towntemp + 4;
  1363. if (#amatsu != 0) set @towntemp,@towntemp + 8;
  1364. if (#ayotaya != 0) set @towntemp,@towntemp + 16;
  1365. if (#comodo != 0) set @towntemp,@towntemp + 32;
  1366. if (#einbech != 0) set @towntemp,@towntemp + 64;
  1367. if (#einbroch != 0) set @towntemp,@towntemp + 128;
  1368. if (#geffen != 0) set @towntemp,@towntemp + 256;
  1369. if (#gonryun != 0) set @towntemp,@towntemp + 512;
  1370. if (#hugel != 0) set @towntemp,@towntemp + 1024;
  1371. if (#izlude != 0) set @towntemp,@towntemp + 2048;
  1372. if (#jawaii != 0) set @towntemp,@towntemp + 4096;
  1373. if (#lighthalzen != 0) set @towntemp,@towntemp + 8192;
  1374. if (#louyang != 0) set @towntemp,@towntemp + 16384;
  1375. if (#xmas != 0) set @towntemp,@towntemp + 32768;
  1376. if (#morocc != 0) set @towntemp,@towntemp + 65536;
  1377. if (#niflheim != 0) set @towntemp,@towntemp + 131072;
  1378. if (#payon != 0) set @towntemp,@towntemp + 262144;
  1379. if (#umbala != 0) set @towntemp,@towntemp + 524288;
  1380. if (#yuno != 0) set @towntemp,@towntemp + 1048576;
  1381. // Clear Town variables
  1382. set #prontera,0;
  1383. set #alberta,0;
  1384. set #aldebaran,0;
  1385. set #amatsu,0;
  1386. set #ayotaya,0;
  1387. set #comodo,0;
  1388. set #einbech,0;
  1389. set #einbroch,0;
  1390. set #geffen,0;
  1391. set #gonryun,0;
  1392. set #hugel,0;
  1393. set #izlude,0;
  1394. set #jawaii,0;
  1395. set #lighthalzen,0;
  1396. set #louyang,0;
  1397. set #xmas,0;
  1398. set #morocc,0;
  1399. set #niflheim,0;
  1400. set #payon,0;
  1401. set #umbala,0;
  1402. set #yuno,0;
  1403. // set Town warp unlock variable
  1404. set ##QWS_T_Unlock, (##QWS_T_Unlock | @towntemp);
  1405. //because multiple account servers now stack on 1 variable i used a 'or' to stack them
  1406. // Dungeons
  1407. set @dungeontemp,0;
  1408. if (#abyss != 0) set @dungeontemp,@dungeontemp + 1;
  1409. if (#ama_dun != 0) set @dungeontemp,@dungeontemp + 2;
  1410. if (#anthell != 0) set @dungeontemp,@dungeontemp + 4;
  1411. if (#ayotaya_dun != 0) set @dungeontemp,@dungeontemp + 8;
  1412. if (#iz_dun != 0) set @dungeontemp,@dungeontemp + 16;
  1413. if (#c_tower != 0) set @dungeontemp,@dungeontemp + 32;
  1414. if (#mjo_dun != 0) set @dungeontemp,@dungeontemp + 64;
  1415. if (#prt_sewb != 0) set @dungeontemp,@dungeontemp + 128;
  1416. if (#einbech_dun != 0) set @dungeontemp,@dungeontemp + 256;
  1417. if (#gefenia != 0) set @dungeontemp,@dungeontemp + 512;
  1418. if (#gef_dun != 0) set @dungeontemp,@dungeontemp + 1024;
  1419. if (#gl_dun != 0) set @dungeontemp,@dungeontemp + 2048;
  1420. if (#gon_dun != 0) set @dungeontemp,@dungeontemp + 4096;
  1421. if (#hid_dun != 0) set @dungeontemp,@dungeontemp + 8192;
  1422. if (#juperos != 0) set @dungeontemp,@dungeontemp + 16384;
  1423. if (#lighthalzen_dun != 0) set @dungeontemp,@dungeontemp + 32768;
  1424. if (#louyang_dun != 0) set @dungeontemp,@dungeontemp + 65536;
  1425. if (#mag_dun != 0) set @dungeontemp,@dungeontemp + 131072;
  1426. if (#odintemple != 0) set @dungeontemp,@dungeontemp + 262144;
  1427. if (#orcsdun != 0) set @dungeontemp,@dungeontemp + 524288;
  1428. if (#pay_dun != 0) set @dungeontemp,@dungeontemp + 1048576;
  1429. if (#moc_pryd != 0) set @dungeontemp,@dungeontemp + 2097152;
  1430. if (#in_sphinx != 0) set @dungeontemp,@dungeontemp + 4194304;
  1431. if (#treasure != 0) set @dungeontemp,@dungeontemp + 8388608;
  1432. if (#thanatos_tower != 0) set @dungeontemp,@dungeontemp + 16777216;
  1433. if (#xmas_dun != 0) set @dungeontemp,@dungeontemp + 33554432;
  1434. if (#tur_dun != 0) set @dungeontemp,@dungeontemp + 67108864;
  1435. if (#um_dun != 0) set @dungeontemp,@dungeontemp + 134217728;
  1436. // Clear Dungeon variables
  1437. set #abyss,0;
  1438. set #ama_dun,0;
  1439. set #anthell,0;
  1440. set #ayotaya_dun,0;
  1441. set #iz_dun,0;
  1442. set #c_tower,0;
  1443. set #mjo_dun,0;
  1444. set #prt_sewb,0;
  1445. set #einbech_dun,0;
  1446. set #gefenia,0;
  1447. set #gef_dun,0;
  1448. set #gl_dun,0;
  1449. set #gon_dun,0;
  1450. set #hid_dun,0;
  1451. set #juperos,0;
  1452. set #lighthalzen_dun,0;
  1453. set #louyang_dun,0;
  1454. set #mag_dun,0;
  1455. set #odintemple,0;
  1456. set #orcsdun,0;
  1457. set #pay_dun,0;
  1458. set #moc_pryd,0;
  1459. set #in_sphinx,0;
  1460. set #treasure,0;
  1461. set #thanatos_tower,0;
  1462. set #xmas_dun,0;
  1463. set #tur_dun,0;
  1464. set #um_dun,0;
  1465. // set Town warp unlock variable
  1466. set ##QWS_D_Unlock, (##QWS_D_Unlock | @dungeontemp);
  1467. //mark that this character has done the upgrade to 1.8
  1468. set ##QWS_UP,18;
  1469. return;
  1470. }
  1471. //===================Extra=Variable=Clear=Pre=1.8==================
  1472. function script Extra_Variable_Clear {
  1473. // Clear Town variables
  1474. set #prontera,0;
  1475. set #alberta,0;
  1476. set #aldebaran,0;
  1477. set #amatsu,0;
  1478. set #ayotaya,0;
  1479. set #comodo,0;
  1480. set #einbech,0;
  1481. set #einbroch,0;
  1482. set #geffen,0;
  1483. set #gonryun,0;
  1484. set #hugel,0;
  1485. set #izlude,0;
  1486. set #jawaii,0;
  1487. set #lighthalzen,0;
  1488. set #louyang,0;
  1489. set #xmas,0;
  1490. set #morocc,0;
  1491. set #niflheim,0;
  1492. set #payon,0;
  1493. set #umbala,0;
  1494. set #yuno,0;
  1495. // Clear Dungeon variables
  1496. set #abyss,0;
  1497. set #ama_dun,0;
  1498. set #anthell,0;
  1499. set #ayotaya_dun,0;
  1500. set #iz_dun,0;
  1501. set #c_tower,0;
  1502. set #mjo_dun,0;
  1503. set #prt_sewb,0;
  1504. set #einbech_dun,0;
  1505. set #gefenia,0;
  1506. set #gef_dun,0;
  1507. set #gl_dun,0;
  1508. set #gon_dun,0;
  1509. set #hid_dun,0;
  1510. set #juperos,0;
  1511. set #lighthalzen_dun,0;
  1512. set #louyang_dun,0;
  1513. set #mag_dun,0;
  1514. set #odintemple,0;
  1515. set #orcsdun,0;
  1516. set #pay_dun,0;
  1517. set #moc_pryd,0;
  1518. set #in_sphinx,0;
  1519. set #treasure,0;
  1520. set #thanatos_tower,0;
  1521. set #xmas_dun,0;
  1522. set #tur_dun,0;
  1523. set #um_dun,0;
  1524. // as the account based variables are limited just run this on every character to save some variables
  1525. set QWS_ExtraVARClear,18;
  1526. return;
  1527. }
  1528. //================Dungeon=Warpras=That=Only=Unlock=================
  1529. function script QWS_Dungeon_Warpra {
  1530. function QWS_D_getbin;
  1531. function QWS_D_setbin;
  1532. if ((QWS_D_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
  1533. mes "[Warpra]";
  1534. mes getarg(1)+" unlocked!";
  1535. QWS_D_setbin(getarg(0));
  1536. return;
  1537. } else if (QWS_D_getbin(getarg(0)) == 1){
  1538. mes "[Warpra]";
  1539. mes "Sorry I can only unlock this location.";
  1540. } else
  1541. debugmes "QWS_Dungeon_Warpra error, improper syntax ?";
  1542. return;
  1543. function QWS_D_setbin {
  1544. set @tempsetbindata,1;
  1545. if (getarg(0) == 0) goto binset;
  1546. set @temploopsetbin,0;
  1547. do {
  1548. set @tempsetbindata, @tempsetbindata * 2;
  1549. set @temploopsetbin, @temploopsetbin + 1;
  1550. } while (getarg(0) > @temploopsetbin);
  1551. binset:
  1552. set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata);
  1553. return;
  1554. }
  1555. function QWS_D_getbin {
  1556. set @tempgetbindata,1;
  1557. if (getarg(0) == 0) goto binget;
  1558. set @temploopgetbin,0;
  1559. do {
  1560. set @tempgetbindata, @tempgetbindata * 2;
  1561. set @temploopgetbin, @temploopgetbin + 1;
  1562. } while (getarg(0) > @temploopgetbin);
  1563. binget:
  1564. if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1;
  1565. return 0;
  1566. }
  1567. }
  1568. //==========================Town=Warpras===========================
  1569. function script QWS_Town_Warpra {
  1570. function QWS_T_getbin;
  1571. function QWS_T_setbin;
  1572. if ((QWS_T_getbin(getarg(0)) == 0) && (getarg(1) != "")) {
  1573. mes "[Warpra]";
  1574. mes getarg(1)+" unlocked!";
  1575. QWS_T_setbin(getarg(0));
  1576. return;
  1577. } else if (QWS_T_getbin(getarg(0)) == 1){
  1578. callfunc "Q_Warpra",0;
  1579. } else
  1580. debugmes "QWS_Town_Warpra error, improper syntax ?";
  1581. return;
  1582. function QWS_T_setbin {
  1583. set @tempsetbindata,1;
  1584. if (getarg(0) == 0) goto binset;
  1585. set @temploopsetbin,0;
  1586. do {
  1587. set @tempsetbindata, @tempsetbindata * 2;
  1588. set @temploopsetbin, @temploopsetbin + 1;
  1589. } while (getarg(0) > @temploopsetbin);
  1590. binset:
  1591. set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata);
  1592. return;
  1593. }
  1594. function QWS_T_getbin {
  1595. set @tempgetbindata,1;
  1596. if (getarg(0) == 0) goto binget;
  1597. set @temploopgetbin,0;
  1598. do {
  1599. set @tempgetbindata, @tempgetbindata * 2;
  1600. set @temploopgetbin, @temploopgetbin + 1;
  1601. } while (getarg(0) > @temploopgetbin);
  1602. binget:
  1603. if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1;
  1604. return 0;
  1605. }
  1606. }
  1607. //============================Warpras==============================
  1608. alb2trea.gat,73,101,4 script Warpra#01 113,{
  1609. callfunc "Q_Warpra",1;
  1610. }
  1611. ama_fild01.gat,178,325,1 script Warpra#02 113,{
  1612. callfunc "Q_Warpra",1;
  1613. }
  1614. gef_fild10.gat,71,339,4 script Warpra#03 113,{
  1615. callfunc "Q_Warpra",1;
  1616. }
  1617. izlu2dun.gat,104,82,4 script Warpra#04 113,{
  1618. callfunc "Q_Warpra",1;
  1619. }
  1620. mjolnir_02.gat,85,363,4 script Warpra#05 113,{
  1621. callfunc "Q_Warpra",1;
  1622. }
  1623. moc_fild04.gat,207,331,4 script Warpra#06 113,{
  1624. callfunc "Q_Warpra",1;
  1625. }
  1626. moc_fild19.gat,106,97,4 script Warpra#07 113,{
  1627. callfunc "Q_Warpra",1;
  1628. }
  1629. moc_ruins.gat,64,166,4 script Warpra#08 113,{
  1630. callfunc "Q_Warpra",1;
  1631. }
  1632. niflheim.gat,197,192,3 script Warpra#09 113,{
  1633. callfunc "Q_Warpra",1;
  1634. }
  1635. pay_arche.gat,39,135,4 script Warpra#10 113,{
  1636. callfunc "Q_Warpra",1;
  1637. }
  1638. prt_fild05.gat,273,215,4 script Warpra#11 113,{
  1639. callfunc "Q_Warpra",1;
  1640. }
  1641. tur_dun01.gat,148,239,4 script Warpra#12 113,{
  1642. callfunc "Q_Warpra",1;
  1643. }
  1644. valkyrie.gat,48,35,8 script Warpra#13 113,{
  1645. callfunc "Q_Warpra",1;
  1646. }
  1647. yuno_fild03.gat,37,135,4 script Warpra#14 113,{
  1648. callfunc "Q_Warpra",1;
  1649. }
  1650. alberta.gat,32,240,4 script Warpra#15 113,{
  1651. callfunc "QWS_Town_Warpra",1,"Alberta Town";
  1652. close;
  1653. }
  1654. aldebaran.gat,146,118,4 script Warpra#16 113,{
  1655. callfunc "QWS_Town_Warpra",2,"Aldebaran Town";
  1656. close;
  1657. }
  1658. ayothaya.gat,216,171,5 script Warpra#17 113,{
  1659. callfunc "QWS_Town_Warpra",4,"Ayotaya Town";
  1660. close;
  1661. }
  1662. amatsu.gat,193,81,1 script Warpra#18 113,{
  1663. callfunc "QWS_Town_Warpra",3,"Amatsu Town";
  1664. close;
  1665. }
  1666. comodo.gat,195,158,4 script Warpra#19 113,{
  1667. callfunc "QWS_Town_Warpra",5,"Comodo Town";
  1668. close;
  1669. }
  1670. einbroch.gat,229,196,5 script Warpra#20 113,{
  1671. callfunc "QWS_Town_Warpra",7,"Einbroch Town";
  1672. close;
  1673. }
  1674. einbech.gat,173,131,5 script Warpra#21 113,{
  1675. callfunc "QWS_Town_Warpra",6,"Einbech Town";
  1676. close;
  1677. }
  1678. geffen.gat,116,66,4 script Warpra#22 113,{
  1679. callfunc "QWS_Town_Warpra",8,"Geffen Town";
  1680. close;
  1681. }
  1682. gonryun.gat,152,130,4 script Warpra#23 113,{
  1683. callfunc "QWS_Town_Warpra",9,"Gonryun Town";
  1684. close;
  1685. }
  1686. hugel.gat,90,127,5 script Warpra#24 113,{
  1687. callfunc "QWS_Town_Warpra",10,"Hugel Town";
  1688. close;
  1689. }
  1690. jawaii.gat,107,182,5 script Warpra#25 113,{
  1691. callfunc "QWS_Town_Warpra",12,"Jawaii Town";
  1692. close;
  1693. }
  1694. izlude.gat,132,116,4 script Warpra#26 113,{
  1695. callfunc "QWS_Town_Warpra",11,"Izlude Town";
  1696. close;
  1697. }
  1698. lighthalzen.gat,153,100,5 script Warpra#27 113,{
  1699. callfunc "QWS_Town_Warpra",13,"Lighthalzen Town";
  1700. close;
  1701. }
  1702. louyang.gat,211,106,4 script Warpra#28 113,{
  1703. callfunc "QWS_Town_Warpra",14,"Louyang Town";
  1704. close;
  1705. }
  1706. morocc.gat,157,95,4 script Warpra#29 113,{
  1707. callfunc "QWS_Town_Warpra",16,"Morroc Town";
  1708. close;
  1709. }
  1710. nif_fild01.gat,319,77,1 script Warpra#30 113,{
  1711. callfunc "QWS_Town_Warpra",17,"Niflheim Town";
  1712. close;
  1713. }
  1714. payon.gat,183,110,4 script Warpra#31 113,{
  1715. callfunc "QWS_Town_Warpra",18,"Payon Town";
  1716. close;
  1717. }
  1718. prontera.gat,147,172,5 script Warpra#32 113,{
  1719. callfunc "QWS_Town_Warpra",0,"Prontera Town";
  1720. close;
  1721. }
  1722. umbala.gat,133,130,4 script Warpra#33 113,{
  1723. callfunc "QWS_Town_Warpra",19,"Umbala Town";
  1724. close;
  1725. }
  1726. xmas.gat,151,136,4 script Warpra#34 113,{
  1727. callfunc "QWS_Town_Warpra",15,"Lutie Town";
  1728. close;
  1729. }
  1730. yuno.gat,138,162,4 script Warpra#35 113,{
  1731. callfunc "QWS_Town_Warpra",20,"Yuno Town";
  1732. close;
  1733. }
  1734. abyss_02.gat,274,266,1 script Warpra#36 113,{
  1735. callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake";
  1736. close;
  1737. }
  1738. ama_dun02.gat,192,118,5 script Warpra Helper#01 112,{
  1739. callfunc "QWS_Dungeon_Warpra",1,"Amatsu Dungeon";
  1740. close;
  1741. }
  1742. anthell02.gat,170,165,3 script Warpra Helper#02 112,{
  1743. callfunc "QWS_Dungeon_Warpra",2,"Ant Hell Dungeon";
  1744. close;
  1745. }
  1746. ayo_dun02.gat,258,193,5 script Warpra Helper#03 112,{
  1747. callfunc "QWS_Dungeon_Warpra",3,"Ayotaya Dungeon";
  1748. close;
  1749. }
  1750. ein_dun02.gat,292,282,1 script Warpra Helper#04 112,{
  1751. callfunc "QWS_Dungeon_Warpra",8,"Einbech Dungeon";
  1752. close;
  1753. }
  1754. iz_dun03.gat,202,47,2 script Warpra Helper#05 112,{
  1755. callfunc "QWS_Dungeon_Warpra",4,"Byalan Dungeon";
  1756. close;
  1757. }
  1758. c_tower3.gat,129,106,4 script Warpra Helper#06 112,{
  1759. callfunc "QWS_Dungeon_Warpra",5,"Clock Tower Dungeon";
  1760. close;
  1761. }
  1762. mjo_dun02.gat,39,25,4 script Warpra Helper#07 112,{
  1763. callfunc "QWS_Dungeon_Warpra",6,"Coal Mine Dungeon";
  1764. close;
  1765. }
  1766. prt_sewb2.gat,176,30,3 script Warpra Helper#08 112,{
  1767. callfunc "QWS_Dungeon_Warpra",7,"Culvert Dungeon";
  1768. close;
  1769. }
  1770. gefenia03.gat,137,34,0 script Warpra Helper#09 112,{
  1771. callfunc "QWS_Dungeon_Warpra",9,"Gefenia Dungeon";
  1772. close;
  1773. }
  1774. gef_dun02.gat,218,61,2 script Warpra Helper#10 112,{
  1775. callfunc "QWS_Dungeon_Warpra",10,"Gefen Dungeon";
  1776. close;
  1777. }
  1778. glast_01.gat,371,308,3 script Warpra Helper#11 112,{
  1779. callfunc "QWS_Dungeon_Warpra",11,"Glast Heim Dungeon";
  1780. close;
  1781. }
  1782. gon_dun01.gat,167,273,4 script Warpra Helper#12 112,{
  1783. callfunc "QWS_Dungeon_Warpra",12,"Gonryun Dungeon";
  1784. close;
  1785. }
  1786. juperos_02.gat,127,154,5 script Warpra Helper#13 112,{
  1787. callfunc "QWS_Dungeon_Warpra",14,"Juperos Cave";
  1788. close;
  1789. }
  1790. kh_dun01.gat,14,224,3 script Warpra Helper#14 112,{
  1791. callfunc "QWS_Dungeon_Warpra",28,"Kiel Dungeon";
  1792. close;
  1793. }
  1794. lhz_dun02.gat,156,151,5 script Warpra Helper#15 112,{
  1795. callfunc "QWS_Dungeon_Warpra",15,"Lighthalzen Bio Lab";
  1796. close;
  1797. }
  1798. lou_dun02.gat,168,264,4 script Warpra Helper#16 112,{
  1799. callfunc "QWS_Dungeon_Warpra",16,"Louyang Dungeon";
  1800. close;
  1801. }
  1802. mag_dun02.gat,46,41,3 script Warpra Helper#17 112,{
  1803. callfunc "QWS_Dungeon_Warpra",17,"Magma Dungeon";
  1804. close;
  1805. }
  1806. odin_tem01.gat,115,148,3 script Warpra Helper#18 112,{
  1807. callfunc "QWS_Dungeon_Warpra",18,"Odin Temple";
  1808. close;
  1809. }
  1810. orcsdun01.gat,185,11,3 script Warpra Helper#19 112,{
  1811. callfunc "QWS_Dungeon_Warpra",19,"Orc Dungeon";
  1812. close;
  1813. }
  1814. pay_dun03.gat,162,143,3 script Warpra Helper#20 112,{
  1815. callfunc "QWS_Dungeon_Warpra",20,"Payon Dungeon";
  1816. close;
  1817. }
  1818. moc_pryd02.gat,101,95,3 script Warpra Helper#21 112,{
  1819. callfunc "QWS_Dungeon_Warpra",21,"Pyramides Dungeon";
  1820. close;
  1821. }
  1822. in_sphinx2.gat,274,268,1 script Warpra Helper#22 112,{
  1823. callfunc "QWS_Dungeon_Warpra",22,"Sphinx Dungeon";
  1824. close;
  1825. }
  1826. tha_t07.gat,111,162,3 script Warpra Helper#23 112,{
  1827. callfunc "QWS_Dungeon_Warpra",24,"Thanatos Tower";
  1828. close;
  1829. }
  1830. treasure02.gat,104,40,3 script Warpra Helper#24 112,{
  1831. callfunc "QWS_Dungeon_Warpra",23,"Sunken Ship Dungeon";
  1832. close;
  1833. }
  1834. xmas_dun02.gat,124,131,3 script Warpra Helper#25 112,{
  1835. callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon";
  1836. close;
  1837. }
  1838. um_dun02.gat,44,28,3 script Warpra Helper#26 112,{
  1839. callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon";
  1840. close;
  1841. }
  1842. tur_dun02.gat,162,23,3 script Warpra Helper#27 112,{
  1843. callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon";
  1844. close;
  1845. }
  1846. prt_maze02.gat,102,69,4 script Warpra Helper#28 112,{
  1847. callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon";
  1848. close;
  1849. }