#include "BattlefieldScript.h"
|
| bool | IsDatabaseBound () const override |
| |
| virtual void | OnBattlefieldPlayerEnterZone (Battlefield *, Player *) |
| | Called when a player enters the battlefield zone, before team-based data assignment. This is the ideal place to reassign a player's team for cross-faction purposes.
|
| |
| virtual void | OnBattlefieldPlayerLeaveZone (Battlefield *, Player *) |
| | Called when a player leaves the battlefield zone, after all cleanup. This is the ideal place to restore a player's original team/faction.
|
| |
| virtual void | OnBattlefieldPlayerJoinWar (Battlefield *, Player *) |
| | Called after a player has been added to the active war (accepted the invitation).
|
| |
| virtual void | OnBattlefieldPlayerLeaveWar (Battlefield *, Player *) |
| | Called after a player has been removed from the active war.
|
| |
| virtual void | OnBattlefieldBeforeInvitePlayerToWar (Battlefield *, Player *) |
| | Called inside InvitePlayerToWar after the WillBeKick entry is erased (using the player's current team) and before the player is inserted into m_InvitedPlayers. This is the correct place to reassign a player's effective team for pre-war zone players: the invite bucket write that follows will use the newly assigned team, keeping all subsequent core operations consistent.
|
| |
| virtual void | OnBattlefieldWarEnd (Battlefield *, bool) |
| | Called in EndBattle() after OnBattleEnd() completes, before the timer is reset. All core PlayersInWar/InvitedPlayers structures have already been cleared. Modules that maintain their own per-war player tracking should use this hook to perform end-of-war cleanup (e.g. restoring cross-faction disguises).
|
| |
| virtual bool | isAfterLoadScript () const |
| |
| virtual void | checkValidity () |
| |
| const std::string & | GetName () const |
| |
| uint16 | GetTotalAvailableHooks () |
| |
◆ BattlefieldScript()
| BattlefieldScript::BattlefieldScript |
( |
const char * |
name, |
|
|
std::vector< uint16 > |
enabledHooks = std::vector<uint16>() |
|
) |
| |
|
protected |
52 :
54{
55
56 if (enabledHooks.empty())
58 enabledHooks.emplace_back(i);
59
61}
@ BATTLEFIELDHOOK_END
Definition BattlefieldScript.h:32
std::uint16_t uint16
Definition Define.h:108
Definition ScriptObject.h:43
static void AddScript(TScript *const script, std::vector< uint16 > enabledHooks={})
Definition ScriptMgr.h:766
References ScriptRegistry< TScript >::AddScript(), and BATTLEFIELDHOOK_END.
◆ IsDatabaseBound()
| bool BattlefieldScript::IsDatabaseBound |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ OnBattlefieldBeforeInvitePlayerToWar()
| virtual void BattlefieldScript::OnBattlefieldBeforeInvitePlayerToWar |
( |
Battlefield * |
, |
|
|
Player * |
|
|
) |
| |
|
inlinevirtual |
Called inside InvitePlayerToWar after the WillBeKick entry is erased (using the player's current team) and before the player is inserted into m_InvitedPlayers. This is the correct place to reassign a player's effective team for pre-war zone players: the invite bucket write that follows will use the newly assigned team, keeping all subsequent core operations consistent.
- Parameters
-
| bf | The Battlefield instance |
| player | The player being invited to war |
Referenced by ScriptMgr::OnBattlefieldBeforeInvitePlayerToWar().
◆ OnBattlefieldPlayerEnterZone()
| virtual void BattlefieldScript::OnBattlefieldPlayerEnterZone |
( |
Battlefield * |
, |
|
|
Player * |
|
|
) |
| |
|
inlinevirtual |
Called when a player enters the battlefield zone, before team-based data assignment. This is the ideal place to reassign a player's team for cross-faction purposes.
- Parameters
-
| bf | The Battlefield instance |
| player | The player entering the zone |
Referenced by ScriptMgr::OnBattlefieldPlayerEnterZone().
◆ OnBattlefieldPlayerJoinWar()
| virtual void BattlefieldScript::OnBattlefieldPlayerJoinWar |
( |
Battlefield * |
, |
|
|
Player * |
|
|
) |
| |
|
inlinevirtual |
◆ OnBattlefieldPlayerLeaveWar()
| virtual void BattlefieldScript::OnBattlefieldPlayerLeaveWar |
( |
Battlefield * |
, |
|
|
Player * |
|
|
) |
| |
|
inlinevirtual |
◆ OnBattlefieldPlayerLeaveZone()
| virtual void BattlefieldScript::OnBattlefieldPlayerLeaveZone |
( |
Battlefield * |
, |
|
|
Player * |
|
|
) |
| |
|
inlinevirtual |
Called when a player leaves the battlefield zone, after all cleanup. This is the ideal place to restore a player's original team/faction.
- Parameters
-
| bf | The Battlefield instance |
| player | The player leaving the zone |
Referenced by ScriptMgr::OnBattlefieldPlayerLeaveZone().
◆ OnBattlefieldWarEnd()
| virtual void BattlefieldScript::OnBattlefieldWarEnd |
( |
Battlefield * |
, |
|
|
bool |
|
|
) |
| |
|
inlinevirtual |
Called in EndBattle() after OnBattleEnd() completes, before the timer is reset. All core PlayersInWar/InvitedPlayers structures have already been cleared. Modules that maintain their own per-war player tracking should use this hook to perform end-of-war cleanup (e.g. restoring cross-faction disguises).
- Parameters
-
| bf | The Battlefield instance |
| endByTimer | True if the war ended by the countdown timer expiring |
Referenced by ScriptMgr::OnBattlefieldWarEnd().
The documentation for this class was generated from the following files: