diff options
| author | ForesterDev <11771800+ForesterDev@users.noreply.github.com> | 2020-06-07 11:22:13 +0300 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-06 20:46:25 +0100 |
| commit | 3171cd3fa9dbcec43f5d70b74ab2f54a2aa44173 (patch) | |
| tree | 838c54078c04b1fdae4ec1aac6fdc70ebdae45b2 /src/server/scripts/Outland/BlackTemple | |
| parent | f0242d4ec7857a18145dd0a9965fcb8526e981c8 (diff) | |
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)
Diffstat (limited to 'src/server/scripts/Outland/BlackTemple')
| -rw-r--r-- | src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 8e11c9eb1a0..5c35dbf8de2 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -236,9 +236,9 @@ struct boss_shade_of_akama : public BossAI _DespawnAtEvade(); } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (spell->Id == SPELL_AKAMA_SOUL_CHANNEL) + if (spellInfo->Id == SPELL_AKAMA_SOUL_CHANNEL) { events.ScheduleEvent(EVENT_START_CHANNELERS_AND_SPAWNERS, 1s); me->SetEmoteState(EMOTE_STATE_NONE); @@ -247,7 +247,7 @@ struct boss_shade_of_akama : public BossAI AttackStart(akama); } - if (spell->Id == SPELL_AKAMA_SOUL_RETRIEVE) + if (spellInfo->Id == SPELL_AKAMA_SOUL_RETRIEVE) DoCastSelf(SPELL_AKAMA_SOUL_EXPEL_CHANNEL); } @@ -381,9 +381,9 @@ struct npc_akama_shade : public ScriptedAI void EnterEvadeMode(EvadeReason /*why*/) override { } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (spell->Id == SPELL_THREAT && !_isInCombat) + if (spellInfo->Id == SPELL_THREAT && !_isInCombat) { _isInCombat = true; me->SetWalk(false); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index ffa022b73d8..4bf3c1bd840 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -92,9 +92,9 @@ struct boss_najentus : public BossAI Talk(SAY_DEATH); } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD)) + if (spellInfo->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD)) { me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); DoCastSelf(SPELL_TIDAL_BURST, true); |
