summaryrefslogtreecommitdiff
path: root/npc/081-2/logic.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/081-2/logic.txt')
-rw-r--r--npc/081-2/logic.txt23
1 files changed, 22 insertions, 1 deletions
diff --git a/npc/081-2/logic.txt b/npc/081-2/logic.txt
index ba9b6abd..604fd9eb 100644
--- a/npc/081-2/logic.txt
+++ b/npc/081-2/logic.txt
@@ -160,7 +160,8 @@ OnInit:
end;
}
-081-2,105,213,0 script #X21Barrier1 NPC_HIDDEN,2,0,{
+081-2,100,213,0 script #X21Barrier1 NPC_HIDDEN,7,0,{
+ @inst = instance_id();
if (!'XMAS21CANDLE)
npctalkonce l("The strong shall yield the powder to enlighten the way, according to the established sequence.");
end;
@@ -185,6 +186,26 @@ OnInit:
if (!'XMAS21TREE)
npctalkonce l("The leaves in a room, the objects from the other; When they merge together, the festivities shall proceed.");
end;
+OnPlant:
+ getmapxy(.@m$, .@x, .@y, 0);
+ // Should never happen, so nuke everything
+ if (instance_id() < 0) end;
+ // Already planted this spot
+ if ('XMAS21TREE_X[.@x] && 'XMAS21TREE_Y[.@y]) return;
+ // Record the success planting it
+ 'XMAS21TREE_X[.@x] = true;
+ 'XMAS21TREE_Y[.@y] = true;
+ // Sprout a Christmas Tree IF position was not already filled
+ monster(.@m$, .@x, .@y, strmobinfo(1, ChristmasTree), ChristmasTree, 1, "#XMAS21Core::OnX1164");
+ // Unlock the gate once the puzzle is complete
+ if (X21SEED_CHECK()) {
+ delcells("X21L2@"+X21ID());
+ specialeffect(FX_MAGIC_WICKED_SPAWN, AREA, getcharid(3));
+ getexp X21_EXP_PUZZLE, 0;
+ getitem AquaTicket, X21_TICKET_PUZZLE;
+ X21INIT();
+ }
+ end;
OnInit:
.distance=2;
end;