diff options
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 4 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 9d79f6d2398..5dbad258d65 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -2914,20 +2914,14 @@ public: if (ghoulGuid.IsEmpty()) return; - oldAI = player->AI(); - oldAIState = player->IsAIEnabled; player->SetAI(new player_ghoulAI(player, ghoulGuid)); - player->IsAIEnabled = true; } void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Player* player = GetTarget()->ToPlayer(); - player->IsAIEnabled = oldAIState; - PlayerAI* thisAI = player->AI(); - player->SetAI(oldAI); - delete thisAI; + player->SetAI(nullptr); // Dismiss ghoul if necessary if (Creature* ghoul = ObjectAccessor::GetCreature(*player, ghoulGuid)) @@ -2946,8 +2940,6 @@ public: } ObjectGuid ghoulGuid; - PlayerAI* oldAI = nullptr; - bool oldAIState = false; }; AuraScript* GetAuraScript() const override diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2ff9d51dc8b..543a566df62 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1647,7 +1647,7 @@ class spell_ethereal_pet_aura : public AuraScript GetUnitOwner()->GetAllMinionsByEntry(minionList, NPC_ETHEREAL_SOUL_TRADER); for (Creature* minion : minionList) { - if (minion->IsAIEnabled) + if (minion->IsAIEnabled()) { minion->AI()->Talk(SAY_STEAL_ESSENCE); minion->CastSpell(eventInfo.GetProcTarget(), SPELL_STEAL_ESSENCE_VISUAL); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 63d084e589b..09c5238bc51 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -54,8 +54,8 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript if (!creatureTarget->IsPet() && creatureTarget->GetEntry() == _originalEntry) { creatureTarget->UpdateEntry(_newEntry); - if (_shouldAttack && creatureTarget->IsAIEnabled) - creatureTarget->AI()->AttackStart(GetCaster()); + if (_shouldAttack) + creatureTarget->EngageWithTarget(GetCaster()); if (_despawnTime) creatureTarget->DespawnOrUnsummon(_despawnTime); |
