feat(core): OnFfaPvpStateUpdate Event (#13023)

* Event for Notification when the Player enters into or Leaves Ffa

* Bug and Formatting Fixes
This commit is contained in:
DavuKnight
2022-09-21 07:33:28 -05:00
committed by GitHub
parent dfa49e9433
commit d8598c764e
9 changed files with 90 additions and 14 deletions

View File

@@ -2088,8 +2088,14 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
if (owner->HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED))
trigger->SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
if (owner->IsFFAPvP())
trigger->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
{
if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
{
sScriptMgr->OnFfaPvpStateUpdate(trigger, true);
trigger->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
}
}
// xinef: Remove Immunity flags
trigger->SetImmuneToNPC(false);
// xinef: set proper orientation, fixes cast against stealthed targets