Battlefields: Move BF scripts out of game

This commit introduces the usual script interface
for battlefields.

(cherry picked from commit f7faf20254)
This commit is contained in:
Carbenium
2020-06-22 16:10:34 +02:00
committed by Shauren
parent a26cc135fa
commit 49523a74a4
15 changed files with 289 additions and 189 deletions

View File

@@ -28,6 +28,7 @@ class AreaTriggerAI;
class AuctionHouseObject;
class Aura;
class AuraScript;
class Battlefield;
class Battleground;
class BattlegroundMap;
class Channel;
@@ -470,6 +471,17 @@ class TC_GAME_API OnlyOnceAreaTriggerScript : public AreaTriggerScript
void ResetAreaTriggerDone(Player const* player, AreaTriggerEntry const* trigger);
};
class TC_GAME_API BattlefieldScript : public ScriptObject
{
protected:
BattlefieldScript(char const* name);
public:
virtual Battlefield* GetBattlefield() const = 0;
};
class TC_GAME_API BattlegroundScript : public ScriptObject
{
protected:
@@ -1016,6 +1028,10 @@ class TC_GAME_API ScriptMgr
bool OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger, bool entered);
public: /* BattlefieldScript */
Battlefield* CreateBattlefield(uint32 scriptId);
public: /* BattlegroundScript */
Battleground* CreateBattleground(BattlegroundTypeId typeId);