summaryrefslogtreecommitdiff
path: root/world/map/npc/functions
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-02 11:06:32 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-02 22:21:29 -0700
commitc0ba38cd4b68491e28e467889804ebc09c9c002e (patch)
treeaf2890e6fe20990d2a9b7c94b991be58f25a5d52 /world/map/npc/functions
parent514a2f05cb335c1e9210fea58bc9a9a58478283f (diff)
downloadserverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.gz
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.bz2
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.tar.xz
serverdata-c0ba38cd4b68491e28e467889804ebc09c9c002e.zip
Clean up main scripts
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r--world/map/npc/functions/banker.txt19
-rw-r--r--world/map/npc/functions/barber.txt78
-rw-r--r--world/map/npc/functions/clear_vars.txt17
-rw-r--r--world/map/npc/functions/dailyquest.txt7
-rwxr-xr-xworld/map/npc/functions/debug.txt99
-rw-r--r--world/map/npc/functions/evil_obelisk.txt3
-rw-r--r--world/map/npc/functions/ferry.txt7
-rw-r--r--world/map/npc/functions/game_rules.txt3
-rw-r--r--world/map/npc/functions/inn.txt3
-rw-r--r--world/map/npc/functions/lockpicking.txt8
-rw-r--r--world/map/npc/functions/magic.txt34
-rw-r--r--world/map/npc/functions/mob_points.txt1
-rw-r--r--world/map/npc/functions/slot_machine.txt6
-rw-r--r--world/map/npc/functions/soul_menhir.txt5
14 files changed, 176 insertions, 114 deletions
diff --git a/world/map/npc/functions/banker.txt b/world/map/npc/functions/banker.txt
index eae01230..df908e62 100644
--- a/world/map/npc/functions/banker.txt
+++ b/world/map/npc/functions/banker.txt
@@ -5,6 +5,7 @@ function|script|Banker|,
if (BankAccount == 0)
goto L_Start;
callsub S_MoveAccount;
+ goto L_Start;
L_Start:
mes "[" + @npcname$ + "]";
@@ -18,7 +19,6 @@ L_Start:
"Check my balance", L_Balance,
"Change Bank Options", L_Change,
"Nevermind", L_Nev;
- close;
// need to close window before opening storage.
L_Storage:
@@ -43,8 +43,7 @@ L_Dep:
"1,000,000 GP", L_Dep_1kk,
"All of my money", L_Dep_All,
"I've changed my mind", L_Start,
- "Quit", -;
- return;
+ "Quit", L_Return;
L_Dep_Input:
input @Amount;
@@ -56,8 +55,7 @@ L_Dep_Input:
"Go back", L_Start,
"Try again", L_Dep_Input,
"Deposit all", L_Dep_All,
- "Nevermind", -;
- goto L_Nev;
+ "Nevermind", L_Nev;
L_Dep_5k:
if (Zeny<5000)
@@ -111,6 +109,7 @@ L_Dep_All:
if (Zeny<1)
goto L_NoMoney;
set @Amount, Zeny;
+ goto L_Dep_Continue;
L_Dep_Continue:
if (Zeny < @Amount)
@@ -134,8 +133,7 @@ L_With:
"1,000,000 GP", L_With_1kk,
"All of my money", L_With_All,
"I've changed my mind", L_Start,
- "Quit", -;
- return;
+ "Quit", L_Return;
L_With_Input:
input @Amount;
@@ -147,8 +145,7 @@ L_With_Input:
"Go back", L_Start,
"Try again", L_With_Input,
"Withdraw all", L_With_All,
- "Nevermind", -;
- goto L_Nev;
+ "Nevermind", L_Nev;
L_With_5k:
if (#BankAccount < 5000)
@@ -202,6 +199,7 @@ L_With_All:
if (#BankAccount < 0)
goto L_NoMoney;
set @Amount, #BankAccount;
+ goto L_With_Continue;
L_With_Continue:
if (#BankAccount < @Amount)
@@ -248,4 +246,7 @@ L_Change_Storage:
L_Change_Bank:
set #BankOptions, (#BankOptions ^ OPT_BANK_CLOSE);
goto L_Start;
+
+L_Return:
+ return;
}
diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt
index dc7f0329..76b06dd7 100644
--- a/world/map/npc/functions/barber.txt
+++ b/world/map/npc/functions/barber.txt
@@ -26,6 +26,7 @@ function|script|Barber|,
mes "Your current style is " + @style$ + " and your current color is " + @color$ + ".";
set @style$, "";
set @color$, "";
+ goto L_Main;
L_Main:
menu
@@ -35,29 +36,30 @@ L_Main:
L_Style:
menu
- "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", -,
+ "Bald", L_MenuItems,
+ "Flat ponytail", L_MenuItems,
+ "Bowl cut", L_MenuItems,
+ "Combed back", L_MenuItems,
+ "Emo", L_MenuItems,
+ "Mohawk", L_MenuItems,
+ "Pompadour", L_MenuItems,
+ "Center parting/Short and slick", L_MenuItems,
+ "Long and slick", L_MenuItems,
+ "Short and curly", L_MenuItems,
+ "Pigtails", L_MenuItems,
+ "Long and curly", L_MenuItems,
+ "Parted", L_MenuItems,
+ "Perky ponytail", L_MenuItems,
+ "Wave", L_MenuItems,
+ "Mane", L_MenuItems,
+ "Bun", L_MenuItems,
+ "Shoulder Length Flick", L_MenuItems,
+ "Fizzy", L_MenuItems,
+ "Long and Clipped", L_MenuItems,
"Surprise me", L_RandomStyle,
"Nah, I'm fine", L_Done;
+L_MenuItems:
if (@menu - 1 == @style)
goto L_SameStyle;
@@ -74,22 +76,23 @@ L_SameStyle:
L_Color:
menu
- "Brunette", -,
- "Green", -,
- "Dark red", -,
- "Light purple", -,
- "Gray", -,
- "Blonde", -,
- "Teal", -,
- "Light red", -,
- "Blue", -,
- "Dark purple", -,
- "Black", -,
- "Pink", -,
- "Brown", -,
+ "Brunette", L_MenuItems1,
+ "Green", L_MenuItems1,
+ "Dark red", L_MenuItems1,
+ "Light purple", L_MenuItems1,
+ "Gray", L_MenuItems1,
+ "Blonde", L_MenuItems1,
+ "Teal", L_MenuItems1,
+ "Light red", L_MenuItems1,
+ "Blue", L_MenuItems1,
+ "Dark purple", L_MenuItems1,
+ "Black", L_MenuItems1,
+ "Pink", L_MenuItems1,
+ "Brown", L_MenuItems1,
"Surprise me", L_RandomColor,
"Nah, I'm fine", L_Done;
+L_MenuItems1:
if (@menu - 1 == @color)
goto L_SameColor;
@@ -112,10 +115,11 @@ L_Done:
return;
}
-// Since this is a function, not an NPC, OnInit doesn't work
-// So call this from a real NPC's OnInit (001-1/barber.txt)
-function|script|OnInitBarber|,
+-|script|#BarberConfig|-1,
{
+ end;
+
+OnInit:
setarray $@HairStyles$,
"Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
"Pompadour", "Center parting/Short and slick", "Long and slick",
@@ -126,5 +130,5 @@ function|script|OnInitBarber|,
"Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
"Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
"Brown";
- return;
+ end;
}
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index 1aa84d2b..905528ae 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -193,6 +193,7 @@ function|script|ClearVarTMW_Quest|,
if (TMW_Quest <= 10) goto L_Vincent;
if (TMW_Quest <= 12) goto L_Sandra;
if (TMW_Quest <= 40) goto L_Desert;
+ goto L_Bandit;
L_Bandit:
// move Bandit subquest into Nibble 0 of QUEST_Hurnscald
@@ -200,44 +201,59 @@ L_Bandit:
set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_0_MASK) | (@bandit << NIBBLE_0_SHIFT));
set TMW_Quest, 40;
set @bandit, 0;
+ goto L_Desert;
+
L_Desert:
// move guard and miner subquest into Byte 2 (Nibble 4 and 5) of QUEST_SouthTulimshar
set @miners, TMW_Quest - 12;
set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(BYTE_2_MASK) | (@miners << BYTE_2_SHIFT));
set TMW_Quest, 12;
set @miners, 0;
+ goto L_Sandra;
+
L_Sandra:
// move Sandra subquest into Nibble 3 of QUEST_SouthTulimshar
set @sandra, TMW_Quest - 10;
set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_3_MASK) | (@sandra << NIBBLE_3_SHIFT));
set TMW_Quest, 10;
set @sandra, 0;
+ goto L_Vincent;
+
L_Vincent:
// move Vincent subquest into Nibble 2 of QUEST_SouthTulimshar
set @vincent, TMW_Quest - 8;
set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_2_MASK) | (@vincent << NIBBLE_2_SHIFT));
set TMW_Quest, 8;
set @vincent, 0;
+ goto L_Sarah;
+
L_Sarah:
// move Sarah subquest into Nibble 1 of QUEST_SouthTulimshar
set @sarah, TMW_Quest - 6;
set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_1_MASK) | (@sarah << NIBBLE_1_SHIFT));
set TMW_Quest, 6;
set @sarah, 0;
+ goto L_Bernard_Mikhail;
+
L_Bernard_Mikhail:
// move Bernard and Mikhail subquest into Nibble 0 of QUEST_SouthTulimshar
set QUEST_SouthTulimshar, (QUEST_SouthTulimshar & ~(NIBBLE_0_MASK) | (TMW_Quest << NIBBLE_0_SHIFT));
set TMW_Quest, 0;
+ goto L_Done;
+
L_Done:
return;
}
-|script|#ClearGlobalVars|-1,
{
+ end;
+
OnInit:
// Clear some entries of the arrays which save the Fluffy Hunting highscore list
set $@loop, 5;
+ goto L_FluffyClear;
L_FluffyClear:
if ($@loop == 12)
@@ -254,6 +270,7 @@ L_FluffyClear:
// 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] == "")
diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt
index aadafc89..a0360376 100644
--- a/world/map/npc/functions/dailyquest.txt
+++ b/world/map/npc/functions/dailyquest.txt
@@ -47,6 +47,7 @@ function|script|DailyQuestPoints|,
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;
@@ -67,9 +68,10 @@ function|script|DailyQuest|,
mes "\"If you bring me " + @dq_count + " " + @dq_friendly_name$ + ", I will give you a reward.\"";
menu
"I have what you want.", L_Trade,
- "Ok, I'll get to work.", -,
- "Nah, I'm not going to help you.", -;
+ "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;
@@ -91,6 +93,7 @@ L_Trade:
mes "";
mes "[" + @dq_money + " money]";
mes "[" + @dq_exp + " experience points]";
+ goto L_Exit_Good;
L_Exit_Good:
set @dq_return, 4;
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index dad9b804..e1c9e6c8 100755
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -2,6 +2,8 @@
function|script|Debug|,
{
+ goto L_Begin;
+
L_Begin:
set @debug_mask, 65535;
set @debug_shift, 0;
@@ -15,8 +17,7 @@ L_Begin:
"Change my magic skills.", L_MagicSkills,
"Add everything.", L_AddAll,
"Reset everything.", L_ResetAll,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_Level:
mes "What level do you want to be (min: 1 - max: 99)?";
@@ -55,8 +56,7 @@ L_Status:
"Get maximum points in all stats.", L_ChangeAllStats,
"Reset my status points.", L_ResetStatusPoints,
"Back to the main menu.", L_Begin,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_ChangeAllStats:
statusup2 bStr, 99 - readparam(bStr);
@@ -156,8 +156,7 @@ L_ChangeSingleStat:
"Dexterity.", L_ChangeDexteritySingle,
"Luck.", L_ChangeLuckSingle,
"Back to the main menu.", L_Begin,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_ChangeStrengthSingle:
mes "How much strength do you want to have (min: 1 - max: 99)?";
@@ -246,8 +245,7 @@ L_BasicSkills:
"Add basic skills.", L_AddBasicSkills,
"Reset basic skills.", L_ResetBasicSkills,
"Back to main menu.", L_Begin,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_BasicSkillsOverview:
mes "Your level in the emote skill is " + @emote + ".";
@@ -263,14 +261,15 @@ L_AddBasicSkills:
"Party.", L_ChangePartySkill,
"All basic skills to their maximum level.", L_AllBasicSkills,
"Back to the basic skills menu.", L_BasicSkills,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_ChangeEmoteSkill:
mes "Your level in the emote skill is " + @emote + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next,
"Get level 1.", L_ChangeEmoteSkill1;
+
+L_Next:
if (@menu == 1)
setskill SKILL_EMOTE, 0;
mes "Emote skill changed to level 0.";
@@ -286,8 +285,10 @@ L_ChangeEmoteSkill1:
L_ChangeTradeSkill:
mes "Your level in the trade skill is " + @trade + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next1,
"Get level 1.", L_ChangeTradeSkill1;
+
+L_Next1:
if (@menu == 1)
setskill SKILL_TRADE, 0;
mes "Trade skill changed to level 0.";
@@ -303,9 +304,11 @@ L_ChangeTradeSkill1:
L_ChangePartySkill:
mes "Your level in the party skill is " + @trade + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next2,
"Get level 1.", L_ChangePartySkill1,
"Get level 2.", L_ChangePartySkill2;
+
+L_Next2:
if (@menu == 1)
setskill SKILL_PARTY, 0;
mes "Party skill changed to level 0.";
@@ -354,8 +357,7 @@ L_FocusSkills:
"Add focus skills.", L_ChangeFocusSkills,
"Reset focus skills.", L_ResetFocusSkills,
"Back to the main menu.", L_Begin,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_SeeFocusSkills:
cleararray @skilllist_name$[0], "", 8;
@@ -409,14 +411,16 @@ L_Focus:
set @skilllist_name$[@skilllist_count], "Back to the focus skills menu.";
mes "You are not focused on any focus skill right now. Which one do you want to focus on?";
menu
- @skilllist_name$[0], -,
- @skilllist_name$[1], -,
- @skilllist_name$[2], -,
- @skilllist_name$[3], -,
- @skilllist_name$[4], -,
- @skilllist_name$[5], -,
- @skilllist_name$[6], -,
- @skilllist_name$[7], -;
+ @skilllist_name$[0], L_MenuItems,
+ @skilllist_name$[1], L_MenuItems,
+ @skilllist_name$[2], L_MenuItems,
+ @skilllist_name$[3], L_MenuItems,
+ @skilllist_name$[4], L_MenuItems,
+ @skilllist_name$[5], L_MenuItems,
+ @skilllist_name$[6], L_MenuItems,
+ @skilllist_name$[7], L_MenuItems;
+
+L_MenuItems:
set @menu, @menu - 1;
poolskill @skilllist_id[@menu];
goto L_FocusSkills;
@@ -428,8 +432,10 @@ L_NoFocusSkills:
L_AskUnfocus:
mes "Unfocus " + @skilllist_name$[@skilllist_count-1] + "?";
menu
- "Yes.", -,
+ "Yes.", L_Next3,
"No.", L_FocusSkills;
+
+L_Next3:
unpoolskill @skilllist_id[@skilllist_count-1];
goto L_FocusSkills;
@@ -444,8 +450,7 @@ L_ChangeFocusSkills:
"Raging.", L_ChangeRagingSkill,
"All focus skills to their maximum level.", L_AllFocusSkills,
"Back to the focus skills menu.", L_FocusSkills,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_BadSkillLevel:
mes "Invalid skill level.";
@@ -554,8 +559,7 @@ L_MagicSkills:
"All magic skills to their maximum level and maximum magic experience.", L_GetAllMagic,
"Reset magic skills and experience.", L_ResetMagicSkills,
"Back to the main menu.", L_Begin,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_MagicSkillsOverview:
mes "Your current magic experience skill is " + @mexp + ".";
@@ -610,15 +614,16 @@ L_ChangeMagicSkills:
"Astral Magic.", L_ChangeAstralMagicSkill,
"Dark Magic.", L_ChangeDarkMagicSkill,
"Back to the magic skills menu.", L_MagicSkills,
- "Close.", -;
- close;
+ "Close.", L_Close;
L_ChangeGeneralMagicSkill:
mes "Your level in the general magic skill is " + @general + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next4,
"Get level 1.", L_ChangeGeneralMagicSkill1,
"Get level 2.", L_ChangeGeneralMagicSkill2;
+
+L_Next4:
if (@menu == 1)
setskill SKILL_MAGIC, 0;
mes "General Magic skill changed to level 0.";
@@ -643,9 +648,11 @@ L_ChangeGeneralMagicSkill2:
L_ChangeLifeMagicSkill:
mes "Your level in the life magic skill is " + @life + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next5,
"Get level 1.", L_ChangeLifeMagicSkill1,
"Get level 2.", L_ChangeLifeMagicSkill2;
+
+L_Next5:
if (@menu == 1)
setskill SKILL_MAGIC_LIFE, 0;
mes "Life Magic skill changed to level 0.";
@@ -670,9 +677,11 @@ L_ChangeLifeMagicSkill2:
L_ChangeWarMagicSkill:
mes "Your level in the war magic skill is " + @war + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next6,
"Get level 1.", L_ChangeWarMagicSkill1,
"Get level 2.", L_ChangeWarMagicSkill2;
+
+L_Next6:
if (@menu == 1)
setskill SKILL_MAGIC_WAR, 0;
mes "War Magic skill changed to level 0.";
@@ -697,9 +706,11 @@ L_ChangeWarMagicSkill2:
L_ChangeTransmutationMagicSkill:
mes "Your level in the transmutation magic skill is " + @trans + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next7,
"Get level 1.", L_ChangeTransmutationMagicSkill1,
"Get level 2.", L_ChangeTransmutationMagicSkill2;
+
+L_Next7:
if (@menu == 1)
setskill SKILL_MAGIC_TRANSMUTE, 0;
mes "Transmutation Magic skill changed to level 0.";
@@ -724,9 +735,11 @@ L_ChangeTransmutationMagicSkill2:
L_ChangeNatureMagicSkill:
mes "Your level in the nature magic skill is " + @nature + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next8,
"Get level 1.", L_ChangeNatureMagicSkill1,
"Get level 2.", L_ChangeNatureMagicSkill2;
+
+L_Next8:
if (@menu == 1)
setskill SKILL_MAGIC_NATURE, 0;
mes "Nature Magic skill changed to level 0.";
@@ -751,9 +764,11 @@ L_ChangeNatureMagicSkill2:
L_ChangeAstralMagicSkill:
mes "Your level in the astral magic skill is " + @astral + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next9,
"Get level 1.", L_ChangeAstralMagicSkill1,
"Get level 2.", L_ChangeAstralMagicSkill2;
+
+L_Next9:
if (@menu == 1)
setskill SKILL_MAGIC_ASTAL, 0;
mes "Astral Magic skill changed to level 0.";
@@ -778,9 +793,11 @@ L_ChangeAstralMagicSkill2:
L_ChangeDarkMagicSkill:
mes "Your level in the dark magic skill is " + @dark + ". What do you want to do?";
menu
- "Get level 0.", -,
+ "Get level 0.", L_Next10,
"Get level 1.", L_ChangeDarkMagicSkill1,
"Get level 2.", L_ChangeDarkMagicSkill2;
+
+L_Next10:
if (@menu == 1)
setskill SKILL_MAGIC_DARK, 0;
mes "Dark Magic skill changed to level 0.";
@@ -894,6 +911,9 @@ L_ResetAll:
next;
goto L_Begin;
+L_Close:
+ close;
+
}
042-2.gat,30,26,0|script|Debug0|154,
@@ -903,6 +923,7 @@ L_ResetAll:
OnInit:
if (!debug)
disablenpc "Debug0";
+ end;
}
001-1.gat,41,29,0|script|Debug1|154,
@@ -912,6 +933,7 @@ OnInit:
OnInit:
if (!debug)
disablenpc "Debug1";
+ end;
}
009-1.gat,52,33,0|script|Debug2|154,
@@ -921,6 +943,7 @@ OnInit:
OnInit:
if (!debug)
disablenpc "Debug2";
+ end;
}
020-1.gat,75,85,0|script|Debug3|154,
@@ -930,6 +953,7 @@ OnInit:
OnInit:
if (!debug)
disablenpc "Debug3";
+ end;
}
botcheck.gat,50,28,0|script|Debug4|154,
@@ -939,4 +963,5 @@ botcheck.gat,50,28,0|script|Debug4|154,
OnInit:
if (!debug)
disablenpc "Debug4";
+ end;
}
diff --git a/world/map/npc/functions/evil_obelisk.txt b/world/map/npc/functions/evil_obelisk.txt
index 0875abb5..328e875b 100644
--- a/world/map/npc/functions/evil_obelisk.txt
+++ b/world/map/npc/functions/evil_obelisk.txt
@@ -11,13 +11,12 @@ function|script|EvilObelisk|,
set @cost_snake, 2500;
menu
- "Don't pay it anything.", -,
+ "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;
- goto L_Close;
L_JACKO:
if (Zeny < @cost_jacko)
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index 0b66f68e..03f5777f 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -7,6 +7,7 @@ function|script|Ferry|,
set @cost_tulimshar, 500;
set @cost_hurnscald, 500;
set @cost_nivalis, 500;
+ goto L_Start;
L_Start:
set @cost_candor, 1500;
@@ -22,8 +23,7 @@ L_PlainMenu:
"Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar,
"Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald,
"Nivalis (" + @cost_nivalis + "GP)", L_Nivalis,
- "Nevermind", -;
- goto L_Close;
+ "Nevermind", L_Close;
L_MenuWithCandor:
menu
@@ -31,8 +31,7 @@ L_MenuWithCandor:
"Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald,
"Nivalis (" + @cost_nivalis + "GP)", L_Nivalis,
"Candor (" + @cost_candor + "GP)", L_Candor,
- "Nevermind", -;
- goto L_Close;
+ "Nevermind", L_Close;
L_Tulimshar:
if (@loc == DOCK_tulimshar)
diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt
index 7ede18ea..5ef85bda 100644
--- a/world/map/npc/functions/game_rules.txt
+++ b/world/map/npc/functions/game_rules.txt
@@ -14,8 +14,6 @@ function|script|GameRules|,
"Portugues (Portuguese)", L_Portuguese,
"Polski (Polish)", L_Polish,
"Italiano (Italian)", L_Italian;
- // is this even reachable? TODO look at how the 'cancel' button works.
- if (@canSkip) goto L_Return;
L_English:
mes "Players breaking the following rules may be banned (up to and including a permanent ban) or have their characters reset at the GM's discretion:";
@@ -160,6 +158,7 @@ L_End:
set @read, 1;
if (TUT_var == 0)
set TUT_var, gettimetick(2);
+ goto L_Return;
L_Return:
return;
diff --git a/world/map/npc/functions/inn.txt b/world/map/npc/functions/inn.txt
index 271a4652..45ed4052 100644
--- a/world/map/npc/functions/inn.txt
+++ b/world/map/npc/functions/inn.txt
@@ -6,9 +6,10 @@ function|script|Inn|,
mes "\"Would you like to rest? It's only " + @cost + " gp.\"";
next;
menu
- "Yes", -,
+ "Yes", L_Next,
"No", L_No;
+L_Next:
if (Zeny < @cost)
goto L_NoMoney;
set Zeny, Zeny - @cost;
diff --git a/world/map/npc/functions/lockpicking.txt b/world/map/npc/functions/lockpicking.txt
index dc05fc53..375fd173 100644
--- a/world/map/npc/functions/lockpicking.txt
+++ b/world/map/npc/functions/lockpicking.txt
@@ -12,8 +12,7 @@ function|script|LockPicking|,
L_NeedLockPickSet:
menu
- "Unfortunately, I don't have these tools... Let's look around.", -;
- return;
+ "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.";
@@ -22,8 +21,10 @@ L_StartLockPicking:
if (countitem ("LockPicks") < 1)
goto L_NeedLockPickSet;
menu
- "I can try with these lock picks I just found.", -,
+ "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;
@@ -53,7 +54,6 @@ L_HandlePin:
"Apply a normal pressure.", L_PinNormal,
"Apply a strong pressure.", L_PinHard,
"Give up. I'm in a rush!", L_GiveUp;
- return;
L_GiveUp:
set @lock_picking_success, 0;
diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt
index a1faea94..2715cf7e 100644
--- a/world/map/npc/functions/magic.txt
+++ b/world/map/npc/functions/magic.txt
@@ -14,7 +14,6 @@ function|script|MagicGainBasic|,
{
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
close;
-
}
// ------------------------------------------------------------
@@ -40,7 +39,6 @@ function|script|MagicTalkOptionsSetup|,
// Returns the result in @c, or returns 0 if there is no result
// ------------------------------------------------------------
-
function|script|MagicTalkMenu|,
{
setarray @choice$, "", "", "", "", "", "", "", "", "", "";
@@ -52,6 +50,7 @@ function|script|MagicTalkMenu|,
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)
@@ -61,6 +60,7 @@ L_Q_post_elanore:
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)
@@ -70,6 +70,7 @@ L_Q_post_manaseed:
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)
@@ -79,6 +80,7 @@ L_Q_post_manapotion:
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)
@@ -88,6 +90,7 @@ L_Q_post_wyara:
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)
@@ -97,6 +100,7 @@ L_Q_post_sagatha:
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)
@@ -106,6 +110,7 @@ L_Q_post_auldsbel:
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)
@@ -115,6 +120,7 @@ L_Q_post_oldwiz:
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)
@@ -126,6 +132,7 @@ L_Q_post_imp:
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.";
@@ -133,17 +140,18 @@ L_Q_post_astralsoul:
set @choices_nr, @choices_nr + 1;
menu
- @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -,
- @choice$[5], -,
- @choice$[6], -,
- @choice$[7], -,
- @choice$[8], -,
- @choice$[9], -;
-
+ @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)
diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt
index 08864ed0..fd769a3f 100644
--- a/world/map/npc/functions/mob_points.txt
+++ b/world/map/npc/functions/mob_points.txt
@@ -168,6 +168,7 @@ function|script|MobPoints|,
L_good:
set @value, 1;
callfunc "QuestSagathaHappy";
+ goto L_end;
L_end:
set @value, 0;
diff --git a/world/map/npc/functions/slot_machine.txt b/world/map/npc/functions/slot_machine.txt
index 5d7e1ee6..ebf72471 100644
--- a/world/map/npc/functions/slot_machine.txt
+++ b/world/map/npc/functions/slot_machine.txt
@@ -6,8 +6,7 @@ function|script|SlotMachine|,
next;
menu
"Pull", L_Play,
- "Maybe later", -;
- close;
+ "Maybe later", L_Close;
L_Play:
if(countitem("CasinoCoins") < 1)
@@ -37,4 +36,7 @@ L_Lost:
L_NoCoin:
mes "Insert coin";
close;
+
+L_Close:
+ close;
}
diff --git a/world/map/npc/functions/soul_menhir.txt b/world/map/npc/functions/soul_menhir.txt
index 02907210..14c1cf1c 100644
--- a/world/map/npc/functions/soul_menhir.txt
+++ b/world/map/npc/functions/soul_menhir.txt
@@ -5,9 +5,10 @@ function|script|SoulMenhir|,
next;
menu
- "Touch it.", -,
+ "Touch it.", L_Bind,
"Leave it alone.", L_Return;
+L_Bind:
if (Menhir_Activated == 1)
goto L_Shortversion;
@@ -30,10 +31,12 @@ 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.)";
next;
+ goto L_Save;
L_Save:
if (@x == 0 && @y == 0)
goto L_FindPoint;
+ goto L_Do_Save;
L_Do_Save:
savepoint @map$, @x, @y;