From c0ba38cd4b68491e28e467889804ebc09c9c002e Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 2 Apr 2014 11:06:32 -0700 Subject: Clean up main scripts --- world/map/npc/annuals/xmas/barriers.txt | 2 +- world/map/npc/annuals/xmas/config.txt | 3 +++ world/map/npc/annuals/xmas/core.txt | 1 + world/map/npc/annuals/xmas/debug.txt | 30 ++++++++++++++++++++++-------- world/map/npc/annuals/xmas/helpers.txt | 1 + world/map/npc/annuals/xmas/list.txt | 2 ++ world/map/npc/annuals/xmas/mobmanager.txt | 9 +++++++++ world/map/npc/annuals/xmas/reagents.txt | 4 ++++ 8 files changed, 43 insertions(+), 9 deletions(-) (limited to 'world/map/npc/annuals/xmas') diff --git a/world/map/npc/annuals/xmas/barriers.txt b/world/map/npc/annuals/xmas/barriers.txt index 7db8a472..07bff6f7 100644 --- a/world/map/npc/annuals/xmas/barriers.txt +++ b/world/map/npc/annuals/xmas/barriers.txt @@ -82,6 +82,7 @@ L_NotActive: L_XmasMain: mes "You notice a small creak in the wall, what do you want to do?"; next; + goto L_EnterDialogue; L_EnterDialogue: menu @@ -119,7 +120,6 @@ L_QueryWarp: menu "Yes", L_Warp, "No", L_Close; - goto L_Close; L_Warp: warp "030-2.gat",47,44; diff --git a/world/map/npc/annuals/xmas/config.txt b/world/map/npc/annuals/xmas/config.txt index 4eacec58..e63c07e2 100644 --- a/world/map/npc/annuals/xmas/config.txt +++ b/world/map/npc/annuals/xmas/config.txt @@ -40,6 +40,8 @@ -|script|#XmasConfig|-1, { + end; + OnCommandRestartQuest: goto L_Main; @@ -278,6 +280,7 @@ L_Main: goto L_RewardTime; if((gettime(6) >= $@xmas_start_month) || (gettime(6) <= $@xmas_end_month && gettime(5) <= $@xmas_reward_start_day)) goto L_EventTime; + goto L_NoEventTime; L_NoEventTime: if($XMAS_TIME_KEY[5] < gettime(7)) diff --git a/world/map/npc/annuals/xmas/core.txt b/world/map/npc/annuals/xmas/core.txt index 0f0c53b4..c925b6eb 100644 --- a/world/map/npc/annuals/xmas/core.txt +++ b/world/map/npc/annuals/xmas/core.txt @@ -241,6 +241,7 @@ function|script|XmasCheckOld|, { if(XMASYEAR == $XMAS_TIME_KEY[5]) goto L_Return; + goto L_OldMatch; L_OldMatch: set XMASTIME, 0; diff --git a/world/map/npc/annuals/xmas/debug.txt b/world/map/npc/annuals/xmas/debug.txt index 6bc0f0c2..05d9a1f1 100644 --- a/world/map/npc/annuals/xmas/debug.txt +++ b/world/map/npc/annuals/xmas/debug.txt @@ -174,48 +174,56 @@ L_Close: 030-1.gat,91,48,0|script|XmasDebug#1|105, { callfunc "XmasDebug"; - goto L_end; + goto L_End; OnInit: if(!(debug)) disablenpc "XmasDebug#1"; -L_end: + goto L_End; + +L_End: end; } 030-2.gat,193,62,0|script|XmasDebug#2|105, { callfunc "XmasDebug"; - goto L_end; + goto L_End; OnInit: if(!(debug)) disablenpc "XmasDebug#2"; -L_end: + goto L_End; + +L_End: end; } 030-3.gat,26,26,0|script|XmasDebug#3|105, { callfunc "XmasDebug"; - goto L_end; + goto L_End; OnInit: if(!(debug)) disablenpc "XmasDebug#3"; -L_end: + goto L_End; + +L_End: end; } 030-4.gat,30,30,0|script|XmasDebug#4|111, { callfunc "XmasDebug"; - goto L_end; + goto L_End; OnInit: if(!(debug)) disablenpc "XmasDebug#4"; -L_end: + goto L_End; + +L_End: end; } @@ -226,6 +234,7 @@ botcheck.gat,26,28,0|script|XmasDebug#5|105, goto L_End; callfunc "XmasDebug"; + goto L_End; L_End: end; @@ -234,8 +243,13 @@ L_End: 020-1.gat,86,76,0|script|XmasDebug#6|105, { callfunc "XmasDebug"; + goto L_End; OnInit: if(!(debug)) disablenpc "XmasDebug#6"; + goto L_End; + +L_End: + end; } diff --git a/world/map/npc/annuals/xmas/helpers.txt b/world/map/npc/annuals/xmas/helpers.txt index 57e535b5..eeb8c50c 100644 --- a/world/map/npc/annuals/xmas/helpers.txt +++ b/world/map/npc/annuals/xmas/helpers.txt @@ -9,6 +9,7 @@ function|script|XmasHelperPoints|, set @xmas_helper_loop, 0; if((@xmas_helper_done_state) || !(@xmas_helper_start_state)) goto L_Return; + goto L_Loop; L_Loop: if(XMASTIME & $@xmas_helper_list[@xmas_helper_loop]) diff --git a/world/map/npc/annuals/xmas/list.txt b/world/map/npc/annuals/xmas/list.txt index c6adf4b6..94dc4b23 100644 --- a/world/map/npc/annuals/xmas/list.txt +++ b/world/map/npc/annuals/xmas/list.txt @@ -9,6 +9,7 @@ function|script|XmasCheckList|, if((@xmas_list_deliver) || !(@xmas_list_gather)) goto L_Return; + goto L_Loop; L_Loop: if(XMASTIME & $@xmas_child_list[@xmas_list_loop]) @@ -82,6 +83,7 @@ function|script|XmasListList|, { set @xmas_list_loop, 0; set @xmas_child_loop, 0; + goto L_Loop; L_Loop: set @xmas_child_loop, ($@xmas_child_list[@xmas_list_loop]); diff --git a/world/map/npc/annuals/xmas/mobmanager.txt b/world/map/npc/annuals/xmas/mobmanager.txt index c8156783..71393290 100644 --- a/world/map/npc/annuals/xmas/mobmanager.txt +++ b/world/map/npc/annuals/xmas/mobmanager.txt @@ -2,6 +2,7 @@ 019-1.gat,0,0,0|script|XmasSpawnManager|400, { + end; OnCommandSpawnStart: if ($@xmas_spawn_started) @@ -55,6 +56,8 @@ L_End: 019-1.gat,0,0,0|script|XmasSpawnCounter#0|400, { + end; + OnTally: cmdothernpc "XmasSpawnManager", "Tally"; end; @@ -62,6 +65,8 @@ OnTally: 019-3.gat,0,0,0|script|XmasSpawnCounter#1|400, { + end; + OnTally: cmdothernpc "XmasSpawnManager", "Tally"; end; @@ -69,6 +74,8 @@ OnTally: 030-1.gat,0,0,0|script|XmasSpawnCounter#2|400, { + end; + OnTally: cmdothernpc "XmasSpawnManager", "Tally"; end; @@ -76,6 +83,8 @@ OnTally: 030-3.gat,0,0,0|script|XmasSpawnCounter#3|400, { + end; + OnTally: cmdothernpc "XmasSpawnManager", "Tally"; end; diff --git a/world/map/npc/annuals/xmas/reagents.txt b/world/map/npc/annuals/xmas/reagents.txt index a1dd8d6f..0b4eaa8b 100644 --- a/world/map/npc/annuals/xmas/reagents.txt +++ b/world/map/npc/annuals/xmas/reagents.txt @@ -51,6 +51,7 @@ function|script|DeleteReagents|, L_ZeroLoop: delitem $@xmas_zero_reagents$[@xmas_reagent_loop], $@xmas_zero_reagents_amounts[@xmas_reagent_loop]; + goto L_ZeroLoopAgain; L_ZeroLoopAgain: if((@xmas_reagent_loop + 1) == getarraysize($@xmas_zero_reagents$)) @@ -60,6 +61,7 @@ L_ZeroLoopAgain: L_OneLoop: delitem $@xmas_one_reagents$[@xmas_reagent_loop], $@xmas_one_reagents_amounts[@xmas_reagent_loop]; + goto L_OneLoopAgain; L_OneLoopAgain: if((@xmas_reagent_loop + 1) == getarraysize($@xmas_one_reagents$)) @@ -84,6 +86,7 @@ function|script|ListReagents|, L_ZeroLoop: mes "\"" + $@xmas_zero_reagents_amounts[@xmas_reagent_loop] + " " + $@xmas_zero_reagents_names$[@xmas_reagent_loop] + "\""; next; + goto L_ZeroLoopAgain; L_ZeroLoopAgain: if((@xmas_reagent_loop + 1) == getarraysize($@xmas_zero_reagents$)) @@ -94,6 +97,7 @@ L_ZeroLoopAgain: L_OneLoop: mes "\"" + $@xmas_one_reagents_amounts[@xmas_reagent_loop] + " " + $@xmas_one_reagents_names$[@xmas_reagent_loop] + "\""; next; + goto L_OneLoopAgain; L_OneLoopAgain: if((@xmas_reagent_loop + 1) == getarraysize($@xmas_one_reagents$)) -- cgit v1.2.3-60-g2f50