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
|
|
@ -957,7 +957,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||
if (crit)
|
||||
{
|
||||
procEx |= PROC_EX_CRITICAL_HIT;
|
||||
addhealth = caster->SpellCriticalBonus(m_spellInfo, addhealth, NULL);
|
||||
addhealth = caster->SpellCriticalHealingBonus(m_spellInfo, addhealth, NULL);
|
||||
}
|
||||
else
|
||||
procEx |= PROC_EX_NORMAL_HIT;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ enum AuraType
|
|||
SPELL_AURA_MOD_PARRY_PERCENT = 47,
|
||||
SPELL_AURA_MOD_DODGE_SKILL = 48,
|
||||
SPELL_AURA_MOD_DODGE_PERCENT = 49,
|
||||
SPELL_AURA_MOD_BLOCK_SKILL = 50,
|
||||
SPELL_AURA_MOD_CRITICAL_HEALING_BONUS = 50,
|
||||
SPELL_AURA_MOD_BLOCK_PERCENT = 51,
|
||||
SPELL_AURA_MOD_CRIT_PERCENT = 52,
|
||||
SPELL_AURA_PERIODIC_LEECH = 53,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
|
|||
&Aura::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
|
||||
&Aura::HandleUnused, // 48 SPELL_AURA_MOD_DODGE_SKILL obsolete?
|
||||
&Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
|
||||
&Aura::HandleUnused, // 50 SPELL_AURA_MOD_BLOCK_SKILL obsolete?
|
||||
&Aura::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_BONUS
|
||||
&Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
|
||||
&Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT
|
||||
&Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1297,7 +1297,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
uint32 SpellHealingBonus(SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, Unit *pVictim);
|
||||
bool isSpellBlocked(Unit *pVictim, SpellEntry const *spellProto, WeaponAttackType attackType = BASE_ATTACK);
|
||||
bool isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK);
|
||||
uint32 SpellCriticalBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
||||
uint32 SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
||||
uint32 SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 damage, Unit *pVictim);
|
||||
|
||||
void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; }
|
||||
bool IsUnderLastManaUseEffect() const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue