Scripts/Spells: Nourish (#24057)

* Scripts/Spells: Nourish

* Rename 9999_99_99_99_world.sql to 2020_02_08_02_world.sql

* Update 2020_02_08_02_world.sql

Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
Sorikoff
2020-02-08 21:55:09 +02:00
committed by GitHub
parent 98d6c501d7
commit 53657441aa
3 changed files with 39 additions and 20 deletions

View File

@@ -0,0 +1,3 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_dru_nourish";
INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES (50464,"spell_dru_nourish");

View File

@@ -1281,25 +1281,6 @@ void Spell::EffectHeal(SpellEffIndex effIndex)
if (!unitCaster->HasAura(54824))
unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID());
}
// Nourish
else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000)
{
addhealth = unitCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL, effIndex, { });
// Glyph of Nourish
if (AuraEffect const* aurEff = unitCaster->GetAuraEffect(62971, 0))
{
uint32 auraCount = 0;
Unit::AuraEffectList const& periodicHeals = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL);
for (AuraEffect const* hot : periodicHeals)
{
if (unitCaster->GetGUID() == hot->GetCasterGUID())
++auraCount;
}
AddPct(addhealth, aurEff->GetAmount() * auraCount);
}
}
// Death Pact - return pct of max health to caster
else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000)
addhealth = unitCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(unitCaster->CountPctFromMaxHealth(damage)), HEAL, effIndex, { });

View File

@@ -90,7 +90,8 @@ enum DruidSpells
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
SPELL_DRUID_BARKSKIN_01 = 63058,
SPELL_DRUID_RESTORATION_T10_2P_BONUS = 70658,
SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845
SPELL_DRUID_FRENZIED_REGENERATION_HEAL = 22845,
SPELL_DRUID_GLYPH_OF_NOURISH = 62971
};
enum MiscSpells
@@ -967,6 +968,39 @@ private:
}
};
// 50464 - Nourish
class spell_dru_nourish : public SpellScript
{
PrepareSpellScript(spell_dru_nourish);
void HandleHeal(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
// Glyph of Nourish
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DRUID_GLYPH_OF_NOURISH, EFFECT_0))
{
uint32 auraCount = 0;
int32 heal = GetHitHeal();
Unit::AuraEffectList const& periodicHeals = GetHitUnit()->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL);
for (AuraEffect const* hot : periodicHeals)
{
if (caster->GetGUID() == hot->GetCasterGUID())
++auraCount;
}
AddPct(heal, aurEff->GetAmount() * auraCount);
SetHitHeal(heal);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dru_nourish::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
}
};
// 16864 - Omen of Clarity
class spell_dru_omen_of_clarity : public AuraScript
{
@@ -1884,6 +1918,7 @@ void AddSC_druid_spell_scripts()
RegisterAuraScript(spell_dru_living_seed);
RegisterAuraScript(spell_dru_living_seed_proc);
RegisterAuraScript(spell_dru_moonkin_form_passive);
RegisterSpellScript(spell_dru_nourish);
RegisterAuraScript(spell_dru_omen_of_clarity);
RegisterAuraScript(spell_dru_owlkin_frenzy);
RegisterAuraScript(spell_dru_predatory_strikes);