diff options
-rw-r--r-- | npc/006-1/crazyfefe.txt | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/npc/006-1/crazyfefe.txt b/npc/006-1/crazyfefe.txt index fffbaec9c..106c98e52 100644 --- a/npc/006-1/crazyfefe.txt +++ b/npc/006-1/crazyfefe.txt @@ -25,6 +25,8 @@ function aboutCandor; function StartFight; function CleanUp; + function CaveLogic; + function NextRound; // Battle already begun if ($@FEFE_WAVE) @@ -154,6 +156,7 @@ function StartFight { } $@FEFE_CAVE_LEVEL = 1; + $@FEFE_WAVE = 0; $@FEFE_DELAY = gettimetick(2)+.delay; $@FEFE_CAVE_PLAYER_COUNT = getmapusers("006-1"); mapannounce("006-1", "The battle is about to begin!", bc_map); @@ -171,16 +174,17 @@ function StartFight { // Recalc difficulty OnSumLevel: if (ispcdead()) end; - $@FEFE_DIFFICULTY+=BaseLevel; end; + $@FEFE_DIFFICULTY+=BaseLevel; + end; // Check if we're ready for next wave. Otherwise, do this check again after 5 seconds. -L_CaveLogic: +function CaveLogic { .wtime+=5; // This is looped every 5 s $@FEFE_CAVE_PLAYER_COUNT = getmapusers("006-1"); // New wave condition: All mobs dead, or 5 minutes have passed if (mobcount("006-1", "Crazyfefe::OnPetDeath") <= 0 || .wtime >= 240) - goto L_NextRound; + NextRound(); // Victory conditions: Too few players are alive OR twenty minutes went on. // WARNING, dead players still in cave are counted, we might never finish the fight. @@ -196,8 +200,9 @@ L_CaveLogic: // reset timer initnpctimer; end; +} -L_NextRound: +function NextRound { .wtime=0; $@FEFE_WAVE = $@FEFE_WAVE + 1; // Prepare next round, and reward survivors @@ -207,10 +212,7 @@ L_NextRound: areatimer "006-1", 20, 20, 70, 60, 10, "Crazyfefe::OnReward"; mapannounce "006-1", "The wave nÂș "+$@FEFE_WAVE+" is starting with " + $@FEFE_CAVE_PLAYER_COUNT + " player(s) left alive." , 0; - goto L_Summon; -// TODO -L_Summon: .@amount=($@FEFE_CAVE_LEVEL/rand(4,6))+1; freeloop(true); for (.@i = 0; .@i < .@amount; ++.@i) { @@ -268,6 +270,7 @@ L_Summon: freeloop(false); initnpctimer; end; +} function CleanUp { mapannounce "006-1", "Game over! Who will be the next to fall on Crazyfefe's Cave?", 0; @@ -318,7 +321,7 @@ OnReward: // Every 5 seconds, handle cave, if fighting. Does nothing when waiting. OnTimer5000: if ($@FEFE_CAVE_LEVEL) - goto L_CaveLogic; + CaveLogic(); end; // Announces and attempts to start the fight once time run out |