summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/023-3/logic.txt93
-rw-r--r--npc/024-16/king.txt2
2 files changed, 88 insertions, 7 deletions
diff --git a/npc/023-3/logic.txt b/npc/023-3/logic.txt
index be9bf7333..d9320848b 100644
--- a/npc/023-3/logic.txt
+++ b/npc/023-3/logic.txt
@@ -2,7 +2,7 @@
// Author:
// Jesusalva
// Description:
-// 023-3 Abandoned Ice Caves Configuration File
+// 023-3 Abandoned Ice Caves Configuration File. Variables: $@LOGIC_0233BOSS
023-3 mapflag zone MMO
@@ -97,12 +97,94 @@ OnTouch:
}
-// TODO: The scout which went ahead of you (+ miniboss mechanics)
+// The scout which went ahead of you (+ miniboss mechanics)
023-3,86,88,0 script Elite Scout#MB0233 NPC_DARKSABER,{
+ if ($@LOGIC_0233BOSS) {
+ npctalkonce l("FIGHT!");
+ end;
+ }
+ if (getq(FrostiaQuest_Homunculus) >= 1) {
+ npctalkonce l("I'm not going any closer to that cursed place!");
+ end;
+ }
mesn;
- mesq l("Uhm, I'm looking for a way out...");
- close;
+ mesq l("Congratulations in making this far, @@.", strcharinfo(0));
+ next;
+ select
+ l("Thanks, and bye."),
+ l("What should I do now?");
+ if (@menu == 1)
+ close;
+ mes "";
+ mesn;
+ mesq l("So, there is a magical barrier to the right, which is in place exactly to protect us.");
+ next;
+ mesn;
+ mesq l("Past this checkpoint, is the village where the Monster King was born.");
+ next;
+ mesn;
+ mesq l("If you want to pass through it, you'll need to defeat the Guardian which made the seal. You can bring friends for healing and support.");
+ next;
+ mesn;
+ mesq l("Once the fight begins, the barrier at your left will lock. It won't open until the fight is over.");
+ next;
+ mesn;
+ mesq l("Are you ready?");
+ mesc l("WARNING: DO NOT PROCEED UNLESS YOU'RE READY."), 1;
+ if (askyesno() == ASK_YES && !$@LOGIC_0233BOSS) {
+ $@LOGIC_0233BOSS=getcharid(3); // It could be 1.
+ $@LOGIC_0233BOXX=monster("023-3", any(85,94,103,113), any(91,96,102,111), "Guardian", Yeti, 1, .name$+"::OnYetiDefeat");
+ initnpctimer;
+ }
+ closeclientdialog;
+ end;
+// Check if fight is still going on
+OnTimer10000:
+ if (!attachrid($@LOGIC_0233BOSS)) {
+ killmonster("023-3", .name$+"::OnYetiDefeat");
+ $@LOGIC_0233BOSS=0;
+ end;
+ }
+ // You gave up, finish it now and not later
+ if (getmap() != "023-3") {
+ killmonster("023-3", .name$+"::OnYetiDefeat");
+ $@LOGIC_0233BOSS=0;
+ end;
+ }
+ // What if the Yeti left the chamber? O.o
+ // It's not like there was mob collision to prevent this from happening
+ // If that's the case, bring the Yeti to player position and order attack :>
+ getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, $@LOGIC_0233BOXX);
+ getmapxy(.@mx$, .@xx, .@yx, 0);
+ if (!(is_between(79, 120, .@x) && is_between(75, 125, .@y))) {
+ unitwarp($@LOGIC_0233BOXX, .@mx$, .@xx, .@yx);
+ unitattack($@LOGIC_0233BOXX, $@LOGIC_0233BOSS);
+ unittalk($@LOGIC_0233BOXX, "I did not forgot you, @@! %%e", strcharinfo(0));
+ end;
+ }
+ initnpctimer;
+ end;
+// Yeti Defeated
+OnYetiDefeat:
+ stopnpctimer;
+ .@rid=$@LOGIC_0233BOSS;
+ $@LOGIC_0233BOSS=0;
+ // In past, only MVP would count. Now, the requester count.
+ if (playerattached())
+ detachrid();
+ // Player decided to leave the game, annuled
+ if (!attachrid(.@rid))
+ end;
+ // Player decided to leave for a walk, annuled
+ if (!isin("023-3", 79, 75, 120, 125))
+ end;
+
+ // We don't need compareandsetq because it's now the requester
+ message(.@rid, l("You've slayed the Yeti."));
+ npctalk l("Good luck in your journey, @@.", rid2name(.@rid));
+ setq FrostiaQuest_Homunculus, 1;
+ end;
OnInit:
.distance = 5;
end;
@@ -116,7 +198,7 @@ OnInit:
OnTouch:
.@q=getq(FrostiaQuest_Homunculus);
.@q2=getq(FrostiaQuest_Homunculus);
- if (!.@q && .@q2) {
+ if ($@LOGIC_0233BOSS) {
dispbottom l("A powerful magic barrier repels you!");
slide 81, 86;
sit();
@@ -143,7 +225,6 @@ OnInit:
}
// TODO: Spike traps and etc. at the corritor
-// TODO: Monsters natural presence in this cave
// TODO: Rolling Stone Trap
diff --git a/npc/024-16/king.txt b/npc/024-16/king.txt
index d7f38449b..3dc1e98a3 100644
--- a/npc/024-16/king.txt
+++ b/npc/024-16/king.txt
@@ -95,7 +95,7 @@ L_Campaign:
// Logout/dead/etc. → Destroy the quest state
// Meaning you'll have to start over. To prevent logout-cheats.
if (.@q)
- setq FrostiaQuest_Homunculus, 0, 0, 0;
+ setq FrostiaQuest_Homunculus, .@q, 0, 0;
// Debug functionality
if (is_staff()) {