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 | |
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)
-rw-r--r-- | npc/functions/clear_vars.txt | 31 | ||||
-rw-r--r-- | npc/functions/global_event_handler.txt | 2 |
2 files changed, 29 insertions, 4 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"; diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt index b63fb28f..f94e7fc8 100644 --- a/npc/functions/global_event_handler.txt +++ b/npc/functions/global_event_handler.txt @@ -15,7 +15,7 @@ OnPCLoginEvent: end; OnPCLogoutEvent: - GM = 0; + FlushVariables(); vaultOnLogout(); end; |