mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
refactor(Core/Unit): PC&NPC Immunity (#11986)
* initial * refactor(Core/Unit): PC & NPC Immunities Cherry-pick TC:74af880217Co-authored-by: Treeston <treeston.nmoc@gmail.com> * fix builds error Cherry-pick TC:74af880217Co-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:
@@ -139,7 +139,7 @@ public:
|
||||
})
|
||||
.Schedule(12s, [this](TaskContext context)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToAll(false);
|
||||
_phase = PHASE_COMBAT;
|
||||
DoZoneInCombat();
|
||||
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
}
|
||||
});
|
||||
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetImmuneToPC(true);
|
||||
me->SetFaction(FACTION_MONSTER);
|
||||
summons.DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
@@ -293,13 +293,13 @@ struct npc_apothecary_genericAI : public ScriptedAI
|
||||
{
|
||||
if (action == ACTION_START_EVENT)
|
||||
{
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetImmuneToPC(true);
|
||||
me->SetFaction(FACTION_MONSTER);
|
||||
me->GetMotionMaster()->MovePoint(1, _movePos);
|
||||
}
|
||||
else if (action == ACTION_START_FIGHT)
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToAll(false);
|
||||
DoZoneInCombat();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user