From b86a66c5be93b594fdda045e860cc1ccf16cee82 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 4 Apr 2019 00:30:25 -0300 Subject: Core/Scripts: Fix Blood summon position (#23088) * Core/Scripts: Fix Blood summon position Updates #13162 (cherry picked from commit cc3293c0023b36434747190103a1f0ffee0f8488) --- src/server/scripts/Spells/spell_generic.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e8a8756a109..5c680852ab5 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -171,6 +171,7 @@ enum AnimalBloodPoolSpell SPELL_SPAWN_BLOOD_POOL = 63471 }; +// 46221 - Animal Blood class spell_gen_animal_blood : public AuraScript { PrepareAuraScript(spell_gen_animal_blood); @@ -201,6 +202,27 @@ class spell_gen_animal_blood : public AuraScript } }; +// 63471 -Spawn Blood Pool +class spell_spawn_blood_pool : public SpellScript +{ + PrepareSpellScript(spell_spawn_blood_pool); + + void SetDest(SpellDestination& dest) + { + Unit* caster = GetCaster(); + Position summonPos = caster->GetPosition(); + LiquidData liquidStatus; + if (caster->GetMap()->GetLiquidStatus(caster->GetPhaseShift(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), map_liquidHeaderTypeFlags::AllLiquids, &liquidStatus, caster->GetCollisionHeight())) + summonPos.m_positionZ = liquidStatus.level; + dest.Relocate(summonPos); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_spawn_blood_pool::SetDest, EFFECT_0, TARGET_DEST_CASTER); + } +}; + class spell_gen_arcane_charge : public SpellScript { PrepareSpellScript(spell_gen_arcane_charge); @@ -4378,6 +4400,7 @@ void AddSC_generic_spell_scripts() RegisterAuraScript(spell_gen_adaptive_warding); RegisterSpellScript(spell_gen_allow_cast_from_item_only); RegisterAuraScript(spell_gen_animal_blood); + RegisterSpellScript(spell_spawn_blood_pool); RegisterSpellScript(spell_gen_arcane_charge); RegisterAuraScript(spell_gen_arena_drink); RegisterAuraScript(spell_gen_aura_of_anger); -- cgit v1.2.3