diff --git a/data/sql/updates/pending_db_world/rev_1763078692528550600.sql b/data/sql/updates/pending_db_world/rev_1763078692528550600.sql new file mode 100644 index 000000000..27eae8cb8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1763078692528550600.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 50380; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(50380, 'spell_bloodspore_haze'); + +DELETE FROM `spell_custom_attr` WHERE `spell_id` = 50380; +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES +(50380, 0x00400000); diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 3ee7f2272..98a66ecef 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -2175,6 +2175,40 @@ class spell_soul_deflection : public AuraScript } }; +enum SpellBloodHaze +{ + SPELL_BLOODSPORE_HAZE = 50380, + SPELL_PSYCHOSIS = 50396 +}; + +// 50380 - Bloodspore Haze +class spell_bloodspore_haze : public SpellScript +{ + PrepareSpellScript(spell_bloodspore_haze); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PSYCHOSIS }); + } + + void HandleEffectHit(SpellEffIndex /*effIndex*/) + { + if (!GetHitUnit()) + return; + + if (GetHitUnit()->GetAuraCount(SPELL_BLOODSPORE_HAZE) >= 5) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_PSYCHOSIS, true); + GetHitUnit()->RemoveAura(SPELL_BLOODSPORE_HAZE); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_bloodspore_haze::HandleEffectHit, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_borean_tundra() { RegisterSpellScript(spell_q11919_q11940_drake_hunt_aura); @@ -2201,4 +2235,5 @@ void AddSC_borean_tundra() RegisterCreatureAI(npc_jenny); RegisterSpellScript(spell_necropolis_beam); RegisterSpellScript(spell_soul_deflection); + RegisterSpellScript(spell_bloodspore_haze); }