mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
Core/Scripts: Add BGScripts and new hooks
* OnBattlegroudStart * OnBattlegroudEndReward * OnBattlegroudUpdate * OnBattlegroudAddPlayer
This commit is contained in:
@@ -1037,6 +1037,29 @@ class GlobalScript : public ScriptObject
|
||||
virtual void OnAfterUpdateEncounterState(Map* /*map*/, EncounterCreditType /*type*/, uint32 /*creditEntry*/, Unit* /*source*/, Difficulty /*difficulty_fixed*/, DungeonEncounterList const* /*encounters*/, uint32 /*dungeonCompleted*/, bool /*updated*/) { }
|
||||
};
|
||||
|
||||
class BGScript : public ScriptObject
|
||||
{
|
||||
protected:
|
||||
|
||||
BGScript(const char* name);
|
||||
|
||||
public:
|
||||
|
||||
bool IsDatabaseBound() const { return false; }
|
||||
|
||||
// Start Battlegroud
|
||||
virtual void OnBattlegroudStart(Battleground* /*bg*/) { }
|
||||
|
||||
// End Battleground
|
||||
virtual void OnBattlegroudEndReward(Battleground* /*bg*/, Player* /*player*/, TeamId /*winnerTeamId*/) { }
|
||||
|
||||
// Update Battlegroud
|
||||
virtual void OnBattlegroudUpdate(Battleground* /*bg*/, uint32 /*diff*/) { }
|
||||
|
||||
// Add Player in Battlegroud
|
||||
virtual void OnBattlegroudAddPlayer(Battleground* /*bg*/, Player* /*player*/) { }
|
||||
};
|
||||
|
||||
// this class can be used to be extended by Modules
|
||||
// creating their own custom hooks inside module itself
|
||||
class ModuleScript : public ScriptObject
|
||||
@@ -1356,6 +1379,13 @@ class ScriptMgr
|
||||
//void OnPlayerEnterAll(Map* map, Player* player);
|
||||
//void OnPlayerLeaveAll(Map* map, Player* player);
|
||||
|
||||
public: /* BGScript */
|
||||
|
||||
void OnBattlegroudStart(Battleground* bg);
|
||||
void OnBattlegroudEndReward(Battleground* bg, Player* player, TeamId winnerTeamId);
|
||||
void OnBattlegroudUpdate(Battleground* bg, uint32 diff);
|
||||
void OnBattlegroudAddPlayer(Battleground* bg, Player* player);
|
||||
|
||||
private:
|
||||
|
||||
uint32 _scriptCount;
|
||||
|
||||
Reference in New Issue
Block a user