diff options
| author | DavuKnight <112143769+DavuKnight@users.noreply.github.com> | 2022-09-21 07:33:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-21 08:33:28 -0400 |
| commit | d8598c764eb8691a4c5201fbb254b4d449fc2531 (patch) | |
| tree | 5a609d68d50d0449370d839db08847c131d36891 /src/server/game/Scripting/ScriptDefines | |
| parent | dfa49e9433d71c89afd01f769842de4cd76f9259 (diff) | |
feat(core): OnFfaPvpStateUpdate Event (#13023)
* Event for Notification when the Player enters into or Leaves Ffa
* Bug and Formatting Fixes
Diffstat (limited to 'src/server/game/Scripting/ScriptDefines')
| -rw-r--r-- | src/server/game/Scripting/ScriptDefines/CreatureScript.cpp | 9 | ||||
| -rw-r--r-- | src/server/game/Scripting/ScriptDefines/PlayerScript.cpp | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/server/game/Scripting/ScriptDefines/CreatureScript.cpp b/src/server/game/Scripting/ScriptDefines/CreatureScript.cpp index 1bbc61f97c..aadf276f1b 100644 --- a/src/server/game/Scripting/ScriptDefines/CreatureScript.cpp +++ b/src/server/game/Scripting/ScriptDefines/CreatureScript.cpp @@ -170,6 +170,15 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature) return tempScript ? tempScript->GetAI(creature) : nullptr; } +//Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed on the player +void ScriptMgr::OnFfaPvpStateUpdate(Creature* creature, bool InPvp) +{ + ExecuteScript<AllCreatureScript>([&](AllCreatureScript* script) + { + script->OnFfaPvpStateUpdate(creature, InPvp); + }); +} + void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff) { ASSERT(creature); diff --git a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp index 7562313383..a8794e8216 100644 --- a/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp +++ b/src/server/game/Scripting/ScriptDefines/PlayerScript.cpp @@ -1263,6 +1263,7 @@ void ScriptMgr::OnGetArenaTeamId(Player* player, uint8 slot, uint32& result) }); } +//Signifies that IsFfaPvp has been called. void ScriptMgr::OnIsFFAPvP(Player* player, bool& result) { ExecuteScript<PlayerScript>([&](PlayerScript* script) @@ -1270,6 +1271,14 @@ void ScriptMgr::OnIsFFAPvP(Player* player, bool& result) script->OnIsFFAPvP(player, result); }); } +//Fires whenever the UNIT_BYTE2_FLAG_FFA_PVP bit is Changed +void ScriptMgr::OnFfaPvpStateUpdate(Player* player, bool result) +{ + ExecuteScript<PlayerScript>([&](PlayerScript* script) + { + script->OnFfaPvpStateUpdate(player, result); + }); +} void ScriptMgr::OnIsPvP(Player* player, bool& result) { |
