Scripts/Shaman: Implemented Ascendance (Restoration) (#29097)

Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
Aqua Deus
2023-06-27 23:25:19 +02:00
committed by GitHub
parent 07d6eb3a57
commit 27005299dc
2 changed files with 77 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_sha_ascendance_restoration', 'spell_sha_restorative_mists');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(114052,'spell_sha_ascendance_restoration'),
(114083,'spell_sha_restorative_mists'),
(294020,'spell_sha_restorative_mists');

View File

@@ -99,6 +99,7 @@ enum ShamanSpells
SPELL_SHAMAN_PATH_OF_FLAMES_SPREAD = 210621,
SPELL_SHAMAN_PATH_OF_FLAMES_TALENT = 201909,
SPELL_SHAMAN_POWER_SURGE = 40466,
SPELL_SHAMAN_RESTORATIVE_MISTS = 114083,
SPELL_SHAMAN_SPIRIT_WOLF_TALENT = 260878,
SPELL_SHAMAN_SPIRIT_WOLF_PERIODIC = 260882,
SPELL_SHAMAN_SPIRIT_WOLF_AURA = 260881,
@@ -124,7 +125,7 @@ enum ShamanSpellLabels
enum MiscNpcs
{
NPC_HEALING_RAIN_INVISIBLE_STALKER = 73400,
NPC_HEALING_RAIN_INVISIBLE_STALKER = 73400
};
// 273221 - Aftershock
@@ -223,6 +224,48 @@ class spell_sha_ancestral_guidance_heal : public SpellScript
}
};
// 114052 - Ascendance (Restoration)
class spell_sha_ascendance_restoration : public AuraScript
{
PrepareAuraScript(spell_sha_ascendance_restoration);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SHAMAN_RESTORATIVE_MISTS });
}
bool CheckProc(ProcEventInfo& procInfo)
{
return procInfo.GetHealInfo() && procInfo.GetHealInfo()->GetOriginalHeal();
}
void OnProcHeal(AuraEffect* /*aurEff*/, ProcEventInfo& procInfo)
{
_healToDistribute += procInfo.GetHealInfo()->GetOriginalHeal();
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (!_healToDistribute)
return;
CastSpellExtraArgs args(aurEff);
args.AddSpellBP0(_healToDistribute);
GetTarget()->CastSpell(nullptr, SPELL_SHAMAN_RESTORATIVE_MISTS, args);
_healToDistribute = 0;
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_sha_ascendance_restoration::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_sha_ascendance_restoration::OnProcHeal, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_ascendance_restoration::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
private:
uint32 _healToDistribute = 0;
};
// 188443 - Chain Lightning
class spell_sha_chain_lightning : public SpellScript
{
@@ -1414,6 +1457,32 @@ class spell_sha_path_of_flames_spread : public SpellScript
}
};
// 114083 - Restorative Mists
class spell_sha_restorative_mists : public SpellScript
{
PrepareSpellScript(spell_sha_restorative_mists);
void FilterTargets(std::list<WorldObject*>& targets)
{
_targetCount = uint32(targets.size());
}
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (_targetCount)
SetHitHeal(GetHitHeal() / _targetCount);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_restorative_mists::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
OnEffectHitTarget += SpellEffectFn(spell_sha_restorative_mists::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
}
private:
uint32 _targetCount = 0;
};
// 2645 - Ghost Wolf
// 260878 - Spirit Wolf
class spell_sha_spirit_wolf : public AuraScript
@@ -1878,6 +1947,7 @@ void AddSC_shaman_spell_scripts()
RegisterSpellScript(spell_sha_aftershock);
RegisterSpellScript(spell_sha_ancestral_guidance);
RegisterSpellScript(spell_sha_ancestral_guidance_heal);
RegisterSpellScript(spell_sha_ascendance_restoration);
RegisterSpellScript(spell_sha_chain_lightning);
RegisterSpellScript(spell_sha_chain_lightning_overload);
RegisterSpellScript(spell_sha_crash_lightning);
@@ -1914,6 +1984,7 @@ void AddSC_shaman_spell_scripts()
RegisterSpellScript(spell_sha_mastery_elemental_overload_proc);
RegisterSpellScript(spell_sha_natures_guardian);
RegisterSpellScript(spell_sha_path_of_flames_spread);
RegisterSpellScript(spell_sha_restorative_mists);
RegisterSpellScript(spell_sha_spirit_wolf);
RegisterSpellScript(spell_sha_tidal_waves);
RegisterSpellScript(spell_sha_t3_6p_bonus);