mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Merge pull request #7065 from Vincent-Michael/PainAndSuffering
Core/Spells: Fix Pain and Suffering reduces damage
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=-32379;
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(-32379,'spell_pri_shadow_word_death');
|
||||
@@ -861,21 +861,6 @@ void AuraEffect::CalculateSpellMod()
|
||||
case SPELL_AURA_DUMMY:
|
||||
switch (GetSpellInfo()->SpellFamilyName)
|
||||
{
|
||||
case SPELLFAMILY_PRIEST:
|
||||
// Pain and Suffering
|
||||
if (m_spellInfo->SpellIconID == 2874)
|
||||
{
|
||||
if (!m_spellmod)
|
||||
{
|
||||
m_spellmod = new SpellModifier(GetBase());
|
||||
m_spellmod->op = SPELLMOD_DOT;
|
||||
m_spellmod->type = SPELLMOD_PCT;
|
||||
m_spellmod->spellId = GetId();
|
||||
m_spellmod->mask[1] = 0x00002000;
|
||||
}
|
||||
m_spellmod->value = GetAmount();
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DRUID:
|
||||
switch (GetId())
|
||||
{
|
||||
|
||||
@@ -463,20 +463,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
}
|
||||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// Shadow Word: Death - deals damage equal to damage done to caster
|
||||
if (m_spellInfo->SpellFamilyFlags[1] & 0x2)
|
||||
{
|
||||
int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE);
|
||||
back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE);
|
||||
// Pain and Suffering reduces damage
|
||||
if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0))
|
||||
AddPctN(back_damage, -aurEff->GetAmount());
|
||||
|
||||
if (back_damage < int32(unitTarget->GetHealth()))
|
||||
m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true);
|
||||
}
|
||||
// Improved Mind Blast (Mind Blast in shadow form bonus)
|
||||
else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
|
||||
if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
|
||||
{
|
||||
Unit::AuraEffectList const& ImprMindBlast = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_FLAT_MODIFIER);
|
||||
for (Unit::AuraEffectList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i)
|
||||
|
||||
@@ -37,6 +37,8 @@ enum PriestSpells
|
||||
PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085,
|
||||
PRIEST_SPELL_EMPOWERED_RENEW = 63544,
|
||||
PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021,
|
||||
PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874,
|
||||
PRIEST_SHADOW_WORD_DEATH = 32409,
|
||||
};
|
||||
|
||||
// Guardian Spirit
|
||||
@@ -311,7 +313,7 @@ public:
|
||||
{
|
||||
if (Unit* caster = GetOriginalCaster())
|
||||
{
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE,EFFECT_0))
|
||||
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE, EFFECT_0))
|
||||
{
|
||||
int32 heal = GetHitHeal();
|
||||
AddPctN(heal, aurEff->GetAmount());
|
||||
@@ -415,6 +417,38 @@ class spell_priest_renew : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pri_shadow_word_death : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pri_shadow_word_death() : SpellScriptLoader("spell_pri_shadow_word_death") { }
|
||||
|
||||
class spell_pri_shadow_word_death_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pri_shadow_word_death_SpellScript);
|
||||
|
||||
void HandleDamage()
|
||||
{
|
||||
int32 damage = GetHitDamage();
|
||||
|
||||
// Pain and Suffering reduces damage
|
||||
if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1))
|
||||
AddPctN(damage, aurEff->GetAmount());
|
||||
|
||||
GetCaster()->CastCustomSpell(GetCaster(), PRIEST_SHADOW_WORD_DEATH, &damage, 0, 0, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_pri_shadow_word_death_SpellScript::HandleDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pri_shadow_word_death_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_priest_spell_scripts()
|
||||
{
|
||||
new spell_pri_guardian_spirit();
|
||||
@@ -426,4 +460,5 @@ void AddSC_priest_spell_scripts()
|
||||
new spell_pri_prayer_of_mending_heal();
|
||||
new spell_pri_vampiric_touch();
|
||||
new spell_priest_renew();
|
||||
new spell_pri_shadow_word_death();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user