refactor(Core/Unit): PC&NPC Immunity (#11986)

* initial

* refactor(Core/Unit): PC & NPC Immunities

Cherry-pick TC: 74af880217

Co-authored-by: Treeston <treeston.nmoc@gmail.com>

* fix builds error

Cherry-pick TC: 74af880217

Co-authored-by: Treeston <treeston.nmoc@gmail.com>

* Fix nef combat, and replace SetFlag by SetUnitFlag

* fix combat with jedoga

Co-authored-by: Treeston <treeston.nmoc@gmail.com>
This commit is contained in:
Maelthyr
2022-06-18 14:16:45 +02:00
committed by GitHub
parent 4bc99f8070
commit d928d8d96a
88 changed files with 450 additions and 328 deletions

View File

@@ -1557,7 +1557,7 @@ struct npc_coren_direbrew : public ScriptedAI
{
_events.Reset();
_summons.DespawnAll();
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
me->SetImmuneToPC(true);
me->SetFaction(FACTION_FRIENDLY);
_events.SetPhase(PHASE_ALL);
@@ -1596,7 +1596,7 @@ struct npc_coren_direbrew : public ScriptedAI
if (action == ACTION_START_FIGHT)
{
_events.SetPhase(PHASE_ONE);
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
me->SetImmuneToPC(false);
me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON);
DoZoneInCombat();
@@ -1830,7 +1830,7 @@ struct npc_direbrew_antagonist : public ScriptedAI
Talk(SAY_ANTAGONIST_2);
break;
case ACTION_ANTAGONIST_HOSTILE:
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
me->SetImmuneToPC(false);
me->SetFaction(FACTION_GOBLIN_DARK_IRON_BAR_PATRON);
DoZoneInCombat();
break;