summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-11-21 14:06:12 -0300
committerJesusaves <cpntb1@ymail.com>2021-11-21 14:06:12 -0300
commit2ebc5a5825bfb0d453e8e9855bfbdaccf4796215 (patch)
treeafe8c44ad727e3ccec113a1342b727d784a64780 /npc
parent697ecd8708a654a675d492f161b3f8c9b72a3c15 (diff)
downloadserverdata-2ebc5a5825bfb0d453e8e9855bfbdaccf4796215.tar.gz
serverdata-2ebc5a5825bfb0d453e8e9855bfbdaccf4796215.tar.bz2
serverdata-2ebc5a5825bfb0d453e8e9855bfbdaccf4796215.tar.xz
serverdata-2ebc5a5825bfb0d453e8e9855bfbdaccf4796215.zip
Initial, draft version of the first boss chamber
Diffstat (limited to 'npc')
-rw-r--r--npc/081-3/_import.txt1
-rw-r--r--npc/081-3/logic.txt151
-rw-r--r--npc/annuals/xmas/2021.txt29
-rw-r--r--npc/functions/clear_vars.txt11
-rw-r--r--npc/magic/config.txt1
-rw-r--r--npc/scripts.conf1
6 files changed, 190 insertions, 4 deletions
diff --git a/npc/081-3/_import.txt b/npc/081-3/_import.txt
index 77c1a286..5e2a38a7 100644
--- a/npc/081-3/_import.txt
+++ b/npc/081-3/_import.txt
@@ -1,2 +1,3 @@
// Map 081-3: Existential Frontier
// This file is generated automatically. All manually added changes will be removed when running the Converter.
+"npc/081-3/logic.txt",
diff --git a/npc/081-3/logic.txt b/npc/081-3/logic.txt
new file mode 100644
index 00000000..b2fe131b
--- /dev/null
+++ b/npc/081-3/logic.txt
@@ -0,0 +1,151 @@
+// TMW Script.
+// Author:
+// Jesusalva
+// Notes:
+// Christmas 2021 - Boss Chamber #1
+// FIXME: Cleanup
+
+081-3,44,36,0 script Pentagram#Xmas21A NPC424,{
+ .@id = X21ID();
+ if ($@XMAS21_BC1[.@id]) end;
+ .@n$ = instance_npcname("Pentagram#Xmas21A");
+ .@cl = X21BC1_CLEAR();
+
+ mesn;
+ mesq l("Should we break the Pentagram?");
+ next;
+ select
+ l("I'm not ready yet."),
+ l("Bring it on!"),
+ rif(.@cl, l("Make it harder!")),
+ rif(.@cl, l("Make it a nightmare!")),
+ rif(.@cl, l("Kill me semi-instantly!"));
+ mes "";
+ if (@menu == 1) {
+ closeclientdialog;
+ close;
+ }
+
+ .@mg = monster(getmap(), 44, 36, "Existential Crisis", Santaboo, 1, .@n$+"::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));
+ .@lv = BaseLevel;
+
+ setunitdata(.@mg, UDT_MAXHP, 5000 + (.@lv * 150) + (1200 * .@df));
+ setunitdata(.@mg, UDT_HP, 5000 + (.@lv * 150) + (1200 * .@df));
+
+ setunitdata(.@mg, UDT_ADELAY, 2200 - max(1200, 75 * .@df));
+ setunitdata(.@mg, UDT_ATKRANGE, 3);
+
+ /*
+ setunitdata(.@mg, UDT_ATKMIN, .@lv*4+.@df*3);
+ setunitdata(.@mg, UDT_ATKMAX, .@lv*4+.@df*3);
+ */
+ setunitdata(.@mg, UDT_ATKMIN, (.@lv+.@df)*5);
+ setunitdata(.@mg, UDT_ATKMAX, (.@lv+.@df)*6);
+ setunitdata(.@mg, UDT_DEF, min(50+.@df, 98));
+ setunitdata(.@mg, UDT_MDEF, min(50+.@df, 98));
+ setunitdata(.@mg, UDT_HIT, 9999);
+
+ // Destroy the instance only after half hour has passed
+ instance_set_timeout(1800, 1800);
+ initnpctimer;
+ setnpctimer(29000);
+ disablenpc(.@n$);
+ $@XMAS21_BC1[.@id] = X21BC1_ON;
+ .BC1ID = .@mg;
+ close;
+
+OnFin:
+ // FIXME: Memorize who broke the seal
+ // and attach the seal broker
+ // FIXME: Mark quest as complete
+ // FIXME: Give experience to the MVP as well
+ stopnpctimer;
+ end;
+
+// Pseudo-Magic
+OnTimer30000:
+ .CYCLE += 1;
+ .@m$=getmapinfo(MAPINFO_NAME); // Maybe .map$?
+ debugmes "HEARTBEAT";
+ debugmes "map$ is %s", .map$;
+ debugmes "MAPINFO is %s", .@m$;
+ debugmes "-----------------------------------------------\n";
+ areamonster(.@m$, 31, 23, 58, 50, "Snowballz", IceElement, 1+getmapusers(.@m$)); // FIXME IceElement => Snowball
+
+ if (.CYCLE % 3 != 0) {
+ initnpctimer;
+ end;
+ }
+
+ // The boss special skill depends on its health
+ .@hp = 100 * getunitdata(.BC1ID, UDT_HP) / getunitdata(.BC1ID, UDT_MAXHP);
+
+ // HP > 70%, just some warm-up
+ if (.@hp > 70) {
+ unittalk(.BC1ID, "Blizzard!");
+ rectharm(.BC1ID, 6, 6, rand2(250), Ele_Neutral, "filter_always", BL_PC);
+
+ // HP < 70%, cripple half the attackers
+ } else if (.@hp > 40) {
+ .@sc = any(SC_SILENCE, SC_BLIND);
+ if (.@sc == SC_SILENCE)
+ unittalk(.BC1ID, "Silence!");
+ else
+ unittalk(.BC1ID, "Blind!");
+ areasc2(.@m$, 44, 36, 14, rand2(15000), BL_PC, .@sc);
+
+ // 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);
+
+ // HP < 15%, use more dangerous conditions
+ } else {
+ .@sc = any(SC_POISON, SC_CURSE);
+ if (.@sc == SC_SILENCE)
+ unittalk(.BC1ID, "Poison!");
+ else
+ unittalk(.BC1ID, "Curse!");
+ areasc2(.@m$, 44, 36, 14, rand2(15000), BL_PC, .@sc);
+ }
+
+ // Repeat forever
+ initnpctimer;
+ end;
+
+OnInit:
+ .distance=2;
+ .BC1ID = 0;
+ .CYCLE = 0;
+ end;
+}
+
+
+081-3,44,22,0 script #0813Nexit NPC_HIDDEN,0,0,{
+ if (!X21BC1_CLEAR()) {
+ dispbottom l("A strong magic barrier prevents me from using this exit.");
+ end;
+ }
+ .@id = X21ID();
+ if ($@XMAS21_BC1[.@id] == X21BC1_ON) end;
+ if ($@XMAS21_BC1[.@id] == X21BC1_OFF) {
+ mesn;
+ mesq l("Should we leave?");
+ next;
+ if (askyesno() == ASK_YES) {
+ // FIXME: Alissa's ED Cutscene
+ warp "081-1", 68, 31;
+ }
+ close;
+ }
+ end;
+OnInit:
+ .distance=2;
+ end;
+}
+
diff --git a/npc/annuals/xmas/2021.txt b/npc/annuals/xmas/2021.txt
new file mode 100644
index 00000000..23db64d5
--- /dev/null
+++ b/npc/annuals/xmas/2021.txt
@@ -0,0 +1,29 @@
+// TMW Script.
+// Author:
+// Jesusalva
+// Notes:
+// Christmas 2021 - Configuration Files
+
+function script X21ID {
+ return (getcharid(1) > 0 ? getcharid(1) : getcharid(3));
+}
+
+function script X21TYPE {
+ return (getcharid(1) > 0 ? IOT_PARTY : IOT_CHAR);
+}
+
+function script X21BC1_CLEAR {
+ return (XMAS2021 & X21_BOSSDEFEAT);
+}
+
+/* You cannot fiddle with party in this region */
+080-1 mapflag partylock
+081-1 mapflag partylock
+//081-2 mapflag partylock
+081-3 mapflag partylock
+
+/* Secure regions */
+081-3 mapflag zone MMO
+081-3 mapflag nosave 000-1,22,22
+
+
diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt
index b5222e43..ee4a2151 100644
--- a/npc/functions/clear_vars.txt
+++ b/npc/functions/clear_vars.txt
@@ -1,4 +1,10 @@
// Update variables on server init, login and logout
+
+function script isChristmas21 {
+ // FIXME: 12/12 = 346; 26/12 = 360; 09/01 = 9 (OBVIOUSLY)
+ return (gettime(8) >= 346 || gettime(8) <= 9);
+}
+
function script ClearVariables {
// Some temporary bugfix
GM = getgroupid();
@@ -138,8 +144,7 @@ function script ClearVariables {
}
// Christmas 2021 Event
- // FIXME: 12/12 = 346; 26/12 = 360; 09/01 = 9 (OBVIOUSLY)
- if (gettime(8) >= 346 || gettime(8) <= 9) {
+ if (isChristmas21()) {
#OLD_EXP=BaseExp;
#OLD_LV=BaseLevel;
}
@@ -153,7 +158,7 @@ function script FlushVariables {
##01_TMWEXP = 0;
// Christmas 2021 Event
- if (gettime(8) >= 346 || gettime(8) <= 9) {
+ if (isChristmas21()) {
#NEW_LV+=(BaseLevel-#OLD_LV);
if (BaseLevel != #OLD_LV) {
#NEW_EXP=BaseExp;
diff --git a/npc/magic/config.txt b/npc/magic/config.txt
index f8135b43..285fa379 100644
--- a/npc/magic/config.txt
+++ b/npc/magic/config.txt
@@ -237,7 +237,6 @@ function script rectharm {
continue;
harm(.@mbs[.@i], .@d, .@t, .@e);
specialeffect(FX_ATTACK, AREA, .@mbs[.@i]);
- // TODO: Handle MobPt to don't overload timer system?
}
return;
}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 2b6aa0f8..c5f4bc98 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -126,6 +126,7 @@
"npc/annuals/xmas/list.txt",
"npc/annuals/xmas/reagents.txt",
"npc/annuals/xmas/mobmanager.txt",
+"npc/annuals/xmas/2021.txt",
"npc/annuals/halloween/config.txt",
"npc/annuals/halloween/debug.txt",
"npc/annuals/halloween/munro.txt",