diff options
author | HoraK-FDF <horak-fdf@web.de> | 2021-12-07 23:01:55 +0100 |
---|---|---|
committer | HoraK-FDF <horak-fdf@web.de> | 2021-12-07 23:01:55 +0100 |
commit | 71d0cdfe8bdb0567303825850ad36a5e8506ab2b (patch) | |
tree | 28f778dc81a65c531a9485e38456a60d6b4daf3f /npc/functions/clear_vars.txt | |
parent | c1be7bd1eab5b0c230001c369292abe757a7f32a (diff) | |
parent | cd6424df5baf7d46b96fa1ee4be500ad8b131a82 (diff) | |
download | serverdata-71d0cdfe8bdb0567303825850ad36a5e8506ab2b.tar.gz serverdata-71d0cdfe8bdb0567303825850ad36a5e8506ab2b.tar.bz2 serverdata-71d0cdfe8bdb0567303825850ad36a5e8506ab2b.tar.xz serverdata-71d0cdfe8bdb0567303825850ad36a5e8506ab2b.zip |
Merge branch 'xmas2021' of https://gitlab.com/themanaworld/evolved/serverdata into xmas2021
Diffstat (limited to 'npc/functions/clear_vars.txt')
-rw-r--r-- | npc/functions/clear_vars.txt | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt index e5e6e5d4..aac27666 100644 --- a/npc/functions/clear_vars.txt +++ b/npc/functions/clear_vars.txt @@ -1,7 +1,11 @@ +// Update variables on server init, login and logout -function script ClearVariables { - if (@login_event != 1) goto L_Deprecated; +function script isChristmas21 { + // FIXME: 12/12 = 346; 26/12 = 360; 09/01 = 9 (OBVIOUSLY) + return (gettime(8) >= 346 || gettime(8) <= 360 || $@XMAS21_OVERRIDE); +} +function script ClearVariables { // Some temporary bugfix GM = getgroupid(); @@ -138,10 +142,38 @@ function script ClearVariables { //QUEST_MAGIC2 = 0; OrumQuest = 0; } + + // Christmas 2021 Event + if (isChristmas21()) { + #OLD_EXP=BaseExp; + #OLD_LV=BaseLevel; + } return; } +function script FlushVariables { + // Some variables should not be saved + GM = 0; + ##01_TMWEXP = 0; + + // Christmas 2021 Event + if (isChristmas21()) { + #NEW_LV+=(BaseLevel-#OLD_LV); + if (BaseLevel != #OLD_LV) { + #NEW_EXP=BaseExp; + } else { + #NEW_EXP+=BaseExp-#OLD_EXP; + } + #OLD_EXP=0; + #OLD_LV=0; + if (getvaultid()) ##01_TMWEXP=#NEW_EXP; // (Techinically wrong) + } + return; +} + + + function script ServerUpdate { if ($@STARTUP) { debugmes "Cowardly refusing to update server outside startup"; |