From 5c83426a20d1e00f09b229182c8b8e35c7f44370 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 3 Dec 2020 18:04:53 -0300 Subject: Prevent summoning in event maps during Christmas 2020. This is very hackish, and the explanation is as hackish as the code. But hey, it gets the job done, and self-disables after Christmas, so. --- world/map/npc/magic/_procedures.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt index 6ba748a9..66f356c7 100644 --- a/world/map/npc/magic/_procedures.txt +++ b/world/map/npc/magic/_procedures.txt @@ -38,6 +38,7 @@ function|script|magic_checks if(@_M_BLOCK) goto L_Blocked; // check if last debuff ended if(Hp < 1) goto L_Dead; // can not cast when dead if (MATK1 < 1 && .@nonmagic < 1) goto L_Greybar; // can not cast with a grey mana bar + if ($@xmas_time && $@xmas_time != $@xmas_reward_time) goto L_Christmas2020; return 0; L_Hidden: @@ -60,6 +61,35 @@ L_Login: smsg SMSG_FAILURE, "Magic: Impossible to cast for 10s after logging in."; return 5; +L_Xmas2020: + smsg SMSG_FAILURE, "Magic: Jack Frost's magical powers prevented your summoning!"; + return 6; + + +L_Christmas2020: + if (gettime(7) != 2020) + goto L_Return; + + // If it is not Astral nor Dark I don't really care + if (.school != SKILL_MAGIC_ASTRAL && .school != SKILL_MAGIC_DARK) + goto L_Return; + + // TODO: Not all astral nor all dark magic are summons + // But I don't have that sort of fine grained control in TMWA + // So I must whitelist a few invocations and hope they cover everything + if (.invocation$ == "#asorm" || .invocation$ == "#anwiltyp" || .invocation$ == "#phlex") + goto L_Return; + + // Not in burst time, so not really important? + // Actually, nevermind, that would not use snowball >__> + + // Unallowed in the map + if (getmap() == "034-1" || getmap() == "033-1" || getmap() == "046-1" || getmap() == "047-1") + goto L_Xmas2020; + + // Other map? Don't care + goto L_Return; + L_Return: return 0; } -- cgit v1.2.3-60-g2f50