diff options
author | Houston <69751143+HoustonCore@users.noreply.github.com> | 2020-09-02 17:41:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 16:41:34 +0200 |
commit | 8d0f52247fe6dbc51a6a41d0530f4409c5f9fbb3 (patch) | |
tree | a9eca6b0b409d8e251fe5270be1201b46cd8422d | |
parent | 470f45db7af8a9976c89f9d69f1637085ebb0fcc (diff) |
Core/Totem: Immune to all positive spells. (#25326)
* Core/Totem: Immune to all positive spells.
* Fix tabs
* Avoid using magic numbers
* Remove whitespace
Co-authored-by: Moki <moki.play@mail.ru>
-rw-r--r-- | src/server/game/Entities/Totem/Totem.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Entities/Totem/Totem.h | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index b5149036b41..5c86d3371d4 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -157,9 +157,13 @@ void Totem::UnSummon(uint32 msTime) bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, WorldObject const* caster) const { - /// @todo possibly all negative auras immune? - if (GetEntry() == 5925) - return false; + // immune to all positive spells, except of stoneclaw totem absorb and sentry totem bind sight + // totems positive spells have unit_caster target + if (spellInfo->Effects[index].Effect != SPELL_EFFECT_DUMMY && + spellInfo->Effects[index].Effect != SPELL_EFFECT_SCRIPT_EFFECT && + spellInfo->IsPositive() && spellInfo->Effects[index].TargetA.GetTarget() != TARGET_UNIT_CASTER && + spellInfo->Effects[index].TargetA.GetCheckType() != TARGET_CHECK_ENTRY && spellInfo->Id != SENTRY_STONECLAW_SPELLID && spellInfo->Id != SENTRY_BIND_SIGHT_SPELLID) + return true; switch (spellInfo->Effects[index].ApplyAuraName) { diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index b37f0ba75ea..123f7cb8720 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -31,6 +31,10 @@ enum TotemType #define SENTRY_TOTEM_ENTRY 3968 +// Totems spells +#define SENTRY_STONECLAW_SPELLID 55277 +#define SENTRY_BIND_SIGHT_SPELLID 6277 + class TC_GAME_API Totem : public Minion { public: |