summaryrefslogtreecommitdiff
path: root/npc/009-4/barriers.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/009-4/barriers.txt')
-rw-r--r--npc/009-4/barriers.txt21
1 files changed, 11 insertions, 10 deletions
diff --git a/npc/009-4/barriers.txt b/npc/009-4/barriers.txt
index 7dcb0b34..0185a2fd 100644
--- a/npc/009-4/barriers.txt
+++ b/npc/009-4/barriers.txt
@@ -1,3 +1,4 @@
+//# see detailed description at orum.txt
function script GetBarrierColor {
if (@Barrier < 0 || @Barrier > 2) goto L_Error;
@@ -154,26 +155,26 @@ L_Advance_Quest:
set @secondary, @BarrierColor + 1;
// Make sure it's in bounds
- if (@secondary > 12) set @secondary, 1;
- if (@secondary < 1) set @secondary, 12;
+ if (@secondary > 12) set @secondary, @secondary - 12;
+ if (@secondary < 1) set @secondary, @secondary + 12;
// Extract first 2 required colors
set @firstColor, @secondary - 2;
set @secondColor, @secondary + 2;
- if (@firstColor > 12) set @firstColor, 1;
- if (@firstColor < 1) set @firstColor, 12;
- if (@secondColor > 12) set @secondColor, 1;
- if (@secondColor < 1) set @secondColor, 12;
+ if (@firstColor > 12) set @firstColor, @firstColor - 12;
+ if (@firstColor < 1) set @firstColor, @firstColor + 12;
+ if (@secondColor > 12) set @secondColor, @secondColor - 12;
+ if (@secondColor < 1) set @secondColor, @secondColor + 12;
set @thirdColor, 12;
set @offsetOne, @BarrierColor + 1;
set @offsetTwo, @BarrierColor - 1;
// Make sure they in bounds
- if (@offsetOne > 12) set @offsetOne, 1;
- if (@offsetOne < 1) set @offsetOne, 12;
- if (@offsetTwo > 12) set @offsetTwo, 1;
- if (@offsetTwo < 1) set @offsetTwo, 12;
+ if (@offsetOne > 12) set @offsetOne, @offsetOne - 12;
+ if (@offsetOne < 1) set @offsetOne, @offsetOne + 12;
+ if (@offsetTwo > 12) set @offsetTwo, @offsetTwo - 12;
+ if (@offsetTwo < 1) set @offsetTwo, @offsetTwo + 12;
// Extract third needed color
if (@secondary == @offsetOne)