diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-12-03 20:17:15 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-12-03 20:17:15 -0300 |
commit | 5a84dd8369d9d687616637e6a789b270c2452278 (patch) | |
tree | 8d063c4b3a871140f183fe5357be42e517e8e467 | |
parent | 711f197ebc7a84270df768964662165c022b6c97 (diff) | |
download | serverdata-5a84dd8369d9d687616637e6a789b270c2452278.tar.gz serverdata-5a84dd8369d9d687616637e6a789b270c2452278.tar.bz2 serverdata-5a84dd8369d9d687616637e6a789b270c2452278.tar.xz serverdata-5a84dd8369d9d687616637e6a789b270c2452278.zip |
Initial prototype of the Ambush Puzzle.
-rw-r--r-- | npc/081-2/logic.txt | 100 | ||||
-rw-r--r-- | npc/annuals/xmas/2021.txt | 28 |
2 files changed, 126 insertions, 2 deletions
diff --git a/npc/081-2/logic.txt b/npc/081-2/logic.txt index b32e6458..629bcb0d 100644 --- a/npc/081-2/logic.txt +++ b/npc/081-2/logic.txt @@ -199,18 +199,114 @@ OnInit: end; } +081-2,112,90,0 script Nutcracker O'Panel#X21 NPC_NO_SPRITE,{ + if ('XMAS21AMBUSH) + end; + mes l("This Nutcracker has a lever on it."); + mesc l("Do you flip it?"), 1; + next; + if (askyesno() == ASK_NO) { + closeclientdialog; + close; + } + + .@goal = (2**'AMBUSHTRI[0]) + (2**'AMBUSHTRI[1]) + (2**'AMBUSHTRI[2]); + if ('AMBUSH_BMASK == .@goal) { + npctalk l("*beep*"); + delcells("X21L3@"+X21ID()); + 'XMAS21AMBUSH = true; + specialeffect(FX_MAGIC_WICKED_SPAWN, AREA, getcharid(3)); + } else { + npctalk l("*click*"); + } + 'AMBUSH_BMASK = 0; + .@amb = any(ManaGuardian, ManaGuardian, ManaSlayer, (X21TYPE() == IOT_PARTY ? ManaTyrant : ManaGuardian), Tengu, Sasquatch); + areamonster getmap(), 108, 82, 128, 102, strmobinfo(1, .@amb), .@amb, 1; + closeclientdialog; + close; +OnInit: + .distance=1; + end; +} + +081-2,117,87,0 script Star of Bethlem#X21_0 NPC_NO_SPRITE,{ + if ('XMAS21AMBUSH) + end; + // Extract ID + .@n$=strnpcinfo(2, "_-1"); + explode(.@ni$, .@n$, "_"); + .@id=atoi(.@ni$[1]); + if (.@id < 0) { consolemes(CONSOLEMES_ERROR, "ERROR, X21 Invalid Ambush Hint"); end; } + + .@n='AMBUSHTRI[.@id]+2; // Account for the invisible frame + .@c=(.@n % 5 == 0) ? 5 : (.@n % 5); + .@r=(.@n / 5)+((.@n % 5 == 0) ? 0 : 1); + npctalkonce l("%s column, %s row", X21SRLZ(.@c), X21SRLZ(.@r)); + end; +OnInit: + .distance=1; + end; +} +081-2,124,94,0 duplicate(Star of Bethlem#X21_0) Canes#X21_1 NPC_NO_SPRITE +081-2,120,100,0 duplicate(Star of Bethlem#X21_0) Crown#X21_2 NPC_NO_SPRITE + +081-2,60,118,0 script Switch#X21AB_1 NPC_NO_SPRITE,{ + if ('XMAS21AMBUSH) + end; + // Extract ID + .@n$=strnpcinfo(2, "_0"); + explode(.@ni$, .@n$, "_"); + .@id=atoi(.@ni$[1]); + if (.@id < 1) { consolemes(CONSOLEMES_ERROR, "ERROR, X21 Invalid Ambush Switch"); end; } + + // Already flipped + .@bit=(2**.@id); + if ('AMBUSH_BMASK & .@bit) + end; + + mesc l("There is a switch here."); + mesc l("Do you flip it?"), 1; + next; + if (askyesno() == ASK_YES) { + 'AMBUSH_BMASK = 'AMBUSH_BMASK | .@bit; + npctalk l("*click*"); + } + + closeclientdialog; + close; +OnInit: + .distance=1; + end; +} +081-2,65,118,0 duplicate(Switch#X21AB_1) Switch#X21AB_2 NPC_NO_SPRITE +081-2,70,118,0 duplicate(Switch#X21AB_1) Switch#X21AB_3 NPC_NO_SPRITE +081-2,50,123,0 duplicate(Switch#X21AB_1) Switch#X21AB_4 NPC_NO_SPRITE +081-2,55,123,0 duplicate(Switch#X21AB_1) Switch#X21AB_5 NPC_NO_SPRITE +081-2,60,123,0 duplicate(Switch#X21AB_1) Switch#X21AB_6 NPC_NO_SPRITE +081-2,65,123,0 duplicate(Switch#X21AB_1) Switch#X21AB_7 NPC_NO_SPRITE +081-2,70,123,0 duplicate(Switch#X21AB_1) Switch#X21AB_8 NPC_NO_SPRITE +081-2,50,128,0 duplicate(Switch#X21AB_1) Switch#X21AB_9 NPC_NO_SPRITE +081-2,55,128,0 duplicate(Switch#X21AB_1) Switch#X21AB_10 NPC_NO_SPRITE +081-2,60,128,0 duplicate(Switch#X21AB_1) Switch#X21AB_11 NPC_NO_SPRITE +081-2,65,128,0 duplicate(Switch#X21AB_1) Switch#X21AB_12 NPC_NO_SPRITE +081-2,70,128,0 duplicate(Switch#X21AB_1) Switch#X21AB_13 NPC_NO_SPRITE +081-2,50,133,0 duplicate(Switch#X21AB_1) Switch#X21AB_14 NPC_NO_SPRITE +081-2,55,133,0 duplicate(Switch#X21AB_1) Switch#X21AB_15 NPC_NO_SPRITE +081-2,60,133,0 duplicate(Switch#X21AB_1) Switch#X21AB_16 NPC_NO_SPRITE +081-2,65,133,0 duplicate(Switch#X21AB_1) Switch#X21AB_17 NPC_NO_SPRITE + /* *************************************************************************** */ /* The Enigma */ // FIXME (137,68 and 130,56 and 120,69) (no sprite) (no code) -081-2,137,68,0 script Enigma#X21A1 NPC188,{ +081-2,137,68,0 script Enigma#X21A1 NPC_NO_SPRITE,{ mes l("Three Enigmas, one always say the truth, one always says a lie, and the third may either say the truth or a lie."); mes ""; if ('TRUTHSTAT[0]) mesc l("The truth"), 1; else mesc l("A lie"), 1; - end; + close; OnInit: .distance=2; end; diff --git a/npc/annuals/xmas/2021.txt b/npc/annuals/xmas/2021.txt index 97f5422f..1c5507fc 100644 --- a/npc/annuals/xmas/2021.txt +++ b/npc/annuals/xmas/2021.txt @@ -105,6 +105,20 @@ function script X21_SEEDS { return; } +function script X21SRLZ { + .@n=getarg(0); + switch (.@n) { + case 1: return l("first"); + case 2: return l("second"); + case 3: return l("third"); + case 4: return l("fourth"); + case 5: return l("fifth"); + case 6: return l("sixth"); + case 7: return l("seventh"); + } + return str(.@n); +} + function script X21QUESTON { // Create and setup the challenge. Allow to reset quest. XMAS2021 = X21_ACCEPTED; @@ -424,6 +438,20 @@ OnInstanceInit: 'COLORCODE[4] = rand2(0, 2); 'COLORCODE[5] = rand2(0, 2); 'OBSCURECOLOR = any(0, 1); + + /* Prepare the Ambush Chamber */ + 'AMBUSHTRI[0] = rand2(1, 17); + do + { + 'AMBUSHTRI[1] = rand2(1, 17); + } while ('AMBUSHTRI[1] == 'AMBUSHTRI[0]); + do + { + 'AMBUSHTRI[2] = rand2(1, 17); + } while ('AMBUSHTRI[2] == 'AMBUSHTRI[0] || 'AMBUSHTRI[2] == 'AMBUSHTRI[1]); + 'AMBUSH_BMASK = 0; + + /* Prepare the Enigma */ 'TRUES=0; 'TRUTHSTAT[0]=any(false, true); if ('TRUTHSTAT[0]) |