mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
Implement 50 PELL_AURA_MOD_CRITICAL_HEALING_BONUS aura
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
c519f9a1b3
commit
249d039d93
5 changed files with 37 additions and 6 deletions
|
|
@ -1078,7 +1078,7 @@ void Unit::CalculateSpellDamage(SpellNonMeleeDamage *damageInfo, int32 damage, S
|
|||
if (crit)
|
||||
{
|
||||
damageInfo->HitInfo|= SPELL_HIT_TYPE_CRIT;
|
||||
damage = SpellCriticalBonus(spellInfo, damage, pVictim);
|
||||
damage = SpellCriticalDamageBonus(spellInfo, damage, pVictim);
|
||||
// Resilience - reduce crit damage
|
||||
if (pVictim->GetTypeId()==TYPEID_PLAYER)
|
||||
damage -= ((Player*)pVictim)->GetSpellCritDamageReduction(damage);
|
||||
|
|
@ -8033,7 +8033,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
|
|||
return false;
|
||||
}
|
||||
|
||||
uint32 Unit::SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
|
||||
uint32 Unit::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
|
||||
{
|
||||
// Calculate critical bonus
|
||||
int32 crit_bonus;
|
||||
|
|
@ -8065,6 +8065,36 @@ uint32 Unit::SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Uni
|
|||
return damage;
|
||||
}
|
||||
|
||||
uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim)
|
||||
{
|
||||
// Calculate critical bonus
|
||||
int32 crit_bonus;
|
||||
switch(spellProto->DmgClass)
|
||||
{
|
||||
case SPELL_DAMAGE_CLASS_MELEE: // for melee based spells is 100%
|
||||
case SPELL_DAMAGE_CLASS_RANGED:
|
||||
// TODO: write here full calculation for melee/ranged spells
|
||||
crit_bonus = damage;
|
||||
break;
|
||||
default:
|
||||
crit_bonus = damage / 2; // for spells is 50%
|
||||
break;
|
||||
}
|
||||
|
||||
crit_bonus = int32(crit_bonus * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_BONUS));
|
||||
|
||||
if(pVictim)
|
||||
{
|
||||
uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
|
||||
crit_bonus = int32(crit_bonus * GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, creatureTypeMask));
|
||||
}
|
||||
|
||||
if(crit_bonus > 0)
|
||||
damage += crit_bonus;
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
uint32 Unit::SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, Unit *pVictim)
|
||||
{
|
||||
// For totems get healing bonus from owner (statue isn't totem in fact)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue