diff options
Diffstat (limited to 'world/map')
28 files changed, 3267 insertions, 35 deletions
diff --git a/world/map/data/099-1.wlk b/world/map/data/099-1.wlk Binary files differindex 09a2a4bd..9c0dfd80 100644 --- a/world/map/data/099-1.wlk +++ b/world/map/data/099-1.wlk diff --git a/world/map/data/099-3.wlk b/world/map/data/099-3.wlk Binary files differindex e9acd9ea..e2677aa7 100644 --- a/world/map/data/099-3.wlk +++ b/world/map/data/099-3.wlk diff --git a/world/map/data/099-6.wlk b/world/map/data/099-6.wlk Binary files differindex e9acd9ea..beb2d549 100644 --- a/world/map/data/099-6.wlk +++ b/world/map/data/099-6.wlk diff --git a/world/map/data/099-7.wlk b/world/map/data/099-7.wlk Binary files differindex 168f0874..cef306af 100644 --- a/world/map/data/099-7.wlk +++ b/world/map/data/099-7.wlk diff --git a/world/map/db/item_db_generic.txt b/world/map/db/item_db_generic.txt index 42383723..35e8fb01 100644 --- a/world/map/db/item_db_generic.txt +++ b/world/map/db/item_db_generic.txt @@ -249,3 +249,4 @@ 5224, PurpleTicket, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 5225, PinkTicket, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} 5251, WumpusEgg, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} +5256, PVPCoin, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {} diff --git a/world/map/db/item_db_head.txt b/world/map/db/item_db_head.txt index cdcb7fde..e1f6e8ea 100644 --- a/world/map/db/item_db_head.txt +++ b/world/map/db/item_db_head.txt @@ -218,4 +218,5 @@ 5248, OrangeShades, 5, 500, 100, 20, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} 5249, PurpleShades, 5, 500, 100, 20, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} 5250, DarkGreenShades, 5, 500, 100, 20, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} -5255, PVPCap, 5, 500, 100, 20, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} +5255, PVPCap, 5, 500, 100, 60, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} +5257, GoldenPVPCap, 5, 500, 100, 60, 0, 2, 0, 0, 0, 2, 256, 0, 0, 0, {}, {} diff --git a/world/map/db/item_db_use.txt b/world/map/db/item_db_use.txt index 144ee053..0ee4ef0d 100644 --- a/world/map/db/item_db_use.txt +++ b/world/map/db/item_db_use.txt @@ -81,7 +81,7 @@ 1250, Pear, 0, 50, 25, 7, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 150, 0, 1;}, {} 1251, Plum, 0, 50, 25, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 100, 0, 1;}, {} 1252, Cherry, 0, 50, 25, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 50, 0, 1;}, {} -1253, GoldenDeliciousApple, 0, 1000, 500, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 200, 0, 1;}, {} +1253, GoldenDeliciousApple, 0, 1000, 500, 30, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 200, 0, 0;}, {} 1258, Honey, 0, 100, 80, 20, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {heal 45, 0, 1;}, {} 1280, Scissors, 0, 1000, 500, 120, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {callfunc "useScissors";}, {} 1281, ShockSweet, 0, 1000, 500, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, {callfunc "useShockSweet";}, {} diff --git a/world/map/db/mob_db_over_100.txt b/world/map/db/mob_db_over_100.txt index 44720cab..568260e2 100644 --- a/world/map/db/mob_db_over_100.txt +++ b/world/map/db/mob_db_over_100.txt @@ -44,7 +44,7 @@ 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 +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, 74, 100, 199, 2, 199, 197, 255, 175, 31, 30, 1, 0, 69, 181, 210, 672, 672, 50, 668, 10000, 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 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 @@ -54,3 +54,16 @@ 1148, DoomGolem, DoomGolem, 180, 22000, 280, 65000, 2000, 3, 160, 180, 60, 30, 31, 22, 90, 127, 255, 105, 31, 30, 1, 0, 69, 181, 320, 1000, 672, 50, 5253, 4, 666, 30, 537, 800, 779, 150, 780, 150, 777, 70, 1198, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 1149, Enchanter, Enchanter, 181, 19000, 280, 55000, 2000, 8, 140, 180, 30, 60, 31, 22, 90, 127, 255, 105, 31, 30, 1, 0, 69, 181, 240, 800, 672, 50, 1227, 2, 666, 30, 537, 800, 779, 90, 780, 80, 777, 70, 1198, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 1150, ManaTyrant, ManaTyrant, 180, 24000, 280, 27000, 5000, 2, 300, 325, 42, 67, 31, 22, 90, 127, 255, 95, 31, 30, 1, 0, 69, 181, 180, 1050, 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 +//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 +1151, VoidFlower, VoidFlower, 115, 7000, 0, 0, 40, 12, 400, 420, 0, 5, 16, 12, 20, 20, 255, 50, 12, 12, 1, 3, 22, 128, 800, 2000, 672, 180, 535, 100, 540, 10, 1199, 100, 526, 400, 565, 1000, 565, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1152, VoidArchant, VoidArchant, 130, 6000, 0, 0, 14, 1, 140, 180, 36, 6, 10, 5, 1, 0, 12, 10, 1, 1, 1, 0, 25, 133, 800, 1500, 672, 200, 537, 300, 535, 100, 640, 40, 4001, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 40 +1153, VoidSlime, VoidSlime, 135, 4144, 0, 6000, 70, 2, 105, 160, 75, 40, 30, 15, 35, 10, 70, 250, 1, 1, 1, 0, 43, 135, 1100, 1500, 672, 200, 904, 10000, 703, 2500, 640, 1000, 701, 1000, 4001, 1000, 825, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1154, VoidSnake, VoidSnake, 130, 2000, 0, 0, 63, 1, 80, 120, 4, 6, 20, 40, 10, 10, 35, 45, 1, 1, 1, 0, 20, 133, 300, 1500, 672, 200, 532, 20, 641, 350, 715, 400, 715, 400, 711, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 30 +1155, VoidBat, VoidBat, 100, 400, 0, 0, 3, 1, 10, 25, 0, 5, 1, 1, 1, 0, 20, 25, 1, 1, 1, 3, 24, 133, 200, 1872, 672, 480, 505, 800, 501, 150, 518, 400, 533, 150, 521, 70, 522, 1, 753, 3000, 754, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 40 +1156, VoidMaggot, VoidMaggot, 100, 400, 0, 0, 1, 1, 10, 25, 0, 5, 1, 1, 1, 0, 20, 25, 1, 1, 1, 3, 21, 133, 800, 1872, 672, 480, 505, 800, 501, 150, 518, 400, 533, 150, 502, 70, 522, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1157, VoidSoldier, VoidSoldier, 120, 11000, 0, 0, 663, 7, 30, 40, 5, 20, 40, 3, 25, 5, 80, 45, 1, 1, 1, 0, 49, 133, 500, 1200, 672, 300, 779, 210, 780, 210, 698, 200, 631, 1000, 636, 3, 658, 2, 532, 35, 778, 500, 1198, 500, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50 +1158, VoidMouboo, VoidMouboo, 100, 5000, 0, 0, 16, 2, 50, 65, 60, 5, 15, 5, 15, 0, 40, 10, 2, 2, 1, 3, 20, 129, 600, 1872, 672, 480, 660, 1000, 660, 500, 541, 750, 660, 50, 806, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 30 +1159, VoidScorpion, VoidScorpion, 110, 6000, 0, 0, 37, 1, 60, 90, 4, 6, 16, 30, 10, 10, 35, 10, 1, 1, 1, 0, 20, 133, 700, 1600, 672, 480, 523, 150, 509, 100, 518, 800, 709, 800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1160, VoidShroom, VoidShroom, 110, 5500, 0, 0, 30, 3, 70, 80, 4, 4, 16, 12, 10, 10, 35, 10, 1, 1, 1, 3, 22, 133, 550, 1600, 672, 480, 613, 600, 4007, 50, 567, 100, 566, 1000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +1161, Xakelbael, Xakelbael, 200, 29999, 280, 999999, 99999, 9, 90, 124, 74, 100, 199, 2, 199, 197, 255, 175, 31, 30, 1, 0, 69, 181, 210, 672, 672, 50, 668, 10000, 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 + diff --git a/world/map/npc/099-1/_import.txt b/world/map/npc/099-1/_import.txt index 88869c9f..ef844283 100644 --- a/world/map/npc/099-1/_import.txt +++ b/world/map/npc/099-1/_import.txt @@ -1,6 +1,7 @@ -// Map 099-1: Nu'Ram-Main +// Map 099-1: Keshlam's Adventurer's Guild // This file is generated automatically. All manually added changes will be removed when running the Converter. map: 099-1 npc: npc/099-1/_mobs.txt npc: npc/099-1/_nodes.txt npc: npc/099-1/_warps.txt +npc: npc/099-1/main.txt diff --git a/world/map/npc/099-1/_warps.txt b/world/map/npc/099-1/_warps.txt index cc8f6e07..a7943182 100644 --- a/world/map/npc/099-1/_warps.txt +++ b/world/map/npc/099-1/_warps.txt @@ -1,5 +1,5 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. -// Nu'Ram-Main warps +// Keshlam's Adventurer's Guild warps 099-1,29,16|warp|-1,-1,099-2,25,22 099-1,77,16|warp|-1,-1,099-2,59,21 @@ -35,3 +35,34 @@ 099-1,15,67|warp|-1,-1,099-3,103,63 099-1,19,93|warp|-1,-1,099-3,109,63 099-1,57,51|warp|-1,-1,099-3,115,63 +099-1,128,44|warp|-1,-1,099-1,35,30 +099-1,21,16|warp|-1,-1,099-6,121,132 +099-1,39,16|warp|-1,-1,099-1,35,30 +099-1,58,16|warp|-1,-1,099-6,92,132 +099-1,67,16|warp|-1,-1,099-1,35,30 +099-1,85,16|warp|-1,-1,099-6,59,21 +099-1,97,8|warp|-1,-1,099-1,35,30 +099-1,97,31|warp|-1,-1,099-6,26,132 +099-1,104,31|warp|-1,-1,099-6,90,21 +099-1,108,24|warp|-1,-1,099-6,121,101 +099-1,99,44|warp|-1,-1,099-1,35,30 +099-1,82,44|warp|-1,-1,099-6,91,101 +099-1,82,25|warp|-1,-1,099-1,35,30 +099-1,69,25|warp|-1,-1,099-6,60,132 +099-1,95,61|warp|-1,-1,099-6,60,101 +099-1,78,58|warp|-1,-1,099-6,25,22 +099-1,66,58|warp|-1,-1,099-6,25,101 +099-1,105,61|warp|-1,-1,099-1,35,30 +099-1,50,51|warp|-1,-1,099-1,35,30 +099-1,34,51|warp|-1,-1,099-6,121,75 +099-1,27,51|warp|-1,-1,099-6,91,75 +099-1,25,77|warp|-1,-1,099-6,59,75 +099-1,40,104|warp|-1,-1,099-6,25,75 +099-1,29,115|warp|-1,-1,099-1,35,30 +099-1,29,136|warp|-1,-1,099-6,121,48 +099-1,58,129|warp|-1,-1,099-6,91,49 +099-1,84,114|warp|-1,-1,099-6,59,49 +099-1,125,126|warp|-1,-1,099-1,35,30 +099-1,83,105|warp|-1,-1,099-6,25,49 +099-1,88,85|warp|-1,-1,099-1,35,30 +099-1,79,72|warp|-1,-1,099-6,121,21 diff --git a/world/map/npc/099-1/main.txt b/world/map/npc/099-1/main.txt new file mode 100644 index 00000000..0508cdfe --- /dev/null +++ b/world/map/npc/099-1/main.txt @@ -0,0 +1,278 @@ +// Evol script +// Author: +// Jesusalva +// Description: +// 099-1 and 099-3 KESHLAM ADVENTURER GUILD MAIN CHAMBERS +// Controls gates and introduction +///////////////////////////////////////////////////////////////////////////////// + +099-1,35,28,0|script|Note#DD5Core|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: Keshlam's Adventurer Guild ::."; + mes ""; + mes "Welcome to the Adventurers Guild!"; + mes "Sorry I could not wait for you. It's your fault for being late."; + next; + mes "So, it has been a long time since you were here."; + mes "I hope you still remember the directions?"; + mes "Hahaha! There is a lot of fake rooms in this building."; + next; + mes "You should have known me for long enough to know I do not take chances."; + mes "I've put the docks where I'm waiting for you in an overlapping dimension."; + mes "This should be enough to stop any Sparron who makes back to here."; + next; + mes "My dimension, my rules."; + mes "I've set a rule that anything dying here should not respawn."; + mes "I'm not sure if it'll work, but I did enough tests on that."; + next; + mes "In case you forgot, this is an, *ahem*, \"deleted\" dimension."; + mes "You'll see notes from the adventurers who used to inhabit here."; + mes "Maybe you even find something which used to belong to them?"; + next; + mes "I'm sure they tried to write down possible ways to stop me."; + mes "I do not like them, so if you find anything which belong to them..."; + mes "...Well, you're free to take it."; + next; + mes "I've stationed a guard here and there, to stop intruders."; + mes "Use invisibility magic if you need to go past them."; + mes "I'll talk to you later. Do not leave me waiting!"; + next; + mes "Signed,"; + mes "Xakelbael the Dark"; + close; +} + +099-3,69,38,0|script|Ritual Book#099-31|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: Ritual Book ::."; + mes ""; + mes "In this maze, sixteen numeric passwords lie."; + mes "All sixteen passwords must be chanted in their sequence."; + mes ""; + mes "Chanting can be done on the book at right."; + mes "##9Only one player may chant all passwords."; + mes "##9No reward is provided."; + mes "##9If you get a number wrong, you'll be penalized!"; + close; +} + +099-3,75,38,0|script|Ritual Book#099-32|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + if ($@DD5_OPENSESAME) goto L_Complete; + + mes ".:: Ritual Book ::."; + mes "Perform the ritual?"; + next; + menu + "Yes", L_RB_0, + "No", L_Close; + +L_RB_0: + mes "Say the password - ##B NULL##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[0]) goto L_Failure; + goto L_RB_1; + +L_RB_1: + mes "Say the password - ##B EIN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[1]) goto L_Failure; + goto L_RB_2; + +L_RB_2: + mes "Say the password - ##B ZWEI##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[2]) goto L_Failure; + goto L_RB_3; + +L_RB_3: + mes "Say the password - ##B DREI##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[3]) goto L_Failure; + goto L_RB_4; + +L_RB_4: + mes "Say the password - ##B VIER##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[4]) goto L_Failure; + goto L_RB_5; + +L_RB_5: + mes "Say the password - ##B FUNF##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[5]) goto L_Failure; + goto L_RB_6; + +L_RB_6: + mes "Say the password - ##B SECHS##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[6]) goto L_Failure; + goto L_RB_7; + +L_RB_7: + mes "Say the password - ##B SIEBEN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[7]) goto L_Failure; + goto L_RB_8; + +L_RB_8: + mes "Say the password - ##B ACHT##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[8]) goto L_Failure; + goto L_RB_9; + +L_RB_9: + mes "Say the password - ##B NEUN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[9]) goto L_Failure; + goto L_RB_10; + +L_RB_10: + mes "Say the password - ##B ZEHN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[10]) goto L_Failure; + goto L_RB_11; + +L_RB_11: + mes "Say the password - ##B ELF##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[11]) goto L_Failure; + goto L_RB_12; + +L_RB_12: + mes "Say the password - ##B ZWOLF##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[12]) goto L_Failure; + goto L_RB_13; + +L_RB_13: + mes "Say the password - ##B DREIZEHN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[13]) goto L_Failure; + goto L_RB_14; + +L_RB_14: + mes "Say the password - ##B VIERZEHN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[14]) goto L_Failure; + goto L_RB_15; + +L_RB_15: + mes "Say the password - ##B FUNFZEHN##b"; + input @pass; + + if (@pass != $@DD5_PASSWORDS[15]) goto L_Failure; + goto L_Success; + +L_Failure: + mes "##1THAT WAS WRONG!"; + mes "##1THE RITUAL BACKFIRES!"; + set Hp, 1; + warp "099-1", 0, 0; + close; + +L_Success: + set $@DD5_OPENSESAME, 1; + mes ".:: Ritual Book ::."; + mes "The portal magic is now active."; + close; + +L_Complete: + mes ".:: Ritual Book ::."; + mes "The ritual was already performed."; + close; + +L_Close: + close; +} + +099-3,72,75,0|script|#WarpToFinalShowdown|424,0,0 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if ($@DD5_TSWITCH != 18) + goto L_NotSwitch; + + if (!$@DD5_OPENSESAME) + goto L_NotSesame; + + mes "Walk here to go to the ##BFinal Showdown##b."; + mes ""; + mes "##1##BWARNING:##b##0 Come prepared!"; + close; + +L_NotSwitch: + mes "All 18 switches must be flipped in order to this warp to work!"; + close; + +L_NotSesame: + mes "The ritual need to be performed to use this warp!"; + close; + +L_Busy: + mes "This warp cannot be used while players are on the other side!"; + close; + +OnTouch: + if ($DOOMSDAY_VANILLA) + goto L_Menu; + + if ($@DD5_TSWITCH != 18) + goto L_NotSwitch; + + if (!$@DD5_OPENSESAME) + goto L_NotSesame; + + goto L_Menu; + +L_Menu: + if ($@DD5_STATUS > 1) + goto L_Busy; + + mes "##BGo to the final showdown?##b"; + mes "You cannot return from there!"; + mes ""; + mes "##1Warning: Warp will be unavailable during fights!"; + if (GM < GM_SYSOP) + close; + + menu + "Yes", L_Yes, + "No", L_No; +L_No: + close; +L_Yes: + warp "099-5", 50, 66; + if (!$@DD5_STATUS) + donpcevent "#TMWFinalExam::OnWarn0"; + close; +} + diff --git a/world/map/npc/099-2/_import.txt b/world/map/npc/099-2/_import.txt index 16a3081c..a60bbc10 100644 --- a/world/map/npc/099-2/_import.txt +++ b/world/map/npc/099-2/_import.txt @@ -1,6 +1,7 @@ -// Map 099-2: Nu'RamRooms +// Map 099-2: Keshlam's Adventurer's Guild Quarters // This file is generated automatically. All manually added changes will be removed when running the Converter. map: 099-2 npc: npc/099-2/_mobs.txt npc: npc/099-2/_nodes.txt npc: npc/099-2/_warps.txt +npc: npc/099-2/logic.txt diff --git a/world/map/npc/099-2/_warps.txt b/world/map/npc/099-2/_warps.txt index 676f6f2f..6d824836 100644 --- a/world/map/npc/099-2/_warps.txt +++ b/world/map/npc/099-2/_warps.txt @@ -1,23 +1,23 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. -// Nu'RamRooms warps +// Keshlam's Adventurer's Guild Quarters warps -099-1,25,23|warp|-1,-1,099-1,29,17 -099-1,59,22|warp|-1,-1,099-1,77,17 -099-1,90,22|warp|-1,-1,099-1,105,9 -099-1,121,22|warp|-1,-1,099-1,91,137 -099-1,25,50|warp|-1,-1,099-1,20,116 -099-1,59,50|warp|-1,-1,099-1,97,86 -099-1,91,50|warp|-1,-1,099-1,112,127 -099-1,121,49|warp|-1,-1,099-1,64,115 -099-1,25,76|warp|-1,-1,099-1,64,73 -099-1,59,76|warp|-1,-1,099-1,42,52 -099-1,91,76|warp|-1,-1,099-1,92,45 -099-1,121,76|warp|-1,-1,099-1,15,78 -099-1,25,102|warp|-1,-1,099-1,49,130 -099-1,60,102|warp|-1,-1,099-1,113,62 -099-1,91,102|warp|-1,-1,099-1,131,79 -099-1,121,102|warp|-1,-1,099-1,72,59 -099-1,26,133|warp|-1,-1,099-1,47,93 -099-1,60,133|warp|-1,-1,099-1,102,25 -099-1,92,133|warp|-1,-1,099-1,120,45 -099-1,121,133|warp|-1,-1,099-1,97,106 +099-2,25,23|warp|-1,-1,099-1,29,17 +099-2,59,22|warp|-1,-1,099-1,77,17 +099-2,90,22|warp|-1,-1,099-1,105,9 +099-2,121,22|warp|-1,-1,099-1,91,137 +099-2,25,50|warp|-1,-1,099-1,20,116 +099-2,59,50|warp|-1,-1,099-1,97,86 +099-2,91,50|warp|-1,-1,099-1,112,127 +099-2,121,49|warp|-1,-1,099-1,64,115 +099-2,25,76|warp|-1,-1,099-1,64,73 +099-2,59,76|warp|-1,-1,099-1,42,52 +099-2,91,76|warp|-1,-1,099-1,92,45 +099-2,121,76|warp|-1,-1,099-1,15,78 +099-2,25,102|warp|-1,-1,099-1,49,130 +099-2,60,102|warp|-1,-1,099-1,113,62 +099-2,91,102|warp|-1,-1,099-1,131,79 +099-2,121,102|warp|-1,-1,099-1,72,59 +099-2,26,133|warp|-1,-1,099-1,47,93 +099-2,60,133|warp|-1,-1,099-1,102,25 +099-2,92,133|warp|-1,-1,099-1,120,45 +099-2,121,133|warp|-1,-1,099-1,97,106 diff --git a/world/map/npc/099-2/logic.txt b/world/map/npc/099-2/logic.txt new file mode 100644 index 00000000..45551e12 --- /dev/null +++ b/world/map/npc/099-2/logic.txt @@ -0,0 +1,1189 @@ +// Evol script +// Author: +// Jesusalva +// Description: +// 099-2 and 099-6 KESHLAM ADVENTURER GUILD QUARTERS +// Controls gimmicks in 099-3 as well +///////////////////////////////////////////////////////////////////////////////// + +-|script|#099-2_CMD|32767 +{ + end; + +OnStorage: + if ($DOOMSDAY != 3) + end; + if (getmap() != "099-5" && getmap() != "099-4") + end; + if ($@DD5_STATUS != 1 && $@DD5_STATUS != 2 && $@DD5_STATUS != 4 && $@DD5_STATUS != 6) + end; + openstorage; + end; + +// FIXME DEBUG DEBUG DEBUG FIXME +OnDebug: + debugmes "CHEAT - JS33"; + if (!debug || $DOOMSDAY != 3 || GM < GM_SYSOP) + end; + set $@DD5_TSWITCH, 18; + set $@DD5_OPENSESAME, 1; + message strcharinfo(0), "DOOMSDAY ACT 5 DEBUG SUCCESSFUL"; + end; + +// FIXME DEBUG DEBUG DEBUG FIXME +OnDebugDamage: + if (!debug || $DOOMSDAY != 3 || GM < GM_SYSOP) + end; + if ($@DD5_HP <= 1000) + end; + set $@DD5_HP, max(1000, $@DD5_HP-2500); + message strcharinfo(0), "Battle: Damage -2500 HP"; + callfunc "FinalExamAttack"; + end; + +// FIXME DEBUG DEBUG DEBUG FIXME +OnDebugX: + debugmes "CHEAT - JS99"; + if (!debug || $DOOMSDAY != 3 || GM < GM_SYSOP || $@DD5_STATUS) + end; + set $@DD5_HP, 100; + set $@DD5_STATUS, 7; + set $@DD5_BEGIN, gettimetick(2); + warp "099-5", 0, 0; + fakenpcname "Zax De'Kagen#0", "Zax De'Kagen#0", 1142; + message strcharinfo(0), "DOOMSDAY ACT 5 SUPER DEBUG SUCCESSFUL"; + end; + +OnInit: + // Register commands + registercmd "@js33", strnpcinfo(0)+"::OnDebug"; + registercmd "@js67", strnpcinfo(0)+"::OnDebugDamage"; + registercmd "@js99", strnpcinfo(0)+"::OnDebugX"; + registercmd "#storage", strnpcinfo(0)+"::OnStorage"; + end; +} + +099-2,0,0,0|script|#099-2_Prestart|32767 +{ + end; + +// FIXME Do not work. Again. +OnTrial1: + monster "099-1", 35, 27, "", 1140, 1, strnpcinfo(0)+"::OnTrial2"; + monster "099-1", 35, 27, "", 1141, 1, strnpcinfo(0)+"::OnTrial2"; + getexp 10000, 0; + getitem "TreasureKey", 1; + end; + +OnTrial2: + monster "099-1", 35, 27, "", 1143, 1, strnpcinfo(0)+"::OnTrial3"; + getexp 10000, 0; + getitem "DarkConcentrationPotion", 1; + end; + +OnTrial3: + getexp 10000, 0; + getitem "BentNeedle", 1; + end; + +// Janitor Function +OnTimer30000: + if (!$@DD5_STATUS) + end; + if (getmapusers("099-5") < 1) + donpcevent "#TMWFinalExam::OnAbort"; + initnpctimer; + end; + +OnInit: + // Initialize the 18 switches + set $@DD5_TSWITCH, 0; + // setarray $@DD5_SWITCH - not needed + + // Initialize the 16 passwords + setarray $@DD5_PASSWORDS, + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000), + 3555+rand(10000); + + // Spawn monsters on maps + // The infantry + areamonster "099-2", 20, 20, 130, 130, "", 1159, 10; + areamonster "099-2", 20, 20, 130, 130, "", 1160, 10; + areamonster "099-6", 20, 20, 130, 130, "", 1159, 10; + areamonster "099-6", 20, 20, 130, 130, "", 1160, 10; + areamonster "099-3", 20, 20, 120, 80, "", 1159, 15; + areamonster "099-3", 20, 20, 120, 80, "", 1160, 15; + + // The small fry + areamonster "099-1", 20, 20, 130, 130, "", 1156, 30; + areamonster "099-2", 20, 20, 130, 130, "", 1156, 20; + areamonster "099-6", 20, 20, 130, 130, "", 1156, 20; + areamonster "099-3", 20, 20, 120, 80, "", 1156, 60; + // The advanced mobs + areamonster "099-1", 20, 20, 130, 130, "", 1152, 15; + areamonster "099-2", 20, 20, 130, 130, "", 1152, 5; + areamonster "099-6", 20, 20, 130, 130, "", 1152, 5; + areamonster "099-3", 20, 20, 120, 80, "", 1152, 20; + + // The boss. Used to be 1137 Tormenta but... Well... Better not. + monster "099-1", 35, 27, "", 1147, 1, "#099-2_Prestart::OnTrial1"; + end; + +OnJanitor: + // Maintain 099-5 (janitor) + initnpctimer; + end; +} + +///////////////////////////////////////////////////// +// Switches subsystem +// Switches are distributed between three maps +// There is a total of 18 switches +099-2,25,17,0|script|#099-2_25_17|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[0]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[0], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-2,90,18,0|script|#099-2_90_18|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[1]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[1], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-2,121,70,0|script|#099-2_121_70|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[2]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[2], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-2,23,95,0|script|#099-2_23_95|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[3]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[3], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-2,57,130,0|script|#099-2_57_130|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[4]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[4], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-6,25,17,0|script|#099-6_25_17|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[5]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[5], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-6,90,18,0|script|#099-6_90_18|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[6]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[6], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-6,121,71,0|script|#099-6_121_71|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[7]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[7], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-6,23,95,0|script|#099-6_23_95|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[8]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[8], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-6,57,130,0|script|#099-6_57_130|422 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[9]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[9], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,29,69,0|script|#099-3_29_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (!$@DD5_SWITCH[10]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[10], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,35,69,0|script|#099-3_35_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[11]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[11], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,41,69,0|script|#099-3_41_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[12]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[12], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,59,69,0|script|#099-3_59_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[13]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[13], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,79,69,0|script|#099-3_79_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[14]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[14], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,91,69,0|script|#099-3_91_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[15]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[15], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,97,69,0|script|#099-3_97_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[16]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[16], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + +099-3,115,69,0|script|#099-3_115_69|422 +{ + // For the cells I need a smaller distance + set @npc_distance, 2; + if(@npc_check) end; + + if (!$@DD5_SWITCH[17]) goto L_Enable; + end; + +L_NoItem: + mes "The switch is stuck, if I only had a Needle or something..."; + close; + +L_Enable: + if ($DOOMSDAY_VANILLA) + end; + if (countitem("BentNeedle") == 0) goto L_NoItem; + delitem "BentNeedle", 1; + fakenpcname strnpcinfo(0), strnpcinfo(0)+"_", 423; + set $@DD5_SWITCH[17], 1; + set $@DD5_TSWITCH, $@DD5_TSWITCH+1; + getexp 100000, 0; + message strcharinfo(0), "The switch is now on!"; + end; +} + + + + + +///////////////////////////////////////////////////// +// Password subsystem +// Passwords are distributed between two maps +// There is a total of 16 passwords +099-2,119,18,0|script|Writing#2_119_18|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... NULL... It is... "+$@DD5_PASSWORDS[0]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,25,45,0|script|Writing#2_25_45|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... EIN... It is... "+$@DD5_PASSWORDS[1]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,93,42,0|script|Writing#2_93_42|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... ZWEI... It is... "+$@DD5_PASSWORDS[2]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,59,72,0|script|Writing#2_59_72|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... DREI... It is... "+$@DD5_PASSWORDS[3]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,89,66,0|script|Writing#2_89_66|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... VIER... It is... "+$@DD5_PASSWORDS[4]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,123,94,0|script|Writing#2_123_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... FUNF... It is... "+$@DD5_PASSWORDS[5]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,62,94,0|script|Writing#2_62_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... SECHS... It is... "+$@DD5_PASSWORDS[6]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-2,27,94,0|script|Writing#2_27_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... SIEBEN... It is... "+$@DD5_PASSWORDS[7]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,119,18,0|script|Writing#6_119_18|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... ACHT... It is... "+$@DD5_PASSWORDS[8]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,25,45,0|script|Writing#6_25_45|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... NEUN... It is... "+$@DD5_PASSWORDS[9]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,93,42,0|script|Writing#6_93_42|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... ZEHN... It is... "+$@DD5_PASSWORDS[10]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,59,72,0|script|Writing#6_59_72|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... ELF... It is... "+$@DD5_PASSWORDS[11]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,89,66,0|script|Writing#6_89_66|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... ZWOLF... It is... "+$@DD5_PASSWORDS[12]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,123,94,0|script|Writing#6_123_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... DREIZEHN... It is... "+$@DD5_PASSWORDS[13]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,62,94,0|script|Writing#6_62_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... VIERZEHN... It is... "+$@DD5_PASSWORDS[14]+"..."; + mes "The remainder was too blurred to read."; + close; +} + +099-6,27,94,0|script|Writing#6_27_94|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is a strange writing here. ##0"; + mes ""; + mes "##1Password... FUNFZEHN... It is... "+$@DD5_PASSWORDS[15]+"..."; + mes "The remainder was too blurred to read."; + close; +} + + + + + +///////////////////////////////////////////////////// +// Lore subsystem +// Lore tidbits are distributed between four maps +// Strategy notes are mixed as well +// There is a total of 18 lore parts + +099-2,57,17,0|script|???#099-2_57_17|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Flower ::."; + mes "This orange flower is dangerous!"; + mes "Do not disturb them - they have great range and damage!"; + mes ""; + mes "Whoever designed this artifical flower must have been crazy!"; + mes "Killing it is not fast enough, avoid its nectar at all costs!"; + close; +} + +099-2,123,128,0|script|???#099-2_123_128|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Slime ::."; + mes "A crazy combat unit made in a crazy laboratory."; + mes "If you can, just avoid it. It is slow enough."; + mes "It can be slain, but have a decent defense, so use magic."; + close; +} + +099-2,95,122,0|script|???#099-2_95_122|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Snake ::."; + mes "If I find who designed these monsters ... Grr..."; + mes "They are fast. And powerful. Goes down quickly, though."; + close; +} + +099-2,28,122,0|script|???#099-2_28_122|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "Last night, we were attacked by Xakelbael the Dark."; + mes "Our attacks could barely do him any harm, and then..."; + mes "He cast \"Fourth Fall\". All our buffed soldiers fell down the same instant."; + mes ""; + mes "I am gravely injured, but I'm leaving this note here."; + mes "Comrades, please avenge me!"; + close; +} + +099-2,91,92,0|script|???#099-2_91_92|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: Sasquatch ::."; + mes "Developed for protection of the Earth Crystal."; + mes "They are extreme power houses capable to smash intruders."; + mes "They have very meh defense, though."; + mes "Also, even then could not harm Xakelbael the Dark."; + close; +} + +099-2,62,43,0|script|???#099-6_62_43|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "Zax De'Kagen trademark skill, the Bliss of Oblivion."; + mes "A powerful skill which dispels mana around himself."; + mes "Monsters will perish the very moment he cast it, and anyone too close"; + mes "will have their mana drained as well, and might die from it."; + mes ""; + mes "Not only that, but he may become immune to certain sources of damage."; + mes "It is a killer move which also allows him to assemble an army right after."; + mes "I do believe there is a weakness, though. Something about excessive fur growth?"; + close; +} + +099-6,57,17,0|script|???#099-6_57_17|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Soldier ::."; + mes "These units can endure a lot of pain and use bows."; + mes "They are not dangerous, but do not let they become fodder."; + mes "A lot of soldiers can be very difficult to kill later on."; + mes "Random trivia: They are afraid of bone arrows and knifes."; + close; +} + +099-6,123,128,0|script|???#099-6_123_128|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Mouboo ::."; + mes "A solid all rounder unit, it has decent health and damage."; + mes "But it proved useless as a security biopart."; + mes "Figures out, we could not subvert its peaceful nature."; + close; +} + +099-6,95,122,0|script|???#099-6_95_122|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: Tengu ::."; + mes "Developed for protection of the Earth Crystal."; + mes "There shouldn't be any here, but they have a high defense."; + mes "They turned out vulnerable to magic, unfortunately."; + close; +} + +099-6,28,122,0|script|???#099-6_28_122|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Bat ::."; + mes "They fly very fast and can quickly swarm you."; + mes "Their damage and health is not important."; + mes "But if not careful, they will overwhelm you."; + mes "Also, did you hear about lay on hands on overlapping dimensions?"; + mes "This have nothing to do with bats but is a cool fact!"; + close; +} + +099-6,91,92,0|script|???#099-6_91_92|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: Mana Slayer ::."; + mes "An anti-magic unit, made to run and slay mages."; + mes "They look so much like us, that we are afraid of them all time."; + mes "Not strong against physical damage, but can resist magic pretty well."; + close; +} + +099-6,62,43,0|script|???#099-6_92_43|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "Do not neglect the potions which you deemed useless until now."; + mes "Our foe is formidable. Our knowledge is being tested, here."; + mes "The same techniques which worked for years simply do not apply."; + mes ""; + mes "Knowing what and when to cast is important in survival."; + mes "I think what should sense magic, might sense mana devoid-ness as well."; + mes "In this case, such would be the only way to know how far of killing we are."; + mes "But I'm not sure if such trick would work except on support role."; + close; +} + + + +/////////////////////////////// +099-1,43,14,0|script|Painting#099-1|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "Reading this is as hard as finding a needle in a haystack."; + if (countitem("FlawedLens") < 1) goto L_Tools; + mes "Although the painting also has no artistic value on its own..."; + mes "Something tells you there is something ominous with it."; + next; + mes "##9 Use [Flawed Lens] on the painting? ##0"; + menu + "No", L_Close, + "Yes", L_UseLens; + +L_Close: + close; + +L_Tools: + mes "The painting itself has no artistic value, either."; + mes "There is something ominous, but you don't know what."; + close; + +L_UseLens: + delitem "FlawedLens", 1; + getexp 10000, 10000; + mes "[@@https://wiki.themanaworld.org/images/5/57/Kirin_by_clef.jpg|There is the image of a woman on it@@]."; + mes ""; + mes "You can make out the following words on it:"; + mes "In memoriam ..... Kirin De'Kagen."; + mes ".... help .... stop ... neither ....."; + mes "Went missing .... .... .... The War."; + mes ""; + mes "Rest in Peace. Damnatio memoriae. Effective immediately."; + // ;-- TRANSLATORS: Damnatio memoriae - "condemnation of memory", indicating that a person is to be excluded from official accounts. History rewrite if required. + next; + mes "The lens break! They were not only poorly effective but also of bad quality."; + mes "If only we could make the real Lens, we would have been able to find out"; + mes "what is up with this ominous, eerie feeling this picture gives."; + close; +} + +099-1,35,22,0|script|Fireplace#099-1|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "##9 There is something interesting on this fireplace. ##0"; + mes "##9 It doesn't seems to fit this building. ##0"; + mes "##9 As if it have been taken from another world and put here. ##0"; + next; + mes "##9 After searching it, you found nothing. ##0"; + mes "##9 It is just a common fireplace, after all. ##0"; + close; +} + +/////////////////////////////// +// Basic Monsters Knowledge +099-1,20,22,0|script|Bookcase#099-1|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Scorpion ::."; + mes "The most basic combat unit in Keshlam."; + mes "They have decent health, damage, and speed."; + mes ""; + mes ".:: V0id Mushroom ::."; + mes "The most basic combat unit in Keshlam."; + mes "They have decent health, damage, and speed, and a higher range."; + mes "Unlike the scorpions, they can move faster, but attack is slower."; + close; +} + +099-1,45,22,0|script|Bookcase#099-1b|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes ".:: V0id Maggot ::."; + mes "They are pathetic individually, and slow, a failed experiment."; + mes "But do not let them overwhelm you, togheter they are formidable!"; + mes ""; + mes ".:: V0id Archant ::."; + mes "An advanced combat unit, without weak points."; + mes "They are slow in movement, but other than that, they are good."; + close; +} + +/////////////////////////////// +// Boss fight general knowledge +099-3,107,50,0|script|Music Score#099-3|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "There is a nice score here."; + mes "I assume important info will be sent by SFX only."; + next; + mes "Also, the time beats of this score are all in 600ms intervals."; + mes "Could it be that attack speed is overridden during the fight?!"; + mes ""; + mes "However, potions will still work, hmm."; + mes "There is also a spell here: \"##B#storage##b\"."; + mes "I assume it only works at specific times."; + close; +} + +099-3,39,46,0|script|Outstanding Book#099-3|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + mes "Zax De'Kagen's Diary, entry #27"; + mes ""; + mes "##9 I am all soaking wet. They found my weak point. ##0"; + mes "##9 However it was too late, Fourth Fall brought the end to this. ##0"; + mes "##9 I did not even had to cancel my illusion. ##0"; + next; + mes "Zax De'Kagen's Diary, entry #34"; + mes ""; + mes "##9 Today my Rubber Bat flew away. Probably shouldn't have given life to it. ##0"; + mes "##9 I'll miss it, my dear friend, I hope one day he returns? ##0"; + next; + mes "Zax De'Kagen's Diary, entry #42"; + mes ""; + mes "##9 What I wouldn't give for some pickled beets right now... ##0"; + mes "##9 Meh, whatever. I'm not going to Dimond's Cove ever again! ##0"; + close; +} + +099-3,64,62,0|script|Pan#099-3|400 +{ + // Default distance is 4 tiles - all we need + callfunc "PCtoNPCRange"; + if(@npc_check) end; + + if (rand(6) % 2 == 0) + goto L_Shock; + goto L_Potion; + +L_Shock: + mes "Some was trying to make Shock Sweets here."; + mes "However, it doesn't seems to have been finished."; + next; + mes "There are the initials \"To stop F.F.\" nearby."; + mes "One can only wonder who or what F.F. is."; + close; + +L_Potion: + mes "Some was trying to make a Mana Potion here."; + mes "However, it doesn't seems to have been finished."; + next; + mes "There are the initials \"To stop Bob\" nearby."; + mes "Well, I assume it is \"Bob\", text is fainted."; + mes "it could be \"boo\" as well. Maybe from Mouboo?"; + close; +} + diff --git a/world/map/npc/099-5/_import.txt b/world/map/npc/099-5/_import.txt index ba38b31c..81a454ca 100644 --- a/world/map/npc/099-5/_import.txt +++ b/world/map/npc/099-5/_import.txt @@ -4,3 +4,4 @@ map: 099-5 npc: npc/099-5/_mobs.txt npc: npc/099-5/_nodes.txt npc: npc/099-5/_warps.txt +npc: npc/099-5/boss.txt diff --git a/world/map/npc/099-5/boss.txt b/world/map/npc/099-5/boss.txt new file mode 100644 index 00000000..d89f60d2 --- /dev/null +++ b/world/map/npc/099-5/boss.txt @@ -0,0 +1,1600 @@ +// Evol script +// Author: +// Jesusalva +// Description: +// 099-5 FINAL EXAM +// The epic final showdown of The Mana World: Legacy +///////////////////////////////////////////////////////////////////////////////// +// $@DD5_STATUS - Status of the battle +// 0 - Idle +// 1 - Timer running +// 2 - Started, first cutscene +// 3 - First Stage +// 4 - Started, second cutscene +// 5 - Second Stage +// 6 - Started, third cutscene +// 7 - Third Stage +// 8 - Epilogue running +// 9 - Epilogue OK +/////////////////////////////////////////////////////////////////// +// $@DD5_HP - Real HitPoints bar of the NPC +// int +// $@DD5_PTS - Total participation points distributed +// int +// $@DD5_BEGIN - Time where the battle begun +// time +// $@DD5_MOBC - Amount of monsters to spawn +// int +// $@DD5MB_WEAK, $@DD5MB_AVERAGE, $@DD5MB_STRONG, $@DD5MB_BOSSLV +// int array - Contains lists of monsters to be used +/////////////////////////////////////////////////////////////////// +// 1151 +// const int - ID of the Void Flower (s1 only) +// 1155 +// const int - ID of the Void Bat +// 1142 +// const int - ID of the visuals for Zax De'Kagen +/////////////////////////////////////////////////////////////////// +// $@DD5_PRIMARY +// int - 3x the challengers in boss room +// $@DD5_SUPPORT +// int - 3x the challengers in waiting room +// $@DD5_TOTALPC +// int - Primary + Support, used to ramp up difficulty +/////////////////////////////////////////////////////////////////// +// $@DD5_RAIN - Is Xakelbael in rain? +// bool +// $@DD5_DEFCON - Defensive mode of Zax De'Kagen +// 0 - Defenseless (#------- TRANSPARENT) +// 1 - Invencible (except to shearing) (#CC79A7 PURPLE) +// 2 - All damage is halved (#E69F00 ORANGE) +// 3 - Immune to potion'ed attackers (#D55E00 BROWN) +// 4 - Vulnerable only when wet (#56B4E9 CYAN) +// 5 - Vulnerable only to melee (#999999 GRAY) +// 6 - Vulnerable to Bone Knife/Bone Arrow (#FFFFFF WHITE) +// 7 - Regenerate from melee (#009E7E GREEN) +// 8 - Requires 10 GP per Damage (#F0E442 YELLOW) +// 9 - (#0072B2 BLUE) +// @dd5_dmg +// int - Calculated damage +// @dd5_shear +// bool - Damage is from shearing skill +/////////////////////////////////////////////////////////////////// +// $@DD5_TALLY_ - Max Individual Score at tally time +// $@DD5_TALLY$ - Player with highest tally +// Tally is conducted at first epilogue scene +// Reward is handed out at last epilogue scene +// If player leaves in-between, reward will be forsaken +// Players who already got the reward (#DD5_TALLY = True) +// will not participate on the tally sequence. +// Tally will not be conducted on Vanilla mode. +/////////////////////////////////////////////////////////////////// +// mapmask +// 1 - Show tiles +// 2 - Epilogue Mode +// 4 - DEFCON 1 INVENCIBLE +// 8 - DEFCON 2 DOUBLE DEFENSE +// 16 - DEFCON 3 POTION IMMUNITY +// 32 - DEFCON 4 WATER VULNERABLE +// 64 - DEFCON 5 RANGED INVULNERABILITY +// 128 - DEFCON 6 BONE VULNERABLE +// 256 - DEFCON 7 MELEE REGEN +// 512 - DEFCON 8 GP COST +// 1024 - DEFCON + +099-5|mapflag|nosave|099-3,72,74 +099-5|mapflag|resave|099-3,72,74 +099-4|mapflag|nosave|099-3,72,74 +099-4|mapflag|resave|099-3,72,74 + +099-5,0,0,0|script|#TMWFinalExam|32767 +{ + // Main script + end; + +OnAbort: + stopnpctimer; + set $@DD5_STATUS, 0; + set $@DD5_HP, 0; + set $@DD5_PTS, 0; + set $@DD5_BEGIN, 0; + set $@DD5_MOBC, 0; + set $@DD5_PRIMARY, 0; + set $@DD5_SUPPORT, 0; + set $@DD5_TOTALPC, 0; + set $@DD5_RAIN, 0; + set $@DD5_DEFCON, 0; + set $@DD5_TALLY_, 0; + set $@DD5_TALLY$, ""; + killmonster "099-5", "All"; + killmonster "099-4", "All"; + disablenpc "Gema III"; + disablenpc "Flying Ship"; + disablenpc "Jande#0"; + disablenpc "Tal#0"; + disablenpc "Anon"; + disablenpc "Zax De'Kagen#0"; + disablenpc "Xakelbael the Dark#0"; + donpcevent "Zax De'Kagen#0::OnAbort"; + end; + +/////////////////////////////////////////////////////////// +// Map timers, against all players +OnMTChallenge: + set @dd5_score, 0; + set @dd5_timer, gettimetick(0); + getexp 40000, 0; + set BOSS_POINTS, BOSS_POINTS + 5; + message strcharinfo(0), "This battle experience distribution is different, and death is final. Be careful!"; + end; + +// FIXME not working for some reason +OnMTWarpTo0: + message strcharinfo(0), "Your party was defeated."; + warp "009-1", 54, 40; + end; + +OnMTDispose: + warp "009-1", 54, 40; + end; + +//////////////////////////// +// First Stage Rewards +OnMTReward50: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*100, @dd5_share; + set Zeny, Zeny + @dd5_share; + set BOSS_POINTS, BOSS_POINTS + @dd5_share/100; + message strcharinfo(0), "Gained "+(@dd5_share/100)+" boss points!"; + goto OnMTMusicOff; + +OnMTReward40: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*10, @dd5_share/10; + set Zeny, Zeny + @dd5_share/10; + set BOSS_POINTS, BOSS_POINTS + @dd5_share/200; + message strcharinfo(0), "Gained "+(@dd5_share/200)+" boss points!"; + goto OnMTMusicOff; + +//////////////////////////// +// Second Stage Rewards +OnMTReward51: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*200, @dd5_share*2; + set Zeny, Zeny + (@dd5_share*2); + set BOSS_POINTS, BOSS_POINTS + @dd5_share/50; + message strcharinfo(0), "Gained "+(@dd5_share/50)+" boss points!"; + goto OnMTMusicOff; + +OnMTReward41: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*20, @dd5_share/5; + set Zeny, Zeny + @dd5_share/5; + set BOSS_POINTS, BOSS_POINTS + @dd5_share/100; + message strcharinfo(0), "Gained "+(@dd5_share/100)+" boss points!"; + goto OnMTMusicOff; + +//////////////////////////// +// Third Stage Rewards +OnMTReward52: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*500, @dd5_share*5; + set Zeny, Zeny + (@dd5_share*5); + set BOSS_POINTS, BOSS_POINTS + @dd5_share/20; + message strcharinfo(0), "Gained "+(@dd5_share/20)+" boss points!"; + music "ghoulish-fun.ogg"; + mapmask 1; + + // Dispose dead bodies (BUG, should not happen) + if (isdead()) + goto OnMTDispose; + + // Tally rewards + // FIXME TODO Use a bitwise to save space, this is TMWA + if (!#DD5_TALLY && !$DOOMSDAY_VANILLA) + goto OnTally; + goto OnEpilogue1; + +OnMTReward42: + set @dd5_share, 10000*@dd5_score/$@DD5_PTS; + if (!@dd5_share) + end; + getexp @dd5_share*50, @dd5_share; + set Zeny, Zeny + @dd5_share; + set BOSS_POINTS, BOSS_POINTS + @dd5_share/50; + message strcharinfo(0), "Gained "+(@dd5_share/50)+" boss points!"; + music "ghoulish-fun.ogg"; + + // Warp to 099-5 or dispose dead bodies + if (isdead()) + goto OnMTDispose; + warp "099-5", rand(53, 59), rand(37, 41); + + // Tally rewards + // FIXME TODO Use a bitwise to save space, this is TMWA + if (!#DD5_TALLY && !$DOOMSDAY_VANILLA) + goto OnTally; + goto OnEpilogue1; + +// Blue Rose tally +OnTally: + if (@dd5_score > $@DD5_TALLY_) + goto OnTallyOK; + goto OnEpilogue1; + +OnTallyOK: + set $@DD5_TALLY_, @dd5_score; + set $@DD5_TALLY$, strcharinfo(0); + goto OnEpilogue1; + +//////////////////////////// +// Fourth Fall +OnMTFourthFall: + misceffect 52, strcharinfo(0); // FIXME + addtimer 3000, "#TMWFinalExam::OnFourthFall"; + end; + +OnFourthFall: + debugmes "FOURTH FALL"; + + // High Damage + if (sc_check(sc_raiseattackspeed0)) + goto OnFF01Y; + goto OnFF01N; + +OnFF01Y: + heal -300, -100; + goto OnFF01N; + +OnFF01N: + if (sc_check(sc_raiseattackstrength)) + goto OnFF02Y; + goto OnFF02N; + +OnFF02Y: + heal -300, -100; + goto OnFF02N; + +OnFF02N: + // Medium Damage + if (sc_check(SC_PHYS_SHIELD)) + goto OnFF03Y; + goto OnFF03N; + +OnFF03Y: + heal -250, -50; + goto OnFF03N; + +OnFF03N: + if (sc_check(SC_MBARRIER)) + goto OnFF04Y; + goto OnFF04N; + +OnFF04Y: + heal -250, -50; + goto OnFF04N; + +OnFF04N: + // Low Damage + if (sc_check(SC_FLYING_BACKPACK)) + goto OnFF05Y; + goto OnFF05N; + +OnFF05Y: + heal -125, -25; + goto OnFF05N; + +OnFF05N: + if (sc_check(sc_slowpoison)) + goto OnFF06Y; + goto OnFF06N; + +OnFF06Y: + heal -125, -25; + goto OnFF06N; + +OnFF06N: + //debugmes "FOURTH WALL WAS BROKEN"; + misceffect 52, strcharinfo(0); // FIXME + end; + +//////////////////////////// +// Bliss Of Oblivion +OnMTBlissOblivion: + misceffect 51, strcharinfo(0); + misceffect 52, strcharinfo(0); // FIXME + // Poison + sc_start sc_poison, 1, 80; + // Adjust Map Mask + if ($@DD5_DEFCON == 0) + mapmask 1; + if ($@DD5_DEFCON == 1) + mapmask 1 | 4; + if ($@DD5_DEFCON == 2) + mapmask 1 | 8; + if ($@DD5_DEFCON == 3) + mapmask 1 | 16; + if ($@DD5_DEFCON == 4) + mapmask 1 | 32; + if ($@DD5_DEFCON == 5) + mapmask 1 | 64; + if ($@DD5_DEFCON == 6) + mapmask 1 | 128; + if ($@DD5_DEFCON == 7) + mapmask 1 | 256; + if ($@DD5_DEFCON == 8) + mapmask 1 | 512; + end; + +OnBlissOblivion: + killmonster "099-5", "All"; + killmonster "099-4", "All"; + set $@DD5_DEFCON, rand(0, 8); + // Keep a few tricks under the sleeve initially + if ($@DD5_HP > 100000 && $@DD5_DEFCON < 4) + set $@DD5_DEFCON, rand(4, 8); + // Re-rolls: Start avoiding initial movements + if ($@DD5_HP < 50000 && $@DD5_DEFCON > 3 && $@DD5_DEFCON < 7) + set $@DD5_DEFCON, rand(0, 8); + // If hurt badly, use invencible a bit more often (shearing is annoying) + if ($@DD5_HP < 10000 && $@DD5_DEFCON > 2) + set $@DD5_DEFCON, rand(0, 8); + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTBlissOblivion"; + setnpctimer 89000; + end; + +//////////////////////////// +// Miniboss Spawning +OnMTWarning: + misceffect 51, strcharinfo(0); + end; + +OnMTMusicOn: + music "Dramatic.ogg"; + end; + +OnMTMusicOff: + music "ghoulish-fun.ogg"; + end; + +/////////////////////////////////////////////////////////// +// Before the battle begins +OnWarn0: + announce "Doomsday : The Final Showdown will start shortly! Make way to the Master Chamber at once!", 0; + set $@DD5_STATUS, 1; + set $@DD5_PTS, 0; + // FIXME DEBUG DEBUG DEBUG FIXME + if (debug) + addnpctimer 10000, "#TMWFinalExam::OnBegin"; + else + addnpctimer 90000, "#TMWFinalExam::OnWarn1"; + end; +OnWarn1: + announce "Doomsday : Doors to Zax De'Kagen domains will seal shut in ##1##B5 minutes##b##0, so prepare yourselves!", 0; + addnpctimer 120000, "#TMWFinalExam::OnWarn2"; + end; +OnWarn2: + announce "Doomsday : Doors to Zax De'Kagen domains will seal shut in ##1##B3 minutes##b##0, so prepare yourselves!", 0; + addnpctimer 120000, "#TMWFinalExam::OnWarn3"; + end; +OnWarn3: + announce "Doomsday : Doors to Zax De'Kagen domains will seal shut in ##1##B1 minute##b##0, last call for challengers!", 0; + addnpctimer 60000, "#TMWFinalExam::OnBegin"; + end; +OnBegin: + announce "Doomsday : Final Showdown: BEGIN!", 0; + set $@DD5_STATUS, 2; + set $@DD5_BEGIN, gettimetick(2); + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTChallenge"; + addnpctimer 2000, "#TMWFinalExam::OnPrologue1"; + donpcevent "#099-2_Prestart::OnJanitor"; + end; + +/////////////////////////////////////////////////////////// +// Prologue +OnPrologue1: + // set the sprite (implies enablenpc) + fakenpcname "Zax De'Kagen#0", "Zax De'Kagen#0", 1142; + mapannounce "099-5", "Zax De'Kagen : What is that, a bunch of Talpans in my domains?" , 0; + mapannounce "099-4", "Zax De'Kagen : What is that, a bunch of Talpans in my domains?" , 0; + npctalk "Zax De'Kagen#0", "What is that, a bunch of Talpans in my domains?"; + addnpctimer 5000, "#TMWFinalExam::OnPrologue2"; + end; + +OnPrologue2: + mapannounce "099-5", "Zax De'Kagen : Don't make me laugh. Do you really think you have what it takes to stop ME?!" , 0; + mapannounce "099-4", "Zax De'Kagen : Don't make me laugh. Do you really think you have what it takes to stop ME?!" , 0; + npctalk "Zax De'Kagen#0", "Don't make me laugh. Do you really think you have what it takes to stop ME?!"; + addnpctimer 10000, "#TMWFinalExam::OnPrologue3"; + end; + +OnPrologue3: + mapannounce "099-5", "Zax De'Kagen : Hmpf! We will see about that. Therefore..." , 0; + mapannounce "099-4", "Zax De'Kagen : Hmpf! We will see about that. Therefore..." , 0; + npctalk "Zax De'Kagen#0", "Hmpf! We will see about that. Therefore..."; + addnpctimer 5000, "#TMWFinalExam::OnPrologue4"; + end; + +OnPrologue4: + mapannounce "099-5", "Zax De'Kagen : Catch me if you can!" , 0; + mapannounce "099-4", "Zax De'Kagen : Catch me if you can!" , 0; + npctalk "Zax De'Kagen#0", "Catch me if you can!"; + set $@DD5_STATUS, 3; + set $@DD5_HP, 20000; + set $@DD5_PRIMARY, 3+getmapusers("099-5")*2; + set $@DD5_SUPPORT, 3+getmapusers("099-4")*2; + set $@DD5_TOTALPC, $@DD5_PRIMARY+$@DD5_SUPPORT; + // Spawn first assault + areamonster "099-5", 43, 44, 56, 55, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], $@DD5_TOTALPC, "#TMWFinalExam::OnKillAverage"; + areamonster "099-5", 20, 20, 75, 75, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], $@DD5_PRIMARY, "#TMWFinalExam::OnKillAverage"; + areamonster "099-4", 20, 20, 75, 75, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], $@DD5_SUPPORT, "#TMWFinalExam::OnKillAverage"; + areamonster "099-5", 20, 20, 75, 75, "", 1151, $@DD5_TOTALPC, "#TMWFinalExam::OnKillAverage"; + // Begin timers! + initnpctimer; + donpcevent "Zax De'Kagen#0::OnEnable"; + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTMusicOn"; + areatimer 0, "099-4", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTMusicOn"; + end; + +/////////////////////////////////////////////////////////// +// First Stage +OnRubberBat: + if ($@DD5_STATUS != 3) + end; + areamonster getmap(), getx()-5, gety()-5, getx()+5, gety()+5, "", 1155, rand(2,4), "#TMWFinalExam::OnKillWeak"; + addtimer 10, "Zax De'Kagen#0::OnAdjustBat"; + end; + +OnPickledBeets: + if ($@DD5_STATUS != 3) + end; + addtimer 10, "Zax De'Kagen#0::OnAdjustBeets"; + end; + +/////////////////////////////////////////////////////////// +// Second Stage +OnWarmedUp0: + stopnpctimer; + set $@DD5_STATUS, 4; + set $@DD5_HP, 0; + killmonster "099-5", "All"; + killmonster "099-4", "All"; + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward50"; + areatimer 0, "099-4", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward40"; + + mapannounce "099-5", "Zax De'Kagen : Hahaha! Not bad, not bad at all!" , 0; + mapannounce "099-4", "Zax De'Kagen : Hahaha! Not bad, not bad at all!" , 0; + npctalk "Zax De'Kagen#0", "Hahaha! Not bad, not bad at all!"; + + addnpctimer 5000, "#TMWFinalExam::OnWarmedUp1"; + donpcevent "Zax De'Kagen#0::OnDisable"; + end; + +OnWarmedUp1: + mapannounce "099-5", "Zax De'Kagen : However..." , 0; + mapannounce "099-4", "Zax De'Kagen : However..." , 0; + npctalk "Zax De'Kagen#0", "However..."; + + addnpctimer 5000, "#TMWFinalExam::OnWarmedUp2"; + end; + +OnWarmedUp2: + mapannounce "099-5", "Zax De'Kagen : This was only warm up!" , 0; + mapannounce "099-4", "Zax De'Kagen : This was only warm up!" , 0; + npctalk "Zax De'Kagen#0", "This was only warm up!"; + + addnpctimer 10000, "#TMWFinalExam::OnWarmedUp3"; + end; + +OnWarmedUp3: + mapannounce "099-5", "Zax De'Kagen : Look and behold, the form I took on this rewrite..." , 0; + mapannounce "099-4", "Zax De'Kagen : Look and behold, the form I took on this rewrite..." , 0; + npctalk "Zax De'Kagen#0", "Look and behold, the form I took on this rewrite..."; + + addnpctimer 10000, "#TMWFinalExam::OnWarmedUp4"; + end; + +OnWarmedUp4: + mapannounce "099-5", "Zax De'Kagen : The name which I am known is..." , 0; + mapannounce "099-4", "Zax De'Kagen : The name which I am known is..." , 0; + npctalk "Zax De'Kagen#0", "The name which I am known is..."; + + addnpctimer 10000, "#TMWFinalExam::OnWarmedUp5"; + end; + +OnWarmedUp5: + disablenpc "Zax De'Kagen#0"; + fakenpcname "Xakelbael the Dark#0", "Xakelbael the Dark#0", 1161; + mapannounce "099-5", "Xakelbael the Dark : ...Xakelbael the Dark! PERISH!" , 0; + mapannounce "099-4", "Xakelbael the Dark : ...Xakelbael the Dark! PERISH!" , 0; + npctalk "Xakelbael the Dark#0", "...Xakelbael the Dark! PERISH!"; + + addnpctimer 3000, "#TMWFinalExam::OnWarmedUp6"; + end; + +OnWarmedUp6: + set $@DD5_STATUS, 5; + set $@DD5_HP, 40000; + set $@DD5_PRIMARY, 1+getmapusers("099-5")*2; + set $@DD5_SUPPORT, 1+getmapusers("099-4")*2; + set $@DD5_TOTALPC, $@DD5_PRIMARY+$@DD5_SUPPORT; + initnpctimer; + donpcevent "Xakelbael the Dark#0::OnEnable"; + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTMusicOn"; + areatimer 0, "099-4", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTMusicOn"; + end; + +OnRainCheck: + set .@name$, strnpcinfo(0,@target_id); + explode .@nearby$[0], .@name$, "#"; + if (.@nearby$[0] != "rain" && .@nearby$[1] != "rain") end; + set $@DD5_RAIN, 1; + end; + +/////////////////////////////////////////////////////////// +// Third Stage +OnShowdown0: + stopnpctimer; + set $@DD5_STATUS, 6; + set $@DD5_HP, 0; + killmonster "099-5", "All"; + killmonster "099-4", "All"; + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward51"; + areatimer 0, "099-4", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward41"; + disablenpc "Xakelbael the Dark#0"; + enablenpc "Zax De'Kagen#0"; + + mapannounce "099-5", "Zax De'Kagen : Hah...! That was a good workout!" , 0; + mapannounce "099-4", "Zax De'Kagen : Hah...! That was a good workout!" , 0; + npctalk "Zax De'Kagen#0", "Hah...! That was a good workout!"; + + addnpctimer 5000, "#TMWFinalExam::OnShowdown1"; + donpcevent "Xakelbael the Dark#0::OnDisable"; + end; + +OnShowdown1: + mapannounce "099-5", "Zax De'Kagen : It was totally worth it! I was incredibly bored!" , 0; + mapannounce "099-4", "Zax De'Kagen : It was totally worth it! I was incredibly bored!" , 0; + npctalk "Zax De'Kagen#0", "It was totally worth it! I was incredibly bored!"; + + addnpctimer 5000, "#TMWFinalExam::OnShowdown2"; + end; + +OnShowdown2: + set $@DD5_TPASSED, (gettimetick(2)-$@DD5_BEGIN); + set $@DD5_TSPENT$, $@DD5_TPASSED/60+" minute(s) and "+$@DD5_TPASSED%60+" second(s)"; + mapannounce "099-5", "Zax De'Kagen : Well, we still have time! Only "+$@DD5_TSPENT$+" passed!" , 0; + mapannounce "099-4", "Zax De'Kagen : Well, we still have time! Only "+$@DD5_TSPENT$+" passed!" , 0; + npctalk "Zax De'Kagen#0", "Well, we still have time! Only "+$@DD5_TSPENT$+" passed!"; + + set $@DD5_TPASSED, 0; + set $@DD5_TSPENT$, ""; + addnpctimer 10000, "#TMWFinalExam::OnShowdown3"; + end; + +OnShowdown3: + mapannounce "099-5", "Zax De'Kagen : I will now acknowledge your strength and fight for realz." , 0; + mapannounce "099-4", "Zax De'Kagen : I will now acknowledge your strength and fight for realz." , 0; + npctalk "Zax De'Kagen#0", "I will now acknowledge your strength and fight for realz."; + + addnpctimer 10000, "#TMWFinalExam::OnShowdown4"; + end; + +OnShowdown4: + mapannounce "099-5", "Zax De'Kagen : Don't blame me if you die!" , 0; + mapannounce "099-4", "Zax De'Kagen : Don't blame me if you die!" , 0; + npctalk "Zax De'Kagen#0", "Don't blame me if you die!"; + + addnpctimer 10000, "#TMWFinalExam::OnShowdown5"; + end; + +OnShowdown5: + mapannounce "099-5", "Zax De'Kagen : Do your best to entretain me!" , 0; + mapannounce "099-4", "Zax De'Kagen : Do your best to entretain me!" , 0; + npctalk "Zax De'Kagen#0", "Do your best to entretain me!"; + + addnpctimer 3000, "#TMWFinalExam::OnShowdown6"; + end; + +OnShowdown6: + set $@DD5_STATUS, 7; + set $@DD5_HP, 120000; + set $@DD5_PRIMARY, 3+getmapusers("099-5")*2; + set $@DD5_SUPPORT, 3+getmapusers("099-4")*2; + set $@DD5_TOTALPC, $@DD5_PRIMARY+$@DD5_SUPPORT; + initnpctimer; + donpcevent "Zax De'Kagen#0::OnFinal"; + end; + +/////////////////////////////////////////////////////////// +// Epilogue +OnEpilogue0: + stopnpctimer; + set $@DD5_STATUS, 8; + set $@DD5_HP, 0; + killmonster "099-5", "All"; + killmonster "099-4", "All"; + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward52"; + areatimer 0, "099-4", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTReward42"; + enablenpc "Flying Ship"; + + set $@DD5_TPASSED, (gettimetick(2)-$@DD5_BEGIN); + set $@DD5_TSPENT$, $@DD5_TPASSED/60+" minute(s) and "+$@DD5_TPASSED%60+" second(s)"; + set $@DD5_TPASSED2, 2100+$@DD5_TPASSED; // 35 minutes, The Big Bad, Watchmen + set $@DD5_TSPENT2$, $@DD5_TPASSED2/60+" minute(s)"; + set $@DD5_PRIMARY, 0; + set $@DD5_SUPPORT, 0; + donpcevent "Zax De'Kagen#0::OnDisable"; + end; + +// Unfortunately we all know that +// MANAPLUS ALLOWS YOU TO EXPLODE THE MENUS +// So we need a control addtimer to fire +// if you exit this illegally +OnEpilogue1: + set @dd5_illegalexit, 1; + addtimer 10, "#TMWFinalExam::OnIllegalExit1"; + + mes "[Zax De'Kagen]"; + mes "Thanks for the "+$@DD5_TSPENT$+" of fun you gave me!"; + next; + mes "[Zax De'Kagen]"; + mes "This was not in the plan, but was fun nonetheless. Worth the detour."; + next; + mes "[Zax De'Kagen]"; + mes "However, now I need to go. Unlike you, I do not want to be late."; + next; + menu + "We just killed you?", L_Epilogue1Part1, + "Late? What do you mean?", L_Epilogue1Part1; + +L_Epilogue1Part1: + mes "[Zax De'Kagen]"; + mes "You know villains never lie. Did you notice how I did not attack any of you directly?"; + next; + mes "[Zax De'Kagen]"; + mes "I already finished my plans "+$@DD5_TSPENT2$+" ago, otherwise I would not be bothering myself with you."; + next; + mes "[Zax De'Kagen]"; + mes "I hope you did not hoped to kill me. Wait. You actually did?!"; + next; + mes "[Zax De'Kagen]"; + mes "HAHAHAHAHAHAHAHA!!"; + next; + mes "[Zax De'Kagen]"; + mes "Thanks for this, I don't recall laughing so hard the past five years."; + next; + mes "[Zax De'Kagen]"; + mes "Tell me... Enumerate me... Which beings on The Mana World remains dead after being killed?"; + next; + mes "[Zax De'Kagen]"; + mes "Think a bit! Monsters respawn... Adventurers appear near the Soul Menhir..."; + next; + mes "[Zax De'Kagen]"; + mes "...Or used to, at least; I don't know why that's not true anymore... anyway..."; + next; + mes "[Zax De'Kagen]"; + mes "Did you really thought you could simply defeat me in combat and expect this to solve all your problems?"; + next; + menu + "I did", L_Epilogue1Part21, + "I didn't", L_Epilogue1Part22; + +L_Epilogue1Part21: + mes "[Zax De'Kagen]"; + mes "HAHAHAHAHAHAHAHA!!"; + next; + goto L_Epilogue1Part2; +L_Epilogue1Part22: + mes "[Zax De'Kagen]"; + mes "So I assume you thought in a way to seal me? Not that it matters anymore."; + next; + goto L_Epilogue1Part2; + +L_Epilogue1Part2: + mes "[Zax De'Kagen]"; + mes "I'm not even close to fainting yet."; + next; + mes "[Zax De'Kagen]"; + mes "Besides, only a handful of mana beings know how to erase something of existence."; + next; + mes "[Zax De'Kagen]"; + mes "Anyway, just look! My ride arrived."; + next; + + set @dd5_illegalexit, 0; + if (getmap() == "099-5") + goto OnEpilogue1b; + + // What. How? Force script to explode. + set Hp, 0; + heal -99999, -99999; + end; + +// If you exited it when convenient, force you to restart interaction +OnIllegalExit1: + if (@dd5_illegalexit) + goto OnEpilogue1; + end; + +// Should we advance or warp map? +// “Instead of using $@DD5_PRIMARY, use an areatimer +// sum up like Candor Cave looking for a temporary variable, +// And only if no one has the temporary variable anymore, advance.” + +// TODO FIXME This looks like it'll explode the first chance it gets +OnEpilogue1b: + set $@DD5_SUPPORT, 0; + // Would this timer ever run if player is on dialog? + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnEpilogue1c"; + close; + +OnEpilogue1c: + if ($@DD5_PRIMARY) + end; + if (!@dd5_illegalexit) + set $@DD5_SUPPORT, $@DD5_SUPPORT+1; + addtimer 50, "#TMWFinalExam::OnEpilogue1d"; + end; + +OnEpilogue1d: + if ($@DD5_PRIMARY) + end; + if ($@DD5_SUPPORT >= getmapusers("099-5")) + goto OnEpilogue1e; + set $@DD5_SUPPORT, 0; + end; + +OnEpilogue1e: + set $@DD5_PRIMARY, 1; + set $@DD5_SUPPORT, 0; + addnpctimer 300, "#TMWFinalExam::OnEpilogue2"; + close; + +////////////// There are no players in 099-4 now +OnEpilogue2: + mapannounce "099-5", "Zax De'Kagen : Now that I know where Nu'Rem is burried, nothing can stop me." , 0; + npctalk "Zax De'Kagen#0", "Now that I know where Nu'Rem is burried, nothing can stop me."; + + // FIXME DEBUG DEBUG DEBUG FIXME + if (debug) + addnpctimer 2000, "#TMWFinalExam::OnEpilogue5"; + else + addnpctimer 5000, "#TMWFinalExam::OnEpilogue3"; + end; + +OnEpilogue3: + mapannounce "099-5", "Zax De'Kagen : Good bye, mortal adventurers." , 0; + npctalk "Zax De'Kagen#0", "Good bye, mortal adventurers."; + + addnpctimer 5000, "#TMWFinalExam::OnEpilogue4"; + end; + +OnEpilogue4: + mapannounce "099-5", "Zax De'Kagen : Heh, not like I wasn't one too, back then..." , 0; + npctalk "Zax De'Kagen#0", "Heh, not like I wasn't one too, back then..."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue5"; + end; + +OnEpilogue5: + disablenpc "Zax De'Kagen#0"; + disablenpc "Flying Ship"; + + addnpctimer 10000, "#TMWFinalExam::OnEpilogue6"; + end; + +OnEpilogue6: + enablenpc "Gema III"; + enablenpc "Jande#0"; + enablenpc "Tal#0"; + enablenpc "Anon"; + mapannounce "099-5", "Jande : With Zax gone, I could finally arrive here." , 0; + npctalk "Jande#0", "With Zax gone, I could finally arrive here."; + + // FIXME DEBUG DEBUG DEBUG FIXME + if (debug) + addnpctimer 2000, "#TMWFinalExam::OnEpilogue15"; + else + addnpctimer 5000, "#TMWFinalExam::OnEpilogue7"; + end; + +OnEpilogue7: + mapannounce "099-5", "Tal : I believe some introductions are in order. I am Tal, the Great Dragon of Water." , 0; + npctalk "Tal#0", "Tal : I believe some introductions are in order. I am Tal, the Great Dragon of Water."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue8"; + end; + +OnEpilogue8: + mapannounce "099-5", "Tal : I also consider myself the creator of the Tritan race. Jande called me to help." , 0; + npctalk "Tal#0", "Tal : I also consider myself the creator of the Tritan race. Jande called me to help."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue9"; + end; + +OnEpilogue9: + mapannounce "099-5", "Tal : While I do not like this idea myself, we have an enemy in common." , 0; + npctalk "Tal#0", "Tal : While I do not like this idea myself, we have an enemy in common."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue10"; + end; + +OnEpilogue10: + mapannounce "099-5", "Anon : We prepared another ship, Gema III. This ship will bring you to the damned island." , 0; + npctalk "Anon", "We prepared another ship, Gema III. This ship will bring you to the damned island."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue11"; + end; + +OnEpilogue11: + mapannounce "099-5", "Anon : Be careful, though. It is the final resting place of the Great Dragon of Air." , 0; + npctalk "Anon", "Be careful, though. It is the final resting place of the Great Dragon of Air."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue12"; + end; + +OnEpilogue12: + mapannounce "099-5", "Anon : There is no telling on the horrors you'll find there." , 0; + npctalk "Anon", "There is no telling on the horrors you'll find there."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue13"; + end; + +OnEpilogue13: + mapannounce "099-5", "Jande : A ship is not so fast as a flying one, but I am sure you can make in time." , 0; + npctalk "Jande#0", "A ship is not so fast a flying one, but I am sure you can make in time."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue14"; + end; + +OnEpilogue14: + mapannounce "099-5", "Jande : Whatever happens, DO NOT let Zax De'Kagen reach the great dragon body. Remember: Zax is wounded!" , 0; + npctalk "Jande#0", "Whatever happens, DO NOT let Zax De'Kagen reach the great dragon body. Remember: Zax is wounded!"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue15"; + end; + +OnEpilogue15: + set $@DD5_STATUS, 9; + mapannounce "099-5", "##1(Talk to Gema III to embark)" , 0; + npctalk "Gema III", "##1(Talk to Gema III to embark)"; + // FIXME DEBUG DEBUG DEBUG FIXME + if (debug) + addnpctimer 2000, "#TMWFinalExam::OnEpilogue25"; + else + addnpctimer 30000, "#TMWFinalExam::OnEpilogue16"; + end; + + +// Conspiracy +OnEpilogue16: + npctalk "Jande#0", "(*whisper* Tal, do you think they'll make it?)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue17"; + end; +OnEpilogue17: + npctalk "Tal#0", "Tal : (*whisper* I would be surprised if they survived the trip alone.)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue18"; + end; +OnEpilogue18: + npctalk "Jande#0", "(*whisper* For now, let's hope for the best. I don't want another rewrite...)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue19"; + end; +OnEpilogue19: + npctalk "Tal#0", "Tal : (*whisper* You worry too much. Di'Tal already put measures in place.)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue20"; + end; +OnEpilogue20: + npctalk "Tal#0", "Tal : (*whisper* The same incident from years ago will not repeat itself.)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue21"; + end; +OnEpilogue21: + npctalk "Tal#0", "Tal : (*whisper* Besides, shall they fail - they won't remember any of this.)"; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue22"; + end; +OnEpilogue22: + npctalk "Jande#0", "(*whisper* We will have a good room to maneuver undercover, then.)"; + addnpctimer 15000, "#TMWFinalExam::OnEpilogue23"; + end; + +OnEpilogue23: + npctalk "Anon", "What are you waiting for? You're running against the clock."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue24"; + end; +OnEpilogue24: + npctalk "Anon", "You know Jande and Tal cannot get close to that... that thing."; + addnpctimer 5000, "#TMWFinalExam::OnEpilogue25"; + end; +OnEpilogue25: + npctalk "Anon", "We will do what we can to support you from sidelines. Now go!"; + end; + +/////////////////////////////////////////////////////////// +// Spawn Subsystem +S_DD5PrimarySpawn: + // Receives: $@DD5_MOBC + set $@DD5_TMP, rand(270) / 100; + if ($@DD5_TMP == 0) + goto L_DD5PSN; + if ($@DD5_TMP == 1) + goto L_DD5PSR; + if ($@DD5_TMP == 2) + goto L_DD5PSP; + goto L_DD5PSResume; + +L_DD5PSN: + callfunc "DD5SpawnNoob"; + goto L_DD5PSResume; + +L_DD5PSR: + callfunc "DD5SpawnRegular"; + goto L_DD5PSResume; + +L_DD5PSP: + callfunc "DD5SpawnPro"; + goto L_DD5PSResume; + +L_DD5PSResume: + if ($@DD5_MOBC) + goto S_DD5PrimarySpawn; + set $@DD5_TMP, 0; + return; + +/////////////////////////////////////////////////////////// +// Timer Subsystem, spawns every 30 seconds +OnTimer30000: + // Imperial Chamber + areamonster "099-5", 43, 44, 56, 55, "", $@DD5MB_WEAK[rand(getarraysize($@DD5MB_WEAK))], $@DD5_PRIMARY, "#TMWFinalExam::OnKillWeak"; + // Map + set $@DD5_MOBC, $@DD5_TOTALPC/2+1; + callsub S_DD5PrimarySpawn; + // Prologue mobs + if ($@DD5_STATUS == 3) + areamonster "099-5", 20, 20, 75, 75, "", 1151, $@DD5_TOTALPC, "#TMWFinalExam::OnKillAverage"; + end; + +OnTimer60000: + // Imperial Chamber + areamonster "099-5", 43, 44, 56, 55, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], $@DD5_PRIMARY/3+1, "#TMWFinalExam::OnKillAverage"; + // Map + set $@DD5_MOBC, $@DD5_TOTALPC/2; + callsub S_DD5PrimarySpawn; + // Prologue mobs + if ($@DD5_STATUS == 3) + areamonster "099-5", 20, 20, 75, 75, "", 1151, $@DD5_TOTALPC, "#TMWFinalExam::OnKillAverage"; + end; + +// Warn players about the 90s rule closing in +// They'll have 10 seconds to prepare themselves to the mini-boss spawn! +// AND to get ready to the boss HP regeneration (which is small but anyway) +OnTimer80000: + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTWarning"; + end; + +OnTimer90000: + // Imperial Chamber + areamonster "099-5", 43, 44, 56, 55, "", $@DD5MB_STRONG[rand(getarraysize($@DD5MB_STRONG))], $@DD5_PRIMARY/3, "#TMWFinalExam::OnKillStrong"; + areamonster "099-5", 43, 44, 56, 55, "", $@DD5MB_BOSSLV[rand(getarraysize($@DD5MB_BOSSLV))], $@DD5_STATUS/2, "#TMWFinalExam::OnKillStrong"; + // Map + set $@DD5_MOBC, $@DD5_TOTALPC/3+1; + callsub S_DD5PrimarySpawn; + // Prologue mobs + if ($@DD5_STATUS == 3) + areamonster "099-5", 20, 20, 75, 75, "", 1151, $@DD5_TOTALPC, "#TMWFinalExam::OnKillAverage"; + // Boss regeneration, which may overflow into infinity. + // A regular tick takes 7s - so ~13 cycles of regen + // It'll regen STATUS Hp per tick, so: 39, 65 and 91 HP every 90s + // Which is a ridiculously low amount, so I buffed it in 3 + // A base healing of 3 HP per tick - So 117, 195 and 273 HP (still low) + set $@DD5_HP, $@DD5_HP+((13*$@DD5_STATUS)*3); + initnpctimer; + end; + +/////////////////////////////////////////////////////////// +// Monster Death Label +OnKillWeak: + set @dd5_score, @dd5_score+1; + set $@DD5_PTS, $@DD5_PTS+1; + end; + +OnKillAverage: + set @dd5_score, @dd5_score+10; + set $@DD5_PTS, $@DD5_PTS+10; + end; + +OnKillStrong: + set @dd5_score, @dd5_score+25; + set $@DD5_PTS, $@DD5_PTS+25; + end; + +/////////////////////////////////////////////////////////// +// Core +OnInit: + setarray $@DD5MB_WEAK, 1155, 1156, 1155, 1156, 1155, 1156, 1157, 1158; + setarray $@DD5MB_AVERAGE, 1159, 1160, 1159, 1160, 1159, 1160, 1157, 1158; + setarray $@DD5MB_STRONG, 1152, 1153, 1154, 1152, 1153, 1154, 1152, 1153, 1154; + setarray $@DD5MB_BOSSLV, 1146, 1147, 1140, 1141, 1143, 1149, 1148, 1140; + // Flower 1151, Mouboo 1158 + end; + +OnMiteyo: + if ($DOOMSDAY != 3) + end; + if ($@DD5_HP < 1) + end; + message strcharinfo(0), "Estimated boss HP: "+($@DD5_HP+rand(-100, 100)); + end; +} + +//////////////////////////////////////////////////////////////////////////////// +function|script|DD5SpawnNoob +{ + areamonster "099-4", 20, 20, 75, 75, "", $@DD5MB_WEAK[rand(getarraysize($@DD5MB_WEAK))], 3, "#TMWFinalExam::OnKillWeak"; + areamonster "099-5", 20, 20, 75, 75, "", $@DD5MB_WEAK[rand(getarraysize($@DD5MB_WEAK))], 3, "#TMWFinalExam::OnKillWeak"; + set $@DD5_MOBC, $@DD5_MOBC-1; + return; +} +function|script|DD5SpawnRegular +{ + if (rand(6) % 2 == 0) + areamonster "099-4", 20, 20, 75, 75, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], 1, "#TMWFinalExam::OnKillAverage"; + areamonster "099-5", 20, 20, 75, 75, "", $@DD5MB_AVERAGE[rand(getarraysize($@DD5MB_AVERAGE))], 2, "#TMWFinalExam::OnKillAverage"; + set $@DD5_MOBC, $@DD5_MOBC-1; + return; +} +function|script|DD5SpawnPro +{ + if (rand(6) % 2 == 0) + areamonster "099-4", 20, 20, 75, 75, "", $@DD5MB_STRONG[rand(getarraysize($@DD5MB_STRONG))], 1, "#TMWFinalExam::OnKillStrong"; + areamonster "099-5", 20, 20, 75, 75, "", $@DD5MB_STRONG[rand(getarraysize($@DD5MB_STRONG))], 1, "#TMWFinalExam::OnKillStrong"; + set $@DD5_MOBC, $@DD5_MOBC-1; + return; +} + +///////////////////////////////////////////////// +function|script|DD5RainCheck +{ + set $@DD5_RAIN, 0; + + // Search for rain + set .@p, get(.max_radius, "rain") + 1; + foreach 1, getmap(), POS_X-.@p, POS_Y-.@p, POS_X+.@p, POS_Y+.@p, "#TMWFinalExam::OnRainCheck"; + + // Not in rain - nullify damage + if (!($@DD5_RAIN)) + set @dd5_dmg, 0; + return; +} + +///////////////////////////////////////////////// +function|script|DD5DEFCONCheck +{ + // Shearing magic is active? + if (@chipchipspell[2] > 0) + goto L_Shear; + goto L_Loop; + +L_Shear: + set @dd5_shear, 1; + addtimer 0, "shear::OnDischarge"; + goto L_Loop; + +L_Loop: + if ($@DD5_DEFCON == 0) + goto L_DEFCON0; + if ($@DD5_DEFCON == 1) + goto L_DEFCON1; + if ($@DD5_DEFCON == 2) + goto L_DEFCON2; + if ($@DD5_DEFCON == 3) + goto L_DEFCON3; + if ($@DD5_DEFCON == 4) + goto L_DEFCON4; + if ($@DD5_DEFCON == 5) + goto L_DEFCON5; + if ($@DD5_DEFCON == 6) + goto L_DEFCON6; + if ($@DD5_DEFCON == 7) + goto L_DEFCON7; + if ($@DD5_DEFCON == 8) + goto L_DEFCON8; + debugmes "ERROR INVALID DEFCON: "+$@DD5_DEFCON; + goto L_Return; + +// DEFCON 0 - Vulnerable +L_DEFCON0: + goto L_Return; + +// DEFCON 1 - Invulnerable +L_DEFCON1: + // FIXME + if (@dd5_shear) + goto L_Return; + set @dd5_dmg, 0; + goto L_Return; + +// DEFCON 2 - Double Defense +L_DEFCON2: + set @dd5_dmg, @dd5_dmg/2; + goto L_Return; + +// DEFCON 3 - Potion Immunity +L_DEFCON3: + if (sc_check(sc_raiseattackspeed0)) + set @dd5_dmg, 0; + if (sc_check(sc_raiseattackstrength)) + set @dd5_dmg, 0; + goto L_Return; + +// DEFCON 4 - Water Vulnerable +L_DEFCON4: + callfunc "DD5RainCheck"; + goto L_Return; + +// DEFCON 5 - Ranged Invulnerable +L_DEFCON5: + if (ATTACKRANGE > 2) + set @dd5_dmg, 0; + goto L_Return; + +// DEFCON 6 - Bone Vulnerable +L_DEFCON6: + // Shearing is immune to DEFCON 6 + if (@dd5_shear) + goto L_Return; + // Not using the allowed equips + if (getequipid(equip_arrow) != 1282 && getequipid(equip_hand1) != 570) + set @dd5_dmg, 0; + // Lame check for bows because I'm lazy + if (getequipid(equip_arrow) == 1282 && ATTACKRANGE < 4) + set @dd5_dmg, 0; + goto L_Return; + +// DEFCON 7 - Melee Absorb +L_DEFCON7: + if (ATTACKRANGE < 3) + set @dd5_dmg, 0-(@dd5_dmg); + goto L_Return; + +// DEFCON 8 - GP Greed +L_DEFCON8: + if (Zeny < @dd5_dmg*10) + set @dd5_dmg, 0; + set Zeny, Zeny-(@dd5_dmg*10); + goto L_Return; + +L_Return: + set @dd5_shear, 0; + return; +} + +//////////////////////////////////////////////////////////////////////////////// +function|script|FinalExamAttack +{ + // Failsafe + if ($@DD5_STATUS != 3 && $@DD5_STATUS != 5 && $@DD5_STATUS != 7) + goto L_Return; + + // CD Initial failsafe + if (!@dd5_timer) + set @dd5_timer, 1-2147483647-1; + + // CD Failsafe + if (@dd5_timer > 1 && gettimetick(0) < 1) + set @dd5_timer, gettimetick(0); + + // Cooldown + if (gettimetick(0) < @dd5_timer) + goto L_Return; + + // Verify range + if (!(isin("099-5", 50-ATTACKRANGE, 49-ATTACKRANGE, 50+ATTACKRANGE, 49+ATTACKRANGE))) + goto L_Return; + + // Assign attack speed delay - 300ms with pots, 600ms without + set @dd5_timer, if_then_else(sc_check(sc_raiseattackspeed0), gettimetick(0)+300, gettimetick(0)+600); + + // Calculate HIT and CRIT rate + set @dd5_crit, (rand(10000) < CRIT); + if (rand(400) > HIT && !@dd5_crit) + goto L_Miss; + + // Calculate damage + set @dd5_dmg, ATK1+BASE_ATK; + + // Strength Potion - DMG +50% + if (sc_check(sc_raiseattackstrength)) + set @dd5_dmg, @dd5_dmg*15/10; + + // Boss defense + set @dd5_dmg, @dd5_dmg*(11-$@DD5_STATUS)/10; + + // Consider criticals (no defense disregard, though) + if (@dd5_crit) + set @dd5_dmg, @dd5_dmg*2; + + // Adjust to Stages + if ($@DD5_STATUS == 5) + goto L_Rainy; + if ($@DD5_STATUS == 7) + goto L_Defcon; + goto L_Damage; + +L_Rainy: + callfunc "DD5RainCheck"; + if (!($@DD5_RAIN)) + goto L_Miss; + goto L_Damage; + +L_Defcon: + callfunc "DD5DEFCONCheck"; + if (@dd5_dmg == 0) + goto L_Miss; + if (@dd5_dmg < 1) + goto L_Absorb; + goto L_Damage; + +L_Absorb: + // Ops! Zax appreciates the heal! + set $@DD5_HP, $@DD5_HP-@dd5_dmg; + message strcharinfo(0), "Battle : Absorbed +"+@dd5_dmg+" HP"; + goto L_Return; + +L_Damage: + // Apply the damage! + set $@DD5_HP, $@DD5_HP-@dd5_dmg; + set @dd5_score, @dd5_score+min(25, @dd5_dmg/50); + set $@DD5_PTS, $@DD5_PTS+min(25, @dd5_dmg/50); + message strcharinfo(0), "Battle : Damage -"+@dd5_dmg+" HP"; + + // Fire events if HP < 0 + if ($@DD5_HP <= 0) + goto L_Slain; + goto L_Return; + +L_Miss: + message strcharinfo(0), "Battle : Miss"; + return; + +L_Slain: + set @dd5_score, @dd5_score+100; + set $@DD5_PTS, $@DD5_PTS+100; + set BOSS_POINTS, BOSS_POINTS + 25; + if ($@DD5_STATUS == 3) + donpcevent "#TMWFinalExam::OnWarmedUp0"; + if ($@DD5_STATUS == 5) + donpcevent "#TMWFinalExam::OnShowdown0"; + if ($@DD5_STATUS == 7) + donpcevent "#TMWFinalExam::OnEpilogue0"; + message strcharinfo(0), "You gained 25 Boss Points!"; + return; + +L_Return: + return; +} + +//////////////////////////////////////////////////////////////////////////////// +// Puppets +099-5,52,35,0|script|Jande#0|426 +{ + message strcharinfo(0), "Jande : What are you waiting for?"; + end; +OnInit: + disablenpc strnpcinfo(0); + end; +} + +// Puppets +099-5,47,34,0|script|Tal#0|427 +{ + message strcharinfo(0), "Tal : What are you waiting for?"; + end; +OnInit: + disablenpc strnpcinfo(0); + end; +} + +// Puppets +099-5,49,35,0|script|Anon|425 +{ + message strcharinfo(0), "Anon : What are you waiting for?"; + end; +OnInit: + disablenpc strnpcinfo(0); + end; +} + +// Puppets +099-5,51,33,0|script|Flying Ship|428 +{ + message strcharinfo(0), "WHAT. IN. NAME. OF. JANDE. IS. THAT. THING?!"; + end; +OnInit: + disablenpc strnpcinfo(0); + end; +} + +// Puppets +099-5,51,33,0|script|Gema III|395 +{ + if ($@DD5_STATUS != 9) + goto L_TooEarly; + if (@dd5_cutscene) + end; + mes "##1Embark on Gema III in pursuit?##0"; + mes "You may be unable to return here!"; + next; + menu + "Yes",L_Yes, + "No",L_No; + +L_No: + close; + +L_Yes: + set @dd5_cutscene, 1; + // Stop rendering the map and Embark + mapmask 1 | 2; + music "epilogue.ogg"; + if (debug) + addtimer 5000, "Gema III::OnDebugPrompt"; + if (!debug) + addtimer 300, "Gema III::OnStart"; + close; + +OnStart: + specialeffect2 53; + message strcharinfo(0), "But it might be too late."; + addtimer 2300, "Gema III::OnFPS01"; + end; + +OnFPS01: + message strcharinfo(0), "Brave adventurers from all around the world,"; + addtimer 2500, "Gema III::OnFPS02"; + end; + +OnFPS02: + message strcharinfo(0), "Marches toward that unknown island,"; + addtimer 2100, "Gema III::OnFPS03"; + end; + +OnFPS03: + message strcharinfo(0), "Said to have the key to stop Zax De'Kagen's ambitions."; + addtimer 4300, "Gema III::OnFPS04"; + end; + +OnFPS04: + message strcharinfo(0), "Unbeknownst to them, Zax already made his move."; + addtimer 3200, "Gema III::OnFPS05"; + end; + +OnFPS05: + message strcharinfo(0), "Before anyone can even reach him, he executes the plan,"; + addtimer 3600, "Gema III::OnFPS06"; + end; + +OnFPS06: + message strcharinfo(0), "Carefully written for over a decade."; + addtimer 3100, "Gema III::OnFPS07"; + end; + +OnFPS07: + message strcharinfo(0), "Using Nu'Rem's body as a catalyst,"; + addtimer 2000, "Gema III::OnFPS08"; + end; + +OnFPS08: + message strcharinfo(0), "The Ether Spirit of Air is finally compromised."; + addtimer 2900, "Gema III::OnFPS09"; + end; + +OnFPS09: + message strcharinfo(0), "Half from the Etheral Powers of Air,"; + addtimer 2300, "Gema III::OnFPS10"; + end; + +OnFPS10: + message strcharinfo(0), "Are absorbed by The Mana Seal."; + addtimer 2100, "Gema III::OnFPS11"; + end; + +OnFPS11: + message strcharinfo(0), "The other half collides with the Earth Spirit,"; + addtimer 2400, "Gema III::OnFPS12"; + end; + +OnFPS12: + message strcharinfo(0), "And a new element is born."; + addtimer 2200, "Gema III::OnFPS13"; + end; + +OnFPS13: + message strcharinfo(0), "History begins to rewrite itself,"; + addtimer 2200, "Gema III::OnFPS14"; + end; + +OnFPS14: + message strcharinfo(0), "Who's Zax? Something is not right."; + addtimer 3600, "Gema III::OnFPS15"; + end; + +OnFPS15: + message strcharinfo(0), "But what will be of our brave adventurers,"; + addtimer 3400, "Gema III::OnFPS16"; + end; + +OnFPS16: + message strcharinfo(0), "lost midst all this cataclysm?"; + addtimer 2800, "Gema III::OnFPS17"; + end; + +OnFPS17: + message strcharinfo(0), "Will they reach Nu'Rem's grave?"; + addtimer 2400, "Gema III::OnFPS18"; + end; + +OnFPS18: + message strcharinfo(0), "Will they put a stop to Zax's evil ambitions?"; + addtimer 3000, "Gema III::OnFPS19"; + end; + +OnFPS19: + message strcharinfo(0), "Follow their journey, and take back the world, in"; + addtimer 3600, "Gema III::OnFPS20"; + end; + +OnFPS20: + message strcharinfo(0), "##2##BTHE MANA WORLD: REVOLT##b##0"; + if (debug) + addtimer 5000, "Gema III::OnDebugPrompt"; + if (!debug) + addtimer 5000, "Gema III::OnPrompt"; + end; + +OnPrompt: + mes ".:: THE MANA WORLD - REVOLT ::."; + mes ""; + mes "Server Name: ##BThe Mana World##b"; + mes "Server Address: ##Bserver.themanaworld.org##b"; + mes "Server Port: ##B6969##b"; + mes "Server Type: ##BEvol2##b"; + mes "Server Description: ##BMain Server for The Mana World##b"; + mes ""; + mes "##BCOMING SOON##b"; + mes "##BMONTH DAY, 18:00 UTC##b"; + next; + mes "##BPre-register##b here:"; + mes "[@@https://vault.themanaworld.org/|@@]"; + mes "Max. 1 account per player."; + next; + goto L_MissionComplete; + +OnDebugPrompt: + mes ".:: THE MANA WORLD - REVOLT ::."; + mes ""; + mes "##BCOMING SOON##b"; + mes ""; + mes "Thanks for testing!"; + mes "Stay tuned for updates!"; + mes ""; + mes "-- The Mana World Team"; + next; + goto L_MissionComplete; + +L_MissionComplete: + set @dd5_cutscene, 0; + warp "009-1", 52, 40; + getexp 1000000, 0; + if (strcharinfo(0) == $@DD5_TALLY$) + goto L_Winner; + close; + +L_Winner: + getitem "BlueRose", 1; + set $@DD5_TALLY$, ""; + set #DD5_TALLY, 1; + mes "##2You were the MVP with "+$@DD5_TALLY_+" points!##0"; + mes "##2Exchange this blue rose with a Game Master!##0"; + close; + +L_TooEarly: + mes "[" + strcharinfo(0) + "]"; + mes "It is Gema III! How did they manage to bring the ship here?!"; + close; + +OnInit: + disablenpc "Gema III"; + end; +} +///////////////////////////////////////////////////// +// Puppets, timers for Stage 2 +099-5,50,49,0|script|Xakelbael the Dark#0|400 +{ + callfunc "FinalExamAttack"; + end; +OnInit: + disablenpc "Xakelbael the Dark#0"; + end; + +OnTimer50000: + areatimer 0, "099-5", 20, 20, 75, 75, 10, "#TMWFinalExam::OnMTFourthFall"; + initnpctimer; + npctalk "Xakelbael the Dark#0", "Fourth Fall!"; + end; +OnEnable: + initnpctimer; + end; +OnAdjustSweet: + if ($@DD5_STATUS != 5) + end; + setnpctimer min(49000, getnpctimer(0)-rand(2500,5000)); + end; +OnDisable: + stopnpctimer; + end; +} + +// Puppets, the timer on this one is for Stage 1 +099-5,50,49,0|script|Zax De'Kagen#0|400 +{ + callfunc "FinalExamAttack"; + end; +OnInit: + disablenpc "Zax De'Kagen#0"; + end; + +OnTimer18000: + if ($@DD5_STATUS != 3) + end; + enablenpc strnpcinfo(0); + end; +OnTimer24000: + if ($@DD5_STATUS != 3) + end; + initnpctimer; + disablenpc strnpcinfo(0); + end; +OnTimer80000: + if ($@DD5_STATUS != 7) + end; + initnpctimer; + npctalk "Zax De'Kagen#0", "Bliss Of Oblivion!"; + donpcevent "#TMWFinalExam::OnBlissOblivion"; + end; + +OnAdjustBat: + if (getnpctimer(0) < 18000) + setnpctimer max(17000, getnpctimer(0)+rand(1000,2500)); + end; +OnAdjustBeets: + if (getnpctimer(0) > 18000) + setnpctimer min(18000, getnpctimer(0)-rand(3000,5000)); + end; +OnAdjustPotion: + if ($@DD5_STATUS != 7) + end; + setnpctimer max(0, min(75000, getnpctimer(0)-rand(5000, 15000))); + // If it is me testing then it forwards >.> + if (debug && strcharinfo(0) == "Jesusalva") + setnpctimer 75000; + end; + +OnEnable: + disablenpc "Zax De'Kagen#0"; + initnpctimer; + end; +OnDisable: + enablenpc strnpcinfo(0); + stopnpctimer; + end; +OnFinal: + initnpctimer; + end; +OnAbort: + stopnpctimer; + areatimer 0, "099-4", 20, 20, 75, 75, 1000, "#TMWFinalExam::OnMTWarpTo0"; + donpcevent "Xakelbael the Dark#0::OnDisable"; + end; +} + diff --git a/world/map/npc/099-6/_warps.txt b/world/map/npc/099-6/_warps.txt index 703b3ca9..ccde0124 100644 --- a/world/map/npc/099-6/_warps.txt +++ b/world/map/npc/099-6/_warps.txt @@ -1,3 +1,23 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. -// Nu'Ram-Battle warps +// Keshlam's Adventurer's Guild Quarters warps +099-6,121,132|warp|-1,-1,099-1,21,16 +099-6,92,132|warp|-1,-1,099-1,58,16 +099-6,59,21|warp|-1,-1,099-1,85,16 +099-6,26,132|warp|-1,-1,099-1,97,31 +099-6,90,21|warp|-1,-1,099-1,104,31 +099-6,121,101|warp|-1,-1,099-1,108,24 +099-6,91,101|warp|-1,-1,099-1,82,44 +099-6,60,132|warp|-1,-1,099-1,69,25 +099-6,60,101|warp|-1,-1,099-1,95,61 +099-6,25,22|warp|-1,-1,099-1,78,58 +099-6,25,101|warp|-1,-1,099-1,66,58 +099-6,121,76|warp|-1,-1,099-1,34,51 +099-6,91,75|warp|-1,-1,099-1,27,51 +099-6,59,75|warp|-1,-1,099-1,25,77 +099-6,25,75|warp|-1,-1,099-1,40,104 +099-6,121,48|warp|-1,-1,099-1,29,136 +099-6,91,49|warp|-1,-1,099-1,58,129 +099-6,59,49|warp|-1,-1,099-1,84,114 +099-6,25,49|warp|-1,-1,099-1,83,105 +099-6,121,21|warp|-1,-1,099-1,79,72 diff --git a/world/map/npc/099-8/mobs.txt b/world/map/npc/099-8/mobs.txt index 67518836..b46efc08 100644 --- a/world/map/npc/099-8/mobs.txt +++ b/world/map/npc/099-8/mobs.txt @@ -14,6 +14,10 @@ OnClock1200: goto L_Main; L_Main: + // Do not waste RAM/CPU if we don't need it + if ($DOOMSDAY_TWARP) + end; + // 1 MONSTER PER 30 TILES, TOTAL 4320 MONSTERS // 1440 monsters of each kind // 360 monsters per quadrand; Center is the pillar in (201, 201) diff --git a/world/map/npc/commands/python.txt b/world/map/npc/commands/python.txt index cbea85be..4f4fcc05 100644 --- a/world/map/npc/commands/python.txt +++ b/world/map/npc/commands/python.txt @@ -40,6 +40,7 @@ L_DoPrank: addtimer 380, strnpcinfo(0) + "::OnKill"; end; + OnInit: registercmd "#python", strnpcinfo(0); end; diff --git a/world/map/npc/functions/doomsday.txt b/world/map/npc/functions/doomsday.txt index 02d0957c..cc9328fa 100644 --- a/world/map/npc/functions/doomsday.txt +++ b/world/map/npc/functions/doomsday.txt @@ -37,7 +37,8 @@ function|script|DoomsdayDebug mes "Zealite Upgrade? "+if_then_else($DOOMSDAY_SUMMON > 1, "Yes", "No"); mes ""; mes "Act 5:"; - mes "Warp to fake Keshlam? "+if_then_else($DOOMSDAY_TWARP > 1, "No", "Yes"); + mes "Warp to fake Keshlam? "+if_then_else($DOOMSDAY_TWARP, "No", "Yes"); + mes "Vanilla Mode? "+if_then_else($DOOMSDAY_VANILLA, "Yes", "No"); //($DOOMSDAY_SUMMON ? "Yes" : "No"); next; // Only GM 80 and above can modify Doomsday @@ -59,6 +60,7 @@ function|script|DoomsdayDebug "[2][4][4] Toggle Zealite Upgrade",L_Zealite, "[3][5][0] Keshlam Warps",L_Keshlam, "[3][5][1] Kage's Final Battle",L_Kage, + "[3][5][2] Vanilla Mode",L_Vanilla, "[-] Close",L_Close; L_Close: @@ -174,6 +176,8 @@ L_Keshlam: enablenpc "Arch-Wizard#9"; enablenpc "Chest#DarkRose"; set $DOOMSDAY, 3; + set $DOOMSDAY_TWARP, 0; + set $DOOMSDAY_VANILLA, 0; donpcevent "Doomsday::OnJanitor"; // TODO gmlog strcharinfo(0) + " changed doomsday to Act 5: The Doomsday."; gmlog strcharinfo(0) + " changed doomsday warp to Keshlam Maze"; @@ -185,6 +189,12 @@ L_Kage: gmlog strcharinfo(0) + " changed doomsday warp to Abandoned Building"; return; +L_Vanilla: + set $DOOMSDAY_VANILLA, 1; + donpcevent "Doomsday::OnJanitor"; // TODO + gmlog strcharinfo(0) + " disabled rewards from final showdown (VANILLA)."; + return; + } // Doomsday script controller @@ -226,7 +236,9 @@ OnJanitor: disablenpc "Arch-Wizard#_DT"; disablenpc "Arch-Wizard#_DH"; disablenpc "Arch-Wizard#_DN"; - // TODO: Act 5: Not needed? + // Act 5: Cleanup + if ($DOOMSDAY == 3 && !$DOOMSDAY_TWARP) + donpcevent "Keshlam Maze::OnInit"; // Spawn monsters if needed // Clear timers setnpctimer 0; stopnpctimer; @@ -1251,9 +1263,16 @@ OnInit: goto L_EndRateLimit; set #HAYSTACKTIMEPENALTY, gettimetick(2) + 5; message strcharinfo(0), "Haystack : What exactly are you looking for?"; - if (rand(20) == 0) getitem "BentNeedle", 1; // 5% chance (was 1% on 2010) + // 5% chance (was 1% on 2010) + if (rand(20) == 0) + goto L_GetNeedle; close; +L_GetNeedle: + set #HAYSTACKTIMEPENALTY, gettimetick(2) + 3600; // 1 hours delay + getitem "BentNeedle", 1; + end; + L_EndTooYoung: end; @@ -1263,20 +1282,24 @@ L_EndRateLimit: } // This function controls death, both on Zax Domains as with Black Rose +// Undead cannot use the Black Rose :> function|script|DoomsdayAct5 { - if ($DOOMSDAY != 3) + if ($DOOMSDAY != 3 || Class == 6) goto L_Return; if (getmap() == "099-8") goto L_Return; + if (getmap() == "099-5") + goto L_WaitRoom; + if (getmap() == "099-1" || getmap() == "099-2" || getmap() == "099-3" || getmap() == "099-4" || getmap() == "099-6") + goto L_WarpOut; if (countitem("BlackRose")) goto L_WarpTo; - if (getmap() == "099-1" || getmap() == "099-2" || getmap() == "099-3" || getmap() == "099-6") - goto L_WarpOut; goto L_Return; L_WarpTo: delitem "BlackRose", 1; + getitem "DarkPetal", 1; heal 100000, 10000; if ($DOOMSDAY_TWARP == 0) goto L_KeshlamMaze; @@ -1287,10 +1310,25 @@ L_WarpTo: L_WarpOut: if (countitem("DarkPetal") < 1) goto L_Failure; + if (rand(9) == 6) + goto L_Failure; delitem "DarkPetal", 1; + heal 100000, 10000; + warp "009-1", 52, 40; + message strcharinfo(0), "The Dark Petal has protected you from certain death!"; + return; + +L_WaitRoom: + heal 100000, 10000; + warp "099-4", 50, 49; + message strcharinfo(0), "You were defeated in combat and warped to a parallel dimension where Zax does not exist."; + message strcharinfo(0), "Try to survive and provide support to your friends from the backline!"; return; L_Failure: + heal 100000, 10000; + warp "009-1", 52, 40; + message strcharinfo(0), "You returned to life as an undead!"; set Class, 6; return; diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt index 6acc5f5f..426bf28c 100644 --- a/world/map/npc/functions/magic.txt +++ b/world/map/npc/functions/magic.txt @@ -13,6 +13,9 @@ function|script|MagicGainBasic { set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION; + // Doomsday Act 5 utils + if (getmap() == "099-5") + addtimer 10, "Zax De'Kagen#0::OnAdjustPotion"; return; } diff --git a/world/map/npc/functions/slot_machine.txt b/world/map/npc/functions/slot_machine.txt index cc8e5a70..8da5e46f 100644 --- a/world/map/npc/functions/slot_machine.txt +++ b/world/map/npc/functions/slot_machine.txt @@ -24,6 +24,28 @@ L_Play: goto L_Lost; if(@Temp1 != @Temp3) goto L_Lost; + if (CSN >= 9) + goto L_Default; + if (rand(6) < CSN) + goto L_Jackpot; + set CSN, CSN+1; + goto L_Default; + +L_Jackpot: + mes "Congratulations! You won!"; + mes "However, the slot machine"; + mes "do not give you the coins!"; + next; + mes "[Staff]"; + mes "\"I apologize for this problem."; + mes "I see you are a huge client of"; + mes "ours, so I'll give you a Monocle"; + mes "as a token of apology.\""; + getitem "Monocle", 1; + set CSN, 9; + goto L_Close; + +L_Default: mes "Congratulations! You won!"; mes "You get 10 casino coins"; getitem "CasinoCoins", 10; diff --git a/world/map/npc/items/pickled_beets.txt b/world/map/npc/items/pickled_beets.txt index 4aaa1f1c..f05b73ca 100644 --- a/world/map/npc/items/pickled_beets.txt +++ b/world/map/npc/items/pickled_beets.txt @@ -6,5 +6,8 @@ function|script|usePickledBeets elif (Class == 2) setlook LOOK_HAIR_COLOR, 18; // add more here for races that have purple + + if ($DOOMSDAY == 3) + addtimer 10, "#TMWFinalExam::OnPickledBeets"; return; } diff --git a/world/map/npc/items/rubber_bat.txt b/world/map/npc/items/rubber_bat.txt index edf12416..9eb3725d 100644 --- a/world/map/npc/items/rubber_bat.txt +++ b/world/map/npc/items/rubber_bat.txt @@ -7,5 +7,8 @@ function|script|rubberBat L_Return: getitem "RubberBat", 1; + debugmes "Check"; + if ($DOOMSDAY == 3) + addtimer 10, "#TMWFinalExam::OnRubberBat"; return; } diff --git a/world/map/npc/items/shock_sweet.txt b/world/map/npc/items/shock_sweet.txt index ea5992c3..dc61790d 100644 --- a/world/map/npc/items/shock_sweet.txt +++ b/world/map/npc/items/shock_sweet.txt @@ -1,5 +1,7 @@ function|script|useShockSweet { + if (getmap() == "099-5") + addtimer 0, "Xakelbael the Dark#0::OnAdjustSweet"; if (rand(5)) goto L_Change; message strcharinfo(0), "Yuck, this tastes like earwax!"; diff --git a/world/map/npc/magic/level1-detect-magic.txt b/world/map/npc/magic/level1-detect-magic.txt index e70c6218..f22be844 100644 --- a/world/map/npc/magic/level1-detect-magic.txt +++ b/world/map/npc/magic/level1-detect-magic.txt @@ -11,6 +11,10 @@ set .@range, (@spellpower/50)+1; foreach 1, getmap(), POS_X - .@range, POS_Y - .@range, POS_X + .@range, POS_Y + .@range, strnpcinfo(0) + "::OnNearbyNpc"; + if (getmap() == "099-4") + addtimer 10, "#TMWFinalExam::OnMiteyo"; + if (getmap() == "099-5" && debug) + addtimer 10, "#TMWFinalExam::OnMiteyo"; callfunc "magic_exp"; end; diff --git a/world/map/npc/magic/level2-lay-on-hands.txt b/world/map/npc/magic/level2-lay-on-hands.txt index 819f0ea2..29d9292b 100644 --- a/world/map/npc/magic/level2-lay-on-hands.txt +++ b/world/map/npc/magic/level2-lay-on-hands.txt @@ -10,6 +10,8 @@ if (get(GM, @target_id) == 1) end; if (Hp <= get(MaxHp, @target_id) / 20) end; // hp needs to be > 1/20 * target hp callfunc "adjust_spellpower"; + if (getmap() == "099-4") goto L_SpecialRules4; + if (getmap() == "099-5") goto L_SpecialRules5; if (distance(BL_ID, @target_id) >= (((sqrt(@spellpower)*12)+@spellpower)/100)+2) end; if (sc_check(SC_HALT_REGENERATE,@target_id)) end; if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat @@ -55,6 +57,20 @@ L_Mouboo: callfunc "QuestMoubooHeal"; end; +// Special rules for a couple special maps +L_SpecialRules4: + if (getmap(@target_id) != "099-5") end; + if (sc_check(SC_HALT_REGENERATE,@target_id)) end; + if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat + set @needed, get(MaxHp, @target_id) - get(Hp, @target_id); + goto L_Pay; +L_SpecialRules5: + if (getmap(@target_id) != "099-4") end; + if (sc_check(SC_HALT_REGENERATE,@target_id)) end; + if (getequipid(equip_head, @args$) == 888) end; // magic gm top hat + set @needed, get(MaxHp, @target_id) - get(Hp, @target_id); + goto L_Pay; + OnInit: set .school, SKILL_MAGIC_LIFE; set .invocation$, chr(MAGIC_SYMBOL) + "inma"; // used in npcs that refer to this spell diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt index df8ef1c9..fac98690 100644 --- a/world/map/npc/magic/level2-rain.txt +++ b/world/map/npc/magic/level2-rain.txt @@ -9,7 +9,7 @@ OnCast: if (getskilllv(SKILL_MAGIC) < .level) end; if (Sp < 17) end; explode .@map_ext[0], getmap(), "-"; - if (.@map_ext[1] != 1) end; // XXX this is fugly, in the future let's use MF_OUTSIDE to detect if a map is "outside" or "inside" + if (.@map_ext[1] != 1 && getmap() != "099-5") end; // XXX this is fugly, in the future let's use MF_OUTSIDE to detect if a map is "outside" or "inside" if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(.school) < 4 && countitem("BottleOfWater") >= 1) delitem "BottleOfWater", 1; elif (getskilllv(.school) < 4) end; |