diff options
| author | treeston <treeston.mmoc@gmail.com> | 2017-07-09 02:07:29 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-18 18:53:13 +0200 |
| commit | 2dfafa69ebc422feba1aa01e0c4fab76366f552f (patch) | |
| tree | c5499048f5e797da591f365709d965cd8f2edd74 /src/server/scripts/Kalimdor | |
| parent | befbfbb655731f0202b79586c98f2780ca507edf (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;
(cherry picked from commit 74af880217fc567c9949d7557408718af889402f)
Diffstat (limited to 'src/server/scripts/Kalimdor')
6 files changed, 14 insertions, 14 deletions
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index d0758b0d1ce..02e65389a16 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -335,7 +335,7 @@ public: void AttackStart(Unit* who) override { - if (who && !who->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_PC)) + if (who && !who->IsImmuneToPC()) npc_escortAI::AttackStart(who); } @@ -359,7 +359,7 @@ public: if (Creature* temp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0], RiftAndSpawnsLocations[timeRiftID][1], RiftAndSpawnsLocations[timeRiftID][2], RiftAndSpawnsLocations[timeRiftID][3], RiftAndSpawnsLocations[timeRiftID][4], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000)) { guidVector[i-timeRiftID-1] = temp->GetGUID(); - temp->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + temp->SetImmuneToAll(true); temp->SetReactState(REACT_PASSIVE); temp->GetMotionMaster()->MovePoint(0, RiftAndSpawnsLocations[i][1], RiftAndSpawnsLocations[i][2], RiftAndSpawnsLocations[i][3]); if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_EPOCH) @@ -951,7 +951,7 @@ public: { disguised2->UpdateEntry(NPC_INFINITE_HUNTER); //Make them unattackable - disguised2->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + disguised2->SetImmuneToAll(true); disguised2->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -961,7 +961,7 @@ public: { disguised1->UpdateEntry(NPC_INFINITE_AGENT); //Make them unattackable - disguised1->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + disguised1->SetImmuneToAll(true); disguised1->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -971,7 +971,7 @@ public: { disguised0->UpdateEntry(NPC_INFINITE_ADVERSARY); //Make them unattackable - disguised0->AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + disguised0->SetImmuneToAll(true); disguised0->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -985,7 +985,7 @@ public: for (uint32 i = 0; i< ENCOUNTER_DRACONIAN_NUMBER; ++i) if (Creature* temp = ObjectAccessor::GetCreature(*me, infiniteDraconianGUID[i])) { - temp->RemoveUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + temp->SetImmuneToAll(false); temp->SetReactState(REACT_AGGRESSIVE); } JumpToNextStep(5000); @@ -1043,7 +1043,7 @@ public: if (Creature* epoch = ObjectAccessor::GetCreature(*me, epochGUID)) { //Make Epoch attackable - epoch->RemoveUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE)); + epoch->SetImmuneToAll(false); epoch->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 2c99ade96d3..2b862ec0b0f 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -89,7 +89,7 @@ public: currentEvent = 0; eventProgress = 0; me->setActive(true); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } uint32 eventTimer; @@ -330,7 +330,7 @@ public: Talk(SAY_MAKE_PREPARATIONS); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); Start(false, false, player->GetGUID()); SetDespawnAtFar(false); diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 54265af5b96..80842ee3ddc 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -630,7 +630,7 @@ public: _explosivesGuids.clear(); if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS)) { - sironas->RemoveUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); + sironas->SetImmuneToAll(false); me->SetFacingToObject(sironas); } _moveTimer = 1 * IN_MILLISECONDS; diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index fe11aefc77d..6fc8ccf9238 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -197,7 +197,7 @@ public: return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); SetCombatMovement(true); if (me->IsInCombat()) diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index 2f0757ab568..853c174edb5 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -52,7 +52,7 @@ public: { npc_omenAI(Creature* creature) : ScriptedAI(creature) { - me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); } @@ -66,7 +66,7 @@ public: if (pointId == 1) { me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); if (Player* player = me->SelectNearestPlayer(40.0f)) AttackStart(player); } diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 06398e21fe5..677ccfee10a 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -365,7 +365,7 @@ public: me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFullHealth(); me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); Talk(SAY_OOX_START); Start(true, false, player->GetGUID()); |
