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/EasternKingdoms/ShadowfangKeep | |
| 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/EasternKingdoms/ShadowfangKeep')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp index e39bf1d83f3..70c5c4cb2d1 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/boss_apothecary_hummel.cpp @@ -135,7 +135,7 @@ class boss_apothecary_hummel : public CreatureScript events.SetPhase(PHASE_INTRO); events.ScheduleEvent(EVENT_HUMMEL_SAY_0, Milliseconds(1)); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetFaction(FACTION_MONSTER); DummyEntryCheckPredicate pred; summons.DoAction(ACTION_START_EVENT, pred); @@ -214,7 +214,7 @@ class boss_apothecary_hummel : public CreatureScript break; case EVENT_START_FIGHT: { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetInCombatWithZone(); events.ScheduleEvent(EVENT_CALL_BAXTER, Seconds(6)); events.ScheduleEvent(EVENT_CALL_FRYE, Seconds(14)); @@ -289,13 +289,13 @@ struct npc_apothecary_genericAI : public ScriptedAI { if (action == ACTION_START_EVENT) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetImmuneToPC(true); me->SetFaction(FACTION_MONSTER); me->GetMotionMaster()->MovePoint(1, _movePos); } else if (action == ACTION_START_FIGHT) { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetImmuneToAll(false); me->SetInCombatWithZone(); } } diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index 9ec2a58f742..68d6d3034e3 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -258,7 +258,7 @@ public: case 1: { Creature* summon = pArchmage->SummonCreature(pArchmage->GetEntry(), SpawnLocation[4], TEMPSUMMON_TIMED_DESPAWN, 10000); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + summon->SetImmuneToPC(true); summon->SetReactState(REACT_DEFENSIVE); summon->CastSpell(summon, SPELL_ASHCROMBE_TELEPORT, true); summon->AI()->Talk(SAY_ARCHMAGE); |
