Merge pull request #12284 from Unholychick/patch-mana
Core/Spells: Implement SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER
This commit is contained in:
commit
0442ff5c99
3 files changed
+13
-4
No files matched your search
@@ -544,7 +544,7 @@ enum SpellAttr7
|
||||
SPELL_ATTR7_UNK13 = 0x00002000, // 13 Not set in 3.2.2a.
|
||||
SPELL_ATTR7_UNK14 = 0x00004000, // 14 Only 52150 (Raise Dead - Pet) spell.
|
||||
SPELL_ATTR7_UNK15 = 0x00008000, // 15 Exorcism. Usable on players? 100% crit chance on undead and demons?
|
||||
SPELL_ATTR7_UNK16 = 0x00010000, // 16 Druid spells (29166, 54833, 64372, 68285).
|
||||
SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER = 0x00010000, // 16 These spells can replenish a powertype, which is not the current powertype.
|
||||
SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell.
|
||||
SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects.
|
||||
SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones.
|
||||
|
||||
@@ -6295,6 +6295,9 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
|
||||
if (target->getPowerType() != powerType && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
if (!target->IsAlive() || !target->GetMaxPower(powerType))
|
||||
return;
|
||||
|
||||
|
||||
@@ -1751,6 +1751,12 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
if (unitTarget->GetMaxPower(power) == 0)
|
||||
return;
|
||||
|
||||
// Some level depends spells
|
||||
int level_multiplier = 0;
|
||||
int level_diff = 0;
|
||||
@@ -1796,9 +1802,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
|
||||
if (damage < 0)
|
||||
return;
|
||||
|
||||
if (unitTarget->GetMaxPower(power) == 0)
|
||||
return;
|
||||
|
||||
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power);
|
||||
|
||||
// Mad Alchemist's Potion
|
||||
@@ -1863,6 +1866,9 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
uint32 maxPower = unitTarget->GetMaxPower(power);
|
||||
if (maxPower == 0)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user