From 0068a563a466b478ba965f28c76793f0995ff58c Mon Sep 17 00:00:00 2001 From: Reid Date: Tue, 16 Feb 2016 17:47:19 +0100 Subject: Launch the training session only if the PC is inside the area and enable dynamic collision. --- npc/001-2-36/training_room_npc.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'npc') diff --git a/npc/001-2-36/training_room_npc.txt b/npc/001-2-36/training_room_npc.txt index cdbb9623..ae07db99 100644 --- a/npc/001-2-36/training_room_npc.txt +++ b/npc/001-2-36/training_room_npc.txt @@ -59,6 +59,14 @@ start: if (FIGHT_TRAINING >= 1) goto JobIsDone; + getmapxy(.@map$, .@x, .@y, 0); + if (.@x < 24 || .@x > 32 || .@y < 33 || .@y > 43) + { + speech 1, l("Please enter the combat zone on the left."); + close; + } + + setcells "001-2-36", 33, 35, 33, 38, 1, "fence"; initnpctimer; setnpctimer 0; startnpctimer; @@ -120,10 +128,12 @@ FinishedTraining: stopnpctimer; setnpctimer 0; set $@CURRENT_WAVE_LEVEL, 0; + delcells "fence"; if (FIGHT_TRAINING >= 1) end; set FIGHT_TRAINING, 1; end; + JobIsDone: mes "Well done, you should talk to \"" + $@NPCNEXTNAME$ + "\"..."; close; -- cgit v1.2.3-70-g09d2