From e556560bc18da5da686823ffe61d7c57ad42dc10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Wed, 21 Jul 2021 19:05:05 +0200 Subject: [PATCH] refactor(Scripts/Pet): code cleanup (part 8) (#6928) --- src/server/scripts/Pet/pet_dk.cpp | 12 +++++++----- src/server/scripts/Pet/pet_generic.cpp | 1 - src/server/scripts/Pet/pet_hunter.cpp | 5 ----- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp index b88f03018..f401bfdcd 100644 --- a/src/server/scripts/Pet/pet_dk.cpp +++ b/src/server/scripts/Pet/pet_dk.cpp @@ -13,7 +13,6 @@ #include "CellImpl.h" #include "CombatAI.h" #include "GridNotifiers.h" -#include "GridNotifiersImpl.h" #include "PassiveAI.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" @@ -62,10 +61,13 @@ public: // Xinef: Night of the Dead avoidance if (Aura* aur = me->GetAura(SPELL_DK_NIGHT_OF_THE_DEAD)) - if (Unit* owner = me->GetOwner()) - if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2718, 0)) - if (aur->GetEffect(0)) - aur->GetEffect(0)->SetAmount(-aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue()); + if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, 2718, 0)) + { + if (aur->GetEffect(0)) + { + aur->GetEffect(0)->SetAmount(-aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue()); + } + } me->SetCanFly(true); me->SetDisableGravity(true); diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index 55fba334f..9688fea70 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -12,7 +12,6 @@ #include "CreatureTextMgr.h" #include "Group.h" #include "PassiveAI.h" -#include "PetAI.h" #include "Player.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 969b2983b..0f5bf8858 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -21,11 +21,6 @@ enum HunterSpells SPELL_HUNTER_PET_SCALING = 62915 }; -enum HunterCreatures -{ - NPC_HUNTER_VIPER = 19921 -}; - class npc_pet_hunter_snake_trap : public CreatureScript { public: