From b07b02bc7899abd47d043731869b4bfa7626f8e4 Mon Sep 17 00:00:00 2001 From: euphyy Date: Fri, 13 Jul 2012 03:35:32 +0000 Subject: * Added mine and tr0n's quest scripts to /custom/quests/ * Added GmOcean's Disguise Event, Mysterious' Mushroom Event, and Keale's Cluckers Event (all edited) to /custom/events/ * Moved Quest Warper into /etc/ * Deleted custom Fashionable Glasses quest, duplicate of official NPC "Zic" (custom/quests/fashion.txt) * Deleted custom Hyegun event (custom/events/hyegun_event.txt) * Deleted custom Dracula event (custom/events/draculax.txt) * Deleted custom Wizard Hat quest (custom/quests/magicalhatquest.txt) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16421 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/custom/etc/quest_warper.txt | 2137 +++++++++++++++++++++++++++++++++ npc/custom/events/cluckers.txt | 114 ++ npc/custom/events/disguise.txt | 244 ++++ npc/custom/events/draculax.txt | 129 -- npc/custom/events/hyegun_event.txt | 77 -- npc/custom/events/mushroom_event.txt | 62 + npc/custom/quest_warper.txt | 2137 --------------------------------- npc/custom/quests/fashion.txt | 69 -- npc/custom/quests/magicalhatquest.txt | 58 - npc/custom/quests/quest_shop.txt | 148 +++ npc/custom/quests/questboard.txt | 300 +++++ npc/scripts_custom.conf | 19 +- 12 files changed, 3015 insertions(+), 2479 deletions(-) create mode 100644 npc/custom/etc/quest_warper.txt create mode 100644 npc/custom/events/cluckers.txt create mode 100644 npc/custom/events/disguise.txt delete mode 100644 npc/custom/events/draculax.txt delete mode 100644 npc/custom/events/hyegun_event.txt create mode 100644 npc/custom/events/mushroom_event.txt delete mode 100644 npc/custom/quest_warper.txt delete mode 100644 npc/custom/quests/fashion.txt delete mode 100644 npc/custom/quests/magicalhatquest.txt create mode 100644 npc/custom/quests/quest_shop.txt create mode 100644 npc/custom/quests/questboard.txt (limited to 'npc') diff --git a/npc/custom/etc/quest_warper.txt b/npc/custom/etc/quest_warper.txt new file mode 100644 index 000000000..85919fa0f --- /dev/null +++ b/npc/custom/etc/quest_warper.txt @@ -0,0 +1,2137 @@ +//===== rAthena Script ============================================ +//= Quest Warper Script +//===== By: ======================================================= +//= DZeroX, Darkchild, Neouni +//===== Current Version: ========================================== +//= 2.2 +//===== Compatible With: ========================================== +//= rAthena SVN +//===== Description: ============================================== +//= Warper that works only after locations are unlocked +//===== Additional Comments: ====================================== +//= 1.0 - NPCs created +//= 1.1 - Add Dungeons by sturm +//= 1.2 - Add All char in account unlocked by ace_killer +//= 1.3 - Add new 7 towns and 7 dungeons by escoteiro +// - Correct bug jawaii town by escoteiro +// - Remove some excessive warpras by escoteiro +//= 1.4 - Rewrite of the Warpa system [Neouni] +// - Corrected some bugs caused by autoconverting the old script +//= 1.4a - Rewrite of menu to be custom for each player [Neouni] +// - Dungeon listing rewrite +// - Town listing rewrite +// - GameMaster can Customise Main menu +//= 1.4b - Pricing round [Neouni] +// - GM menu added for pricing +// - Town Warp pricing tags added +// - Dungeon Warp pricing tags added +//= 1.5 - storage functions pricing [Neouni] +// - storage pricing added +// - kafra points setting added +// - kafra storage code security added +// - Healing scripts pricing added +// - Heal Part script added +//= 1.6 - Dungeon warp [Neouni] (beta only) +// - added option to add a extra fee for going down deeper into dungeon +// partly by rebuilding the dungeon warping into variable menu's +//= 1.6a - alot of fixes for beta release [Neouni] (public release) +// - fixed syntax problems +// - fixed missing pyramid gats in @DGat$ array +// - removed the culver level 5 that didn't exist +// and caused quite alot of problems (i didn't check while converting) +//-1.7 - Readability of Dungeon menu building increased [Neouni] +// - Thanatos Tower & Louyang Dungeon added +//-1.8 - changed around unlock variables [Neouni] +// - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable +// (warp variables are saved in login database, so all charservers have these unlocked) +// - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 ! +// - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 ! +// - (max login ##variables = 16, i used 3) +// - old variables are cleared on next save +// - Extra Variable clear added for every character, just in case (request by Terces) +//-1.8a - Show ammount of users on map [Neouni] +// - Default = off, enable in GM menu +// - Requested by escoteiro +//-1.8b - Small typo fixed in stampcard script [Neouni] +// - Reported by escoteiro +//-1.9 - Making it more edit friendly [Neouni] +// - Made Dungeon warp arrays more readable & editable (QWS_Darray) +// - Made town warp arrays more readable & editable (QWS_Tarray) +//-2.0 - Special Warp menu added [Neouni] +// - when all towns and dungeons are collected a new option on the main menu will show +// - it will only show when you setup the mapname of the warp ! +// - requested by escoteiro +// - several bugs fixed +//-2.0a - Dungeon Level Limit & Split dungeon fees +// - Limits dungeon based on Depth, access special setup menu thru GM-Menu +// - Dungeon fees split up based on Basic , Advanced & Overseas +// - Old Dungeon fee system removed, all dungeon fees now set to 0 +//-2.0b +// - Special warpname menu option name bug fixed +//-2.1 Updated names to fall within retrictions. [L0ne_W0lf] +//-2.2 #kafra_code is now stored as is. [brianluau] +//================================================================= + +//========================Function=&=Script======================== + + +function script Q_Warpra { +// Quick hack for backwards compatibility pre 1.8 +if (##QWS_UP < 18) callfunc "QWS_BackComp"; +// Extra clear variables because marker is saved on all char servers and variables can be on multiple servers +if (QWS_ExtraVARClear < 18) callfunc "Extra_Variable_Clear"; + + mes "[Warpra]"; + mes "Hello,"; + mes "I can warp you to any town or dungeon, but you need to unlock them first."; + mes "To unlock them, you have to visit us."; + mes "What do you need?"; + + if(getarg(0) == 0) callfunc "QWS_MMarray",0; + if(getarg(0) == 1) callfunc "QWS_MMarray",1; + + 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]); + + switch(@Mmenuref[@MMenu-1]+1){ + case 1: + goto GM_Menu; + case 2: + warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY; + close2; + debugmes "Please check your special warp menu settings on the Warpra"; + end; + case 3: + goto L_town; + case 4: + goto L_dungeon; + case 5: + goto L_FewWarps; + case 6: + goto L_NoUnlock; + case 7: + goto L_heal_Full; + case 8: + goto L_heal_Part; + case 9: + goto L_Storage; + case 10: + goto L_GStorage; + case 11: + goto L_end; + default: + goto L_end; +} + +//=====================GM-Menu=Functions=========================== + +GM_Menu: +next; +//----------------Town-Warp + if ($QW_TW_OFF == 0) mes "Town warping = ^00FF00 On ^000000"; + if ($QW_TW_OFF == 1) mes "Town warping = ^FF0000 Off ^000000"; +//----------------Dungeon-Warp + if ($QW_DW_OFF == 0) mes "Dungeon warping = ^00FF00 On ^000000"; + if ($QW_DW_OFF == 1) mes "Dungeon warping = ^FF0000 Off ^000000"; +//----------------Dungeon-Depth-Limit + if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; + if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; + mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; +//----------------ShowMapUsers + if ($QW_MapUserShow == 1) mes "Show Map Users = ^00FF00 On ^000000"; + if ($QW_MapUserShow == 0) mes "Show Map Users = ^FF0000 Off ^000000"; +//----------------Healfull + if ($QW_HF == 1) mes "Healing full = ^00FF00 On ^000000"; +//----------------Healpart + if ($QW_HP == 1) mes "Healing partly = ^00FF00 On ^000000"; + if (($QW_HF == 0)&&($QW_HP == 0)) mes "Healing = ^FF0000 Off ^000000"; +//----------------Storage + if ($QW_Stor == 1) mes "Storage = ^00FF00 On ^000000"; + if ($QW_Stor == 0) mes "Storage = ^FF0000 Off ^000000"; +//----------------GuildStorage + if ($QW_GStor == 1) mes "Guild Storage = ^00FF00 On ^000000"; + if ($QW_GStor == 0) mes "Guild Storage = ^FF0000 Off ^000000"; +//----------------KafraPoints + if ($QW_KPoint == 1) mes "Kafra points collect = ^00FF00 On ^000000"; + if ($QW_KPoint == 0) mes "Kafra points collect = ^FF0000 Off ^000000"; +//----------------GMmenu + 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")) { + +// Using callsub and a small check to not make 1 part of the script set it on and the other turning it off again + +case 1: + if ($QW_TW_OFF == 0) { + set $QW_TW_OFF,1; + goto GM_Menu; + } else + set $QW_TW_OFF,0; + goto GM_Menu; +case 2: + if ($QW_DW_OFF == 0) { + set $QW_DW_OFF,1; + goto GM_Menu; + } else + set $QW_DW_OFF,0; + goto GM_Menu; +case 3: + goto DungeonLevelLimit; +case 4: + if ($QW_MapUserShow == 0) { + set $QW_MapUserShow,1; + goto GM_Menu; + } else + set $QW_MapUserShow,0; + goto GM_Menu; +case 5: + if ($QW_HF == 0) { + set $QW_HF,1; + set $QW_HP,0; + goto GM_Menu; + } else + set $QW_HF,0; + goto GM_Menu; +case 6: + if ($QW_HP == 0) { + set $QW_HP,1; + set $QW_HF,0; + goto GM_Menu; + } else + set $QW_HP,0; + goto GM_Menu; +case 7: + if ($QW_Stor == 0) { + set $QW_Stor,1; + goto GM_Menu; + } else + set $QW_Stor,0; + goto GM_Menu; +case 8: + if ($QW_GStor == 0) { + set $QW_GStor,1; + goto GM_Menu; + } else + set $QW_GStor,0; + goto GM_Menu; +case 9: + if ($QW_KPoint == 0) { + set $QW_KPoint,1; + goto GM_Menu; + } else + set $QW_KPoint,0; + goto GM_Menu; +case 10: + goto Setprice; +case 11: + goto SpecialWarpMenu; +default: + close; + end; +} + + +//======================GM-Menu=Pricing============================ + +Setprice: + if ($QW_DW_FEE != 0) set $QW_DW_FEE,0; + next; + mes "Scroll thru the list to see all the options"; +//----------------Warp-Basic-Price + if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; + if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; +//----------------Warp-Advanced-Price + if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; + if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; +//----------------Warp-Oversea-Price + if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; + if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; +//----------------Basic-Dungeon-Level-Warp-Fee + if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; + if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Advanced-Dungeon-Level-Warp-Fee + if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; + if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Overseas-Dungeon-Level-Warp-Fee + if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; + if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; +//----------------Heal-Full + if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; + if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; +//----------------Heal-Part + if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; + if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; + if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; + if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; +//----------------Storage + if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; + if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; + if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; +//----------------Guild-Storage + if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; + if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; + + 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")) { + +case 1: + next; + if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; + if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; + mes "Basic - Warps are starter towns and related dungeons"; + input $QW_BW_PRICE; + goto Setprice; + +case 2: + next; + if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; + if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; + mes "Advanced - Warps are towns and dungeons on the same island but not close to any starter town"; + input $QW_AW_PRICE; + goto Setprice; + +case 3: + next; + if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; + if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; + mes "Overseas - Warps are towns and dungeons overseas reachable by boat from alberta"; + input $QW_OW_PRICE; + goto Setprice; + +case 4: + next; + if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; + if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Basic - Warps are starter town related dungeons"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_BW_FEE; + goto Setprice; + +case 5: + next; + if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; + if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Advanced - Warps are dungeons not close to any starter town"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_AW_FEE; + goto Setprice; + +case 6: + next; + if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; + if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; + mes "Overseas - Warps are dungeons related to towns overseas reachable by boat from alberta"; + mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; + mes "These costs are on top of the regular Warp costs"; + input $QW_OW_FEE; + goto Setprice; + +case 7: + next; + if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; + if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; + mes "Instant full healing 1 price"; + input $QW_HF_PRICE; + goto Setprice; + +case 8: + next; + if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; + if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; + if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; + if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; + mes "Healing price per 1 HP"; + mes "Healing price per 1 SP"; + mes "2 inputs, first HP then SP"; + input $QW_HP_H_PRICE; + input $QW_HP_S_PRICE; + goto Setprice; + +case 9: + next; + if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; + if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; + if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; + mes "Storage cost, if set to 60 Kafra pricing will be handled"; + input $QW_S_PRICE; + goto Setprice; + +case 10: + next; + if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; + if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; + mes "Guild Storage, free on Guild Kafras"; + input $QW_GS_PRICE; + goto Setprice; +case 11: + goto GM_Menu; +default: + close; + end; +} + +//======================Special=Warp=Menu========================== + +SpecialWarpMenu: + if ($QW_SP_Warpname$ == "") set $QW_SP_Warpname$,"Special Warp"; + next; + mes "Scroll down to see all the information"; + mes "The Special warp menu option will show in the main menu when all towns & dungeons are unlocked"; + mes "And when the map for special warping has been set"; + mes "menu option name set to ^0000FF"+$QW_SP_Warpname$+"^000000"; + if ($QW_SP_WarpMap$ == "") mes "map is currently ^FF0000not^000000 set, and Special warp menu is off"; + if ($QW_SP_WarpMap$ != "") mes "map is currently set to ^0000FF"+$QW_SP_WarpMap$+"^000000 and Special Warp menu is on"; + mes "coords are set to ^0000FF"+$QW_SP_WarpX+","+$QW_SP_WarpY+"^000000"; + switch(select("Set Special Warp name to show in menu", "Set WarpMap","Set Coords","Go Back to GM_Menu","Exit")){ + +case 1: + next; + mes "set the name to show in the menu as option"; + input $QW_SP_Warpname$; + goto SpecialWarpMenu; +case 2: + next; + mes "set the map in the ^0000FFmapname^000000 format"; + mes "when this warpmap is set the option for players will show once they meet the requirments"; + mes "to disable Special Warp Menu option clear this !"; + input $QW_SP_WarpMap$; + goto SpecialWarpMenu; +case 3: + next; + mes "First input = Xcoord"; + mes "Second input = Ycoord"; + input $QW_SP_WarpX; + input $QW_SP_WarpY; + goto SpecialWarpMenu; +case 4: + goto GM_Menu; +default: + close; + end; +} + +//======================Dungeon=Level=Limit======================== +DungeonLevelLimit: + next; + if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; + if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; + mes "If^00FF00 On ^000000Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; + + switch(select("Toggle Dungeon Depth Limit", "Set Dungeon Depth Limit","Go Back to GM_Menu","Exit")){ + +case 1: + if ($QW_DL == 0) { + set $QW_DL,1; + goto DungeonLevelLimit; + } else + set $QW_DL,0; + goto DungeonLevelLimit; +case 2: + next; + mes "set limit of Dungeon Depth 0 = entrance"; + mes "Depth 1 is a map connected to 0 and so on"; + mes "Shortest Route to map counts as depth"; + input $QW_DDL; + goto DungeonLevelLimit; +case 3: + goto GM_Menu; +default: + close; + end; +} + +//===========================Towns================================= + +L_town: + callfunc "QWS_Tarray"; + +// Expected maximum is set to 25 items, if you add more options add more ",@Tmenulist$[xx]" + + 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]); + + if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex + + if(Zeny<@pTprice[@Tmenuref[@TWMenu-1]]) callsub L_Short_on_zeny,0; + + set Zeny, Zeny-@pTprice[@Tmenuref[@TWMenu-1]]; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@pTprice[@Tmenuref[@TWMenu-1]]/16); + warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]]; + close2; // this part safegaurds against errors/typos + set Zeny, Zeny+@pTprice[@Tmenuref[@TWMenu-1]]; + end; + +//=========================Dungeons================================ + +L_dungeon: + callfunc "QWS_Darray"; + +// Expected maximum is set to 35 items, if you add more options add more ",@Dmenulist$[xx]" + + 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]); + + if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex + set @DwarpMenu, (@Dmenuref[@DWMenu-1]); + callfunc "QWS_DLarray"; + + next; + mes "[Warpra]"; + mes "Please select where you want to go"; + +// Expected maximum is set to 18 items, if you have dungeons with more levels add more ",@DWLmenulist$[xx]" + 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]); + + if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex + + set @Darrayref, @DWLmenuref[@DWLMenu-1]; + set @warpprice, @pDprice[@Dmenuref[@DWMenu-1]]+(getd(@pDfee$[@Dmenuref[@DWMenu-1]])*(@DDepth[@Darrayref])); + + if(Zeny<@warpprice) callsub L_Short_on_zeny,1; + + set Zeny, Zeny-(@warpprice); + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@warpprice/16); + warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref]; + close2; // this part safegaurds against errors/typos + set Zeny, Zeny+@pTprice[@Tmenuref[@DWMenu-1]]; + end; + +//=============================Healing============================= + +L_heal_Full: + set @healfee, $QW_HF_PRICE; + if(Zeny<@healfee) callsub L_Short_on_zeny,4; + set Zeny, Zeny-@healfee; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@healfee/500); + next; + mes "[Warpra]"; + mes "Close this window and I will Heal you."; + close2; + percentheal 100,100; + end; + +L_heal_Part: + set @healchoice,select("Full heal","Health Points only","Skill Points only","Exit"); + if (@healchoice == 1) callsub PHeal,1,1; + if (@healchoice == 2) callsub PHeal,1,0; + if (@healchoice == 3) callsub PHeal,0,1; + goto L_end; + +PHeal: + next; + set @Hp, MaxHp-Hp; + set @Sp, MaxSp-Sp; + set @HpPrice, @hp*$QW_HP_H_PRICE; + set @SpPrice, @sp*$QW_HP_S_PRICE; + mes "[Warpra]"; + if(getarg(0) == 1) mes ""+@HpPrice+" Zeny for "+@Hp+" health points"; + if(getarg(1) == 1) mes ""+@SpPrice+" Zeny for "+@Sp+" skill points"; + set @total, @HpPrice+@SpPrice; + mes "for a total of "+@total+" zeny"; + if (select("Heal me","Let me see the choices again")==2) goto L_heal_Part; + + if(getarg(0) == 1)set @HpPrice, (MaxHp-Hp)*$QW_HP_H_PRICE; + if(getarg(1) == 1)set @SpPrice, (MaxSp-Sp)*$QW_HP_S_PRICE; + set @healfee, @HpPrice+@SpPrice; + if (getarg(0) == 1)&&(getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_Short_Both; + if (getarg(0) == 1)&&(Zeny<@healfee) goto Zeny_short_HP; + if (getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_short_SP; + set Zeny, Zeny-@healfee; + if (getarg(0) == 1)&&(getarg(1) == 1) percentheal 100,100; + if (getarg(0) == 1) percentheal 100,0; + if (getarg(1) == 1) percentheal 0,100; + close; + end; + +Zeny_Short_Both: + mes "[Warpra]"; + mes "choose another option, you can afford both."; + mes "I can heal as much as you can afford too."; + if (select("OK","Exit") == 2) goto L_end; + goto PHeal; + +Zeny_short_HP: + mes "[Warpra]"; + mes "do you want me to partly heal your HP ?"; + if (select("Yes","No") == 2) goto L_end; + set @Hp, Zeny/$QW_HP_H_PRICE; + set @HpPrice, @Hp*$QW_HP_H_PRICE; + if (@Hp == 1) mes "your not worth the effort"; + if (@Hp == 1) goto L_end; + set Zeny, Zeny-@HpPrice; + heal @Hp,0; + close; + end; + + +Zeny_short_SP: + mes "[Warpra]"; + mes "do you want me to partly heal your SP ?"; + if (select("Yes","No") == 2) goto L_end; + set @Sp, Zeny/$QW_HP_S_PRICE; + set @SpPrice, @Sp*$QW_HP_S_PRICE; + if (@Sp == 1) mes "your not worth the effort"; + if (@Sp == 1) goto L_end; + set Zeny, Zeny-@SpPrice; + heal 0,@Sp; + close; + end; + + +//=============================Storage============================= + +L_Storage: + next; + if(basicskillcheck() > 0 && getskilllv("NV_BASIC") < 6) goto L_StorageJBlow; + set @fee, $QW_S_PRICE; + if ($QW_S_PRICE == 60)&&(BaseJob == Job_Novice) set @fee, 30; + if ($QW_S_PRICE == 60)&&(BaseJob != Job_Novice) set @fee, 60; + if(Zeny<@fee) callsub L_Short_on_zeny,2; + set Zeny, Zeny-@fee; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@fee/5); + + mes "[Warpra]"; + mes "Close this window and i will open your storage."; + + callsub F_CheckKafCode; //check your storage password thru kafra coding, if set + + close2; + openstorage; + end; + +F_CheckKafCode: + if(#kafra_code==0) return; + mes "Enter your storage password:"; + set @code_,0; + input @code_; + if(@code_ != #kafra_code) { + dispbottom "Wrong storage password."; + close; + } + set @kafcode_try,0; + set @code_,0; + return; + +L_StorageJBlow: + mes "[Warpra]"; + mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage."; + return; + +L_GStorage: + if(@GID==0) goto L_NoGuild; + if(Zeny<$QW_GS_PRICE) callsub L_Short_on_zeny,3; + set Zeny, Zeny-$QW_GS_PRICE; + if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + ($QW_GS_PRICE/5); + next; + mes "[Warpra]"; + mes "Close this window and i will open the ^5533FF" + GetGuildName(@GID) + "^000000 storage."; + close2; + guildopenstorage; + end; + +L_NoGuild: + next; + mes "[Warpra]"; + mes "You are not a part of a guild I can't help you."; + close; + end; + +L_end: + close; + end; + +//============================Few=Warp============================= +L_FewWarps: + next; + mes "[Warpra ]"; + mes "You need to unlock locations before they come available to you."; + mes "To unlock a location talk to my colleagues all over the world."; + mes "Each account got it's own stamp card."; + mes "Want me to check what stamps you have collected so far ?."; + if (select("Yes","No")==1) callsub stampcard; + close; + end; + + +//============================No=Unlock============================ + +L_NoUnlock: + next; + mes "[Warpra ]"; + mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place."; + close; + end; + +//=========================Short=On=Zeny=========================== +L_Short_on_zeny: + next; + 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]]+""; + 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]]+""; + if (getarg(0) == 2) mes "you don't seem to have "+@fee+" zeny, to pay for the storage fee"; + if (getarg(0) == 3) mes "you don't seem to have "+$QW_GS_PRICE+" zeny, to pay for the guild storage fee"; + if (getarg(0) == 4) mes "you don't seem to have "+@healfee+" zeny, to pay for your healing"; + close; + end; + +//===========================Stamp=Card============================ +stampcard: +// Counting of the ammount of places you have unlocked + next; + mes "Let me check what Towns you have"; + + callfunc "QWS_TownStamps"; + + mes "you collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns."; + if (@Tstamp == 15) mes "They say there is an island you can only get to when married"; + if (@Tstamp == 15) emotion 18; + next; + + mes "Let me check what dungeons you have"; + + callfunc "QWS_DungeonStamps"; + + mes "you collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons"; + mes "To unlock a dungeon, search for my colleague."; + mes "You can usually find them near the middle or end of the dungeon"; + return; +} + +function script QWS_TownStamps { + set @Tstamp,0; + set @MaxTstamp,21; //maximum number of towns + set @binvalue,1; + set @Tstamploop,0; + do { + if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1; + + set @binvalue, @binvalue *2; + set @Tstamploop, @Tstamploop + 1; + +}while (@Tstamploop < @MaxTstamp); +return; +} + +function script QWS_DungeonStamps { + set @Dstamp,0; + set @MaxDstamp,29; //maximum number of dungeons + set @binvalue,1; + set @Dstamploop,0; + do { + if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1; + + set @binvalue, @binvalue *2; + set @Dstamploop, @Dstamploop + 1; + +}while (@Dstamploop < @MaxDstamp); +return; +} + +//======================Main=Menu=Array============================ + +function script QWS_MMarray { + +// Currently 9 items + + 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"; + set @Mi,0; // That's our loop counter. + set @Mj,0; // That's the menu lines counter. +//----------------GameMaster-Menu + if (getgmlevel()>= 80) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if (getgmlevel()>= 80) set @Mmenuref[@Mj],@Mi; + if (getgmlevel()>= 80) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Special-Warp + callfunc "QWS_TownStamps"; + callfunc "QWS_DungeonStamps"; + if (@Tstamp == @MaxTstamp)&&(@Dstamp == @MaxDstamp)&&($QW_SP_WarpMap$ != "") { + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + set @Mj,@Mj+1; + } + set @Mi,@Mi+1; +//----------------Town-Warp + if ($QW_TW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_TW_OFF == 0) set @Mmenuref[@Mj],@Mi; + if ($QW_TW_OFF == 0) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Dungeon-Warp + if ($QW_DW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_DW_OFF == 0) set @Mmenuref[@Mj],@Mi; + if ($QW_DW_OFF == 0) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Why-So-Few-Warps + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------No-Unlock + if (getarg(0) == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if (getarg(0) == 1) set @Mmenuref[@Mj],@Mi; + if (getarg(0) == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Healfull + if ($QW_HF == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_HF == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_HF == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Healpart + if ($QW_HP == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_HP == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_HP == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Storage + if ($QW_Stor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_Stor == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_Stor == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------GuildStorage + if ($QW_GStor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + if ($QW_GStor == 1) set @Mmenuref[@Mj],@Mi; + if ($QW_GStor == 1) set @Mj,@Mj+1; + set @Mi,@Mi+1; +//----------------Cancel + set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; + set @Mmenuref[@Mj],@Mi; + return; + } + + + +//======================Town=Menu=Array============================ + +//----------------Prontera // I do this to find back sections quickly altho almost the same name is a line below it now +// setarray @pTmenuitems$[@Ti], "Prontera"; // Name of Town shown in Town select Menu +// setarray @pTprice[@Ti], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) +// +// setarray @pTmap$[@Ti], "prontera"; // mapfilename of town +// setarray @pTXcoords[@Ti], 156; // X warp coords +// setarray @pTYcoords[@Ti], 187; // Y warp coords +// +// QWS_Make_Town_Menu XXX; +// +// the full wap commands send out by this script for these example would be +//warp example_01 123 123 +// +// use the same XXX number as you used when making your own town warpra +// Read below how +// +// example: +// +//syntax: +//mapname,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ +// +// Full example using fake map & coords +// +//example_01,213,213,4 script Warpra 112,{ +// callfunc "QWS_Town_Warpra",XXX,"A FAKE TOWN FOR EXAMPLE"; +// close; +// } +// use a free number for XXX, last used is 20, for Yuno + +function script QWS_Tarray { + function QWS_Make_Town_Menu; + + set @Ti,0; // That's our loop counter. + set @Tj,0; // That's the menu lines counter. +//----------------Prontera + setarray @pTmenuitems$[@Ti], "Prontera"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "prontera"; + setarray @pTXcoords[@Ti], 156; + setarray @pTYcoords[@Ti], 187; + + QWS_Make_Town_Menu 0; +//----------------Alberta + setarray @pTmenuitems$[@Ti], "Alberta"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "alberta"; + setarray @pTXcoords[@Ti], 27; + setarray @pTYcoords[@Ti], 236; + + QWS_Make_Town_Menu 1; +//----------------Aldebaran + setarray @pTmenuitems$[@Ti], "Aldebaran"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "aldebaran"; + setarray @pTXcoords[@Ti], 145; + setarray @pTYcoords[@Ti], 120; + + QWS_Make_Town_Menu 2; +//----------------Amatsu: + setarray @pTmenuitems$[@Ti], "Amatsu"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "amatsu"; + setarray @pTXcoords[@Ti], 197; + setarray @pTYcoords[@Ti], 86; + + QWS_Make_Town_Menu 3; +//----------------Ayothaya: + setarray @pTmenuitems$[@Ti], "Ayothaya"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "ayothaya"; + setarray @pTXcoords[@Ti], 150; + setarray @pTYcoords[@Ti], 57; + + QWS_Make_Town_Menu 4; +//----------------Comodo: + setarray @pTmenuitems$[@Ti], "Comodo"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "comodo"; + setarray @pTXcoords[@Ti], 188; + setarray @pTYcoords[@Ti], 161; + + QWS_Make_Town_Menu 5; +//----------------Einbech: + setarray @pTmenuitems$[@Ti], "Einbech"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "einbech"; + setarray @pTXcoords[@Ti], 172; + setarray @pTYcoords[@Ti], 126; + + QWS_Make_Town_Menu 6; +//----------------Einbroch: + setarray @pTmenuitems$[@Ti], "Einbroch"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "einbroch"; + setarray @pTXcoords[@Ti], 230; + setarray @pTYcoords[@Ti], 191; + + QWS_Make_Town_Menu 7; +//----------------Geffen: + setarray @pTmenuitems$[@Ti], "Geffen"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "geffen"; + setarray @pTXcoords[@Ti], 119; + setarray @pTYcoords[@Ti], 66; + + QWS_Make_Town_Menu 8; +//----------------Gonryun: + setarray @pTmenuitems$[@Ti], "Gonryun"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "gonryun"; + setarray @pTXcoords[@Ti], 150; + setarray @pTYcoords[@Ti], 130; + + QWS_Make_Town_Menu 9; +//----------------Hugel: + setarray @pTmenuitems$[@Ti], "Hugel"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "hugel"; + setarray @pTXcoords[@Ti], 95; + setarray @pTYcoords[@Ti], 121; + + QWS_Make_Town_Menu 10; +//----------------Izlude: + setarray @pTmenuitems$[@Ti], "Izlude"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "izlude"; + setarray @pTXcoords[@Ti], 128; + setarray @pTYcoords[@Ti], 111; + + QWS_Make_Town_Menu 11; +//----------------Jawaii: + setarray @pTmenuitems$[@Ti], "Jawaii"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "jawaii"; + setarray @pTXcoords[@Ti], 243; + setarray @pTYcoords[@Ti], 115; + + QWS_Make_Town_Menu 12; +//----------------Lighthalzen: + setarray @pTmenuitems$[@Ti], "Lighthalzen"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "lighthalzen"; + setarray @pTXcoords[@Ti], 158; + setarray @pTYcoords[@Ti], 110; + + QWS_Make_Town_Menu 13; +//----------------Louyang: + setarray @pTmenuitems$[@Ti], "Louyang"; + setarray @pTprice[@Ti], $QW_OW_PRICE; + + setarray @pTmap$[@Ti], "louyang"; + setarray @pTXcoords[@Ti], 210; + setarray @pTYcoords[@Ti], 108; + + QWS_Make_Town_Menu 14; +//----------------Lutie + setarray @pTmenuitems$[@Ti], "Lutie"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "xmas"; + setarray @pTXcoords[@Ti], 148; + setarray @pTYcoords[@Ti], 131; + + QWS_Make_Town_Menu 15; +//----------------Morroc: + setarray @pTmenuitems$[@Ti], "Morroc"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "morocc"; + setarray @pTXcoords[@Ti], 159; + setarray @pTYcoords[@Ti], 93; + + QWS_Make_Town_Menu 16; +//----------------Niflheim: + setarray @pTmenuitems$[@Ti], "Niflheim"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "niflheim"; + setarray @pTXcoords[@Ti], 195; + setarray @pTYcoords[@Ti], 186; + + QWS_Make_Town_Menu 17; +//----------------Payon: + setarray @pTmenuitems$[@Ti], "Payon"; + setarray @pTprice[@Ti], $QW_BW_PRICE; + + setarray @pTmap$[@Ti], "payon"; + setarray @pTXcoords[@Ti], 152; + setarray @pTYcoords[@Ti], 75; + + QWS_Make_Town_Menu 18; +//----------------Umbala: + setarray @pTmenuitems$[@Ti], "Umbala"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "umbala"; + setarray @pTXcoords[@Ti], 130; + setarray @pTYcoords[@Ti], 130; + + QWS_Make_Town_Menu 19; +//----------------Yuno: + setarray @pTmenuitems$[@Ti], "Yuno"; + setarray @pTprice[@Ti], $QW_AW_PRICE; + + setarray @pTmap$[@Ti], "yuno"; + setarray @pTXcoords[@Ti], 160; + setarray @pTYcoords[@Ti], 168; + + QWS_Make_Town_Menu 20; +//----------------Cancel + setarray @pTmenuitems$[@Ti], "Cancel"; + setarray @pTprice[@Ti], 0; + + set @Tmenulist$[@Tj],@pTmenuitems$[@Ti]; + set @Tmenuref[@Tj],57005; // 57005='dead' in hex + return; + + +//----------------Make Town Menu Function + +function QWS_Make_Town_Menu { + set @temptownmenubin,1; + if (getarg(0) == 0) goto menu_item; + set @templooptownmenu,0; + do { + set @temptownmenubin, @temptownmenubin * 2; + set @templooptownmenu, @templooptownmenu + 1; + }while (getarg(0) > @templooptownmenu); +// check marker and make menu item +menu_item: + if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) { + set @Ti,@Ti+1; + return; + } + if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti]; + if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]; + if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti]; + if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"; + set @Tmenuref[@Tj],@Ti; + set @Tj,@Tj+1; + set @Ti,@Ti+1; + return; + +} +} + +//====================Dungeon=Menu=Arrays========================== + +//----------------A FAKE DUNGEON FOR EXAMPLE // I do this to find back sections quickly altho almost the same name is a line below it now +// setarray @pDmenuitems$[@Di], "Fake Dungeon"; // Name of Dungeon shown in Dungeon select Menu +// setarray @pDprice[@Di], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) +// 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 "") +// setarray @DLevels[@Di], 2; //number of levels in dungeon (very important if set to high will shift all leveldata!!) +// +// setarray @DGat$[@Dref], "example_01", "example_02"; // mapfilename of dungeon level +// setarray @DLevelName$[@Dref], "Example Level 1", "Example Level 2"; // level name shown in dungeon level select +// setarray @DXcoords[@Dref], 123, 234; // X warp coords +// setarray @DYcoords[@Dref], 123, 234;// Y warp coords +// setarray @DDepth[@Dref], 0, 1; // relative depth to entrance to calculate extra warp fee +// +// QWS_Make_Dungeon_Menu XXX +// +// the full wap commands send out by this scripts for these examples would be +// for Example Level 1: +//warp example_01 123 123 +// +// for Example Level 2: +//warp example_02 234 234 +// +// use the same XXX number as you used when making your own dungeon unlocker (Warpra Helper) inside the dungeon +// (usually half way near a warp to next level) +// Read below how +// +// example: +// +//syntax: +//mapname,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ +// +// Full example using fake map & coords +// +//example_01,213,213,4 script Warpra Helper 112,{ +// callfunc "QWS_Dungeon_Warpra",XXX,"A FAKE DUNGEON FOR EXAMPLE"; +// close; +// } +// use a free number for XXX, last used is 28, for Kiel Dungeon + +function script QWS_Darray { + function QWS_Make_Dungeon_Menu; + + set @Di,0; + set @Dj,0; + set @Dref,0; +//----------------ABYSS LAKE + setarray @pDmenuitems$[@Di], "Abyss Lake"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "abyss_01", "abyss_02", "abyss_03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 265, 275, 116; + setarray @DYcoords[@Dref], 273, 270, 27; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 0; + +//----------------AMATSU DUNGEON + setarray @pDmenuitems$[@Di], "Amatsu Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "ama_dun01", "ama_dun02", "ama_dun03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 227, 32, 119; + setarray @DYcoords[@Dref], 10, 43, 15; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 1; + +//----------------ANT HELL + setarray @pDmenuitems$[@Di], "Ant Hell Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[2], 2; + + setarray @DGat$[@Dref], "anthell01", "anthell02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 32, 34; + setarray @DYcoords[@Dref], 262, 263; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 2; + +//----------------AYOTAYA + setarray @pDmenuitems$[@Di], "Ayotaya Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[3], 2; + + setarray @DGat$[@Dref], "ayo_dun01", "ayo_dun02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 275, 150; + setarray @DYcoords[@Dref], 17, 13; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 3; + +//----------------BYALAN + setarray @pDmenuitems$[@Di], "Byalan Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[4], 5; + + setarray @DGat$[@Dref], "iz_dun00", "iz_dun01", "iz_dun02", "iz_dun03", "iz_dun04"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 168, 41, 236, 32, 26; + setarray @DYcoords[@Dref], 168, 37, 204, 63, 27; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 4; + +//----------------CLOCK TOWER + setarray @pDmenuitems$[@Di], "Clock Tower Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[5], 8; + + setarray @DGat$[@Dref], "c_tower1", "c_tower2", "c_tower3", "c_tower4", "alde_dun01", "alde_dun02", "alde_dun03", "alde_dun04"; + 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"; + setarray @DXcoords[@Dref], 200, 268, 64, 32, 197, 262, 276, 122; + setarray @DYcoords[@Dref], 163, 26, 148, 63, 25, 41, 53, 125; + setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 5; + +//----------------COAL MINE + setarray @pDmenuitems$[@Di], "Coal Mine Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[6], 3; + + setarray @DGat$[@Dref], "mjo_dun01", "mjo_dun02", "mjo_dun03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 52, 381, 302; + setarray @DYcoords[@Dref], 17, 343, 261; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 6; + +//----------------CULVERT + setarray @pDmenuitems$[@Di], "Culvert Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[7], 4; + + setarray @DGat$[@Dref], "prt_sewb1", "prt_sewb2", "prt_sewb3", "prt_sewb4"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 132, 19, 180, 100; + setarray @DYcoords[@Dref], 248, 19, 169, 92; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 7; + +//----------------EINBECH DUNGEON + setarray @pDmenuitems$[@Di], "Einbech Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[8], 2; + + setarray @DGat$[@Dref], "ein_dun01", "ein_dun02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 22, 292; + setarray @DYcoords[@Dref], 14, 290; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 8; + +//----------------GEFENIA DUNGEON + setarray @pDmenuitems$[@Di], "Gefenia Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[9], 4; + + setarray @DGat$[@Dref], "gefenia01", "gefenia02", "gefenia03", "gefenia04"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 59, 201, 264, 33; + setarray @DYcoords[@Dref], 167, 35, 236, 270; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 9; + +//----------------GEFFEN DUNGEON + setarray @pDmenuitems$[@Di], "Geffen Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 4; + + setarray @DGat$[@Dref], "gef_dun00", "gef_dun01", "gef_dun02", "gef_dun03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; + setarray @DXcoords[@Dref], 104, 115, 106, 203; + setarray @DYcoords[@Dref], 100, 236, 132, 200; + setarray @DDepth[@Dref], 0, 1, 2, 3; + + QWS_Make_Dungeon_Menu 10; + +//----------------GLAST HEIM + setarray @pDmenuitems$[@Di], "Glast Heim Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 17; + + setarray @DGat$[@Dref], "glast_01", "gl_church", "gl_chyard", "gl_in01", "gl_cas01", "gl_cas02", "gl_knt01", "gl_knt02", "gl_prison", "gl_prison1", "gl_step", "gl_sew01", "gl_sew02", "gl_sew03", "gl_sew04", "gl_dun01", "gl_dun02"; + 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"; + setarray @DXcoords[@Dref], 370, 156, 147, 121, 199, 104, 150, 157, 14, 150, 117, 258, 108, 171, 68, 133, 224; + setarray @DYcoords[@Dref], 300, 8, 15, 59, 29, 25, 10, 287, 70, 14, 124, 255, 291, 273, 277, 271, 274; + setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6; + + QWS_Make_Dungeon_Menu 11; + +//----------------GONRYUN DUNGEON + setarray @pDmenuitems$[@Di], "Gonryun Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "gon_dun01", "gon_dun02", "gon_dun03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 143, 17, 68; + setarray @DYcoords[@Dref], 59, 114, 9; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 12; + +//----------------HIDDEN DUNGEON + setarray @pDmenuitems$[@Di], "Hidden Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "prt_maze01", "prt_maze02", "prt_maze03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 176, 94, 23; + setarray @DYcoords[@Dref], 6, 19, 8; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 13; + +//----------------JUPEROS CAVE + setarray @pDmenuitems$[@Di], "Juperos Cave"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "juperos_01", "juperos_02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 53, 36; + setarray @DYcoords[@Dref], 247, 60; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 14; + +//----------------KIEL DUNGEON + setarray @pDmenuitems$[@Di], "Kiel Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "kh_dun01", "kh_dun02"; + setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor"; + setarray @DXcoords[@Dref], 63, 42; + setarray @DYcoords[@Dref], 10, 197; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 28; + +//----------------LIGHTHALZEN BIO LAB + setarray @pDmenuitems$[@Di], "Lighthalzen Bio Lab"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "lhz_dun01", "lhz_dun02", "lhz_dun03"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 150, 150, 140; + setarray @DYcoords[@Dref], 287, 18, 137; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 15; + +//----------------LOUYANG DUNGEON + setarray @pDmenuitems$[@Di], "Louyang Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "lou_dun02", "lou_dun03"; + setarray @DLevelName$[@Dref], "Royal Tomb Level 1", "Royal Tomb Level 2"; + setarray @DXcoords[@Dref], 282, 165; + setarray @DYcoords[@Dref], 20, 38; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 16; + +//----------------MAGMA DUNGEON + setarray @pDmenuitems$[@Di], "Magma Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "mag_dun01", "mag_dun02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 126, 47; + setarray @DYcoords[@Dref], 69, 32; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 17; + +//----------------ODIN TEMPLE + setarray @pDmenuitems$[@Di], "Odin Temple"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 1; + + setarray @DGat$[@Dref], "odin_tem01"; + setarray @DLevelName$[@Dref], "Level 1"; + setarray @DXcoords[@Dref], 96; + setarray @DYcoords[@Dref], 145; + setarray @DDepth[@Dref], 0; + + QWS_Make_Dungeon_Menu 18; + +//----------------ORC DUNGEON + setarray @pDmenuitems$[@Di], "Orc Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "orcsdun01", "orcsdun02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 32, 21; + setarray @DYcoords[@Dref], 169, 185; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 19; + +//----------------PAYON DUNGEON + setarray @pDmenuitems$[@Di], "Payon Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 5; + + setarray @DGat$[@Dref], "pay_dun00", "pay_dun01", "pay_dun02", "pay_dun03", "pay_dun04"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 22, 19, 19, 155, 201; + setarray @DYcoords[@Dref], 180, 33, 63, 159, 204; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 20; + +//----------------PYRAMIDS + setarray @pDmenuitems$[@Di], "Pyramids Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 6; + + setarray @DGat$[@Dref], "moc_pryd01", "moc_pryd02", "moc_pryd03", "moc_pryd04", "moc_pryd05", "moc_pryd06"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2"; + setarray @DXcoords[@Dref], 192, 10, 100, 181, 94, 192; + setarray @DYcoords[@Dref], 9, 192, 92, 11, 96, 8; + setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2; + + QWS_Make_Dungeon_Menu 21; + +//----------------SPHINX + setarray @pDmenuitems$[@Di], "Sphinx Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 5; + + setarray @DGat$[@Dref], "in_sphinx1", "in_sphinx2", "in_sphinx3", "in_sphinx4", "in_sphinx5"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; + setarray @DXcoords[@Dref], 192, 149, 210, 10, 100; + setarray @DYcoords[@Dref], 9, 81, 54, 222, 99; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4; + + QWS_Make_Dungeon_Menu 22; + +//----------------SUNKEN SHIP + setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon"; + setarray @pDprice[@Di], $QW_BW_PRICE; + setarray @pDfee$[@Di], "$QW_BW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "treasure01", "treasure02"; + setarray @DLevelName$[@Dref], "Level 1", "Level 2"; + setarray @DXcoords[@Dref], 69, 102; + setarray @DYcoords[@Dref], 24, 27; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 23; + +//----------------THANATOS TOWER + setarray @pDmenuitems$[@Di], "Thanatos Tower"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 13; + + setarray @DGat$[@Dref], "tha_t01", "tha_t02", "tha_t03", "tha_t04", "tha_t05", "tha_t06", "tha_t07", "tha_t08", "tha_t09", "tha_t10", "tha_t11", "tha_t12", "thana_boss"; + 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"; + setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85; + setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76; + setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12; + + QWS_Make_Dungeon_Menu 24; + +//----------------TOY FACTORY + setarray @pDmenuitems$[@Di], "Toy Factory Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 2; + + setarray @DGat$[@Dref], "xmas_dun01", "xmas_dun02"; + setarray @DLevelName$[@Dref], "Factory Warehouse", "Classifying Room"; + setarray @DXcoords[@Dref], 205, 129; + setarray @DYcoords[@Dref], 16, 133; + setarray @DDepth[@Dref], 0, 1; + + QWS_Make_Dungeon_Menu 25; + +//----------------TURTLE ISTLAND + setarray @pDmenuitems$[@Di], "Turtle Island Dungeon"; + setarray @pDprice[@Di], $QW_AW_PRICE; + setarray @pDfee$[@Di], "$QW_AW_FEE"; + setarray @DLevels[@Di], 4; + + setarray @DGat$[@Dref], "tur_dun01", "tur_dun02", "tur_dun03", "tur_dun04"; + setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3"; + setarray @DXcoords[@Dref], 161, 148, 132, 100; + setarray @DYcoords[@Dref], 34, 256, 190, 192; + setarray @DDepth[@Dref], 0, 0, 1, 2; + + QWS_Make_Dungeon_Menu 26; + +//----------------UMBALA + setarray @pDmenuitems$[@Di], "Umbala Dungeon"; + setarray @pDprice[@Di], $QW_OW_PRICE; + setarray @pDfee$[@Di], "$QW_OW_FEE"; + setarray @DLevels[@Di], 3; + + setarray @DGat$[@Dref], "um_dun01", "um_dun02", "yggdrasil01"; + setarray @DLevelName$[@Dref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain"; + setarray @DXcoords[@Dref], 205, 48, 40; + setarray @DYcoords[@Dref], 26, 30, 63; + setarray @DDepth[@Dref], 0, 1, 2; + + QWS_Make_Dungeon_Menu 27; + +//----------------Cancel + setarray @pDmenuitems$[@Di], "Cancel"; + setarray @pDprice[@Di], 0; + + set @Dmenulist$[@Dj],@pDmenuitems$[@Di]; + set @Dmenuref[@Dj],57005; // 57005='dead' in hex + return; + + +//----------------Make Dungeon Menu Function + +function QWS_Make_Dungeon_Menu { + set @tempdungeonmenubin,1; + if (getarg(0) == 0) goto menu_item; + set @temploopdungeonmenu,0; + do { + set @tempdungeonmenubin, @tempdungeonmenubin * 2; + set @temploopdungeonmenu, @temploopdungeonmenu + 1; + }while (getarg(0) > @temploopdungeonmenu); +// check marker and make menu item +menu_item: + if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) { + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + } + if ($QW_MapUserShow == 1) { + set @tempmapusers,0; + set @mapusersloop,0; + do { + set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers); + set @mapusersloop, (@mapusersloop + 1); + }while (@DLevels[@Di] > @mapusersloop); + if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di]; + if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]"; + set @Dmenuref[@Dj],@Di; + set @Dj,@Dj+1; + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + } + if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di]; + if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]; + set @Dmenuref[@Dj],@Di; + set @Dj,@Dj+1; + setarray @DLocRef[@Di], @Dref; + set @Dref, @Dref+@DLevels[@Di]; + set @Di,@Di+1; + return; + +} +} + +function script QWS_DLarray { +//----------------Start building Menu + set @DWref,@DLocRef[@DwarpMenu]; // That's our reference to the arrays with leveldata. + set @DWi,0; // That's our loop counter. + set @DWj,0; // That's the menu lines counter. + cleararray @DWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu + do { + if ($QW_DL == 0)||($QW_DDL >= @DDepth[@DWref]) { + + set @warpprice, (@pDprice[@DwarpMenu]+ (getd(@pDfee$[@DwarpMenu])*@DDepth[@DWref])); + + if (@warpprice != 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice; + if (@warpprice == 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]; + if (@warpprice != 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice; + if (@warpprice == 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]"; + set @DWLmenuref[@DWj],@DWref; + + set @DWj,@DWj+1; + } + set @DWref, @DWref+1; + set @DWi,@DWi+1; + }while (@DWi < @DLevels[@DwarpMenu]); + set @DWLmenulist$[@DWj], "Exit"; + set @DWLmenuref[@DWj],57005; // 57005='dead' in hex + return; + } + + +//=================Backwards=Compatibility=Pre=1.8================= + +function script QWS_BackComp { +// 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]; +// 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]; +// also clears variables so that the account file variables can be used for something else variable 0 = variable delete on next save + +// Towns + set @towntemp,0; + if (#prontera != 0) set @towntemp,@towntemp + 1; + if (#alberta != 0) set @towntemp,@towntemp + 2; + if (#aldebaran != 0) set @towntemp,@towntemp + 4; + if (#amatsu != 0) set @towntemp,@towntemp + 8; + if (#ayotaya != 0) set @towntemp,@towntemp + 16; + if (#comodo != 0) set @towntemp,@towntemp + 32; + if (#einbech != 0) set @towntemp,@towntemp + 64; + if (#einbroch != 0) set @towntemp,@towntemp + 128; + if (#geffen != 0) set @towntemp,@towntemp + 256; + if (#gonryun != 0) set @towntemp,@towntemp + 512; + if (#hugel != 0) set @towntemp,@towntemp + 1024; + if (#izlude != 0) set @towntemp,@towntemp + 2048; + if (#jawaii != 0) set @towntemp,@towntemp + 4096; + if (#lighthalzen != 0) set @towntemp,@towntemp + 8192; + if (#louyang != 0) set @towntemp,@towntemp + 16384; + if (#xmas != 0) set @towntemp,@towntemp + 32768; + if (#morocc != 0) set @towntemp,@towntemp + 65536; + if (#niflheim != 0) set @towntemp,@towntemp + 131072; + if (#payon != 0) set @towntemp,@towntemp + 262144; + if (#umbala != 0) set @towntemp,@towntemp + 524288; + if (#yuno != 0) set @towntemp,@towntemp + 1048576; +// Clear Town variables + set #prontera,0; + set #alberta,0; + set #aldebaran,0; + set #amatsu,0; + set #ayotaya,0; + set #comodo,0; + set #einbech,0; + set #einbroch,0; + set #geffen,0; + set #gonryun,0; + set #hugel,0; + set #izlude,0; + set #jawaii,0; + set #lighthalzen,0; + set #louyang,0; + set #xmas,0; + set #morocc,0; + set #niflheim,0; + set #payon,0; + set #umbala,0; + set #yuno,0; +// set Town warp unlock variable +set ##QWS_T_Unlock, (##QWS_T_Unlock | @towntemp); + //because multiple account servers now stack on 1 variable i used a 'or' to stack them +// Dungeons + set @dungeontemp,0; + if (#abyss != 0) set @dungeontemp,@dungeontemp + 1; + if (#ama_dun != 0) set @dungeontemp,@dungeontemp + 2; + if (#anthell != 0) set @dungeontemp,@dungeontemp + 4; + if (#ayotaya_dun != 0) set @dungeontemp,@dungeontemp + 8; + if (#iz_dun != 0) set @dungeontemp,@dungeontemp + 16; + if (#c_tower != 0) set @dungeontemp,@dungeontemp + 32; + if (#mjo_dun != 0) set @dungeontemp,@dungeontemp + 64; + if (#prt_sewb != 0) set @dungeontemp,@dungeontemp + 128; + if (#einbech_dun != 0) set @dungeontemp,@dungeontemp + 256; + if (#gefenia != 0) set @dungeontemp,@dungeontemp + 512; + if (#gef_dun != 0) set @dungeontemp,@dungeontemp + 1024; + if (#gl_dun != 0) set @dungeontemp,@dungeontemp + 2048; + if (#gon_dun != 0) set @dungeontemp,@dungeontemp + 4096; + if (#hid_dun != 0) set @dungeontemp,@dungeontemp + 8192; + if (#juperos != 0) set @dungeontemp,@dungeontemp + 16384; + if (#lighthalzen_dun != 0) set @dungeontemp,@dungeontemp + 32768; + if (#louyang_dun != 0) set @dungeontemp,@dungeontemp + 65536; + if (#mag_dun != 0) set @dungeontemp,@dungeontemp + 131072; + if (#odintemple != 0) set @dungeontemp,@dungeontemp + 262144; + if (#orcsdun != 0) set @dungeontemp,@dungeontemp + 524288; + if (#pay_dun != 0) set @dungeontemp,@dungeontemp + 1048576; + if (#moc_pryd != 0) set @dungeontemp,@dungeontemp + 2097152; + if (#in_sphinx != 0) set @dungeontemp,@dungeontemp + 4194304; + if (#treasure != 0) set @dungeontemp,@dungeontemp + 8388608; + if (#thanatos_tower != 0) set @dungeontemp,@dungeontemp + 16777216; + if (#xmas_dun != 0) set @dungeontemp,@dungeontemp + 33554432; + if (#tur_dun != 0) set @dungeontemp,@dungeontemp + 67108864; + if (#um_dun != 0) set @dungeontemp,@dungeontemp + 134217728; +// Clear Dungeon variables + set #abyss,0; + set #ama_dun,0; + set #anthell,0; + set #ayotaya_dun,0; + set #iz_dun,0; + set #c_tower,0; + set #mjo_dun,0; + set #prt_sewb,0; + set #einbech_dun,0; + set #gefenia,0; + set #gef_dun,0; + set #gl_dun,0; + set #gon_dun,0; + set #hid_dun,0; + set #juperos,0; + set #lighthalzen_dun,0; + set #louyang_dun,0; + set #mag_dun,0; + set #odintemple,0; + set #orcsdun,0; + set #pay_dun,0; + set #moc_pryd,0; + set #in_sphinx,0; + set #treasure,0; + set #thanatos_tower,0; + set #xmas_dun,0; + set #tur_dun,0; + set #um_dun,0; +// set Town warp unlock variable +set ##QWS_D_Unlock, (##QWS_D_Unlock | @dungeontemp); +//mark that this character has done the upgrade to 1.8 +set ##QWS_UP,18; +return; +} + + +//===================Extra=Variable=Clear=Pre=1.8================== +function script Extra_Variable_Clear { +// Clear Town variables + set #prontera,0; + set #alberta,0; + set #aldebaran,0; + set #amatsu,0; + set #ayotaya,0; + set #comodo,0; + set #einbech,0; + set #einbroch,0; + set #geffen,0; + set #gonryun,0; + set #hugel,0; + set #izlude,0; + set #jawaii,0; + set #lighthalzen,0; + set #louyang,0; + set #xmas,0; + set #morocc,0; + set #niflheim,0; + set #payon,0; + set #umbala,0; + set #yuno,0; + +// Clear Dungeon variables + set #abyss,0; + set #ama_dun,0; + set #anthell,0; + set #ayotaya_dun,0; + set #iz_dun,0; + set #c_tower,0; + set #mjo_dun,0; + set #prt_sewb,0; + set #einbech_dun,0; + set #gefenia,0; + set #gef_dun,0; + set #gl_dun,0; + set #gon_dun,0; + set #hid_dun,0; + set #juperos,0; + set #lighthalzen_dun,0; + set #louyang_dun,0; + set #mag_dun,0; + set #odintemple,0; + set #orcsdun,0; + set #pay_dun,0; + set #moc_pryd,0; + set #in_sphinx,0; + set #treasure,0; + set #thanatos_tower,0; + set #xmas_dun,0; + set #tur_dun,0; + set #um_dun,0; + +// as the account based variables are limited just run this on every character to save some variables +set QWS_ExtraVARClear,18; +return; +} + +//================Dungeon=Warpras=That=Only=Unlock================= + +function script QWS_Dungeon_Warpra { + function QWS_D_getbin; + function QWS_D_setbin; + + if ((QWS_D_getbin(getarg(0)) == 0) && (getarg(1) != "")) { + mes "[Warpra]"; + mes getarg(1)+" unlocked!"; + QWS_D_setbin(getarg(0)); + return; + } else if (QWS_D_getbin(getarg(0)) == 1){ + mes "[Warpra]"; + mes "Sorry I can only unlock this location."; + } else + debugmes "QWS_Dungeon_Warpra error, improper syntax ?"; + return; + + +function QWS_D_setbin { + set @tempsetbindata,1; + if (getarg(0) == 0) goto binset; + set @temploopsetbin,0; + do { + set @tempsetbindata, @tempsetbindata * 2; + set @temploopsetbin, @temploopsetbin + 1; + } while (getarg(0) > @temploopsetbin); +binset: + set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata); + return; +} + +function QWS_D_getbin { + set @tempgetbindata,1; + if (getarg(0) == 0) goto binget; + set @temploopgetbin,0; + do { + set @tempgetbindata, @tempgetbindata * 2; + set @temploopgetbin, @temploopgetbin + 1; + } while (getarg(0) > @temploopgetbin); +binget: + if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1; + return 0; +} +} + +//==========================Town=Warpras=========================== + +function script QWS_Town_Warpra { + function QWS_T_getbin; + function QWS_T_setbin; + + if ((QWS_T_getbin(getarg(0)) == 0) && (getarg(1) != "")) { + mes "[Warpra]"; + mes getarg(1)+" unlocked!"; + QWS_T_setbin(getarg(0)); + return; + } else if (QWS_T_getbin(getarg(0)) == 1){ +callfunc "Q_Warpra",0; + } else + debugmes "QWS_Town_Warpra error, improper syntax ?"; + return; + + +function QWS_T_setbin { + set @tempsetbindata,1; + if (getarg(0) == 0) goto binset; + set @temploopsetbin,0; + do { + set @tempsetbindata, @tempsetbindata * 2; + set @temploopsetbin, @temploopsetbin + 1; + } while (getarg(0) > @temploopsetbin); +binset: + set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata); + return; +} + +function QWS_T_getbin { + set @tempgetbindata,1; + if (getarg(0) == 0) goto binget; + set @temploopgetbin,0; + do { + set @tempgetbindata, @tempgetbindata * 2; + set @temploopgetbin, @temploopgetbin + 1; + } while (getarg(0) > @temploopgetbin); +binget: + if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1; + return 0; +} +} +//============================Warpras============================== + +alb2trea,73,101,4 script Warpra#1 113,{ + callfunc "Q_Warpra",1; +} +ama_fild01,178,325,1 script Warpra#2 113,{ + callfunc "Q_Warpra",1; +} +gef_fild10,71,339,4 script Warpra#3 113,{ + callfunc "Q_Warpra",1; +} +izlu2dun,104,82,4 script Warpra#4 113,{ + callfunc "Q_Warpra",1; +} +mjolnir_02,85,363,4 script Warpra#5 113,{ + callfunc "Q_Warpra",1; +} +moc_fild04,207,331,4 script Warpra#6 113,{ + callfunc "Q_Warpra",1; +} +moc_fild19,106,97,4 script Warpra#7 113,{ + callfunc "Q_Warpra",1; +} +moc_ruins,64,166,4 script Warpra#8 113,{ + callfunc "Q_Warpra",1; +} +niflheim,197,192,3 script Warpra#9 113,{ + callfunc "Q_Warpra",1; +} +pay_arche,39,135,4 script Warpra#10 113,{ + callfunc "Q_Warpra",1; +} +prt_fild05,273,215,4 script Warpra#11 113,{ + callfunc "Q_Warpra",1; +} +tur_dun01,148,239,4 script Warpra#12 113,{ + callfunc "Q_Warpra",1; +} +valkyrie,48,35,8 script Warpra#13 113,{ + callfunc "Q_Warpra",1; +} +yuno_fild03,37,135,4 script Warpra#14 113,{ + callfunc "Q_Warpra",1; +} + +alberta,32,240,4 script Warpra#15 113,{ + callfunc "QWS_Town_Warpra",1,"Alberta Town"; + close; +} +aldebaran,146,118,4 script Warpra#16 113,{ + callfunc "QWS_Town_Warpra",2,"Aldebaran Town"; + close; +} +ayothaya,216,171,5 script Warpra#17 113,{ + callfunc "QWS_Town_Warpra",4,"Ayotaya Town"; + close; +} +amatsu,193,81,1 script Warpra#18 113,{ + callfunc "QWS_Town_Warpra",3,"Amatsu Town"; + close; +} +comodo,195,158,4 script Warpra#19 113,{ + callfunc "QWS_Town_Warpra",5,"Comodo Town"; + close; +} +einbroch,229,196,5 script Warpra#20 113,{ + callfunc "QWS_Town_Warpra",7,"Einbroch Town"; + close; +} +einbech,173,131,5 script Warpra#21 113,{ + callfunc "QWS_Town_Warpra",6,"Einbech Town"; + close; +} +geffen,116,66,4 script Warpra#22 113,{ + callfunc "QWS_Town_Warpra",8,"Geffen Town"; + close; +} +gonryun,152,130,4 script Warpra#23 113,{ + callfunc "QWS_Town_Warpra",9,"Gonryun Town"; + close; +} +hugel,90,127,5 script Warpra#24 113,{ + callfunc "QWS_Town_Warpra",10,"Hugel Town"; + close; +} +jawaii,107,182,5 script Warpra#25 113,{ + callfunc "QWS_Town_Warpra",12,"Jawaii Town"; + close; +} +izlude,132,116,4 script Warpra#26 113,{ + callfunc "QWS_Town_Warpra",11,"Izlude Town"; + close; +} +lighthalzen,153,100,5 script Warpra#27 113,{ + callfunc "QWS_Town_Warpra",13,"Lighthalzen Town"; + close; +} +louyang,211,106,4 script Warpra#28 113,{ + callfunc "QWS_Town_Warpra",14,"Louyang Town"; + close; +} +morocc,157,95,4 script Warpra#29 113,{ + callfunc "QWS_Town_Warpra",16,"Morroc Town"; + close; +} +nif_fild01,319,77,1 script Warpra#30 113,{ + callfunc "QWS_Town_Warpra",17,"Niflheim Town"; + close; +} +payon,183,110,4 script Warpra#31 113,{ + callfunc "QWS_Town_Warpra",18,"Payon Town"; + close; +} +prontera,147,172,5 script Warpra#32 113,{ + callfunc "QWS_Town_Warpra",0,"Prontera Town"; + close; +} +umbala,133,130,4 script Warpra#33 113,{ + callfunc "QWS_Town_Warpra",19,"Umbala Town"; + close; +} +xmas,151,136,4 script Warpra#34 113,{ + callfunc "QWS_Town_Warpra",15,"Lutie Town"; + close; +} +yuno,138,162,4 script Warpra#35 113,{ + callfunc "QWS_Town_Warpra",20,"Yuno Town"; + close; +} + +abyss_02,274,266,1 script Warpra#36 113,{ + callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake"; + close; +} + +ama_dun02,192,118,5 script Warpra Helper#1 112,{ + callfunc "QWS_Dungeon_Warpra",1,"Amatsu Dungeon"; + close; +} + +anthell02,170,165,3 script Warpra Helper#2 112,{ + callfunc "QWS_Dungeon_Warpra",2,"Ant Hell Dungeon"; + close; +} + +ayo_dun02,258,193,5 script Warpra Helper#3 112,{ + callfunc "QWS_Dungeon_Warpra",3,"Ayotaya Dungeon"; + close; +} + +ein_dun02,292,282,1 script Warpra Helper#4 112,{ + callfunc "QWS_Dungeon_Warpra",8,"Einbech Dungeon"; + close; +} + +iz_dun03,202,47,2 script Warpra Helper#5 112,{ + callfunc "QWS_Dungeon_Warpra",4,"Byalan Dungeon"; + close; +} + +c_tower3,129,106,4 script Warpra Helper#6 112,{ + callfunc "QWS_Dungeon_Warpra",5,"Clock Tower Dungeon"; + close; +} + +mjo_dun02,39,25,4 script Warpra Helper#7 112,{ + callfunc "QWS_Dungeon_Warpra",6,"Coal Mine Dungeon"; + close; +} + +prt_sewb2,176,30,3 script Warpra Helper#8 112,{ + callfunc "QWS_Dungeon_Warpra",7,"Culvert Dungeon"; + close; +} + +gefenia03,137,34,0 script Warpra Helper#9 112,{ + callfunc "QWS_Dungeon_Warpra",9,"Gefenia Dungeon"; + close; +} + +gef_dun02,218,61,2 script Warpra Helper#10 112,{ + callfunc "QWS_Dungeon_Warpra",10,"Gefen Dungeon"; + close; +} + +glast_01,371,308,3 script Warpra Helper#11 112,{ + callfunc "QWS_Dungeon_Warpra",11,"Glast Heim Dungeon"; + close; +} + +gon_dun01,167,273,4 script Warpra Helper#12 112,{ + callfunc "QWS_Dungeon_Warpra",12,"Gonryun Dungeon"; + close; +} + +juperos_02,127,154,5 script Warpra Helper#13 112,{ + callfunc "QWS_Dungeon_Warpra",14,"Juperos Cave"; + close; +} + +kh_dun01,14,224,3 script Warpra Helper#14 112,{ + callfunc "QWS_Dungeon_Warpra",28,"Kiel Dungeon"; + close; +} + +lhz_dun02,156,151,5 script Warpra Helper#15 112,{ + callfunc "QWS_Dungeon_Warpra",15,"Lighthalzen Bio Lab"; + close; +} + +lou_dun02,168,264,4 script Warpra Helper#16 112,{ + callfunc "QWS_Dungeon_Warpra",16,"Louyang Dungeon"; + close; +} + +mag_dun02,46,41,3 script Warpra Helper#17 112,{ + callfunc "QWS_Dungeon_Warpra",17,"Magma Dungeon"; + close; +} + +odin_tem01,115,148,3 script Warpra Helper#18 112,{ + callfunc "QWS_Dungeon_Warpra",18,"Odin Temple"; + close; +} + +orcsdun01,185,11,3 script Warpra Helper#19 112,{ + callfunc "QWS_Dungeon_Warpra",19,"Orc Dungeon"; + close; +} + +pay_dun03,162,143,3 script Warpra Helper#20 112,{ + callfunc "QWS_Dungeon_Warpra",20,"Payon Dungeon"; + close; +} + +moc_pryd02,101,95,3 script Warpra Helper#21 112,{ + callfunc "QWS_Dungeon_Warpra",21,"Pyramides Dungeon"; + close; +} + +in_sphinx2,274,268,1 script Warpra Helper#22 112,{ + callfunc "QWS_Dungeon_Warpra",22,"Sphinx Dungeon"; + close; +} + +tha_t07,111,162,3 script Warpra Helper#23 112,{ + callfunc "QWS_Dungeon_Warpra",24,"Thanatos Tower"; + close; +} + +treasure02,104,40,3 script Warpra Helper#24 112,{ + callfunc "QWS_Dungeon_Warpra",23,"Sunken Ship Dungeon"; + close; +} + +xmas_dun02,124,131,3 script Warpra Helper#25 112,{ + callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon"; + close; +} + +um_dun02,44,28,3 script Warpra Helper#26 112,{ + callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon"; + close; +} + +tur_dun02,162,23,3 script Warpra Helper#27 112,{ + callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon"; + close; +} +prt_maze02,102,69,4 script Warpra Helper#28 112,{ + callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon"; + close; +} diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt new file mode 100644 index 000000000..9d0253164 --- /dev/null +++ b/npc/custom/events/cluckers.txt @@ -0,0 +1,114 @@ +//===== rAthena Script ======================================= +//= Cluck! Cluck! Boom! +//===== By: ================================================== +//= Keale +//===== Current Version: ===================================== +//= 1.2 +//===== Compatible With: ===================================== +//= rAthena SVN +//===== Description: ========================================= +//= Click the chicken and try retrieve the item at a low +//= chance. If you fail he will nuke, freeze, stone, +//= stun, or make you fall asleep. +//= The prize is configurable and triggered by the NPC. +//===== Additional Comments: ================================= +//= 1.0 First release. +//= 1.1 Using 'switch rand' instead. +//= 1.2 Cleaned and standardized. [Euphy] +//============================================================ + +prontera,156,219,4 script Cluckers 800,{ + + set .@GMAccess,80; // GM level required to access NPC + + if (.startcluck) { + specialeffect2 2; + switch(rand(15)) { + case 0: npctalk "CLUUUUUUCK!!!"; atcommand "@nuke "+strcharinfo(0); emotion 23; break; + case 1: npctalk "Cluuuuuck!~"; break; + case 2: atcommand "@nuke "+strcharinfo(0); break; + case 3: sc_start SC_Freeze,10000,0; break; + case 4: npctalk "CLUUUUUUUUUCK!!!"; atcommand "@nuke "+strcharinfo(0); emotion 23; break; + case 5: sc_start SC_Sleep,10000,0; break; + case 6: sc_start SC_Stone,10000,0; emotion 29; break; + case 7: npctalk "CLUUUUUUCK!!!"; atcommand "@nuke "+strcharinfo(0); emotion 23; break; + case 8: npctalk "Cluck! CLUUUCK!!"; atcommand "@nuke "+strcharinfo(0); emotion 23; break; + case 9: sc_start SC_Stun,10000,0; break; + case 10: sc_start SC_Sleep,10000,0; emotion 29; break; + case 11: npctalk "Cluck! Cluck!"; break; + case 12: sc_start SC_Stun,10000,0; break; + case 13: atcommand "@nuke "+strcharinfo(0); break; + default: + if (rand(50) < 4) { + npctalk "WOOF!..........."; + specialeffect2 72; + announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " squeezed out the prize! Well done!",0; + getitem $cluck_item_id,$cluck_item_amount; + set .startcluck,0; + } else { + npctalk "Cluck! CLUUUCK!!"; + atcommand "@nuke "+strcharinfo(0); + } + break; + } + end; + } + mes "[Cluckers]"; + if (getgmlevel() >= .@GMAccess) { + mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000"; + mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000"; + next; + while(1) switch(select("Start Event:Check Prize:Set Prize:Not today Cluckers")) { + case 1: + mes "[Cluckers]"; + mes "CLUCK! ^FF0000~Sure thing!~^000000"; + emotion 33; + close2; + announce "[Cluck! Cluck! Boom!] is about to start in Prontera!",bc_blue; + initnpctimer; + end; + case 2: + mes "[Cluckers]"; + mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +".^000000"; + next; + break; + case 3: + mes "[Cluckers]"; + mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000"; + input $cluck_item_id; + next; + mes "[Cluckers]"; + mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000"; + input $cluck_item_amount; + next; + mes "[Cluckers]"; + mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +"^000000? ^FF0000Great.~^000000"; + emotion 33; + next; + break; + case 4: + mes "[Cluckers]"; + mes "Cluck cluck cluck..."; + close; + } + } + mes "Cluck cluck! Cluuuuuck?"; + mes "Cluck...."; + close; + +OnTimer10000: + announce "Please hurry behind the fountain if you want to play with the crazy chicken!",bc_blue; + end; +OnTimer20000: + announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue; + end; +OnTimer30000: + announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue; + end; +OnTimer40000: + announce "GO! Click the chicken to get the prize!",bc_blue; + if (!$cluck_item_id) set $cluck_item_id,512; + if (!$cluck_item_amount) set $cluck_item_amount,1; + set .startcluck,1; + end; +} \ No newline at end of file diff --git a/npc/custom/events/disguise.txt b/npc/custom/events/disguise.txt new file mode 100644 index 000000000..12db534df --- /dev/null +++ b/npc/custom/events/disguise.txt @@ -0,0 +1,244 @@ +//===== rAthena Script ======================================= +//= Disguise Event +//===== By: ================================================== +//= GmOcean +//===== Current Version: ===================================== +//= 5.1 +//===== Compatible With: ===================================== +//= rAthena SVN +//===== Additional Comments: ================================= +//= 5.0 Last update by GmOcean. +//= 5.1 Cleaned and standardized, mostly. [Euphy] +//============================================================ + +prontera,160,155,4 script Disguise Event 795,{ + + // Currently set to run every two hours. + // To change times, edit the OnClock labels below. + + set .@GMLevel,60; // GM level required to access NPC. + set .@n$,"[^0000FFDisguise NPC^000000]"; + + if (getgmlevel()>=.@GMLevel) { + mes .@n$; + mes "Select an option."; + next; + switch(select("Turn ON/OFF Event:Event Settings")) { + case 1: + mes .@n$; + if ($@EventON) { + mes "The Event is currently: [^0000FFON^000000]"; + mes "Would you like to turn it OFF?"; } + else { + mes "The Event is currently: [^FF0000OFF^000000]"; + mes "Would you like to turn it ON?"; } + if(select("Yes:No")==2) close; + if ($@EventON) { + set $@EventON,0; set $@Timer,0; + setnpctimer 0; stopnpctimer; + announce "A GM has decided to turn the Disguise Event off. As a result no further prizes will be given.",bc_map | bc_blue; + deletepset 1; + setnpcdisplay "Disguise Event",795; + close; } + set $@EventON,1; set $@Timer,1; setnpctimer 0; initnpctimer; + set $@ResetCounter,$@ResetCounter+1; + announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue; + announce "The Event is being held in Prontera.",bc_all | bc_blue; + close; + case 2: + mes .@n$; + mes "Pick a setting to modify."; + next; + switch(select("Monster Display:Number of Rounds:Prize Settings")) { + case 1: + setarray .@r$[0],"Disguise as all monsters.","Disguise as MVPs only."; + mes .@n$; + mes "Choose a disguise rule."; + next; + set $Rule, select(implode(.@r$,":")); + mes .@n$; + mes "The Disguise Rule has been set:"; + mes " > ^0055FF"+.@r$[$Rule-1]+"^000000"; + close; + case 2: + mes .@n$; + mes "Input the number of rounds you want the event to last."; + mes "Current number: [^0000FF"+$Rounds+"^000000]"; + next; + input .@Rounds; + set $Rounds,.@Rounds; + mes .@n$; + mes "The number of rounds has been changed to "+$Rounds+"."; + close; + case 3: + mes .@n$; + mes "Input the Item ID of the prize given each round."; + mes "Current item: [^0000FF"+getitemname($Prize)+"^000000] (ID #"+$Prize+")"; + next; + input .@Prize; + mes .@n$; + if (getitemname(.@Prize)=="" || getitemname(.@Prize)=="null") { + mes "That item does not exist. Please try again."; + close; } + set $Prize,.@Prize; + mes "Input the amount to be given."; + next; + input .@amount; + mes .@n$; + if (.@amount<=0 || .@amount>=10000) { + mes "That amount is invalid. Using default ammount of 1."; + set .@amount,1; + next; + mes .@n$; } + set $PrizeAmt,.@amount; + mes "The Prize has been changed successfully."; + mes "Prize: "+$PrizeAmt+"x [^0000FF"+getitemname($Prize)+"^000000]"; + close; + } + } + } + if ($@EventON) end; + mes .@n$; + mes "Welcome."; + mes "How may I be of assistance?"; + if(select("Information:Nothing, just passing through.")==2) close; + next; + mes .@n$; + mes "This event is quite simple."; + mes "At the start of the event, I will"; + mes "disguise myself as a random"; + mes "monster. You have to shout"; + mes "that monter's name out loud."; + next; + mes "If you are correct, you will receive"; + mes "a prize. If not, keep trying!"; + mes "That's all that there is to this event."; + close; + +OnInit: + defpattern 1,"([^:]+):.\\s*OMFGBBQLEETSAUCEGMOCEANRULESHAI!!.*", "iCorrect"; + activatepset 1; + set $@EventON,0; + set $@Wait,0; + set $@Winner,0; + set $@ResetCounter,0; + set $Points,$Points; + if (!$Rounds) set $Rounds,10; + else set $Rounds,$Rounds; + if (!$Prize) set $Prize,512; + else set $Prize,$Prize; + if (!$PrizeAmt) set $PrizeAmt,1; + else set $PrizeAmt,$PrizeAmt; + if ($Rule) set $Rule,1; + else set $Rule,$Rule; + setarray $@MVP[0],1038,1039,1046,1059,1086,1087,1112,1115,1147,1150,1157,1159,1190,1251,1252,1272,1312,1373, + 1389,1399,1418,1492,1502,1511,1583,1623,1630,1646,1647,1648,1649,1650,1651,1658,1685,1688, + 1708,1719,1734,1751,1768,1779,1785,1802,1832,1871,1874,1885,1917,1980,2022,2068,2087,2131, + 2156,2165; + setarray $@BlackList[0], 1003,1006,1017,1021,1022,1027,1043,1075,1136,1137,1168,1171,1172,1173,1181,1210,1217,1218, + 1222,1223,1224,1225,1226,1227,1228,1233,1284,1407,1411,1414,1495,1501,1900,1996,2000,2001, + 2002,2003,2004,2005,2006,2007,2011,2012,2025,2028,2029,2030,2031,2032,2033,2034,2035,2036, + 2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054, + 2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2075,2076,2077,2078,2079, + 2080,2081,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098, + 2099,2100,2101,2012,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116, + 2117,2118; + setarray $@BlackList2[0],2119,2120,2121,2123,2124,2125,1496; + end; +OnClock0000: +OnClock0200: +OnClock0400: +OnClock0600: +OnClock0800: +OnClock1000: +OnClock1200: +OnClock1400: +OnClock1600: +OnClock1800: +OnClock2000: +OnClock2200: + set $@ResetCounter,$@ResetCounter+1; + set $@EventON,1; + set $@Timer,1; + set $@Wait,1; + announce "The Disguise Event will begin in 3 minutes.",bc_all | bc_blue; + announce "The Event is being held in Prontera.",bc_all | bc_blue; + setnpctimer 0; + initnpctimer; + end; +OnTimer10000: + if ($@Timer || $@Change) end; + set $@Wait,0; + goto iDisguise; + end; +OnTimer30000: + if ($@Timer) end; + set $@Change,0; + setnpcdisplay "Disguise Event",795; + npctalk "You took too long to guess what I was. Please wait 10 seconds while I disguise again."; + specialeffect 725; + set $MonsterName$,""; + deletepset 1; + stopnpctimer; + setnpctimer 0; + initnpctimer; + end; +OnTimer60000: + if ($@Timer!=1) end; + announce "The Disguise Event will begin in 2 minutes.",bc_all | bc_blue; + announce "The Event is being held in Prontera.",bc_all | bc_blue; + end; +OnTimer120000: + if ($@Timer!=1) end; + announce "The Disguise Event will begin 1 minute.",bc_all | bc_blue; + announce "The Event is being held in Prontera.",bc_all | bc_blue; + end; +OnTimer180000: + if ($@Timer!=1) end; + announce "The Disguise Event has begun!",bc_all | bc_blue; + announce "The Event is being held in Prontera.",bc_all | bc_blue; + set $@Timer,0; stopnpctimer; + setnpctimer 0; initnpctimer; + goto iDisguise; + end; +iDisguise: + if ($Rule==1) { + set $@Winner,0; + set $@Monster,1000+rand(1,995); + for(set .@BL,0; .@BL=$Rounds) { + setnpcdisplay "Disguise Event",795; + set $@RoundCount,0; set $@Change,0; set $@EventON,0; + setnpctimer 0; stopnpctimer; + npctalk "Thank you all for playing. That was the last round of the Disguise Event. Come play again later."; + end; } + setnpcdisplay "Disguise Event",795; + set $@Change,0; + setnpctimer 0; + end; +} \ No newline at end of file diff --git a/npc/custom/events/draculax.txt b/npc/custom/events/draculax.txt deleted file mode 100644 index 13eb8fc8f..000000000 --- a/npc/custom/events/draculax.txt +++ /dev/null @@ -1,129 +0,0 @@ -//===== rAthena Script ======================================= -//= Dracula X -//===== By: ================================================== -//= valaris (1.0) -//===== Current Version: ===================================== -//= 1.0a -//===== Compatible With: ===================================== -//= rAthena SVN -//===== Description: ========================================= -//= Custom Dracula X Event -//============================================================ - -mag_dun02,72,182,1 script Dracula's Coffin::Dracula_Init -1,{ - -OnInit: - set $dracula_event,0; - end; - -OnKilled: - MapAnnounce "mag_dun02","Dracula's curse has been lifted!",17; - set $dracula_event,0; - initnpctimer; - end; - -OnTimer7200000: - if($dracula_event==0) - stopnpctimer; - enablenpc "Dracula_Event"; - end; -} - -mag_dun02,72,182,1 script Dracula's Coffin::Dracula_Event 801,{ - - if($dracula_event==1) - close; - - set $dracula_event,1; - MapAnnounce "mag_dun02","Count Dracula : Who has awakened me from my slumber?",17; - npcskilleffect 21,10,66,175; - initnpctimer; - end; - -OnTimer500: - npcskilleffect 21,10,74,187; - end; - -OnTimer1000: - npcskilleffect 21,10,80,180; - end; - -OnTimer1500: - npcskilleffect 21,10,79,183; - end; - -OnTimer2000: - npcskilleffect 21,10,66,175; - end; - -OnTimer2500: - npcskilleffect 21,10,63,186; - end; - -OnTimer3000: - npcskilleffect 21,10,75,186; - end; - -OnTimer3500: - npcskilleffect 21,10,75,173; - end; - -OnTimer4000: - npcskilleffect 21,10,80,170; - end; - -OnTimer4500: - npcskilleffect 21,10,60,179; - end; - -OnTimer5000: - npcskilleffect 21,10,74,187; - end; - -OnTimer6000: - npcskilleffect 21,10,69,182; - end; - -OnTimer6500: - npcskilleffect 21,10,80,180; - end; - -OnTimer7000: - npcskilleffect 21,10,60,179; - end; - -OnTimer7500: - npcskilleffect 21,10,66,175; - end; - -OnTimer8000: - npcskilleffect 21,10,80,187; - end; - -OnTimer8500: - npcskilleffect 21,10,75,186; - end; - -OnTimer9000: - npcskilleffect 21,10,75,173; - end; - -OnTimer9500: - npcskilleffect 21,10,80,170; - end; - -OnTimer10000: - npcskilleffect 21,10,63,186; - end; - -OnTimer10500: - npcskilleffect 21,10,74,187; - end; - -OnTimer11000: - npcskilleffect 21,10,72,182; - monster "mag_dun02",72,182,"Count Dracula",1389,1,"Dracula_Init::OnKilled"; - stopnpctimer; - disablenpc "Dracula_Event"; - end; -} diff --git a/npc/custom/events/hyegun_event.txt b/npc/custom/events/hyegun_event.txt deleted file mode 100644 index 084df8eca..000000000 --- a/npc/custom/events/hyegun_event.txt +++ /dev/null @@ -1,77 +0,0 @@ -//===== rAthena Script ======================================= -//= HyeGun Event -//===== By: ================================================== -//= Synesthesia -//===== Current Version: ===================================== -//= 1.0 -//===== Compatible With: ===================================== -//= rAthena SVN -//===== Description: ========================================= -//= Event similar to iRO's Christmas event when searching for Antonios. -//===== Additional Comments: ================================= -//= Drink Jakada! -//============================================================ - -//HyeGun Mob spawning -anthell01,0,0,0,0 monster Hyegun 1512,3,180000,30000,0 -mag_dun01,0,0,0,0 monster Hyegun 1512,3,180000,30000,0 -alde_dun01,0,0,0,0 monster Hyegun 1512,3,180000,30000,0 -in_sphinx1,0,0,0,0 monster Hyegun 1512,3,180000,30000,0 - -//Munak Quest -pay_dun01,53,269,6 script Munak 1026,{ - if(event_hyegun==3) goto Lfinished; - mes "[^FF0000Munak^000000]"; - mes "Hello, kinda strange talking to a Munak huh?"; - mes "I'm a friendly Munak that wants to tell you something."; - menu "Listen to her story",Lok,"Leave",Lno; - -Lok: - mes "[^FF0000Munak^000000]"; - mes "Well see our father ^666600HyeGun^000000 has been terrible to us Munaks."; - mes "We would like you to get revenge for what he has done to us."; - next; - mes "When you find him, kill him."; - mes "He will drop an item that you will have to bring to me to prove his death."; - mes "Bring me ^FF00003 ^008800Yggdrasil Dew^000000 and I'll give you a reward."; - mes "Remember, you may only do this quest ^FF00003 times."; - menu "Info about HyeGun",Lhyeinfo,"Give her the items",Litem,"Leave",Lno; - -Lhyeinfo: - mes "[^FF0000Munak^000000]"; - mes "- HyeGun looks like us but he's a tanish color type with long hair."; - mes "- He's been last seen in the first level of the 4 most popular dungeons."; - mes "He doesn't hang out here because there's so many of us."; - mes "Anything else?"; - menu "Info about HyeGun",Lhyeinfo,"Give her the items",Litem,"Leave",Lno; - -Litem: - mes "[^FF0000Munak^000000]"; - mes "Ahh so you've completed the task so soon?"; - mes "Good job"; - mes "Let's see if you've got the right stuff."; - next; - if (countitem(7141) < 3)goto Lnoitem; - mes "Good job, here's your reward."; - next; - delitem 7141,3; - getitem 617,1; - set event_hyegun,event_hyegun+1; - close; - -Lfinished: - mes "[^FF0000Munak^000000]"; - mes "I'm sorry, you've already completed my task 3 times."; - close; - -Lno: - mes "[^FF0000Munak^000000]"; - mes "Okay then, when you feel brave enough, come on back."; - close; - -Lnoitem: - mes "[^FF0000Munak^000000]"; - mes "Hey, you don't have the Yggdrasil Dew."; - mes "Come back when you've gotten 3 of them."; - close; -} diff --git a/npc/custom/events/mushroom_event.txt b/npc/custom/events/mushroom_event.txt new file mode 100644 index 000000000..bbb8e91ab --- /dev/null +++ b/npc/custom/events/mushroom_event.txt @@ -0,0 +1,62 @@ +//===== rAthena Script ======================================= +//= Find the Mushroom +//===== By: ================================================== +//= Mysterious +//===== Current Version: ===================================== +//= 3.6a +//===== Compatible With: ===================================== +//= rAthena SVN +//===== Description: ========================================= +//= Find the Mushroom - random amount of Mushrooms spawns in random maps. +//= Players need to find these mushrooms and kill them to gain prizes! +//===== Additional Comments: ================================= +//= 3.0 Fully Functional with Rewritten script. [Mysterious] +//= 3.6a Slightly edited. [Euphy] +//============================================================ + +prontera,142,228,6 script Find the Mushroom 1084,{ + mes "[ Find The Mushroom ]"; + if (!.Status) + mes "There is no event at the moment!"; + else { + mes "There are "+.Spawn+" Mushrooms left in "+.Map$+"!"; + mes "Find and kill the mushrooms to gain "+getitemname(.Prize)+"!"; + } + if (.Status || getgmlevel() < .GM) close; + mes "Start the event?"; + next; + if(select("- No:- Yes") == 1) close; + donpcevent strnpcinfo(0)+"::OnMinute10"; + mes "[ Find The Mushroom ]"; + mes "Event started!"; + close; + +OnInit: + set .Prize,512; // Reward item ID + set .Amount,10; // Reward item amount + set .GM,60; // GM level required to access NPC + setarray .Maps$[0],"izlude","geffen","morocc","prontera"; // Possible maps + end; + +OnMinute10: // Start time (every hour) + if (.Status) end; + set .Status,1; + set .Spawn,rand(1,10); // How many Mushrooms should spawn? + set .Map$,.Maps$[rand(getarraysize(.Maps$))]; + killmonster .Map$,"All"; + monster .Map$,0,0,"Please don't kill me!",1084,.Spawn,strnpcinfo(0)+"::OnMobKilled"; + announce "Find the Mushroom : Total of "+.Spawn+" Mushrooms have been spawned in "+.Map$+"!",0; + sleep 2500; + announce "Find the Mushroom : Every Mushroom you kill will give you "+getitemname(.Prize)+"!",0; + end; + +OnMobKilled: + set .Spawn, .Spawn - 1; + getitem .Prize, .Amount; + if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map; + else { + announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0; + set .Status,0; + } + end; +} \ No newline at end of file diff --git a/npc/custom/quest_warper.txt b/npc/custom/quest_warper.txt deleted file mode 100644 index 85919fa0f..000000000 --- a/npc/custom/quest_warper.txt +++ /dev/null @@ -1,2137 +0,0 @@ -//===== rAthena Script ============================================ -//= Quest Warper Script -//===== By: ======================================================= -//= DZeroX, Darkchild, Neouni -//===== Current Version: ========================================== -//= 2.2 -//===== Compatible With: ========================================== -//= rAthena SVN -//===== Description: ============================================== -//= Warper that works only after locations are unlocked -//===== Additional Comments: ====================================== -//= 1.0 - NPCs created -//= 1.1 - Add Dungeons by sturm -//= 1.2 - Add All char in account unlocked by ace_killer -//= 1.3 - Add new 7 towns and 7 dungeons by escoteiro -// - Correct bug jawaii town by escoteiro -// - Remove some excessive warpras by escoteiro -//= 1.4 - Rewrite of the Warpa system [Neouni] -// - Corrected some bugs caused by autoconverting the old script -//= 1.4a - Rewrite of menu to be custom for each player [Neouni] -// - Dungeon listing rewrite -// - Town listing rewrite -// - GameMaster can Customise Main menu -//= 1.4b - Pricing round [Neouni] -// - GM menu added for pricing -// - Town Warp pricing tags added -// - Dungeon Warp pricing tags added -//= 1.5 - storage functions pricing [Neouni] -// - storage pricing added -// - kafra points setting added -// - kafra storage code security added -// - Healing scripts pricing added -// - Heal Part script added -//= 1.6 - Dungeon warp [Neouni] (beta only) -// - added option to add a extra fee for going down deeper into dungeon -// partly by rebuilding the dungeon warping into variable menu's -//= 1.6a - alot of fixes for beta release [Neouni] (public release) -// - fixed syntax problems -// - fixed missing pyramid gats in @DGat$ array -// - removed the culver level 5 that didn't exist -// and caused quite alot of problems (i didn't check while converting) -//-1.7 - Readability of Dungeon menu building increased [Neouni] -// - Thanatos Tower & Louyang Dungeon added -//-1.8 - changed around unlock variables [Neouni] -// - Moved warp variables to mark what you have unlocked to an binary array in login based permanent variable -// (warp variables are saved in login database, so all charservers have these unlocked) -// - Town Warp unlock array max 21/(unknown max) items used instead of max account #variables 32 ! -// - Dungeon Warp unlock array 28/(unknown max) items used instead of max account #variables 32 ! -// - (max login ##variables = 16, i used 3) -// - old variables are cleared on next save -// - Extra Variable clear added for every character, just in case (request by Terces) -//-1.8a - Show ammount of users on map [Neouni] -// - Default = off, enable in GM menu -// - Requested by escoteiro -//-1.8b - Small typo fixed in stampcard script [Neouni] -// - Reported by escoteiro -//-1.9 - Making it more edit friendly [Neouni] -// - Made Dungeon warp arrays more readable & editable (QWS_Darray) -// - Made town warp arrays more readable & editable (QWS_Tarray) -//-2.0 - Special Warp menu added [Neouni] -// - when all towns and dungeons are collected a new option on the main menu will show -// - it will only show when you setup the mapname of the warp ! -// - requested by escoteiro -// - several bugs fixed -//-2.0a - Dungeon Level Limit & Split dungeon fees -// - Limits dungeon based on Depth, access special setup menu thru GM-Menu -// - Dungeon fees split up based on Basic , Advanced & Overseas -// - Old Dungeon fee system removed, all dungeon fees now set to 0 -//-2.0b -// - Special warpname menu option name bug fixed -//-2.1 Updated names to fall within retrictions. [L0ne_W0lf] -//-2.2 #kafra_code is now stored as is. [brianluau] -//================================================================= - -//========================Function=&=Script======================== - - -function script Q_Warpra { -// Quick hack for backwards compatibility pre 1.8 -if (##QWS_UP < 18) callfunc "QWS_BackComp"; -// Extra clear variables because marker is saved on all char servers and variables can be on multiple servers -if (QWS_ExtraVARClear < 18) callfunc "Extra_Variable_Clear"; - - mes "[Warpra]"; - mes "Hello,"; - mes "I can warp you to any town or dungeon, but you need to unlock them first."; - mes "To unlock them, you have to visit us."; - mes "What do you need?"; - - if(getarg(0) == 0) callfunc "QWS_MMarray",0; - if(getarg(0) == 1) callfunc "QWS_MMarray",1; - - 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]); - - switch(@Mmenuref[@MMenu-1]+1){ - case 1: - goto GM_Menu; - case 2: - warp $QW_SP_WarpMap$, $QW_SP_WarpX, $QW_SP_WarpY; - close2; - debugmes "Please check your special warp menu settings on the Warpra"; - end; - case 3: - goto L_town; - case 4: - goto L_dungeon; - case 5: - goto L_FewWarps; - case 6: - goto L_NoUnlock; - case 7: - goto L_heal_Full; - case 8: - goto L_heal_Part; - case 9: - goto L_Storage; - case 10: - goto L_GStorage; - case 11: - goto L_end; - default: - goto L_end; -} - -//=====================GM-Menu=Functions=========================== - -GM_Menu: -next; -//----------------Town-Warp - if ($QW_TW_OFF == 0) mes "Town warping = ^00FF00 On ^000000"; - if ($QW_TW_OFF == 1) mes "Town warping = ^FF0000 Off ^000000"; -//----------------Dungeon-Warp - if ($QW_DW_OFF == 0) mes "Dungeon warping = ^00FF00 On ^000000"; - if ($QW_DW_OFF == 1) mes "Dungeon warping = ^FF0000 Off ^000000"; -//----------------Dungeon-Depth-Limit - if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; - if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; - mes "If on Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; -//----------------ShowMapUsers - if ($QW_MapUserShow == 1) mes "Show Map Users = ^00FF00 On ^000000"; - if ($QW_MapUserShow == 0) mes "Show Map Users = ^FF0000 Off ^000000"; -//----------------Healfull - if ($QW_HF == 1) mes "Healing full = ^00FF00 On ^000000"; -//----------------Healpart - if ($QW_HP == 1) mes "Healing partly = ^00FF00 On ^000000"; - if (($QW_HF == 0)&&($QW_HP == 0)) mes "Healing = ^FF0000 Off ^000000"; -//----------------Storage - if ($QW_Stor == 1) mes "Storage = ^00FF00 On ^000000"; - if ($QW_Stor == 0) mes "Storage = ^FF0000 Off ^000000"; -//----------------GuildStorage - if ($QW_GStor == 1) mes "Guild Storage = ^00FF00 On ^000000"; - if ($QW_GStor == 0) mes "Guild Storage = ^FF0000 Off ^000000"; -//----------------KafraPoints - if ($QW_KPoint == 1) mes "Kafra points collect = ^00FF00 On ^000000"; - if ($QW_KPoint == 0) mes "Kafra points collect = ^FF0000 Off ^000000"; -//----------------GMmenu - 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")) { - -// Using callsub and a small check to not make 1 part of the script set it on and the other turning it off again - -case 1: - if ($QW_TW_OFF == 0) { - set $QW_TW_OFF,1; - goto GM_Menu; - } else - set $QW_TW_OFF,0; - goto GM_Menu; -case 2: - if ($QW_DW_OFF == 0) { - set $QW_DW_OFF,1; - goto GM_Menu; - } else - set $QW_DW_OFF,0; - goto GM_Menu; -case 3: - goto DungeonLevelLimit; -case 4: - if ($QW_MapUserShow == 0) { - set $QW_MapUserShow,1; - goto GM_Menu; - } else - set $QW_MapUserShow,0; - goto GM_Menu; -case 5: - if ($QW_HF == 0) { - set $QW_HF,1; - set $QW_HP,0; - goto GM_Menu; - } else - set $QW_HF,0; - goto GM_Menu; -case 6: - if ($QW_HP == 0) { - set $QW_HP,1; - set $QW_HF,0; - goto GM_Menu; - } else - set $QW_HP,0; - goto GM_Menu; -case 7: - if ($QW_Stor == 0) { - set $QW_Stor,1; - goto GM_Menu; - } else - set $QW_Stor,0; - goto GM_Menu; -case 8: - if ($QW_GStor == 0) { - set $QW_GStor,1; - goto GM_Menu; - } else - set $QW_GStor,0; - goto GM_Menu; -case 9: - if ($QW_KPoint == 0) { - set $QW_KPoint,1; - goto GM_Menu; - } else - set $QW_KPoint,0; - goto GM_Menu; -case 10: - goto Setprice; -case 11: - goto SpecialWarpMenu; -default: - close; - end; -} - - -//======================GM-Menu=Pricing============================ - -Setprice: - if ($QW_DW_FEE != 0) set $QW_DW_FEE,0; - next; - mes "Scroll thru the list to see all the options"; -//----------------Warp-Basic-Price - if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; - if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; -//----------------Warp-Advanced-Price - if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; - if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; -//----------------Warp-Oversea-Price - if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; - if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; -//----------------Basic-Dungeon-Level-Warp-Fee - if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; - if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; -//----------------Advanced-Dungeon-Level-Warp-Fee - if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; - if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; -//----------------Overseas-Dungeon-Level-Warp-Fee - if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; - if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; -//----------------Heal-Full - if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; - if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; -//----------------Heal-Part - if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; - if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; - if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; - if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; -//----------------Storage - if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; - if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; - if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; -//----------------Guild-Storage - if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; - if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; - - 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")) { - -case 1: - next; - if ($QW_BW_PRICE != 0) mes "Basic - Warps are = ^00FF00 "+$QW_BW_PRICE+" ^000000"; - if ($QW_BW_PRICE == 0) mes "Basic - Warps are = ^FF0000 Free ^000000"; - mes "Basic - Warps are starter towns and related dungeons"; - input $QW_BW_PRICE; - goto Setprice; - -case 2: - next; - if ($QW_AW_PRICE != 0) mes "Advanced - Warps are = ^00FF00 "+$QW_AW_PRICE+" ^000000"; - if ($QW_AW_PRICE == 0) mes "Advanced - Warps are = ^FF0000 Free ^000000"; - mes "Advanced - Warps are towns and dungeons on the same island but not close to any starter town"; - input $QW_AW_PRICE; - goto Setprice; - -case 3: - next; - if ($QW_OW_PRICE != 0) mes "Overseas - Warps are = ^00FF00 "+$QW_OW_PRICE+" ^000000"; - if ($QW_OW_PRICE == 0) mes "Overseas - Warps are = ^FF0000 Free ^000000"; - mes "Overseas - Warps are towns and dungeons overseas reachable by boat from alberta"; - input $QW_OW_PRICE; - goto Setprice; - -case 4: - next; - if ($QW_BW_FEE != 0) mes "Basic Dungeon level warp fee = ^00FF00 "+$QW_BW_FEE+" ^000000 zeny per level"; - if ($QW_BW_FEE == 0) mes "Basic Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; - mes "Basic - Warps are starter town related dungeons"; - mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; - mes "These costs are on top of the regular Warp costs"; - input $QW_BW_FEE; - goto Setprice; - -case 5: - next; - if ($QW_AW_FEE != 0) mes "Advanced Dungeon level warp fee = ^00FF00 "+$QW_AW_FEE+" ^000000 zeny per level"; - if ($QW_AW_FEE == 0) mes "Advanced Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; - mes "Advanced - Warps are dungeons not close to any starter town"; - mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; - mes "These costs are on top of the regular Warp costs"; - input $QW_AW_FEE; - goto Setprice; - -case 6: - next; - if ($QW_OW_FEE != 0) mes "Overseas Dungeon level warp fee = ^00FF00 "+$QW_OW_FEE+" ^000000 zeny per level"; - if ($QW_OW_FEE == 0) mes "Overseas Dungeon level warp fee = ^FF0000 NO ^000000 zeny per level"; - mes "Overseas - Warps are dungeons related to towns overseas reachable by boat from alberta"; - mes "Dungeon warp fees are calculated by maps away from entrance of the dungeon times Dungeon warp fee"; - mes "These costs are on top of the regular Warp costs"; - input $QW_OW_FEE; - goto Setprice; - -case 7: - next; - if ($QW_HF_PRICE != 0) mes "Full Healing = ^00FF00 "+$QW_HF_PRICE+" ^000000"; - if ($QW_HF_PRICE == 0) mes "Full Healing = ^FF0000 Free ^000000"; - mes "Instant full healing 1 price"; - input $QW_HF_PRICE; - goto Setprice; - -case 8: - next; - if ($QW_HP_H_PRICE != 0) mes "^FF0000HP ^000000Part Healing = ^00FF00 "+$QW_HP_H_PRICE+" ^000000 a point"; - if ($QW_HP_H_PRICE == 0) mes "^FF0000HP ^000000Part Healing = ^FF0000 Free ^000000"; - if ($QW_HP_S_PRICE != 0) mes "^0000FFSP ^000000Part Healing = ^00FF00 "+$QW_HP_S_PRICE+" ^000000 a point"; - if ($QW_HP_S_PRICE == 0) mes "^0000FFSP ^000000Part Healing = ^FF0000 Free ^000000"; - mes "Healing price per 1 HP"; - mes "Healing price per 1 SP"; - mes "2 inputs, first HP then SP"; - input $QW_HP_H_PRICE; - input $QW_HP_S_PRICE; - goto Setprice; - -case 9: - next; - if (($QW_S_PRICE != 0)&&($QW_S_PRICE != 60)) mes "Storage = ^00FF00 "+$QW_S_PRICE+" ^000000"; - if ($QW_S_PRICE == 0) mes "Storage = ^FF0000 Free ^000000"; - if ($QW_S_PRICE == 60) mes "Storage = ^0000FF Kafra Mode ^000000"; - mes "Storage cost, if set to 60 Kafra pricing will be handled"; - input $QW_S_PRICE; - goto Setprice; - -case 10: - next; - if ($QW_GS_PRICE != 0) mes "Guild Storage = ^00FF00 "+$QW_GS_PRICE+" ^000000"; - if ($QW_GS_PRICE == 0) mes "Guild Storage = ^FF0000 Free ^000000"; - mes "Guild Storage, free on Guild Kafras"; - input $QW_GS_PRICE; - goto Setprice; -case 11: - goto GM_Menu; -default: - close; - end; -} - -//======================Special=Warp=Menu========================== - -SpecialWarpMenu: - if ($QW_SP_Warpname$ == "") set $QW_SP_Warpname$,"Special Warp"; - next; - mes "Scroll down to see all the information"; - mes "The Special warp menu option will show in the main menu when all towns & dungeons are unlocked"; - mes "And when the map for special warping has been set"; - mes "menu option name set to ^0000FF"+$QW_SP_Warpname$+"^000000"; - if ($QW_SP_WarpMap$ == "") mes "map is currently ^FF0000not^000000 set, and Special warp menu is off"; - if ($QW_SP_WarpMap$ != "") mes "map is currently set to ^0000FF"+$QW_SP_WarpMap$+"^000000 and Special Warp menu is on"; - mes "coords are set to ^0000FF"+$QW_SP_WarpX+","+$QW_SP_WarpY+"^000000"; - switch(select("Set Special Warp name to show in menu", "Set WarpMap","Set Coords","Go Back to GM_Menu","Exit")){ - -case 1: - next; - mes "set the name to show in the menu as option"; - input $QW_SP_Warpname$; - goto SpecialWarpMenu; -case 2: - next; - mes "set the map in the ^0000FFmapname^000000 format"; - mes "when this warpmap is set the option for players will show once they meet the requirments"; - mes "to disable Special Warp Menu option clear this !"; - input $QW_SP_WarpMap$; - goto SpecialWarpMenu; -case 3: - next; - mes "First input = Xcoord"; - mes "Second input = Ycoord"; - input $QW_SP_WarpX; - input $QW_SP_WarpY; - goto SpecialWarpMenu; -case 4: - goto GM_Menu; -default: - close; - end; -} - -//======================Dungeon=Level=Limit======================== -DungeonLevelLimit: - next; - if ($QW_DL == 1) mes "Dungeon Depth limit is ^00FF00 On ^000000"; - if ($QW_DL == 0) mes "Dungeon Depth limit is ^FF0000 Off ^000000"; - mes "If^00FF00 On ^000000Dungeon Depth limit is set to ^0000FF"+$QW_DDL+"^000000"; - - switch(select("Toggle Dungeon Depth Limit", "Set Dungeon Depth Limit","Go Back to GM_Menu","Exit")){ - -case 1: - if ($QW_DL == 0) { - set $QW_DL,1; - goto DungeonLevelLimit; - } else - set $QW_DL,0; - goto DungeonLevelLimit; -case 2: - next; - mes "set limit of Dungeon Depth 0 = entrance"; - mes "Depth 1 is a map connected to 0 and so on"; - mes "Shortest Route to map counts as depth"; - input $QW_DDL; - goto DungeonLevelLimit; -case 3: - goto GM_Menu; -default: - close; - end; -} - -//===========================Towns================================= - -L_town: - callfunc "QWS_Tarray"; - -// Expected maximum is set to 25 items, if you add more options add more ",@Tmenulist$[xx]" - - 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]); - - if (@Tmenuref[@TWMenu-1] == 57005) goto L_end; // 57005='dead' in hex - - if(Zeny<@pTprice[@Tmenuref[@TWMenu-1]]) callsub L_Short_on_zeny,0; - - set Zeny, Zeny-@pTprice[@Tmenuref[@TWMenu-1]]; - if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@pTprice[@Tmenuref[@TWMenu-1]]/16); - warp @pTmap$[@Tmenuref[@TWMenu-1]],@pTXcoords[@Tmenuref[@TWMenu-1]],@pTYcoords[@Tmenuref[@TWMenu-1]]; - close2; // this part safegaurds against errors/typos - set Zeny, Zeny+@pTprice[@Tmenuref[@TWMenu-1]]; - end; - -//=========================Dungeons================================ - -L_dungeon: - callfunc "QWS_Darray"; - -// Expected maximum is set to 35 items, if you add more options add more ",@Dmenulist$[xx]" - - 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]); - - if (@Dmenuref[@DWMenu-1] == 57005) goto L_end; // 57005='dead' in hex - set @DwarpMenu, (@Dmenuref[@DWMenu-1]); - callfunc "QWS_DLarray"; - - next; - mes "[Warpra]"; - mes "Please select where you want to go"; - -// Expected maximum is set to 18 items, if you have dungeons with more levels add more ",@DWLmenulist$[xx]" - 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]); - - if (@DWLmenuref[@DWLMenu-1] == 57005) goto L_end; // 57005='dead' in hex - - set @Darrayref, @DWLmenuref[@DWLMenu-1]; - set @warpprice, @pDprice[@Dmenuref[@DWMenu-1]]+(getd(@pDfee$[@Dmenuref[@DWMenu-1]])*(@DDepth[@Darrayref])); - - if(Zeny<@warpprice) callsub L_Short_on_zeny,1; - - set Zeny, Zeny-(@warpprice); - if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@warpprice/16); - warp @DGat$[@Darrayref],@DXcoords[@Darrayref],@DYcoords[@Darrayref]; - close2; // this part safegaurds against errors/typos - set Zeny, Zeny+@pTprice[@Tmenuref[@DWMenu-1]]; - end; - -//=============================Healing============================= - -L_heal_Full: - set @healfee, $QW_HF_PRICE; - if(Zeny<@healfee) callsub L_Short_on_zeny,4; - set Zeny, Zeny-@healfee; - if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@healfee/500); - next; - mes "[Warpra]"; - mes "Close this window and I will Heal you."; - close2; - percentheal 100,100; - end; - -L_heal_Part: - set @healchoice,select("Full heal","Health Points only","Skill Points only","Exit"); - if (@healchoice == 1) callsub PHeal,1,1; - if (@healchoice == 2) callsub PHeal,1,0; - if (@healchoice == 3) callsub PHeal,0,1; - goto L_end; - -PHeal: - next; - set @Hp, MaxHp-Hp; - set @Sp, MaxSp-Sp; - set @HpPrice, @hp*$QW_HP_H_PRICE; - set @SpPrice, @sp*$QW_HP_S_PRICE; - mes "[Warpra]"; - if(getarg(0) == 1) mes ""+@HpPrice+" Zeny for "+@Hp+" health points"; - if(getarg(1) == 1) mes ""+@SpPrice+" Zeny for "+@Sp+" skill points"; - set @total, @HpPrice+@SpPrice; - mes "for a total of "+@total+" zeny"; - if (select("Heal me","Let me see the choices again")==2) goto L_heal_Part; - - if(getarg(0) == 1)set @HpPrice, (MaxHp-Hp)*$QW_HP_H_PRICE; - if(getarg(1) == 1)set @SpPrice, (MaxSp-Sp)*$QW_HP_S_PRICE; - set @healfee, @HpPrice+@SpPrice; - if (getarg(0) == 1)&&(getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_Short_Both; - if (getarg(0) == 1)&&(Zeny<@healfee) goto Zeny_short_HP; - if (getarg(1) == 1)&&(Zeny<@healfee) goto Zeny_short_SP; - set Zeny, Zeny-@healfee; - if (getarg(0) == 1)&&(getarg(1) == 1) percentheal 100,100; - if (getarg(0) == 1) percentheal 100,0; - if (getarg(1) == 1) percentheal 0,100; - close; - end; - -Zeny_Short_Both: - mes "[Warpra]"; - mes "choose another option, you can afford both."; - mes "I can heal as much as you can afford too."; - if (select("OK","Exit") == 2) goto L_end; - goto PHeal; - -Zeny_short_HP: - mes "[Warpra]"; - mes "do you want me to partly heal your HP ?"; - if (select("Yes","No") == 2) goto L_end; - set @Hp, Zeny/$QW_HP_H_PRICE; - set @HpPrice, @Hp*$QW_HP_H_PRICE; - if (@Hp == 1) mes "your not worth the effort"; - if (@Hp == 1) goto L_end; - set Zeny, Zeny-@HpPrice; - heal @Hp,0; - close; - end; - - -Zeny_short_SP: - mes "[Warpra]"; - mes "do you want me to partly heal your SP ?"; - if (select("Yes","No") == 2) goto L_end; - set @Sp, Zeny/$QW_HP_S_PRICE; - set @SpPrice, @Sp*$QW_HP_S_PRICE; - if (@Sp == 1) mes "your not worth the effort"; - if (@Sp == 1) goto L_end; - set Zeny, Zeny-@SpPrice; - heal 0,@Sp; - close; - end; - - -//=============================Storage============================= - -L_Storage: - next; - if(basicskillcheck() > 0 && getskilllv("NV_BASIC") < 6) goto L_StorageJBlow; - set @fee, $QW_S_PRICE; - if ($QW_S_PRICE == 60)&&(BaseJob == Job_Novice) set @fee, 30; - if ($QW_S_PRICE == 60)&&(BaseJob != Job_Novice) set @fee, 60; - if(Zeny<@fee) callsub L_Short_on_zeny,2; - set Zeny, Zeny-@fee; - if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + (@fee/5); - - mes "[Warpra]"; - mes "Close this window and i will open your storage."; - - callsub F_CheckKafCode; //check your storage password thru kafra coding, if set - - close2; - openstorage; - end; - -F_CheckKafCode: - if(#kafra_code==0) return; - mes "Enter your storage password:"; - set @code_,0; - input @code_; - if(@code_ != #kafra_code) { - dispbottom "Wrong storage password."; - close; - } - set @kafcode_try,0; - set @code_,0; - return; - -L_StorageJBlow: - mes "[Warpra]"; - mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage."; - return; - -L_GStorage: - if(@GID==0) goto L_NoGuild; - if(Zeny<$QW_GS_PRICE) callsub L_Short_on_zeny,3; - set Zeny, Zeny-$QW_GS_PRICE; - if ($QW_KPoint == 1) set RESRVPTS, RESRVPTS + ($QW_GS_PRICE/5); - next; - mes "[Warpra]"; - mes "Close this window and i will open the ^5533FF" + GetGuildName(@GID) + "^000000 storage."; - close2; - guildopenstorage; - end; - -L_NoGuild: - next; - mes "[Warpra]"; - mes "You are not a part of a guild I can't help you."; - close; - end; - -L_end: - close; - end; - -//============================Few=Warp============================= -L_FewWarps: - next; - mes "[Warpra ]"; - mes "You need to unlock locations before they come available to you."; - mes "To unlock a location talk to my colleagues all over the world."; - mes "Each account got it's own stamp card."; - mes "Want me to check what stamps you have collected so far ?."; - if (select("Yes","No")==1) callsub stampcard; - close; - end; - - -//============================No=Unlock============================ - -L_NoUnlock: - next; - mes "[Warpra ]"; - mes "I don't unlock this location, my assistant deeper in the dungeon will unlock this place."; - close; - end; - -//=========================Short=On=Zeny=========================== -L_Short_on_zeny: - next; - 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]]+""; - 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]]+""; - if (getarg(0) == 2) mes "you don't seem to have "+@fee+" zeny, to pay for the storage fee"; - if (getarg(0) == 3) mes "you don't seem to have "+$QW_GS_PRICE+" zeny, to pay for the guild storage fee"; - if (getarg(0) == 4) mes "you don't seem to have "+@healfee+" zeny, to pay for your healing"; - close; - end; - -//===========================Stamp=Card============================ -stampcard: -// Counting of the ammount of places you have unlocked - next; - mes "Let me check what Towns you have"; - - callfunc "QWS_TownStamps"; - - mes "you collected^00FF00 "+@Tstamp+" of "+@MaxTstamp+" ^000000Towns."; - if (@Tstamp == 15) mes "They say there is an island you can only get to when married"; - if (@Tstamp == 15) emotion 18; - next; - - mes "Let me check what dungeons you have"; - - callfunc "QWS_DungeonStamps"; - - mes "you collected^00FF00 "+@Dstamp+" of "+@MaxDstamp+" ^000000Dungeons"; - mes "To unlock a dungeon, search for my colleague."; - mes "You can usually find them near the middle or end of the dungeon"; - return; -} - -function script QWS_TownStamps { - set @Tstamp,0; - set @MaxTstamp,21; //maximum number of towns - set @binvalue,1; - set @Tstamploop,0; - do { - if ((@binvalue & ##QWS_T_Unlock) == @binvalue) set @Tstamp,@Tstamp+1; - - set @binvalue, @binvalue *2; - set @Tstamploop, @Tstamploop + 1; - -}while (@Tstamploop < @MaxTstamp); -return; -} - -function script QWS_DungeonStamps { - set @Dstamp,0; - set @MaxDstamp,29; //maximum number of dungeons - set @binvalue,1; - set @Dstamploop,0; - do { - if ((@binvalue & ##QWS_D_Unlock) == @binvalue) set @Dstamp,@Dstamp+1; - - set @binvalue, @binvalue *2; - set @Dstamploop, @Dstamploop + 1; - -}while (@Dstamploop < @MaxDstamp); -return; -} - -//======================Main=Menu=Array============================ - -function script QWS_MMarray { - -// Currently 9 items - - 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"; - set @Mi,0; // That's our loop counter. - set @Mj,0; // That's the menu lines counter. -//----------------GameMaster-Menu - if (getgmlevel()>= 80) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if (getgmlevel()>= 80) set @Mmenuref[@Mj],@Mi; - if (getgmlevel()>= 80) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Special-Warp - callfunc "QWS_TownStamps"; - callfunc "QWS_DungeonStamps"; - if (@Tstamp == @MaxTstamp)&&(@Dstamp == @MaxDstamp)&&($QW_SP_WarpMap$ != "") { - set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - set @Mmenuref[@Mj],@Mi; - set @Mj,@Mj+1; - } - set @Mi,@Mi+1; -//----------------Town-Warp - if ($QW_TW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_TW_OFF == 0) set @Mmenuref[@Mj],@Mi; - if ($QW_TW_OFF == 0) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Dungeon-Warp - if ($QW_DW_OFF == 0) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_DW_OFF == 0) set @Mmenuref[@Mj],@Mi; - if ($QW_DW_OFF == 0) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Why-So-Few-Warps - set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - set @Mmenuref[@Mj],@Mi; - set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------No-Unlock - if (getarg(0) == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if (getarg(0) == 1) set @Mmenuref[@Mj],@Mi; - if (getarg(0) == 1) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Healfull - if ($QW_HF == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_HF == 1) set @Mmenuref[@Mj],@Mi; - if ($QW_HF == 1) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Healpart - if ($QW_HP == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_HP == 1) set @Mmenuref[@Mj],@Mi; - if ($QW_HP == 1) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Storage - if ($QW_Stor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_Stor == 1) set @Mmenuref[@Mj],@Mi; - if ($QW_Stor == 1) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------GuildStorage - if ($QW_GStor == 1) set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - if ($QW_GStor == 1) set @Mmenuref[@Mj],@Mi; - if ($QW_GStor == 1) set @Mj,@Mj+1; - set @Mi,@Mi+1; -//----------------Cancel - set @Mmenulist$[@Mj],@pMmenuitems$[@Mi]; - set @Mmenuref[@Mj],@Mi; - return; - } - - - -//======================Town=Menu=Array============================ - -//----------------Prontera // I do this to find back sections quickly altho almost the same name is a line below it now -// setarray @pTmenuitems$[@Ti], "Prontera"; // Name of Town shown in Town select Menu -// setarray @pTprice[@Ti], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) -// -// setarray @pTmap$[@Ti], "prontera"; // mapfilename of town -// setarray @pTXcoords[@Ti], 156; // X warp coords -// setarray @pTYcoords[@Ti], 187; // Y warp coords -// -// QWS_Make_Town_Menu XXX; -// -// the full wap commands send out by this script for these example would be -//warp example_01 123 123 -// -// use the same XXX number as you used when making your own town warpra -// Read below how -// -// example: -// -//syntax: -//mapname,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ -// -// Full example using fake map & coords -// -//example_01,213,213,4 script Warpra 112,{ -// callfunc "QWS_Town_Warpra",XXX,"A FAKE TOWN FOR EXAMPLE"; -// close; -// } -// use a free number for XXX, last used is 20, for Yuno - -function script QWS_Tarray { - function QWS_Make_Town_Menu; - - set @Ti,0; // That's our loop counter. - set @Tj,0; // That's the menu lines counter. -//----------------Prontera - setarray @pTmenuitems$[@Ti], "Prontera"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "prontera"; - setarray @pTXcoords[@Ti], 156; - setarray @pTYcoords[@Ti], 187; - - QWS_Make_Town_Menu 0; -//----------------Alberta - setarray @pTmenuitems$[@Ti], "Alberta"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "alberta"; - setarray @pTXcoords[@Ti], 27; - setarray @pTYcoords[@Ti], 236; - - QWS_Make_Town_Menu 1; -//----------------Aldebaran - setarray @pTmenuitems$[@Ti], "Aldebaran"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "aldebaran"; - setarray @pTXcoords[@Ti], 145; - setarray @pTYcoords[@Ti], 120; - - QWS_Make_Town_Menu 2; -//----------------Amatsu: - setarray @pTmenuitems$[@Ti], "Amatsu"; - setarray @pTprice[@Ti], $QW_OW_PRICE; - - setarray @pTmap$[@Ti], "amatsu"; - setarray @pTXcoords[@Ti], 197; - setarray @pTYcoords[@Ti], 86; - - QWS_Make_Town_Menu 3; -//----------------Ayothaya: - setarray @pTmenuitems$[@Ti], "Ayothaya"; - setarray @pTprice[@Ti], $QW_OW_PRICE; - - setarray @pTmap$[@Ti], "ayothaya"; - setarray @pTXcoords[@Ti], 150; - setarray @pTYcoords[@Ti], 57; - - QWS_Make_Town_Menu 4; -//----------------Comodo: - setarray @pTmenuitems$[@Ti], "Comodo"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "comodo"; - setarray @pTXcoords[@Ti], 188; - setarray @pTYcoords[@Ti], 161; - - QWS_Make_Town_Menu 5; -//----------------Einbech: - setarray @pTmenuitems$[@Ti], "Einbech"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "einbech"; - setarray @pTXcoords[@Ti], 172; - setarray @pTYcoords[@Ti], 126; - - QWS_Make_Town_Menu 6; -//----------------Einbroch: - setarray @pTmenuitems$[@Ti], "Einbroch"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "einbroch"; - setarray @pTXcoords[@Ti], 230; - setarray @pTYcoords[@Ti], 191; - - QWS_Make_Town_Menu 7; -//----------------Geffen: - setarray @pTmenuitems$[@Ti], "Geffen"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "geffen"; - setarray @pTXcoords[@Ti], 119; - setarray @pTYcoords[@Ti], 66; - - QWS_Make_Town_Menu 8; -//----------------Gonryun: - setarray @pTmenuitems$[@Ti], "Gonryun"; - setarray @pTprice[@Ti], $QW_OW_PRICE; - - setarray @pTmap$[@Ti], "gonryun"; - setarray @pTXcoords[@Ti], 150; - setarray @pTYcoords[@Ti], 130; - - QWS_Make_Town_Menu 9; -//----------------Hugel: - setarray @pTmenuitems$[@Ti], "Hugel"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "hugel"; - setarray @pTXcoords[@Ti], 95; - setarray @pTYcoords[@Ti], 121; - - QWS_Make_Town_Menu 10; -//----------------Izlude: - setarray @pTmenuitems$[@Ti], "Izlude"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "izlude"; - setarray @pTXcoords[@Ti], 128; - setarray @pTYcoords[@Ti], 111; - - QWS_Make_Town_Menu 11; -//----------------Jawaii: - setarray @pTmenuitems$[@Ti], "Jawaii"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "jawaii"; - setarray @pTXcoords[@Ti], 243; - setarray @pTYcoords[@Ti], 115; - - QWS_Make_Town_Menu 12; -//----------------Lighthalzen: - setarray @pTmenuitems$[@Ti], "Lighthalzen"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "lighthalzen"; - setarray @pTXcoords[@Ti], 158; - setarray @pTYcoords[@Ti], 110; - - QWS_Make_Town_Menu 13; -//----------------Louyang: - setarray @pTmenuitems$[@Ti], "Louyang"; - setarray @pTprice[@Ti], $QW_OW_PRICE; - - setarray @pTmap$[@Ti], "louyang"; - setarray @pTXcoords[@Ti], 210; - setarray @pTYcoords[@Ti], 108; - - QWS_Make_Town_Menu 14; -//----------------Lutie - setarray @pTmenuitems$[@Ti], "Lutie"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "xmas"; - setarray @pTXcoords[@Ti], 148; - setarray @pTYcoords[@Ti], 131; - - QWS_Make_Town_Menu 15; -//----------------Morroc: - setarray @pTmenuitems$[@Ti], "Morroc"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "morocc"; - setarray @pTXcoords[@Ti], 159; - setarray @pTYcoords[@Ti], 93; - - QWS_Make_Town_Menu 16; -//----------------Niflheim: - setarray @pTmenuitems$[@Ti], "Niflheim"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "niflheim"; - setarray @pTXcoords[@Ti], 195; - setarray @pTYcoords[@Ti], 186; - - QWS_Make_Town_Menu 17; -//----------------Payon: - setarray @pTmenuitems$[@Ti], "Payon"; - setarray @pTprice[@Ti], $QW_BW_PRICE; - - setarray @pTmap$[@Ti], "payon"; - setarray @pTXcoords[@Ti], 152; - setarray @pTYcoords[@Ti], 75; - - QWS_Make_Town_Menu 18; -//----------------Umbala: - setarray @pTmenuitems$[@Ti], "Umbala"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "umbala"; - setarray @pTXcoords[@Ti], 130; - setarray @pTYcoords[@Ti], 130; - - QWS_Make_Town_Menu 19; -//----------------Yuno: - setarray @pTmenuitems$[@Ti], "Yuno"; - setarray @pTprice[@Ti], $QW_AW_PRICE; - - setarray @pTmap$[@Ti], "yuno"; - setarray @pTXcoords[@Ti], 160; - setarray @pTYcoords[@Ti], 168; - - QWS_Make_Town_Menu 20; -//----------------Cancel - setarray @pTmenuitems$[@Ti], "Cancel"; - setarray @pTprice[@Ti], 0; - - set @Tmenulist$[@Tj],@pTmenuitems$[@Ti]; - set @Tmenuref[@Tj],57005; // 57005='dead' in hex - return; - - -//----------------Make Town Menu Function - -function QWS_Make_Town_Menu { - set @temptownmenubin,1; - if (getarg(0) == 0) goto menu_item; - set @templooptownmenu,0; - do { - set @temptownmenubin, @temptownmenubin * 2; - set @templooptownmenu, @templooptownmenu + 1; - }while (getarg(0) > @templooptownmenu); -// check marker and make menu item -menu_item: - if ((@temptownmenubin & ##QWS_T_Unlock) != @temptownmenubin) { - set @Ti,@Ti+1; - return; - } - if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" -> "+@pTprice[@Ti]; - if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 0) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]; - if (@pTprice[@Ti] != 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"+" -> "+@pTprice[@Ti]; - if (@pTprice[@Ti] == 0)&&($QW_MapUserShow == 1) set @Tmenulist$[@Tj], @pTmenuitems$[@Ti]+" ["+getmapusers(@pTmap$[@Ti])+"]"; - set @Tmenuref[@Tj],@Ti; - set @Tj,@Tj+1; - set @Ti,@Ti+1; - return; - -} -} - -//====================Dungeon=Menu=Arrays========================== - -//----------------A FAKE DUNGEON FOR EXAMPLE // I do this to find back sections quickly altho almost the same name is a line below it now -// setarray @pDmenuitems$[@Di], "Fake Dungeon"; // Name of Dungeon shown in Dungeon select Menu -// setarray @pDprice[@Di], $QW_BW_PRICE; // warp prices (Basic ($QW_BW_PRICE), Advanced ($QW_AW_PRICE), Overseas $QW_OW_PRICE) -// 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 "") -// setarray @DLevels[@Di], 2; //number of levels in dungeon (very important if set to high will shift all leveldata!!) -// -// setarray @DGat$[@Dref], "example_01", "example_02"; // mapfilename of dungeon level -// setarray @DLevelName$[@Dref], "Example Level 1", "Example Level 2"; // level name shown in dungeon level select -// setarray @DXcoords[@Dref], 123, 234; // X warp coords -// setarray @DYcoords[@Dref], 123, 234;// Y warp coords -// setarray @DDepth[@Dref], 0, 1; // relative depth to entrance to calculate extra warp fee -// -// QWS_Make_Dungeon_Menu XXX -// -// the full wap commands send out by this scripts for these examples would be -// for Example Level 1: -//warp example_01 123 123 -// -// for Example Level 2: -//warp example_02 234 234 -// -// use the same XXX number as you used when making your own dungeon unlocker (Warpra Helper) inside the dungeon -// (usually half way near a warp to next level) -// Read below how -// -// example: -// -//syntax: -//mapname,xcoord,ycoord,directionfacing script Name of NPC NPC-ID,{ -// -// Full example using fake map & coords -// -//example_01,213,213,4 script Warpra Helper 112,{ -// callfunc "QWS_Dungeon_Warpra",XXX,"A FAKE DUNGEON FOR EXAMPLE"; -// close; -// } -// use a free number for XXX, last used is 28, for Kiel Dungeon - -function script QWS_Darray { - function QWS_Make_Dungeon_Menu; - - set @Di,0; - set @Dj,0; - set @Dref,0; -//----------------ABYSS LAKE - setarray @pDmenuitems$[@Di], "Abyss Lake"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "abyss_01", "abyss_02", "abyss_03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 265, 275, 116; - setarray @DYcoords[@Dref], 273, 270, 27; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 0; - -//----------------AMATSU DUNGEON - setarray @pDmenuitems$[@Di], "Amatsu Dungeon"; - setarray @pDprice[@Di], $QW_OW_PRICE; - setarray @pDfee$[@Di], "$QW_OW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "ama_dun01", "ama_dun02", "ama_dun03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 227, 32, 119; - setarray @DYcoords[@Dref], 10, 43, 15; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 1; - -//----------------ANT HELL - setarray @pDmenuitems$[@Di], "Ant Hell Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[2], 2; - - setarray @DGat$[@Dref], "anthell01", "anthell02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 32, 34; - setarray @DYcoords[@Dref], 262, 263; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 2; - -//----------------AYOTAYA - setarray @pDmenuitems$[@Di], "Ayotaya Dungeon"; - setarray @pDprice[@Di], $QW_OW_PRICE; - setarray @pDfee$[@Di], "$QW_OW_FEE"; - setarray @DLevels[3], 2; - - setarray @DGat$[@Dref], "ayo_dun01", "ayo_dun02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 275, 150; - setarray @DYcoords[@Dref], 17, 13; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 3; - -//----------------BYALAN - setarray @pDmenuitems$[@Di], "Byalan Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[4], 5; - - setarray @DGat$[@Dref], "iz_dun00", "iz_dun01", "iz_dun02", "iz_dun03", "iz_dun04"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; - setarray @DXcoords[@Dref], 168, 41, 236, 32, 26; - setarray @DYcoords[@Dref], 168, 37, 204, 63, 27; - setarray @DDepth[@Dref], 0, 1, 2, 3, 4; - - QWS_Make_Dungeon_Menu 4; - -//----------------CLOCK TOWER - setarray @pDmenuitems$[@Di], "Clock Tower Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[5], 8; - - setarray @DGat$[@Dref], "c_tower1", "c_tower2", "c_tower3", "c_tower4", "alde_dun01", "alde_dun02", "alde_dun03", "alde_dun04"; - 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"; - setarray @DXcoords[@Dref], 200, 268, 64, 32, 197, 262, 276, 122; - setarray @DYcoords[@Dref], 163, 26, 148, 63, 25, 41, 53, 125; - setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2, 3, 4; - - QWS_Make_Dungeon_Menu 5; - -//----------------COAL MINE - setarray @pDmenuitems$[@Di], "Coal Mine Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[6], 3; - - setarray @DGat$[@Dref], "mjo_dun01", "mjo_dun02", "mjo_dun03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 52, 381, 302; - setarray @DYcoords[@Dref], 17, 343, 261; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 6; - -//----------------CULVERT - setarray @pDmenuitems$[@Di], "Culvert Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[7], 4; - - setarray @DGat$[@Dref], "prt_sewb1", "prt_sewb2", "prt_sewb3", "prt_sewb4"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; - setarray @DXcoords[@Dref], 132, 19, 180, 100; - setarray @DYcoords[@Dref], 248, 19, 169, 92; - setarray @DDepth[@Dref], 0, 1, 2, 3; - - QWS_Make_Dungeon_Menu 7; - -//----------------EINBECH DUNGEON - setarray @pDmenuitems$[@Di], "Einbech Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[8], 2; - - setarray @DGat$[@Dref], "ein_dun01", "ein_dun02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 22, 292; - setarray @DYcoords[@Dref], 14, 290; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 8; - -//----------------GEFENIA DUNGEON - setarray @pDmenuitems$[@Di], "Gefenia Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[9], 4; - - setarray @DGat$[@Dref], "gefenia01", "gefenia02", "gefenia03", "gefenia04"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; - setarray @DXcoords[@Dref], 59, 201, 264, 33; - setarray @DYcoords[@Dref], 167, 35, 236, 270; - setarray @DDepth[@Dref], 0, 1, 2, 3; - - QWS_Make_Dungeon_Menu 9; - -//----------------GEFFEN DUNGEON - setarray @pDmenuitems$[@Di], "Geffen Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 4; - - setarray @DGat$[@Dref], "gef_dun00", "gef_dun01", "gef_dun02", "gef_dun03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4"; - setarray @DXcoords[@Dref], 104, 115, 106, 203; - setarray @DYcoords[@Dref], 100, 236, 132, 200; - setarray @DDepth[@Dref], 0, 1, 2, 3; - - QWS_Make_Dungeon_Menu 10; - -//----------------GLAST HEIM - setarray @pDmenuitems$[@Di], "Glast Heim Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 17; - - setarray @DGat$[@Dref], "glast_01", "gl_church", "gl_chyard", "gl_in01", "gl_cas01", "gl_cas02", "gl_knt01", "gl_knt02", "gl_prison", "gl_prison1", "gl_step", "gl_sew01", "gl_sew02", "gl_sew03", "gl_sew04", "gl_dun01", "gl_dun02"; - 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"; - setarray @DXcoords[@Dref], 370, 156, 147, 121, 199, 104, 150, 157, 14, 150, 117, 258, 108, 171, 68, 133, 224; - setarray @DYcoords[@Dref], 300, 8, 15, 59, 29, 25, 10, 287, 70, 14, 124, 255, 291, 273, 277, 271, 274; - setarray @DDepth[@Dref], 0, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 4, 2, 3, 4, 5, 6; - - QWS_Make_Dungeon_Menu 11; - -//----------------GONRYUN DUNGEON - setarray @pDmenuitems$[@Di], "Gonryun Dungeon"; - setarray @pDprice[@Di], $QW_OW_PRICE; - setarray @pDfee$[@Di], "$QW_OW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "gon_dun01", "gon_dun02", "gon_dun03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 143, 17, 68; - setarray @DYcoords[@Dref], 59, 114, 9; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 12; - -//----------------HIDDEN DUNGEON - setarray @pDmenuitems$[@Di], "Hidden Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "prt_maze01", "prt_maze02", "prt_maze03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 176, 94, 23; - setarray @DYcoords[@Dref], 6, 19, 8; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 13; - -//----------------JUPEROS CAVE - setarray @pDmenuitems$[@Di], "Juperos Cave"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "juperos_01", "juperos_02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 53, 36; - setarray @DYcoords[@Dref], 247, 60; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 14; - -//----------------KIEL DUNGEON - setarray @pDmenuitems$[@Di], "Kiel Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "kh_dun01", "kh_dun02"; - setarray @DLevelName$[@Dref], "1st Floor", "2nd Floor"; - setarray @DXcoords[@Dref], 63, 42; - setarray @DYcoords[@Dref], 10, 197; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 28; - -//----------------LIGHTHALZEN BIO LAB - setarray @pDmenuitems$[@Di], "Lighthalzen Bio Lab"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "lhz_dun01", "lhz_dun02", "lhz_dun03"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 150, 150, 140; - setarray @DYcoords[@Dref], 287, 18, 137; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 15; - -//----------------LOUYANG DUNGEON - setarray @pDmenuitems$[@Di], "Louyang Dungeon"; - setarray @pDprice[@Di], $QW_OW_PRICE; - setarray @pDfee$[@Di], "$QW_OW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "lou_dun02", "lou_dun03"; - setarray @DLevelName$[@Dref], "Royal Tomb Level 1", "Royal Tomb Level 2"; - setarray @DXcoords[@Dref], 282, 165; - setarray @DYcoords[@Dref], 20, 38; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 16; - -//----------------MAGMA DUNGEON - setarray @pDmenuitems$[@Di], "Magma Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "mag_dun01", "mag_dun02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 126, 47; - setarray @DYcoords[@Dref], 69, 32; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 17; - -//----------------ODIN TEMPLE - setarray @pDmenuitems$[@Di], "Odin Temple"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 1; - - setarray @DGat$[@Dref], "odin_tem01"; - setarray @DLevelName$[@Dref], "Level 1"; - setarray @DXcoords[@Dref], 96; - setarray @DYcoords[@Dref], 145; - setarray @DDepth[@Dref], 0; - - QWS_Make_Dungeon_Menu 18; - -//----------------ORC DUNGEON - setarray @pDmenuitems$[@Di], "Orc Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "orcsdun01", "orcsdun02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 32, 21; - setarray @DYcoords[@Dref], 169, 185; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 19; - -//----------------PAYON DUNGEON - setarray @pDmenuitems$[@Di], "Payon Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 5; - - setarray @DGat$[@Dref], "pay_dun00", "pay_dun01", "pay_dun02", "pay_dun03", "pay_dun04"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; - setarray @DXcoords[@Dref], 22, 19, 19, 155, 201; - setarray @DYcoords[@Dref], 180, 33, 63, 159, 204; - setarray @DDepth[@Dref], 0, 1, 2, 3, 4; - - QWS_Make_Dungeon_Menu 20; - -//----------------PYRAMIDS - setarray @pDmenuitems$[@Di], "Pyramids Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 6; - - setarray @DGat$[@Dref], "moc_pryd01", "moc_pryd02", "moc_pryd03", "moc_pryd04", "moc_pryd05", "moc_pryd06"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Basement 1", "Basement 2"; - setarray @DXcoords[@Dref], 192, 10, 100, 181, 94, 192; - setarray @DYcoords[@Dref], 9, 192, 92, 11, 96, 8; - setarray @DDepth[@Dref], 0, 1, 2, 3, 1, 2; - - QWS_Make_Dungeon_Menu 21; - -//----------------SPHINX - setarray @pDmenuitems$[@Di], "Sphinx Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 5; - - setarray @DGat$[@Dref], "in_sphinx1", "in_sphinx2", "in_sphinx3", "in_sphinx4", "in_sphinx5"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2", "Level 3", "Level 4", "Level 5"; - setarray @DXcoords[@Dref], 192, 149, 210, 10, 100; - setarray @DYcoords[@Dref], 9, 81, 54, 222, 99; - setarray @DDepth[@Dref], 0, 1, 2, 3, 4; - - QWS_Make_Dungeon_Menu 22; - -//----------------SUNKEN SHIP - setarray @pDmenuitems$[@Di], "Sunken Ship Dungeon"; - setarray @pDprice[@Di], $QW_BW_PRICE; - setarray @pDfee$[@Di], "$QW_BW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "treasure01", "treasure02"; - setarray @DLevelName$[@Dref], "Level 1", "Level 2"; - setarray @DXcoords[@Dref], 69, 102; - setarray @DYcoords[@Dref], 24, 27; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 23; - -//----------------THANATOS TOWER - setarray @pDmenuitems$[@Di], "Thanatos Tower"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 13; - - setarray @DGat$[@Dref], "tha_t01", "tha_t02", "tha_t03", "tha_t04", "tha_t05", "tha_t06", "tha_t07", "tha_t08", "tha_t09", "tha_t10", "tha_t11", "tha_t12", "thana_boss"; - 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"; - setarray @DXcoords[@Dref], 150, 150, 220, 59, 62, 206, 35, 105, 88, 168, 90, 129, 85; - setarray @DYcoords[@Dref], 35, 136, 158, 143, 11, 8, 166, 44, 145, 138, 36, 83, 76; - setarray @DDepth[@Dref], 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12; - - QWS_Make_Dungeon_Menu 24; - -//----------------TOY FACTORY - setarray @pDmenuitems$[@Di], "Toy Factory Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 2; - - setarray @DGat$[@Dref], "xmas_dun01", "xmas_dun02"; - setarray @DLevelName$[@Dref], "Factory Warehouse", "Classifying Room"; - setarray @DXcoords[@Dref], 205, 129; - setarray @DYcoords[@Dref], 16, 133; - setarray @DDepth[@Dref], 0, 1; - - QWS_Make_Dungeon_Menu 25; - -//----------------TURTLE ISTLAND - setarray @pDmenuitems$[@Di], "Turtle Island Dungeon"; - setarray @pDprice[@Di], $QW_AW_PRICE; - setarray @pDfee$[@Di], "$QW_AW_FEE"; - setarray @DLevels[@Di], 4; - - setarray @DGat$[@Dref], "tur_dun01", "tur_dun02", "tur_dun03", "tur_dun04"; - setarray @DLevelName$[@Dref], "Outside", "Level 1", "Level 2", "Level 3"; - setarray @DXcoords[@Dref], 161, 148, 132, 100; - setarray @DYcoords[@Dref], 34, 256, 190, 192; - setarray @DDepth[@Dref], 0, 0, 1, 2; - - QWS_Make_Dungeon_Menu 26; - -//----------------UMBALA - setarray @pDmenuitems$[@Di], "Umbala Dungeon"; - setarray @pDprice[@Di], $QW_OW_PRICE; - setarray @pDfee$[@Di], "$QW_OW_FEE"; - setarray @DLevels[@Di], 3; - - setarray @DGat$[@Dref], "um_dun01", "um_dun02", "yggdrasil01"; - setarray @DLevelName$[@Dref], "Carpenter's Shop in The Tree", "Passage to a Foreign World", "Hvergelmir's Fountain"; - setarray @DXcoords[@Dref], 205, 48, 40; - setarray @DYcoords[@Dref], 26, 30, 63; - setarray @DDepth[@Dref], 0, 1, 2; - - QWS_Make_Dungeon_Menu 27; - -//----------------Cancel - setarray @pDmenuitems$[@Di], "Cancel"; - setarray @pDprice[@Di], 0; - - set @Dmenulist$[@Dj],@pDmenuitems$[@Di]; - set @Dmenuref[@Dj],57005; // 57005='dead' in hex - return; - - -//----------------Make Dungeon Menu Function - -function QWS_Make_Dungeon_Menu { - set @tempdungeonmenubin,1; - if (getarg(0) == 0) goto menu_item; - set @temploopdungeonmenu,0; - do { - set @tempdungeonmenubin, @tempdungeonmenubin * 2; - set @temploopdungeonmenu, @temploopdungeonmenu + 1; - }while (getarg(0) > @temploopdungeonmenu); -// check marker and make menu item -menu_item: - if ((@tempdungeonmenubin & ##QWS_D_Unlock) != @tempdungeonmenubin) { - setarray @DLocRef[@Di], @Dref; - set @Dref, @Dref+@DLevels[@Di]; - set @Di,@Di+1; - return; - } - if ($QW_MapUserShow == 1) { - set @tempmapusers,0; - set @mapusersloop,0; - do { - set @tempmapusers,(getmapusers(@DGat$[@Dref+@mapusersloop]) + @tempmapusers); - set @mapusersloop, (@mapusersloop + 1); - }while (@DLevels[@Di] > @mapusersloop); - if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"] -> "+@pDprice[@Di]; - if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" ["+@tempmapusers+"]"; - set @Dmenuref[@Dj],@Di; - set @Dj,@Dj+1; - setarray @DLocRef[@Di], @Dref; - set @Dref, @Dref+@DLevels[@Di]; - set @Di,@Di+1; - return; - } - if (@pDprice[@Di] != 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]+" -> "+@pDprice[@Di]; - if (@pDprice[@Di] == 0) set @Dmenulist$[@Dj], @pDmenuitems$[@Di]; - set @Dmenuref[@Dj],@Di; - set @Dj,@Dj+1; - setarray @DLocRef[@Di], @Dref; - set @Dref, @Dref+@DLevels[@Di]; - set @Di,@Di+1; - return; - -} -} - -function script QWS_DLarray { -//----------------Start building Menu - set @DWref,@DLocRef[@DwarpMenu]; // That's our reference to the arrays with leveldata. - set @DWi,0; // That's our loop counter. - set @DWj,0; // That's the menu lines counter. - cleararray @DWLmenulist$[0],"",20; // Clearing the array to get rid off ghost items in menu - do { - if ($QW_DL == 0)||($QW_DDL >= @DDepth[@DWref]) { - - set @warpprice, (@pDprice[@DwarpMenu]+ (getd(@pDfee$[@DwarpMenu])*@DDepth[@DWref])); - - if (@warpprice != 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" -> "+@warpprice; - if (@warpprice == 0)&&($QW_MapUserShow == 0) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]; - if (@warpprice != 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"] -> "+@warpprice; - if (@warpprice == 0)&&($QW_MapUserShow == 1) set @DWLmenulist$[@DWj], @DLevelName$[@DWref]+" ["+getmapusers(@DGat$[@DWref])+"]"; - set @DWLmenuref[@DWj],@DWref; - - set @DWj,@DWj+1; - } - set @DWref, @DWref+1; - set @DWi,@DWi+1; - }while (@DWi < @DLevels[@DwarpMenu]); - set @DWLmenulist$[@DWj], "Exit"; - set @DWLmenuref[@DWj],57005; // 57005='dead' in hex - return; - } - - -//=================Backwards=Compatibility=Pre=1.8================= - -function script QWS_BackComp { -// 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]; -// 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]; -// also clears variables so that the account file variables can be used for something else variable 0 = variable delete on next save - -// Towns - set @towntemp,0; - if (#prontera != 0) set @towntemp,@towntemp + 1; - if (#alberta != 0) set @towntemp,@towntemp + 2; - if (#aldebaran != 0) set @towntemp,@towntemp + 4; - if (#amatsu != 0) set @towntemp,@towntemp + 8; - if (#ayotaya != 0) set @towntemp,@towntemp + 16; - if (#comodo != 0) set @towntemp,@towntemp + 32; - if (#einbech != 0) set @towntemp,@towntemp + 64; - if (#einbroch != 0) set @towntemp,@towntemp + 128; - if (#geffen != 0) set @towntemp,@towntemp + 256; - if (#gonryun != 0) set @towntemp,@towntemp + 512; - if (#hugel != 0) set @towntemp,@towntemp + 1024; - if (#izlude != 0) set @towntemp,@towntemp + 2048; - if (#jawaii != 0) set @towntemp,@towntemp + 4096; - if (#lighthalzen != 0) set @towntemp,@towntemp + 8192; - if (#louyang != 0) set @towntemp,@towntemp + 16384; - if (#xmas != 0) set @towntemp,@towntemp + 32768; - if (#morocc != 0) set @towntemp,@towntemp + 65536; - if (#niflheim != 0) set @towntemp,@towntemp + 131072; - if (#payon != 0) set @towntemp,@towntemp + 262144; - if (#umbala != 0) set @towntemp,@towntemp + 524288; - if (#yuno != 0) set @towntemp,@towntemp + 1048576; -// Clear Town variables - set #prontera,0; - set #alberta,0; - set #aldebaran,0; - set #amatsu,0; - set #ayotaya,0; - set #comodo,0; - set #einbech,0; - set #einbroch,0; - set #geffen,0; - set #gonryun,0; - set #hugel,0; - set #izlude,0; - set #jawaii,0; - set #lighthalzen,0; - set #louyang,0; - set #xmas,0; - set #morocc,0; - set #niflheim,0; - set #payon,0; - set #umbala,0; - set #yuno,0; -// set Town warp unlock variable -set ##QWS_T_Unlock, (##QWS_T_Unlock | @towntemp); - //because multiple account servers now stack on 1 variable i used a 'or' to stack them -// Dungeons - set @dungeontemp,0; - if (#abyss != 0) set @dungeontemp,@dungeontemp + 1; - if (#ama_dun != 0) set @dungeontemp,@dungeontemp + 2; - if (#anthell != 0) set @dungeontemp,@dungeontemp + 4; - if (#ayotaya_dun != 0) set @dungeontemp,@dungeontemp + 8; - if (#iz_dun != 0) set @dungeontemp,@dungeontemp + 16; - if (#c_tower != 0) set @dungeontemp,@dungeontemp + 32; - if (#mjo_dun != 0) set @dungeontemp,@dungeontemp + 64; - if (#prt_sewb != 0) set @dungeontemp,@dungeontemp + 128; - if (#einbech_dun != 0) set @dungeontemp,@dungeontemp + 256; - if (#gefenia != 0) set @dungeontemp,@dungeontemp + 512; - if (#gef_dun != 0) set @dungeontemp,@dungeontemp + 1024; - if (#gl_dun != 0) set @dungeontemp,@dungeontemp + 2048; - if (#gon_dun != 0) set @dungeontemp,@dungeontemp + 4096; - if (#hid_dun != 0) set @dungeontemp,@dungeontemp + 8192; - if (#juperos != 0) set @dungeontemp,@dungeontemp + 16384; - if (#lighthalzen_dun != 0) set @dungeontemp,@dungeontemp + 32768; - if (#louyang_dun != 0) set @dungeontemp,@dungeontemp + 65536; - if (#mag_dun != 0) set @dungeontemp,@dungeontemp + 131072; - if (#odintemple != 0) set @dungeontemp,@dungeontemp + 262144; - if (#orcsdun != 0) set @dungeontemp,@dungeontemp + 524288; - if (#pay_dun != 0) set @dungeontemp,@dungeontemp + 1048576; - if (#moc_pryd != 0) set @dungeontemp,@dungeontemp + 2097152; - if (#in_sphinx != 0) set @dungeontemp,@dungeontemp + 4194304; - if (#treasure != 0) set @dungeontemp,@dungeontemp + 8388608; - if (#thanatos_tower != 0) set @dungeontemp,@dungeontemp + 16777216; - if (#xmas_dun != 0) set @dungeontemp,@dungeontemp + 33554432; - if (#tur_dun != 0) set @dungeontemp,@dungeontemp + 67108864; - if (#um_dun != 0) set @dungeontemp,@dungeontemp + 134217728; -// Clear Dungeon variables - set #abyss,0; - set #ama_dun,0; - set #anthell,0; - set #ayotaya_dun,0; - set #iz_dun,0; - set #c_tower,0; - set #mjo_dun,0; - set #prt_sewb,0; - set #einbech_dun,0; - set #gefenia,0; - set #gef_dun,0; - set #gl_dun,0; - set #gon_dun,0; - set #hid_dun,0; - set #juperos,0; - set #lighthalzen_dun,0; - set #louyang_dun,0; - set #mag_dun,0; - set #odintemple,0; - set #orcsdun,0; - set #pay_dun,0; - set #moc_pryd,0; - set #in_sphinx,0; - set #treasure,0; - set #thanatos_tower,0; - set #xmas_dun,0; - set #tur_dun,0; - set #um_dun,0; -// set Town warp unlock variable -set ##QWS_D_Unlock, (##QWS_D_Unlock | @dungeontemp); -//mark that this character has done the upgrade to 1.8 -set ##QWS_UP,18; -return; -} - - -//===================Extra=Variable=Clear=Pre=1.8================== -function script Extra_Variable_Clear { -// Clear Town variables - set #prontera,0; - set #alberta,0; - set #aldebaran,0; - set #amatsu,0; - set #ayotaya,0; - set #comodo,0; - set #einbech,0; - set #einbroch,0; - set #geffen,0; - set #gonryun,0; - set #hugel,0; - set #izlude,0; - set #jawaii,0; - set #lighthalzen,0; - set #louyang,0; - set #xmas,0; - set #morocc,0; - set #niflheim,0; - set #payon,0; - set #umbala,0; - set #yuno,0; - -// Clear Dungeon variables - set #abyss,0; - set #ama_dun,0; - set #anthell,0; - set #ayotaya_dun,0; - set #iz_dun,0; - set #c_tower,0; - set #mjo_dun,0; - set #prt_sewb,0; - set #einbech_dun,0; - set #gefenia,0; - set #gef_dun,0; - set #gl_dun,0; - set #gon_dun,0; - set #hid_dun,0; - set #juperos,0; - set #lighthalzen_dun,0; - set #louyang_dun,0; - set #mag_dun,0; - set #odintemple,0; - set #orcsdun,0; - set #pay_dun,0; - set #moc_pryd,0; - set #in_sphinx,0; - set #treasure,0; - set #thanatos_tower,0; - set #xmas_dun,0; - set #tur_dun,0; - set #um_dun,0; - -// as the account based variables are limited just run this on every character to save some variables -set QWS_ExtraVARClear,18; -return; -} - -//================Dungeon=Warpras=That=Only=Unlock================= - -function script QWS_Dungeon_Warpra { - function QWS_D_getbin; - function QWS_D_setbin; - - if ((QWS_D_getbin(getarg(0)) == 0) && (getarg(1) != "")) { - mes "[Warpra]"; - mes getarg(1)+" unlocked!"; - QWS_D_setbin(getarg(0)); - return; - } else if (QWS_D_getbin(getarg(0)) == 1){ - mes "[Warpra]"; - mes "Sorry I can only unlock this location."; - } else - debugmes "QWS_Dungeon_Warpra error, improper syntax ?"; - return; - - -function QWS_D_setbin { - set @tempsetbindata,1; - if (getarg(0) == 0) goto binset; - set @temploopsetbin,0; - do { - set @tempsetbindata, @tempsetbindata * 2; - set @temploopsetbin, @temploopsetbin + 1; - } while (getarg(0) > @temploopsetbin); -binset: - set ##QWS_D_Unlock,(##QWS_D_Unlock | @tempsetbindata); - return; -} - -function QWS_D_getbin { - set @tempgetbindata,1; - if (getarg(0) == 0) goto binget; - set @temploopgetbin,0; - do { - set @tempgetbindata, @tempgetbindata * 2; - set @temploopgetbin, @temploopgetbin + 1; - } while (getarg(0) > @temploopgetbin); -binget: - if ((@tempgetbindata & ##QWS_D_Unlock) == @tempgetbindata) return 1; - return 0; -} -} - -//==========================Town=Warpras=========================== - -function script QWS_Town_Warpra { - function QWS_T_getbin; - function QWS_T_setbin; - - if ((QWS_T_getbin(getarg(0)) == 0) && (getarg(1) != "")) { - mes "[Warpra]"; - mes getarg(1)+" unlocked!"; - QWS_T_setbin(getarg(0)); - return; - } else if (QWS_T_getbin(getarg(0)) == 1){ -callfunc "Q_Warpra",0; - } else - debugmes "QWS_Town_Warpra error, improper syntax ?"; - return; - - -function QWS_T_setbin { - set @tempsetbindata,1; - if (getarg(0) == 0) goto binset; - set @temploopsetbin,0; - do { - set @tempsetbindata, @tempsetbindata * 2; - set @temploopsetbin, @temploopsetbin + 1; - } while (getarg(0) > @temploopsetbin); -binset: - set ##QWS_T_Unlock,(##QWS_T_Unlock | @tempsetbindata); - return; -} - -function QWS_T_getbin { - set @tempgetbindata,1; - if (getarg(0) == 0) goto binget; - set @temploopgetbin,0; - do { - set @tempgetbindata, @tempgetbindata * 2; - set @temploopgetbin, @temploopgetbin + 1; - } while (getarg(0) > @temploopgetbin); -binget: - if ((@tempgetbindata & ##QWS_T_Unlock) == @tempgetbindata) return 1; - return 0; -} -} -//============================Warpras============================== - -alb2trea,73,101,4 script Warpra#1 113,{ - callfunc "Q_Warpra",1; -} -ama_fild01,178,325,1 script Warpra#2 113,{ - callfunc "Q_Warpra",1; -} -gef_fild10,71,339,4 script Warpra#3 113,{ - callfunc "Q_Warpra",1; -} -izlu2dun,104,82,4 script Warpra#4 113,{ - callfunc "Q_Warpra",1; -} -mjolnir_02,85,363,4 script Warpra#5 113,{ - callfunc "Q_Warpra",1; -} -moc_fild04,207,331,4 script Warpra#6 113,{ - callfunc "Q_Warpra",1; -} -moc_fild19,106,97,4 script Warpra#7 113,{ - callfunc "Q_Warpra",1; -} -moc_ruins,64,166,4 script Warpra#8 113,{ - callfunc "Q_Warpra",1; -} -niflheim,197,192,3 script Warpra#9 113,{ - callfunc "Q_Warpra",1; -} -pay_arche,39,135,4 script Warpra#10 113,{ - callfunc "Q_Warpra",1; -} -prt_fild05,273,215,4 script Warpra#11 113,{ - callfunc "Q_Warpra",1; -} -tur_dun01,148,239,4 script Warpra#12 113,{ - callfunc "Q_Warpra",1; -} -valkyrie,48,35,8 script Warpra#13 113,{ - callfunc "Q_Warpra",1; -} -yuno_fild03,37,135,4 script Warpra#14 113,{ - callfunc "Q_Warpra",1; -} - -alberta,32,240,4 script Warpra#15 113,{ - callfunc "QWS_Town_Warpra",1,"Alberta Town"; - close; -} -aldebaran,146,118,4 script Warpra#16 113,{ - callfunc "QWS_Town_Warpra",2,"Aldebaran Town"; - close; -} -ayothaya,216,171,5 script Warpra#17 113,{ - callfunc "QWS_Town_Warpra",4,"Ayotaya Town"; - close; -} -amatsu,193,81,1 script Warpra#18 113,{ - callfunc "QWS_Town_Warpra",3,"Amatsu Town"; - close; -} -comodo,195,158,4 script Warpra#19 113,{ - callfunc "QWS_Town_Warpra",5,"Comodo Town"; - close; -} -einbroch,229,196,5 script Warpra#20 113,{ - callfunc "QWS_Town_Warpra",7,"Einbroch Town"; - close; -} -einbech,173,131,5 script Warpra#21 113,{ - callfunc "QWS_Town_Warpra",6,"Einbech Town"; - close; -} -geffen,116,66,4 script Warpra#22 113,{ - callfunc "QWS_Town_Warpra",8,"Geffen Town"; - close; -} -gonryun,152,130,4 script Warpra#23 113,{ - callfunc "QWS_Town_Warpra",9,"Gonryun Town"; - close; -} -hugel,90,127,5 script Warpra#24 113,{ - callfunc "QWS_Town_Warpra",10,"Hugel Town"; - close; -} -jawaii,107,182,5 script Warpra#25 113,{ - callfunc "QWS_Town_Warpra",12,"Jawaii Town"; - close; -} -izlude,132,116,4 script Warpra#26 113,{ - callfunc "QWS_Town_Warpra",11,"Izlude Town"; - close; -} -lighthalzen,153,100,5 script Warpra#27 113,{ - callfunc "QWS_Town_Warpra",13,"Lighthalzen Town"; - close; -} -louyang,211,106,4 script Warpra#28 113,{ - callfunc "QWS_Town_Warpra",14,"Louyang Town"; - close; -} -morocc,157,95,4 script Warpra#29 113,{ - callfunc "QWS_Town_Warpra",16,"Morroc Town"; - close; -} -nif_fild01,319,77,1 script Warpra#30 113,{ - callfunc "QWS_Town_Warpra",17,"Niflheim Town"; - close; -} -payon,183,110,4 script Warpra#31 113,{ - callfunc "QWS_Town_Warpra",18,"Payon Town"; - close; -} -prontera,147,172,5 script Warpra#32 113,{ - callfunc "QWS_Town_Warpra",0,"Prontera Town"; - close; -} -umbala,133,130,4 script Warpra#33 113,{ - callfunc "QWS_Town_Warpra",19,"Umbala Town"; - close; -} -xmas,151,136,4 script Warpra#34 113,{ - callfunc "QWS_Town_Warpra",15,"Lutie Town"; - close; -} -yuno,138,162,4 script Warpra#35 113,{ - callfunc "QWS_Town_Warpra",20,"Yuno Town"; - close; -} - -abyss_02,274,266,1 script Warpra#36 113,{ - callfunc "QWS_Dungeon_Warpra",0,"Abyss Lake"; - close; -} - -ama_dun02,192,118,5 script Warpra Helper#1 112,{ - callfunc "QWS_Dungeon_Warpra",1,"Amatsu Dungeon"; - close; -} - -anthell02,170,165,3 script Warpra Helper#2 112,{ - callfunc "QWS_Dungeon_Warpra",2,"Ant Hell Dungeon"; - close; -} - -ayo_dun02,258,193,5 script Warpra Helper#3 112,{ - callfunc "QWS_Dungeon_Warpra",3,"Ayotaya Dungeon"; - close; -} - -ein_dun02,292,282,1 script Warpra Helper#4 112,{ - callfunc "QWS_Dungeon_Warpra",8,"Einbech Dungeon"; - close; -} - -iz_dun03,202,47,2 script Warpra Helper#5 112,{ - callfunc "QWS_Dungeon_Warpra",4,"Byalan Dungeon"; - close; -} - -c_tower3,129,106,4 script Warpra Helper#6 112,{ - callfunc "QWS_Dungeon_Warpra",5,"Clock Tower Dungeon"; - close; -} - -mjo_dun02,39,25,4 script Warpra Helper#7 112,{ - callfunc "QWS_Dungeon_Warpra",6,"Coal Mine Dungeon"; - close; -} - -prt_sewb2,176,30,3 script Warpra Helper#8 112,{ - callfunc "QWS_Dungeon_Warpra",7,"Culvert Dungeon"; - close; -} - -gefenia03,137,34,0 script Warpra Helper#9 112,{ - callfunc "QWS_Dungeon_Warpra",9,"Gefenia Dungeon"; - close; -} - -gef_dun02,218,61,2 script Warpra Helper#10 112,{ - callfunc "QWS_Dungeon_Warpra",10,"Gefen Dungeon"; - close; -} - -glast_01,371,308,3 script Warpra Helper#11 112,{ - callfunc "QWS_Dungeon_Warpra",11,"Glast Heim Dungeon"; - close; -} - -gon_dun01,167,273,4 script Warpra Helper#12 112,{ - callfunc "QWS_Dungeon_Warpra",12,"Gonryun Dungeon"; - close; -} - -juperos_02,127,154,5 script Warpra Helper#13 112,{ - callfunc "QWS_Dungeon_Warpra",14,"Juperos Cave"; - close; -} - -kh_dun01,14,224,3 script Warpra Helper#14 112,{ - callfunc "QWS_Dungeon_Warpra",28,"Kiel Dungeon"; - close; -} - -lhz_dun02,156,151,5 script Warpra Helper#15 112,{ - callfunc "QWS_Dungeon_Warpra",15,"Lighthalzen Bio Lab"; - close; -} - -lou_dun02,168,264,4 script Warpra Helper#16 112,{ - callfunc "QWS_Dungeon_Warpra",16,"Louyang Dungeon"; - close; -} - -mag_dun02,46,41,3 script Warpra Helper#17 112,{ - callfunc "QWS_Dungeon_Warpra",17,"Magma Dungeon"; - close; -} - -odin_tem01,115,148,3 script Warpra Helper#18 112,{ - callfunc "QWS_Dungeon_Warpra",18,"Odin Temple"; - close; -} - -orcsdun01,185,11,3 script Warpra Helper#19 112,{ - callfunc "QWS_Dungeon_Warpra",19,"Orc Dungeon"; - close; -} - -pay_dun03,162,143,3 script Warpra Helper#20 112,{ - callfunc "QWS_Dungeon_Warpra",20,"Payon Dungeon"; - close; -} - -moc_pryd02,101,95,3 script Warpra Helper#21 112,{ - callfunc "QWS_Dungeon_Warpra",21,"Pyramides Dungeon"; - close; -} - -in_sphinx2,274,268,1 script Warpra Helper#22 112,{ - callfunc "QWS_Dungeon_Warpra",22,"Sphinx Dungeon"; - close; -} - -tha_t07,111,162,3 script Warpra Helper#23 112,{ - callfunc "QWS_Dungeon_Warpra",24,"Thanatos Tower"; - close; -} - -treasure02,104,40,3 script Warpra Helper#24 112,{ - callfunc "QWS_Dungeon_Warpra",23,"Sunken Ship Dungeon"; - close; -} - -xmas_dun02,124,131,3 script Warpra Helper#25 112,{ - callfunc "QWS_Dungeon_Warpra",25,"Toy Factory Dungeon"; - close; -} - -um_dun02,44,28,3 script Warpra Helper#26 112,{ - callfunc "QWS_Dungeon_Warpra",27,"Umbala Dungeon"; - close; -} - -tur_dun02,162,23,3 script Warpra Helper#27 112,{ - callfunc "QWS_Dungeon_Warpra",26,"Turtle Island Dungeon"; - close; -} -prt_maze02,102,69,4 script Warpra Helper#28 112,{ - callfunc "QWS_Dungeon_Warpra",13,"Hidden Dungeon"; - close; -} diff --git a/npc/custom/quests/fashion.txt b/npc/custom/quests/fashion.txt deleted file mode 100644 index 5027bf8e8..000000000 --- a/npc/custom/quests/fashion.txt +++ /dev/null @@ -1,69 +0,0 @@ -//===== rAthena Script ======================================= -//= Quest for Fashion Glasses (Daily Job Quest) -//===== By: ================================================== -//= -//===== Current Version: ===================================== -//= 1.1 -//===== Compatible With: ===================================== -//= rAthena SVN -//===== Description: ========================================= -//= Quest for Fashion Glasses -//===== Additional Comments: ================================= -//= 1.0 Fully Working [Lupus] -//= 1.1 fixed exploit [Lupus] -//============================================================ - -izlude,135,96,5 script Fashion Glasses Quest 76,{ - mes "[Fashionable Glasses Quest]"; - mes "Hi, today's quest is...."; - mes "Ah, the ^CC6633Fashionable Glasses^000000 Quest!"; - next; - menu "Requirements",M_INFO,"Make Item",-,"Cancel",M_CANCEL; - - mes "[Fashionable Glasses Quest]"; - mes "Good good, let me just check"; - next; - if(countitem(2271)<1 || countitem(975)<1) goto M_NOITEMS; - delitem 2271,1; - delitem 975,1; - mes "[Fashionable Glasses Quest]"; - mes "Give me a second....."; - next; - getitem 5047,1; - mes "[Fashionable Glasses Quest]"; - mes "Ok done!"; - close; - -M_NOITEMS: - mes "[Fashionable Glasses Quest]"; - mes "You don't have the requirements."; - mes "Please come back another time..."; - close; - -M_INFO: - mes "[Fashionable Glasses Quest]"; - mes "Ok all you have to do is collect"; - mes "^CC66331 Jack'a Dandy^000000"; - mes "and ^CC66331 Scalet Dyestuffs^000000."; - next; - menu "Accept",-,"Leave",M_LEAVE; - - mes "[Fashionable Glasses Quest]"; - mes "When you are done, bring the items to me,"; - mes "Ok good luck finding those items."; - close; - -M_LEAVE: - mes "[Fashionable Glasses Quest]"; - mes "Maybe another time?"; - close; - -M_CANCEL: - mes "[Fashionable Glasses Quest]"; - mes "Aw, what a shame"; - mes "Giving up already?"; - mes "Oh well maybe you will"; - mes "participate in tommorow's"; - mes "quest."; - close; -} diff --git a/npc/custom/quests/magicalhatquest.txt b/npc/custom/quests/magicalhatquest.txt deleted file mode 100644 index 145ea0f27..000000000 --- a/npc/custom/quests/magicalhatquest.txt +++ /dev/null @@ -1,58 +0,0 @@ -//===== rAthena Script ======================================= -//= Wizard Hat Custom Quest -//===== By: ================================================== -//= Who -//===== Current Version: ===================================== -//= 1.1 -//===== Compatible With: ===================================== -//= rAthena SVN -//===== Description: ========================================= -//= Wizard Hat quest. Harmless, doesn't screw game balance. -//===== Additional Comments: ================================= -//= 1.1 Reversed ingreadients and the quest result due to -//= treasue boxes drops fix [Lupus] -//============================================================ - -geffen,126,107,5 script Wizard Hat Dude 51,{ - mes "[Wizard Hat Dude]"; - mes "Huh! What do you want?"; - mes "Ohh, I see, you want me to make you something."; - emotion e_what; - next; - mes "[Wizard Hat Dude]"; - mes "Well if you want this Wizard Hat here is a list of the items I need you to go out and get them for me:"; - mes "1 Magican Hat"; - mes "1 Bathory Card"; - mes "and 200,000z for my efforts"; - next; - mes "[Wizard Hat Dude]"; - mes "Are you ready for me to make this magical item?"; - next; - menu "Sure am!",-,"These requirements are unfathomable!",M_RIPOFF; - - mes "[Wizard Hat Dude]"; - if(countitem(5045) < 1 || countitem(4119) < 1 || Zeny < 200000) goto L_NotEnough; - delitem 5045,1; - delitem 4119,1; - set Zeny,Zeny-200000; - mes "Wow! You are brave indeed!"; - emotion e_no1; - next; - mes "[Wizard Hat Dude]"; - mes "Enjoy your Wizard Hat!"; - getitem 2252,1; - close; - -L_NotEnough: - mes ". . .I'm sorry .. You don't have enough money and items .."; - mes "I can't afford to make this if you don't bring all materials needed. Please understand this is to benefit heroes such as yourself!"; - emotion e_sry; - close; - -M_RIPOFF: - mes "[Wizard Hat Dude]"; - mes "What I had to go through was more unfathomable.."; - mes "If you succeed in getting these items, you will have incredible strength!"; - emotion e_hmm; - close; -} diff --git a/npc/custom/quests/quest_shop.txt b/npc/custom/quests/quest_shop.txt new file mode 100644 index 000000000..fd58e49a4 --- /dev/null +++ b/npc/custom/quests/quest_shop.txt @@ -0,0 +1,148 @@ +//===== rAthena Script ======================================= +//= Euphy's Quest Shop +//===== By: ================================================== +//= Euphy +//===== Current Version: ===================================== +//= 1.4a +//===== Compatible With: ===================================== +//= rAthena SVN r15340+ +//===== Description: ========================================= +//= A dynamic quest shop based on Lunar's, with easier config. +//= Includes support for multiple shops & cashpoints. +//= Item Preview script by ToastOfDoom. +//============================================================ + +prontera,164,203,6 script Quest Shop 998,{ +function Add; function Chk; function Slot; function A_An; + + if(.Shops$ != "") set .@i,1; + else { + set .@menu$,""; + for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) + set .@menu$, .@menu$+.Shops$[.@i]+":"; + set .@i, select(.@menu$); } + dispbottom "Select one item at a time."; + callshop "qshop"+.@i,1; + npcshopattach "qshop"+.@i; + end; + +function Add { + if (getitemname(getarg(1))=="null") { + debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } + for(set .@n,5; .@n<127; set .@n,.@n+2) { + if (!getarg(.@n,0)) break; + if (getitemname(getarg(.@n))=="null") { + debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } } + for(set .@i,2; .@i<.@n; set .@i,.@i+1) + set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i); + npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); + return; } +function Chk { + if (getarg(0)0) return .@s$+" ["+getitemslots(getarg(0))+"]"; + default: return .@s$; } } +function A_An { + setarray .@A$[0],"a","e","i","o","u"; + set .@B$, "_"+getarg(0); + for(set .@i,0; .@i<5; set .@i,.@i+1) + if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0); + return "a "+getarg(0); } + +OnBuyItem: + set .@q[0],@bought_nameid; + copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]")); + if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; } + mes "[Quest Shop]"; + mes "Reward: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000"; + mes "Requirements:"; + if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000"; + if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000"; + if (.@q[4]) for(set .@i,4; .@i "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000"; + next; + set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11); + addtimer 1000, strnpcinfo(1)+"::OnEnd"; + while(1){ + switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512)) && @qe2>0 && !@qe6)?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { + case 1: + if (@qe0) { + mes "[Quest Shop]"; + mes "You're missing one or more quest requirements."; + close; } + if (!checkweight(.@q[0],.@q[1])) { + mes "[Quest Shop]"; + mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; + close; } + if (.@q[2]) set Zeny, Zeny-.@q[2]; + if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3]; + if (.@q[4]) for(set .@i,4; .@i","" + setarray .Points$[0],"#CASHPOINTS","Cash Points"; + + set .Announce,1; // Announce quest completion? (1: yes / 0: no) + set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) + set .DisplayID,0; // Show item IDs? (1: yes / 0: no) + set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) + +// Shop categories, if needed: "",""{,...}; +// Duplicate dummy data for any additional shops (bottom of script). +// If no categories, use the second line instead (remove //). + + setarray .Shops$[1],"Headgears","Weapons","Other"; + // set .Shops$,"n/a"; + +// Add(,,,,, +// ,{,...}); +// Shop number corresponds with order above (default is 1). +// Note: Do NOT use a reward item more than once! + + Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2); + Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600); + Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1); + Add(1,5045,1,0,0,2252,1,1054,450,943,1200); + + Add(2,1224,1,0,0,7297,30,969,10,999,50,714,10); + Add(2,1225,1,0,0,7292,30,969,10,999,50,714,10); + + Add(3,531,1,3,0,512,1,713,1); + Add(3,532,1,3,0,513,1,713,1); + Add(3,533,1,3,0,514,1,713,1); + Add(3,534,1,3,0,515,1,713,1); + +// -------------------------------------------------- + freeloop(0); + for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) + npcshopdelitem "qshop"+.@i,909; + end; +} + +// -------- Dummy data (duplicate as needed) -------- +- shop qshop1 -1,909:-1 +- shop qshop2 -1,909:-1 +- shop qshop3 -1,909:-1 \ No newline at end of file diff --git a/npc/custom/quests/questboard.txt b/npc/custom/quests/questboard.txt new file mode 100644 index 000000000..3bea4b71c --- /dev/null +++ b/npc/custom/quests/questboard.txt @@ -0,0 +1,300 @@ +//===== rAthena Script ======================================= +//= tr0n's Questboard +//===== By: ================================================== +//= tr0n +//===== Current Version: ===================================== +//= 1.3.4 +//===== Compatible With: ===================================== +//= rAthena SVN +//===== Description: ========================================= +//= Easily add collection and hunting quests. +//===== Additional Comments: ================================= +// 1.0.0 Release +// 1.1.0 Added zeny reward +// 1.2.0 Rewrote checkmob and killcounter +// 1.3.1 Added level restriction +// 1.3.4 Added Reward Item Amount +//============================================================ + +prontera,129,215,5 script Questboard 857,{ + + if(c_run==1){ + mes "[^FF7700Questboard^000000]"; + mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000"; + mes "--------------------------------"; + for( set .@j, 0; .@j < getarraysize(getd("."+ currentquest$ + "_collectionitem")); set .@j,.@j+2) { + mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+currentquest$+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; + } + mes "--------------------------------"; + mes "[Reward]"; + mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" ea.^000000":"Nothing^000000"); + mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000"; + mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000"; + mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000"; + next; + if(select("Finish:Abort") == 2){ + mes "[^FF7700Questboard^000000]"; + mes "Quest aborted."; + set currentquest$, ""; + set c_run, 0; + close; + } + goto L_checkitems; + } + + if(h_run==1) { + mes "[^FF7700Questboard^000000]"; + mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000"; + mes "--------------------------------"; + for( set .@j, 0; .@j < getarraysize(getd("."+ currentquest$ + "_huntingmob")); set .@j,.@j+2) { + set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]"); + mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; + } + mes "--------------------------------"; + mes "[Reward]"; + mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" ea.^000000":"Nothing^000000"); + mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000"; + mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000"; + mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000"; + next; + if(select("Finish:Abort") == 2){ + mes "[^FF7700Questboard^000000]"; + mes "Quest aborted."; + for(set .@x, 1; .@x < getarraysize(getd("."+currentquest$+"_huntingmob")); set .@x,.@x+2){ + set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]"); + setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0); + } + set currentquest$, ""; + set h_run, 0; + close; + } + goto L_checkmobs; + } + +L_questmenu: + mes "[^FF7700Questboard^000000]"; + mes "Select category:"; + next; + + switch(select((.collection)?"Collection Quests":"", + (.hunting)?"Hunting Quests":"", + "Exit")) { + +case 1: + set .@collectmenu$, ""; + for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1) { + if (.@i) set .@collectmenu$,.@collectmenu$+":"; + set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$"); + } + set .@selection,select(.@collectmenu$); + mes "[^FF7700Questboard^000000]"; + mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000"; + mes "--------------------------------"; + for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_collectionitem")); set .@j,.@j+2) { + mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; + } + mes "--------------------------------"; + mes "[Reward]"; + mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000"); + mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000"; + mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000"; + mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000"; + next; + if(select("Accept:Decline") == 2){ + close; + } + if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax")) + { + mes "[^FF7700Questboard^000000]"; + mes "Quest accepted."; + set c_run, 1; + set currentquest$, .@selection; + close; + } + else + { + mes "[^FF7700Questboard^000000]"; + mes "You don't have the required"; + mes "level to do this quest."; + close; + } + +case 2: + set .@huntmenu$, ""; + for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1) { + if (.@i) set .@huntmenu$,.@huntmenu$+":"; + set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$"); + } + set .@selection,select(.@huntmenu$); + mes "[^FF7700Questboard^000000]"; + mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000"; + mes "--------------------------------"; + for( set .@j, 0; .@j < getarraysize(getd("."+ .@selection + "_huntingmob")); set .@j,.@j+2) { + mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; + } + mes "--------------------------------"; + mes "[Reward]"; + mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000"); + mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000"; + mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000"; + mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000"; + next; + if(select("Accept:Decline") == 2){ + close; + } + if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax")) + { + mes "[^FF7700Questboard^000000]"; + mes "Quest accepted."; + set h_run, 1; + set currentquest$, .@selection; + close; + } + else + { + mes "[^FF7700Questboard^000000]"; + mes "You don't have the required"; + mes "level to do this quest."; + close; + } + +case 3: + close; + } + +L_checkitems: + for( set .@k,0; .@k < getarraysize(getd("."+currentquest$+"_collectionitem")); set .@k,.@k+2) { + if(countitem(getd("."+currentquest$+"_collectionitem["+.@k+"]"))>=getd("."+currentquest$+"_collectionitem["+(.@k+1)+"]")){ + set .@checkitem,.@checkitem+2; + } + } + if(.@checkitem=getd("."+currentquest$+"_huntingmob["+.@i+"]")) end; + setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1); + dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+.@i+"]")+")"; + end; + } + continue; + } + end; + +OnInit: + + function AddCollection; + function AddHunting; + + //Activate/Deactive quest categories here + set .collection, 1; + set .hunting, 1; + + //Checks if quests are loaded (prevents out of index) + if(.questsloaded==1) end; + set .questsloaded, 1; + + //Add Collection Quests here + //AddCollection("",,,,,,,,,,...); + + //Add Hunting Quests here + //AddHunting("",,,,,,,,,,...); + + end; + + +function AddCollection { + set .collectionquestcount,.collectionquestcount+1; + setd ("." +.collectionquestcount+"_collectionname$", getarg(0)); + setd ("." +.collectionquestcount+"_collectionmin", getarg(1)); + setd ("." +.collectionquestcount+"_collectionmax", getarg(2)); + setd ("." +.collectionquestcount+"_collectionprize", getarg(3)); + setd ("." +.collectionquestcount+"_collectionamount", getarg(4)); + setd ("." +.collectionquestcount+"_collectionzeny", getarg(5)); + set .@argcount, 6; + set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); + setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); + setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount+1)); + set .@argcount, .@argcount+2; + while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1) { + set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); + setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg(.@argcount)); + setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg(.@argcount+1)); + set .@argcount,.@argcount+2; + } + return; +} + +function AddHunting { + set .huntingquestcount,.huntingquestcount+1; + setd ("." +.huntingquestcount+"_huntingname$", getarg(0)); + setd ("." +.huntingquestcount+"_huntingmin", getarg(1)); + setd ("." +.huntingquestcount+"_huntingmax", getarg(2)); + setd ("." +.huntingquestcount+"_huntingprize", getarg(3)); + setd ("." +.huntingquestcount+"_huntingamount", getarg(4)); + setd ("." +.huntingquestcount+"_huntingzeny", getarg(5)); + set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); + set .@argcount, 6; + setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount)); + setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); + set .@argcount, .@argcount+2; + while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1) { + set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); + setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); + setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount+1)); + set .@argcount, .@argcount+2; + } + return; +} +} \ No newline at end of file diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index 08548f792..ee22ac71e 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -18,8 +18,6 @@ //npc: npc/custom/card_remover.txt //npc: npc/custom/item_signer.txt //npc: npc/custom/woe_controller.txt -// -- Warper that works only after locations are unlocked -//npc: npc/custom/quest_warper.txt // ----------------------- Other Scripts ----------------------- // -- MVP Arena @@ -47,8 +45,13 @@ //npc: npc/custom/etc/floating_rates.txt // -- Wedding script that supports same-sex marriages //npc: npc/custom/etc/marriage.txt +// -- Warper that works only after locations are unlocked +//npc: npc/custom/etc/quest_warper.txt // ----------------------- Quest Scripts ----------------------- +// -- Dynamic Quest Scripts +//npc: npc/custom/quests/quest_shop.txt +//npc: npc/custom/quests/questboard.txt // -- Treasure Hunters Guild Quests (40 Quests + Special Guild Shop) //npc: npc/custom/quests/thq/THQS_ChatingNPC.txt //npc: npc/custom/quests/thq/THQS_GuildNPC.txt @@ -58,7 +61,6 @@ // -- Equipment Quests //npc: npc/custom/quests/magicalhatquest.txt //npc: npc/custom/quests/elvenear.txt -//npc: npc/custom/quests/fashion.txt //npc: npc/custom/quests/sunglasses.txt //npc: npc/custom/quests/bandit_beard.txt //npc: npc/custom/quests/event_6_new_hats.txt @@ -74,16 +76,15 @@ //npc: npc/custom/quests/kahohorn.txt // ----------------------- Event Scripts ----------------------- -// -- X-Mas, Karachun, and New Year (8 Dec. ~ 8 Jan.) +// -- Daily Events +//npc: npc/custom/events/disguise.txt +//npc: npc/custom/events/mushroom_event.txt +//npc: npc/custom/events/cluckers.txt +// -- Holiday Events //npc: npc/custom/events/xmas_rings_event.txt -// -- Custom Valentine's Day event //npc: npc/custom/events/valentinesdayexp.txt -// -- Custom Halloween scripts //npc: npc/custom/events/hallow06.txt //npc: npc/custom/events/uneasy_cemetery.txt -//npc: npc/custom/events/draculax.txt -// -- Hyegun event -//npc: npc/custom/events/hyegun_event.txt // ----------------------- Unofficial Scripts ----------------------- // -- Unofficial Airplane script -- cgit v1.2.3-70-g09d2