fix(Scripts/SunwellPlateau): Fix Darkness spawning midair (#21851)
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` = 46268;
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (46268, 'spell_muru_blackhole');
|
||||||
@@ -611,6 +611,10 @@ public:
|
|||||||
[[nodiscard]] virtual float GetStationaryZ() const { return GetPositionZ(); }
|
[[nodiscard]] virtual float GetStationaryZ() const { return GetPositionZ(); }
|
||||||
[[nodiscard]] virtual float GetStationaryO() const { return GetOrientation(); }
|
[[nodiscard]] virtual float GetStationaryO() const { return GetOrientation(); }
|
||||||
|
|
||||||
|
[[nodiscard]] float GetMapWaterOrGroundLevel(Position pos, float* ground = nullptr) const
|
||||||
|
{
|
||||||
|
return GetMapWaterOrGroundLevel(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), ground);
|
||||||
|
};
|
||||||
[[nodiscard]] float GetMapWaterOrGroundLevel(float x, float y, float z, float* ground = nullptr) const;
|
[[nodiscard]] float GetMapWaterOrGroundLevel(float x, float y, float z, float* ground = nullptr) const;
|
||||||
[[nodiscard]] float GetMapHeight(float x, float y, float z, bool vmap = true, float distanceToSearch = 50.0f) const; // DEFAULT_HEIGHT_SEARCH in map.h
|
[[nodiscard]] float GetMapHeight(float x, float y, float z, bool vmap = true, float distanceToSearch = 50.0f) const; // DEFAULT_HEIGHT_SEARCH in map.h
|
||||||
|
|
||||||
|
|||||||
@@ -352,6 +352,29 @@ class spell_entropius_negative_energy_periodic : public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class spell_muru_blackhole : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_muru_blackhole);
|
||||||
|
|
||||||
|
void ChangeSummonPos(SpellEffIndex /*effIndex*/)
|
||||||
|
{
|
||||||
|
if (!GetCaster())
|
||||||
|
return;
|
||||||
|
|
||||||
|
WorldLocation summonPos = *GetExplTargetDest();
|
||||||
|
float destZ = summonPos.GetPositionZ() - GetCaster()->GetMapWaterOrGroundLevel(GetCaster()->GetPosition());
|
||||||
|
Position offset = { 0.0f, 0.0f, -destZ, 0.0f};
|
||||||
|
summonPos.RelocateOffset(offset);
|
||||||
|
SetExplTargetDest(summonPos);
|
||||||
|
GetHitDest()->RelocateOffset(offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectHit += SpellEffectFn(spell_muru_blackhole::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_boss_muru()
|
void AddSC_boss_muru()
|
||||||
{
|
{
|
||||||
RegisterSunwellPlateauCreatureAI(boss_muru);
|
RegisterSunwellPlateauCreatureAI(boss_muru);
|
||||||
@@ -363,4 +386,5 @@ void AddSC_boss_muru()
|
|||||||
RegisterSpellScript(spell_entropius_void_zone_visual_aura);
|
RegisterSpellScript(spell_entropius_void_zone_visual_aura);
|
||||||
RegisterSpellScript(spell_entropius_black_hole_effect);
|
RegisterSpellScript(spell_entropius_black_hole_effect);
|
||||||
RegisterSpellScript(spell_entropius_negative_energy_periodic);
|
RegisterSpellScript(spell_entropius_negative_energy_periodic);
|
||||||
|
RegisterSpellScript(spell_muru_blackhole);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user