[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
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;
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);
}
// 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);
for(AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
@ -8489,21 +8490,15 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
case 849: if (pVictim->isFrozen()) crit_chance+= 17.0f; break; //Shatter Rank 1
case 910: if (pVictim->isFrozen()) crit_chance+= 34.0f; break; //Shatter Rank 2
case 911: if (pVictim->isFrozen()) crit_chance+= 50.0f; break; //Shatter Rank 3
case 7917: // Glyph of Shadowburn
case 7917: // Glyph of Shadowburn
if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
crit_chance+=(*i)->GetModifier()->m_amount;
break;
case 7997: // Renewed Hope
case 7997: // Renewed Hope
case 7998:
if (pVictim->HasAura(6788))
crit_chance+=(*i)->GetModifier()->m_amount;
break;
case 21: // Test of Faith
case 6935:
case 6918:
if (pVictim->GetHealth() < pVictim->GetMaxHealth()/2)
crit_chance+=(*i)->GetModifier()->m_amount;
break;
default:
break;
}
@ -8511,23 +8506,40 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Custom crit by class
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:
// Sacred Shield
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000))
{
Aura *aura = pVictim->GetDummyAura(58597);
if (aura && aura->GetCasterGUID() == GetGUID())
crit_chance+=aura->GetModifier()->m_amount;
break;
crit_chance+=aura->GetModifier()->m_amount;
}
// Exorcism
else if (spellProto->Category == 19)
{
if (pVictim->GetCreatureTypeMask() & CREATURE_TYPEMASK_DEMON_OR_UNDEAD)
return true;
break;
}
break;
break;
case SPELLFAMILY_SHAMAN:
// Lava Burst
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
@ -8539,9 +8551,8 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
pVictim->RemoveAurasByCasterSpell(flameShock->GetId(), GetGUID());
return true;
}
break;
}
break;
break;
}
}
break;

View file

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