From 53f1b87a3906315be125559631d20c0a8e18baa5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 16 Dec 2021 23:18:27 -0300 Subject: I suspect checkcell is doing a bad job, but I don't have much time to debug --- npc/081-1/extra.txt | 32 +++++++++++++++++++++++++++++++- npc/annuals/xmas/2021.txt | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/npc/081-1/extra.txt b/npc/081-1/extra.txt index c39d5a22..4cf01650 100644 --- a/npc/081-1/extra.txt +++ b/npc/081-1/extra.txt @@ -157,8 +157,8 @@ OnInit: 081-2,90,288,0 script #X21ADMIN NPC_NO_SPRITE,{ - if (!is_admin()) end; if (instance_id() < 0) end; + if (!is_admin()) goto L_Auto; clear; do { @@ -188,6 +188,36 @@ OnInit: } while (@menu != 1); closeclientdialog; close; + +L_Auto: + /* Attempt to fix Candle state */ + if (!'XMAS21CANDLE) { + if (checkcell(getmap(), 105, 212, cell_chkpass)) + setcells getmap(), 103, 211, 107, 212, 1, "X21L1@"+X21ID(); + } else { + if (!checkcell(getmap(), 105, 212, cell_chkpass)) + delcells "X21L1@"+X21ID(); + } + + /* Attempt to fix Seeds state */ + if (!'XMAS21TREE) { + if (checkcell(getmap(), 127, 128, cell_chkpass)) + setcells getmap(), 124, 127, 131, 128, 1, "X21L2@"+X21ID(); + } else { + if (!checkcell(getmap(), 127, 128, cell_chkpass)) + delcells "X21L2@"+X21ID(); + } + + /* Attempt to fix Ambush state */ + if (!'XMAS21AMBUSH) { + if (checkcell(getmap(), 49, 72, cell_chkpass)) + setcells getmap(), 47, 71, 51, 72, 1, "X21L3@"+X21ID(); + } else { + if (!checkcell(getmap(), 49, 72, cell_chkpass)) + delcells "X21L3@"+X21ID(); + } + end; + OnInit: .distance=1; end; diff --git a/npc/annuals/xmas/2021.txt b/npc/annuals/xmas/2021.txt index 4b8543ca..f2fbef13 100644 --- a/npc/annuals/xmas/2021.txt +++ b/npc/annuals/xmas/2021.txt @@ -663,6 +663,7 @@ OnInstanceInit: end; OnInit: + debugmes "Initialization for the event at %d", gettimetick(2); /* Aethyra - Frontier Town */ "#XMAS21Core"::spawn(Fluffy, 16, "081-1"); "#XMAS21Core"::spawn(Poltergeist, 7, "081-1"); -- cgit v1.2.3-60-g2f50