From 5f6b73fcec312583a93bf0a54eaaae829a58d6ed Mon Sep 17 00:00:00 2001 From: click Date: Sat, 11 Sep 2010 16:11:07 +0200 Subject: Core/ScriptMgr: Remove incorrect assertion in OnGameObjectDestroyed, and clean up code style (fix by Zor) --HG-- branch : trunk --- src/server/game/Scripting/ScriptMgr.h | 86 ++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 42 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.h') 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. -- cgit v1.2.3