[8510] Fixes for healing crit calculation code

* Implement talent 63504 and ranks
* Allow work target dependent healing crit chance mods
  This let work existed code for talent 57470 and ranks

(cherry picked from commit eadc239846d6dc5db582908458421411995d7974)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also
* Drop oudated functionality code for 47558 and ranks (new functionality code already added)
This commit is contained in:
pasdVn 2009-06-20 18:15:22 +02:00 committed by VladimirMangos
parent c361b0dc0b
commit b42082bc0c
3 changed files with 28 additions and 17 deletions

View file

@ -960,7 +960,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// Do healing and triggers // Do healing and triggers
if (m_healing) if (m_healing)
{ {
bool crit = caster->isSpellCrit(NULL, m_spellInfo, m_spellSchoolMask); bool crit = caster->isSpellCrit(unitTarget, m_spellInfo, m_spellSchoolMask);
uint32 addhealth = m_healing; uint32 addhealth = m_healing;
if (crit) if (crit)
{ {

View file

@ -8478,7 +8478,8 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
crit_chance -= ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL); crit_chance -= ((Player*)pVictim)->GetRatingBonusValue(CR_CRIT_TAKEN_SPELL);
} }
// scripted (increase crit chance ... against ... target by x% // scripted (increase crit chance ... against ... target by x%)
// scripted (Increases the critical effect chance of your .... by x% on targets ...)
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{ {
@ -8498,12 +8499,6 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
if (pVictim->HasAura(6788)) if (pVictim->HasAura(6788))
crit_chance+=(*i)->GetModifier()->m_amount; crit_chance+=(*i)->GetModifier()->m_amount;
break; break;
case 21: // Test of Faith
case 6935:
case 6918:
if (pVictim->GetHealth() < pVictim->GetMaxHealth()/2)
crit_chance+=(*i)->GetModifier()->m_amount;
break;
default: default:
break; break;
} }
@ -8511,6 +8506,25 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Custom crit by class // Custom crit by class
switch(spellProto->SpellFamilyName) switch(spellProto->SpellFamilyName)
{ {
case SPELLFAMILY_PRIEST:
// Flash Heal
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800))
{
if (pVictim->GetHealth() > pVictim->GetMaxHealth()/2)
break;
AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin(); i!= mDummyAuras.end(); ++i)
{
// Improved Flash Heal
if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST &&
(*i)->GetSpellProto()->SpellIconID == 2542)
{
crit_chance+=(*i)->GetModifier()->m_amount;
break;
}
}
}
break;
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
// Sacred Shield // Sacred Shield
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000)) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000))
@ -8518,14 +8532,12 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
Aura *aura = pVictim->GetDummyAura(58597); Aura *aura = pVictim->GetDummyAura(58597);
if (aura && aura->GetCasterGUID() == GetGUID()) if (aura && aura->GetCasterGUID() == GetGUID())
crit_chance+=aura->GetModifier()->m_amount; crit_chance+=aura->GetModifier()->m_amount;
break;
} }
// Exorcism // Exorcism
else if (spellProto->Category == 19) else if (spellProto->Category == 19)
{ {
if (pVictim->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD) if (pVictim->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD)
return true; return true;
break;
} }
break; break;
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
@ -8539,7 +8551,6 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
pVictim->RemoveAurasByCasterSpell(flameShock->GetId(), GetGUID()); pVictim->RemoveAurasByCasterSpell(flameShock->GetId(), GetGUID());
return true; return true;
} }
break;
} }
break; break;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8509" #define REVISION_NR "8510"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__