fix(Script/Spell): Fix animal blood pool effect and position (#15918)

Adapted from TC Commits 3ddc6e70df0401a0677bef536e6b0e46e3dbf9e9 and cc3293c0023b36434747190103a1f0ffee0f8488

Co-authored-by: sirikfoll <sirikfoll@hotmail.com>
Co-authored-by: Rushor <rushor@github.com>
This commit is contained in:
Timothy Vaccarelli
2023-04-12 07:07:00 -04:00
committed by GitHub
parent ce6ca597b5
commit a8a3011278
2 changed files with 28 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
-- Add spell script to database for 63471 - Spawn Blood Pool
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');

View File

@@ -2030,8 +2030,7 @@ class spell_gen_animal_blood : public AuraScript
{
if (Unit* owner = GetUnitOwner())
{
if (owner->IsInWater())
owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true);
}
}
@@ -2042,6 +2041,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();
LiquidData liquidStatus = caster->GetMap()->GetLiquidData(caster->GetPhaseMask(), caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), caster->GetCollisionHeight(), MAP_ALL_LIQUIDS);
float level = liquidStatus.Level > INVALID_HEIGHT ? liquidStatus.Level : caster->GetPositionZ();
Position pos = Position(caster->GetPositionX(), caster->GetPositionY(), level, caster->GetOrientation());
dest.Relocate(pos);
}
void Register() override
{
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_spawn_blood_pool::SetDest, EFFECT_0, TARGET_DEST_CASTER);
}
};
enum DivineStormSpell
{
SPELL_DIVINE_STORM = 53385,
@@ -4893,6 +4913,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_feign_death_no_prevent_emotes);
RegisterSpellScript(spell_pvp_trinket_wotf_shared_cd);
RegisterSpellScript(spell_gen_animal_blood);
RegisterSpellScript(spell_spawn_blood_pool);
RegisterSpellScript(spell_gen_divine_storm_cd_reset);
RegisterSpellScript(spell_gen_profession_research);
RegisterSpellScript(spell_gen_clone);