diff options
author | Gustavo <sirikfoll@hotmail.com> | 2019-04-04 00:30:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-04 00:30:25 -0300 |
commit | cc3293c0023b36434747190103a1f0ffee0f8488 (patch) | |
tree | 22ad36216438ce675a29596f7aa61d9f90a70e11 /src | |
parent | 50f122de778bca324d0f4c81f1e8eb30b90a7314 (diff) |
Core/Scripts: Fix Blood summon position (#23088)
* Core/Scripts: Fix Blood summon position
Updates #13162
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 48ab431147a..861bf997a99 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->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), MAP_ALL_LIQUIDS, &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); @@ -4195,6 +4217,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); |