aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Unit
diff options
context:
space:
mode:
authorNoName <322016+Faq@users.noreply.github.com>2020-01-17 17:50:50 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-20 22:30:41 +0100
commit37178ff311af95c4a2035a38839b5e8a9afe2af5 (patch)
tree545bceb5ebc2ce36f9923a691c85ce9f22f34a31 /src/server/game/Entities/Unit
parentef794af489e6e6b593023cbbb6b032a916ed9db0 (diff)
Core/Spells: SPELL_AURA_48 implementation (#24054)
by xvwyh (cherry picked from commit b3b7f0761d5605d57f9d62ca8e22a8cd9a4df24b)
Diffstat (limited to 'src/server/game/Entities/Unit')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp8
-rw-r--r--src/server/game/Entities/Unit/Unit.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 1f0168b560c..1f16f9789b1 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -4431,6 +4431,14 @@ bool Unit::HasAuraTypeWithValue(AuraType auraType, int32 value) const
return false;
}
+bool Unit::HasAuraTypeWithTriggerSpell(AuraType auratype, uint32 triggerSpell) const
+{
+ for (AuraEffect const* aura : GetAuraEffectsByType(auratype))
+ if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
+ return true;
+ return false;
+}
+
template <typename InterruptFlags>
bool Unit::HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid) const
{
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 180398e74d8..1708a6b8a6d 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1409,6 +1409,7 @@ class TC_GAME_API Unit : public WorldObject
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const;
bool HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const* affectedSpell) const;
bool HasAuraTypeWithValue(AuraType auraType, int32 value) const;
+ bool HasAuraTypeWithTriggerSpell(AuraType auratype, uint32 triggerSpell) const;
template <typename InterruptFlags>
bool HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid = ObjectGuid::Empty) const;
bool HasAuraWithMechanic(uint32 mechanicMask) const;