diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-11-21 10:40:17 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-11-21 10:40:17 -0300 |
commit | 4be5faa879c7822c080735a594aa7b648c951db9 (patch) | |
tree | cacac00db626822eb1fef84998aacf8b1a926118 /npc/functions/clear_vars.txt | |
parent | a88a15a107fdaf6f305aae78c19de974b01044d4 (diff) | |
download | serverdata-4be5faa879c7822c080735a594aa7b648c951db9.tar.gz serverdata-4be5faa879c7822c080735a594aa7b648c951db9.tar.bz2 serverdata-4be5faa879c7822c080735a594aa7b648c951db9.tar.xz serverdata-4be5faa879c7822c080735a594aa7b648c951db9.zip |
Track experience and level changes in server between Dec 12th and Jan 9th
(Provisory final date)
Diffstat (limited to 'npc/functions/clear_vars.txt')
-rw-r--r-- | npc/functions/clear_vars.txt | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt index e5e6e5d4..4cd8c9b8 100644 --- a/npc/functions/clear_vars.txt +++ b/npc/functions/clear_vars.txt @@ -1,7 +1,5 @@ - +// Update variables on server init, login and logout function script ClearVariables { - if (@login_event != 1) goto L_Deprecated; - // Some temporary bugfix GM = getgroupid(); @@ -138,10 +136,37 @@ function script ClearVariables { //QUEST_MAGIC2 = 0; OrumQuest = 0; } + + // Christmas 2021 Event + // FIXME: 12/12 = 346; 26/12 = 360; 09/01 = 9 (OBVIOUSLY) + if (gettime(8) >= 346 || gettime(8) <= 9) { + #OLD_EXP=BaseExp; + #OLD_LV=BaseLevel; + } + return; +} + + +function script FlushVariables { + // Some variables should not be saved + GM = 0; + + // Christmas 2021 Event + if (gettime(8) >= 346 || gettime(8) <= 9) { + #NEW_LV+=(BaseLevel-#OLD_LV); + if (BaseLevel != #OLD_LV) { + #NEW_EXP+=BaseExp; + } else { + #NEW_EXP+=BaseExp-#OLD_EXP; + } + #OLD_EXP=0; + #OLD_LV=0; + } return; } + function script ServerUpdate { if ($@STARTUP) { debugmes "Cowardly refusing to update server outside startup"; |