diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 1e1404498..e4803ed71 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -517,7 +517,7 @@ namespace Scripts.Spells.Generic } } - [Script] + [Script] // 46221 - Animal Blood class spell_gen_animal_blood : AuraScript { public override bool Validate(SpellInfo spellInfo) @@ -548,6 +548,25 @@ namespace Scripts.Spells.Generic } } + [Script] // 63471 -Spawn Blood Pool + class spell_spawn_blood_pool : SpellScript + { + void SetDest(ref SpellDestination dest) + { + Unit caster = GetCaster(); + Position summonPos = caster.GetPosition(); + LiquidData liquidStatus; + if (caster.GetMap().GetLiquidStatus(caster.GetPhaseShift(), caster.GetPositionX(), caster.GetPositionY(), caster.GetPositionZ(), LiquidHeaderTypeFlags.AllLiquids, out liquidStatus, caster.GetCollisionHeight()) != ZLiquidStatus.NoWater) + summonPos.posZ = liquidStatus.level; + dest.Relocate(summonPos); + } + + public override void Register() + { + OnDestinationTargetSelect.Add(new DestinationTargetSelectHandler(SetDest, 0, Targets.DestCaster)); + } + } + [Script] class spell_gen_arcane_charge : SpellScript { 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 000000000..606343241 --- /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');