mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36: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:
@@ -310,7 +310,7 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
dragon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
dragon->SetImmuneToNPC(true);
|
||||
dragon->SetFullHealth();
|
||||
|
||||
++dragonsCount;
|
||||
@@ -729,7 +729,7 @@ struct boss_sartharion_dragonAI : public BossAI
|
||||
events.Reset();
|
||||
ClearInstance();
|
||||
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToNPC(false);
|
||||
me->SetSpeed(MOVE_FLIGHT, 1.0f);
|
||||
me->SetCanFly(false);
|
||||
me->ResetLootMode();
|
||||
@@ -790,7 +790,7 @@ struct boss_sartharion_dragonAI : public BossAI
|
||||
}
|
||||
}
|
||||
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToNPC(false);
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,10 @@ public:
|
||||
{
|
||||
BossAI::Reset();
|
||||
if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
{
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetImmuneToPC(false);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) override
|
||||
|
||||
@@ -187,7 +187,10 @@ public:
|
||||
case DATA_BALTHARUS_THE_WARBORN:
|
||||
if (GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE && GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE)
|
||||
if (Creature* zarithrian = instance->GetCreature(GeneralZarithrianGUID))
|
||||
zarithrian->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
|
||||
{
|
||||
zarithrian->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
zarithrian->SetImmuneToPC(false);
|
||||
}
|
||||
break;
|
||||
case DATA_GENERAL_ZARITHRIAN:
|
||||
if (state == DONE)
|
||||
|
||||
Reference in New Issue
Block a user