From 462c9dc750807e2edec0e219157204d86e231f48 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 10 Jun 2019 13:36:47 -0300 Subject: Reorder Cindy's script to improve how easy to read it is --- npc/021-4/main.txt | 72 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'npc/021-4') diff --git a/npc/021-4/main.txt b/npc/021-4/main.txt index 6fe7c0237..5fe28cd8e 100644 --- a/npc/021-4/main.txt +++ b/npc/021-4/main.txt @@ -109,28 +109,6 @@ OnInit: } hello; end; - -// Edge Cases -L_Cheat: - warp "Save", 0, 0; atcommand "@jail "+strcharinfo(0); dispbottom l("Cheater detected."); - end; - -L_Reset: - if ($@CINDY_HERO$ == strcharinfo(0)) { - goto L_Winner; - } else if (is_gm() && $@GM_OVERRIDE) { - $@CINDY_STATE=0; - npctalk l("*beeep*"); - } - end; - -// Timeout -OnReckless: -L_Reckless: - kamibroadcast("People failed to rescue Cindy!"); - areatimer "021-4", 20, 20, 100, 80, 10, "Cindy#Outside::OnFail"; - goto L_CleanUp; - // Start L_Start: mesn; @@ -167,6 +145,31 @@ L_Begin: monster "021-4", 66, 49, "Yeti", Yeti, 1, "Cindy#Outside::OnPetDeath"; close; +// Special use-case +L_Reset: + if ($@CINDY_HERO$ == strcharinfo(0)) { + goto L_Winner; + } else if (is_gm() && $@GM_OVERRIDE) { + $@CINDY_STATE=0; + npctalk l("*beeep*"); + } + end; + +// For all players finishing the quest +OnReward: + if (ispcdead()) { + recovery(getcharid(3)); + warp "Save", 0, 0; + end; + } + if ($@CINDY_HERO$ == strcharinfo(0)) + dispbottom l("Congratulations on rescuing Cindy. You should now talk to her before leaving."); + else + dispbottom l("Congratulations on rescuing Cindy."); + setq2 NivalisQuest_Cindy, getq2(NivalisQuest_Cindy)+1; + getexp 10000, JobLevel; + end; + // Winner Reward L_Winner: mesn; @@ -213,26 +216,25 @@ L_Winner: OnPetDeath: end; +// Cast against all players on defeat OnFail: percentheal -100, -100; heal -1, -1; end; -// For all players finishing the quest -OnReward: - if (ispcdead()) { - recovery(getcharid(3)); - warp "Save", 0, 0; - end; - } - if ($@CINDY_HERO$ == strcharinfo(0)) - dispbottom l("Congratulations on rescuing Cindy. You should now talk to her before leaving."); - else - dispbottom l("Congratulations on rescuing Cindy."); - setq2 NivalisQuest_Cindy, getq2(NivalisQuest_Cindy)+1; - getexp 10000, JobLevel; +// Edge Cases +L_Cheat: + warp "Save", 0, 0; atcommand "@jail "+strcharinfo(0); dispbottom l("Cheater detected."); end; +// Timeout +OnReckless: +L_Reckless: + kamibroadcast("People failed to rescue Cindy!"); + areatimer "021-4", 20, 20, 100, 80, 10, "Cindy#Outside::OnFail"; + goto L_CleanUp; + +// Event is over, clean up the mess the players left OnCleanUp: L_CleanUp: .lifetime=0; -- cgit v1.2.3-60-g2f50