aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/custom/on_events.cpp
diff options
context:
space:
mode:
authorRat <none@none>2010-01-19 11:36:05 +0100
committerRat <none@none>2010-01-19 11:36:05 +0100
commit0cc053ea4d42ce405a915857f75ee00f0f65666b (patch)
tree7c25955ee5db618deee963f515ba061fbb1e1e8c /src/scripts/custom/on_events.cpp
parentf5dea61b66a616110cfc82ff640ec448b1efa702 (diff)
*Integrate Script system to Core
-added ScriptMgr for loading scripts -removed bindings -moved script system to src/game -moved scripts to src/scripts -VC project files updated -cmakes updated (not 100% done yet) NOTE to Devs: -file locations changed -precompiled renamed to ScriptedPch -ecsort_ai renamed to ScriptedEscortAI -follower_ai renamed to ScriptedFollowerAI -guard_ai renamed to ScriptedGuardAI -simple_ai renamed to ScriptedSimpleAI -sc_creature renamed to ScriptedCreature -sc_gossip renamed to ScriptedGossip -sc_instance renamed to ScriptedInstance *use the new headers in scripts, thank you NOTE to ALL: cmake not fully tested, please report any errors with it could make creashes, incompability USE AT YOUR OWN RISK before further tests!! --HG-- branch : trunk
Diffstat (limited to 'src/scripts/custom/on_events.cpp')
-rw-r--r--src/scripts/custom/on_events.cpp108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/scripts/custom/on_events.cpp b/src/scripts/custom/on_events.cpp
new file mode 100644
index 00000000000..eca1c266bf6
--- /dev/null
+++ b/src/scripts/custom/on_events.cpp
@@ -0,0 +1,108 @@
+#include "ScriptedPch.h"
+#include <cstring>
+
+//This function is called when the player logs in (every login)
+void OnLogin(Player *pPlayer)
+{
+
+}
+
+//This function is called when the player logs out
+void OnLogout(Player *pPlayer)
+{
+
+}
+
+//This function is called when the player kills another player
+void OnPVPKill(Player *killer, Player *killed)
+{
+
+}
+
+//This function is called when a players AreaID changes
+void OnAreaChange(Player *pPlayer, AreaTableEntry const *pArea)
+{
+
+}
+
+//This is called when a player kills a creature (non pvp)
+void OnCreatureKill(Player *pPlayer, Creature *pCreature)
+{
+
+}
+
+//This function is called when a player has a money exchange
+int32 OnGetMoney(Player *pPlayer, int32 amount)
+{
+ return amount;
+}
+
+//This function is called whenever a player gets XP
+uint32 OnGetXP(Player *pPlayer, uint32 amount)
+{
+ return amount;
+}
+
+//This function is called when a player clicks a GO Object
+bool OnGoClick(Player *pPlayer, GameObject *pGameObject)
+{
+ return true;
+}
+
+//This function is called when a player clicks and item
+bool OnItemClick(Player *pPlayer, Item *pItem)
+{
+ return true;
+}
+
+//This function is called when a player opens an item (like a clam)
+bool OnItemOpen(Player *pPlayer, Item *pItem)
+{
+ return true;
+}
+
+//This function is called when a player sends a chat message
+bool OnPlayerChat(Player *pPlayer, const char *text)
+{
+ return true;
+}
+
+//this function is called when the server starts
+void OnServerStartup()
+{
+
+}
+//this function is called when the server shuts down
+void OnServerShutdown()
+{
+
+}
+
+//this function is called when a player casts a spell
+bool OnSpellCast(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGoTarget, uint32 i, SpellEntry const *spell)
+{
+ return true;
+}
+
+ void AddSC_onevents()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "scripted_on_events";
+ newscript->pOnLogin = &OnLogin;
+ newscript->pOnLogout = &OnLogout;
+ newscript->pOnPVPKill = &OnPVPKill;
+ newscript->pOnAreaChange = &OnAreaChange;
+ newscript->pOnCreatureKill = &OnCreatureKill;
+ newscript->pOnGetMoney = &OnGetMoney;
+ newscript->pOnGetXP = &OnGetXP;
+ newscript->pOnGoClick = &OnGoClick;
+ newscript->pOnItemClick = &OnItemClick;
+ newscript->pOnItemOpen = &OnItemOpen;
+ newscript->pOnPlayerChat = &OnPlayerChat;
+ newscript->pOnServerShutdown = &OnServerShutdown;
+ newscript->pOnServerStartup = &OnServerStartup;
+ newscript->pOnSpellCast = &OnSpellCast;
+
+ newscript->RegisterSelf();
+}