diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2899bf394..9a3d39adf 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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) { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5ee5794fb..704535322 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fd774213e..fd681231b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8509" + #define REVISION_NR "8510" #endif // __REVISION_NR_H__