mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +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:
@@ -465,7 +465,7 @@ public:
|
||||
if (battleStarted == ENCOUNTER_STATE_OUTRO && cr->GetEntry() == NPC_DEFENDER_OF_THE_LIGHT)
|
||||
{
|
||||
cr->SetReactState(REACT_PASSIVE);
|
||||
cr->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
cr->SetImmuneToAll(true);
|
||||
cr->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H);
|
||||
cr->HandleEmoteCommand(EMOTE_STATE_READY1H);
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToAll(true);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetVisible(true);
|
||||
@@ -670,7 +670,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case EVENT_START_COUNTDOWN_14:
|
||||
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToAll(false);
|
||||
me->SummonCreatureGroup(5);
|
||||
return;
|
||||
case EVENT_FINISH_FIGHT_1:
|
||||
@@ -698,13 +698,13 @@ public:
|
||||
{
|
||||
summon->CombatStop(true);
|
||||
summon->GetThreatMgr().ClearAllThreat();
|
||||
summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetImmuneToAll(true);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->Clear(false);
|
||||
}
|
||||
me->CombatStop(true);
|
||||
me->GetThreatMgr().ClearAllThreat();
|
||||
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetImmuneToAll(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
|
||||
@@ -1027,7 +1027,7 @@ public:
|
||||
{
|
||||
tirion->CastSpell(tirion, SPELL_TIRION_CHARGE, true);
|
||||
tirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
|
||||
tirion->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
tirion->SetImmuneToAll(true);
|
||||
}
|
||||
break;
|
||||
case EVENT_OUTRO_SCENE_44:
|
||||
|
||||
Reference in New Issue
Block a user