summaryrefslogtreecommitdiff
path: root/npc/functions/global_event_handler.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 11:00:49 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 11:00:49 -0300
commit8a4bf716002a017de77fe7df301ef8e4aaf00a2e (patch)
tree4947d0b015baad639fa07133369e9a09c8a468bc /npc/functions/global_event_handler.txt
downloadserverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.gz
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.bz2
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.xz
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.zip
Initial commit
Diffstat (limited to 'npc/functions/global_event_handler.txt')
-rw-r--r--npc/functions/global_event_handler.txt73
1 files changed, 73 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..3f10ae73
--- /dev/null
+++ b/npc/functions/global_event_handler.txt
@@ -0,0 +1,73 @@
+// The Mana World scripts.
+// Author:
+// The Mana World Team
+// Description:
+// Controls most, if not all, global events on this server.
+// Please only use callfunc("") here; This script is loaded
+// early on and direct function assignment will cause fails.
+// TODO: Move "new quest" notification here. (Or deprecate)
+
+// Helper function for scripted Monster Kills.
+function script fix_mobkill {
+ killedrid=getarg(0);
+ doevent "#GlobalHandler::OnNPCKillEvent";
+ return;
+}
+
+- script #GlobalHandler NPC_HIDDEN,{
+ end;
+
+
+OnPCLoginEvent:
+ callfunc("updateSpotlight");
+ callfunc("ReceiveMOTD");
+ callfunc("ReceiveScheduledBroadcast");
+ callfunc("FixBankVault");
+ callfunc("GrantSuperSkill");
+ callfunc("AFKLogin");
+ callfunc("TravelFix");
+ end;
+
+OnPCLogoutEvent:
+ callfunc("UnequipCookie");
+ callfunc("MundaneLogout");
+ callfunc("fishing_cleanup", @fishing_spot$);
+ callfunc("ATLFightEnd");
+ callfunc("RossyLogout");
+
+ // Variable cleanup
+ @fishing_spot$ = "";
+ end;
+
+OnPCDieEvent:
+ callfunc("ForcedUnmount");
+ callfunc("MundaneDeath");
+ callfunc("ATLFightEnd");
+ callfunc("RossyDeath");
+ end;
+
+OnPCBaseLvUpEvent:
+ //callfunc("newquestwarning");
+ callfunc("ReferralSendLvReward");
+ end;
+
+OnNPCKillEvent:
+ $MONSTERS_KILLED+=1;
+ MONSTERS_KILLED+=1;
+ callfunc("EnoraKills");
+ callfunc("refineupdate");
+ if ($MONSTERS_KILLED % 1000000 == 0)
+ callfunc("GetBeanieCopter");
+ end;
+
+OnPCKillEvent:
+ $PLAYERS_KILLED+=1;
+ PLAYERS_KILLED+=1;
+ end;
+
+OnSkillInvoke:
+ callfunc("SkillInvoked");
+ end;
+
+}
+