Core/Spells: Prevent apply spell power coefficients at bonus given by some "taken" damage mods
Closes #1991
This commit is contained in:
@@ -10855,16 +10855,16 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
|
|||||||
coeff = DotFactor;
|
coeff = DotFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
float coeff2 = CalculateLevelPenalty(spellProto) * stack;
|
float factorMod = CalculateLevelPenalty(spellProto) * stack;
|
||||||
if (spellProto->SpellFamilyName) // TODO: fix this
|
// level penalty still applied on Taken bonus - is it blizzlike?
|
||||||
TakenTotal+= int32(TakenAdvertisedBenefit * coeff * coeff2);
|
TakenTotal+= int32(TakenAdvertisedBenefit * factorMod);
|
||||||
if (Player* modOwner = GetSpellModOwner())
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
{
|
{
|
||||||
coeff *= 100.0f;
|
coeff *= 100.0f;
|
||||||
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff);
|
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff);
|
||||||
coeff /= 100.0f;
|
coeff /= 100.0f;
|
||||||
}
|
}
|
||||||
DoneTotal += int32(DoneAdvertisedBenefit * coeff * coeff2);
|
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some spells don't benefit from done mods
|
// Some spells don't benefit from done mods
|
||||||
@@ -11414,7 +11414,8 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32
|
|||||||
}
|
}
|
||||||
|
|
||||||
factorMod *= CalculateLevelPenalty(spellProto) * stack;
|
factorMod *= CalculateLevelPenalty(spellProto) * stack;
|
||||||
TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod);
|
// level penalty still applied on Taken bonus - is it blizzlike?
|
||||||
|
TakenTotal += int32(TakenAdvertisedBenefit * factorMod);
|
||||||
if (Player* modOwner = GetSpellModOwner())
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
{
|
{
|
||||||
coeff *= 100.0f;
|
coeff *= 100.0f;
|
||||||
|
|||||||
@@ -4924,6 +4924,18 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
caster->CastSpell(target, GetAmount(), true);
|
caster->CastSpell(target, GetAmount(), true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SPELLFAMILY_PRIEST:
|
||||||
|
// Vampiric Touch
|
||||||
|
if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
|
||||||
|
{
|
||||||
|
if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
|
||||||
|
{
|
||||||
|
int32 damage = aurEff->GetAmount() * 8;
|
||||||
|
// backfire damage
|
||||||
|
target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SPELLFAMILY_WARLOCK:
|
case SPELLFAMILY_WARLOCK:
|
||||||
// Haunt
|
// Haunt
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
|
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
|
||||||
@@ -4952,18 +4964,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPELLFAMILY_PRIEST:
|
|
||||||
// Vampiric Touch
|
|
||||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
|
|
||||||
{
|
|
||||||
if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
|
|
||||||
{
|
|
||||||
int32 damage = aurEff->GetAmount() * 8;
|
|
||||||
// backfire damage
|
|
||||||
target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SPELLFAMILY_HUNTER:
|
case SPELLFAMILY_HUNTER:
|
||||||
// Misdirection
|
// Misdirection
|
||||||
if (GetId() == 34477)
|
if (GetId() == 34477)
|
||||||
|
|||||||
@@ -1358,18 +1358,15 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
|||||||
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
|
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_caster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)
|
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)
|
||||||
m_caster->ToCreature()->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
|
m_caster->ToCreature()->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
|
||||||
|
|
||||||
// Needs to be called after dealing damage/healing to not remove breaking on damage auras
|
// Needs to be called after dealing damage/healing to not remove breaking on damage auras
|
||||||
DoTriggersOnSpellHit(spellHitTarget, mask);
|
DoTriggersOnSpellHit(spellHitTarget, mask);
|
||||||
|
|
||||||
// if target is fallged for pvp also flag caster if a player
|
// if target is fallged for pvp also flag caster if a player
|
||||||
if (unit->IsPvP())
|
if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
|
||||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
|
||||||
m_caster->ToPlayer()->UpdatePvP(true);
|
m_caster->ToPlayer()->UpdatePvP(true);
|
||||||
}
|
|
||||||
|
|
||||||
CallScriptAfterHitHandlers();
|
CallScriptAfterHitHandlers();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user