summaryrefslogtreecommitdiff
path: root/world/map/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r--world/map/npc/functions/DyeConfig.txt42
-rw-r--r--world/map/npc/functions/announcements.txt194
-rw-r--r--world/map/npc/functions/banker.txt271
-rw-r--r--world/map/npc/functions/barber.txt250
-rw-r--r--world/map/npc/functions/clear_vars.txt490
-rw-r--r--world/map/npc/functions/dailyquest.txt189
-rw-r--r--world/map/npc/functions/default_npc_checks.txt155
-rw-r--r--world/map/npc/functions/doomsday.txt1435
-rw-r--r--world/map/npc/functions/dynamic_menu.txt302
-rw-r--r--world/map/npc/functions/evil_obelisk.txt97
-rw-r--r--world/map/npc/functions/ferry.txt140
-rw-r--r--world/map/npc/functions/game_rules.txt193
-rw-r--r--world/map/npc/functions/ghost.txt36
-rw-r--r--world/map/npc/functions/global_event_handler.txt48
-rw-r--r--world/map/npc/functions/gm_island.txt131
-rw-r--r--world/map/npc/functions/headstyles.txt112
-rw-r--r--world/map/npc/functions/inn.txt36
-rw-r--r--world/map/npc/functions/lockpicking.txt93
-rw-r--r--world/map/npc/functions/magic.txt191
-rw-r--r--world/map/npc/functions/miriam.txt20
-rw-r--r--world/map/npc/functions/mob_points.txt247
-rw-r--r--world/map/npc/functions/motd.txt.example10
-rw-r--r--world/map/npc/functions/motdconfig.txt40
-rw-r--r--world/map/npc/functions/process_equip.txt28
-rw-r--r--world/map/npc/functions/quiz.txt97
-rw-r--r--world/map/npc/functions/slot_machine.txt65
-rw-r--r--world/map/npc/functions/soul_menhir.txt57
-rw-r--r--world/map/npc/functions/stat_reset.txt55
-rw-r--r--world/map/npc/functions/time.txt175
-rw-r--r--world/map/npc/functions/travelers.txt243
-rw-r--r--world/map/npc/functions/undead_debug.txt119
-rw-r--r--world/map/npc/functions/water_bottle.txt45
32 files changed, 0 insertions, 5606 deletions
diff --git a/world/map/npc/functions/DyeConfig.txt b/world/map/npc/functions/DyeConfig.txt
deleted file mode 100644
index 999f6722..00000000
--- a/world/map/npc/functions/DyeConfig.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-009-2,32,105,0|script|#DyeChecker|32767
-{
- end;
-OnInit:
- /******************************
- Config Starts Here
- ******************************/
- setarray $@DYE_color_names$, "Red", "Green", "Dark Blue", "Yellow", "Light blue", "Pink", "Black", "Orange", "Purple", "Dark Green";
- setarray $@DYE_colors$, "Red", "Green", "DarkBlue", "Yellow", "LightBlue", "Pink", "Black", "Orange", "Purple", "DarkGreen";
-
- setarray $@DYE_items$, "Beret", "CottonShirt", "CottonCloth", "VNeckSweater", "Turtleneck", "CottonShorts", "CottonTrousers", "CottonSkirt", "Miniskirt", "TankTop", "ShortTankTop", "SilkRobe", "CottonHeadband", "DesertHat", "CottonBoots", "CottonGloves", "RabbitEars", "WizardHat", "BowlerHat", "BowlerHatBrown", "FineDress", "Contributor", "SorcererRed", "SorcererGreen", "SorcererDBlue", "SorcererYellow", "SorcererLBlue", "SorcererPink", "SorcererBlack", "SorcererOrange", "SorcererPurple", "SorcererDGreen", "SorcererWhite";
- setarray $@DYE_item_names$, "Beret", "Cotton Shirt", "Cotton Cloth", "V-Neck Sweater", "Turtleneck Sweater", "Cotton Shorts", "Cotton Trousers", "Cotton Skirt", "Miniskirt", "Tank Top", "Short Tank Top", "Silk Robe", "Cotton Headband", "Desert Hat", "Cotton Boots", "Cotton Gloves", "Rabbit Ears", "Wizard Hat", "Bowler Hat", "Bowler Hat (brown)", "Fine Dress", "Contributor Shirt", "Sorcerer Robe (Red)", "Sorcerer Robe (Green)", "Sorcerer Robe (Dark Blue)", "Sorcerer Robe (Yellow)", "Sorcerer Robe (Light Blue)", "Sorcerer Robe (Pink)", "Sorcerer Robe (Black)", "Sorcerer Robe (Orange)", "Sorcerer Robe (Purple)", "Sorcerer Robe (Dark Green)", "Sorcerer Robe (White)";
- /******************************
- Config Ends Here
- ******************************/
-
- set $@w, 0;
- freeloop 1; // do not check for infinity loop
- callsub S_Array;
- freeloop 0; // re-enable infinity loop check
- set $@w, 0;
- set $@c, 0;
- end;
-
-S_Array:
- if(getitemlink($@DYE_items$[$@w]) == "Unknown Item") goto L_Fail;
- set $@c, 0;
- callsub S_Color;
- set $@w, $@w + 1;
- if($@w < getarraysize($@DYE_items$)) goto S_Array;
- return;
-
-L_Fail:
- debugmes "Dye Fail: "+$@DYE_items$[$@w];
- mapexit;
-
-S_Color:
- if(getitemlink($@DYE_colors$[$@c] + $@DYE_items$[$@w]) == "Unknown Item") goto L_Fail;
- set $@c, $@c + 1;
- if($@c < getarraysize($@DYE_colors$)) goto S_Color;
- return;
-}
diff --git a/world/map/npc/functions/announcements.txt b/world/map/npc/functions/announcements.txt
deleted file mode 100644
index f5d3491b..00000000
--- a/world/map/npc/functions/announcements.txt
+++ /dev/null
@@ -1,194 +0,0 @@
-//############################################################################
-//# #
-//# GM scheduled broadcasts #
-//# #
-//############################################################################
-
-// $@GMSA_STATUS values:
-// 0: Broadcasts not running
-// 1: Broadcasts running
-// $@GMSA_NAME$: the GM/Admin who created the broadcast, if any
-// $@GMSA_MSG$: the message to be broadcasted
-// $@GMSA_MAX: the number of times the broadcast will be performed, if > 0
-// $@GMSA_TICK: broadcast the message every $@GMSA_TICK hours
-// $@GMSA_CURRENT_TICK: internal counter incremented every hour
-
-function|script|SBConfig
-{
- if ($@GMSA_STATUS)
- goto L_InfoBroadcast;
- goto L_PrepareBroadcast;
-
-L_InfoBroadcast:
- set @ms, (3600000*($@GMSA_TICK - $@GMSA_CURRENT_TICK) - getnpctimer(0, "Stone Board"));
- if (@ms < 0) set @ms, 0; // FIXME: find out WHY this can happen
- callfunc "HumanTime";
-
- mes "[GM Scheduled Broadcasts Board]";
- mes $@GMSA_NAME$ + " scheduled the current message, every " + $@GMSA_TICK + " hour(s):";
- mes $@GMSA_MSG$;
- next;
- mes "The next broadcast will happen in " + @time$ + ".";
- next;
-
- set @next_broadcast_ts, 0;
- set @next_broadcast_h, 0;
- set @next_broadcast_m, 0;
-
- mes "What do you want to do?";
- menu
- "Nothing.", L_Close,
- "Nothing but... what is this?", L_Help,
- "Stop broadcasting.", L_StopBroadcast,
- "Trigger manually the current broadcast.", L_ManualBroadcast;
-
-L_PrepareBroadcast:
- callsub S_Help;
- next;
- mes "There is no broadcast scheduled.";
- mes "Do you want to create one?";
- menu
- "No.", L_Close,
- "Yes.", L_CreateBroadcast;
-
-L_CreateBroadcast:
- mes "[GM Scheduled Broadcasts Board]";
- mes "Enter the message to broadcast:";
- input $@GMSA_MSG$;
- if ($@GMSA_MSG$ == "")
- goto L_InvalidBMsg;
-
- next;
- mes "[GM Scheduled Broadcasts Board]";
- mes "The message will be broadcasted every X hour(s). Enter X:";
- input $@GMSA_TICK;
- if ($@GMSA_TICK < 1 || $@GMSA_TICK > 24)
- goto L_InvalidBroadcastTick;
-
- next;
- mes "[GM Scheduled Broadcasts Board]";
- mes "If you want the message to be broadcasted a limited number of times, enter its value. Keep 0 otherwise:";
- input $@GMSA_MAX;
-
- next;
- mes "[GM Scheduled Broadcasts Board]";
- if ($@GMSA_MAX == 0)
- mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s):";
- if ($@GMSA_MAX > 0)
- mes "The current message will be broadcasted every " + $@GMSA_TICK + " hour(s), up to " + $@GMSA_MAX + " times:";
- mes $@GMSA_MSG$;
- next;
- mes "Is this correct?";
- menu
- "No. I'll retry.", L_CreateBroadcast,
- "No", L_Close,
- "Yes. Broadcast this. (the first broadcast will happen in " + $@GMSA_TICK + " hour(s).)", L_StartBroadcast,
- "Yes. Broadcast this, and make an extra broadcast right now.", L_StartBroadcast2;
-
-L_InvalidBMsg:
- mes "[GM Scheduled Broadcasts Board]";
- mes "The message can't be empty. Please retry.";
- goto L_CreateBroadcast;
-
-L_InvalidBroadcastTick:
- mes "[GM Scheduled Broadcasts Board]";
- mes "You obviously can't repeat a message every 0 hours. Please retry.";
- goto L_CreateBroadcast;
-
-L_Help:
- callsub S_Help;
- goto L_Close;
-
-S_Help:
- mes "[GM Scheduled Broadcasts Board]";
- mes "This board allows a GM to schedule a message to be broadcast every X hours.";
- mes "Only one broadcast can be scheduled at a time.";
- return;
-
-L_ManualBroadcast:
- announce $@GMSA_MSG$, 0;
- mes "Done.";
- goto L_Close;
-
-L_StopBroadcast:
- donpcevent "Stone Board::OnStopBroadcast";
- mes "Done.";
- gmlog strcharinfo(0) + " stopped the scheduled broadcast.";
- goto L_Close;
-
-L_StartBroadcast2:
- if ($@GMSA_STATUS == 1)
- goto L_Abort;
- announce $@GMSA_MSG$, 0;
- goto L_StartBroadcast;
-
-L_StartBroadcast:
- if ($@GMSA_STATUS == 1)
- goto L_Abort;
- set $@GMSA_STATUS, 1;
- set $@GMSA_NAME$, strcharinfo(0);
- set $@GMSA_CURRENT_TICK, 0;
- initnpctimer "Stone Board";
- mes "Done.";
- gmlog strcharinfo(0) + " modified the scheduled broadcast.";
- goto L_Close;
-
-L_Abort:
- mes "[GM Scheduled Broadcasts Board]";
- mes $@GMSA_NAME$ + " has created a scheduled broadcast just before you, hence yours will abort.";
- goto L_Close;
-
-L_Close:
- return;
-}
-
-
-017-9,26,28,0|script|Stone Board|32767
-{
- end;
-
-OnStopBroadcast:
- goto L_Stop;
-
-L_Stop:
- stopnpctimer "Stone Board";
- setnpctimer 0, "Stone Board";
- set $@GMSA_STATUS, 0;
- set $@GMSA_NAME$, "";
- set $@GMSA_MSG$, "";
- set $@GMSA_TICK, 0;
- set $@GMSA_MAX, 0;
- set $@GMSA_CURRENT_TICK, 0;
- end;
-
-OnTimer3600000:
- set $@GMSA_CURRENT_TICK, $@GMSA_CURRENT_TICK + 1;
- setnpctimer 0, "Stone Board";
- if ($@GMSA_CURRENT_TICK != $@GMSA_TICK)
- end;
- announce $@GMSA_MSG$, 0;
- set $@GMSA_CURRENT_TICK, 0;
- set $@GMSA_MAX, $@GMSA_MAX - 1;
- if ($@GMSA_MAX != 0)
- end;
- goto L_Stop;
-}
-
-function|script|getBroadcast
-{
- if (getmap() == "029-2" && getx() == 22 && gety() == 24) goto L_NewPlayer;
- goto L_ReturningPlayer;
-
-L_NewPlayer:
- // todo: show game rules on login
- // FIXME: needs to spawn a 32767 puppet
- goto L_Return;
-
-L_ReturningPlayer:
- if ($@GMSA_STATUS < 1) goto L_Return;
- announce $@GMSA_MSG$, 3;
- goto L_Return;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/banker.txt b/world/map/npc/functions/banker.txt
deleted file mode 100644
index 711275e2..00000000
--- a/world/map/npc/functions/banker.txt
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-
-function|script|Banker
-{
- if (BankAccount == 0)
- goto L_Start;
- callsub S_MoveAccount;
- goto L_Start;
-
-L_Start:
- if(@npcname$ == "") set @npcname$, strnpcinfo(1);
- mes "[" + @npcname$ + "]";
- mes "\"Welcome to the bank!";
- mes "How can I help you?\"";
- next;
- menu
- "Open my storage", L_Storage,
- "Deposit", L_Dep,
- "Withdraw", L_With,
- "Check my balance", L_Balance,
- "Change Bank Options", L_Change,
- "Nevermind", L_Nev;
-
-// need to close window before opening storage.
-L_Storage:
- if (#BankOptions & OPT_STORAGE_CLOSE) close2;
- openstorage;
- if (#BankOptions & OPT_STORAGE_CLOSE) goto L_Return;
- goto L_Start;
-
-L_Dep:
- mes "[" + @npcname$ + "]";
- mes "\"How much would you like to deposit?\"";
- next;
- menu
- "Other", L_Dep_Input,
- "5,000 GP", L_Dep_5k,
- "10,000 GP", L_Dep_10k,
- "25,000 GP", L_Dep_25k,
- "50,000 GP", L_Dep_50k,
- "100,000 GP", L_Dep_100k,
- "250,000 GP", L_Dep_250k,
- "500,000 GP", L_Dep_500k,
- "1,000,000 GP", L_Dep_1kk,
- "All of my money", L_Dep_All,
- "I've changed my mind", L_Start,
- "Quit", L_Return;
-
-L_Dep_Input:
- input @Amount;
- if (@Amount >= 0)
- goto L_Dep_Continue;
- mes "[" + @npcname$ + "]";
- mes "\"I need a positive amount. What would you like to do?\"";
- menu
- "Go back", L_Start,
- "Try again", L_Dep_Input,
- "Deposit all", L_Dep_All,
- "Nevermind", L_Nev;
-
-L_Dep_5k:
- if (Zeny<5000)
- goto L_NoMoney;
- set @Amount, 5000;
- goto L_Dep_Continue;
-
-L_Dep_10k:
- if (Zeny<10000)
- goto L_NoMoney;
- set @Amount, 10000;
- goto L_Dep_Continue;
-
-L_Dep_25k:
- if (Zeny<25000)
- goto L_NoMoney;
- set @Amount, 25000;
- goto L_Dep_Continue;
-
-L_Dep_50k:
- if (Zeny<50000)
- goto L_NoMoney;
- set @Amount, 50000;
- goto L_Dep_Continue;
-
-L_Dep_100k:
- if (Zeny<100000)
- goto L_NoMoney;
- set @Amount, 100000;
- goto L_Dep_Continue;
-
-L_Dep_250k:
- if (Zeny<250000)
- goto L_NoMoney;
- set @Amount, 250000;
- goto L_Dep_Continue;
-
-L_Dep_500k:
- if (Zeny<500000)
- goto L_NoMoney;
- set @Amount, 500000;
- goto L_Dep_Continue;
-
-L_Dep_1kk:
- if (Zeny<1000000)
- goto L_NoMoney;
- set @Amount, 1000000;
- goto L_Dep_Continue;
-
-L_Dep_All:
- if (Zeny<1)
- goto L_NoMoney;
- set @Amount, Zeny;
- goto L_Dep_Continue;
-
-L_Dep_Continue:
- if (Zeny < @Amount)
- goto L_NoMoney;
- set Zeny, Zeny - @Amount;
- set #BankAccount, #BankAccount + @Amount;
- goto L_Balance;
-
-L_With:
- mes "[" + @npcname$ + "]";
- mes "\"How much would you like to withdraw?\"";
- menu
- "Other", L_With_Input,
- "5,000 GP", L_With_5k,
- "10,000 GP", L_With_10k,
- "25,000 GP", L_With_25k,
- "50,000 GP", L_With_50k,
- "100,000 GP", L_With_100k,
- "250,000 GP", L_With_250k,
- "500,000 GP", L_With_500k,
- "1,000,000 GP", L_With_1kk,
- "All of my money", L_With_All,
- "I've changed my mind", L_Start,
- "Quit", L_Return;
-
-L_With_Input:
- input @Amount;
- if (@Amount >= 0)
- goto L_With_Continue;
- mes "[" + @npcname$ + "]";
- mes "\"I need a positive amount. What would you like to do?\"";
- menu
- "Go back", L_Start,
- "Try again", L_With_Input,
- "Withdraw all", L_With_All,
- "Nevermind", L_Nev;
-
-L_With_5k:
- if (#BankAccount < 5000)
- goto L_NoMoney;
- set @Amount, 5000;
- goto L_With_Continue;
-
-L_With_10k:
- if (#BankAccount < 10000)
- goto L_NoMoney;
- set @Amount, 10000;
- goto L_With_Continue;
-
-L_With_25k:
- if (#BankAccount < 25000)
- goto L_NoMoney;
- set @Amount, 25000;
- goto L_With_Continue;
-
-L_With_50k:
- if (#BankAccount < 50000)
- goto L_NoMoney;
- set @Amount, 50000;
- goto L_With_Continue;
-
-L_With_100k:
- if (#BankAccount < 100000)
- goto L_NoMoney;
- set @Amount, 100000;
- goto L_With_Continue;
-
-L_With_250k:
- if (#BankAccount < 250000)
- goto L_NoMoney;
- set @Amount, 250000;
- goto L_With_Continue;
-
-L_With_500k:
- if (#BankAccount < 500000)
- goto L_NoMoney;
- set @Amount, 500000;
- goto L_With_Continue;
-
-L_With_1kk:
- if (#BankAccount < 1000000)
- goto L_NoMoney;
- set @Amount, 1000000;
- goto L_With_Continue;
-
-L_With_All:
- if (#BankAccount < 0)
- goto L_NoMoney;
- set @Amount, #BankAccount;
- goto L_With_Continue;
-
-L_With_Continue:
- if (#BankAccount < @Amount)
- goto L_NoMoney;
- set Zeny, Zeny + @Amount;
- set #BankAccount, #BankAccount - @Amount;
- goto L_Balance;
-
-L_Balance:
- mes "[" + @npcname$ + "]";
- mes "\"Your current bank balance is:";
- mes #BankAccount + " GP\"";
- if (!(#BankOptions & OPT_BANK_CLOSE) || (#BankAccount >= 10000000 &&
- BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE))) next;
- if (#BankAccount >= 10000000 && BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE))
- goto L_GiveShade;
- if (#BankOptions & OPT_BANK_CLOSE) goto L_Return;
- goto L_Start;
-
-L_GiveShade:
- mes "\"Oh\"";
- next;
- mes "\"It seems you managed to amass quite a fortune!\"";
- next;
- mes "\"Thank you for using our services. Please accept this little gift.\"";
- set #BankOptions, #BankOptions | OPT_BANK_GOTSHADE;
- getitem "CashiersShade", 1;
- if (#BankOptions & OPT_BANK_CLOSE) goto L_Return;
- next;
- npcaction 9; // clear npc dialog
- goto L_Start;
-
-L_Nev:
- mes "[" + @npcname$ + "]";
- mes "\"Goodbye then.\"";
- return;
-
-L_NoMoney:
- mes "[" + @npcname$ + "]";
- mes "\"Oh dear, it seems that you don't have enough money.\"";
- goto L_Start;
-
-S_MoveAccount:
- set #BankAccount, #BankAccount + BankAccount;
- set BankAccount, 0;
- return;
-
-L_Change:
- setarray @menuitems$, "Keep the current settings", "Close NPC dialog after selecting storage option", "Close NPC dialog after checking your balance";
- if (#BankOptions & OPT_STORAGE_CLOSE) set @menuitems$[1], "Return to main menu after leaving storage";
- if (#BankOptions & OPT_BANK_CLOSE) set @menuitems$[2], "Return to main menu after leaving bank";
- menu
- @menuitems$[0], L_Start,
- @menuitems$[1], L_Change_Storage,
- @menuitems$[2], L_Change_Bank;
-
-L_Change_Storage:
- set #BankOptions, (#BankOptions ^ OPT_STORAGE_CLOSE);
- goto L_Start;
-
-L_Change_Bank:
- set #BankOptions, (#BankOptions ^ OPT_BANK_CLOSE);
- goto L_Start;
-
-L_Return:
- set @npcname$, "";
- return;
-}
diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt
deleted file mode 100644
index dbc7614b..00000000
--- a/world/map/npc/functions/barber.txt
+++ /dev/null
@@ -1,250 +0,0 @@
-// The Barber script has been around since before the repository split
-// so it's hard to figure out who wrote it.
-
-// o11c updated it according to new scripting standards while adding pink.
-// ... and added the code that shows your old color/style.
-
-// Note: there is a soft limit of 15 colors per classes and 20 styles (0-19)
-// This is the number that can be set when creating a character
-// or using GM commands, but scripts (such as this one) can set
-// any value 0-255
-
-function|script|Barber
-{
- if (getequipid(equip_head) == 647)
- goto L_Debug;
- callfunc "getHeadStyles";
- set @hairOpts, 0;
- set @colorOpts, 0;
- set @menu, 0;
- goto L_Main;
-
-L_MainClear:
- clear;
- goto L_Main;
-
-L_Main:
- set @style, getlook(LOOK_HAIR_STYLE);
- set @color, getlook(LOOK_HAIR_COLOR);
- set @style$, "Unknown";
- set @color$, "Unknown";
-
- if (@style >= 1 && @style <= 20)
- set @style$, @HairStyles$[(@style - 1)];
-
- if (@color == ((HC_WHITE - Class) + 1))
- set @color$, "Shocked White";
- set @color, (@color - (15 * (Class - 1)));
- if (@color >= 0 && @color <= 15)
- set @color$, @HairColors$[@color];
-
- if (Sex == 0) set @gender$, " female";
- elif (Sex == 1) set @gender$, " male";
- elif (Class == 3 || Class == 6) set @gender$, "n";
- else set @gender$, "";
-
- mes "You are a" + @gender$ + " " + @species$ + ".";
- mes "Your current style is " + @style$ + " and your current color is " + @color$ + ".";
- set @style$, "";
- set @color$, "";
- menu
- "Change my style", L_Style,
- "Change my color", L_Color,
- "Change my gender", L_Gender,
- "Change my species", L_Species,
- "Nah, I'm fine", L_Done;
-
-L_Gender:
- menu
- "Female.", L_Female,
- "Male.", L_Male,
- "Non-binary.", L_NonBinary,
- "Nah, I'm fine", L_MainClear;
-
-L_Female:
- set Sex, 0;
- goto L_MainClear;
-
-L_Male:
- set Sex, 1;
- goto L_MainClear;
-
-L_NonBinary:
- set Sex, 3;
- goto L_MainClear;
-
-L_Species:
- if (countitem("SkeletonCharm") >= 1)
- menu
- "Talpan", L_Species_next,
- "Tritan", L_Species_next,
- "Ifriton", L_Species_next,
- //"Gispaan", L_Species_next,
- //"Sparron", L_Species_next,
- "Undead", L_Species_next,
- "Nah, I'm fine", L_MainClear;
- //else
- menu
- "Talpan", L_Species_next,
- "Tritan", L_Species_next,
- "Ifriton", L_Species_next,
- //"Gispaan", L_Species_next,
- //"Sparron", L_Species_next,
- "Nah, I'm fine", L_MainClear;
-
-L_Species_next:
- if (@menu == 4) set @menu, 6;
- set Class, @menu;
- callfunc "fixHeadStyles";
- goto L_MainClear;
-
-L_Style:
- if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Surprise me";
- if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Nah, I'm fine";
- if(!@hairOpts) set @hairOpts, 1;
- menu
- @HairStyles$[0], L_MenuItems,
- @HairStyles$[1], L_MenuItems,
- @HairStyles$[2], L_MenuItems,
- @HairStyles$[3], L_MenuItems,
- @HairStyles$[4], L_MenuItems,
- @HairStyles$[5], L_MenuItems,
- @HairStyles$[6], L_MenuItems,
- @HairStyles$[7], L_MenuItems,
- @HairStyles$[8], L_MenuItems,
- @HairStyles$[9], L_MenuItems,
- @HairStyles$[10], L_MenuItems,
- @HairStyles$[11], L_MenuItems,
- @HairStyles$[12], L_MenuItems,
- @HairStyles$[13], L_MenuItems,
- @HairStyles$[14], L_MenuItems,
- @HairStyles$[15], L_MenuItems,
- @HairStyles$[16], L_MenuItems,
- @HairStyles$[17], L_MenuItems,
- @HairStyles$[18], L_MenuItems,
- @HairStyles$[19], L_MenuItems,
- @HairStyles$[20], L_MenuItems,
- @HairStyles$[21], L_MenuItems;
-
-L_MenuItems:
- if(@menu == (getarraysize(@HairStyles$) - 1)) goto L_RandomStyle;
- if(@menu >= getarraysize(@HairStyles$)) goto L_MainClear;
- setlook LOOK_HAIR_STYLE, @menu;
- goto L_MainClear;
-
-L_RandomStyle:
- setarray @randomStyle[0], rand(1, (getarraysize(@HairStyles$) - 2));
- setarray @randomStyle[1], @randomStyle[1] + 1; // infinite loop prevention
- if(@randomStyle[0] == @style && @randomStyle[1] < 15) goto L_RandomStyle;
- setlook LOOK_HAIR_STYLE, @randomStyle[0];
- setarray @randomStyle[1], 0;
- menu
- "Surprise me once again", L_RandomStyle,
- "Go back", L_MainClear,
- "Goodbye", L_Done;
-
-L_Color:
- if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Surprise me";
- if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Nah, I'm fine";
- if(!@colorOpts) set @colorOpts, 1;
- menu
- @HairColors$[0], L_MenuItems1,
- @HairColors$[1], L_MenuItems1,
- @HairColors$[2], L_MenuItems1,
- @HairColors$[3], L_MenuItems1,
- @HairColors$[4], L_MenuItems1,
- @HairColors$[5], L_MenuItems1,
- @HairColors$[6], L_MenuItems1,
- @HairColors$[7], L_MenuItems1,
- @HairColors$[8], L_MenuItems1,
- @HairColors$[9], L_MenuItems1,
- @HairColors$[10], L_MenuItems1,
- @HairColors$[11], L_MenuItems1,
- @HairColors$[12], L_MenuItems1,
- @HairColors$[13], L_MenuItems1,
- @HairColors$[14], L_MenuItems1,
- @HairColors$[15], L_MenuItems1,
- @HairColors$[16], L_MenuItems1;
-
-L_MenuItems1:
- if(@menu == (getarraysize(@HairColors$) - 1)) goto L_RandomColor;
- if(@menu >= getarraysize(@HairColors$)) goto L_MainClear;
- setlook LOOK_HAIR_COLOR, ((@menu - 1) + (15 * (Class - 1)));
- goto L_MainClear;
-
-L_RandomColor:
- setarray @randomColor[0], rand((15 * (Class - 1)), ((getarraysize(@HairColors$) - 3) + (15 * (Class - 1))));
- setarray @randomColor[1], @randomColor[1] + 1;
- if(@randomColor[0] == @color && @randomColor[1] < 15) goto L_RandomColor;
- setlook LOOK_HAIR_COLOR, @randomColor[0];
- setarray @randomColor[1], 0;
- menu
- "Surprise me once again", L_RandomColor,
- "Go back", L_MainClear,
- "Goodbye", L_Done;
-
-L_Done:
- // cleanup
- set @menu, 0;
- set @style, 0;
- set @color, 0;
- cleararray @HairStyles$, "", getarraysize(@HairStyles$);
- cleararray @HairColors$, "", getarraysize(@HairColors$);
- set @hairOpts, 0;
- set @colorOpts, 0;
- return;
-
-L_Debug:
- npcaction 9; // FIXME: this should become a builtin (ie `clear`)
- mes "Class: " + Class;
- mes "Style: " + getlook(LOOK_HAIR_STYLE);
- mes "Color: " + getlook(LOOK_HAIR_COLOR);
- mes "Gender: " + Sex;
- menu
- "edit| Set Class", L_DebugClass,
- "edit| Set Style", L_DebugStyle,
- "edit| Set Color", L_DebugColor,
- "edit| Set Gender", L_DebugGender,
- "toggle| Simulate logout", L_DebugLogout,
- "Close", L_Done;
-
-L_DebugLogout:
- callfunc "fixHeadStyles";
- goto L_Debug;
-
-L_DebugClass:
- set @dbg_class, 0;
- mes "input class (0-32767)";
- input @dbg_class;
- if (@dbg_class >= 0 && @dbg_class <= 32767)
- set Class, @dbg_class;
- set @dbg_class, 0;
- goto L_Debug;
-
-L_DebugStyle:
- set @dbg_style, 0;
- mes "input style (0-255)";
- input @dbg_style;
- if (@dbg_style >= 0 && @dbg_style <= 255)
- setlook LOOK_HAIR_STYLE, @dbg_style;
- set @dbg_style, 0;
- goto L_Debug;
-
-L_DebugColor:
- set @dbg_color, 0;
- mes "input color (0-255)";
- input @dbg_color;
- if (@dbg_color >= 0 && @dbg_color <= 255)
- setlook LOOK_HAIR_COLOR, @dbg_color;
- set @dbg_color, 0;
- goto L_Debug;
-
-L_DebugGender:
- set @dbg_gender, 0;
- mes "input gender (0-3)";
- input @dbg_gender;
- if (@dbg_gender >= 0 && @dbg_gender <= 3)
- set Sex, @dbg_gender;
- set @dbg_gender, 0;
- goto L_Debug;
-}
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
deleted file mode 100644
index 2abfb118..00000000
--- a/world/map/npc/functions/clear_vars.txt
+++ /dev/null
@@ -1,490 +0,0 @@
-// Clears old variables
-
-function|script|ClearVariables
-{
- if(@login_event != 1) goto L_Deprecated;
-
- callsub S_Bernard_Mikhail;
- callsub S_Sarah;
- callsub S_Vincent;
- callsub S_Sandra;
- callsub S_Desert;
- callsub S_Bandit;
- callsub S_Tutorial;
- callsub S_Heathin;
- callsub S_Remove_Skills;
- callsub S_FixBank;
- callsub S_Angus;
- callsub S_Flags;
- callsub S_Bitmask;
- callsub S_BlueSage;
- callsub S_Luca;
-
- callsub S_Easter;
- callsub S_Easter2008;
- callsub S_Easter2009;
- callsub S_Easter2010;
- callsub S_Easter2011;
- callsub S_Easter2012;
- callsub S_Halloween2006;
- callsub S_Halloween2007;
- callsub S_Halloween2008;
- callsub S_Halloween2009;
- callsub S_Halloween2010;
- callsub S_Halloween2011;
- callsub S_Halloween2016;
- callsub S_Xmas2006;
- callsub S_Xmas2007;
- callsub S_Xmas2008;
- callsub S_Xmas2009;
- callsub S_Xmas2010;
- callsub S_Xmas2011;
- callsub S_Xmas2012;
- callsub S_Valentine2021;
-
- callsub S_Misc;
- return; // go back to global handler
-
-S_Return: // this is to end execution of a sub
- return;
-
-////////////////////////////////////////////////////////////////
-
-S_Xmas2007:
- if(!QUEST_xmas07_state) goto S_Return;
- set QUEST_xmas07_state, 0;
- set QUEST_xmas07_milk, 0;
- set QUEST_xmas07_cookies, 0;
- set QUEST_xmas07_presents, 0;
- return;
-
-S_Halloween2007:
- set QUEST_Halloween07_state, 0;
- return;
-
-S_Xmas2006:
- if(!XMASQUEST1) goto S_Return;
- set XMASQUEST1, 0;
- set XMASQUEST2, 0;
- set XMASQUEST3, 0;
- set XMASQUEST4, 0;
- set XMASQUEST5, 0;
- set XMASQUEST6, 0;
- set XMASQUEST7, 0;
- set XMASQUEST8, 0;
- set XMASQUEST9, 0;
- set XMASQUEST10, 0;
- set XMASQUEST11, 0;
- set XMASQUEST12, 0;
- set XMASQUEST13, 0;
- set XMASQUEST14, 0;
- set XMASQUEST15, 0;
- set XMASQUEST16, 0;
- set XMASQUEST17, 0;
- set XMASQUEST18, 0;
- set XMASQUEST19, 0;
- set XMASQUEST20, 0;
- return;
-
-S_Halloween2006:
- if(!HWQUEST1) goto S_Return;
- set HWQUEST1, 0;
- set HWQUEST2, 0;
- set HWQUEST3, 0;
- set HWQUEST4, 0;
- set HWQUEST5, 0;
- set HWQUEST6, 0;
- set HWQUEST7, 0;
- set HWQUEST8, 0;
- set HWQUEST9, 0;
- set HWQUEST10, 0;
- set HWQUEST11, 0;
- set HWQUEST12, 0;
- set HWQUEST13, 0;
- set HWQUEST14, 0;
- set HWQUEST15, 0;
- set HWQUEST16, 0;
- set HWQUEST17, 0;
- set HWQUEST18, 0;
- set HWQUEST18, 0;
- set HWQUEST19, 0;
- set HWQUEST20, 0;
- return;
-
-S_Easter:
- set EasterQuest, 0;
- return;
-
-S_Easter2008:
- set QUEST_Easter08_state, 0;
- return;
-
-S_Halloween2008:
- set Halloween08, 0;
- return;
-
-S_Xmas2008:
- set QUEST_xmas08_state, 0;
- return;
-
-S_Easter2009:
- set QUEST_Easter09, 0;
- set QUEST_Easter09_slots, 0;
- return;
-
-S_Halloween2009:
- set Candyman, 0;
- return;
-
-S_Xmas2009:
- set QUEST_Christmas09_state, 0;
- return;
-
-S_Easter2010:
- if(!Easter_2010_QuestState) goto S_Return;
- set Easter_2010_QuestState, 0;
- set Easter_2010_EggState1, 0;
- set Easter_2010_EggState2, 0;
- set Easter_2010_EggState3, 0;
- set Easter_2010_EggState4, 0;
- set Easter_2010_EggState5, 0;
- return;
-
-S_Halloween2010:
- if(!hween10) goto S_Return;
- set hween10, 0;
- set hween10_collect_canpump, 0;
- set hween10_credits, 0;
- set hween10_collect, 0;
- set hween10_collect_mmallow, 0;
- set hween10_collect_jelskul, 0;
- set hween10_bonecount, 0;
- set hween10_collect_tondel, 0;
- set hween10_paid, 0;
- return;
-
-S_Halloween2016:
- set HWEEN16, 0;
- if(!hween16) goto S_Return;
- set hween16, 0;
- set hween16_collect_canpump, 0;
- set hween16_credits, 0;
- set hween16_collect, 0;
- set hween16_collect_mmallow, 0;
- set hween16_collect_jelskul, 0;
- set hween16_bonecount, 0;
- set hween16_collect_tondel, 0;
- set hween16_paid, 0;
- return;
-
-S_Xmas2010:
- if(!Xmas2010) goto S_Return;
- set Count_Yellow, 0;
- set Count_White, 0;
- set Maze, 0;
- set Yellow, 0;
- set White, 0;
- set Xmas2010, 0;
- set Golbenez_Inn_Cost, 0;
- return;
-
-S_Easter2011:
- set QUEST_Easter11, 0;
- return;
-
-S_Halloween2011:
- set hw2011, 0;
- return;
-
-S_Xmas2011:
- set xmas11, 0;
- return;
-
-S_Easter2012:
- set QUEST_Easter12, 0;
- return;
-
-S_Xmas2012:
- set xmas2012, 0;
- return;
-
-S_Angus:
- set QUEST_clothdyer_angus, 0;
- set QUEST_clothdyer_state, 0;
- return;
-
-S_Bitmask:
- // move Scythe quest into bitmasked variable QUEST_Hurnscald
- if (QUEST_Scythe_state)
- set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_1_MASK)) | (QUEST_Scythe_state << NIBBLE_1_SHIFT);
- set QUEST_Scythe_state, 0;
-
- // move Demon Mask quest into bitmasked variable QUEST_Hurnscald
- if (QUEST_demon_mines)
- set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_2_MASK)) | (QUEST_demon_mines << NIBBLE_2_SHIFT);
- set QUEST_demon_mines, 0;
-
- // move Inspector quest into bitmasked variable QUEST_Hurnscald
- set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
- if (Inspector > @inspector)
- set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_3_MASK)) | (Inspector << NIBBLE_3_SHIFT);
- set Inspector, 0;
- set @inspector, 0;
- return;
-
-S_BlueSage:
- if (QUEST_BlueSage & (1 << 7))
- set QUEST_BlueSage, QUEST_BlueSage & ~((1<<5)|(1<<6)|(1<<7));
- return;
-
-S_Luca:
- if (FLAGS & FLAG_LUCA_FIX) goto S_Return;
- if (FLAGS & FLAG_LUCA_6SKILLS_MAXED) goto S_Luca6;
- if (FLAGS & FLAG_LUCA_4SKILLS_MAXED) goto S_Luca4;
- if (FLAGS & FLAG_LUCA_2SKILLS_MAXED) goto S_Luca2;
- goto S_LucaX;
-
-S_Luca6:
- if (countitem("AssassinMask") < 1) goto S_Return;
- delitem "AssassinMask", 1;
- set FLAGS, FLAGS ^ FLAG_LUCA_6SKILLS_MAXED;
- goto S_Luca4;
-
-S_Luca4:
- if (countitem("AssassinPants") < 1) goto S_Return;
- delitem "AssassinPants", 1;
- set FLAGS, FLAGS ^ FLAG_LUCA_4SKILLS_MAXED;
- goto S_Luca2;
-
-S_Luca2:
- if (countitem("AssassinBoots") < 1) goto S_Return;
- delitem "AssassinBoots", 1;
- set FLAGS, FLAGS ^ FLAG_LUCA_2SKILLS_MAXED;
- goto S_LucaX;
-
-S_LucaX:
- set FLAGS, FLAGS | FLAG_LUCA_FIX;
- return;
-
-S_Flags:
- if (Open_Underground_Palace_Barrier)
- set FLAGS, FLAGS | FLAG_OPENED_UNDERGROUND;
- set Open_Underground_Palace_Barrier, 0;
-
- if (Naem_Quest_Done)
- set FLAGS, FLAGS | FLAG_GOT_NAEM_GLOVES;
- set Naem_Quest_Done, 0;
-
- if (ChristmasQuest)
- set FLAGS, FLAGS | FLAG_SNOWMAN;
- set ChristmasQuest, 0;
-
- if (ChristmasQuest2)
- set FLAGS, FLAGS | FLAG_SANTAS_HELPER;
- set ChristmasQuest2, 0;
-
- if (ChestQuest)
- set FLAGS, FLAGS | FLAG_HURNSMINE_CHEST;
- set ChestQuest, 0;
- return;
-
-S_FixBank:
- if(#BankAccount >= 0) goto S_Return;
- if (Zeny >= -#BankAccount)
- goto S_Fix_Bank_Full;
- // Partial fix
- set #BankAccount, #BankAccount + Zeny;
- set Zeny, 0;
- return;
-
-S_Fix_Bank_Full:
- set Zeny, Zeny + #BankAccount;
- set #BankAccount, 0;
- return;
-
-S_Remove_Skills:
- if(getskilllv(SKILL_TRADE) < 1) goto S_Return;
- setskill SKILL_TRADE, 0;
- setskill SKILL_PARTY, 0;
- setskill SKILL_EMOTE, 0;
- return;
-
-S_Misc:
- set Death_Kill, 0;
- set Scorp, 0; // Tulimshar and Mine Variables which aren't used anymore
- set Bugleg, 0; // Tulimshar and Mine Variables which aren't used anymore
- set KatzeBeenOutside, 0; // variable was moved to a temporary player variable
- set LastHiss, 0; // variable was moved to Nibble 1 of the variable Katze
- set CaveSnakeLamp, 0; // quest was turned into a Daily Quest, so the variable isn't needed anymore
- set MAGIC_CAST_TICK, 0; // legacy stuff
- return;
-
-S_Tutorial:
- if(!TUTORIAL && !sorfina) goto S_Return;
- //TUTORIAL to STARTAREA
- if ((sorfina) || (kaan) || (hasan) || (tanisha))
- goto S_ResetAllTut;
- set @tutorial_tmp, ((TUTORIAL & NIBBLE_0_MASK) >> NIBBLE_0_SHIFT);
- // Tutorial
- // Nibble 0 (sorfina, tanisha, kaan & hasan)
- set STARTAREA, (STARTAREA & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
- // Nibble 1 (valon)
- set @tutorial_tmp, ((TUTORIAL & NIBBLE_2_MASK) >> NIBBLE_2_SHIFT);
- set @valon_done, (TUTORIAL & (1 << 7));
- set @valon_start, (TUTORIAL & (1 << 6));
- if (@valon_start)
- set @tutorial_tmp, (@tutorial_tmp + 2);
- if (@valon_done)
- set @tutorial_tmp, 7;
- set STARTAREA, (STARTAREA & ~(NIBBLE_1_MASK) | (@tutorial_tmp << NIBBLE_1_SHIFT));
- // Nibble 2 (Counts)
- set @tutorial_tmp, ((TUTORIAL & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
- set STARTAREA, (STARTAREA & ~(NIBBLE_2_MASK) | (@tutorial_tmp << NIBBLE_2_SHIFT));
- // Nibble 3 (Morgan)
- set @tutorial_tmp, ((TUTORIAL & NIBBLE_6_MASK) >> NIBBLE_6_SHIFT);
- set STARTAREA, (STARTAREA & ~(NIBBLE_3_MASK) | (@tutorial_tmp << NIBBLE_3_SHIFT));
- // Nibble 4 (Zegas) Barrels shuffled
- set @zegas_done, (TUTORIAL & (1 << 23));
- set @zegas_start, (TUTORIAL & (1 << 16));
- set @zegas_met, (TUTORIAL & (1 << 30));
- set @tutorial_tmp, 0;
- if (@zegas_met)
- set @tutorial_tmp, 1;
- if (@zegas_start)
- set @tutorial_tmp, 2;
- if (@zegas_done)
- set @tutorial_tmp, 4;
- set STARTAREA, (STARTAREA & ~(NIBBLE_4_MASK) | (@tutorial_tmp << NIBBLE_4_SHIFT));
- // Nibble 5 (Barrels)
- set @tutorial_tmp, 0;
- set STARTAREA, (STARTAREA & ~(NIBBLE_5_MASK) | (@tutorial_tmp << NIBBLE_5_SHIFT));
- // Nibble 6 (Barrels)
- set STARTAREA, (STARTAREA & ~(NIBBLE_6_MASK) | (@tutorial_tmp << NIBBLE_6_SHIFT));
- set TUTORIAL, 0;
- return;
-
-S_ResetAllTut:
- set sorfina, 0;
- set tanisha, 0;
- set hasan, 0;
- set kaan, 0;
- set TUTORIAL, 0;
- set STARTAREA, 0;
- set FLAGS, FLAGS &~ FLAG_TUTORIAL_DONE;
- return;
-
-S_Heathin:
- if(!HEATHIN_QUEST) goto S_Return;
- set QUEST_NorthTulimshar, (QUEST_NorthTulimshar & ~(NIBBLE_6_MASK)) | (HEATHIN_QUEST << NIBBLE_6_SHIFT);
- set HEATHIN_QUEST, 0;
- return;
-
-S_Desert: // move guard and miner subquest into Byte 2 (Nibble 4 and 5) of QUEST_SouthTulimshar
- if(!TMW_QUEST || TMW_QUEST > 40) goto S_Return;
- set @miners, TMW_Quest - 12;
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@miners << BYTE_2_SHIFT));
- set TMW_Quest, 12;
- set @miners, 0;
- return;
-
-S_Sandra: // move Sandra subquest into Nibble 3 of QUEST_SouthTulimshar
- if(!TMW_QUEST || TMW_QUEST > 12) goto S_Return;
- set @sandra, TMW_Quest - 10;
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_3_MASK) | (@sandra << NIBBLE_3_SHIFT));
- set TMW_Quest, 10;
- set @sandra, 0;
- return;
-
-S_Vincent: // move Vincent subquest into Nibble 2 of QUEST_SouthTulimshar
- if(!TMW_QUEST || TMW_QUEST > 10) goto S_Return;
- set @vincent, TMW_Quest - 8;
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (@vincent << NIBBLE_2_SHIFT));
- set TMW_Quest, 8;
- set @vincent, 0;
- return;
-
-S_Sarah: // move Sarah subquest into Nibble 1 of QUEST_SouthTulimshar
- if(!TMW_QUEST || TMW_QUEST > 8) goto S_Return;
- set @sarah, TMW_Quest - 6;
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_1_MASK) | (@sarah << NIBBLE_1_SHIFT));
- set TMW_Quest, 6;
- set @sarah, 0;
- return;
-
-S_Bernard_Mikhail: // move Bernard and Mikhail subquest into Nibble 0 of QUEST_SouthTulimshar
- if(!TMW_QUEST || TMW_QUEST > 6) goto S_Return;
- set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (TMW_Quest << NIBBLE_0_SHIFT));
- set TMW_Quest, 0;
- return;
-
-S_Bandit: // move Bandit subquest into Nibble 0 of QUEST_Hurnscald
- if(!TMW_QUEST) goto S_Return;
- set @bandit, TMW_Quest - 40;
- set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@bandit << NIBBLE_0_SHIFT));
- set TMW_Quest, 40;
- set @bandit, 0;
- return;
-
-S_Valentine2021:
- set #VALENTINE2021, 0;
- return;
-
-L_Deprecated:
- debugmes "Explicitely calling ClearVariables after login is deprecated.";
- mapexit;
-}
-
-
-function|script|ClearGlobalVars
-{
- goto L_IlliaClear;
-// Clear the array which saves the teams who beat the Illia quest
-L_IlliaClear:
- set $@loop, 0;
- goto L_IlliaLoop;
-
-L_IlliaLoop:
- if ($Illia_Win_Records$[$@loop] == "")
- goto L_EventClear;
-
- set $Illia_Win_Records$[$@loop], "";
-
- set $@loop, $@loop + 1;
- goto L_IlliaLoop;
-
-L_EventClear:
- set $@loop, 0;
-
-// Clear global variable used in the Halloween event 2009
- set $CandyOpsComplete, 0;
-
-// Clear global variables used in the Easter event 2010
- set $Easter_2010_Npc_State1, 0;
- set $Easter_2010_Npc_State2, 0;
- set $Easter_2010_Egg_Loc_State1, 0;
- set $Easter_2010_Egg_Loc_State2, 0;
- set $Easter_2010_Egg_Loc_State3, 0;
- set $Easter_2010_Egg_Loc_State4, 0;
- set $Easter_2010_Egg_Loc_State5, 0;
-
-// Clear global variables used in the Halloween event 2010
- set $hween10, 0;
- set $hween10_tondel, 0;
- set $hween10_mmallow, 0;
- set $hween10_jelskul, 0;
- set $hween10_canpump, 0;
-
-// Clear global variable used in Christmas event 2010
- set $Golbenez_Inn_Cost, 0;
-
-// Clear global variables used in the Halloween event 2016
- set $hween16, 0;
- set $hween16_tondel, 0;
- set $hween16_mmallow, 0;
- set $hween16_jelskul, 0;
- set $hween16_canpump, 0;
-
-// Variable was used in Voltain's script, was renamed and turned into a temporary variable
- set $state, 0;
- return;
-}
diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt
deleted file mode 100644
index 4bbe7800..00000000
--- a/world/map/npc/functions/dailyquest.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-// The daily quests
-
-// Variables returned:
-// @dq_return - Code of what happend
-// 0 = Low level
-// 1 = Ignored NPC
-// 2 = Not enough points
-// 3 = Not enough items
-// 4 = Success
-
-// Variables to set:
-// @dq_level - Minimal level needed to use the quest
-// @dq_cost - The number of points this quest uses
-// @dq_count - The number of given item needed
-// @dq_name$ - String name of the item as seen by server
-// @dq_friendly_name$ - String name of the item as seen by user
-// @dq_money - The money reward for doing the quest
-// @dq_exp - Experince gained by doing the quest
-
-// Optional:
-// @dq_handle_return - When set to anything other then 0 the function will not print exiting text
-
-// Variables used inside:
-// DailyQuestPoints - The number of points the player currently has
-// DailyQuestTime - Time since DailyQuestPoints was lasted renewed
-// DailyQuestBonus - Additional points added in addition to player BaseLevel
-
-// (DailyQuestBonus makes a good reward from non-daily quests)
-
-function|script|DailyQuestPoints
-{
- set @dq_earliest, gettimetick(2) - 86400;
- if (DailyQuestTime < @dq_earliest)
- set DailyQuestTime, @dq_earliest;
-
- // how many whole daily quest points the player has earned
- // we increment DailyQuestTime by the number of seconds in that many increments
- set @dq_increments, (gettimetick(2) - DailyQuestTime)*BaseLevel / 86400;
- set DailyQuestTime, DailyQuestTime + @dq_increments*86400/BaseLevel;
-
- // player can't regenerate any quest points, but might have a bonus
- if (DailyQuestPoints >= BaseLevel)
- goto L_Bonus;
-
- // normal recharging case - increment, but don't let it recharge more than a day's worth
- set DailyQuestPoints, DailyQuestPoints + @dq_increments;
- if (DailyQuestPoints > BaseLevel)
- set DailyQuestPoints, BaseLevel;
- // fallthrough to bonus, which *is* allowed to push DailyQuestPoints above BaseLevel
- goto L_Bonus;
-
-L_Bonus:
- set DailyQuestPoints, DailyQuestPoints + DailyQuestBonus;
- set DailyQuestBonus, 0;
-
- return;
-}
-
-function|script|DailyQuest
-{
- callfunc "DailyQuestPoints";
-
- if (BaseLevel < @dq_level)
- goto L_Low_Level;
- if (DailyQuestPoints < @dq_cost)
- goto L_Not_Enough_Points;
-
- mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\"";
- menu
- "I have what you want.", L_Trade,
- "Take all you need.", L_All,
- "Ok, I'll get to work.", L_Next,
- "Nah, I'm not going to help you.", L_Next;
-
-L_Next:
- set @dq_return, 1;
- goto L_Exit;
-
-L_Trade:
- if (countitem(@dq_name$) < @dq_count)
- goto L_Not_Enough;
- delitem @dq_name$, @dq_count;
-
- set Zeny, Zeny + @dq_money;
- getexp @dq_exp, 0;
-
- set DailyQuestPoints, DailyQuestPoints - @dq_cost;
-
- if (@dq_handle_return)
- goto L_Exit_Good;
-
- mes "\"Thank you!\"";
- callsub S_SayPhrase;
- mes "";
- mes "[" + @dq_money + " money]";
- mes "[" + @dq_exp + " experience points]";
- goto L_Exit_Good;
-
-L_All:
- if (countitem(@dq_name$) < @dq_count)
- goto L_Not_Enough;
-
- set @item_multiple, (countitem(@dq_name$) / @dq_count);
- set @dp_multiple, (DailyQuestPoints / @dq_cost);
-
- if (@dp_multiple > @item_multiple)
- set @multipler, @item_multiple;
- if (@item_multiple >= @dp_multiple)
- set @multipler, @dp_multiple;
-
- set DailyQuestPoints, DailyQuestPoints - (@dq_cost * @multipler);
-
- delitem @dq_name$, (@dq_count * @multipler);
-
- set Zeny, Zeny + (@dq_money * @multipler);
- getexp (@dq_exp * @multipler), 0;
-
- if (@dq_handle_return)
- goto L_Exit_Good;
-
- mes "\"Thank you!\"";
- callsub S_SayPhrase;
- mes "";
- mes "[" + (@dq_money * @multipler) + " money]";
- mes "[" + (@dq_exp * @multipler) + " experience points]";
- goto L_Exit_Good;
-
-L_Exit_Good:
- set @dq_return, 4;
- goto L_Exit;
-
-L_Not_Enough:
- if (!@dq_handle_return)
- mes "\"I said " + @dq_count + " " + @dq_friendly_name$ + "; you should learn to count.\"";
- set @dq_return, 3;
- goto L_Exit;
-
-L_Low_Level:
- if (!@dq_handle_return)
- mes "\"Hey, you should go kill some things to get stronger first.\"";
- set @dq_return, 0;
- goto L_Exit;
-
-L_Not_Enough_Points:
- mes "\"You look exhausted, maybe you should rest a bit.\"";
- set @dq_return, 2;
- goto L_Exit;
-
-L_Exit:
- set @dq_handle_return, 0; // Incase they forget
- return;
-
-S_SayPhrase:
- if (@dq_handle_return)
- goto L_Return;
- if (DailyQuestPoints < @dq_cost)
- goto L_Exhausted;
- if (DailyQuestPoints > BaseLevel)
- goto L_Over;
- if (DailyQuestPoints > (BaseLevel*9)/10)
- goto L_P90;
- if (DailyQuestPoints > (BaseLevel*7)/10)
- goto L_P70;
- if (DailyQuestPoints > (BaseLevel*5)/10)
- goto L_P50;
- goto L_Low;
-
-L_Over:
- mes "\"Woah, you're bursting with power.\"";
- return;
-L_P90:
- mes "\"You're in a very good shape.\"";
- return;
-L_P70:
- mes "\"You don't seem very exhausted by my tasks.\"";
- return;
-L_P50:
- mes "\"Aren't you getting weary yet?\"";
- return;
-L_Low:
- mes "\"You look a little tired.\"";
- return;
-L_Exhausted:
- mes "\"You look exhausted, maybe you should rest a bit.\"";
- return;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/default_npc_checks.txt b/world/map/npc/functions/default_npc_checks.txt
deleted file mode 100644
index cc5c4086..00000000
--- a/world/map/npc/functions/default_npc_checks.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-// Default NPC Checks
-// Author: Wushin, mekolat
-
-// Range
-// Distance in Tiles
-// set @npc_distance, 4;
-function|script|PCtoNPCRange
-{
- set @npc_check, 0;
- set @Nmap$, strnpcinfo(3);
- if(!@npc_distance) set @npc_distance, 4; // <== default distance
- if(@npc_distance == (1-2)) set @npc_distance, ATTACKRANGE;
- cleararray @npc_loc, 0, 3;
- setarray @npc_loc, getnpcx(), getnpcy(), @npc_distance;
- set @Nx1, (@npc_loc[0] - @npc_loc[2]);
- set @Ny1, (@npc_loc[1] - @npc_loc[2]);
- set @Nx2, (@npc_loc[0] + @npc_loc[2]);
- set @Ny2, (@npc_loc[1] + @npc_loc[2]);
- if (isin(@Nmap$, @Nx1, @Ny1, @Nx2, @Ny2))
- goto L_Return;
- set @npc_check, 1;
- if(@distance_handler) goto L_Return;
- set @dnpc_name$, strnpcinfo(1);
- if(@dnpc_name$ != "") goto L_Named;
- message strcharinfo(0), "Server : ##BYou need to move closer to interact with this npc.";
- goto L_Return;
-
-L_Named:
- message strcharinfo(0), ""+@dnpc_name$+" : ##BPlease move closer.";
- goto L_Return;
-
-L_Return:
- set @dnpc_name$, "";
- set @distance_handler, 0;
- set @npc_distance, 0;
- cleararray @npc_loc, 0, 3;
- return;
-}
-
-// Inventory & Weight
-// @delitem_ids Items to delete
-// @delitem_counts Counts of Items to delete
-// @getitem_ids Items to get
-// @getitem_counts Counts of Items to get
-function|script|CheckInventory
-{
- set @del_loop, 0;
- set @get_loop, 0;
- set @delitem_loop, 0;
- set @getitem_loop, 0;
- set @check_fail, 0;
- set @msg_loop, 0;
-
- if (getarraysize(@delitem_ids))
- goto L_DelItemsLoop;
- goto L_CheckGet;
-
-L_DelItemsLoop:
- if(countitem(@delitem_ids[@delitem_loop]) >= @delitem_counts[@delitem_loop])
- goto L_DelLoopAgain;
- goto L_ReturnMissing;
-
-L_DelLoopAgain:
- set @delitem_loop, (@delitem_loop + 1);
- if(@delitem_loop == getarraysize(@delitem_ids))
- goto L_CheckGet;
- goto L_DelItemsLoop;
-
-L_CheckGet:
- if (getarraysize(@getitem_ids))
- goto L_CheckWeight;
- goto L_DelCheck;
-
-L_CheckWeight:
- getinventorylist;
- if (100 < (@inventorylist_count + getarraysize(@getitem_ids)))
- goto L_ReturnSpace;
- goto L_GetItemsLoop;
-
-L_GetItemsLoop:
- if (checkweight(@getitem_ids[@getitem_loop], @getitem_counts[@getitem_loop]))
- goto L_GetLoopAgain;
- goto L_ReturnWeight;
-
-L_GetLoopAgain:
- set @getitem_loop, (@getitem_loop + 1);
- if(@getitem_loop == getarraysize(@getitem_ids))
- goto L_DelCheck;
- goto L_GetItemsLoop;
-
-L_DelCheck:
- if (getarraysize(@delitem_ids))
- goto L_DelLoop;
- goto L_CheckGet2;
-
-L_DelLoop:
- delitem @delitem_ids[@del_loop], @delitem_counts[@del_loop];
- goto L_DelAgain;
-
-L_DelAgain:
- set @del_loop, (@del_loop + 1);
- if(@del_loop == getarraysize(@delitem_ids))
- goto L_GetLoop;
- goto L_DelLoop;
-
-L_CheckGet2:
- if (getarraysize(@getitem_ids))
- goto L_GetLoop;
- goto L_Return;
-
-L_GetLoop:
- misceffect FX_GETITEM, strcharinfo(0);
- getitem @getitem_ids[@get_loop], @getitem_counts[@get_loop];
- goto L_GetAgain;
-
-L_GetAgain:
- set @get_loop, (@get_loop + 1);
- if(@get_loop == getarraysize(@getitem_ids))
- goto L_Return;
- goto L_GetLoop;
-
-L_ReturnMissing:
- set @check_fail, 1;
- mes "\"You are missing required items.\"";
- goto L_MissingMsg;
-
-L_MissingMsg:
- mes "[@@"+@delitem_ids[@msg_loop]+"|"+getitemlink(@delitem_ids[@msg_loop])+"@@] "+countitem(getitemlink(@delitem_ids[@msg_loop]))+"/"+@delitem_counts[@msg_loop];
- goto L_NextMsgCheck;
-
-L_NextMsgCheck:
- set @msg_loop, (@msg_loop + 1);
- if(@msg_loop == getarraysize(@delitem_ids))
- goto L_Return;
- goto L_MissingMsg;
-
-L_ReturnWeight:
- mes "\"You need to be carrying less weight.\"";
- next;
- set @check_fail, 1;
- goto L_Return;
-
-L_ReturnSpace:
- mes "\"You need more room in your inventory.\"";
- next;
- set @check_fail, 1;
- goto L_Return;
-
-L_Return:
- cleararray @delitem_ids, "", getarraysize(@delitem_ids);
- cleararray @delitem_counts, "", getarraysize(@delitem_counts);
- cleararray @getitem_ids, "", getarraysize(@getitem_ids);
- cleararray @getitem_counts, "", getarraysize(@getitem_counts);
- return;
-}
diff --git a/world/map/npc/functions/doomsday.txt b/world/map/npc/functions/doomsday.txt
deleted file mode 100644
index 1d3df2cd..00000000
--- a/world/map/npc/functions/doomsday.txt
+++ /dev/null
@@ -1,1435 +0,0 @@
-// Evol script
-// Controls Doomsday Event
-//
-// A really long event (months), controlling and being written by
-// every event which happens since doomsday program officialy started
-// in Halloween 2019 with Tormenta's release.
-//
-// This file history is written by GMs and players as the events happen
-// and therefore it is not possible to predict or add code for things which
-// are too far away from happening.
-//
-// Please keep Doomsday System simple.
-// Revert it to anything to stage once it is over.
-// It can be epic. But it doesn't needs to be.
-// But above all, this should NOT affect the merge.
-// The event purpose is to give players background history.
-
-function|script|DoomsdayDebug
-{
- mes "$DOOMSDAY: "+$DOOMSDAY; // Event Status
- mes "";
- mes "Act 2:";
- mes "Amount of slain Mana Guardians:";
- mes "$DOOMSDAY_CNT: "+$DOOMSDAY_CNT;
- mes "";
- mes "Act 3:";
- mes "Situation of the towns (0 - standing, n - fallen n times)";
- mes "$DOOMSDAY_TOWN[0] (Tulim): "+$DOOMSDAY_TOWN[0];
- mes "$DOOMSDAY_TOWN[1] (Hurns): "+$DOOMSDAY_TOWN[1];
- mes "$DOOMSDAY_TOWN[2] (Nival): "+$DOOMSDAY_TOWN[2];
- mes "$DOOMSDAY_SCORE: "+$DOOMSDAY_SCORE;
- mes "$DOOMSDAY_CLUES: "+$DOOMSDAY_CLUES;
- mes "";
- mes "Act 4:";
- mes "Can players summon Mana Guardians? "+if_then_else($DOOMSDAY_SUMMON, "Yes", "No");
- mes "Is TMW under Jande's control? "+if_then_else($DOOMSDAY_TAKENOVER, "Yes", "No");
- mes "Zealite Upgrade? "+if_then_else($DOOMSDAY_SUMMON > 1, "Yes", "No");
- mes "";
- mes "Act 5:";
- mes "Warp to fake Keshlam? "+if_then_else($DOOMSDAY_TWARP, "No", "Yes");
- mes "Jande was rescued? "+if_then_else($@HW2020_HOCUS > 2, "Yes", "No");
- mes "Jande has recovered? "+if_then_else($DOOMSDAY_TJANDE, "Yes", "No");
- mes "$DOOMSDAY_CNT2: "+$DOOMSDAY_CNT2;
- mes "Vanilla Mode? "+if_then_else($DOOMSDAY_VANILLA, "Yes", "No");
- //($DOOMSDAY_SUMMON ? "Yes" : "No");
- next;
- // Only GM 80 and above can modify Doomsday
- // ...Yes, G_ADMIN is 80 while G_SYSOP is 99.
- if (GM < G_ADMIN) goto L_Close;
- mes "Setting $DOOMSDAY event state";
- mes "[DOOMSDAY][ACT][STATE]";
- menu
- "[0][1][0] Tormenta's Seal",L_Seal,
- "[1][2][0] Jande's Army",L_Army,
- "[1][2][1] Toggle Mana Guardian Skill",L_Summon,
- "[1][2][2] Surrender TMW to Jande",L_Surrender,
- "[1][3][0] The Great War - First Wave",L_War,
- "[2][3][1] The Great War - Additional Wave",L_GreatWar,
- "[2][4][0] Wumpus Great Egg Hunt - DEBUG",L_Wumpus,
- "[2][4][1] Council - Tulimshar's Guild",L_TulimCouncil,
- "[2][4][2] Council - Celestia's Residence",L_HurnsCouncil,
- "[2][4][3] Council - Blue Sage's Residence",L_NivalCouncil,
- "[2][4][4] Toggle Zealite Upgrade",L_Zealite,
- "[3][5][0] Keshlam Warps",L_Keshlam,
- "[3][5][1] Rescuing Jande",L_Jande,
- "[3][5][2] Kage's Final Battle",L_Kage,
- "[3][5][3] Vanilla Mode",L_Vanilla,
- "[-] Close",L_Close;
-
-L_Close:
- return;
-
-// Act 1: Tormenta's Seal
-L_Seal:
- set $DOOMSDAY, 0;
- donpcevent "Doomsday::OnJanitor";
- gmlog strcharinfo(0) + " changed doomsday to Act 1: Tormenta's Seal.";
- return;
-
-// Act 2: Jande's Army
-L_Army:
- set $DOOMSDAY, 1;
- donpcevent "Doomsday::OnJanitor";
- gmlog strcharinfo(0) + " changed doomsday to Act 2: Jande's Army.";
- return;
-
-L_Summon:
- set $DOOMSDAY_SUMMON, (!$DOOMSDAY_SUMMON);
- gmlog strcharinfo(0) + " changed the availability of #jande spell.";
- return;
-
-L_Surrender:
- set $DOOMSDAY_TAKENOVER, 1;
- donpcevent "Doomsday::OnDoomsday2Restart";
- gmlog strcharinfo(0) + " surrendered The Mana World to Jande.";
- return;
-
-
-// Act 3: The Great War
-L_War:
- set $@DOOMSDAY_SKIP, 1; // Skip the next scheduled siege
- donpcevent "Doomsday::OnDoomsday3First"; // Forces a doomsday to begin now
- gmlog strcharinfo(0) + " changed doomsday to Act 3: The Great War.";
- return;
-
-L_Wumpus:
- set $@DOOMSDAY_SKIP, 0;
- donpcevent "Doomsday::OnClock1830"; // Forces a doomsday act 4 check
- gmlog strcharinfo(0) + " manually triggered debug function. Doomsday Act 4.";
- return;
-
-// Act 4: The Great War Council
-L_GreatWar:
- disablenpc "Wizard#1";
- disablenpc "Wizard#2";
- disablenpc "Wizard#3";
- disablenpc "Wizard#4";
- disablenpc "Wizard#5";
- disablenpc "Wizard#6";
- disablenpc "Wizard#7";
- disablenpc "Wizard#8";
- disablenpc "Arch-Wizard#9";
- set $DOOMSDAY, 2;
- set $@DOOMSDAY_SKIP, 0;
- donpcevent "Doomsday::OnJanitor";
- gmlog strcharinfo(0) + " changed doomsday to Act 4: The Great War Council.";
- return;
-
-L_CouncilRefusal:
- mes "##1Cowardly refusing to meet in a town destroyed five times.";
- next;
- return;
-
-L_TulimCouncil:
- if ($DOOMSDAY_TOWN[0] >= 5)
- goto L_CouncilRefusal;
-
- enablenpc "Arch-Wizard#_DT";
- gmlog strcharinfo(0) + " called the Council to Tulimshar.";
- return;
-
-L_HurnsCouncil:
- if ($DOOMSDAY_TOWN[1] >= 5)
- goto L_CouncilRefusal;
-
- enablenpc "Arch-Wizard#_DH";
- gmlog strcharinfo(0) + " called the Council to Hurnscald.";
- return;
-
-L_NivalCouncil:
- if ($DOOMSDAY_TOWN[2] >= 5)
- goto L_CouncilRefusal;
-
- enablenpc "Arch-Wizard#_DN";
- gmlog strcharinfo(0) + " called the Council to Nivalis.";
- return;
-
-L_Zealite:
- set $DOOMSDAY_SUMMON, 2;
- disablenpc "Soul Menhir#deadmire";
- disablenpc "Soul Menhir#hurnscald";
- disablenpc "Soul Menhir#nivalis";
- disablenpc "Soul Menhir#tulimshar";
- enablenpc "Chest#Zealite";
- //disablenpc "Soul Menhir#candor";
- gmlog strcharinfo(0) + " changed the availability of #manatez and Savior Armor.";
- return;
-
-// Act 5: The Doomsday
-L_Keshlam:
- mes "//-- TODO --//";
- enablenpc "Wizard#1";
- enablenpc "Wizard#2";
- enablenpc "Wizard#3";
- enablenpc "Wizard#4";
- enablenpc "Wizard#5";
- enablenpc "Wizard#6";
- enablenpc "Wizard#7";
- enablenpc "Wizard#8";
- enablenpc "Arch-Wizard#9";
- enablenpc "Chest#DarkRose";
- set $DOOMSDAY, 3;
- set $DOOMSDAY_TWARP, 0;
- set $DOOMSDAY_VANILLA, 0;
- donpcevent "Doomsday::OnJanitor"; // TODO
- gmlog strcharinfo(0) + " changed doomsday to Act 5: The Doomsday.";
- gmlog strcharinfo(0) + " changed doomsday warp to Keshlam Maze";
- return;
-
-L_Jande:
- set $DOOMSDAY_TWARP, 1;
- donpcevent "Doomsday::OnJanitor"; // TODO
- gmlog strcharinfo(0) + " changed doomsday warp to Abandoned Building";
- return;
-
-L_Kage:
- set $DOOMSDAY_TJANDE, 1;
- donpcevent "Doomsday::OnJanitor"; // TODO
- gmlog strcharinfo(0) + " changed Jande from MIA to ACT. Final battle begun.";
- return;
-
-L_Vanilla:
- set $DOOMSDAY_VANILLA, 1;
- donpcevent "Doomsday::OnJanitor"; // TODO
- gmlog strcharinfo(0) + " disabled rewards from final showdown (VANILLA).";
- return;
-
-}
-
-// Doomsday script controller
--|script|Doomsday|32767
-{
- close;
-
-// Destroy any artifact as doomsday mode changes
-OnJanitor:
- // TODO: Act 2: Kill monsters?
- // Act 3: Clean eventually on-going Doomsday
- set $@DOOMSDAY_SKIP, 0;
- set $@DD_NUMWAVES, 0;
- set $@DoomsdayLoc, 0;
- set $@DoomsdayMc, 0;
- set $@DD_LOC$, "";
- // Act 4: Disable council puppets
- disablenpc "Sagatha#_DT";
- disablenpc "Elanore#_DT";
- disablenpc "Nikolai#_DT";
- disablenpc "Morgan#_DT";
- disablenpc "Valia#_DT";
- disablenpc "Waric#_DT";
- disablenpc "Golbenez#_DT";
- disablenpc "Sagatha#_DH";
- disablenpc "Elanore#_DH";
- disablenpc "Nikolai#_DH";
- disablenpc "Morgan#_DH";
- disablenpc "Valia#_DH";
- disablenpc "Waric#_DH";
- disablenpc "Golbenez#_DH";
- disablenpc "Sagatha#_DN";
- disablenpc "Elanore#_DN";
- disablenpc "Nikolai#_DN";
- disablenpc "Morgan#_DN";
- disablenpc "Valia#_DN";
- disablenpc "Waric#_DN";
- disablenpc "Golbenez#_DN";
- disablenpc "Arch-Wizard#_DT";
- disablenpc "Arch-Wizard#_DH";
- disablenpc "Arch-Wizard#_DN";
- // Act 5: Cleanup
- if ($DOOMSDAY == 3 && !$DOOMSDAY_TWARP)
- donpcevent "Keshlam Maze::OnInit"; // Spawn monsters if needed
- if ($DOOMSDAY != 3)
- disablenpc "To Underworld";
- if ($DOOMSDAY == 3)
- enablenpc "To Underworld";
- // Clear timers
- setnpctimer 0;
- stopnpctimer;
- goto OnInit;
-
-// Check for our current doomsday state
-OnInit:
- setarray $@doomsday_mobs, 1140, 1141, 1143, 1140, 1141, 1143, 1140, 1141, 1143;
- setarray $@doomsday_boss, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147;
- if ($DOOMSDAY == 1)
- goto L_Doomsday1;
- if ($DOOMSDAY == 2)
- goto L_Doomsday2;
- if ($DOOMSDAY == 3)
- goto L_Doomsday5;
- // goto L_Check2;
- end;
-
-////////////////////////////////////////////////////////////////////////////////
-L_Doomsday1:
- // 1138 - Mana Guardian
- // Argaes Invasion (1)
- areamonster "017-1", 169, 49, 198, 77, "", 1138, 1, "Doomsday::OnDeathMapname";
- // Argaes Invasion (2)
- areamonster "012-1", 20, 47, 74, 77, "", 1138, 3, "Doomsday::OnDeathMapname";
- // Argaes Invasion (3)
- areamonster "057-1", 115, 50, 140, 75, "", 1138, 4, "Doomsday::OnDeathMapname";
- // Kaizei Invasion (I)
- areamonster "046-1", 58, 49, 92, 70, "", 1138, 2, "Doomsday::OnDeathMapname";
- // Kaizei Invasion (II)
- areamonster "034-1", 83, 51, 121, 98, "", 1138, 6, "Doomsday::OnDeathMapname";
- // Tonori Invasion
- areamonster "003-4", 20, 20, 85, 60, "", 1138, 7, "Doomsday::OnDeathMapname";
- end;
-
-L_Doomsday1Respawn:
- // Argaes Invasion (1)
- set $@DoomsdayMc, mobcount("017-1", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 1)
- areamonster "017-1", 169, 49, 198, 77, "", 1138, 1-$@DoomsdayMc, "Doomsday::OnDeathMapname";
-
- // Argaes Invasion (2)
- set $@DoomsdayMc, mobcount("012-1", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 3)
- areamonster "012-1", 20, 47, 74, 77, "", 1138, 3-$@DoomsdayMc, "Doomsday::OnDeathMapname";
-
- // Argaes Invasion (3)
- set $@DoomsdayMc, mobcount("057-1", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 4)
- areamonster "057-1", 115, 50, 140, 75, "", 1138, 4-$@DoomsdayMc, "Doomsday::OnDeathMapname";
-
- // Kaizei Invasion (I)
- set $@DoomsdayMc, mobcount("046-1", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 2)
- areamonster "046-1", 58, 49, 92, 70, "", 1138, 2-$@DoomsdayMc, "Doomsday::OnDeathMapname";
-
- // Kaizei Invasion (II)
- set $@DoomsdayMc, mobcount("034-1", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 6)
- areamonster "034-1", 83, 51, 121, 98, "", 1138, 6-$@DoomsdayMc, "Doomsday::OnDeathMapname";
-
- // Tonori Invasion
- set $@DoomsdayMc, mobcount("003-4", "Doomsday::OnDeathMapname")+1;
- if ($@DoomsdayMc < 7)
- areamonster "003-4", 20, 20, 85, 60, "", 1138, 7-$@DoomsdayMc, "Doomsday::OnDeathMapname";
- // goto L_TimerCheck2;
- goto L_TimerFinish;
-
-////////////////////////////////////////////////////////////////////////////////
-// Disable Tulimshar Magic Council
-L_Doomsday2:
- addnpctimer 1000, "Doomsday::OnDoomsday2Restart";
- end;
-
-OnDoomsday2Restart:
- disablenpc "Wizard#1";
- disablenpc "Wizard#2";
- disablenpc "Wizard#3";
- disablenpc "Wizard#4";
- disablenpc "Wizard#5";
- disablenpc "Wizard#6";
- disablenpc "Wizard#7";
- disablenpc "Wizard#8";
- disablenpc "Arch-Wizard#9";
-
- // TODO: Maybe the town was taken over?
- if (!$DOOMSDAY_TAKENOVER)
- end;
-
- fakenpcname "Constable Bob", "Constable Bob#_D", 421;
- fakenpcname "Inspector#Hurnscald", "Inspector#Hurnscald_D", 420;
- //fakenpcname "Richard", "Guardian Richard#_D", 420;
- fakenpcname "Selim", "Guardian Selim#_D", 420;
- fakenpcname "General Store#hurnscald", "Guardian Store#hurns_D", 420;
- fakenpcname "General Store#dimond", "Guardian Store#dimond_D", 420;
- fakenpcname "Sabine", "Mana Tourist#_D", 420;
- fakenpcname "Apprentice", "Apprentice#_D", 420;
- fakenpcname "Entertainer", "Entertainer#_D", 420;
- fakenpcname "Drinker#2", "Drinker#2_D", 420;
- fakenpcname "Bartender#Duels", "Bartender#Duels_D", 420;
- fakenpcname "Jerry", "Mana Singer#_D", 420;
-
- fakenpcname "Constable Perry Graf", "Constable Perry#_D", 420; // Name too long
- fakenpcname "Guard#school", "Guard#school_D", 420;
- fakenpcname "Guard#castle", "Guard#castle_D", 420;
- fakenpcname "Guard#east3", "Guard#east3_D", 420;
- fakenpcname "Guard#govt_out", "Guard#govtout_D", 420;
- fakenpcname "Guard#govt_in", "Guard#govtin_D", 420;
- fakenpcname "Guard#port1", "Guard#port1_D", 420;
- fakenpcname "Guard#port2", "Guard#port2_D", 420;
- fakenpcname "Guard#east1", "Guard#east1_D", 420;
-
- fakenpcname "Mede", "Mana Shopkeeper#_D", 420;
- fakenpcname "Bracco", "Mana Shopkeeper#2_D", 420;
-
- if ($DOOMSDAY_SUMMON == 2)
- goto L_MenhirUpdate;
- end;
-
-L_MenhirUpdate:
- disablenpc "Soul Menhir#deadmire";
- disablenpc "Soul Menhir#hurnscald";
- disablenpc "Soul Menhir#nivalis";
- disablenpc "Soul Menhir#tulimshar";
- enablenpc "Chest#Zealite";
- end;
-
-/////// Act 3 sieges
-// Variables:
-// $@DoomsdayLoc / 100 = Town Code (0: Tulim, 1: Hurns, 2: Nivalis)
-
-// Fake label for the first Zax's movement
-OnDoomsday3First:
- set $@DoomsdayLoc, 1;
- goto L_Doomsday3;
-
-// Setup a siege
-L_Doomsday3Init:
- set $@DoomsdayLoc, rand(300) / 100;
-
- // Announce based on location
- if ($@DoomsdayLoc == 0)
- announce "Jande : Zax De'Kagen's army is marching to ##BTULIMSHAR##b in 10 minutes! (Attack by south gate)", 0;
- if ($@DoomsdayLoc == 1)
- announce "Jande : Zax De'Kagen's army is marching to ##BHURNSCALD##b in 10 minutes! (Attack by the mines)", 0;
- if ($@DoomsdayLoc == 2)
- announce "Jande : Zax De'Kagen's army is marching to ##BNIVALIS##b in 10 minutes! (Attack by east entrance)", 0;
- end;
-
-// This siege will be skipped
-L_Doomsday3Skip:
- set $@DOOMSDAY_SKIP, 0;
- end;
-
-// Operational label, handles sieges
-L_Doomsday3:
- // At this point it is no longer possible to skip the event.
- // Based on $@DoomsdayLoc go to a town-specific label
- // One wave every 5 minutes, until 6 waves were called (~30 min)
- // Then stop the timer, and check for survivor mobs 45 minutes after
- // If survivors are found, the town will be overrun
- set $@DD_NUMWAVES, 0;
-
- // Set the map for other labels (could use an array but meh)
- if ($@DoomsdayLoc == 0)
- set $@DD_LOC$, "002-1";
- if ($@DoomsdayLoc == 1)
- set $@DD_LOC$, "018-1";
- if ($@DoomsdayLoc == 2)
- set $@DD_LOC$, "031-1";
-
-
- // Set the map coordinates for spawns
- // Tulimshar
- if ($@DoomsdayLoc == 0)
- setarray $@DD_XPOS, 98, 97, 91, 75, 56, 44, 76, 54;
- if ($@DoomsdayLoc == 0)
- setarray $@DD_YPOS, 75, 86, 99,104, 81, 63, 76, 96;
-
- // Hurnscald
- if ($@DoomsdayLoc == 1)
- setarray $@DD_XPOS,138,136,133,111, 95, 79, 67, 88;
- if ($@DoomsdayLoc == 1)
- setarray $@DD_YPOS, 63, 71, 79, 74, 75, 64, 82, 90;
-
- // Nivalis
- if ($@DoomsdayLoc == 2)
- setarray $@DD_XPOS, 90, 62, 63, 56, 70, 36, 62, 85;
- if ($@DoomsdayLoc == 2)
- setarray $@DD_YPOS, 47, 49, 61, 83, 41, 37, 26, 30;
-
-
- // Make an extra announce for those whom missed
- if ($@DoomsdayLoc == 0)
- announce "Jande : Zax De'Kagen's army reached ##BTULIMSHAR##b! (Attack by south gate)", 0;
- if ($@DoomsdayLoc == 1)
- announce "Jande : Zax De'Kagen's army reached ##BHURNSCALD##b! (Attack by the mines)", 0;
- if ($@DoomsdayLoc == 2)
- announce "Jande : Zax De'Kagen's army reached ##BNIVALIS##b! (Attack by east entrance)", 0;
-
- goto L_DDAdvanceWave;
-
-// Advance wave (max. 10->6 waves)
-L_DDAdvanceWave:
- set $@DD_NUMWAVES, $@DD_NUMWAVES+1;
- if ($@DD_NUMWAVES > 6)
- end; // TODO: Maybe a final wave announcement?
-
- // Variable initialization
- set $@DD_INT, 0;
- set $@DD_UNITS, getmapusers($@DD_LOC$)+$DOOMSDAY_SCORE;
-
- // Spawns
- if ($@DoomsdayLoc == 0)
- goto L_DD3Tulim;
- if ($@DoomsdayLoc == 1)
- goto L_DD3Hurns;
- if ($@DoomsdayLoc == 2)
- goto L_DD3Nival;
-
- // Fallback
- debugmes "DOOMSDAY/ACT3: Unrecognized town: "+$@DoomsdayLoc;
- goto L_DDAdvanceTimers;
-
-// Restart timers and advance wave
-L_DDAdvanceTimers:
- initnpctimer;
- if ($@DD_INT < $@DD_UNITS*2)
- goto L_DDAdvanceTimers2;
- goto L_DDAdvanceWavePost;
-
-// If we have more users than possible, waves come faster
-L_DDAdvanceTimers2:
- set $@ADD_TIME, (($@DD_UNITS*2-$@DD_INT)*500); // ±1 second per player/victory
- // Cap to 90s (to prevent skipping first third)
- if ($@ADD_TIME > 90000)
- set $@ADD_TIME, 90000;
-
- setnpctimer $@ADD_TIME;
-
- set $@ADD_TIME, 0;
- // If we have clues, we will cause a few extra spawns
- if ($DOOMSDAY_CLUES)
- goto L_DD3WaveReinforcements;
- goto L_DDAdvanceWavePost;
-
-// Reinforcements on waves, to ensure Kage never really weaken their attacks
-L_DD3WaveReinforcements:
- set $@DD_UNITS, $@DD_UNITS-$@DD_INT;
- set $@DD_UNITS, $@DD_UNITS*$DOOMSDAY_CLUES/3;
- set $@DD_INT, 0;
-
- if ($@DD_UNITS > 0)
- goto L_DD3WRCallsub;
- goto L_DDAdvanceWavePost;
-
-L_DD3WRCallsub:
- callsub S_DD3ThirdSpawns;
- goto L_DDAdvanceWavePost;
-
-// Clear temporary variables and broadcast
-L_DDAdvanceWavePost:
- set $@DD_IDX, 0;
- set $@DD_INT, 0;
- set $@DD_UNITS, 0;
-
- // Tell users
- mapannounce $@DD_LOC$, "Jande : Watch out, another wave! Only "+(6-$@DD_NUMWAVES)+" waves left!", 0;
-
- // Prepare optional boss
- set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
- set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
-
- // Spawn optional boss if req. is met
- if ($@DD_NUMWAVES > 6-$DOOMSDAY_CLUES)
- monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
- end;
-
-
-
-
-// Tulimshar Siege points
-L_DD3Tulim:
- // Compulsory spawns
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 98, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // Non-compulsory spawns
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 91, 99, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 75, 104, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 56, 81, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 44, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 76, 76, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 54, 96, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // No extra spawns possible
- goto L_DDAdvanceTimers;
-
-
-
-// Hurnscald Siege points
-L_DD3Hurns:
- // Compulsory spawns
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 138, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // Non-compulsory spawns
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 133, 79, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 111, 74, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 94, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 79, 64, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 67, 82, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 88, 90, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // No extra spawns possible
- goto L_DDAdvanceTimers;
-
-
-
-// Nivalis Siege points
-L_DD3Nival:
- // Compulsory spawns
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 90, 47, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // Non-compulsory spawns
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 63, 61, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 56, 83, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 70, 41, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 36, 37, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 62, 26, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 85, 30, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3";
- set $@DD_INT, $@DD_INT+1;
-
- // No extra spawns possible
- goto L_DDAdvanceTimers;
-
-
-
-
-// Extra wave control system [0]
-S_DD3ThirdSpawns:
- set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
- set $@DD_IDX2, rand(getarraysize($@doomsday_mobs));
-
- monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_mobs[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
-
- set $@DD_INT, $@DD_INT+1;
- if($@DD_INT < $@DD_UNITS) goto S_DD3ThirdSpawns;
- return;
-
-// Extra wave control system [1]
-L_DD3FirstThird:
- set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
- set $@DD_INT, 0;
-
- // Difficulty adjustment: Invoke -1 mob per player and +1 mob per 2 score points
- set $@DD_UNITS, $@DD_UNITS-getmapusers($@DD_LOC$)+($DOOMSDAY_SCORE/2);
-
- // Monsters already overpower players
- if ($@DD_UNITS < 0)
- goto L_DD3EndThird;
-
- // Prepare optional boss
- set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
- set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
-
- // Spawn optional boss
- if ($@DD_NUMWAVES == 5 && $DOOMSDAY_SCORE > 6)
- monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
-
- // Spawn first third's wave
- callsub S_DD3ThirdSpawns;
- goto L_DD3EndThird;
-
-// Extra wave control system [2]
-L_DD3SecondThird:
- set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
- set $@DD_INT, 0;
-
- // Intensity control
- if ($DOOMSDAY_SCORE < 12-$DOOMSDAY_CLUES)
- goto L_DD3EndThird;
-
- // Difficulty adjustment: Invoke -1 mob per player and +1 mob per 3 score points
- set $@DD_UNITS, $@DD_UNITS-getmapusers($@DD_LOC$)+($DOOMSDAY_SCORE/3);
-
- // Prepare optional boss
- set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
- set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
-
- // Spawn optional boss
- if ($@DD_NUMWAVES == 5)
- monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3";
-
- // Monsters already overpower players
- if ($@DD_UNITS < 0)
- goto L_DD3EndThird;
-
- // Spawn second third's wave
- callsub S_DD3ThirdSpawns;
- goto L_DD3EndThird;
-
-// Extra wave control system [3]
-L_DD3EndThird:
- set $@DD_UNITS, 0;
- set $@DD_IDX1, 0;
- set $@DD_IDX2, 0;
- set $@DD_INT, 0;
- end;
-
-
-
-// Timer controls (5 minutes between waves);
-// It only fires after first wave
-L_TimerCheck2:
- if ($@DD_NUMWAVES > 0)
- goto L_DDAdvanceWave;
- end;
-
-// Siege one hour condition fully elapsed
-L_Doomsday3Check:
- set $@DoomsdayMc, mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1;
- if ($@DoomsdayMc > 0)
- goto L_Doomsday3Defeat;
- goto L_Doomsday3Victory;
-
-// Town was defeated
-L_Doomsday3Defeat:
- // Warn players that town is in danger
- mapannounce $@DD_LOC$, "Jande : Oh noes, "+$@DoomsdayMc+" monsters passed the barricate!!", 0;
-
- // Move the monsters to town
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- if ($@DoomsdayLoc == 0)
- areamonster "001-1", 52, 35, 119, 113, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
- if ($@DoomsdayLoc == 1)
- areamonster "009-1", 25, 25, 96, 53, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
- if ($@DoomsdayLoc == 2)
- areamonster "020-1", 24, 32, 99, 96, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc;
-
- // Update defeat counter and advance
- set $DOOMSDAY_TOWN[$@DoomsdayLoc], $DOOMSDAY_TOWN[$@DoomsdayLoc]+1;
- set $@DD_IDX, 0;
- goto L_Doomsday3Cleanup;
-
-// Siege was cleared up
-L_Doomsday3Victory:
- set $DOOMSDAY_SCORE, $DOOMSDAY_SCORE+1;
- mapannounce $@DD_LOC$, "Jande : That was a close call, but we did it! We defended "+$DOOMSDAY_SCORE+" times.", 0;
- goto L_Doomsday3Cleanup;
-
-// Clean up temporary variables (except skip)
-L_Doomsday3Cleanup:
- killmonster $@DD_LOC$, "Doomsday::OnDeathAct3";
- set $@DD_NUMWAVES, 0;
- set $@DoomsdayLoc, 0;
- set $@DoomsdayMc, 0;
- set $@DD_LOC$, "";
- cleararray $@DD_XPOS, 0, 8;
- cleararray $@DD_YPOS, 0, 8;
- end;
-
-// Bonus spawn
-L_Doomsday3Bonus:
- announce "Jande : Stray minions from Zax De'Kagen army were sighted all over the world!", 0;
- set $@DD_UNITS, 2+($DOOMSDAY_SCORE/5);
-
- // Cap value (to prevent huge spikes)
- if ($@DD_UNITS > 5)
- set $@DD_UNITS, 3+($DOOMSDAY_SCORE/10);
-
- // Sum the permanent clues
- set $@DD_UNITS, $@DD_UNITS+$DOOMSDAY_CLUES;
-
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
-
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "017-1", 169, 49, 198, 77, "", $@doomsday_mobs[$@DD_IDX], 1+$DOOMSDAY_CLUES;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "012-1", 20, 47, 74, 77, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "057-1", 115, 50, 140, 75, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "046-1", 58, 49, 92, 70, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "034-1", 83, 51, 121, 98, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
- set $@DD_IDX, rand(getarraysize($@doomsday_mobs));
- areamonster "003-4", 20, 20, 85, 60, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS;
-
- // Tormenta
- if (rand(10) <= $DOOMSDAY_CLUES)
- monster "057-1", 126, 64, "", 1137, 1;
-
- set $@DD_UNITS, 0;
- set $@DD_IDX, 0;
- end;
-
-// Act 4 System
-L_Doomsday4Check:
- // Magic number: 21
- if ($DOOMSDAY_SCORE >= 20-$DOOMSDAY_CLUES)
- goto L_DD4WarnSeq;
- end;
-
-L_DD4WarnSeq:
- areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4Warning1";
- announce "Jande : ##1##BWarning: ##bZax's Golem spawning! Defeat it!!", 0;
- addnpctimer 7500, "Doomsday::OnDD4Spawn";
- end;
-
-OnDD4Warning1:
- mapmask 1 | 2;
- music "Dramatic.ogg";
- areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 600, "Doomsday::OnDD4Warning2";
- end;
-
-OnDD4Warning2:
- misceffect 51, strcharinfo(0);
- areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 7000, "Doomsday::OnDD4Warning3";
- end;
-
-OnDD4Warning3:
- mapmask 1;
- end;
-
-OnDD4Spawn:
- set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
- monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", 1145, 1, "Doomsday::OnDeathAct4";
- //debugmes "Success "+$@DD_LOC$+" ("+$@DD_XPOS[$@DD_IDX1]+", "+$@DD_YPOS[$@DD_IDX1]+")";
- mapannounce $@DD_LOC$, "Golem : FRAIL SMALL PEOPLE, ME SMASH!!!", 0;
- // Spawn a few mobs
- set $@DD_INT, 0;
- set $@DD_UNITS, $DOOMSDAY_CLUES*4;
- callsub S_DD3ThirdSpawns;
- goto OnDD4Smash;
-
-// Could use a new optional skill: FRAIL NOOBS, ZAX RULES! (causes new wave of 6 monsters)
-OnDD4Smash:
- // Golem got itself smashed D:
- if ($@DD_LOC$ == "")
- end;
- if (!(mobcount($@DD_LOC$, "Doomsday::OnDeathAct4")+1))
- end;
- // TODO: Do not keep repeating the announce
- //mapannounce $@DD_LOC$, "Golem : FRAIL SMALL PEOPLE, ME SMASH!!!", 0;
- areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4Smashed";
- addnpctimer rand(12000, 18000), "Doomsday::OnDD4Smash";
- end;
-
-OnDD4Smashed:
- misceffect 52, strcharinfo(0);
- heal -70-BaseLevel, 0;
- end;
-
-// For surviving
-OnDD4SurvivorReward:
- getexp 10000, 0;
- end;
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Act 5 utils
-L_Doomsday5:
- enablenpc "Chest#DarkRose";
- if ($DOOMSDAY_SUMMON == 2)
- goto L_MenhirUpdate;
- end;
-
-////////////////////////////////////////////////////////////////////////////////
-// Respawn logic (5 minutes)
-OnTimer100000:
- if ($DOOMSDAY == 2)
- goto L_DD3FirstThird;
- end;
-
-OnTimer200000:
- if ($DOOMSDAY == 2)
- goto L_DD3SecondThird;
- end;
-
-OnTimer300000:
- if ($DOOMSDAY == 1)
- goto L_Doomsday1Respawn;
- if ($DOOMSDAY == 2)
- goto L_TimerCheck2;
- goto L_TimerFinish;
-
-// Once all timer checks are over
-L_TimerFinish:
- set $@DoomsdayMc, 0;
- setnpctimer 0;
- stopnpctimer;
- end;
-
-// Act 3 clock handlers [1]
-OnClock1750:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3Init;
- end;
-
-OnClock1800:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3;
- end;
-
-OnClock1830:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday4Check;
- end;
-
-// 19h -> 18h45
-OnClock1845:
- if ($@DOOMSDAY_SKIP)
- goto L_Doomsday3Skip;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3Check;
- end;
-
-// Act 3 clock handlers [2]
-OnClock2350:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3Init;
- end;
-
-OnClock0000:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3;
- end;
-
-OnClock0030:
- if ($@DOOMSDAY_SKIP)
- end;
- if ($DOOMSDAY == 2)
- goto L_Doomsday4Check;
- end;
-
-OnClock0045:
- if ($@DOOMSDAY_SKIP)
- goto L_Doomsday3Skip;
- if ($DOOMSDAY == 2)
- goto L_Doomsday3Check;
- end;
-
-// Act 3 clock handlers [3]
-OnClock0900:
- if ($DOOMSDAY == 2)
- goto L_Doomsday3Bonus;
- end;
-
-////////////////////////////////////////////////////////////////////////////////
-// Puppet labels
-OnDeathMapname:
- if ($DOOMSDAY == 1)
- set $DOOMSDAY_CNT, $DOOMSDAY_CNT+1;
- startnpctimer;
- end;
-
-OnDeathAct3:
- end;
-
-OnDeathAct4:
- set $DOOMSDAY_SCORE, 0;
- set $DOOMSDAY_CLUES, $DOOMSDAY_CLUES+1;
- announce "Jande : Golem destroyed, crisis averted. I'll be resetting the number of victories.", 0;
- if ($@DD_LOC$ == "")
- end;
- areatimer 0, $@DD_LOC$, 20, 20, 500, 500, 100, "Doomsday::OnDD4SurvivorReward";
- end;
-
-}
-
-// Control puppets for Doomsday Council Meetings
--|script|Doomsday Council|32767
-{
- if (GM >= G_DEV)
- mes "["+strnpcinfo(0)+"]";
- mes "You probably should try talking to them normally.";
- if (GM >= G_DEV)
- mes "##9 Use: @npctalk \""+strnpcinfo(0)+"\" \"your message goes here\"##0";
- close;
-
-OnInit:
- // Tulimshar room (Doomsday Tulim: _DT)
- if (puppet("001-2", 99, 22, "Sagatha#_DT", 167) < 1) mapexit;
- if (puppet("001-2", 92, 24, "Elanore#_DT", 108) < 1) mapexit;
- if (puppet("001-2", 92, 30, "Nikolai#_DT", 362) < 1) mapexit;
- if (puppet("001-2", 99, 32, "Morgan#_DT", 355) < 1) mapexit;
- if (puppet("001-2", 110, 22, "Valia#_DT", 370) < 1) mapexit;
- if (puppet("001-2", 117, 24, "Waric#_DT", 153) < 1) mapexit;
- if (puppet("001-2", 117, 30, "Golbenez#_DT", 307) < 1) mapexit;
- if (puppet("001-2", 110, 32, "Numa#_DT", 393) < 1) mapexit;
-
- // Hurnscald room (Doomsday Hurns: _DH)
- if (puppet("069-2", 101, 85, "Sagatha#_DH", 167) < 1) mapexit;
- if (puppet("069-2", 94, 87, "Elanore#_DH", 108) < 1) mapexit;
- if (puppet("069-2", 94, 93, "Nikolai#_DH", 362) < 1) mapexit;
- if (puppet("069-2", 101, 95, "Morgan#_DH", 355) < 1) mapexit;
- if (puppet("069-2", 112, 85, "Valia#_DH", 370) < 1) mapexit;
- if (puppet("069-2", 119, 87, "Waric#_DH", 153) < 1) mapexit;
- if (puppet("069-2", 119, 93, "Golbenez#_DH", 307) < 1) mapexit;
- if (puppet("069-2", 112, 95, "Numa#_DH", 393) < 1) mapexit;
-
- // Nivalis room (Doomsday Nivalis: _DN)
- if (puppet("048-2", 113, 86, "Sagatha#_DN", 167) < 1) mapexit;
- if (puppet("048-2", 112, 87, "Elanore#_DN", 108) < 1) mapexit;
- if (puppet("048-2", 114, 87, "Nikolai#_DN", 362) < 1) mapexit;
- if (puppet("048-2", 113, 88, "Morgan#_DN", 355) < 1) mapexit;
- if (puppet("048-2", 118, 85, "Valia#_DN", 370) < 1) mapexit;
- if (puppet("048-2", 117, 86, "Waric#_DN", 153) < 1) mapexit;
- if (puppet("048-2", 119, 86, "Golbenez#_DN", 307) < 1) mapexit;
- if (puppet("048-2", 118, 87, "Numa#_DN", 393) < 1) mapexit;
-
- // Disable puppets
- disablenpc "Sagatha#_DT";
- disablenpc "Elanore#_DT";
- disablenpc "Nikolai#_DT";
- disablenpc "Morgan#_DT";
- disablenpc "Valia#_DT";
- disablenpc "Waric#_DT";
- disablenpc "Golbenez#_DT";
- disablenpc "Numa#_DT";
-
- disablenpc "Sagatha#_DH";
- disablenpc "Elanore#_DH";
- disablenpc "Nikolai#_DH";
- disablenpc "Morgan#_DH";
- disablenpc "Valia#_DH";
- disablenpc "Waric#_DH";
- disablenpc "Golbenez#_DH";
- disablenpc "Numa#_DH";
-
- disablenpc "Sagatha#_DN";
- disablenpc "Elanore#_DN";
- disablenpc "Nikolai#_DN";
- disablenpc "Morgan#_DN";
- disablenpc "Valia#_DN";
- disablenpc "Waric#_DN";
- disablenpc "Golbenez#_DN";
- disablenpc "Numa#_DN";
- end;
-}
-
-// 114,80
--|script|Doomsday Council Master|32767
-{
- mes "The wizard seems to ignore you.";
- if (GM < G_DEV)
- close;
- goto L_Main;
-
-L_Main:
- explode @n$, strnpcinfo(0), "#";
- // @n$[1] = _DT/_DH/_DN for dismissal
- mes "";
- menu
- "[GM 40] Enable Sagatha", L_Sagatha,
- "[GM 40] Enable Elanore", L_Elanore,
- "[GM 40] Enable Nikolai", L_Nikolai,
- "[GM 40] Enable Morgan", L_Morgan,
- "[GM 40] Enable Valia", L_Valia,
- "[GM 40] Enable Waric", L_Waric,
- "[GM 40] Enable Golbenez", L_Golbenez,
- "[GM 98] Enable Numa", L_Numa,
- "[GM 40] Disable Sagatha", L_NoSagatha,
- "[GM 40] Disable Elanore", L_NoElanore,
- "[GM 40] Disable Nikolai", L_NoNikolai,
- "[GM 40] Disable Morgan", L_NoMorgan,
- "[GM 40] Disable Valia", L_NoValia,
- "[GM 40] Disable Waric", L_NoWaric,
- "[GM 40] Disable Golbenez", L_NoGolbenez,
- "[GM 98] Disable Numa", L_NoNuma,
- "[GM 60] Cancel Next Siege", L_SkipSiege,
- "[GM 80] Dismiss the council", L_Dismiss;
-
-L_Sagatha:
- enablenpc "Sagatha#"+@n$[1];
- goto L_Main;
-L_NoSagatha:
- disablenpc "Sagatha#"+@n$[1];
- goto L_Main;
-
-L_Elanore:
- enablenpc "Elanore#"+@n$[1];
- goto L_Main;
-L_NoElanore:
- disablenpc "Elanore#"+@n$[1];
- goto L_Main;
-
-L_Nikolai:
- enablenpc "Nikolai#"+@n$[1];
- goto L_Main;
-L_NoNikolai:
- disablenpc "Nikolai#"+@n$[1];
- goto L_Main;
-
-L_Morgan:
- enablenpc "Morgan#"+@n$[1];
- goto L_Main;
-L_NoMorgan:
- disablenpc "Morgan#"+@n$[1];
- goto L_Main;
-
-L_Valia:
- enablenpc "Valia#"+@n$[1];
- goto L_Main;
-L_NoValia:
- disablenpc "Valia#"+@n$[1];
- goto L_Main;
-
-L_Waric:
- enablenpc "Waric#"+@n$[1];
- goto L_Main;
-L_NoWaric:
- disablenpc "Waric#"+@n$[1];
- goto L_Main;
-
-L_Golbenez:
- enablenpc "Golbenez#"+@n$[1];
- goto L_Main;
-L_NoGolbenez:
- disablenpc "Golbenez#"+@n$[1];
- goto L_Main;
-
-L_Numa:
- if (GM < G_SYSOP)
- mes "Your GM level does not authorizes you to perform this operation.";
- if (GM < G_SYSOP)
- close;
- enablenpc "Numa#"+@n$[1];
- goto L_Main;
-L_NoNuma:
- if (GM < G_SYSOP)
- mes "Your GM level does not authorizes you to perform this operation.";
- if (GM < G_SYSOP)
- close;
- disablenpc "Numa#"+@n$[1];
- goto L_Main;
-
-L_Dismiss:
- if (GM < G_ADMIN)
- mes "Your GM level does not authorizes you to perform this operation.";
- if (GM < G_ADMIN)
- close;
- disablenpc "Sagatha#"+@n$[1];
- disablenpc "Elanore#"+@n$[1];
- disablenpc "Nikolai#"+@n$[1];
- disablenpc "Morgan#"+@n$[1];
- disablenpc "Valia#"+@n$[1];
- disablenpc "Waric#"+@n$[1];
- disablenpc "Golbenez#"+@n$[1];
- disablenpc "Arch-Wizard#"+@n$[1];
- gmlog strcharinfo(0) + " dismissed the Council.";
- close;
-
-L_SkipSiege:
- if (GM < G_GM)
- mes "Your GM level does not authorizes you to perform this operation.";
- if (GM < G_GM)
- close;
- set $@DOOMSDAY_SKIP, 1;
- announce "Jande : I do not believe the enemy army will move this time. We should be safe for now.", 0;
- gmlog strcharinfo(0) + " cancelled the scheduled doomsday attack.";
- close;
-
-OnInit:
- // Tulimshar room (Doomsday Tulim: _DT)
- if (puppet("001-2", 104, 27, "Arch-Wizard#_DT", 354) < 1) mapexit;
- if (puppet("069-2", 106, 90, "Arch-Wizard#_DH", 354) < 1) mapexit;
- if (puppet("048-2", 114, 80, "Arch-Wizard#_DN", 354) < 1) mapexit;
-
- // Disable puppets
- disablenpc "Arch-Wizard#_DT";
- disablenpc "Arch-Wizard#_DH";
- disablenpc "Arch-Wizard#_DN";
- end;
-}
-
-009-1,53,40,0|script|Chest#Zealite|111
-{
- if ($DOOMSDAY_SUMMON < 2) end;
- if ((gettimetick(2)-TUT_var < 3*7*86400) || (BaseLevel < 25)) //player must be created at least 3 weeks ago
- goto L_EndTooYoung;
- if (#DOOMSDAY_ARMOR)
- goto L_EndTooYoung;
- mes "[Chest]";
- mes "Inside this chest, Jande left us some Zealite based armor.";
- next;
- mes "[Chest]";
- mes "The @@5254|@@ can be really powerful. It'll be taken away once Doomsday Event ends.";
- next;
- mes "[Chest]";
- mes "Should we take it? (Max. 1 per account)";
- next;
- mes "Event Details: [@@https://forums.themanaworld.org/viewtopic.php?t=20921|@@]";
- menu
- "Yes, take it", L_Yes,
- "No, I don't trust it", L_No;
-
-L_Yes:
- message strcharinfo(0), "Chest : You took the Savior Armor from the chest. It will be lost once event ends.";
- getitem "SaviorArmor", 1;
- set #DOOMSDAY_ARMOR, 1;
- close;
-
-L_No:
- close;
-
-L_EndTooYoung:
- if ($DOOMSDAY == 3) goto L_Hocus;
- message strcharinfo(0), "Chest : It is empty!";
- end;
-
-L_Hocus:
- message strcharinfo(0), "Chest : Only contains fire extinguishers, water hoses, and other fire-fighting stuff. I wonder what that is for.";
- end;
-
-OnInit:
- disablenpc "Chest#Zealite";
- end;
-}
-
-008-1,97,28,0|script|#Haystack|400
-{
- if ($DOOMSDAY != 3) end;
- if ((gettimetick(2)-TUT_var < 5*7*86400) || (BaseLevel < 40)) //player must be created at least 5 weeks ago
- goto L_EndTooYoung;
- if (gettimetick(2) < #HAYSTACKTIMEPENALTY)
- goto L_EndRateLimit;
- set #HAYSTACKTIMEPENALTY, gettimetick(2) + 5;
- message strcharinfo(0), "Haystack : What exactly are you looking for?";
- // 5% chance (was 1% on 2010)
- if (rand(20) == 0)
- goto L_GetNeedle;
- close;
-
-L_GetNeedle:
- set #HAYSTACKTIMEPENALTY, gettimetick(2) + 3600; // 1 hours delay
- getitem "BentNeedle", 1;
- end;
-
-L_EndTooYoung:
- end;
-
-L_EndRateLimit:
- message strcharinfo(0), "Haystack : I just searched this haystack... Gimme a break.";
- end;
-}
-
-// This function controls death, both on Zax Domains as with Black Rose
-// Undead cannot use the Black Rose :>
-function|script|DoomsdayAct5
-{
- if ($DOOMSDAY != 3 || Class == 6)
- goto L_Return;
- if (getmap() == "099-8")
- goto L_Return;
- if (getmap() == "099-5")
- goto L_WaitRoom;
- if (getmap() == "099-1" || getmap() == "099-2" || getmap() == "099-3" || getmap() == "099-4" || getmap() == "099-6")
- goto L_WarpOut;
- // Iilia, Candor, Botcheck, etc.
- if (getmapflag(getmap(), MF_NOSAVE))
- goto L_Return;
- // Anywhere else is fine
- if (countitem("BlackRose") || @alonso)
- goto L_WarpTo;
- goto L_Return;
-
-L_WarpTo:
- heal 100000, 10000;
- if ($DOOMSDAY_TWARP == 0)
- goto L_KeshlamMaze;
- if ($DOOMSDAY_TJANDE == 1)
- goto L_KeshlamAbandoned;
- if (!@alonso)
- message strcharinfo(0), "The Black Rose did a miracle! Failed to die!";
- else
- message strcharinfo(0), "World Shift : Shifted to full health";
- // Ops, nowhere to go!
- goto L_Payment;
-
-L_Payment:
- if (@alonso)
- goto L_PayAlonso;
- goto L_PayNormal;
-
-L_PayAlonso:
- delitem "DarkPetal", 1;
- set @alonso, 0;
- return;
-
-L_PayNormal:
- delitem "BlackRose", 1;
- if (rand(5) < 3)
- getitem "DarkPetal", 1;
- return;
-
-L_WarpOut:
- if (countitem("DarkPetal") < 1)
- goto L_Failure;
- if (rand(9) == 6)
- goto L_Failure;
- delitem "DarkPetal", 1;
- heal 100000, 10000;
- warp "009-1", 52, 40;
- message strcharinfo(0), "The Dark Petal has protected you from certain death!";
- return;
-
-L_WaitRoom:
- heal 100000, 10000;
- warp "099-4", 50, 49;
- message strcharinfo(0), "You were defeated in combat and warped to a parallel dimension where Zax does not exist.";
- message strcharinfo(0), "Try to survive and provide support to your friends from the backline!";
- return;
-
-L_Failure:
- heal 100000, 10000;
- warp "009-1", 52, 40;
- message strcharinfo(0), "You returned to life as an undead!";
- set Class, 6;
- return;
-
-L_Return:
- return;
-
-///////////////////////////////////
-L_KeshlamMaze:
- if (rand(10) % 2 == 1)
- warp "099-8", 23, 378;
- else
- warp "099-8", 379, 378;
- goto L_Payment;
-
-L_KeshlamAbandoned:
- warp "099-1", 34, 34;
- goto L_Payment;
-}
-
-009-1,30,43,0|script|Chest#DarkRose|111
-{
- if ($DOOMSDAY != 3) end;
- if ((gettimetick(2)-TUT_var < 2*7*86400) || (BaseLevel < 35)) //player must be created at least 2 weeks ago
- goto L_EndTooYoung;
- if (#DOOMSDAY_FREEROSE > gettimetick(2))
- goto L_Cooldown;
- mes "[Old Woman]";
- mes "Hello. I've been picking up some @@666|@@, they are growing in my garden.";
- next;
- mes "[Old Woman]";
- mes "The last time this happened was 10 years ago. They give me an ominous feeling.";
- next;
- mes "[Old Woman]";
- mes "Do you want one? I don't like them. (Max. 1 per account)";
- next;
- mes "Event Details: [@@https://forums.themanaworld.org/viewtopic.php?t=20921|@@]";
- menu
- "Yes, take it", L_Yes,
- "No, it sounds dangerous", L_No;
-
-L_Yes:
- message strcharinfo(0), "Chest : You can get another black rose for free in 23 hours.";
- getitem "BlackRose", 1;
- set #DOOMSDAY_FREEROSE, gettimetick(2)+82800;
- close;
-
-L_No:
- close;
-
-L_EndTooYoung:
- message strcharinfo(0), "Chest : It is locked.";
- end;
-
-L_Cooldown:
- message strcharinfo(0), "Chest : You can only claim a free rose every 23 hours, please come back later.";
- end;
-
-OnInit:
- disablenpc "Chest#DarkRose";
- end;
-}
-
diff --git a/world/map/npc/functions/dynamic_menu.txt b/world/map/npc/functions/dynamic_menu.txt
deleted file mode 100644
index a2a735d6..00000000
--- a/world/map/npc/functions/dynamic_menu.txt
+++ /dev/null
@@ -1,302 +0,0 @@
-// Input: @items (array of items you want to choose from)
-// @item_names$ (names of the items in @items)
-// @default_choice$ (default option)
-// Return: @item (The selected item, or 0 if the default/something invalid was chosen)
-//
-// NOTE: DynamicItemMenu is ONLY used for scripts that need to do math with @item like tailor, dyer, bleacher
-// All other scripts should use DynamicItemMenu$
-
-function|script|DynamicItemMenu
-{
-set @items_nr, getarraysize(@items);
-if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
-if(@default_choice$ == "") set @default_choice$, "Never mind.";
-goto L_pick_one_of_many_items;
-
-L_pick_one_of_many_items:
- set @c, 0;
- set @i, 0;
-
- setarray @choice_n$, "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "";
- goto L_pick_choice_loop;
-
-L_pick_choice_loop:
- if (@i >= @items_nr)
- goto L_choice_init_done;
- set @current, @items[@i];
- set @current_name$, @item_names$[@i];
- set @current_index, @i;
- set @i, @i + 1;
-
- if (countitem(@current) == 0)
- goto L_pick_choice_loop;
- set @choice_v[@c], @current;
- set @choice_n$[@c], @current_name$;
- set @choice_i[@c], @current_index;
- set @c, @c + 1;
- goto L_pick_choice_loop;
-
-L_choice_init_done:
- set @choice_v[@c], 0;
- set @choice_n$[@c], @default_choice$;
- set @c, @c + 1;
-
- if (@c < 10)
- menu
- @choice_n$[0], L_MenuItems,
- @choice_n$[1], L_MenuItems,
- @choice_n$[2], L_MenuItems,
- @choice_n$[3], L_MenuItems,
- @choice_n$[4], L_MenuItems,
- @choice_n$[5], L_MenuItems,
- @choice_n$[6], L_MenuItems,
- @choice_n$[7], L_MenuItems,
- @choice_n$[8], L_MenuItems,
- @choice_n$[9], L_MenuItems;
- goto L_MenuItems;
-
-L_MenuItems:
- if (@c < 10)
- goto L_choice_join;
-
- if (@c < 20)
- menu
- @choice_n$[0], L_MenuItems1,
- @choice_n$[1], L_MenuItems1,
- @choice_n$[2], L_MenuItems1,
- @choice_n$[3], L_MenuItems1,
- @choice_n$[4], L_MenuItems1,
- @choice_n$[5], L_MenuItems1,
- @choice_n$[6], L_MenuItems1,
- @choice_n$[7], L_MenuItems1,
- @choice_n$[8], L_MenuItems1,
- @choice_n$[9], L_MenuItems1,
- @choice_n$[10], L_MenuItems1,
- @choice_n$[11], L_MenuItems1,
- @choice_n$[12], L_MenuItems1,
- @choice_n$[13], L_MenuItems1,
- @choice_n$[14], L_MenuItems1,
- @choice_n$[15], L_MenuItems1,
- @choice_n$[16], L_MenuItems1,
- @choice_n$[17], L_MenuItems1,
- @choice_n$[18], L_MenuItems1,
- @choice_n$[19], L_MenuItems1;
- goto L_MenuItems1;
-
-L_MenuItems1:
- if (@c < 20)
- goto L_choice_join;
-
- menu
- @choice_n$[0], L_choice_join,
- @choice_n$[1], L_choice_join,
- @choice_n$[2], L_choice_join,
- @choice_n$[3], L_choice_join,
- @choice_n$[4], L_choice_join,
- @choice_n$[5], L_choice_join,
- @choice_n$[6], L_choice_join,
- @choice_n$[7], L_choice_join,
- @choice_n$[8], L_choice_join,
- @choice_n$[9], L_choice_join,
- @choice_n$[10], L_choice_join,
- @choice_n$[11], L_choice_join,
- @choice_n$[12], L_choice_join,
- @choice_n$[13], L_choice_join,
- @choice_n$[14], L_choice_join,
- @choice_n$[15], L_choice_join,
- @choice_n$[16], L_choice_join,
- @choice_n$[17], L_choice_join,
- @choice_n$[18], L_choice_join,
- @choice_n$[19], L_choice_join,
- @choice_n$[20], L_choice_join,
- @choice_n$[21], L_choice_join,
- @choice_n$[22], L_choice_join,
- @choice_n$[23], L_choice_join,
- @choice_n$[24], L_choice_join,
- @choice_n$[25], L_choice_join,
- @choice_n$[26], L_choice_join,
- @choice_n$[27], L_choice_join,
- @choice_n$[28], L_choice_join,
- @choice_n$[29], L_choice_join,
- @choice_n$[30], L_choice_join,
- @choice_n$[31], L_choice_join;
-
-L_choice_join:
- set @menu, @menu - 1;
- set @item, @choice_v[@menu];
- set @index, @choice_i[@menu];
- if (@menu >= @c)
- set @item, 0;
- goto L_Clean;
-
-L_Clean:
- set @menu, 0;
- set @items_nr, 0;
- set @c, 0;
- set @i, 0;
- set @current, 0;
- set @current_name$, "";
- cleararray @choice_v, 0, getarraysize(@choice_v);
- cleararray @choice_n$, "", getarraysize(@choice_n$);
- cleararray @choice_i, 0, getarraysize(@choice_i);
- return;
-
-L_ArrayLengthMismatch:
- debugmes "@items and @item_names$ array length mismatch";
- mapexit;
-}
-
-
-
-
-// Input: @items$ (array of items you want to choose from)
-// @item_names$ (names of the items in @items)
-// @default_choice$ (default option)
-// Return: @item$ (The selected item, or 0 if the default/something invalid was chosen)
-
-function|script|DynamicItemMenu$
-{
-set @items_nr, getarraysize(@items$);
-if(@items_nr != getarraysize(@item_names$)) goto L_ArrayLengthMismatch;
-if(@default_choice$ == "") set @default_choice$, "Never mind.";
-goto L_pick_one_of_many_items;
-
-L_pick_one_of_many_items:
- set @c, 0;
- set @i, 0;
-
- setarray @choice_n$, "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "";
- goto L_pick_choice_loop;
-
-L_pick_choice_loop:
- if (@i >= @items_nr)
- goto L_choice_init_done;
- set @current$, @items$[@i];
- set @current_name$, @item_names$[@i];
- set @current_index, @i;
- set @i, @i + 1;
-
- if (countitem(@current$) == 0)
- goto L_pick_choice_loop;
- set @choice_v$[@c], @current$;
- set @choice_n$[@c], @current_name$;
- set @choice_i[@c], @current_index;
- set @c, @c + 1;
- goto L_pick_choice_loop;
-
-L_choice_init_done:
- set @choice_v$[@c], "";
- set @choice_n$[@c], @default_choice$;
- set @c, @c + 1;
-
- if (@c < 10)
- menu
- @choice_n$[0], L_MenuItems,
- @choice_n$[1], L_MenuItems,
- @choice_n$[2], L_MenuItems,
- @choice_n$[3], L_MenuItems,
- @choice_n$[4], L_MenuItems,
- @choice_n$[5], L_MenuItems,
- @choice_n$[6], L_MenuItems,
- @choice_n$[7], L_MenuItems,
- @choice_n$[8], L_MenuItems,
- @choice_n$[9], L_MenuItems;
- goto L_MenuItems;
-
-L_MenuItems:
- if (@c < 10)
- goto L_choice_join;
-
- if (@c < 20)
- menu
- @choice_n$[0], L_MenuItems1,
- @choice_n$[1], L_MenuItems1,
- @choice_n$[2], L_MenuItems1,
- @choice_n$[3], L_MenuItems1,
- @choice_n$[4], L_MenuItems1,
- @choice_n$[5], L_MenuItems1,
- @choice_n$[6], L_MenuItems1,
- @choice_n$[7], L_MenuItems1,
- @choice_n$[8], L_MenuItems1,
- @choice_n$[9], L_MenuItems1,
- @choice_n$[10], L_MenuItems1,
- @choice_n$[11], L_MenuItems1,
- @choice_n$[12], L_MenuItems1,
- @choice_n$[13], L_MenuItems1,
- @choice_n$[14], L_MenuItems1,
- @choice_n$[15], L_MenuItems1,
- @choice_n$[16], L_MenuItems1,
- @choice_n$[17], L_MenuItems1,
- @choice_n$[18], L_MenuItems1,
- @choice_n$[19], L_MenuItems1;
- goto L_MenuItems1;
-
-L_MenuItems1:
- if (@c < 20)
- goto L_choice_join;
-
- menu
- @choice_n$[0], L_choice_join,
- @choice_n$[1], L_choice_join,
- @choice_n$[2], L_choice_join,
- @choice_n$[3], L_choice_join,
- @choice_n$[4], L_choice_join,
- @choice_n$[5], L_choice_join,
- @choice_n$[6], L_choice_join,
- @choice_n$[7], L_choice_join,
- @choice_n$[8], L_choice_join,
- @choice_n$[9], L_choice_join,
- @choice_n$[10], L_choice_join,
- @choice_n$[11], L_choice_join,
- @choice_n$[12], L_choice_join,
- @choice_n$[13], L_choice_join,
- @choice_n$[14], L_choice_join,
- @choice_n$[15], L_choice_join,
- @choice_n$[16], L_choice_join,
- @choice_n$[17], L_choice_join,
- @choice_n$[18], L_choice_join,
- @choice_n$[19], L_choice_join,
- @choice_n$[20], L_choice_join,
- @choice_n$[21], L_choice_join,
- @choice_n$[22], L_choice_join,
- @choice_n$[23], L_choice_join,
- @choice_n$[24], L_choice_join,
- @choice_n$[25], L_choice_join,
- @choice_n$[26], L_choice_join,
- @choice_n$[27], L_choice_join,
- @choice_n$[28], L_choice_join,
- @choice_n$[29], L_choice_join,
- @choice_n$[30], L_choice_join,
- @choice_n$[31], L_choice_join;
-
-L_choice_join:
- set @menu, @menu - 1;
- set @item$, @choice_v$[@menu];
- set @index, @choice_i[@menu];
- if (@menu >= @c)
- set @item$, "";
- goto L_Clean;
-
-L_Clean:
- set @menu, 0;
- set @items_nr, 0;
- set @c, 0;
- set @current_index, 0;
- set @i, 0;
- set @current$, 0;
- set @current_name$, "";
- cleararray @choice_v$, "", getarraysize(@choice_v$);
- cleararray @choice_n$, "", getarraysize(@choice_n$);
- cleararray @choice_i, 0, getarraysize(@choice_i);
- return;
-
-L_ArrayLengthMismatch:
- debugmes "@items$ and @item_names$ array length mismatch";
- mapexit;
-}
diff --git a/world/map/npc/functions/evil_obelisk.txt b/world/map/npc/functions/evil_obelisk.txt
deleted file mode 100644
index dbfede0d..00000000
--- a/world/map/npc/functions/evil_obelisk.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-function|script|EvilObelisk
-{
- mes "[Evil Obelisk]";
- mes "(A mystical aura surrounds this stone. It seems to crave money.)";
- next;
-
- set @cost_jacko, 6500;
- set @cost_gy1, 4000;
- set @cost_gy2, 3000;
- set @cost_skull, 2800;
- set @cost_snake, 2500;
-
- menu
- "Don't pay it anything.", L_Close,
- "Pay it " + @cost_jacko + " gold.", L_JACKO,
- "Pay it " + @cost_gy1 + " gold.", L_GRAVEYARD1,
- "Pay it " + @cost_gy2 + " gold.", L_GRAVEYARD2,
- "Pay it " + @cost_skull + " gold.", L_SKULL,
- "Pay it " + @cost_snake + " gold.", L_SNAKE;
-
-L_JACKO:
- if (Zeny < @cost_jacko)
- goto L_NotEnough;
- set Zeny, Zeny - @cost_jacko;
- set @mob_id, 1022;
- set @mob_count, rand(1,2);
- goto L_Summon;
-
-L_GRAVEYARD1:
- if (Zeny < @cost_gy1)
- goto L_NotEnough;
- set @temp, rand(2);
- if(@temp == 0)
- set @mob_id, 1036; // Zombie
- if(@temp == 1)
- set @mob_id, 1045; // Fallen
- set @mob_count, rand(1,2);
- set Zeny, Zeny - @cost_gy1;
- goto L_Summon;
-
-L_GRAVEYARD2:
- if (Zeny < @cost_gy2)
- goto L_NotEnough;
- set @temp, rand(2);
- if(@temp == 0)
- set @mob_id, 1044; // Lady Skelly
- if(@temp == 1)
- set @mob_id, 1043; // Normal Skelly
- set @mob_count, rand(1,2);
- set Zeny, Zeny - @cost_gy2;
- goto L_Summon;
-
-L_SKULL:
- if (Zeny < @cost_skull)
- goto L_NotEnough;
- set @temp, rand(2);
- if(@temp == 0)
- set @mob_id, 1024; // Poison
- if(@temp == 1)
- set @mob_id, 1023; // Fire
- set @mob_count, rand(1,4);
- set Zeny, Zeny - @cost_skull;
- goto L_Summon;
-
-L_SNAKE:
- if (Zeny < @cost_snake)
- goto L_NotEnough;
- set @temp, rand(4);
- if(@temp == 0)
- set @mob_id, 1034; // Grass
- if(@temp == 1)
- set @mob_id, 1026; // Mnt.
- if(@temp == 2)
- set @mob_id, 1010; // Normal
- if(@temp == 3)
- set @mob_id, 1021; // Cave
- set @mob_count, rand(1,4);
- set Zeny, Zeny - @cost_snake;
- goto L_Summon;
-
-L_Summon:
- areamonster @map$, @x0, @y0, @x1, @y1, "", @mob_id, @mob_count;
- goto L_Close;
-
-L_NotEnough:
- mes "You don't have that much money";
- goto L_Close;
-
-L_Close:
- set @cost_jacko, 0;
- set @cost_gy1, 0;
- set @cost_gy2, 0;
- set @cost_skull, 0;
- set @cost_snake, 0;
- return;
-
-}
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
deleted file mode 100644
index 5f9e57f7..00000000
--- a/world/map/npc/functions/ferry.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-// The ferry system
-
-017-9,27,28,0|script|#FerryConfig|32767
-{
- end;
-
-OnInit:
- disablenpc "Hurnscald South Koga";
- disablenpc "Candor Koga";
- disablenpc "Nivalis Koga";
- disablenpc "Hurnscald North Koga";
- disablenpc "Tulimshar Koga";
- set $@MainCurrentDock, 0;
- set $@CandorCurrentDock, 0;
- set $@DockTickCount, 0;
- set $@DockLeaveCount, 1;
- setarray $@MainDocks$, "Hurnscald North", "Nivalis", "Tulimshar";
- setarray $@CandorDocks$, "Candor", "Hurnscald South";
- donpcevent "#"+$@MainDocks$[$@MainCurrentDock]+"Dock::OnCommandArrive";
- donpcevent "#"+$@CandorDocks$[$@CandorCurrentDock]+"Dock::OnCommandArrive";
- set .warp_delay, 430;
- if (debug >= 2) end;
- initnpctimer;
- goto L_k1city2;
-
-L_NextDock:
- set $@MainLastDock, $@MainCurrentDock;
- set $@CandorLastDock, $@CandorCurrentDock;
- set $@MainCurrentDock, $@MainCurrentDock + 1;
- set $@CandorCurrentDock, $@CandorCurrentDock + 1;
- if($@MainCurrentDock == getarraysize($@MainDocks$))
- set $@MainCurrentDock, 0;
- if($@CandorCurrentDock == getarraysize($@CandorDocks$))
- set $@CandorCurrentDock, 0;
- set $@DockTickCount, 0;
- donpcevent "#"+$@MainDocks$[$@MainLastDock]+"Dock::OnCommandWarp";
- donpcevent "#"+$@MainDocks$[$@MainCurrentDock]+"Dock::OnCommandArrive";
- donpcevent "#"+$@CandorDocks$[$@CandorLastDock]+"Dock::OnCommandWarp";
- donpcevent "#"+$@CandorDocks$[$@CandorCurrentDock]+"Dock::OnCommandArrive";
-
- donpcevent "#k1sound::OnCommandDing";
- donpcevent "#k2sound::OnCommandDing";
-
- initnpctimer;
-
- if($@MainCurrentDock == 2) goto L_k1city1;
- if($@MainCurrentDock == 0) goto L_k1city2;
- if($@MainCurrentDock == 1) goto L_k1city3;
- end;
-
-OnTimer5000:
- if ($@DockTickCount > $@DockLeaveCount)
- goto L_NextDock;
- set $@DockTickCount, $@DockTickCount + 1;
- initnpctimer;
- end;
-
-
-L_k1city1:
- enablenpc "#k1city1e"; disablenpc "#k1city2e"; disablenpc "#k1city3e";
- disablenpc "#k1city1d"; enablenpc "#k1city2d"; enablenpc "#k1city3d";
- if($@CandorCurrentDock == 1) goto L_k2city1;
- if($@CandorCurrentDock == 0) goto L_k2city2;
-end;
-
-L_k1city2:
- disablenpc "#k1city1e"; enablenpc "#k1city2e"; disablenpc "#k1city3e";
- enablenpc "#k1city1d"; disablenpc "#k1city2d"; enablenpc "#k1city3d";
- if($@CandorCurrentDock == 1) goto L_k2city1;
- if($@CandorCurrentDock == 0) goto L_k2city2;
-end;
-
-L_k1city3:
- disablenpc "#k1city1e"; disablenpc "#k1city2e"; enablenpc "#k1city3e";
- enablenpc "#k1city1d"; enablenpc "#k1city2d"; disablenpc "#k1city3d";
- if($@CandorCurrentDock == 1) goto L_k2city1;
- if($@CandorCurrentDock == 0) goto L_k2city2;
-end;
-
-L_k2city1:
- enablenpc "#k2city1e"; disablenpc "#k2city2e";
- disablenpc "#k2city1d"; enablenpc "#k2city2d";
-end;
-
-L_k2city2:
- disablenpc "#k2city1e"; enablenpc "#k2city2e";
- enablenpc "#k2city1d"; disablenpc "#k2city2d";
-end;
-}
-
-function|script|FerryHelp
-{
- mes "\"You wait on the dock for the ship to come in. You'll be given a chance to board the boat when it comes into port.\"";
- mes "\"It lingers in port to allow you some time to board in case you are running behind.\"";
- mes "\"Once on the ship, it will sail to different ports and annouce where it is docking.\"";
- mes "\"There are 2 Ferrys, both ferrys are free to ride.\"";
- mes "\"The Main ferry travels from Argeas, Kaizei and Tonori. It docks in the major ports Hurnscald North, Nivalis and the Tulimshar Dock.\"";
- mes "\"The Candor Ferry only travels betwen Candor and the Hurnscald South Dock.\"";
- mes "\"Refreshments and supplies are offered aboard both ships during the voyage.\"";
- mes "\"We also have some slot machines in case you get bored.\"";
- return;
-}
-
-function|script|BoardFerry
-{
- if ($@MainCurrentDock == 0 && getmap() == "008-1") goto L_Board;
- elif ($@MainCurrentDock == 1 && getmap() == "031-1") goto L_Board;
- elif ($@MainCurrentDock == 2 && getmap() == "001-1") goto L_Board;
-
- set @NextDock, $@MainCurrentDock + 1;
- if(@NextDock == getarraysize($@MainDocks$)) set @NextDock, 0;
- message strcharinfo(0),
- "Ferry : ##3The ferry is currently at ##B"+$@MainDocks$[$@MainCurrentDock]+"##b. "
- +"It will be arriving at ##B"+$@MainDocks$[@NextDock]+"##b next.";
- return;
-
-L_Board:
- warp "035-2",32,29;
- return;
-}
-
-function|script|BoardCandorFerry
-{
- if ($@CandorCurrentDock == 0 && getmap() == "029-1") goto L_Board;
- elif ($@CandorCurrentDock == 1 && getmap() == "008-1") goto L_Board;
-
- set @NextDock, $@CandorCurrentDock + 1;
- if(@NextDock == getarraysize($@CandorDocks$)) set @NextDock, 0;
- message strcharinfo(0),
- "Ferry : ##3The ferry is currently at ##B"+$@CandorDocks$[$@CandorCurrentDock]+"##b. "
- +"It will be arriving at ##B"+$@CandorDocks$[@NextDock]+"##b next.";
- return;
-
-L_Board:
- warp "036-2",32,29;
- goto L_Return;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt
deleted file mode 100644
index 4ac65525..00000000
--- a/world/map/npc/functions/game_rules.txt
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-
-function|script|GameRules
-{
- mes "##BPlease click submit.";
- //requestlang .@cl$; // newer clients will automatically submit and skip ahead
- clear;
- title "Game Rules";
- /*
- explode .@l$, .@cl$, "_";
- if (.@l$[0] == "en") goto L_English;
- if (.@l$[0] == "nl") goto L_Dutch;
- if (.@l$[0] == "de") goto L_German;
- if (.@l$[0] == "da") goto L_Danish;
- if (.@l$[0] == "fr") goto L_French;
- if (.@l$[0] == "es") goto L_Spanish;
- if (.@l$[0] == "sv") goto L_Swedish;
- if (.@l$[0] == "pt") goto L_Portuguese;
- if (.@l$[0] == "pl") goto L_Polish;
- if (.@l$[0] == "it") goto L_Italian;
- if (.@l$[0] == "zh") goto L_zhHant;
- if (.@l$[0] == "ru") goto L_Russian;
-
- mes "Please select a language:";
- menu
- "English", L_English,
- "Deutsch (German)", L_German,
- "Nederlands (Dutch)", L_Dutch,
- "Dansk (Danish)", L_Danish,
- "Francais (French)", L_French,
- "Castellano (Spanish)", L_Spanish,
- "Svenska (Swedish)", L_Swedish,
- "Portugues (Portuguese)", L_Portuguese,
- "Polski (Polish)", L_Polish,
- "Italiano (Italian)", L_Italian,
- "繁體中文 (Traditional Chinese)", L_zhHant,
- "Русский (Russian)", L_Russian;
- */
- goto L_English;
-
-L_English:
- mes "Players breaking the following [@@https://policies.themanaworld.org/rules|rules@@] may be banned for any length of time (even permanently) or have their characters reset at a GM's discretion:";
- mes "1) Do not AFK bot. this means you are not allowed to perform any AFK (away from keyboard) activity, apart from standing idle.";
- mes "2) Do not use offensive/rude language in the chats or in your character(s) name(s).";
- mes "3) Do not spam/flood other players. This includes chat spam and spam by trade requests.";
- mes "4) Speak only English in public areas. You can speak whatever language you want through whispers or whenever everyone in the area can speak said language.";
- mes "5) Do not beg others for money, items or favours of any kind. If you want to ask for something, do it politely and only once. Try not to annoy other players.";
- mes "6) Do not multibox. You are not allowed to engage in combat while controlling more than one character at a time.";
- mes "7) Follow the [@@https://policies.themanaworld.org/TSC|TMW Social Convention@@].";
- //mes "";
- //mes "Failure on our part to enforce any of the rules does not waive our rights to enforce them in the present or the future.";
- goto L_End;
-
-/* Very outdated
-L_German:
- mes "Wir bitten um das Einhalten folgender Regeln:";
- mes "1) Keine Beleidigungen, Schimpfwörter, Schmähungen oder Rufmord.";
- mes "2) Keine 'bots' (automatisierte Spieler). Dies beinhaltet JEGLICHE Teilnahme am Spiel während der Abwesenheit des Spielers. Es beinhaltet auch das automatisierte Folgen anderer Spieler.";
- mes "3) Kein 'spamming' oder 'flooding' (schnelles Wiederholen von Nachrichten oder Aufforderungen zum Warenhandel).";
- mes "4) Kein Betteln.";
- mes "5) Englisch ist die einzig zulässige Sprache im öffentlichen Raum.";
- mes "6) Behandele andere so, wie du selbst behandelt werden willst.";
- mes "Jegliche Regelverstöße können bestraft werden, entweder durch ein Zurücksetzen der Charaktereigenschaften und -besitztümer auf den Ausgangszustand, oder durch einen temporären oder permanenten Ausschluss aus dem Spiel.";
- mes "Automatisiertes Spielverhalten liegt vor, wenn ein sich bewegender/kämpfender Spieler nicht intelligent auf Gesprächsaufforderungen reagiert.";
- goto L_End;
-
-L_Dutch:
- mes "ATTENTION: this translation is outdated. Please refer to the English version and submit a patch.";
- mes "Spelers die de volgende regels overtreden lopen het risico gebanned te worden (oplopend tot een permanente ban) of een reset te krijgen:";
- mes "1) Misbruik geen andere spelers (vloeken, groftaal gebruik, enzovoort tegen een bepaalde persoon of personen)";
- mes "2) Geen 'bots' (geautomatiseerde speler) en botten betekend ELKE activiteit terwijl je van je toetsenboord weg bent";
- mes "3) Verboden te 'spammen' (inclusief het spammen van ruilaanvragen)";
- mes "4) Verboden te bedelen";
- mes "5) Spreek Engels op de publieke chat";
- mes "6) Behandel andere zoals ook jij behandeld wilt worden";
- mes "Botten word bepaald door te praten tegen spelers die aan het bewegen en/of aanvallen zijn.";
- goto L_End;
-
-L_Danish:
- mes "ATTENTION: this translation is outdated. Please refer to the English version and submit a patch.";
- mes "Spillere der ikke overholder de foelgende regner, kan risikere at blive banned (op til et permanent ban) eller faa deres bruger nulstillet af en spilmester (GM).";
- mes "1) Misbrug ikke medspillere (fornaerm dem ikke, svaerg ikke og mobning er forbudt)";
- mes "2) Det er forbudt at bruge bots (Botting betyder at man er aktiv inde i spillet, imens man er vaek fra ens keyboard)";
- mes "3) Det er forbudt at spamme i chatten, eller lave trade spam (spamme betyder at man sender mange beskeder efter hinanden)";
- mes "4) Det er forbudt at tigge (for eksempel: Maa jeg ikke nok faa dit svaerd, kom nu, vaer nu soed... og saa videre)";
- mes "5) Det er forbudt at snakke andre sprog end Engelsk, i den aabne chat. (Dog er det lovligt ved at bruge foelgende kommandoen /whisper)";
- mes "6) Husk at goere mod andre, som du vil have de skal goere imod dig (opfoer dig ordenligt!)";
- mes "Botting bliver fastlagt paa grundlag af, at man snakker til andre spillere, der gaar rundt og/eller der angriber og de ikke svare igen.";
- goto L_End;
-
-L_French:
- mes "Les joueurs enfreignant les règles suivantes sont sujets, à la discrétion des modérateurs, au banissement temporaire ou permanent de leur compte ou à une réinitialisation de leur personnage.";
- mes "1) Aucun abus envers autrui n'est toléré. Ceci inclus (mais n'est pas restreint à) les insultes, le non-respect, le langage grossier, le racisme, l'homophobie, etc.";
- mes "2) Toute forme d'automatisation (bot) est interdite. Ceci inclus toute activité effectuée sans la presence de l'utilisateur (botting) ou le suivi automatique d'un personnage (following).";
- mes "3) Le spam / l'envoi répeté d'un même message est interdit.";
- mes "4) Pas de mendiant. Ne demandez pas d'items ou de l'argent aux autres joueurs.";
- mes "5) Vous devez impérativement parler anglais dans l'onglet General. Les autres langues sont autorisées dans les conversations privées (Whisper), les guildes (Guild), ou les groupes (Party).";
- mes "6) Traitez les autres joueurs de la façon dont vous voudriez être traité.";
- mes "L'utilisation de logiciel d'automatisation (bot) sera vérifiée en parlent aux joueurs en mouvement et/ou attaquant.";
- mes "Le déplacement automatique (following) sera déterminé par observation.";
- goto L_End;
-
-L_Spanish:
- mes "Los jugadores que rompan las siguientes reglas pueden ser bloqueados (incluso permanentemente), o se les restablecerán sus personajes, según el criterio del GM:";
- mes "1) No abusar de otros jugadores (insultos, malas palabras, y similares dirigidas a una o varias personas)";
- mes "2) No utilizar programas automáticos (incluyendo el seguimiento automático y CUALQUIER otra actividad mientras el jugador está lejos del teclado)";
- mes "3) No enviar mensajes publicitarios ni inundar el chat de mensajes (incluyendo los mensajes de intercambio)";
- mes "4) No mendigar.";
- mes "5) Hablar únicamente en Inglés en el chat público";
- mes "6) Tratar a los demás de la misma forma que le gustaría ser tratado";
- mes "El uso de programas automáticos para jugar sin estar frente al teclado será determinado al hablar con los jugadores que estén moviéndose y/o atacando.";
- mes "El seguimiento automático será determinado por observación.";
- goto L_End;
-
-L_Swedish:
- mes "Spelare som bryter mot dessa regler riskerar att bli utkastade eller portade (antingen under kort period eller permanent), den som blivit portad/bannlyst ut kan be en GM om att starta om sitt konto.";
- mes "1) Förolämpa inte medspelare (svordomar och annat riktat till att skada en eller flera individer)";
- mes "2) Inga bottar (med bottande avses ALLA aktiviteter som sker när spelaren inte aktivt spelar eller styr sin karraktär)";
- mes "3) Inget spammande/floodande (inklusive meddelanden om byteshandel)";
- mes "4) Tigg inte";
- mes "5) Prata bara engelska i den offentliga chatten";
- mes "6) Behandla andra som du vill bli behandlad";
- mes "Vid misstankar om bottande kontrolleras detta genom att prata med spelaren under dess kringvandrande eller attackerande.";
- goto L_End;
-
-L_Portuguese:
- mes "ATTENTION: this translation is outdated. Please refer to the English version and submit a patch.";
- mes "Jogadores que quebrarem as regras que se seguem serao banidos (temporariamente ou permanentemente), ou a possibilidade dos caracteres serem limpos a descricao do Mestre do Jogo (GM).";
- mes "1) Nao tratar mal os outros jogadores (isto, insultar, dizer palavroes ou chamar nomes a pessoas em particular, etc.)";
- mes "2) Proibido \"botting\", que quer dizer qualquer actividade do caracter enquanto o jogador estiver longe do teclado.";
- mes "3) Nao abusar da caixa de texto com mensagens repetitivas, ou abusar da funcao de trocar com outros jogadores.";
- mes "4) Pedintes serao ignorados, ou banidos.";
- mes "5) Fale ingles em lugares publicos.";
- mes "6) Trate os outros da mesma maneira que quer ser tratado(a).";
- mes "O \"botting\" sera determinado, falando com os jogadores que se movem e/ou atacam.";
- goto L_End;
-
-L_Polish:
- mes "ATTENTION: this translation is outdated. Please refer to the English version and submit a patch.";
- mes "Konta graczy lamiacych nastepujace zasady moga zostac zablokowane (w niektorych przypadkach nawet nieodwolalnie) lub zresetowane przez GM:";
- mes "1) Nie wykorzystuj innych graczy (wymuszenia, przeklinanie, itp.)";
- mes "2) Zabrania sie korzystania z botow (przez boty rozumiemy kazda aktywnosc gdy gracz przebywa z dala od klawiatury)";
- mes "3) Zabrania sie spamowania / flodowania (wliczajac takze natarczywe oferty handlowe)";
- mes "4) Zabrania sie zebrania";
- mes "5) Na publicznym kanale rozmawiamy po angielsku";
- mes "6) Traktuj innych tak jak sam chcesz byc traktowany";
- mes "Uzywanie botow zostanie okreslone na podstawie rozmow z innymi graczami podczas aktywnosci gracza.";
- goto L_End;
-
-L_Italian:
- mes "Gli account dei giocatori che infrangeranno le seguenti regole verranno bloccati (anche permanentemente) o i loro personaggi saranno resettati, a discrezione dei GM:";
- mes "1) Non trattare male gli altri giocatori (questo include insulti, imprecazioni, e simili, diretti verso una persona in particolare o verso gruppi di persone)";
- mes "2) Non usare bot (ossia non effettuare NESSUNA attività quando non si è al computer)";
- mes "3) Non effettuare spam o scrivere ripetutamente messaggi inutili (incluso spam con richieste di scambio)";
- mes "4) Non fare il mendicante, ovvero non importunare gli altri chiedendo soldi o oggetti";
- mes "5) Non parlare altre lingue al di fuori dell'inglese nella chat pubblica";
- mes "6) Non fare agli altri ciò che non vuoi sia fatto a te.";
- mes "I bot saranno individuati scrivendo ai giocatori sospetti che attaccano o camminano, esaminandone le risposte e i movimenti.";
- mes "Chiunque segua automaticamente un altro giocatore senza dimostrare di non essere un bot, verrà considerato come tale.";
- goto L_End;
-
-L_zhHant:
- mes "以下為TMW的遊戲規則,違反的玩家會被封鎖(有機會永久封鎖)或重設遊戲資料:";
- mes "1) 不要謾罵其他玩家 (侮辱, 粗言穢語, 或針對某玩家的攻擊)";
- mes "2) 禁止外掛(所有玩家離開電腦時的活動)";
- mes "3) 禁止外掛(所有玩家離開電腦時的活動)";
- mes "4) 不可乞討";
- mes "5) 在公開場合需說英語";
- mes "6) 己所不欲,勿施於人";
- mes "離開鍵盤的外掛玩家會經對話的方式識別。";
- goto L_End;
-
-L_Russian:
- mes "Игроки, уличенные в нарушении следующих правил, могут быть забанены (включая пожизненный бан) или столкнутся с тем, что их игровая статистика и опыт будут понижены, на усмотрение модераторов GM:";
- mes "1) Не обижайте других игроков (оскорбления, ругательства и иное, направленное на унижения достоинства отдельного человека или людей).";
- mes "2) Никаких ботов (включая любую активность, происходящую без взаимодействия с клавиатурой (AFK), а также автоматическое следование за игроком).";
- mes "3) Никакого спама и флуда (включая навязчивую торговлю).";
- mes "4) Запрещено попрошайничество.";
- mes "5) Во время публичного общения надлежит использовать английский язык.";
- mes "6) Обращайтесь с другими так, как вы хотели, чтобы другие с вами обращались.";
- mes "Активность, происходящая без взаимодействия с клавиатурой (AFK) будет определяться путем общения с авто- перемещающимися и атакующими игроками.";
- mes "Автоматическое следование за игроком будет выявляться путем наблюдения.";
- goto L_End;
-*/
-
-L_End:
- if (TUT_var == 0)
- set TUT_var, gettimetick(2);
- goto L_Return;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/ghost.txt b/world/map/npc/functions/ghost.txt
deleted file mode 100644
index 921b8b79..00000000
--- a/world/map/npc/functions/ghost.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-function|script|SpawnGhost
-{
- if ($GHOSTS_DISABLED)
- goto L_Return;
-
- if (BaseLevel >= 40 &&
- (getmap() == "026-1" ||
- getmap() == "027-1" ||
- getmap() == "027-2" ||
- getmap() == "027-3" ||
- getmap() == "027-4" ||
- getmap() == "027-5"))
- goto L_Spawn;
- return;
-
-L_Spawn:
- set .@x, POS_X;
- set .@y, POS_Y;
-
- if (!(iscollision(getmap(), .@x, .@y - 1))) set .@y, .@y - 1; // up
- elif (!(iscollision(getmap(), .@x, .@y + 1))) set .@y, .@y + 1; // down
- elif (!(iscollision(getmap(), .@x - 1, .@y))) set .@x, .@x - 1; // left
- elif (!(iscollision(getmap(), .@x + 1, .@y))) set .@x, .@x + 1; // right
- // else on the player
-
- if (@GHOST_MAP$ != "")
- killmonster @GHOST_MAP$, "~GH~" + getcharid(0);
-
- set @GHOST_MAP$, getmap();
- specialeffect2 39;
- monster getmap(), .@x, .@y, strcharinfo(0), 1136, 1, "~GH~" + getcharid(0);
- return;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/global_event_handler.txt b/world/map/npc/functions/global_event_handler.txt
deleted file mode 100644
index b92967b3..00000000
--- a/world/map/npc/functions/global_event_handler.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-// This is the global event dispatcher
-// Do not add code to this file. Please only add callfuncs
-//
-// Author: meko
-
--|script|#GlobalHandler|32767
-{
- end;
-
-OnPCLoginEvent:
- set @login_event, 1;
- callfunc "fixHeadStyles"; // convert headstyles
- callfunc "ClearVariables"; // removes / converts old variables
- callfunc "DisplayMOTD"; // send the motd to the client, if enabled
- callfunc "getBroadcast"; // get the scheduled broadcast, if any
- addtimer 0, "Magic Timer::OnLogin"; // prevent cast rate abuse
- callfunc "MaybeGiveBirthday";
- callfunc "MiriamExpire"; // force the speed skill quest to expire
- // add more here
- set @login_event, 2;
- end;
-
-OnPCKillEvent:
- callfunc "elanore_decrease_exp"; // decrease heal exp for doing bad things
- end;
-
-OnMobKillEvent:
- callfunc "MobPoints";
- end;
-
-OnPCDieEvent:
- set @necromancer, 0;
- addtimer 0, "Magic Timer::OnClear"; // reset magic block on death
- callfunc "SpawnGhost";
- callfunc "MiriamExpire"; // force the speed skill quest to expire
- callfunc "DoomsdayAct5"; // Doomsday Event Act 5
- set @killerrid, 0; // reset killer rid
- end;
-
-OnInit:
- callfunc "ClearGlobalVars";
- callfunc "MOTD"; // set the MOTD array
- end;
-
-OnDay0411:
- callfunc "MaybeAnnounceBirthday";
- end;
-}
diff --git a/world/map/npc/functions/gm_island.txt b/world/map/npc/functions/gm_island.txt
deleted file mode 100644
index e2763bbf..00000000
--- a/world/map/npc/functions/gm_island.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-// Add Localized Warp in town centers and Message to GM Island
--|script|#GmConfig|32767
-{
- end;
-
-OnInit:
- disablenpc "Gm Event#1";
- disablenpc "Gm Event#2";
- disablenpc "Gm Event#3";
- end;
-}
--|script|#Puppet|32767
-{
- mes "You found me! Now please send my coordinates to staff.";
- close;
-
-OnSpawn:
- if (GM < G_SYSOP) goto L_GM;
- callfunc "argv_splitter";
- if (@argv$[4] == "") goto L_Failed;
- set $@PMAP$, @argv$[0];
- set $@PX, @argv$[1];
- set $@PY, @argv$[2];
- set $@PNAME$, @argv$[3];
- set $@PNPC, @argv$[4];
- if (puppet($@PMAP$, $@PX, $@PY, $@PNAME$, $@PNPC) > 0)
- gmlog "@puppeter " + @args$;
- set $@PMAP$, "";
- set $@PX, 0;
- set $@PY, 0;
- set $@PNAME$, "";
- set $@PNPC, 0;
- end;
-
-L_Failed:
- message strcharinfo(0), "Syntax: @puppeter MAP X Y NAME NPCID";
- end;
-
-L_GM:
- message strcharinfo(0), "puppeter : GM command is level "+ G_SYSOP +", but you are level " + GM;
- end;
-
-OnInit:
- registercmd chr(ATCMD_SYMBOL) + "puppeter", strnpcinfo(0)+"::OnSpawn";
- end;
-}
-function|script|GmWarp
-{
- if ($@GM_EVENT_WARP == 1) warp "028-1", 110, 30;
- if ($@GM_EVENT_WARP == 2) warp "028-1", 119, 74;
- if ($@GM_EVENT_WARP == 3) warp "028-3", 68, 36;
- if ($@GM_EVENT_WARP == 4) warp "001-3", 0, 0;
- if ($@GM_EVENT_WARP == 5) warp "070-1", 30, 92;
- if ($@GM_EVENT_WARP == 6) warp "070-3", 60, 63;
- if ($@GM_EVENT_WARP == 7) warp "003-1", 44, 94;
- return;
-}
-function|script|GmDebug
-{
- mes "[GM Debug]";
- mes "What do you want to do?";
- menu
- "Open Event Portals.", L_GmChoose,
- "Close Event Portals.", L_GmStop,
- "Disguise.", L_Disguise;
-
-L_GmChoose:
- mes "Choose a destination:";
- menu
- "GM Island (entrance)", L_GmStart,
- "GM Island (auditorium)", L_GmStart,
- "GM Island (cave)", L_GmStart,
- "Tulimshar Arena", L_GmStart,
- "Underworld", L_GmStart,
- "The Abyss", L_GmStart,
- "2006 Tulimshar", L_GmStart;
-
-L_GmStart:
- set $@GM_EVENT_WARP, @menu;
- enablenpc "Gm Event#1";
- enablenpc "Gm Event#2";
- enablenpc "Gm Event#3";
- return;
-
-L_GmStop:
- disablenpc "Gm Event#1";
- disablenpc "Gm Event#2";
- disablenpc "Gm Event#3";
- return;
-
-L_Disguise:
- npcaction 9;
- mes "[GM Debug - Disguise]";
- mes "The Disguise function allows GMs to disguise themselves as mobs or npcs.";
- mes "---";
- mes "Mob IDs: [@@https://www.themanaworld.org/index.php/Monster_Reference|Monster Reference@@]";
- mes "You can either logout or use id ##B0##b to reset.";
- mes "---";
- mes "Please input the mob ID:";
- input @disguise_id;
- if (@disguise_id < 1000 || @disguise_id > 32767)
- goto L_ResetClass;
- mes "Your disguise has been changed.";
- if (Class <= 5)
- set @old_class, Class;
- set Class, @disguise_id;
- mes "";
- mes "For technical reasons, you are not able to see your own disguise, but other players will see it.";
- return;
-
-L_ResetClass:
- mes "Your appearance has been reset.";
- set Class, if_then_else(@old_class, @old_class, 1);
- callfunc "fixHeadStyles";
- return;
-}
-001-1,49,68,0|script|Gm Event#1|368,0,0
-{
- callfunc "GmWarp";
- end;
-}
-009-1,46,30,0|script|Gm Event#2|368,0,0
-{
- callfunc "GmWarp";
- end;
-}
-020-1,67,89,0|script|Gm Event#3|368,0,0
-{
- callfunc "GmWarp";
- end;
-}
diff --git a/world/map/npc/functions/headstyles.txt b/world/map/npc/functions/headstyles.txt
deleted file mode 100644
index f5f2ea82..00000000
--- a/world/map/npc/functions/headstyles.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-// headstyles config file
-// author: meko
-
-function|script|fixHeadStyles
-{
- callfunc "getHeadStyles";
- if ((TUT_var < 1 || QL_BEGIN < 1) && StatusPoint < 1 && BaseLevel == 1)
- goto L_RandomHair; // on first login
- set @style, getlook(LOOK_HAIR_STYLE); // FIXME: this needs to be a param in the future
- set @color, getlook(LOOK_HAIR_COLOR); // FIXME: this needs to be a param in the future
- if (@style < 1 || @style > getarraysize(@HairStyles$)) // leftover from previous attempt at classes
- setlook LOOK_HAIR_STYLE, 1; // FIXME: this needs to be a param in the future
- if (@color >= 120 && @color <= HC_WHITE) // convert shock white
- set @color, (HC_WHITE - Class) + 1;
- if (@color < 105 && ((@color - (15 * (Class - 1))) < 0 || @color > ((15 * (Class - 1)) + (getarraysize(@HairColors$) - 1))))
- set @color, 15 * (Class - 1); // it is possible to style color 0 but not style 0 since style is treated as an item
- setlook LOOK_HAIR_COLOR, @color; // FIXME: this needs to be a param in the future
- return;
-
-L_RandomHair:
- resetstatus; // <= important! gives 48 stat points
- setlook LOOK_HAIR_STYLE, rand(1, getarraysize(@HairStyles$));
- setlook LOOK_HAIR_COLOR, rand((15 * (Class - 1)),((15 * (Class - 1)) + (getarraysize(@HairColors$) - 1)));
- return;
-}
-
-function|script|getHeadStyles
-{
- cleararray @HairStyles$, "", getarraysize(@HairStyles$);
- cleararray @HairColors$, "", getarraysize(@HairColors$);
-
- if (Class == 2) goto L_Tritan;
- elif (Class == 3) goto L_Ifriton;
- elif (Class == 4) goto L_Gispaan;
- elif (Class == 5) goto L_Sparron;
- elif (Class == 6) goto L_Headless;
- else set Class, 1; // we can not style custom classes, so reset when using the barber
- goto L_Talpan;
-
-L_Talpan:
- set @species$, "Talpan";
- setarray @HairStyles$[0],
- "Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
- "Pompadour", "Center parting/Short and slick", "Long and slick",
- "Short and curly", "Pigtails", "Long and curly", "Parted",
- "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick",
- "Fizzy", "Long and Clipped";
- setarray @HairColors$[0],
- "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
- "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
- "Brown";//, "(free slot)", "(free slot)";
- return;
-
-L_Headless:
- if (Class == 6) set @species$, "Undead";
- setarray @HairStyles$[0],
- "Plain", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
- "Pompadour", "Center parting/Short and slick", "Long and slick",
- "Short and curly", "Pigtails", "Long and curly", "Parted",
- "Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick",
- "Fizzy", "Long and Clipped";
- setarray @HairColors$[0],
- "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
- "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
- "Brown";//, "(free slot)", "(free slot)";
- return;
-
-L_Tritan:
- set @species$, "Tritan";
- setarray @HairStyles$[0],
- "Finless", "Mohawk", "Dorsal", "Translucid", "Spiky",
- "Dual dorsal", "Intricate", "Lateral";
- setarray @HairColors$[0],
- "Midori", "Aqua", "Mauve", "Magenta", "Jet";
- return;
-
-L_Gispaan:
- set @species$, "Gispaan";
- setarray @HairStyles$[0],
- "1", "2", "3", "4", "5",
- "6", "7", "8", "9", "10",
- "11", "12", "13", "14", "15",
- "16", "17", "18", "19", "20";
- setarray @HairColors$[0],
- "1", "2", "3", "4", "5",
- "6", "7", "8", "9", "10",
- "11", "12", "13", "14", "15";
- return;
-
-L_Sparron:
- set @species$, "Sparron";
- setarray @HairStyles$[0],
- "1", "2", "3", "4", "5",
- "6", "7", "8", "9", "10",
- "11", "12", "13", "14", "15",
- "16", "17", "18", "19", "20";
- setarray @HairColors$[0],
- "1", "2", "3", "4", "5",
- "6", "7", "8", "9", "10",
- "11", "12", "13", "14", "15";
- return;
-
-L_Ifriton:
- set @species$, "Ifriton";
- setarray @HairStyles$[0],
- "Plain", "Horny", "Kinky", "Fiendish", "Modest",
- "Spiky";
- setarray @HairColors$[0],
- "Natural", "Fiery", "Bold", "Blazing", "Spunky",
- "Gloomy";
- return;
-}
diff --git a/world/map/npc/functions/inn.txt b/world/map/npc/functions/inn.txt
deleted file mode 100644
index 7cf281bd..00000000
--- a/world/map/npc/functions/inn.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-// INN
-
-function|script|Inn
-{
- if(@npcname$ == "") set @npcname$, strnpcinfo(1);
- mes "[" + @npcname$ + "]";
- mes "\"Would you like to rest? It's only " + @cost + " gp.\"";
- next;
- menu
- "Yes", L_Next,
- "No", L_Close;
-
-L_Next:
- if (Zeny < @cost)
- goto L_NoMoney;
- set Zeny, Zeny - @cost;
- heal 10000, 10000;
-
- mes "[" + @npcname$ + "]";
- mes "\"Sleep well!\"";
- next;
- goto L_Close;
-
-L_Close:
- mes "[" + @npcname$ + "]";
- mes "\"See you.\"";
- set @npcname$, "";
- close2;
- return;
-
-L_NoMoney:
- mes "[" + @npcname$ + "]";
- mes "\"You don't have enough money to stay here.\"";
- next;
- goto L_Close;
-}
diff --git a/world/map/npc/functions/lockpicking.txt b/world/map/npc/functions/lockpicking.txt
deleted file mode 100644
index e878298e..00000000
--- a/world/map/npc/functions/lockpicking.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-//-----------------------------------------------------------------------------
-// Lock picking.
-// 3 pins per lock.
-// The player has to find the good number of times to hit a pin
-//-----------------------------------------------------------------------------
-
-function|script|LockPicking
-{
- set @lock_picking_success, 0;
- setarray @pins, rand(1,3), rand(1,3), rand(1,3);
- goto L_StartLockPicking;
-
-L_NeedLockPickSet:
- menu
- "Unfortunately, I don't have these tools... Let's look around.", L_Return;
-
-L_StartLockPicking:
- mes "You inspect the lock and notice it isn't sophisticated.";
- mes "With regular stuff, you should be able to lock pick it.";
- next;
- if (countitem ("LockPicks") < 1)
- goto L_NeedLockPickSet;
- menu
- "I can try with these lock picks I just found.", L_Next,
- "Maybe later.", L_Return;
-
-L_Next:
- delitem "LockPicks", 1;
- mes "You insert the hook pick inside the lock, and, without applying any tension, you discover there are only 3 pins to set.";
- next;
- mes "You will need to set the 3 pins to align them and turn the lock's cylinder.";
- mes "A wrong move will make you start over. Remember how you had set the pins!";
- next;
- set @pin, 0;
- goto L_HandlePin;
-
-L_NextPinOrEnd:
- if (@pin >= 2)
- goto L_OpenDoor;
- set @pin, @pin + 1;
- mes "Click! This pin is set!";
- next;
- goto L_HandlePin;
-
-L_HandlePin:
- if (@pin == 0)
- mes "What to do with the first pin?";
- if (@pin == 1)
- mes "What to do with the second pin?";
- if (@pin == 2)
- mes "What to do with the last pin?";
- menu
- "Apply a soft pressure.", L_PinSoft,
- "Apply a normal pressure.", L_PinNormal,
- "Apply a strong pressure.", L_PinHard,
- "Give up. I'm in a rush!", L_GiveUp;
-
-L_GiveUp:
- set @lock_picking_success, 0;
- set @pin, 0;
- cleararray @pins, 0, 3;
- set @pin_pressure, 0;
- return;
-
-L_PinSoft:
- set @pin_pressure, 1;
- goto L_TestPin;
-
-L_PinNormal:
- set @pin_pressure, 2;
- goto L_TestPin;
-
-L_PinHard:
- set @pin_pressure, 3;
- goto L_TestPin;
-
-L_TestPin:
- if (@pin_pressure == @pins[@pin])
- goto L_NextPinOrEnd;
- mes "Nope, that did not work. And the pins are unset now...";
- next;
- set @pin, 0;
- goto L_HandlePin;
-
-L_Return:
- return;
-
-L_OpenDoor:
- set @lock_picking_success, 1;
- mes "The two sets of pins separate. You can now turn the cylinder to open the door!";
- return;
-
-}
diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt
deleted file mode 100644
index 426bf28c..00000000
--- a/world/map/npc/functions/magic.txt
+++ /dev/null
@@ -1,191 +0,0 @@
-// Basic magic functionality
-
-// Magic system uses:
-// - MAGIC_EXP (magic experience points, gained for spellcasting)
-// - MAGIC_FLAGS
-// Magic quests use:
-// - QUEST_MAGIC
-// - QUEST_MAGIC2
-
-// ------------------------------------------------------------
-// Gain initial magic skill
-// ------------------------------------------------------------
-function|script|MagicGainBasic
-{
- set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
- // Doomsday Act 5 utils
- if (getmap() == "099-5")
- addtimer 10, "Zax De'Kagen#0::OnAdjustPotion";
- return;
-}
-
-// ------------------------------------------------------------
-// Initialise Menu for selecting a choice of things to ask about
-// ------------------------------------------------------------
-function|script|MagicTalkOptionsSetup
-{
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_MANAPOTION, 4;
- set @QQ_WYARA, 8;
- set @QQ_SAGATHA, 16;
- set @QQ_AULDSBEL, 32;
- set @QQ_IMP, 64;
- set @QQ_OLDWIZ, 128;
- set @QQ_ASTRALSOUL, 256;
- return;
-}
-
-// ------------------------------------------------------------
-// Print and run menu for choice of things to ask about
-// Ignores the entry in @ignore
-// Returns the result in @c, or returns 0 if there is no result
-// ------------------------------------------------------------
-
-function|script|MagicTalkMenu
-{
- setarray @choice$, "", "", "", "", "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
-
- if (@ignore & @QQ_ELANORE)
- goto L_Q_post_elanore;
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_elanore;
-
-L_Q_post_elanore:
- if (@ignore == @QQ_MANASEED)
- goto L_Q_post_manaseed;
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_manaseed;
-
-L_Q_post_manaseed:
- if (@ignore & @QQ_MANAPOTION)
- goto L_Q_post_manapotion;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
- goto L_Q_post_manapotion;
- set @choice$[@choices_nr], "...Mana Potions?";
- set @choice_idx[@choices_nr], @QQ_MANAPOTION;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_manapotion;
-
-L_Q_post_manapotion:
- if (@ignore & @QQ_WYARA)
- goto L_Q_post_wyara;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_wyara;
-
-L_Q_post_wyara:
- if (@ignore & @QQ_SAGATHA)
- goto L_Q_post_sagatha;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_sagatha;
-
-L_Q_post_sagatha:
- if (@ignore & @QQ_AULDSBEL)
- goto L_Q_post_auldsbel;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_auldsbel;
-
-L_Q_post_auldsbel:
- if (@ignore & @QQ_OLDWIZ)
- goto L_Q_post_oldwiz;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
- goto L_Q_post_oldwiz;
- set @choice$[@choices_nr], "...the Old Wizard?";
- set @choice_idx[@choices_nr], @QQ_OLDWIZ;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_oldwiz;
-
-L_Q_post_oldwiz:
- if (@ignore & @QQ_IMP)
- goto L_Q_post_imp;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
- goto L_Q_post_imp;
- set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
- set @choice_idx[@choices_nr], @QQ_IMP;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_imp;
-
-L_Q_post_imp:
- if (@ignore & @QQ_ASTRALSOUL)
- goto L_Q_post_astralsoul;
- if (!(getskilllv(SKILL_MAGIC)))
- goto L_Q_post_astralsoul;
- if (!(getskilllv(SKILL_POOL)))
- goto L_Q_post_astralsoul;
- set @choice$[@choices_nr], "...ways to improve my magic?";
- set @choice_idx[@choices_nr], @QQ_ASTRALSOUL;
- set @choices_nr, @choices_nr + 1;
- goto L_Q_post_astralsoul;
-
-L_Q_post_astralsoul:
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu
- @choice$[0], L_MenuItems,
- @choice$[1], L_MenuItems,
- @choice$[2], L_MenuItems,
- @choice$[3], L_MenuItems,
- @choice$[4], L_MenuItems,
- @choice$[5], L_MenuItems,
- @choice$[6], L_MenuItems,
- @choice$[7], L_MenuItems,
- @choice$[8], L_MenuItems,
- @choice$[9], L_MenuItems;
-
-L_MenuItems:
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
- return;
-}
-
-
-// ------------------------------------------------------------
-// Level up a skill
-// @SUP_id skill ID to level up
-// @SUP_lvl skill level to attain
-// @SUP_name$ name of the skill to level up
-// @SUP_xp # of experience points to award if the level up succeeds
-// ------------------------------------------------------------
-function|script|SkillUp
-{
- if (getskilllv(@SUP_id) >= @SUP_lvl)
- goto L_shortcut;
-
- misceffect sfx_skillup, strcharinfo(0);
- setskill @SUP_id, @SUP_lvl;
- getexp @SUP_xp, 0;
- if (@SUP_xp)
- mes "[" + @SUP_xp + " experience points]";
- mes "[Level " + @SUP_lvl + " in " + @SUP_name$ + "]";
- return;
-
-L_shortcut:
- mes "[You already have level " + getskilllv(@SUP_id) + " in " + @SUP_name$ + "]";
- return;
-}
diff --git a/world/map/npc/functions/miriam.txt b/world/map/npc/functions/miriam.txt
deleted file mode 100644
index b76efcc5..00000000
--- a/world/map/npc/functions/miriam.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-function|script|MiriamGoal
-{
- if (QUEST_MIRIAM_run > 0)
- set QUEST_MIRIAM_run, 0 - (gettimetick(2) - QUEST_MIRIAM_run);
- return;
-}
-
-function|script|MiriamExpire
-{
- if (QUEST_MIRIAM_run > 0)
- set QUEST_MIRIAM_run, 0 - 2; // force failute (expired)
- return;
-}
-
-function|script|MiriamCheat
-{
- if (QUEST_MIRIAM_run > 0)
- set QUEST_MIRIAM_run, 0 - 1; // force failure (cheating)
- return;
-}
diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt
deleted file mode 100644
index 81e3c6d9..00000000
--- a/world/map/npc/functions/mob_points.txt
+++ /dev/null
@@ -1,247 +0,0 @@
-// Mob points
-
-function|script|MobPoints
-{
- if (@mobID < 1002) goto L_Return;
-
- setarray @points,
- 1, // Maggot
- 2, // Scorpion
- 20, // Red Scorpion
- 40, // Green Slime
- 30, // Giant Maggot
- 15, // Yellow Slime
- 25, // Red Slime
- 45, // Black Scorpion
- 50, // Snake
- 6, // Fire Goblin
- 55, // Spider
- 35, // Evil Mushroom
- 35, // Pink Flower
- 40, // Santa Slime
- 15, // Rudolph Slime
- 2, // Bat
- 16, // Pinkie
- 10, // Spiky Mushroom
- 14, // Fluffy
- 25, // Cave Snake
- 200, // Jack O
- 85, // Fire Skull
- 85, // Poison Skull
- 20, // Log Head
- 70, // Mountain Snake
- 15, // Easter Fluffy
- 40, // Mouboo
- 0, // Mauve Plant
- 0, // Cobalt Plant
- 0, // Gamboge Plant
- 0, // Alizarin Plant
- 20, // Sea Slime
- 75, // Grass Snake
- 0, // Silk Worm
- 125, // Zombie
- 0, // Clover Patch
- 5, // Squirrel
- 0, // Fire Lizard
- 80, // Wisp
- 15, // Snail
- 80, // Spectre
- 100, // Skeleton
- 100, // Lady Skeleton
- 150, // Fallen
- 0, // Snake Lord
- 80, // Poltergeist
- 0, // Duck
- 15, // Bee
- 0, // Larvespa
- 0, // Vespa
- 0, // Hivespa
- 0, // Froad
- 0, // Troll
- 15, // Butterfly
- 2, // Cave Maggot
- 10, // Angry Scorpion
- 6, // Ice Goblin
- 20, // Archant
- 40, // Giant Cave Maggot
- 35, // Moggun
- 100, // Terranite
- 10, // Pumpkin
- 10, // Bandit
- 20, // Bandit Lord
- 30, // Vampire Bat
- 20, // Reaper
- 20, // Reaper2
- 100, // Scythe
- 20, // Ball Lightning
- 60, // Ice Element
- 80, // Yeti
- 100, // The Lost
- 60, // Red Bone
- 60, // Stalker
- 0, // Dreadwing
- 100, // Drunken Skeleton
- 100, // Tipsy Skeleton
- 100, // Drunken Lady Skeleton
- 60, // BlueSpark
- 60, // RedSpark
- 0, // Serqet
- 60, // HuntsmanSpider,
- 40, // CrotcherScorpion,
- 0, // IceSkull,
- 120, // FeyElement,
- 10, // Larvern,
- 60, // Hyvern,
- 20, // HungryFluffy,
- 40, // Wolvern,
- 50, // BlueSlime,
- 0, // SlimeBlast,
- 20, // WhiteSlime,
- 40, // Reinboo,
- 0, // WhiteBell,
- 60, // SoulSnake
- 100, // SoulEater
- 25, // CopperSlime
- 0, // SleepingBandit
- 20, // AzulSlime
- 80, // DemonicSpirit
- 940, // Luvia
- 150, // WitchGuard
- 50, // DemonicMouboo
- 15, // ViciousSquirrel
- 20, // WickedMushroom
- 18, // Bluepar
- 10, // AngryFireGoblin
- 35, // AngrySeaSlime
- 50, // CandiedSlime
- 40, // Santaboo
- 30, // Pollett
- 100, //Nutcracker
- 40, // SeaSlimeMother
- 50, // UndeadWitch
- 60, // UndeadTroll
- 80, // GreenSlimeMother
- 100, // Thug
- 100, // Swashbuckler
- 100, // Grenadier
- 150, // DreadPirateMarley
- 10, // DreadPirateMarleyClone
- 100, // Wight
- 100, // ManaGhost
- 100, // PsiBrain
- 150, // GeneralKurkan
- 175 // GeneralRazha
- // No more room! script engine is buggy, sorry.
- // -o11c
- ; // END
-
- setarray @points_extended,
- 200, // 1129 GeneralTerogan
- 100, // 1130 Moonshroom
- 20, // 1131 ManaBug
- 80, // 1132 LavaSlime
- 80, // 1133 Anne
- 200, // 1134 SUSAN
- 80, // 1135 LovelyMaggot
- 10, // 1136 LesserGhost
- 500, // 1137 Tormenta
- 200, // 1138 ManaGuardian
- 10, // 1139 Virus
- 200, // 1140 Tengu
- 200, // 1141 Sasquatch
- 999, // 1142 ZaxDeKagen
- 200, // 1143 ManaSlayer
- 200 // 1144 GreatDragon
- ;
-
- if ((MPQUEST == 1) && (@mobID < 1129))
- goto L_Table1;
-
- if ((MPQUEST == 1) && (@mobID > 1128))
- goto L_Table2;
-
- goto L_PostLoop;
-
-L_Table1:
- set Mobpt, Mobpt + @points[@mobID - 1002];
- goto L_PostLoop;
-
-L_Table2:
- set Mobpt, Mobpt + @points_extended[@mobID - 1129];
- goto L_PostLoop;
-
-L_PostLoop:
- callfunc "ValonCount";
- if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobID == $@ValonMob[@valon_mob]))
- goto L_ValonMobKill;
- goto L_NatureKarma;
-
-L_ValonMobKill:
- callfunc "AddValonCntMask";
- goto L_NatureKarma;
-
-L_NatureKarma:
-// Scorpion, Red Scorpion, Black Scorpion, Angry Scorpion
-// DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar
- if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1009) || (@mobID == 1057)
- || (@mobID == 1104) || (@mobID == 1105) || (@mobID == 1106) || (@mobID == 1107))
- goto L_good;
-
- // Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
-
- set @value, 0;
-// Pinkie
- if (@mobID == 1018)
- set @value, 3;
-
-// Fluffy
- if (@mobID == 1020)
- set @value, 3;
-// Easter Fluffy
- if (@mobID == 1027)
- set @value, 3;
-// Mouboo
- if (@mobID == 1028)
- set @value, 4;
-// Squirrel
- if (@mobID == 1038)
- set @value, 2;
-// Reinboo
- if (@mobID == 1094)
- set @value, 3;
-// Santaboo
- if (@mobID == 1112)
- set @value, 3;
-// Pollett
- if (@mobID == 1113)
- set @value, 3;
-
- if (@value == 0)
- goto L_Celestia;
-
- callfunc "QuestSagathaAnnoy";
- goto L_Celestia;
-
-L_good:
- set @value, 1;
- callfunc "QuestSagathaHappy";
- goto L_Celestia;
-
-L_Celestia:
- if (QL_CELESTIA < 5 || QL_CELESTIA >= 205 || @mobID != 1072) goto L_Terranite;
- set QL_CELESTIA, QL_CELESTIA + 1;
- if (QL_CELESTIA == 205)
- message strcharinfo(0), "Yeti : ##3This should be enough yetis killed to please Celestia.";
- goto L_Terranite;
-
-L_Terranite:
- if (TERRAC < 1 || TERRAC > 1500 || @mobID != 1062) goto L_Return;
- if (TERRAC % 100 == 0)
- message strcharinfo(0), "Terranite : ##3Total Terranites Slain: "+TERRAC;
- set TERRAC, TERRAC + 1;
- goto L_Return;
-
-L_Return:
- set @value, 0;
- return;
-}
diff --git a/world/map/npc/functions/motd.txt.example b/world/map/npc/functions/motd.txt.example
deleted file mode 100644
index f52b80f9..00000000
--- a/world/map/npc/functions/motd.txt.example
+++ /dev/null
@@ -1,10 +0,0 @@
-function|script|MOTD
-{
- setarray $@MOTD$,
-
- "Welcome to The Mana World! (running on tmwAthena)",
- "[@@http://ow.ly/MCesp|Website & Wiki@@] [@@https://goo.gl/fC4YcM|Bug Reports@@] [@@https://goo.gl/z6YDDp|Live Support@@]",
- "You can report abuse by typing in chat: @wgm Player XYZ is abusing me";
-
- return;
-}
diff --git a/world/map/npc/functions/motdconfig.txt b/world/map/npc/functions/motdconfig.txt
deleted file mode 100644
index 2d0ae049..00000000
--- a/world/map/npc/functions/motdconfig.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-function|script|MOTDConfig
-{
- mes "[MOTD]";
- mes "lines:";
- mes "---";
- set @line, 0;
- callsub S_Lines;
- mes "---";
- mes "Enabled: " + !($@MOTD_Disabled);
- next;
- menu
- "toggle|Toggle MOTD", L_Toggle;
-
-L_Toggle:
- gmlog strcharinfo(0) + " enabled or disabled the MOTD.";
- set $@MOTD_Disabled, !$@MOTD_Disabled;
- close2;
- return;
-
-S_Lines:
- mes @line + ": "+ $@MOTD$[@line];
- set @line, @line + 1;
- if(@line != getarraysize($@MOTD$)) goto S_Lines;
- return;
-}
-
-function|script|DisplayMOTD
-{
- if($@MOTD_Disabled || $@MOTD$[0] == "") goto L_Return;
- goto L_MOTD;
-
-L_MOTD:
- message strcharinfo(0), "Server : " + $@MOTD$[@motd_index];
- set @motd_index, @motd_index + 1;
- if($@MOTD$[@motd_index] == "") goto L_Return;
- goto L_MOTD;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/process_equip.txt b/world/map/npc/functions/process_equip.txt
deleted file mode 100644
index 4a4b776f..00000000
--- a/world/map/npc/functions/process_equip.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-
-function|script|ProcessEquip
-{
- set @head, getequipid(equip_head);
- set @torso, getequipid(equip_torso);
- set @legs, getequipid(equip_legs);
-
- set @torsoB, @torso;
- if (@torsoB >= 2050 && @torsoB <= 2059) set @torsoB, 1202; // Cotton shirt
- if (@torsoB >= 2060 && @torsoB <= 2069) set @torsoB, 624; // V Neck
- if (@torsoB >= 2070 && @torsoB <= 2079) set @torsoB, 564; // T Neck
- if (@torsoB >= 2080 && @torsoB <= 2089) set @torsoB, 720; // Silk Robe
- if (@torsoB >= 2090 && @torsoB <= 2099) set @torsoB, 688; // Tanktop
- if (@torsoB >= 2120 && @torsoB <= 2129) set @torsoB, 689; // Short tanktop
- set @torsoC, cNone;
- if (@torso == 1202 || @torso == 624 || @torso == 564 || @torso == 688 || @torso == 689 || @torso == 720) set @torsoC, cWhite;
- if (@torso >= 2050) set @torsoC, @torso % 10;
-
- set @legsB, @legs;
- if (@legsB >= 2100 && @legsB <= 2109) set @legsB, 632; // Cotton skirt
- if (@legsB >= 2110 && @legsB <= 2119) set @legsB, 586; // Cotton shorts
- set @legsC, cNone;
- if (@legs == 632 || @legs == 586) set @legsC, cWhite;
- if (@legs >= 2050) set @legsC, @legs % 10;
-
- return;
-}
diff --git a/world/map/npc/functions/quiz.txt b/world/map/npc/functions/quiz.txt
deleted file mode 100644
index 3deddd0a..00000000
--- a/world/map/npc/functions/quiz.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-// FIXME/TODO: some variables should be scoped, and some other variables
-// combined in an array, with a very specific name, to avoid
-// collisions. The script as a whole should be optimized to
-// take advangage of magic-v3
-
-function|script|MultiQuiz
-{
- if((getarraysize(@quiz_answers$[0]) != getarraysize(@quiz_questions$[0])) ||
- (@quiz_answers$[0] == "") || (@quiz_questions$[0] == "")) goto L_ArrayError;
- set @setindex, 1;
- set @index, rand(0,(getarraysize(@quiz_answers$[0]) - 1));
- set @question$, @quiz_questions$[@index];
- mes "\""+ @question$ + "\"";
- next;
- mes "Pick the correct answer.";
- callfunc "Quiz";
- return;
-
-L_ArrayError:
- if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty";
- if(@quiz_questions$[0] == "") debugmes "@quiz_questions$ is empty";
- if(getarraysize(@quiz_answers$[0]) != getarraysize(@quiz_questions$[0])) debugmes "Size of @quiz_answers$ is not equal to size of @quiz_questions$";
- close;
-}
-
-function|script|Quiz
-{
- if((@choices_nr < 1) || (@choices_nr > 8)) set @choices_nr, 3;
- if(@choices_nr > getarraysize(@quiz_answers$[0])) set @choices_nr, getarraysize(@quiz_answers$[0]);
- if(@quiz_answers$[0] == "") goto L_ArrayError;
- set @success, 0;
- if(@setindex < 1) set @index, @answer;
- set @good, rand(0,(@choices_nr - 1));
- cleararray @choices$, "", getarraysize(@choices$[0]);
- set @loop, 0;
- goto L_Shuffle;
-
-L_Shuffle:
- set @nindex, rand(0,(getarraysize(@quiz_answers$[0]) - 1));
- if(@nindex == @index) goto L_Shuffle; // do not get the good definition
- set @loop2, 0;
- goto L_Search;
-
-L_Search:
- if(@choices$[@loop2] == @quiz_answers$[@nindex]) goto L_Shuffle; // array is already populated with this choice
- if(@loop2 >= (@choices_nr - 1)) goto L_Shuffle2;
- set @loop2, @loop2 + 1;
- goto L_Search;
-
-L_Shuffle2:
- set @choices$[@loop], @quiz_answers$[@nindex];
- if(@loop >= (@choices_nr - 1)) goto L_Answer;
- set @loop, @loop + 1;
- goto L_Shuffle;
-
-L_Answer:
- set @choices$[@good], @quiz_answers$[@index]; // set the good definition
- menu
- @choices$[0], L_Enter,
- @choices$[1], L_Enter,
- @choices$[2], L_Enter,
- @choices$[3], L_Enter,
- @choices$[4], L_Enter,
- @choices$[5], L_Enter,
- @choices$[6], L_Enter,
- @choices$[7], L_Enter;
-
-L_Enter:
- if(@menu != (@good + 1)) goto L_Shift;
- set @success, 1;
- goto L_Shift;
-
-L_Shift:
- if(@shift < @index) set @shift, @index;
-
- if(@shift == @index) set @quiz_answers$[@index], ""; // do not allow twice the same question
-
- if((@quiz_questions$[0] != "") && (@shift == @index)) set @quiz_questions$[@index], "";
- if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[@shift], @quiz_questions$[(@shift + 1)];
- if((@quiz_questions$[0] != "") && (@quiz_questions$[(@shift + 1)] != "")) set @quiz_questions$[(@shift + 1)], "";
-
- if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[@shift], @quiz_answers$[(@shift + 1)];
- if(@quiz_answers$[(@shift + 1)] != "") set @quiz_answers$[(@shift + 1)], "";
-
- set @shift, @shift + 1;
- if(@quiz_answers$[(@shift + 1)] != "") goto L_Shift;
- set @shift, 0;
- goto L_Close;
-
-L_Close:
- set @answer, 0;
- return;
-
-L_ArrayError:
- if(@quiz_answers$[0] == "") debugmes "@quiz_answers$ is empty";
- mapexit;
-}
diff --git a/world/map/npc/functions/slot_machine.txt b/world/map/npc/functions/slot_machine.txt
deleted file mode 100644
index 8da5e46f..00000000
--- a/world/map/npc/functions/slot_machine.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-
-function|script|SlotMachine
-{
- mes "Pull the lever...";
- next;
- menu
- "Pull", L_Play,
- "Maybe later", L_Close;
-
-L_Play:
- if(countitem("CasinoCoins") < 1)
- goto L_NoCoin;
- delitem "CasinoCoins", 1;
- set @Temp1,rand(7);
- set @Temp2,rand(7);
- set @Temp3,rand(7);
- mes "Numbers: " + @Temp1 + "/" + @Temp2 + "/" + @Temp3 + ".";
- next;
-
- if(@Temp1 != @Temp2)
- goto L_Lost;
- if(@Temp2 != @Temp3)
- goto L_Lost;
- if(@Temp1 != @Temp3)
- goto L_Lost;
- if (CSN >= 9)
- goto L_Default;
- if (rand(6) < CSN)
- goto L_Jackpot;
- set CSN, CSN+1;
- goto L_Default;
-
-L_Jackpot:
- mes "Congratulations! You won!";
- mes "However, the slot machine";
- mes "do not give you the coins!";
- next;
- mes "[Staff]";
- mes "\"I apologize for this problem.";
- mes "I see you are a huge client of";
- mes "ours, so I'll give you a Monocle";
- mes "as a token of apology.\"";
- getitem "Monocle", 1;
- set CSN, 9;
- goto L_Close;
-
-L_Default:
- mes "Congratulations! You won!";
- mes "You get 10 casino coins";
- getitem "CasinoCoins", 10;
- goto L_Close;
-
-L_Lost:
- mes "You lost!";
- goto L_Close;
-
-L_NoCoin:
- mes "Insert coin";
- goto L_Close;
-
-L_Close:
- close2;
- return;
-}
diff --git a/world/map/npc/functions/soul_menhir.txt b/world/map/npc/functions/soul_menhir.txt
deleted file mode 100644
index 9d6f04ce..00000000
--- a/world/map/npc/functions/soul_menhir.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-function|script|SoulMenhir
-{
- mes "[Soul Menhir]";
- mes "(A mystical aura surrounds this stone. You feel mysteriously attracted to it. Something tells you to touch it. What do you do?)";
-
- menu
- "Touch it.", L_Bind,
- "Leave it alone.", L_Return,
- "I lost my towel...", L_Towel;
-
-L_Towel:
- if (TowelLastUsed > (gettimetick(2) - 1800))
- goto L_DontPanic;
- set TowelLastUsed, gettimetick(2);
- mes "[Soul Menhir]";
- mes "(You touch the mysterious stone. Somehow it feels hard and soft at the same time.)";
- getitem "HitchhikersTowel", 1;
- goto L_Return;
-
-L_Bind:
- if (Menhir_Activated == 1)
- goto L_Shortversion;
-
- mes "[Soul Menhir]";
- mes "(You touch the mysterious stone. Somehow it feels warm and cold at the same time.)";
- mes "(Suddenly a strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone.)";
- mes "(As suddenly as the feeling started it stops. The strange attraction is away from one moment to the next and the menhir feels like just an ordinary stone.)";
- set Menhir_Activated, 1;
- goto L_Save;
-
-L_Shortversion:
- mes "[Soul Menhir]";
- mes "(A strange sensation flows through you. It feels like your soul leaves your body and becomes one with the stone. As suddenly as the feeling started it stops.)";
- goto L_Save;
-
-L_Save:
- if (@x == 0 && @y == 0)
- goto L_FindPoint;
- goto L_Do_Save;
-
-L_DontPanic:
- message strcharinfo(0), "(A strange barrier keeps you from touching the stone at this time.)";
- goto L_Return;
-
-L_Do_Save:
- savepoint @map$, @x, @y;
- goto L_Return;
-
-L_FindPoint:
- set @n, rand(getarraysize(@Xs));
- set @x, @Xs[@n];
- set @y, @Ys[@n];
- goto L_Do_Save;
-
-L_Return:
- return;
-}
diff --git a/world/map/npc/functions/stat_reset.txt b/world/map/npc/functions/stat_reset.txt
deleted file mode 100644
index fdb833f7..00000000
--- a/world/map/npc/functions/stat_reset.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-
-function|script|StatReset
-{
-// if (ResetA_charstate == 1) goto L_Multiple;
-
-// set @cost, 10000000 / ($ResetA_uses + 1);
-
- set @cost, BaseLevel * 100;
-
- mes "[" + @npcname$ + "]";
- mes "\"I have come across a spell that will";
- mes "reset your status points.";
- mes "Normally this spell is expensive, but";
- mes "due to an unusual constellation of the";
- mes "stars I can cast it very cheaply!";
- mes "For you it will cost only "+@cost+" gp.\"";
- next;
- menu
- "Reset my stats",L_Next,
- "Forget about it",L_Pass;
-
-L_Next:
- if (Zeny<@cost) goto L_NoMoney;
- goto L_Reset;
-
-// set $ResetA_uses, $ResetA_uses + 1;
-// set ResetA_charstate, 1;
-
-L_Reset:
- set Zeny, Zeny-@cost;
- resetstatus;
-
- mes "[" + @npcname$ + "]";
- mes "\"There you are.";
- mes "";
- mes "Good as new!\"";
- goto L_Return;
-
-L_Pass:
- mes "[" + @npcname$ + "]";
- mes "\"Very well then, see you.\"";
- goto L_Return;
-
-L_NoMoney:
- mes "[" + @npcname$ + "]";
- mes "\"Oh dear, the price cannot be bargained.";
- mes "";
- mes "Perhaps you can borrow from a friend?\"";
- goto L_Return;
-
-L_Return:
- set @cost, 0;
- return;
-}
diff --git a/world/map/npc/functions/time.txt b/world/map/npc/functions/time.txt
deleted file mode 100644
index 7d16a200..00000000
--- a/world/map/npc/functions/time.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-// A replacement for gettimestr()
-// At some point this should be a builtin in the server
-// Should I allow formatting of times other than the current time?
-
-// Variables:
-// output @ts_date$ "yyyy-mm-dd"
-// output @ts_time$ "hh:mm:ss"
-
-function|script|time_stamp
-{
- // local variables
- // if there is reasonable demand, these might be exported
- // (that is what the builtin is likely to do)
- set @ts_year, gettime(7);
- set @ts_month, gettime(6);
- set @ts_mday, gettime(5);
- //set @ts_wday, gettime(4);
- set @ts_hour, gettime(3);
- set @ts_minute, gettime(2);
- set @ts_second, gettime(1);
-
- // locals used to generate leading zeroes
- set @ts_month_pad$, "";
- set @ts_mday_pad$, "";
- set @ts_hour_pad$, "";
- set @ts_minute_pad$, "";
- set @ts_second_pad$, "";
-
- if (@ts_month < 10)
- set @ts_month_pad$, "0";
- if (@ts_mday < 10)
- set @ts_mday_pad$, "0";
- if (@ts_hour < 10)
- set @ts_hour_pad$, "0";
- if (@ts_minute < 10)
- set @ts_minute_pad$, "0";
- if (@ts_second < 10)
- set @ts_second_pad$, "0";
-
- set @ts_date$, @ts_year + "-" + @ts_month_pad$ + @ts_month + "-" + @ts_mday_pad$ + @ts_mday;
- set @ts_time$, @ts_hour_pad$ + @ts_hour + ":" + @ts_minute_pad$ + @ts_minute + ":" +@ts_second_pad$ + @ts_second;
-
- // cleanup
- set @ts_year, 0;
- set @ts_month, 0;
- set @ts_mday, 0;
- set @ts_hour, 0;
- set @ts_minute, 0;
- set @ts_second, 0;
- set @ts_month_pad$, "";
- set @ts_mday_pad$, "";
- set @ts_hour_pad$, "";
- set @ts_minute_pad$, "";
- set @ts_second_pad$, "";
-
- return;
-}
-
-
-
-// HumanTime - returns a human-readable time
-// author: meko
-
-// Internal variables:
-// @separator$, @unit$, @unit2$, @unit3$, @unit4$, @unit5$
-// @seconds, @minutes, @hours, @days
-
-// Public Variables:
-// input @ms integer
-// output @time$ string
-
-function|script|HumanTime
-{
- set @time$, "now";
- if(@seconds) set @ms, @ms + (@seconds * 1000);
- if(@minutes) set @ms, @ms + (@minutes * 60000);
- if(@days) set @ms, @ms + (@days * 1440000);
- if(@ms < 1000) goto L_Millis; // under 1 second we have nothing to count
- set @seconds, @ms / 1000;
- set @ms, @ms % 1000;
- if(@seconds < 60) goto L_Seconds;
- set @minutes, @seconds / 60;
- set @seconds, @seconds % 60;
- if(@minutes < 60) goto L_Minutes;
- set @hours, @minutes / 60;
- set @minutes, @minutes % 60;
- if(@hours < 24) goto L_Hours;
- set @days, @hours / 24;
- set @hours, @hours % 24;
- if(@days) goto L_Days;
- goto L_Clean;
-
-L_Millis:
- set @time$, @ms + "ms";
- return;
-
-L_Seconds:
- set @unit$, "second";
- if(@seconds > 1) set @unit$, "seconds";
- set @unit2$, "millisecond";
- if(@ms > 1) set @unit2$, "milliseconds";
- set @time$, @seconds + " " + @unit$;
- if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit2$;
- goto L_Clean;
-
-L_Minutes:
- set @unit$, "minute";
- if(@minutes > 1) set @unit$, "minutes";
- set @unit2$, "second";
- if(@seconds > 1) set @unit2$, "seconds";
- set @unit3$, "millisecond";
- if(@ms > 1) set @unit3$, "milliseconds";
- set @time$, @minutes + " " + @unit$;
- set @separator$, " and ";
- if(@ms) set @separator$, ", ";
- if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit2$;
- if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit3$;
- goto L_Clean;
-
-L_Hours:
- set @unit$, "hour";
- if(@hours > 1) set @unit$, "hours";
- set @unit2$, "minute";
- if(@minutes > 1) set @unit2$, "minutes";
- set @unit3$, "second";
- if(@seconds > 1) set @unit3$, "seconds";
- set @unit4$, "millisecond";
- if(@ms > 1) set @unit4$, "milliseconds";
- set @time$, @hours + " " + @unit$;
- set @separator$, " and ";
- if(@seconds || @ms) set @separator$, ", ";
- if(@minutes) set @time$, @time$ + @separator$ + @minutes + " " + @unit2$;
- set @separator$, " and ";
- if(@ms) set @separator$, ", ";
- if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit3$;
- if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit4$;
- goto L_Clean;
-
-L_Days:
- set @unit$, "day";
- if(@hours > 1) set @unit$, "days";
- set @unit2$, "hour";
- if(@hours > 1) set @unit2$, "hours";
- set @unit3$, "minute";
- if(@minutes > 1) set @unit3$, "minutes";
- set @unit4$, "second";
- if(@seconds > 1) set @unit4$, "seconds";
- set @unit5$, "millisecond";
- if(@ms > 1) set @unit5$, "milliseconds";
- set @time$, @days + " " + @unit$;
- set @separator$, " and ";
- if(@minutes || @seconds || @ms) set @separator$, ", ";
- if(@hours) set @time$, @time$ + @separator$ + @hours + " " + @unit2$;
- set @separator$, " and ";
- if(@seconds || @ms) set @separator$, ", ";
- if(@minutes) set @time$, @time$ + @separator$ + @minutes + " " + @unit3$;
- set @separator$, " and ";
- if(@ms) set @separator$, ", ";
- if(@seconds) set @time$, @time$ + @separator$ + @seconds + " " + @unit3$;
- if(@ms) set @time$, @time$ + " and " + @ms + " " + @unit4$;
- goto L_Clean;
-
-L_Clean:
- set @unit$, "";
- set @unit2$, "";
- set @unit3$, "";
- set @unit4$, "";
- set @unit5$, "";
- set @seconds, 0;
- set @minutes, 0;
- set @hours, 0;
- set @days, 0;
- set @separator$, "";
- return;
-}
diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt
deleted file mode 100644
index 30116ecb..00000000
--- a/world/map/npc/functions/travelers.txt
+++ /dev/null
@@ -1,243 +0,0 @@
-// Travelers
-// Authors: Wombat, Wushin
-
-// Multiple Travelers
-// Cannot access until found (Player Bitmask)
-// Costs Zeny
-
-// Contains all warp points to find
-017-9,27,28,0|script|#TravelConfig|32767
-{
- end;
-
-OnInit:
- // TravelFound
- set $@tut_bit, (1 << 2);
- //set $@druid_tree_bit, (1 << 3);
- set $@graveyard_bit, (1 << 4);
- set $@magic_house_bit, (1 << 5);
- set $@terranite_cave_bit, (1 << 6);
- set $@tulimshar_bit, (1 << 7);
- set $@blue_sage_bit, (1 << 8);
- set $@hurnscald_bit, (1 << 9);
- set $@nivalis_bit, (1 << 10);
- //set $@tul_mine_bit, (1 << 11);
- set $@pachua_bit, (1 << 12);
- set $@barbarians_bit, (1 << 14);
- set $@hurns_farms_bit, (1 << 15);
- set $@candor_bit, (1 << 16);
- // Travel Base Cost
- set $@tulimshar_cost, 100;
- set $@hurnscald_cost, 100;
- set $@nivalis_cost, 100;
- //set $@druid_tree_cost, 150;
- //set $@tul_mine_cost, 150;
- set $@pachua_cost, 200;
- set $@graveyard_cost, 200;
- set $@magic_house_cost, 150;
- set $@terranite_cave_cost, 200;
- set $@blue_sage_cost, 200;
- set $@barbarians_cost, 150;
- set $@hurns_farms_cost, 150;
- set $@candor_cost, 200;
- end;
-}
-
-function|script|Traveler
-{
- if(@npcname$ == "") set @npcname$, strnpcinfo(1);
- mes "["+@npcname$+"]";
- mes "\"Greetings. I am "+@npcname$+" the Traveler.\"";
- next;
-
- if (TravelFound & $@tut_bit)
- goto L_Main;
- goto L_TravelTut;
-
-L_Main:
- if (TravelFound & @NpcTravelBit)
- goto L_BitTravelSet;
- goto L_SetTravelBit;
-
-L_BitTravelSet:
- set @Cost, 10;
- if (BaseLevel < 45)
- set @Cost, 5;
- goto L_Start;
-
-L_TravelTut:
- mes "["+@npcname$+"]";
- mes "\"We travelers are found all over the world. Once you have found a traveler at a certain location, you can be sent back there instantly by another traveler.\"";
- next;
- if (TravelFound & $@tut_bit)
- goto L_Main;
- goto L_SetBit;
-
-L_SetBit:
- set TravelFound, TravelFound | $@tut_bit;
- goto L_Main;
-
-L_SetTravelBit:
- mes "["+@npcname$+"]";
- mes "\"Uplink set. You can now return to this spot for a fee.\"";
- next;
- set TravelFound, TravelFound | @NpcTravelBit;
- goto L_BitTravelSet;
-
-L_Start:
- mes "\"Where would you like to go?\"";
- menu
- "Tonori - Tulimshar (" + (@Cost * $@tulimshar_cost) + " GP)", L_TravelTulimshar,
- "Argeas - Hurnscald (" + (@Cost * $@hurnscald_cost) + " GP)", L_TravelHurnscald,
- "Kaizei - Nivalis (" + (@Cost * $@nivalis_cost) + " GP)", L_TravelNivalis,
- "Tonori - Pachua's Village (" + (@Cost * $@pachua_cost) + " GP)", L_TravelPachua,
- "Argeas - Candor (" + (@Cost * $@candor_cost) + " GP)", L_TravelCandor,
- "Argeas - Magic House (" + (@Cost * $@magic_house_cost) + " GP)", L_TravelMagicHouse,
- "Argeas - Farmsteads (" + (@Cost * $@hurns_farms_cost) + " GP)", L_TravelHurnsFarms,
- "Argeas - Graveyard (" + (@Cost * $@graveyard_cost) + " GP)", L_TravelGraveyard,
- "Argeas - Terranite Cave (" + (@Cost * $@terranite_cave_cost) + " GP)", L_TravelTerranite,
- "Kaizei - Barbarian Village (" + (@Cost * $@barbarians_cost) + " GP)", L_TravelBarbarians,
- "Kaizei - Sage Nikolai's Mansion (" + (@Cost * $@blue_sage_cost) + " GP)", L_TravelBlueSage,
- "Who are the Travelers?", L_TravelTut,
- "I'm not interested.", L_TravelNo;
-
-L_TravelChecks:
- if (@NpcTravelBit == @NextLocationBit)
- goto L_AlreadyThere;
- if (!(TravelFound & @NextLocationBit))
- goto L_NoFound;
- if (Zeny < @NextLocationCost)
- goto L_NoMoney;
- goto L_TravelPlayer;
-
-L_TravelPlayer:
- mes "["+@npcname$+"]";
- mes "\"Be fearless!\"";
- close2;
- set Zeny, Zeny - @NextLocationCost;
- warp @NextLocationMap$,@NextLocationX,@NextLocationY;
- goto L_Clearvars;
-
-L_TravelGraveyard:
- set @NextLocationBit, $@graveyard_bit;
- set @NextLocationCost, (@Cost * $@graveyard_cost);
- set @NextLocationMap$, "026-1";
- set @NextLocationX, 49;
- set @NextLocationY, 45;
- goto L_TravelChecks;
-
-L_TravelMagicHouse:
- set @NextLocationBit, $@magic_house_bit;
- set @NextLocationCost, (@Cost * $@magic_house_cost);
- set @NextLocationMap$, "013-1";
- set @NextLocationX, 120;
- set @NextLocationY, 93;
- goto L_TravelChecks;
-
-L_TravelTerranite:
- set @NextLocationBit, $@terranite_cave_bit;
- set @NextLocationCost, (@Cost * $@terranite_cave_cost);
- set @NextLocationMap$, "012-3";
- set @NextLocationX, 445;
- set @NextLocationY, 65;
- goto L_TravelChecks;
-
-L_TravelTulimshar:
- set @NextLocationBit, $@tulimshar_bit;
- set @NextLocationCost, (@Cost * $@tulimshar_cost);
- set @NextLocationMap$, "002-1";
- set @NextLocationX, 60;
- set @NextLocationY, 42;
- goto L_TravelChecks;
-
-L_TravelBlueSage:
- set @NextLocationBit, $@blue_sage_bit;
- set @NextLocationCost, (@Cost * $@blue_sage_cost);
- set @NextLocationMap$, "048-2";
- set @NextLocationX, 26;
- set @NextLocationY, 47;
- goto L_TravelChecks;
-
-L_TravelHurnscald:
- set @NextLocationBit, $@hurnscald_bit;
- set @NextLocationCost, (@Cost * $@hurnscald_cost);
- set @NextLocationMap$, "008-1";
- set @NextLocationX, 79;
- set @NextLocationY, 84;
- goto L_TravelChecks;
-
-L_TravelNivalis:
- set @NextLocationBit, $@nivalis_bit;
- set @NextLocationCost, (@Cost * $@nivalis_cost);
- set @NextLocationMap$, "020-1";
- set @NextLocationX, 53;
- set @NextLocationY, 122;
- goto L_TravelChecks;
-
-L_TravelPachua:
- set @NextLocationBit, $@pachua_bit;
- set @NextLocationCost, (@Cost * $@pachua_cost);
- set @NextLocationMap$, "006-1";
- set @NextLocationX, 28;
- set @NextLocationY, 97;
- callfunc "MiriamCheat";
- goto L_TravelChecks;
-
-L_TravelBarbarians:
- set @NextLocationBit, $@barbarians_bit;
- set @NextLocationCost, (@Cost * $@barbarians_cost);
- set @NextLocationMap$, "033-1";
- set @NextLocationX, 66;
- set @NextLocationY, 33;
- goto L_TravelChecks;
-
-L_TravelHurnsFarms:
- set @NextLocationBit, $@hurns_farms_bit;
- set @NextLocationCost, (@Cost * $@hurns_farms_cost);
- set @NextLocationMap$, "055-1";
- set @NextLocationX, 135;
- set @NextLocationY, 60;
- goto L_TravelChecks;
-
-L_TravelCandor:
- set @NextLocationBit, $@candor_bit;
- set @NextLocationCost, (@Cost * $@candor_cost);
- set @NextLocationMap$, "029-1";
- set @NextLocationX, 69;
- set @NextLocationY, 69;
- goto L_TravelChecks;
-
-L_TravelNo:
- mes "["+@npcname$+"]";
- mes "\"Perhaps you will have the courage to help us some day.\"";
- close2;
- goto L_Clearvars;
-
-L_NoMoney:
- mes "["+@npcname$+"]";
- mes "\"I'm sorry, but you don't have enough money. Maybe next time.\"";
- close2;
- goto L_Clearvars;
-
-L_NoFound:
- mes "["+@npcname$+"]";
- mes "\"Sorry, but you haven't visited a traveler yet at that location. You should find and talk to a traveler there so you can quickly return to that location in the future.\"";
- close2;
- goto L_Clearvars;
-
-L_AlreadyThere:
- mes "["+@npcname$+"]";
- mes "\"Uh... You're already here. Are you sure you know where you are going?\"";
- close2;
- goto L_Clearvars;
-
-L_Clearvars:
- set @npcname$, "";
- set @Cost, 0;
- set @NextLocationBit, 0;
- set @NextLocationCost, 0;
- set @NextLocationMap$, "";
- set @NextLocationX, 0;
- set @NextLocationY, 0;
- return;
-}
diff --git a/world/map/npc/functions/undead_debug.txt b/world/map/npc/functions/undead_debug.txt
deleted file mode 100644
index 15e3bcd9..00000000
--- a/world/map/npc/functions/undead_debug.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-// Debug Crypts Battle
-
-function|script|UndeadDebug
-{
- goto L_Main;
-
-L_Main:
- if (@undeaddebug == 3)
- goto L_UndeadDebugThree;
- if (@undeaddebug == 4)
- goto L_UndeadDebugFour;
- if (@undeaddebug == 5)
- goto L_UndeadDebugFive;
- goto L_Close;
-
-L_UndeadDebugThree:
- mes "Reset your self to the various states.";
- mes "Options Limited to Time and Place.";
- menu
- "Get Ritual Items.", L_KrukanItems,
- "Nevermind.", L_Close;
-
-L_UndeadDebugFour:
- mes "Reset your self to the various states.";
- mes "Options Limited to Time and Place.";
- menu
- "Get Ritual Items.", L_RazhaItems,
- "Nevermind.", L_Close;
-
-L_UndeadDebugFive:
- mes "Reset your self to the various states.";
- mes "Options Limited to Time and Place.";
- menu
- "Get Ritual Items.", L_TeroganItems,
- "Nevermind.", L_Close;
-
-L_InventoryNoSpace:
- mes "\"Drop some weight then come back.\"";
- goto L_Close;
-
-L_KrukanItems:
- if ((checkweight("Soul", 1) == 0)
- || (checkweight("Skull", 5) == 0)
- || (checkweight("DarkCrystal", 5) == 0)
- || (checkweight("Bone", 5) == 0)
- || (@inventorylist_count == 100))
- goto L_InventoryNoSpace;
- getitem "Soul", 1;
- getitem "Skull", 5;
- getitem "DarkCrystal", 5;
- getitem "Bone", 5;
- goto L_Main;
-
-L_RazhaItems:
- if ((checkweight("Soul", 3) == 0)
- || (checkweight("DiseasedHeart", 5) == 0)
- || (checkweight("UndeadEye", 5) == 0)
- || (checkweight("UndeadEar", 5) == 0)
- || (@inventorylist_count == 100))
- goto L_InventoryNoSpace;
- getitem "Soul", 3;
- getitem "DiseasedHeart", 5;
- getitem "UndeadEye", 5;
- getitem "UndeadEar", 5;
- goto L_Main;
-
-L_TeroganItems:
- if ((checkweight("Soul", 5) == 0)
- || (checkweight("RottenRags", 5) == 0)
- || (checkweight("UndeadEye", 5) == 0)
- || (checkweight("UndeadEar", 5) == 0)
- || (@inventorylist_count == 100))
- goto L_InventoryNoSpace;
- getitem "Soul", 5;
- getitem "RottenRags", 5;
- getitem "UndeadEye", 5;
- getitem "UndeadEar", 5;
- goto L_Main;
-
-L_Close:
- close2;
- return;
-}
-
-// Debug for Krukan
-027-3,84,89,0|script|UndeadDebug3|155
-{
- set @undeaddebug, 3;
- callfunc "UndeadDebug";
- end;
-OnInit:
- if (!debug)
- disablenpc "UndeadDebug3";
- end;
-}
-
-// Debug for Razha
-027-4,76,79,0|script|UndeadDebug4|155
-{
- set @undeaddebug, 4;
- callfunc "UndeadDebug";
- end;
-OnInit:
- if (!debug)
- disablenpc "UndeadDebug4";
- end;
-}
-
-// Debug for Terogan
-027-5,72,26,0|script|UndeadDebug5|155
-{
- set @undeaddebug, 5;
- callfunc "UndeadDebug";
- end;
-OnInit:
- if (!debug)
- disablenpc "UndeadDebug5";
- end;
-}
diff --git a/world/map/npc/functions/water_bottle.txt b/world/map/npc/functions/water_bottle.txt
deleted file mode 100644
index e5f80766..00000000
--- a/world/map/npc/functions/water_bottle.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-// Fills empty bottles with water
-
-function|script|WaterBottle
-{
- set @COST_PER_BOTTLE, 150;
-
- mes "How many empty bottles do you want to fill with water? It costs " + @COST_PER_BOTTLE + "gp per bottle.";
- input @count;
-
- if (@count == 0)
- goto L_Close;
- set @cost, @count * @COST_PER_BOTTLE;
- set @empty, countitem("EmptyBottle");
-
- if (@empty < @count)
- goto L_NotEnoughBottles;
- if (Zeny < @cost)
- goto L_NotEnoughMoney;
- getinventorylist;
- if (@inventorylist_count == 100
- && countitem("BottleOfWater") == 0
- && @empty > @count)
- goto L_NotEnoughSlots;
-
- set Zeny, Zeny - @cost;
- delitem "EmptyBottle", @count;
- getitem "BottleOfWater", @count;
- goto L_Close;
-
-L_NotEnoughBottles:
- mes "You don't have that many empty bottles!";
- goto L_Close;
-
-L_NotEnoughMoney:
- mes "You don't have enough gp! You need " + @cost + "gp.";
- goto L_Close;
-
-L_NotEnoughSlots:
- mes "You don't have room for these bottles!";
- goto L_Close;
-
-L_Close:
- close2;
- return;
-}