summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf3
-rw-r--r--db/pre-re/mob_db.conf71
-rw-r--r--npc/annuals/xmas/2021.txt70
3 files changed, 142 insertions, 2 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 75b4af8d..42c1c023 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3378,6 +3378,9 @@ more than one separator can be used in a row (so 12_3___456 is illegal).
comment__: "Christmas 2021 Constants"
X21_ACCEPTED: 1
+ X21_PLANTPUZZLE: 128
+ X21_LEVEL3: 256
+ X21_RIDDLEDONE: 512
X21_BOSSDEFEAT: 1024
X21_ALYSSAINIT: 2048
X21_ALYSSARESCUE: 4096
diff --git a/db/pre-re/mob_db.conf b/db/pre-re/mob_db.conf
index 50798b57..653b30e0 100644
--- a/db/pre-re/mob_db.conf
+++ b/db/pre-re/mob_db.conf
@@ -7002,4 +7002,75 @@ mob_db: (
CandyPumpkin: 1250
}
},
+{
+ Id: 1164
+ SpriteName: "ChristmasTree"
+ Name: "Christmas Tree"
+ Lv: 40
+ Hp: 10000
+ Sp: 0
+ Exp: 3647
+ JExp: 392
+ AttackRange: 2
+ Attack: [40, 40]
+ Def: 20
+ Mdef: 40
+ Stats: {
+ Str: 30
+ Agi: 30
+ Vit: 30
+ Int: 30
+ Dex: 30
+ Luk: 30
+ }
+ ViewRange: 9
+ ChaseRange: 10
+ Size: 1
+ Race: 0
+ Element: (0, 1)
+ Mode: {
+ CanMove: true
+ CanAttack: true
+ ChangeTargetMelee: true
+ ChangeTargetChase: true
+ }
+ MoveSpeed: 190
+ AttackDelay: 1500
+ AttackMotion: 800
+ DamageMotion: 800
+},
+{
+ Id: 1165
+ SpriteName: "ChristmasGift"
+ Name: "Christmas Gift"
+ Lv: 1
+ Hp: 1
+ Sp: 0
+ Exp: 1
+ JExp: 1
+ AttackRange: 1
+ Attack: [0, 0]
+ Def: 0
+ Mdef: 5
+ Stats: {
+ Str: 0
+ Agi: 0
+ Vit: 0
+ Int: 0
+ Dex: 0
+ Luk: 0
+ }
+ ViewRange: 9
+ ChaseRange: 10
+ Size: 1
+ Race: 3
+ Element: (2, 1)
+ MoveSpeed: 800
+ AttackDelay: 800
+ AttackMotion: 672
+ DamageMotion: 480
+ Drops: {
+ FourLeafClover: 5
+ }
+},
)
diff --git a/npc/annuals/xmas/2021.txt b/npc/annuals/xmas/2021.txt
index 95a2c2fb..fb65092b 100644
--- a/npc/annuals/xmas/2021.txt
+++ b/npc/annuals/xmas/2021.txt
@@ -33,6 +33,26 @@ function script X21ED1_DOCLEAR {
return;
}
+function script X21SEED_CHECK {
+ if (XMAS2021 & X21_PLANTPUZZLE) return false;
+ /* 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_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;
+ XMAS2021 = (XMAS2021 | X21_PLANTPUZZLE);
+ return true;
+}
+
function script X21_SEEDS {
getmapxy(.@m$, .@x, .@y, 0);
// If planted in the wrong region, vanish without effect
@@ -42,8 +62,20 @@ function script X21_SEEDS {
return;
if (.@y < 159 || .@y > 177)
return;
- // TODO: Sprout a Christmas Tree IF position is not filled
- // TODO: Record the position filled
+ // 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));
+ }
return;
}
@@ -151,6 +183,18 @@ public function spawn {
.@n$="#XMAS21Core::On"+getarg(0);
if (mobcount(.@m$, .@n$) < 200)
areamonster .@m$, 20, 20, getmapinfo(MAPINFO_SIZE_X, .@m$)-20, getmapinfo(MAPINFO_SIZE_Y, .@m$)-20, strmobinfo(1, getarg(0)), getarg(0), getarg(1, 1), .@n$;
+
+ /* Aqua Ticket Drops */
+ if (playerattached()) {
+ if (getmonsterinfo(getarg(0), MOB_LV) >= 150)
+ getitem AquaTicket, 2;
+ else if (getmonsterinfo(getarg(0), MOB_LV) >= 100 && any(true, false))
+ getitem AquaTicket, 2;
+ else if (getmonsterinfo(getarg(0), MOB_LV) >= 40 && any(true, false, false))
+ getitem AquaTicket, 1;
+ else if (rand2(5) == 3)
+ getitem AquaTicket, 1;
+ }
return;
}
@@ -204,6 +248,28 @@ OnX1147:
.@y=cap_value(rand2(.@y1, .@y2), 250, 265);
makeitem(ThermalNapalm, rand2(3, 5), .@m$, .@x, .@y);
end;
+// Christmas Tree, spawns a (few?) gift boxes
+OnX1164:
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@x1=.@x-2;
+ .@y1=.@y-2;
+ .@x2=.@x+2;
+ .@y2=.@y+2;
+ .@x=cap_value(rand2(.@x1, .@x2), 47, 65);
+ .@y=cap_value(rand2(.@y1, .@y2), 191, 212);
+ spawn2(ChristmasGift, .@x1, .@y1, .@x2, .@y2, rand2(1, 3));
+ end;
+// Christmas Gift Box, gives you Tickets
+OnX1165:
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@x1=.@x-2;
+ .@y1=.@y-2;
+ .@x2=.@x+2;
+ .@y2=.@y+2;
+ .@x=cap_value(rand2(.@x1, .@x2), 47, 65);
+ .@y=cap_value(rand2(.@y1, .@y2), 191, 212);
+ makeitem(AquaTicket, any(1, 1, 2), .@m$, .@x, .@y);
+ end;
/* Experimental */
On1162: