Core/Spells: Define and implement SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS; revert SPELL_ATTR4_FIXED_DAMAGE

Closes #1307
Closes #2270
This commit is contained in:
tobmaps
2011-07-22 23:30:23 +07:00
parent f50892fa77
commit a3feb40eb6
3 changed files with 11 additions and 16 deletions

View File

@@ -1032,12 +1032,6 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
if (damage < 0)
return;
if (spellInfo->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE)
{
damageInfo->damage = damage;
return;
}
Unit* victim = damageInfo->target;
if (!victim || !victim->isAlive())
return;
@@ -10692,9 +10686,9 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellEntry const* spellProto, uint32
AddPctN(DoneTotalMod, aurEff->GetAmount());
// Sigil of the Vengeful Heart
if (spellProto->SpellFamilyFlags[0] & 0x2000)
if (AuraEffect* aurEff = GetAuraEffect(64962, EFFECT_1))
AddPctN(DoneTotal, aurEff->GetAmount());
if (spellProto->SpellFamilyFlags[0] & 0x2000)
if (AuraEffect* aurEff = GetAuraEffect(64962, EFFECT_1))
AddPctN(DoneTotal, aurEff->GetAmount());
// Glacier Rot
if (spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x6)
@@ -10904,6 +10898,12 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellEntry const* spellProto, uint32
DoneTotalMod = 1.0f;
}
// Some spells don't benefit from from pct done mods
// maybe should be implemented like SPELL_ATTR3_NO_DONE_BONUS,
// but then it may break spell power coeffs work on spell 31117
if (spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS)
DoneTotalMod = 1.0f;
float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod;
// apply spellmod to Done damage (flat and pct)
if (Player* modOwner = GetSpellModOwner())

View File

@@ -415,7 +415,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK5 = 0x00000020, // 5
SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen
SPELL_ATTR4_TRIGGERED = 0x00000080, // 7 spells forced to be triggered
SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 decimate, share damage?
SPELL_ATTR4_UNK8 = 0x00000100, // 8 ignores taken percent damage mods?
SPELL_ATTR4_UNK9 = 0x00000200, // 9
SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag
SPELL_ATTR4_UNK11 = 0x00000800, // 11
@@ -508,7 +508,7 @@ enum SpellAttr6
SPELL_ATTR6_UNK26 = 0x04000000, // 26
SPELL_ATTR6_UNK27 = 0x08000000, // 27
SPELL_ATTR6_UNK28 = 0x10000000, // 28
SPELL_ATTR6_UNK29 = 0x20000000, // 29
SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS = 0x20000000, // 29 ignores done percent damage mods?
SPELL_ATTR6_UNK30 = 0x40000000, // 30
SPELL_ATTR6_UNK31 = 0x80000000 // 31
};

View File

@@ -3942,11 +3942,6 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED;
++count;
break;
case 31117: // Unstable Affliction
// this attribute currently makes spell to ignore resilience and absorbs
spellInfo->AttributesEx4 &= ~SPELL_ATTR4_FIXED_DAMAGE;
++count;
break;
case 16007: // Draco-Incarcinatrix 900
// was 46, but effect is aura effect
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_NEARBY_ENTRY;