diff options
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"; |