summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-11-10 18:32:44 -0300
committerJesusaves <cpntb1@ymail.com>2020-11-11 18:41:53 -0300
commit153a033e66e60b689a61567802d3793d43688922 (patch)
treed62dd74aca83180c4d27167c0e02aac612151c6d
parent9b15a09fe4d28f3ae2d8b06ff0a20a46ddadd310 (diff)
downloadserverdata-153a033e66e60b689a61567802d3793d43688922.tar.gz
serverdata-153a033e66e60b689a61567802d3793d43688922.tar.bz2
serverdata-153a033e66e60b689a61567802d3793d43688922.tar.xz
serverdata-153a033e66e60b689a61567802d3793d43688922.zip
With luck, bandit lord fight will work now :<
-rw-r--r--npc/008-3-5/_import.txt1
-rw-r--r--npc/008-3-5/bryant.txt8
-rw-r--r--npc/008-3-5/lordcave.txt101
3 files changed, 110 insertions, 0 deletions
diff --git a/npc/008-3-5/_import.txt b/npc/008-3-5/_import.txt
index e3a73ff7..cb743792 100644
--- a/npc/008-3-5/_import.txt
+++ b/npc/008-3-5/_import.txt
@@ -3,4 +3,5 @@
"npc/008-3-5/_mobs.txt",
"npc/008-3-5/_warps.txt",
"npc/008-3-5/bryant.txt",
+"npc/008-3-5/lordcave.txt",
"npc/008-3-5/nunia.txt",
diff --git a/npc/008-3-5/bryant.txt b/npc/008-3-5/bryant.txt
index 6482084b..acef6f09 100644
--- a/npc/008-3-5/bryant.txt
+++ b/npc/008-3-5/bryant.txt
@@ -8,9 +8,11 @@
008-3-5,101,85,0 script Bryant NPC_CRASMANDE,{
function bryantBanditLord;
function bryantSilverKey;
+ function bryantComplete;
.@q=getq(HurnscaldQuest_Bandits);
if (.@q == 5) bryantSilverKey();
if (.@q == 6) bryantBanditLord();
+ if (.@q >= 7) bryantComplete();
mesn;
mesq lg("Welcome.");
next;
@@ -55,6 +57,12 @@ function bryantBanditLord {
close;
}
+function bryantComplete {
+ mesn;
+ mesq l("Good job defeating the Bandit Lord.");
+ close;
+}
+
OnInit:
/*
.@npcId = getnpcid(.name$);
diff --git a/npc/008-3-5/lordcave.txt b/npc/008-3-5/lordcave.txt
new file mode 100644
index 00000000..906cd8ad
--- /dev/null
+++ b/npc/008-3-5/lordcave.txt
@@ -0,0 +1,101 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// FIXME:
+// Create a party instance for this
+
+008-3-5,83,49,0 script #BanditLordDen NPC_HIDDEN,0,5,{
+ function lordCleanup;
+ end;
+
+function lordCleanup {
+ // Bug
+ if (!.lock) {
+ consolemes(CONSOLEMES_ERROR, "No lock passed to Lord Cave during cleanup");
+ end;
+ }
+
+ // Cleanup
+ .lock = false;
+ delcells "BanditLordDenWall";
+ killmonster("008-3-5", "#BanditLordDen::OnLordDeath");
+ stopnpctimer;
+ return;
+}
+
+OnInit:
+ .maxLevel = 55;
+ .lock=false;
+ end;
+
+OnTouch:
+ .@q=getq(HurnscaldQuest_Bandits);
+ if (.@q != 6) end;
+
+ // Oooh, we got a challenger!
+
+ // But the Lord is busy? Oh well, try again later
+ if (.lock) {
+ dispbottom l("%s came here first, you should wait for them.", strcharinfo(0, "Someone", .lock));
+ slide 92, 52;
+ end;
+ }
+
+ // Block the NPC
+ .lock=getcharid(3);
+ slide 80, 49;
+
+ // Block the passage
+ mapannounce "008-3-5", "A minor earthquake happens.", bc_map;
+ setcells "008-3-5", 82, 48, 83, 51, 2, "BanditLordDenWall";
+ initnpctimer;
+
+ // Summon
+ if (mobcount("008-3-5", "#BanditLordDen::OnLordDeath") == 0)
+ monster "008-3-5", 48, 35, "Bandit Lord", BanditLord, 1, "#BanditLordDen::OnLordDeath";
+ end;
+
+OnLordDeath:
+ // Unlock
+ lordCleanup();
+
+ // If killed by a monster, GM, whatever, abort
+ if (!playerattached())
+ end;
+
+ // Complete quest (if PC is attached and doing quest)
+ .@q=getq(HurnscaldQuest_Bandits);
+ if (.@q == 6 && !ispcdead()) {
+ setq HurnscaldQuest_Bandits, 7;
+ quest_xp(.maxLevel, 2500);
+ dispbottom l("Phew! The Bandit Lord was killed.");
+ } else {
+ dispbottom l("I killed the Bandit Lord! ...Why I did that, again?");
+ }
+ end;
+
+OnTimer5000:
+ .@pc=attachrid(.lock);
+
+ // Player logged out
+ if (!.@pc) {
+ lordCleanup();
+ end;
+ }
+
+ // Player killed in combat
+ if (ispcdead()) {
+ lordCleanup();
+ end;
+ }
+
+ // Player changed map
+ if (getmap() != "008-3-5") {
+ lordCleanup();
+ end;
+ }
+
+ // Battle ongoing, restart timer
+ initnpctimer;
+ end;
+}