diff options
| author | treeston <treeston.mmoc@gmail.com> | 2017-07-09 02:07:29 +0200 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2017-07-09 02:07:29 +0200 |
| commit | 74af880217fc567c9949d7557408718af889402f (patch) | |
| tree | 7a39bedb3fbd1a618413ef60ca390c94f4298fea /src/server/scripts/Kalimdor | |
| parent | c6d799444572a6d3023a560d7d1c24b0d7a8d050 (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/Kalimdor')
7 files changed, 15 insertions, 15 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 3b92e2926c6..26c718c3930 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->HasFlag(UNIT_FIELD_FLAGS, 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->SetFlag(UNIT_FIELD_FLAGS, 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->SetFlag(UNIT_FIELD_FLAGS, 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->SetFlag(UNIT_FIELD_FLAGS, 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->SetFlag(UNIT_FIELD_FLAGS, 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->RemoveFlag(UNIT_FIELD_FLAGS, 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->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + epoch->SetImmuneToAll(false); epoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 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 05385a0c6bf..0286de05581 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -90,7 +90,7 @@ public: currentEvent = 0; eventProgress = 0; me->setActive(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } uint32 eventTimer; @@ -331,7 +331,7 @@ public: Talk(SAY_MAKE_PREPARATIONS); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, 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 fe965718852..86eae7f4b40 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -640,7 +640,7 @@ public: _explosivesGuids.clear(); if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS)) { - sironas->RemoveFlag(UNIT_FIELD_FLAGS, 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 898eaa8521e..5f800e80e6d 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -200,7 +200,7 @@ public: return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, 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 3dbab7098fe..e19d8797bc9 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -411,7 +411,7 @@ public: { npc_omenAI(Creature* creature) : ScriptedAI(creature) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); } @@ -425,7 +425,7 @@ public: if (pointId == 1) { me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, 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_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 470f848bcb9..fa9164fced8 100644 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -87,7 +87,7 @@ public: Talk(SAY_START); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); } } }; diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index fcd531a10ce..b1e44a4ac55 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -370,7 +370,7 @@ public: me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); me->SetFullHealth(); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); Talk(SAY_OOX_START); Start(true, false, player->GetGUID()); |
