diff options
Diffstat (limited to 'npc/functions/global_event_handler.txt')
-rw-r--r-- | npc/functions/global_event_handler.txt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt new file mode 100644 index 00000000..69972292 --- /dev/null +++ b/npc/functions/global_event_handler.txt @@ -0,0 +1,49 @@ + +- script #GlobalHandler NPC32767,{ + end; + +OnPCLoginEvent: + @login_event = 1; + adddefaultskills(); + //callfunc "fixHeadStyles"; // convert headstyles + ClearVariables(); // removes / converts old variables + DisplayMOTD(); // send the motd to the client, if enabled + TMWBirthday(); + // add more here + vaultOnLogin(); + @login_event = 2; + end; + +OnPCLogoutEvent: + vaultOnLogout(); + end; + +OnPCKillEvent: + elanore_decrease_exp(); // decrease heal exp for doing bad things + end; + +OnNPCKillEvent: +OnMobKillEvent: + MobPoints(); + end; + +OnPCDieEvent: + @necromancer = 0; + callfunc "SpawnGhost"; + set @killerrid, 0; // reset killer rid + end; + +// Cleanup: Retain chat logs for 24~48 hours +// Cleanup: Retain item logs for 2 months +OnClock0500: + query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -2)+"'"); + query_sql("DELETE FROM `zenylog` WHERE `time` < '"+sqldate(0, -2)+"'"); +OnClock1700: + if (gettime(GETTIME_DAYOFMONTH) > 1) + query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-1)+"'"); + end; + +OnInit: + MOTD(); // set the MOTD array + end; +} |