summaryrefslogtreecommitdiff
path: root/world/map/npc/009-4
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2014-10-20 23:08:32 -0500
committerwushin <pasekei@gmail.com>2014-10-20 23:10:33 -0500
commitfe2f7f944eb90bcbad53a1d9b86f2d09025f2217 (patch)
tree0084c41e598ae8f5d935d51b51e96c09e001fc4e /world/map/npc/009-4
parent2882833197d794e77616e211834022dc3538a6d9 (diff)
downloadserverdata-fe2f7f944eb90bcbad53a1d9b86f2d09025f2217.tar.gz
serverdata-fe2f7f944eb90bcbad53a1d9b86f2d09025f2217.tar.bz2
serverdata-fe2f7f944eb90bcbad53a1d9b86f2d09025f2217.tar.xz
serverdata-fe2f7f944eb90bcbad53a1d9b86f2d09025f2217.zip
Reset barriers if barrier color 0
closes #180
Diffstat (limited to 'world/map/npc/009-4')
-rw-r--r--world/map/npc/009-4/barriers.txt11
-rw-r--r--world/map/npc/009-4/orum.txt99
-rw-r--r--world/map/npc/009-4/torches.txt1
3 files changed, 77 insertions, 34 deletions
diff --git a/world/map/npc/009-4/barriers.txt b/world/map/npc/009-4/barriers.txt
index f3f2e085..ae960d97 100644
--- a/world/map/npc/009-4/barriers.txt
+++ b/world/map/npc/009-4/barriers.txt
@@ -1,8 +1,13 @@
//# see detailed description at orum.txt
function|script|GetBarrierColor|,
{
- if (@Barrier < 0 || @Barrier > 2) goto L_Error;
+ if (@Barrier < 0 || @Barrier > 2)
+ goto L_Error;
+ if (@BarrierColor <= 0 || @BarrierColor > 12)
+ goto L_Error2;
+ goto L_GetBarrierColor;
+L_GetBarrierColor:
set @Mask, 15;
set @Shift, 4 * @Barrier;
set @BarrierColor, (OrumQuestBarrier >> @Shift) & @Mask;
@@ -11,6 +16,10 @@ function|script|GetBarrierColor|,
L_Error:
mes "Barrier number is out of range.";
close;
+
+L_Error2:
+ callfunc "SetUpOrumQuest";
+ goto L_GetBarrierColor;
}
function|script|SetBarrierColor|,
diff --git a/world/map/npc/009-4/orum.txt b/world/map/npc/009-4/orum.txt
index 2b222255..c547af05 100644
--- a/world/map/npc/009-4/orum.txt
+++ b/world/map/npc/009-4/orum.txt
@@ -18,6 +18,37 @@
//# OrumQuestBarrier nibble (0,1,2) stores the color of the barriers #
//#################################################################################
+009-4.gat,35,115,0|script|OrumDebug|158,
+{
+ mes "[Orum Debug]";
+ menu
+ "Set Quest State", L_SetQuest,
+ "Reset Quest", L_ResetQuest,
+ "Display Quest", L_Display;
+
+L_SetQuest:
+ input @quest_state;
+ set OrumQuest, @quest_state;
+ goto L_Close;
+
+L_ResetQuest:
+ set OrumQuest, 0;
+ set OrumQuestBarrier, 0;
+ set OrumQuestTorch, 0;
+ goto L_Close;
+
+L_Display:
+ mes OrumQuest;
+ goto L_Close;
+
+L_Close:
+ end;
+
+OnInit:
+ if (!debug)
+ disablenpc "OrumDebug";
+ end;
+}
009-4.gat,37,115,0|script|Orum#barrier|158,
{
// needed to pass the very first barrier
@@ -221,38 +252,7 @@ L_Missing_Materials:
L_Setup_Lair:
set OrumQuest, 2;
-
- // Second Barrier
- set @BarrierColor, 1 + rand(3) * 4;
- set @Barrier, 0;
- callfunc "SetBarrierColor";
-
- set @TorchIntensity, 0;
-
- set @Torch, 0;
- set @TorchColor, rand(1, 12);
- callfunc "SetTorchColor";
- callfunc "SetTorchIntensity";
-
- // Third Barrier
- set @BarrierColor, 3 + rand(3) * 4;
- set @Barrier, 1;
- callfunc "SetBarrierColor";
-
- set @Torch, 1;
- set @TorchColor, rand(1, 12);
- callfunc "SetTorchColor";
- callfunc "SetTorchIntensity";
-
- // End Barrier
- set @BarrierColor, 2 + rand(6) * 2;
- set @Barrier, 2;
- callfunc "SetBarrierColor";
-
- set @Torch, 2;
- set @TorchColor, rand(1, 12);
- callfunc "SetTorchColor";
- callfunc "SetTorchIntensity";
+ callfunc "SetUpOrumQuest";
goto L_Close;
L_Use_First_Barrier:
@@ -592,3 +592,38 @@ L_Close:
set @TorchColor, 0;
close;
}
+function|script|SetUpOrumQuest|,
+{
+ // Second Barrier
+ set @BarrierColor, 1 + rand(3) * 4;
+ set @Barrier, 0;
+ callfunc "SetBarrierColor";
+
+ set @TorchIntensity, 0;
+
+ set @Torch, 0;
+ set @TorchColor, rand(1, 12);
+ callfunc "SetTorchColor";
+ callfunc "SetTorchIntensity";
+
+ // Third Barrier
+ set @BarrierColor, 3 + rand(3) * 4;
+ set @Barrier, 1;
+ callfunc "SetBarrierColor";
+
+ set @Torch, 1;
+ set @TorchColor, rand(1, 12);
+ callfunc "SetTorchColor";
+ callfunc "SetTorchIntensity";
+
+ // End Barrier
+ set @BarrierColor, 2 + rand(6) * 2;
+ set @Barrier, 2;
+ callfunc "SetBarrierColor";
+
+ set @Torch, 2;
+ set @TorchColor, rand(1, 12);
+ callfunc "SetTorchColor";
+ callfunc "SetTorchIntensity";
+ return;
+}
diff --git a/world/map/npc/009-4/torches.txt b/world/map/npc/009-4/torches.txt
index f093bc10..e9d8ff3e 100644
--- a/world/map/npc/009-4/torches.txt
+++ b/world/map/npc/009-4/torches.txt
@@ -1,5 +1,4 @@
//# see detailed description at orum.txt
-//# see detailed description at orum.txt
function|script|GetTorchColor|,
{
if (@Torch < 0 || @Torch > 2) goto L_Error;