mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
c361b0dc0b
commit
b42082bc0c
3 changed files with 28 additions and 17 deletions
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
@ -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 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 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 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))
|
if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT))
|
||||||
crit_chance+=(*i)->GetModifier()->m_amount;
|
crit_chance+=(*i)->GetModifier()->m_amount;
|
||||||
break;
|
break;
|
||||||
case 7997: // Renewed Hope
|
case 7997: // Renewed Hope
|
||||||
case 7998:
|
case 7998:
|
||||||
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,23 +8506,40 @@ 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))
|
||||||
{
|
{
|
||||||
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:
|
||||||
// Lava Burst
|
// Lava Burst
|
||||||
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
|
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
|
||||||
|
|
@ -8539,9 +8551,8 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue