mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-17 05:19:40 -04:00
Core/Spells: Fix Hunters Mark and allow additional damage talents to provide benefits - patch by Dr.Tenma
Fixes issue 2674. Fixes issue 2792. --HG-- branch : trunk
This commit is contained in:
@@ -10128,12 +10128,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
DoneTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
|
||||
// done scripted mod (take it from owner)
|
||||
Unit *owner = GetOwner() ? GetOwner() : this;
|
||||
Unit * owner = GetOwner() ? GetOwner() : this;
|
||||
AuraEffectList const &mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
|
||||
{
|
||||
if (!(*i)->IsAffectedOnSpell(spellProto))
|
||||
continue;
|
||||
|
||||
switch ((*i)->GetMiscValue())
|
||||
{
|
||||
case 4920: // Molten Fury
|
||||
@@ -10242,7 +10243,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
case 7602:
|
||||
{
|
||||
if (pVictim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0))
|
||||
DoneTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
|
||||
DoneTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -10447,15 +10448,23 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
|
||||
{
|
||||
coeff = bonus->dot_damage;
|
||||
if (bonus->ap_dot_bonus > 0)
|
||||
DoneTotal += int32(bonus->ap_dot_bonus * stack * ApCoeffMod * GetTotalAttackPowerValue(
|
||||
(IsRangedWeaponSpell(spellProto) && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
|
||||
{
|
||||
WeaponAttackType attType = (IsRangedWeaponSpell(spellProto) && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
|
||||
float APbonus = attType == BASE_ATTACK ? pVictim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS) : pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
|
||||
APbonus += GetTotalAttackPowerValue(attType);
|
||||
DoneTotal += int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
coeff = bonus->direct_damage;
|
||||
if (bonus->ap_bonus > 0)
|
||||
DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * GetTotalAttackPowerValue(
|
||||
(IsRangedWeaponSpell(spellProto) && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK));
|
||||
{
|
||||
WeaponAttackType attType = (IsRangedWeaponSpell(spellProto) && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
|
||||
float APbonus = attType == BASE_ATTACK ? pVictim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS) : pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
|
||||
APbonus += GetTotalAttackPowerValue(attType);
|
||||
DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Default calculation
|
||||
@@ -11412,12 +11421,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
|
||||
DoneTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
|
||||
// done scripted mod (take it from owner)
|
||||
Unit *owner = GetOwner() ? GetOwner() : this;
|
||||
Unit * owner = GetOwner() ? GetOwner() : this;
|
||||
AuraEffectList const &mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
|
||||
{
|
||||
if (!(*i)->IsAffectedOnSpell(spellProto))
|
||||
continue;
|
||||
|
||||
switch ((*i)->GetMiscValue())
|
||||
{
|
||||
// Tundra Stalker
|
||||
@@ -11447,6 +11457,17 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
|
||||
DoneTotalMod *= (chain->rank * 2.0f + 100.0f)/100.0f;
|
||||
break;
|
||||
}
|
||||
// Marked for Death
|
||||
case 7598:
|
||||
case 7599:
|
||||
case 7600:
|
||||
case 7601:
|
||||
case 7602:
|
||||
{
|
||||
if (pVictim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0))
|
||||
DoneTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11469,6 +11490,12 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
|
||||
if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask())
|
||||
TakenTotalMod *= ((*i)->GetAmount()+100.0f)/100.0f;
|
||||
|
||||
// From caster spells
|
||||
AuraEffectList const& mOwnerTaken = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
|
||||
for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
|
||||
if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto))
|
||||
TakenTotalMod *= ((*i)->GetAmount() + 100.0f) / 100.0f;
|
||||
|
||||
// .. taken pct (special attacks)
|
||||
if (spellProto)
|
||||
{
|
||||
|
||||
@@ -3874,6 +3874,14 @@ void SpellMgr::LoadSpellCustomAttr()
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_NO_DONE_BONUS;
|
||||
count++;
|
||||
break;
|
||||
case 53241: // Marked for Death (Rank 1)
|
||||
case 53243: // Marked for Death (Rank 2)
|
||||
case 53244: // Marked for Death (Rank 3)
|
||||
case 53245: // Marked for Death (Rank 4)
|
||||
case 53246: // Marked for Death (Rank 5)
|
||||
spellInfo->EffectSpellClassMask[0] = flag96(423937, 276955137, 2049);
|
||||
count++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user