From 3171cd3fa9dbcec43f5d70b74ab2f54a2aa44173 Mon Sep 17 00:00:00 2001 From: ForesterDev <11771800+ForesterDev@users.noreply.github.com> Date: Sun, 7 Jun 2020 11:22:13 +0300 Subject: Core/AI: refactor SpellHit and SpellHitTarget. (#24691) * Core/AI: refactor SpellHit and SpellHitTarget. - now caster/target is WorldObject instead of Unit - remove SpellHitByGameObject / SpellHitTargetGameObject (handled by SpellHit / SpellHitTarget) - rename parameters in scripts according parent methods * Restore logic in Algalon script * Changed check for REMORSELESS_WINTER hit to avoid dublicate call, because it has TARGET_UNIT_CASTER for effects 0/1 and TARGET_GAMEOBJECT_SRC_AREA for effect 2 * Fix build after merge (cherry picked from commit e3b232fe0e5c21a87d3fe71813e9d750259823f1) --- .../HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp | 4 ++-- .../Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/scripts/Outland/HellfireCitadel') diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 22d0d29af0f..f9829a0f5e9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -111,9 +111,9 @@ class boss_nazan : public CreatureScript } } - void SpellHitTarget(Unit* target, SpellInfo const* entry) override + void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override { - if (target && entry->Id == uint32(SPELL_FIREBALL)) + if (spellInfo->Id == uint32(SPELL_FIREBALL)) me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000); } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index ebe371fff15..2bec89430ca 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -184,9 +184,9 @@ class boss_magtheridon : public CreatureScript } } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (spell->Id == SPELL_SHADOW_CAGE) + if (spellInfo->Id == SPELL_SHADOW_CAGE) Talk(SAY_BANISHED); } -- cgit v1.2.3