diff options
-rw-r--r-- | sql/updates/world/master/2021_11_26_07_world_2019_04_04_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_11_26_07_world_2019_04_04_00_world.sql b/sql/updates/world/master/2021_11_26_07_world_2019_04_04_00_world.sql new file mode 100644 index 00000000000..6063432415b --- /dev/null +++ b/sql/updates/world/master/2021_11_26_07_world_2019_04_04_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_spawn_blood_pool'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(63471, 'spell_spawn_blood_pool'); 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); |