summaryrefslogtreecommitdiff
path: root/npc/025-1/ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'npc/025-1/ctrl.c')
-rw-r--r--npc/025-1/ctrl.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/npc/025-1/ctrl.c b/npc/025-1/ctrl.c
index 7c0090069..483f70c5f 100644
--- a/npc/025-1/ctrl.c
+++ b/npc/025-1/ctrl.c
@@ -11,9 +11,9 @@
// 0 - Locked
// 1 - Unlocked
// $@FORTRESS_STATUE = bitmask
-// 1,2,4,8... broken statues
+// 1,2,4,8,16 - broken statues
+// 1024 - Fortress Gate
// TODO: Use bg() - maybe with dummysd? What will increase allies count?
-// mapwarp() everyone outside when FTCleanup(false)
// TODO: Gate control during siege (not $FORTRESS_STATE). Gate monster.
// TODO: Spawn the monster general for each statue. Count their deaths.
// TODO: Spawn Monster Governor (and add it) once statue is broken. ::OnConquest
@@ -119,19 +119,52 @@ function script FTStatue {
// Hey, you can assault the town!
mesc ".:: "+l("THE FORTRESS ISLAND TOWN") + " ::.", 1;
mes l("Behind this gate, lies the Fortress Island Town.");
- //monster(FortressGate, ::OnOpenGate)
+ next;
+ mesc ".:: "+l("THE FORTRESS ISLAND TOWN") + " ::.", 1;
+ mes l("Assault?");
+ mesc l("Lorem ipsum dolor sit amet"), 1;
+ next;
+ if (askyesno() == ASK_NO)
+ close;
+
+ // FIRE THE EVENT
+ disablenpc .name$;
+ initnpctimer;
+
+ // Spawn the gate
+ monster("025-1", 99, 113, "Fortress Gate", FortressGate, 1, .name$+"::OnOpenGate");
+ // TODO: Initial defending waves
+ // TODO: Enable the statues
+ // TODO: Summon reinforcements
close;
+/////////////////////////////////////////////////////////
+OnOpenGate:
+ // FIXME Broken
+ $@FORTRESS_STATUE = $@FORTRESS_STATUE|1024;
+ donpcevent "#025-1_99_112::OnDisable";
+ kamibroadcast("The Fortress Town Gate has been breached!");
+ close;
+
+OnTimer30000:
+ // TODO: Spawn mobs
+ .@breach=($@FORTRESS_STATUE & 1024);
+ initnpctimer;
+ end;
+
+/////////////////////////////////////////////////////////
OnInit:
FTCleanup($FORTRESS_STATE);
end;
OnTue0000:
FTCleanup(false);
+ enablenpc .name$;
end;
OnConquest:
FTCleanup(true);
+ disablenpc .name$;
end;
}