aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2017-07-09 02:07:29 +0200
committertreeston <treeston.mmoc@gmail.com>2017-07-09 02:07:29 +0200
commit74af880217fc567c9949d7557408718af889402f (patch)
tree7a39bedb3fbd1a618413ef60ca390c94f4298fea /src/server/scripts/Northrend
parentc6d799444572a6d3023a560d7d1c24b0d7a8d050 (diff)
Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it. New methods on Unit: - void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false); - bool IsImmuneTo<All/PC/NPC>() const;
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp5
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp5
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp22
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp6
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp12
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp3
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp9
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp13
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp3
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp8
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp8
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp11
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp5
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp4
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp6
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp12
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp10
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp9
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp13
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp15
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp3
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp10
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp6
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp9
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp4
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp3
-rw-r--r--src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp20
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp8
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp4
40 files changed, 169 insertions, 115 deletions
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
index d835549ad17..99d30e4dc0f 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp
@@ -77,7 +77,10 @@ class boss_general_zarithrian : public CreatureScript
{
_Reset();
if (instance->GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && instance->GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
+ }
}
bool CanAIAttack(Unit const* target) const override
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index db2fc0b407b..9b48e717f75 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -175,7 +175,10 @@ class instance_ruby_sanctum : public InstanceMapScript
{
if (GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
if (Creature* zarithrian = GetCreature(DATA_GENERAL_ZARITHRIAN))
- zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ {
+ zarithrian->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ zarithrian->SetImmuneToPC(false);
+ }
}
void SetData(uint32 type, uint32 data) override
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index 4bb64f22dfc..08214a5195d 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -111,11 +111,10 @@ void AggroAllPlayers(Creature* temp)
if (player->IsAlive())
{
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ temp->SetImmuneToPC(true);
temp->SetReactState(REACT_AGGRESSIVE);
- temp->SetInCombatWith(player);
- player->SetInCombatWith(temp);
- temp->GetThreatManager().AddThreat(player, 0.0f);
+ temp->EngageWithTarget(player);
}
}
}
@@ -330,7 +329,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void Initialize()
@@ -467,7 +467,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void Initialize()
@@ -610,7 +611,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void Initialize()
@@ -761,7 +763,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void Initialize()
@@ -921,7 +924,8 @@ public:
me->SetReactState(REACT_PASSIVE);
// THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void Initialize()
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 433721e70bd..fc2d5c466cc 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -488,7 +488,8 @@ class boss_toc_champion_controller : public CreatureScript
{
_summons.Summon(champion);
champion->SetReactState(REACT_PASSIVE);
- champion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ champion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ champion->SetImmuneToPC(false);
if (playerTeam == ALLIANCE)
{
champion->SetHomePosition(vChampionJumpTarget[pos].GetPositionX(), vChampionJumpTarget[pos].GetPositionY(), vChampionJumpTarget[pos].GetPositionZ(), 0);
@@ -519,7 +520,8 @@ class boss_toc_champion_controller : public CreatureScript
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
{
summon->SetReactState(REACT_AGGRESSIVE);
- summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ summon->SetImmuneToPC(false);
}
}
break;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
index 767f46756ea..8f50ed0e365 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp
@@ -121,7 +121,8 @@ class boss_jaraxxus : public CreatureScript
_JustReachedHome();
instance->SetBossState(BOSS_JARAXXUS, FAIL);
DoCast(me, SPELL_JARAXXUS_CHAINS);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
}
void KilledUnit(Unit* who) override
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 81cd4ff8470..17ce9458905 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -205,7 +205,8 @@ class boss_gormok : public CreatureScript
{
case 0:
instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -614,7 +615,8 @@ struct boss_jormungarAI : public BossAI
case EVENT_SUMMON_ACIDMAW:
if (Creature* acidmaw = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{
- acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ acidmaw->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ acidmaw->SetImmuneToPC(false);
acidmaw->SetReactState(REACT_AGGRESSIVE);
acidmaw->SetInCombatWithZone();
acidmaw->CastSpell(acidmaw, SPELL_EMERGE);
@@ -771,7 +773,8 @@ class boss_dreadscale : public CreatureScript
{
case 0:
instance->DoCloseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
@@ -944,7 +947,8 @@ class boss_icehowl : public CreatureScript
break;
case 2:
instance->DoUseDoorOrButton(instance->GetGuidData(GO_MAIN_GATE_DOOR));
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
index 73dd987171e..49bd28f7e56 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp
@@ -203,7 +203,8 @@ struct boss_twin_baseAI : public BossAI
switch (uiId)
{
case 1:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
break;
default:
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
index 8a404f66cc5..fdc93f56c39 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp
@@ -241,7 +241,8 @@ class npc_announcer_toc10 : public CreatureScript
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetGuidData(NPC_JARAXXUS)))
{
jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS);
- jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ jaraxxus->SetImmuneToPC(false);
jaraxxus->SetReactState(REACT_DEFENSIVE);
jaraxxus->SetInCombatWithZone();
}
@@ -430,7 +431,8 @@ class npc_fizzlebang_toc : public CreatureScript
_instance->SetData(TYPE_EVENT, 1180);
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_JARAXXUS)))
{
- jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ jaraxxus->SetImmuneToPC(false);
jaraxxus->SetReactState(REACT_AGGRESSIVE);
jaraxxus->SetInCombatWithZone();
}
@@ -527,7 +529,8 @@ class npc_fizzlebang_toc : public CreatureScript
Talk(SAY_STAGE_1_04);
if (Creature* jaraxxus = me->SummonCreature(NPC_JARAXXUS, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 5.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{
- jaraxxus->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ jaraxxus->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ jaraxxus->SetImmuneToPC(true);
jaraxxus->SetReactState(REACT_PASSIVE);
jaraxxus->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ());
}
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index fd8b209e0cb..a70bf5992e8 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
@@ -213,7 +213,7 @@ class npc_drakkari_invader : public CreatureScript
if (type == POINT_MOTION_TYPE && pointId == POINT_LANDING)
{
me->Dismount();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
DoCastAOE(SPELL_INVADER_TAUNT);
}
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.cpp
index 4aec3a9ed78..9da3da05f95 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_horAI.cpp
@@ -27,7 +27,7 @@ void boss_horAI::Reset()
{
_Reset();
me->SetVisible(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(true);
me->SetReactState(REACT_PASSIVE);
if (instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED)
instance->ProcessEvent(nullptr, EVENT_DO_WIPE);
@@ -38,7 +38,7 @@ void boss_horAI::DoAction(int32 actionId)
switch (actionId)
{
case ACTION_ENTER_COMBAT: // called by InstanceScript when boss shall enter in combat.
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
me->SetReactState(REACT_AGGRESSIVE);
DoZoneInCombat(me, 150.0f);
break;
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 326a78c03c4..7d620ae5a60 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1032,7 +1032,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
if (Creature* lichking = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING_ESCAPE)))
{
- lichking->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ lichking->SetImmuneToPC(true);
lichking->RemoveAllAttackers();
DeleteAllFromThreatList(lichking, me->GetGUID());
@@ -1046,7 +1046,8 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
case EVENT_ESCAPE_6:
if (Creature* lichking = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING_ESCAPE)))
{
- lichking->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_PACIFIED);
+ lichking->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
+ lichking->SetImmuneToPC(false);
if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
{
@@ -1929,7 +1930,7 @@ class npc_frostsworn_general : public CreatureScript
{
if (Creature* reflection = me->SummonCreature(NPC_REFLECTION, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000))
{
- reflection->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ reflection->SetImmuneToPC(false);
target->CastSpell(reflection, SPELL_CLONE, true);
target->CastSpell(reflection, SPELL_GHOST_VISUAL, true);
reflection->AI()->AttackStart(target);
@@ -2164,7 +2165,7 @@ struct npc_escape_event_trash : public ScriptedAI
DoZoneInCombat(me, 0.0f);
if (Creature* leader = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ESCAPE_LEADER)))
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->SetInCombatWith(leader);
leader->SetInCombatWith(me);
AddThreat(leader, 0.0f);
@@ -2595,7 +2596,7 @@ class npc_quel_delar_sword : public CreatureScript
if (_intro)
_events.ScheduleEvent(EVENT_QUEL_DELAR_INIT, 0);
else
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
}
void EnterCombat(Unit* /*victim*/) override
@@ -2663,7 +2664,7 @@ class npc_quel_delar_sword : public CreatureScript
case EVENT_QUEL_DELAR_FIGHT:
Talk(SAY_QUEL_DELAR_SWORD);
me->GetMotionMaster()->MovePoint(0, QuelDelarMovement[2]);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
break;
default:
break;
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
index 936a1117b88..89f95a32cc8 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp
@@ -590,7 +590,8 @@ class instance_halls_of_reflection : public InstanceMapScript
if (Creature* temp = instance->GetCreature(guid))
{
temp->CastSpell(temp, SPELL_SPIRIT_ACTIVATE, false);
- temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
+ temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ temp->SetImmuneToAll(false);
temp->AI()->DoZoneInCombat(temp, 100.00f);
}
}
diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
index 465bb9bcf24..110341a552f 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
@@ -108,7 +108,7 @@ class boss_drakkari_colossus : public CreatureScript
if (GetData(DATA_INTRO_DONE))
{
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->RemoveAura(SPELL_FREEZE_ANIM);
}
@@ -140,7 +140,7 @@ class boss_drakkari_colossus : public CreatureScript
me->GetMotionMaster()->MoveIdle();
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
DoCast(me, SPELL_FREEZE_ANIM);
break;
case ACTION_UNFREEZE_COLOSSUS:
@@ -149,7 +149,7 @@ class boss_drakkari_colossus : public CreatureScript
return;
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->RemoveAura(SPELL_FREEZE_ANIM);
me->SetInCombatWithZone();
@@ -163,7 +163,7 @@ class boss_drakkari_colossus : public CreatureScript
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
+ if (me->IsImmuneToPC())
damage = 0;
if (phase == COLOSSUS_PHASE_NORMAL ||
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
index 28be5f8ccc0..f038f653782 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp
@@ -244,7 +244,8 @@ class boss_blood_council_controller : public CreatureScript
for (uint32 bossData : PrincesData)
if (Creature* prince = ObjectAccessor::GetCreature(*me, instance->GetGuidData(bossData)))
{
- prince->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ prince->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ prince->SetImmuneToPC(false);
if (bossData == DATA_PRINCE_VALANAR)
prince->SetHealth(prince->GetMaxHealth());
}
@@ -453,7 +454,7 @@ struct BloodPrincesBossAI : public BossAI
summons.DespawnAll();
me->SetCombatPulseDelay(0);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
_isEmpowered = false;
me->SetHealth(_spawnHealth);
instance->SetData(DATA_ORB_WHISPERER_ACHIEVEMENT, uint32(true));
@@ -562,7 +563,8 @@ struct BloodPrincesBossAI : public BossAI
{
case ACTION_STAND_UP:
me->RemoveAurasDueToSpell(SPELL_FEIGN_DEATH);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
index f5568b4c298..e2951277101 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp
@@ -295,7 +295,7 @@ class boss_deathbringer_saurfang : public CreatureScript
events.Reset();
events.SetPhase(PHASE_COMBAT);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
if (!_introDone)
{
DoCast(me, SPELL_GRIP_OF_AGONY);
@@ -323,7 +323,7 @@ class boss_deathbringer_saurfang : public CreatureScript
void AttackStart(Unit* victim) override
{
- if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
+ if (me->IsImmuneToPC())
return;
ScriptedAI::AttackStart(victim);
@@ -333,7 +333,7 @@ class boss_deathbringer_saurfang : public CreatureScript
{
ScriptedAI::EnterEvadeMode(why);
if (_introDone)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
}
void JustReachedHome() override
@@ -369,7 +369,8 @@ class boss_deathbringer_saurfang : public CreatureScript
_dead = true;
_JustDied();
_EnterEvadeMode();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(true);
DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION);
DoCast(me, SPELL_ACHIEVEMENT, true);
@@ -489,7 +490,7 @@ class boss_deathbringer_saurfang : public CreatureScript
case EVENT_INTRO_FINISH:
events.SetPhase(PHASE_COMBAT);
_introDone = true;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
break;
case EVENT_SUMMON_BLOOD_BEAST:
for (uint32 i10 = 0; i10 < 2; ++i10)
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index ce92ffc6abc..b23b3ca9917 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -249,7 +249,10 @@ class boss_professor_putricide : public CreatureScript
me->GetMotionMaster()->MovementExpired();
if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE)
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ {
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
+ }
}
void EnterCombat(Unit* who) override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index 4bf8f97f623..81e092f57a2 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -849,7 +849,7 @@ class npc_rimefang : public CreatureScript
me->setActive(true);
me->SetSpeedRate(MOVE_FLIGHT, 2.0f);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
float moveTime = me->GetExactDist(&RimefangFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
me->m_Events.AddEvent(new FrostwyrmLandEvent(*me, RimefangLandPos), me->m_Events.CalculateTime(uint64(moveTime) + 250));
me->SetDefaultMovementType(IDLE_MOTION_TYPE);
@@ -871,7 +871,7 @@ class npc_rimefang : public CreatureScript
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(RimefangLandPos);
me->SetFacingTo(RimefangLandPos.GetOrientation());
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 97b3261f51e..d00e56606b5 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -527,7 +527,7 @@ class boss_the_lich_king : public CreatureScript
void Reset() override
{
_Reset();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
me->SetReactState(REACT_PASSIVE);
events.SetPhase(PHASE_INTRO);
Initialize();
@@ -936,7 +936,7 @@ class boss_the_lich_king : public CreatureScript
break;
case EVENT_FINISH_INTRO:
me->SetWalk(false);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
events.SetPhase(PHASE_ONE);
DoZoneInCombat();
@@ -1855,7 +1855,7 @@ class npc_terenas_menethil : public CreatureScript
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_THE_LICH_KING)))
{
lichKing->AI()->DoAction(ACTION_FINISH_OUTRO);
- lichKing->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ lichKing->SetImmuneToNPC(false);
if (Creature* tirion = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_HIGHLORD_TIRION_FORDRING)))
tirion->AI()->AttackStart(lichKing);
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 2ddfa86f5fa..ed85ee3fa17 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -837,7 +837,7 @@ class boss_sister_svalna : public CreatureScript
case ACTION_START_GAUNTLET:
me->setActive(true);
_isEventInProgress = true;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(true);
events.ScheduleEvent(EVENT_SVALNA_START, 25000);
break;
case ACTION_RESURRECT_CAPTAINS:
@@ -871,7 +871,7 @@ class boss_sister_svalna : public CreatureScript
_isEventInProgress = false;
me->setActive(false);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
me->SetDisableGravity(false);
me->SetHover(false);
}
@@ -1042,7 +1042,7 @@ class npc_crok_scourgebane : public CreatureScript
{
// pause pathing until trash pack is cleared
case 0:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToNPC(false);
Talk(SAY_CROK_COMBAT_WP_0);
if (!_aliveTrash.empty())
SetEscortPaused(true);
@@ -1788,7 +1788,8 @@ class spell_icc_stoneform : public SpellScriptLoader
if (Creature* target = GetTarget()->ToCreature())
{
target->SetReactState(REACT_PASSIVE);
- target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ target->SetImmuneToPC(true);
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_02);
}
}
@@ -1798,7 +1799,8 @@ class spell_icc_stoneform : public SpellScriptLoader
if (Creature* target = GetTarget()->ToCreature())
{
target->SetReactState(REACT_AGGRESSIVE);
- target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ target->SetImmuneToPC(false);
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index faaafac710a..02313e8d286 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -224,7 +224,8 @@ public:
return;
_Reset();
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(true);
_skeletonCount = 0;
_bansheeCount = 0;
_abominationCount = 0;
@@ -424,7 +425,8 @@ public:
case EVENT_PHASE_TWO:
me->CastStop();
events.SetPhase(PHASE_TWO);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
ResetThreatList();
me->SetReactState(REACT_AGGRESSIVE);
Talk(EMOTE_PHASE_TWO);
@@ -521,7 +523,7 @@ public:
case ACTION_BEGIN_ENCOUNTER:
if (instance->GetBossState(BOSS_KELTHUZAD) != NOT_STARTED)
return;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
instance->SetBossState(BOSS_KELTHUZAD, IN_PROGRESS);
events.SetPhase(PHASE_ONE);
DoZoneInCombat();
@@ -805,7 +807,7 @@ public:
me->RemoveAllAuras();
me->CombatStop();
me->StopMoving();
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
me->DespawnOrUnsummon(30 * IN_MILLISECONDS); // just in case anything interrupts the movement
me->GetMotionMaster()->MoveTargetedHome();
default:
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index b7333e90e2e..840a8c0dba7 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -105,7 +105,8 @@ public:
{
DoCastAOE(SPELL_TELEPORT_BACK);
me->SetReactState(REACT_AGGRESSIVE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
}
balconyCount = 0;
@@ -243,7 +244,8 @@ public:
case EVENT_BALCONY:
events.SetPhase(PHASE_BALCONY);
me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(true, true);
me->AttackStop();
me->StopMoving();
me->RemoveAllAuras();
@@ -299,7 +301,8 @@ public:
EnterPhaseGround();
break;
case EVENT_GROUND_ATTACKABLE:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
break;
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index d6a36680c33..5233a49b881 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -330,7 +330,8 @@ public:
me->DespawnOrUnsummon();
me->SetRespawnTime(initial ? 5 : 30);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED);
+ me->SetImmuneToPC(true);
events.SetPhase(PHASE_RESETTING);
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
feugen->AI()->DoAction(ACTION_BEGIN_RESET_ENCOUNTER);
@@ -395,7 +396,7 @@ public:
ballLightningUnlocked = false;
me->RemoveAura(SPELL_THADDIUS_INACTIVE_VISUAL);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
DoZoneInCombat();
@@ -652,7 +653,7 @@ public:
if (!isOverloading)
{
isOverloading = true;
- caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ caster->SetImmuneToPC(false);
if (Creature* creatureCaster = caster->ToCreature())
creatureCaster->AI()->Talk(EMOTE_TESLA_LINK_BREAKS);
me->RemoveAura(SPELL_STALAGG_CHAIN_VISUAL);
@@ -669,7 +670,7 @@ public:
refreshBeam = false;
caster->CastStop();
caster->CastSpell(me, SPELL_STALAGG_CHAIN_VISUAL, true);
- caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ caster->SetImmuneToPC(true);
}
}
@@ -919,7 +920,7 @@ public:
if (!isOverloading)
{
isOverloading = true;
- caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ caster->SetImmuneToPC(false);
if (Creature* creatureCaster = caster->ToCreature())
creatureCaster->AI()->Talk(EMOTE_TESLA_LINK_BREAKS);
me->RemoveAura(SPELL_STALAGG_CHAIN_VISUAL);
@@ -936,7 +937,7 @@ public:
refreshBeam = false;
caster->CastStop();
caster->CastSpell(me, SPELL_FEUGEN_CHAIN_VISUAL, true);
- caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ caster->SetImmuneToPC(true);
}
}
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
index 553300715e5..8e51d79a87b 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
@@ -376,7 +376,7 @@ public:
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// TO DO: find what in core is making boss slower than in retail (when correct speed data) or find missing movement flag update or forced spline change
me->SetSpeedRate(MOVE_FLIGHT, _flySpeed * 0.25f);
@@ -466,7 +466,7 @@ public:
pos.m_positionZ = alexstraszaBunny->GetPositionZ();
alexstraszaBunny->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 30.0f, alexstraszaBunny->GetAngle(me));
me->GetMotionMaster()->MoveLand(POINT_LAND_P_ONE, pos);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
events.ScheduleEvent(EVENT_LAND_START_ENCOUNTER, 7*IN_MILLISECONDS, 1, PHASE_NOT_STARTED);
diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
index cb17a64563a..0de036eb782 100644
--- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
+++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp
@@ -138,14 +138,14 @@ class boss_keristrasza : public CreatureScript
{
if (remove)
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasAura(SPELL_FROZEN_PRISON))
me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
}
else
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoCast(me, SPELL_FROZEN_PRISON, false);
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
index 460288d99f0..8b18640c6cd 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp
@@ -285,7 +285,8 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
if (caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6))
{
caster->ToCreature()->SetReactState(REACT_PASSIVE);
- caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6);
+ caster->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_UNK_6);
+ caster->SetImmuneToAll(true, true);
}
}
}
@@ -295,7 +296,8 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader
if (Unit* caster = GetCaster())
{
caster->ToCreature()->SetReactState(REACT_AGGRESSIVE);
- caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_UNK_6);
+ caster->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_UNK_6);
+ caster->SetImmuneToAll(false);
}
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
index 72a911d398e..69d5fa4d2fb 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp
@@ -379,11 +379,12 @@ class boss_algalon_the_observer : public CreatureScript
events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17000);
events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26000);
me->DespawnOrUnsummon(34000);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToNPC(true);
break;
case ACTION_INIT_ALGALON:
_firstPull = false;
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
break;
}
}
@@ -396,7 +397,8 @@ class boss_algalon_the_observer : public CreatureScript
void EnterCombat(Unit* /*target*/) override
{
uint32 introDelay = 0;
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToNPC(true);
events.Reset();
events.SetPhase(PHASE_ROLE_PLAY);
@@ -503,7 +505,7 @@ class boss_algalon_the_observer : public CreatureScript
{
instance->SetBossState(BOSS_ALGALON, FAIL);
BossAI::EnterEvadeMode(why);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
me->SetSheath(SHEATH_STATE_UNARMED);
}
@@ -578,7 +580,7 @@ class boss_algalon_the_observer : public CreatureScript
break;
case EVENT_INTRO_FINISH:
events.Reset();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
break;
case EVENT_START_COMBAT:
instance->SetBossState(BOSS_ALGALON, IN_PROGRESS);
@@ -587,7 +589,8 @@ class boss_algalon_the_observer : public CreatureScript
{
events.SetPhase(PHASE_NORMAL);
me->SetSheath(SHEATH_STATE_MELEE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToNPC(false);
me->SetReactState(REACT_DEFENSIVE);
DoCastAOE(SPELL_SUPERMASSIVE_FAIL, true);
//! Workaround for Creature::_IsTargetAcceptable returning false
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index b436f196b40..2a018700b34 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -1356,7 +1356,8 @@ class npc_healthy_spore : public CreatureScript
npc_healthy_sporeAI(Creature* creature) : ScriptedAI(creature)
{
SetCombatMovement(false);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
me->SetReactState(REACT_PASSIVE);
DoCast(me, SPELL_HEALTHY_SPORE_VISUAL);
DoCast(me, SPELL_POTENT_PHEROMONES);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
index 1fb7dda696a..ae61452dc6e 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp
@@ -181,7 +181,8 @@ class boss_ignis : public CreatureScript
{
summon->SetFaction(FACTION_MONSTER_2);
summon->SetReactState(REACT_AGGRESSIVE);
- summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IMMUNE_TO_PC);
+ summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED);
+ summon->SetImmuneToPC(false);
summon->SetControlled(false, UNIT_STATE_ROOT);
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
index 4859e376779..3b95b36c375 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
@@ -981,7 +981,8 @@ class boss_vx_001 : public CreatureScript
events.ScheduleEvent(EVENT_FLAME_SUPPRESSANT_VX, 6000);
// Missing break intended.
case DO_START_VX001:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); // Remove emotestate.
//me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); Blizzard handles hover animation like this it seems.
@@ -1157,7 +1158,8 @@ class boss_aerial_command_unit : public CreatureScript
events.ScheduleEvent(EVENT_SUMMON_FIRE_BOTS, 1000, 0, PHASE_AERIAL_COMMAND_UNIT);
// Missing break intended.
case DO_START_AERIAL:
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
events.SetPhase(PHASE_AERIAL_COMMAND_UNIT);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
index 118c293755a..9c6cffcba13 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
@@ -474,7 +474,7 @@ class boss_thorim : public CreatureScript
me->SetReactState(REACT_PASSIVE);
me->SetDisableGravity(true);
me->SetControlled(true, UNIT_STATE_ROOT);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
events.SetPhase(PHASE_NULL);
@@ -631,7 +631,7 @@ class boss_thorim : public CreatureScript
if (Creature* runicColossus = instance->GetCreature(DATA_RUNIC_COLOSSUS))
{
- runicColossus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ runicColossus->SetImmuneToPC(false);
runicColossus->AI()->DoAction(ACTION_ACTIVATE_ADDS);
}
@@ -838,7 +838,7 @@ class boss_thorim : public CreatureScript
if (++_killedCount >= 6)
{
// Event starts
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
DoZoneInCombat(me);
}
break;
@@ -1356,7 +1356,7 @@ struct npc_thorim_minibossAI : public ScriptedAI
{
for (ObjectGuid const& guid : _summons)
if (Creature* summon = ObjectAccessor::GetCreature(*me, guid))
- summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ summon->SetImmuneToPC(false);
}
}
@@ -1426,7 +1426,7 @@ class npc_runic_colossus : public CreatureScript
if (Creature* giant = _instance->GetCreature(DATA_RUNE_GIANT))
{
- giant->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ giant->SetImmuneToPC(false);
giant->AI()->DoAction(ACTION_ACTIVATE_ADDS);
}
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
index 7f3a2120e88..c3817b0525b 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp
@@ -1048,7 +1048,8 @@ class boss_brain_of_yogg_saron : public CreatureScript
void Reset() override
{
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
DoCast(me, SPELL_MATCH_HEALTH);
_summons.DespawnAll();
}
@@ -1062,7 +1063,8 @@ class boss_brain_of_yogg_saron : public CreatureScript
DoCastAOE(SPELL_SHATTERED_ILLUSION_REMOVE, true);
DoCast(me, SPELL_MATCH_HEALTH_2, true); // it doesn't seem to hit Yogg-Saron here
DoCast(me, SPELL_BRAIN_HURT_VISUAL, true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(true);
if (Creature* voice = _instance->GetCreature(DATA_VOICE_OF_YOGG_SARON))
voice->AI()->DoAction(ACTION_PHASE_THREE);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index e023be23cd4..bd1d2b9c3b6 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -228,7 +228,7 @@ class instance_ulduar : public InstanceMapScript
if (_algalonTimer && _algalonTimer <= 60)
algalon->AI()->DoAction(ACTION_INIT_ALGALON);
else
- algalon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ algalon->SetImmuneToPC(false);
}
// Keepers at Observation Ring
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
index 3d2fa75ecac..743adbb739f 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp
@@ -113,7 +113,8 @@ class boss_ingvar_the_plunderer : public CreatureScript
{
if (me->GetEntry() != NPC_INGVAR)
me->UpdateEntry(NPC_INGVAR);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
_Reset();
}
@@ -129,7 +130,8 @@ class boss_ingvar_the_plunderer : public CreatureScript
me->StopMoving();
DoCast(me, SPELL_INGVAR_FEIGN_DEATH, true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(true, true);
Talk(SAY_DEATH);
}
@@ -227,7 +229,8 @@ class boss_ingvar_the_plunderer : public CreatureScript
break;
case EVENT_JUST_TRANSFORMED:
ScheduleSecondPhase();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
if (Unit* target = me->GetThreatManager().SelectVictim())
AttackStart(target);
else
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
index 60426fe448f..4d0dcd4cd74 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp
@@ -292,7 +292,7 @@ public:
}
case ACTION_START_FIGHT:
me->RemoveAurasDueToSpell(SPELL_FREEZE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
DoZoneInCombat();
if (Creature* orb = ObjectAccessor::GetCreature(*me, _orb))
orb->DespawnOrUnsummon(1000);
@@ -345,7 +345,7 @@ struct PalehoofMinionsBossAI : public BossAI
if (actionId == ACTION_START_FIGHT)
{
me->RemoveAurasDueToSpell(SPELL_FREEZE);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
DoZoneInCombat();
}
}
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
index effd1741bf1..968210df209 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp
@@ -265,7 +265,8 @@ public:
Talk(SAY_DRAKE_DEATH);
DoCast(me, SPELL_SKADI_TELEPORT, true);
summons.DespawnEntry(NPC_WORLD_TRIGGER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
_phase = PHASE_GROUND;
diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
index cf5d256f3a6..b2c37cc59b6 100644
--- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
+++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp
@@ -557,7 +557,7 @@ class instance_violet_hold : public InstanceMapScript
{
if (Creature* moragg = GetCreature(DATA_MORAGG))
{
- moragg->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ moragg->SetImmuneToAll(false);
moragg->AI()->DoZoneInCombat(moragg, 200.0f);
}
});
@@ -590,12 +590,12 @@ class instance_violet_hold : public InstanceMapScript
for (uint32 i = DATA_EREKEM_GUARD_1; i <= DATA_EREKEM_GUARD_2; ++i)
{
if (Creature* guard = instance->GetCreature(GetGuidData(i)))
- guard->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ guard->SetImmuneToAll(false);
}
if (Creature* erekem = GetCreature(DATA_EREKEM))
{
- erekem->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ erekem->SetImmuneToAll(false);
erekem->AI()->DoZoneInCombat(erekem, 200.0f);
}
});
@@ -618,7 +618,7 @@ class instance_violet_hold : public InstanceMapScript
{
if (Creature* ichoron = GetCreature(DATA_ICHORON))
{
- ichoron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ ichoron->SetImmuneToAll(false);
ichoron->AI()->DoZoneInCombat(ichoron, 200.0f);
}
});
@@ -640,7 +640,7 @@ class instance_violet_hold : public InstanceMapScript
{
if (Creature* lavanthor = GetCreature(DATA_LAVANTHOR))
{
- lavanthor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ lavanthor->SetImmuneToAll(false);
lavanthor->AI()->DoZoneInCombat(lavanthor, 200.0f);
}
});
@@ -667,7 +667,7 @@ class instance_violet_hold : public InstanceMapScript
{
if (Creature* xevozz = GetCreature(DATA_XEVOZZ))
{
- xevozz->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ xevozz->SetImmuneToAll(false);
xevozz->AI()->DoZoneInCombat(xevozz, 200.0f);
}
});
@@ -693,7 +693,7 @@ class instance_violet_hold : public InstanceMapScript
{
if (Creature* zuramat = GetCreature(DATA_ZURAMAT))
{
- zuramat->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ zuramat->SetImmuneToAll(false);
zuramat->AI()->DoZoneInCombat(zuramat, 200.0f);
}
});
@@ -733,7 +733,7 @@ class instance_violet_hold : public InstanceMapScript
UpdateKilledBoss(guard);
guard->GetMotionMaster()->MoveTargetedHome();
- guard->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ guard->SetImmuneToAll(true);
}
}
// no break
@@ -746,7 +746,7 @@ class instance_violet_hold : public InstanceMapScript
}
boss->GetMotionMaster()->MoveTargetedHome();
- boss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ boss->SetImmuneToAll(true);
break;
}
}
@@ -901,7 +901,7 @@ class instance_violet_hold : public InstanceMapScript
{
cyanigosa->RemoveAurasDueToSpell(SPELL_CYANIGOSA_ARCANE_POWER_STATE);
cyanigosa->CastSpell(cyanigosa, SPELL_CYANIGOSA_TRANSFORM, true);
- cyanigosa->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ cyanigosa->SetImmuneToAll(false);
}
});
});
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 50818339887..fccc0a8f437 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -727,7 +727,7 @@ public:
owner->CastSpell(owner, SPELL_SUBDUED, true);
GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true);
owner->SetFaction(35);
- owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ owner->SetImmuneToAll(true);
owner->DespawnOrUnsummon(3 * MINUTE*IN_MILLISECONDS);
}
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index e8b70b98010..43983271833 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -550,7 +550,7 @@ class npc_wyrmrest_defender : public CreatureScript
{
case SPELL_WYRMREST_DEFENDER_MOUNT:
Talk(WHISPER_MOUNTED, me->GetCharmerOrOwner());
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ me->SetImmuneToAll(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
break;
// Both below are for checking low hp warning
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 78be007420d..f4749ef74f4 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -373,7 +373,7 @@ public:
if (me->FindNearestGameObject(OBJECT_HAUNCH, 2.0f))
{
me->SetStandState(UNIT_STAND_STATE_DEAD);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
}
_phase = 0;
@@ -568,7 +568,8 @@ public:
{
_playerGUID.Clear();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(false);
me->SetReactState(REACT_AGGRESSIVE);
}
@@ -618,7 +619,8 @@ public:
{
if (spell->Id == SPELL_SMOKE_BOMB && caster->GetTypeId() == TYPEID_PLAYER)
{
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ me->SetImmuneToPC(true);
me->SetReactState(REACT_PASSIVE);
me->CombatStop(false);
_playerGUID = caster->GetGUID();
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 5bc39c7e47d..efe1691d479 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -719,7 +719,7 @@ class npc_wild_wyrm : public CreatureScript
InitSpellsForPhase();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(false);
}
void DoAction(int32 action) override
@@ -758,7 +758,7 @@ class npc_wild_wyrm : public CreatureScript
_playerGuid = caster->GetGUID();
DoCastAOE(SPELL_FULL_HEAL_MANA, true);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
+ me->SetImmuneToPC(true);
me->GetMotionMaster()->MovePoint(POINT_START_FIGHT, *caster);
}