From 2dfafa69ebc422feba1aa01e0c4fab76366f552f Mon Sep 17 00:00:00 2001 From: treeston Date: Sun, 9 Jul 2017 02:07:29 +0200 Subject: 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(apply, keepCombat = false); - bool IsImmuneTo() const; (cherry picked from commit 74af880217fc567c9949d7557408718af889402f) --- src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 6 +++--- src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/EasternKingdoms/ScarletEnclave') diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a8759cd9372..82b4a915627 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -130,7 +130,7 @@ public: Initialize(); events.Reset(); me->SetFaction(FACTION_CREATURE); - me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetStandState(UNIT_STAND_STATE_KNEEL); me->LoadEquipment(0, true); } @@ -236,7 +236,7 @@ public: else { me->SetFaction(FACTION_MONSTER); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); phase = PHASE_ATTACKING; if (Player* target = ObjectAccessor::GetPlayer(*me, playerGUID)) @@ -609,7 +609,7 @@ public: if (m_bIsDuelInProgress) return true; - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); me->RemoveUnitFlag(UNIT_FLAG_UNK_15); player->CastSpell(me, SPELL_DUEL, false); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 1a24429aa38..a8bbb1af174 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -270,7 +270,7 @@ public: if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) valrothGUID = summoned->GetGUID(); - summoned->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + summoned->SetImmuneToPC(false); } void SummonAcolyte(uint32 uiAmount) @@ -609,7 +609,7 @@ public: { Initialize(); - me->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); } bool MeetQuestCondition(Player* player) @@ -718,7 +718,7 @@ public: case 9: Talk(SAY_EXEC_TIME, player); me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(false); break; case 10: Talk(SAY_EXEC_WAITING, player); -- cgit v1.2.3