mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
feat(Core/Unit): New helper HasActivePowerType and script hook OnPlayerHasActivePowerType (#18293)
* Create HasActivePower for script intercept * Replace relevant player-related getPowerType() comparators with HasActivePowerType * Change OnPlayerHasActivePowerType to regular bool instead of optional --------- Co-authored-by: NathanHandley <nathanhandley@protonmail.com>
This commit is contained in:
@@ -992,7 +992,7 @@ class spell_sha_mana_spring_totem : public SpellScript
|
||||
int32 damage = GetEffectValue();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* caster = GetCaster())
|
||||
if (target->getPowerType() == POWER_MANA)
|
||||
if (target->HasActivePowerType(POWER_MANA))
|
||||
caster->CastCustomSpell(target, SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
|
||||
}
|
||||
|
||||
@@ -1017,7 +1017,7 @@ class spell_sha_mana_tide_totem : public SpellScript
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
if (unitTarget->getPowerType() == POWER_MANA)
|
||||
if (unitTarget->HasActivePowerType(POWER_MANA))
|
||||
{
|
||||
int32 effValue = GetEffectValue();
|
||||
// Glyph of Mana Tide
|
||||
|
||||
Reference in New Issue
Block a user