From 39c68b2d7115684a179b5511753b56836197185f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 5 Dec 2021 22:24:14 -0300 Subject: When completing a puzzle, renew the instance. Create placeholders for Gak and Alissa. --- npc/annuals/xmas/2021.txt | 149 +++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 74 deletions(-) (limited to 'npc/annuals') diff --git a/npc/annuals/xmas/2021.txt b/npc/annuals/xmas/2021.txt index 85770700..61d1fcbc 100644 --- a/npc/annuals/xmas/2021.txt +++ b/npc/annuals/xmas/2021.txt @@ -33,80 +33,6 @@ function script X21ED1_DOCLEAR { return; } -function script X21CANDLE_CHECK { - if ('XMAS21CANDLE) return false; - // NOTE: We could check here if player already finished this - // And skip the challenge after litting one candle? - if ('X21_CANDLE[0] != 'COLORCODE[0]) return false; - if ('X21_CANDLE[1] != 'COLORCODE[1]) return false; - if ('X21_CANDLE[2] != 'COLORCODE[2]) return false; - if ('X21_CANDLE[3] != 'COLORCODE[3]) return false; - if ('X21_CANDLE[4] != 'COLORCODE[4]) return false; - if ('X21_CANDLE[5] != 'COLORCODE[5]) return false; - // This instance challenge is over - 'XMAS21CANDLE = true; - // Record on player as well, just to be safe. - if (XMAS2021 & X21_CANDLES) return true; - getitem AquaTicket, 5; - XMAS2021 = (XMAS2021 | X21_CANDLES); - return true; -} - -function script X21SEED_CHECK { - /* Protip: You don't have to fill all spots - * - * If you plant a "L" it also works - * This is because "L" is the first letter of "Lazy" - * And I was particularly lazy to make a proper script - */ - if ('XMAS21TREE) return false; - // NOTE: We could check here if player already finished this - // And skip the challenge after planting one tree? - if (!'XMAS21TREE_X[116]) return false; - if (!'XMAS21TREE_X[117]) return false; - if (!'XMAS21TREE_X[118]) return false; - if (!'XMAS21TREE_X[119]) return false; - if (!'XMAS21TREE_X[120]) return false; - if (!'XMAS21TREE_Y[168]) return false; - if (!'XMAS21TREE_Y[169]) return false; - if (!'XMAS21TREE_Y[170]) return false; - // This instance challenge is over - 'XMAS21TREE = true; - // Record on player as well, just to be safe. - if (XMAS2021 & X21_PLANTPUZZLE) return true; - getitem AquaTicket, 5; - XMAS2021 = (XMAS2021 | X21_PLANTPUZZLE); - return true; -} - -function script X21_SEEDS { - getmapxy(.@m$, .@x, .@y, 0); - // If planted in the wrong region, vanish without effect - if (.@m$ != "0812@"+X21ID2()) - return; - if (.@x < 107 || .@x > 126) - return; - if (.@y < 159 || .@y > 177) - return; - // 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, 1; - } - return; -} - function script X21SRLZ { .@n=getarg(0); switch (.@n) { @@ -207,6 +133,81 @@ function script X21INIT { return; } +function script X21CANDLE_CHECK { + if ('XMAS21CANDLE) return false; + // NOTE: We could check here if player already finished this + // And skip the challenge after litting one candle? + if ('X21_CANDLE[0] != 'COLORCODE[0]) return false; + if ('X21_CANDLE[1] != 'COLORCODE[1]) return false; + if ('X21_CANDLE[2] != 'COLORCODE[2]) return false; + if ('X21_CANDLE[3] != 'COLORCODE[3]) return false; + if ('X21_CANDLE[4] != 'COLORCODE[4]) return false; + if ('X21_CANDLE[5] != 'COLORCODE[5]) return false; + // This instance challenge is over + 'XMAS21CANDLE = true; + // Record on player as well, just to be safe. + if (XMAS2021 & X21_CANDLES) return true; + getitem AquaTicket, 5; + XMAS2021 = (XMAS2021 | X21_CANDLES); + return true; +} + +function script X21SEED_CHECK { + /* Protip: You don't have to fill all spots + * + * If you plant a "L" it also works + * This is because "L" is the first letter of "Lazy" + * And I was particularly lazy to make a proper script + */ + if ('XMAS21TREE) return false; + // NOTE: We could check here if player already finished this + // And skip the challenge after planting one tree? + if (!'XMAS21TREE_X[116]) return false; + if (!'XMAS21TREE_X[117]) return false; + if (!'XMAS21TREE_X[118]) return false; + if (!'XMAS21TREE_X[119]) return false; + if (!'XMAS21TREE_X[120]) return false; + if (!'XMAS21TREE_Y[168]) return false; + if (!'XMAS21TREE_Y[169]) return false; + if (!'XMAS21TREE_Y[170]) return false; + // This instance challenge is over + 'XMAS21TREE = true; + // Record on player as well, just to be safe. + if (XMAS2021 & X21_PLANTPUZZLE) return true; + getitem AquaTicket, 5; + XMAS2021 = (XMAS2021 | X21_PLANTPUZZLE); + return true; +} + +function script X21_SEEDS { + getmapxy(.@m$, .@x, .@y, 0); + // If planted in the wrong region, vanish without effect + if (.@m$ != "0812@"+X21ID2()) + return; + if (.@x < 107 || .@x > 126) + return; + if (.@y < 159 || .@y > 177) + return; + // 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, 1; + X21INIT(); + } + return; +} + /* You cannot fiddle with party in this region */ 080-1 mapflag partylock 080-3 mapflag partylock -- cgit v1.2.3-70-g09d2