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/doomsday.txt194
1 files changed, 150 insertions, 44 deletions
diff --git a/world/map/npc/functions/doomsday.txt b/world/map/npc/functions/doomsday.txt
index 641bd6b0..365f6b50 100644
--- a/world/map/npc/functions/doomsday.txt
+++ b/world/map/npc/functions/doomsday.txt
@@ -29,6 +29,7 @@ function|script|DoomsdayDebug
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 "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");
@@ -46,6 +47,7 @@ function|script|DoomsdayDebug
"[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,
@@ -88,6 +90,12 @@ L_War:
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";
@@ -350,6 +358,26 @@ L_Doomsday3:
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, 44, 62, 63, 56, 70, 36, 62, 85;
+ if ($@DoomsdayLoc == 2)
+ setarray $@DD_YPOS, 55, 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;
@@ -399,6 +427,23 @@ L_DDAdvanceTimers2:
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/6;
+ 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
@@ -406,8 +451,17 @@ 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;
@@ -578,24 +632,6 @@ L_DD3FirstThird:
if ($@DD_UNITS < 0)
goto L_DD3EndThird;
- // 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, 44, 62, 63, 56, 70, 36, 62, 85;
- if ($@DoomsdayLoc == 2)
- setarray $@DD_YPOS, 55, 49, 61, 83, 41, 37, 26, 30;
-
// Prepare optional boss
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
@@ -620,24 +656,6 @@ L_DD3SecondThird:
// 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);
- // 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, 44, 62, 63, 56, 70, 36, 62, 85;
- if ($@DoomsdayLoc == 2)
- setarray $@DD_YPOS, 55, 49, 61, 83, 41, 37, 26, 30;
-
// Prepare optional boss
set $@DD_IDX1, rand(getarraysize($@DD_XPOS));
set $@DD_IDX2, rand(getarraysize($@doomsday_boss));
@@ -660,8 +678,6 @@ L_DD3EndThird:
set $@DD_IDX1, 0;
set $@DD_IDX2, 0;
set $@DD_INT, 0;
- cleararray $@DD_XPOS, 0, 8;
- cleararray $@DD_YPOS, 0, 8;
end;
@@ -712,6 +728,8 @@ L_Doomsday3Cleanup:
set $@DoomsdayLoc, 0;
set $@DoomsdayMc, 0;
set $@DD_LOC$, "";
+ cleararray $@DD_XPOS, 0, 8;
+ cleararray $@DD_YPOS, 0, 8;
end;
// Bonus spawn
@@ -723,15 +741,18 @@ L_Doomsday3Bonus:
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;
+ 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;
+ 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;
+ 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;
+ 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));
@@ -747,6 +768,64 @@ L_Doomsday3Bonus:
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;
+ 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;
+
////////////////////////////////////////////////////////////////////////////////
// Respawn logic (5 minutes)
OnTimer100000:
@@ -783,13 +862,22 @@ OnClock1750:
OnClock1800:
if ($@DOOMSDAY_SKIP)
- goto L_Doomsday3Skip;
+ 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;
@@ -804,12 +892,21 @@ OnClock2350:
OnClock0000:
if ($@DOOMSDAY_SKIP)
- goto L_Doomsday3Skip;
+ 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;
@@ -831,6 +928,15 @@ OnDeathMapname:
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