diff options
Diffstat (limited to 'npc/081-3/logic.txt')
-rw-r--r-- | npc/081-3/logic.txt | 65 |
1 files changed, 41 insertions, 24 deletions
diff --git a/npc/081-3/logic.txt b/npc/081-3/logic.txt index 6d98fddc..0911dd18 100644 --- a/npc/081-3/logic.txt +++ b/npc/081-3/logic.txt @@ -20,18 +20,19 @@ rif(.@cl, l("Make it a nightmare!")), rif(.@cl, l("Kill me semi-instantly!")); mes ""; - if (@menu == 1) { - closeclientdialog; + closeclientdialog; + if (@menu == 1 || .LOCKD) { close; } - .BC1ME = getcharid(3); - .@mg = monster(getmap(), 44, 36, "Existential Crisis", Santaboo, 1, .@n$+"::OnFin"); // FIXME Santaboo => SnowBallMan + .LOCKD = true; + @BC1ME = getcharid(3); + .@mg = monster(getmap(), 44, 36, "Existential Crisis", Santaboo, 1, "Pentagram#Xmas21A::OnFin"); // FIXME Santaboo => SnowBallMan // Prepare the difficulty settings // Each difficulty level doubles the nÂș of players difficulty setting // Can go up to 12 * 4 = 48, but we use 16 as the theoretical max - .@df = max(1, getmap() * ((@menu - 1) * 2)); + .@df = max(1, getmapusers(getmap()) * ((@menu - 1) * 2)); .@lv = BaseLevel; setunitdata(.@mg, UDT_MAXHP, 5000 + (.@lv * 150) + (1200 * .@df)); @@ -53,37 +54,48 @@ // Destroy the instance only after half hour has passed instance_set_timeout(1800, 1800); initnpctimer; - setnpctimer(29000); + setnpctimer(39000); disablenpc(.@n$); $@XMAS21_BC1[.@id] = X21BC1_ON; .BC1ID = .@mg; close; OnFin: - if (playerattached()) - getexp 10000, 0; - // Attach whoever broke the seal - if (attachrid(.BC1ME)) { + if (!playerattached()) { + consolemes(CONSOLEMES_ERROR, "Player not attached after Christmas 2021 victory! Script aborted!"); + end; + } + killmonsterall(getmap()); + getexp 10000, 0; + maptimer(getmap(), 10, "Pentagram#Xmas21A::OnFlush"); + end; + +// Distribute experience and handle quest progress +OnFlush: + getexp 5000, 0; + if (@BC1ME > 0) { if (!X21BC1_CLEAR()) { dispbottom l("Whatever that guardian was, the path is now clear, and the gate, open."); X21BC1_DOCLEAR(); - getexp 5000, 0; } } - stopnpctimer; + @BC1ME = 0; + .@id = X21ID(); + $@XMAS21_BC1[.@id] = X21BC1_OFF; end; // Pseudo-Magic -OnTimer30000: +OnTimer40000: + if (getunittype(.BC1ID) < 0) { + stopnpctimer; + end; + } + .CYCLE += 1; - .@m$=getmapinfo(MAPINFO_NAME); // Maybe .map$? - debugmes "HEARTBEAT"; - debugmes "map$ is %s", .map$; - debugmes "MAPINFO is %s", .@m$; - debugmes "-----------------------------------------------\n"; + .@m$=getmapinfo(MAPINFO_NAME); // We could use .map$ too areamonster(.@m$, 31, 23, 58, 50, "Snowballz", IceElement, 1+getmapusers(.@m$)); // FIXME IceElement => Snowball - if (.CYCLE % 3 != 0) { + if (.CYCLE % 2 != 0) { initnpctimer; end; } @@ -94,7 +106,7 @@ OnTimer30000: // HP > 70%, just some warm-up if (.@hp > 70) { unittalk(.BC1ID, "Blizzard!"); - rectharm(.BC1ID, 6, 6, rand2(250), Ele_Neutral, "filter_always", BL_PC); + rectharm(.BC1ID, 6, 6, rand2(250), HARM_MAGI, Ele_Neutral, "filter_always", BL_PC); // HP < 70%, cripple half the attackers } else if (.@hp > 40) { @@ -104,11 +116,12 @@ OnTimer30000: else unittalk(.BC1ID, "Blind!"); areasc2(.@m$, 44, 36, 14, rand2(15000), BL_PC, .@sc); + rectharm(.BC1ID, 5, 5, rand2(50), HARM_MAGI, Ele_Neutral, "filter_always", BL_PC); // HP < 40%, cause great damage } else if (.@hp > 15) { unittalk(.BC1ID, "Greater Blizzard!"); - rectharm(.BC1ID, 8, 8, 100+rand2(250), Ele_Neutral, "filter_always", BL_PC); + rectharm(.BC1ID, 8, 8, 100+rand2(250), HARM_MAGI, Ele_Neutral, "filter_always", BL_PC); // HP < 15%, use more dangerous conditions } else { @@ -118,6 +131,7 @@ OnTimer30000: else unittalk(.BC1ID, "Curse!"); areasc2(.@m$, 44, 36, 14, rand2(15000), BL_PC, .@sc); + rectharm(.BC1ID, 5, 5, rand2(100), HARM_MAGI, Ele_Neutral, "filter_always", BL_PC); } // Repeat forever @@ -131,7 +145,7 @@ OnInit: .distance=2; .BC1ID = 0; .CYCLE = 0; - .BC1ME = 0; + .LOCKD = false; end; } @@ -146,13 +160,15 @@ OnTouch: .@id = X21ID(); if ($@XMAS21_BC1[.@id] == X21BC1_ON) end; if ($@XMAS21_BC1[.@id] == X21BC1_OFF) { - mesn; - mesq l("Should we leave?"); + mesn l("Northen Lights"); + mes l("Past this gate, beyond the existential frontier, I can see the Northen Lights."); + mes l("Should we walk toward it?"); next; if (askyesno() == ASK_YES) { // FIXME: Alissa's ED Cutscene warp "081-1", 68, 31; } + closeclientdialog; close; } end; @@ -161,6 +177,7 @@ OnTouch: 081-3,44,50,0 script #0813Sexit NPC_HIDDEN,0,0,{ end; OnTouch: + .@id = X21ID(); if ($@XMAS21_BC1[.@id] == X21BC1_ON) end; warp "081-2", 90, 21; end; |