aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp1
-rw-r--r--src/server/game/Scripting/ScriptMgr.h86
2 files changed, 44 insertions, 43 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 987580a7701..e2da5d20d4c 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -822,7 +822,6 @@ uint32 ScriptMgr::GetDialogStatus(Player* player, GameObject* go)
void ScriptMgr::OnGameObjectDestroyed(Player* player, GameObject* go, uint32 eventId)
{
- ASSERT(player);
ASSERT(go);
GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript);
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 619c9e9bfd5..008f945cb53 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -641,67 +641,69 @@ class AchievementCriteriaScript : public ScriptObject
class PlayerScript : public ScriptObject
{
-protected:
- PlayerScript(const char* name);
+ protected:
+
+ PlayerScript(const char* name);
-public:
- bool IsDatabaseBound() const { return false; }
+ public:
- // Called when a player kills another player
- virtual void OnPVPKill(Player* /*killer*/, Player* /*killed*/) { }
+ // Called when a player kills another player
+ virtual void OnPVPKill(Player* /*killer*/, Player* /*killed*/) { }
- // Called when a player kills a creature
- virtual void OnCreatureKill(Player* /*killer*/, Creature* /*killed*/) { }
+ // Called when a player kills a creature
+ virtual void OnCreatureKill(Player* /*killer*/, Creature* /*killed*/) { }
- // Called when a player is killed by a creature
- virtual void OnPlayerKilledByCreature(Creature* /*killer*/, Player* /*killed*/) { }
+ // Called when a player is killed by a creature
+ virtual void OnPlayerKilledByCreature(Creature* /*killer*/, Player* /*killed*/) { }
- // Called when a player's level changes (right before the level is applied)
- virtual void OnLevelChanged(Player* /*player*/, uint8 /*newLevel*/) { }
+ // Called when a player's level changes (right before the level is applied)
+ virtual void OnLevelChanged(Player* /*player*/, uint8 /*newLevel*/) { }
- // Called when a player's free talent points change (right before the change is applied)
- virtual void OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points*/) { }
+ // Called when a player's free talent points change (right before the change is applied)
+ virtual void OnFreeTalentPointsChanged(Player* /*player*/, uint32 /*points*/) { }
- // Called when a player's talent points are reset (right before the reset is done)
- virtual void OnTalentsReset(Player* /*player*/, bool /*no_cost*/) { }
+ // Called when a player's talent points are reset (right before the reset is done)
+ virtual void OnTalentsReset(Player* /*player*/, bool /*no_cost*/) { }
- // Called when a player's money is modified (before the modification is done)
- virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { }
+ // Called when a player's money is modified (before the modification is done)
+ virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { }
- // Called when a player gains XP (before anything is given)
- virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { }
+ // Called when a player gains XP (before anything is given)
+ virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { }
- // Called when a player's reputation changes (before it is actually changed)
- virtual void OnReputationChange(Player* /*player*/, uint32 /*factionID*/, int32& /*standing*/, bool /*incremental*/) { }
+ // Called when a player's reputation changes (before it is actually changed)
+ virtual void OnReputationChange(Player* /*player*/, uint32 /*factionID*/, int32& /*standing*/, bool /*incremental*/) { }
- // The following methods are called when a player sends a chat message
- virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/) { }
- virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Player* /*receiver*/) { }
- virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Group* /*group*/) { }
- virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Guild* /*guild*/) { }
- virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Channel* /*channel*/) { }
+ // The following methods are called when a player sends a chat message
+ virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/) { }
+ virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Player* /*receiver*/) { }
+ virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Group* /*group*/) { }
+ virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Guild* /*guild*/) { }
+ virtual void OnChat(Player* /*player*/, uint32 /*type*/, uint32 /*lang*/, std::string /*msg*/, Channel* /*channel*/) { }
- // Both of the below are called on emote opcodes
- virtual void OnEmote(Player* /*player*/, uint32 /*emote*/) { }
- virtual void OnTextEmote(Player* /*player*/, uint32 /*text_emote*/, uint32 /*emoteNum*/, uint64 /*guid*/) { }
+ // Both of the below are called on emote opcodes
+ virtual void OnEmote(Player* /*player*/, uint32 /*emote*/) { }
+ virtual void OnTextEmote(Player* /*player*/, uint32 /*text_emote*/, uint32 /*emoteNum*/, uint64 /*guid*/) { }
- // Called in Spell::cast
- virtual void OnSpellCast(Player * /*player*/, Spell * /*spell*/, bool /*skipCheck*/) { }
+ // Called in Spell::cast
+ virtual void OnSpellCast(Player * /*player*/, Spell * /*spell*/, bool /*skipCheck*/) { }
};
class GuildScript : public ScriptObject
{
-protected:
- GuildScript(const char* name);
+ protected:
+
+ GuildScript(const char* name);
+
+ public:
-public:
- bool IsDatabaseBound() const { return false; }
+ bool IsDatabaseBound() const { return false; }
- virtual void OnAddMember(Guild* /*guild*/, Player* /*player*/, uint32& /*plRank*/) { }
- virtual void OnRemoveMember(Guild* /*guild*/, Player* /*player*/, bool /*isDisbanding*/, bool /*isKicked*/) { }
- virtual void OnMOTDChanged(Guild* /*guild*/, std::string /*newMotd*/) { }
- virtual void OnGInfoChanged(Guild* /*guild*/, std::string /*newGInfo*/) { }
- virtual void OnDisband(Guild* /*guild*/) { }
+ virtual void OnAddMember(Guild* /*guild*/, Player* /*player*/, uint32& /*plRank*/) { }
+ virtual void OnRemoveMember(Guild* /*guild*/, Player* /*player*/, bool /*isDisbanding*/, bool /*isKicked*/) { }
+ virtual void OnMOTDChanged(Guild* /*guild*/, std::string /*newMotd*/) { }
+ virtual void OnGInfoChanged(Guild* /*guild*/, std::string /*newGInfo*/) { }
+ virtual void OnDisband(Guild* /*guild*/) { }
};
// Placed here due to ScriptRegistry::AddScript dependency.