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/EasternKingdoms/Stratholme | |
| 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/EasternKingdoms/Stratholme')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 5702f0b68be..92da0c408a3 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -156,9 +156,9 @@ struct npc_summoned_skeleton : public ScriptedAI { npc_summoned_skeleton(Creature* creature) : ScriptedAI(creature) { } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (spell->Id == SPELL_DEATH_PACT_2) + if (spellInfo->Id == SPELL_DEATH_PACT_2) DoCastSelf(SPELL_DEATH_PACT_3, true); } }; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index cc4275cf622..2634441d8b4 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -146,9 +146,9 @@ public: void JustEngagedWith(Unit* /*who*/) override { } - void SpellHit(Unit* caster, SpellInfo const* spell) override + void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override { - if (Tagged || spell->Id != SPELL_EGAN_BLASTER) + if (Tagged || spellInfo->Id != SPELL_EGAN_BLASTER) return; Player* player = caster->ToPlayer(); @@ -242,9 +242,9 @@ public: void JustEngagedWith(Unit* /*who*/) override { } - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override { - if (!Tagged && spell->Id == SPELL_EGAN_BLASTER) + if (!Tagged && spellInfo->Id == SPELL_EGAN_BLASTER) Tagged = true; } |
