Fix Paladin Hammer of Wrath,Judgement of Command,Seal of Command PROC,Seal of Righteousness Dummy Proc receive benefit from Spell Damage and Healing.

Prevent Seal of Command damage overflow.
Fix Talent  improve Seal of Righteousness.
Config in DB spell_bonus_data.
This commit is contained in:
Zwisus 2016-03-18 11:51:16 +08:00
parent f05f21a631
commit c8b4d06b6a
3 changed files with 80 additions and 15 deletions

View File

@ -1332,11 +1332,58 @@ void Unit::CalculateSpellDamage(SpellNonMeleeDamage* damageInfo, int32 damage, S
{
// Melee and Ranged Spells
case SPELL_DAMAGE_CLASS_RANGED:
{
// Calculate damage bonus
switch (spellInfo->Id)
{
// Paladin Hammer of Wrath receive benefit from Spell Damage and Healing
case 24274: case 24275: case 24239:
{
damage = SpellDamageBonusDone(pVictim, spellInfo, damage, SPELL_DIRECT_DAMAGE);
damage = pVictim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);
break;
}
default:
{
damage = MeleeDamageBonusDone(pVictim, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
damage = pVictim->MeleeDamageBonusTaken(this, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
}
break;
}
// if crit add critical bonus
if (crit)
{
damageInfo->HitInfo |= SPELL_HIT_TYPE_CRIT;
damage = SpellCriticalDamageBonus(spellInfo, damage, pVictim);
}
}
break;
case SPELL_DAMAGE_CLASS_MELEE:
{
// Calculate damage bonus
damage = MeleeDamageBonusDone(pVictim, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
damage = pVictim->MeleeDamageBonusTaken(this, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
switch (spellInfo->Id)
{
// Paladin
// Judgement of Command receive benefit from Spell Damage and Healing
case 20467: case 20963: case 20964: case 20965: case 20966:
// Seal of Command PROC receive benefit from Spell Damage and Healing
case 20424:
// Seal of Righteousness Dummy Proc receive benefit from Spell Damage and Healing
case 25735: case 25736: case 25737: case 25738: case 25739: case 25740:
case 25713: case 25742:
{
damage = SpellDamageBonusDone(pVictim, spellInfo, damage, SPELL_DIRECT_DAMAGE);
damage = pVictim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);
break;
}
default:
{
damage = MeleeDamageBonusDone(pVictim, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
damage = pVictim->MeleeDamageBonusTaken(this, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE);
}
break;
}
// if crit add critical bonus
if (crit)

View File

@ -3177,16 +3177,6 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx)
switch (m_spellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
// Seal of Command - receive benefit from Spell Damage and Healing
if (m_spellInfo->Id == 20424)
{
spell_bonus = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, spell_bonus, SPELL_DIRECT_DAMAGE);
spell_bonus = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, spell_bonus, SPELL_DIRECT_DAMAGE);
}
break;
}
case SPELLFAMILY_ROGUE:
{
// Ambush
@ -3215,6 +3205,23 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx)
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
weaponDamagePercentMod *= float(CalculateDamage(SpellEffectIndex(j), unitTarget)) / 100.0f;
//Prevent Seal of Command damage overflow
if (m_spellInfo->Id == 20424)
{
Unit::AuraList const& mModDamagePercentDone = m_caster->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (Unit::AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
{
if (((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_HOLY) && ((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) &&
(*i)->GetSpellProto()->EquippedItemClass == -1 &&
// -1 == any item class (not wand then)
(*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0)
// 0 == any inventory type (not wand then)
{
totalDamagePercentMod /= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
}
}
}
// applied only to prev.effects fixed damage
if (customBonusDamagePercentMod)
{ fixed_bonus = int32(fixed_bonus * bonusDamagePercentMod); }

View File

@ -724,15 +724,26 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura
int damagePoint;
// Talent - Improve Seal of Righteousness
uint32 ModSpellId[] = { 20224, 20225, 20330, 20331, 20332 };
float ModPct = 1.0f;
AuraList const& mModDamagePercentModifier = GetAurasByType(SPELL_AURA_ADD_PCT_MODIFIER);
for (AuraList::const_iterator i = mModDamagePercentModifier.begin(); i != mModDamagePercentModifier.end(); ++i)
{
for (int j = 0; j < 5; j++)
{
if ((*i)->GetId() == ModSpellId[j])
ModPct *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f;
}
}
triggerAmount = triggerAmount * ModPct;
// In the description, we can find the divider of the base points for min/max effects.
int min=triggerAmount/87;
int max=triggerAmount/25;
damagePoint = (speed<=1.5?min:(speed>=4.0?max:min+(((max-min)/2.5f)*(speed-1.5))));
damagePoint = SpellDamageBonusDone(pVictim, dummySpell, damagePoint, SPELL_DIRECT_DAMAGE);
damagePoint = pVictim->SpellDamageBonusTaken(this, dummySpell, damagePoint, SPELL_DIRECT_DAMAGE);
CastCustomSpell(pVictim, spellId, &damagePoint, NULL, NULL, true, NULL, triggeredByAura);
return SPELL_AURA_PROC_OK; // no hidden cooldown
}