summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-05 03:23:03 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-05 03:23:03 -0300
commit7202bad1d8c0b82c5bd2d076e88ab9cbbd62a5df (patch)
tree5061c04c700d7af091cc527ee30c8412864ae9bd
parenta33298493f416062171fb970f1737d176225917a (diff)
downloadserverdata-7202bad1d8c0b82c5bd2d076e88ab9cbbd62a5df.tar.gz
serverdata-7202bad1d8c0b82c5bd2d076e88ab9cbbd62a5df.tar.bz2
serverdata-7202bad1d8c0b82c5bd2d076e88ab9cbbd62a5df.tar.xz
serverdata-7202bad1d8c0b82c5bd2d076e88ab9cbbd62a5df.zip
Victory condition. Hopefully Serena's Quest is finishable now (even if ugly)
-rw-r--r--npc/001-2-32/serena.txt21
-rw-r--r--npc/001-2-35/doors.txt1
2 files changed, 17 insertions, 5 deletions
diff --git a/npc/001-2-32/serena.txt b/npc/001-2-32/serena.txt
index 5284caa6..b25d32be 100644
--- a/npc/001-2-32/serena.txt
+++ b/npc/001-2-32/serena.txt
@@ -6,9 +6,6 @@
// Artis's Legion of Aemil officier of the fighting room.
// Note:
// ATL - Artis Training Legion
-// TODO: Handle victory (3 waves?)
-// TODO: Handle logout
-// TODO: EVERYTHING!!
001-2-32,27,27,0 script Serena NPC_SERENA,{
mesn;
@@ -29,6 +26,8 @@ OnInit:
}
001-2-35,26,27,0 script Serena#Ctrl NPC_SERENA,{
+ function checkVictory;
+
// We can't begin if we're already doing it
if (.atlf) {
// TODO: We should check if the timers are running
@@ -169,17 +168,29 @@ OnVerify:
if (readbattleparam(getcharid(3), UDT_ADELAY) < .atl_bDly)
.atl_bDly=readbattleparam(getcharid(3), UDT_DELAY);
- // TODO: Victory conditions
+ // Victory conditions
+ if (getq(Artis_Legion_Progress) == 3)
+ checkVictory();
addtimer(5000, instance_npcname(.name$)+"::OnVerify");
end;
+
+ // Victory conditions
+ function checkVictory {
+ if (.atlf > 3) {
+ npctalk l("Congratulations, %s. I think this is enough. You can continue fighting to set a good score or report to Lozerk.", strcharinfo(0));
+ setq Artis_Legion_Progress, 4, 0;
+ }
+ return;
+ }
+
}
// Helper function for failure
function script ATLFightEnd {
- .@mapn$="atl2@"+getcharid(0);
if (@ATLFIGHT) {
@ATLFIGHT=false;
+ .@mapn$="atl2@"+getcharid(0);
killmonster(.@mapn$, "all", false);
set(getvariableofnpc(.atlf, instance_npcname("Serena#Ctrl")), 0));
}
diff --git a/npc/001-2-35/doors.txt b/npc/001-2-35/doors.txt
index 461ef6eb..64fcb30f 100644
--- a/npc/001-2-35/doors.txt
+++ b/npc/001-2-35/doors.txt
@@ -12,6 +12,7 @@ OnTouch:
dispbottom l("I am not a coward. I shall not give up!");
end;
}
+ ATLFightEnd();
warp "001-2-32", 32, 29;
end;
}