diff options
author | Jesusaves <jesusalva@themanaworld.org> | 2020-04-13 04:52:44 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 07:52:44 +0000 |
commit | d0ce35ecaa36c2908070645bfa6d616fffbc7030 (patch) | |
tree | 19d13ba8490218964ee7ef0e863024289b2038bd | |
parent | 59919f9f1b0f47fde4248746cf78ba8a7d843d2b (diff) | |
download | classic-serverdata-d0ce35ecaa36c2908070645bfa6d616fffbc7030.tar.gz classic-serverdata-d0ce35ecaa36c2908070645bfa6d616fffbc7030.tar.bz2 classic-serverdata-d0ce35ecaa36c2908070645bfa6d616fffbc7030.tar.xz classic-serverdata-d0ce35ecaa36c2908070645bfa6d616fffbc7030.zip |
Doomsday 3 Additional Patches (#553)
The core I've wrote was too primitive and was not be able to handle the heat of TMW playerbase.
This new one is more sturdy, more flexible, more scalable.
It also redefines the siege rules, logic and mechanics after a few sieges, and spawn amounts is based on players around and number of victories.
Should be much more fun than the previous core.
* Add two new monsters for Doomsday Act 3: Flashmob and Koyntety.
Both are "boss" which Kage may use at their own whim.
72000 experience, 27k HP, one attacks and walks fast, other is ranged high DPS.
Drops:
Chocolate Bar: 100.00%
Enchanter Amulet: 0.35%
Black Evoker Robe: 0.05%
White Evoker Robe: 0.05%
Apprentice Robe: 0.05%
Flawed Lens: 0.02%
Paladin's Helmet: 0.02%
A siege may contain only two boss at most. The time fastforward is still in effect.
Spawn stage last 25 minutes in total, overrun is checked 45 minutes later.
This means players have 20 minutes after siege spawns are concluded to clean
up the area. More players cause more difficult sieges, but beware:
This primitive difficulty barment logic is the opposite!
Every 1.5 siege victories (=a whole day), it expects +1 player in combat.
-rw-r--r-- | world/map/db/mob_db_over_100.txt | 18 | ||||
-rw-r--r-- | world/map/npc/functions/doomsday.txt | 234 |
2 files changed, 193 insertions, 59 deletions
diff --git a/world/map/db/mob_db_over_100.txt b/world/map/db/mob_db_over_100.txt index 886efb4b..fdde9a60 100644 --- a/world/map/db/mob_db_over_100.txt +++ b/world/map/db/mob_db_over_100.txt @@ -41,11 +41,13 @@ 1136, LesserGhost, LesserGhost, 1, 1, 0, 1, 1, 0, 150, 300, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 1, 29, 131, 340, 1800, 672, 950, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 20 1137, Tormenta, Tormenta, 200, 18000, 60, 500000, 5000, 5, 360, 374, 48, 90, 1, 32, 60, 255, 255, 255, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 //ID, Name, Jname, LV, HP, SP, EXP, JEXP, Range1, ATK1, ATK2, DEF, MDEF, STR, AGI, VIT, INT, DEX, LUK, Range2, Range3, Scale, Race, Element,Mode, Speed, Adelay, Amotion,Dmotion,Drop1id,Drop1per,Drop2id,Drop2%, Drop3id,Drop3%, Drop4id,Drop4%, Drop5id,Drop5%, Drop6id,Drop6%, Drop7id,Drop7%, Drop8id,Drop8%, Item1, Item2, MEXP, ExpPer, MVP1id, MVP1per,MVP2id, MVP2per,MVP3id, MVP3per,mutationcount,mutationstrength -1138, ManaGuard, ManaGuardian, 180, 20000, 280, 27000, 5000, 2, 280, 324, 22, 67, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 759, 1, 5237, 20, 1253, 5, 720, 100, 825, 500, 868, 20, 1172, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1139, Virus, Virus, 170, 5000, 0, 0, 721, 6, 45, 75, 37, 12, 30, 30, 20, 20, 25, 60, 1, 1, 1, 3, 25, 175, 600, 1872, 672, 480, 787, 500, 743, 1100, 5236, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 20 -1140, Tengu, Tengu, 180, 24000, 280, 45000, 5000, 2, 180, 224, 67, 9, 31, 22, 90, 97, 255, 95, 31, 30, 1, 0, 69, 181, 310, 1200, 672, 50, 649, 2, 4024, 300, 862, 800, 4005, 25, 1227, 15, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1141, Sasquatch, Sasquatch, 180, 24000, 280, 45000, 5000, 1, 420, 444, 12, 27, 31, 22, 90, 97, 255, 95, 31, 30, 1, 0, 69, 181, 310, 1200, 672, 50, 653, 2, 763, 500, 862, 800, 640, 1000, 1227, 15, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1142, Kage, ZaxDeKagen, 200, 29999, 280, 999999, 99999, 9, 90, 124, 62, 100, 199, 2, 199, 197, 255, 95, 31, 30, 1, 0, 69, 181, 210, 672, 672, 50, 760, 10000, 666, 10000, 1244, 10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1143, ManaSlayer, ManaSlayer, 180, 24000, 280, 42000, 5000, 2, 260, 274, 22, 67, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 650, 2, 828, 2400, 1227, 15, 4007, 35, 4029, 10, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1144, Dragon, GreatDragon, 250, 29999, 280, 1, 1, 3, 60, 90, 40, 40, 199, 2, 199, 197, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 759, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -1145, KageSlayer, KageSlayer, 180, 8000, 280, 38000, 5000, 6, 140, 174, 74, 0, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1000, 672, 50, 584, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1138, ManaGuard, ManaGuardian, 180, 20000, 280, 27000, 5000, 2, 280, 324, 22, 67, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 759, 1, 5237, 20, 1253, 5, 720, 100, 825, 500, 868, 20, 1172, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1139, Virus, Virus, 170, 5000, 0, 0, 721, 6, 45, 75, 37, 12, 30, 30, 20, 20, 25, 60, 1, 1, 1, 3, 25, 175, 600, 1872, 672, 480, 787, 500, 743, 1100, 5236, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 20 +1140, Tengu, Tengu, 180, 24000, 280, 45000, 5000, 2, 180, 224, 67, 9, 31, 22, 90, 97, 255, 95, 31, 30, 1, 0, 69, 181, 310, 1200, 672, 50, 649, 2, 4024, 300, 862, 800, 4005, 25, 1227, 15, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1141, Sasquatch, Sasquatch, 180, 24000, 280, 45000, 5000, 1, 420, 444, 12, 27, 31, 22, 90, 97, 255, 95, 31, 30, 1, 0, 69, 181, 310, 1200, 672, 50, 653, 2, 763, 500, 862, 800, 640, 1000, 1227, 15, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1142, Kage, ZaxDeKagen, 200, 29999, 280, 999999, 99999, 9, 90, 124, 69, 100, 199, 2, 199, 197, 255, 95, 31, 30, 1, 0, 69, 181, 210, 672, 672, 50, 760, 10000, 666, 10000, 1244, 10000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1143, ManaSlayer, ManaSlayer, 180, 24000, 280, 42000, 5000, 2, 260, 274, 22, 67, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 650, 2, 828, 2400, 1227, 15, 4007, 35, 4029, 10, 5237, 20, 758, 3, 825, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1144, Dragon, GreatDragon, 250, 29999, 280, 1, 1, 3, 60, 90, 67, 67, 199, 2, 199, 197, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1200, 672, 50, 759, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1145, KageSlayer, KageSlayer, 180, 8000, 280, 38000, 5000, 6, 140, 174, 74, 0, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 210, 1000, 672, 50, 584, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1146, Flashmob, Flashmob, 181, 27000, 280, 72000, 5000, 1, 40, 60, 57, 57, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 160, 600, 672, 50, 649, 5, 650, 5, 653, 5, 1227, 35, 509, 10000, 1257, 2, 759, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1147, Koyntety, Koyntety, 181, 27000, 280, 72000, 5000, 4, 220, 240, 52, 52, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 240, 1400, 672, 50, 649, 5, 650, 5, 653, 5, 1227, 35, 509, 10000, 1257, 2, 759, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/world/map/npc/functions/doomsday.txt b/world/map/npc/functions/doomsday.txt index 7bd6fa9c..641bd6b0 100644 --- a/world/map/npc/functions/doomsday.txt +++ b/world/map/npc/functions/doomsday.txt @@ -199,6 +199,7 @@ OnJanitor: // Check for our current doomsday state OnInit: setarray $@doomsday_mobs, 1140, 1141, 1143, 1140, 1141, 1143, 1140, 1141, 1143; + setarray $@doomsday_boss, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147, 1146, 1147; if ($DOOMSDAY == 1) goto L_Doomsday1; if ($DOOMSDAY == 2) @@ -365,6 +366,10 @@ L_DDAdvanceWave: if ($@DD_NUMWAVES > 6) end; // TODO: Maybe a final wave announcement? + // Variable initialization + set $@DD_INT, 0; + set $@DD_UNITS, getmapusers($@DD_LOC$)+$DOOMSDAY_SCORE; + // Spawns if ($@DoomsdayLoc == 0) goto L_DD3Tulim; @@ -386,7 +391,14 @@ L_DDAdvanceTimers: // If we have more users than possible, waves come faster L_DDAdvanceTimers2: - setnpctimer (($@DD_UNITS*2-$@DD_INT)*500); // ±1 second per player + set $@ADD_TIME, (($@DD_UNITS*2-$@DD_INT)*500); // ±1 second per player/victory + // Cap to 90s (to prevent skipping first third) + if ($@ADD_TIME > 90000) + set $@ADD_TIME, 90000; + + setnpctimer $@ADD_TIME; + + set $@ADD_TIME, 0; goto L_DDAdvanceWavePost; // Clear temporary variables and broadcast @@ -403,46 +415,43 @@ L_DDAdvanceWavePost: // Tulimshar Siege points L_DD3Tulim: - set $@DD_INT, 0; - set $@DD_UNITS, getmapusers($@DD_LOC$); - // Compulsory spawns - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 98, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; // Non-compulsory spawns if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 91, 99, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 75, 104, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 56, 81, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 44, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 76, 76, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 54, 96, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; @@ -453,46 +462,43 @@ L_DD3Tulim: // Hurnscald Siege points L_DD3Hurns: - set $@DD_INT, 0; - set $@DD_UNITS, getmapusers($@DD_LOC$); - // Compulsory spawns - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 138, 63, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; // Non-compulsory spawns if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 133, 79, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 111, 74, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 94, 75, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 79, 64, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 67, 82, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 88, 90, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; @@ -503,46 +509,43 @@ L_DD3Hurns: // Nivalis Siege points L_DD3Nival: - set $@DD_INT, 0; - set $@DD_UNITS, getmapusers($@DD_LOC$); - // Compulsory spawns - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 44, 55, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; // Non-compulsory spawns if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 63, 61, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 56, 83, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 70, 41, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 36, 37, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 62, 26, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; if ($@DD_INT >= $@DD_UNITS*2) goto L_DDAdvanceTimers; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 85, 30, "", $@doomsday_mobs[$@DD_IDX], 1, "Doomsday::OnDeathAct3"; set $@DD_INT, $@DD_INT+1; @@ -552,6 +555,117 @@ L_DD3Nival: +// Extra wave control system [0] +S_DD3ThirdSpawns: + set $@DD_IDX1, rand(getarraysize($@DD_XPOS)); + set $@DD_IDX2, rand(getarraysize($@doomsday_mobs)); + + monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_mobs[$@DD_IDX2], 1, "Doomsday::OnDeathAct3"; + + set $@DD_INT, $@DD_INT+1; + if($@DD_INT < $@DD_UNITS) goto S_DD3ThirdSpawns; + return; + +// Extra wave control system [1] +L_DD3FirstThird: + set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1; + set $@DD_INT, 0; + + // Difficulty adjustment: Invoke -1 mob per player and +1 mob per 2 score points + set $@DD_UNITS, $@DD_UNITS-getmapusers($@DD_LOC$)+($DOOMSDAY_SCORE/2); + + // Monsters already overpower players + 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)); + + // Spawn optional boss + if ($@DD_NUMWAVES == 5 && $DOOMSDAY_SCORE > 6) + monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3"; + + // Spawn first third's wave + callsub S_DD3ThirdSpawns; + goto L_DD3EndThird; + +// Extra wave control system [2] +L_DD3SecondThird: + set $@DD_UNITS, getmapusers($@DD_LOC$)-mobcount($@DD_LOC$, "Doomsday::OnDeathAct3")+1; + set $@DD_INT, 0; + + // Intensity control + if ($DOOMSDAY_SCORE < 12) + goto L_DD3EndThird; + + // 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)); + + // Spawn optional boss + if ($@DD_NUMWAVES == 5) + monster $@DD_LOC$, $@DD_XPOS[$@DD_IDX1], $@DD_YPOS[$@DD_IDX1], "", $@doomsday_boss[$@DD_IDX2], 1, "Doomsday::OnDeathAct3"; + + // Monsters already overpower players + if ($@DD_UNITS < 0) + goto L_DD3EndThird; + + // Spawn second third's wave + callsub S_DD3ThirdSpawns; + goto L_DD3EndThird; + +// Extra wave control system [3] +L_DD3EndThird: + set $@DD_UNITS, 0; + set $@DD_IDX1, 0; + set $@DD_IDX2, 0; + set $@DD_INT, 0; + cleararray $@DD_XPOS, 0, 8; + cleararray $@DD_YPOS, 0, 8; + end; + + + // Timer controls (5 minutes between waves); // It only fires after first wave L_TimerCheck2: @@ -572,7 +686,7 @@ L_Doomsday3Defeat: mapannounce $@DD_LOC$, "Jande : Oh noes, "+$@DoomsdayMc+" monsters passed the barricate!!", 0; // Move the monsters to town - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); if ($@DoomsdayLoc == 0) areamonster "001-1", 52, 35, 119, 113, "", $@doomsday_mobs[$@DD_IDX], $@DoomsdayMc; if ($@DoomsdayLoc == 1) @@ -587,8 +701,8 @@ L_Doomsday3Defeat: // Siege was cleared up L_Doomsday3Victory: - mapannounce $@DD_LOC$, "Jande : That was a close call, but we did it! We defended "+$DOOMSDAY_SCORE+" times.", 0; set $DOOMSDAY_SCORE, $DOOMSDAY_SCORE+1; + mapannounce $@DD_LOC$, "Jande : That was a close call, but we did it! We defended "+$DOOMSDAY_SCORE+" times.", 0; goto L_Doomsday3Cleanup; // Clean up temporary variables (except skip) @@ -602,31 +716,49 @@ L_Doomsday3Cleanup: // Bonus spawn L_Doomsday3Bonus: - announce "Jande: Stray minions from Zax De'Kagen were sighted all over the world!", 0; + announce "Jande: Stray minions from Zax De'Kagen army were sighted all over the world!", 0; + set $@DD_UNITS, 2+($DOOMSDAY_SCORE/5); - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + // Cap value (to prevent huge spikes) + if ($@DD_UNITS > 5) + set $@DD_UNITS, 3+($DOOMSDAY_SCORE/10); + + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "031-1", 62, 49, "", $@doomsday_mobs[$@DD_IDX], 1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "018-1", 136, 71, "", $@doomsday_mobs[$@DD_IDX], 1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); monster "002-1", 97, 86, "", $@doomsday_mobs[$@DD_IDX], 1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); areamonster "017-1", 169, 49, 198, 77, "", $@doomsday_mobs[$@DD_IDX], 1; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); - areamonster "012-1", 20, 47, 74, 77, "", $@doomsday_mobs[$@DD_IDX], 2; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); - areamonster "057-1", 115, 50, 140, 75, "", $@doomsday_mobs[$@DD_IDX], 2; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); - areamonster "046-1", 58, 49, 92, 70, "", $@doomsday_mobs[$@DD_IDX], 2; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); - areamonster "034-1", 83, 51, 121, 98, "", $@doomsday_mobs[$@DD_IDX], 2; - setarray $@DD_IDX, rand(getarraysize($@doomsday_mobs)); - areamonster "003-4", 20, 20, 85, 60, "", $@doomsday_mobs[$@DD_IDX], 2; + 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)); + areamonster "057-1", 115, 50, 140, 75, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS; + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + areamonster "046-1", 58, 49, 92, 70, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS; + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + areamonster "034-1", 83, 51, 121, 98, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS; + set $@DD_IDX, rand(getarraysize($@doomsday_mobs)); + areamonster "003-4", 20, 20, 85, 60, "", $@doomsday_mobs[$@DD_IDX], $@DD_UNITS; + + set $@DD_UNITS, 0; + set $@DD_IDX, 0; end; //////////////////////////////////////////////////////////////////////////////// // Respawn logic (5 minutes) +OnTimer100000: + if ($DOOMSDAY == 2) + goto L_DD3FirstThird; + end; + +OnTimer200000: + if ($DOOMSDAY == 2) + goto L_DD3SecondThird; + end; + OnTimer300000: if ($DOOMSDAY == 1) goto L_Doomsday1Respawn; |