From d9e97f9fef0e97b963ebbb096c5c955a16e8cfe1 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 31 Aug 2018 20:49:59 +0200 Subject: [PATCH] Scripts/TSC: Ozruk's Rupture will now always summon his spikes into the right direction --- .../custom/custom_2018_08_31_01_world.sql | 6 +++ src/server/game/Spells/SpellMgr.cpp | 6 +++ .../Maelstrom/Stonecore/boss_ozruk.cpp | 47 +++++++++++++++---- 3 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/custom/custom_2018_08_31_01_world.sql diff --git a/sql/updates/world/custom/custom_2018_08_31_01_world.sql b/sql/updates/world/custom/custom_2018_08_31_01_world.sql new file mode 100644 index 0000000000..57eb4c18df --- /dev/null +++ b/sql/updates/world/custom/custom_2018_08_31_01_world.sql @@ -0,0 +1,6 @@ +-- Spells +DELETE FROM `spell_script_names` WHERE `ScriptName` IN +('spell_ozuruk_rupture_summon'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(95669, 'spell_ozuruk_rupture_summon'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 2e40a7a2ed..38ffa17d09 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4150,6 +4150,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; }); + // Rupture + ApplySpellFix({ 95669 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_1].MaxRadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_8_YARDS); + }); + // ENDOF STONECORE SPELLS // diff --git a/src/server/scripts/Maelstrom/Stonecore/boss_ozruk.cpp b/src/server/scripts/Maelstrom/Stonecore/boss_ozruk.cpp index b6a6351ba8..f481893c63 100644 --- a/src/server/scripts/Maelstrom/Stonecore/boss_ozruk.cpp +++ b/src/server/scripts/Maelstrom/Stonecore/boss_ozruk.cpp @@ -15,11 +15,12 @@ * with this program. If not, see . */ +#include "stonecore.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellAuraEffects.h" +#include "Spell.h" #include "SpellScript.h" -#include "stonecore.h" #include "TemporarySummon.h" #include "Vehicle.h" @@ -190,15 +191,16 @@ class spell_ozruk_rupture : public AuraScript Unit* caster = GetTarget(); float dist = aurEff->GetTickNumber() * 8.0f; + float angle = caster->GetOrientation() -0.2f; - Position pos = caster->GetNearPosition(dist, 0.0f); - caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RUPTURE_SUMMON, true); - - pos = caster->GetNearPosition(dist, 0.2f); - caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RUPTURE_SUMMON, true); - - pos = caster->GetNearPosition(dist, -0.2f); - caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RUPTURE_SUMMON, true); + for (uint8 i = 0; i < 3; i++) + { + float x = caster->GetPositionX() + cos(angle) * dist; + float y = caster->GetPositionY() + sin(angle) * dist; + float z = caster->GetMap()->GetStaticHeight(caster->GetPhaseShift(), x, y, caster->GetPositionZ() + 3.0f); + caster->CastSpell(x, y, z, SPELL_RUPTURE_SUMMON, true); + angle += 0.2f; + } } void Register() @@ -207,6 +209,32 @@ class spell_ozruk_rupture : public AuraScript } }; +class spell_ozuruk_rupture_summon : public SpellScript +{ + PrepareSpellScript(spell_ozuruk_rupture_summon); + + void SetDest(SpellDestination& dest) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + Position pos = caster->GetPosition(); + float x = pos.GetPositionX() + cos(pos.GetOrientation()) * 8.0f; + float y = pos.GetPositionY() + sin(pos.GetOrientation()) * 8.0f; + float z = caster->GetMap()->GetStaticHeight(caster->GetPhaseShift(), x, y, caster->GetPositionZ() + 3.0f); + if (std::abs(z) > 5.0f) + z = caster->GetPositionZ(); + + dest.Relocate({ x, y, z, pos.GetOrientation() }); + } + + void Register() + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_ozuruk_rupture_summon::SetDest, EFFECT_0, TARGET_DEST_CASTER_FRONT); + } +}; + class spell_ozruk_elementium_spike_shield : public SpellScript { PrepareSpellScript(spell_ozruk_elementium_spike_shield); @@ -277,6 +305,7 @@ void AddSC_boss_ozruk() { new boss_ozruk(); RegisterAuraScript(spell_ozruk_rupture); + RegisterSpellScript(spell_ozuruk_rupture_summon); RegisterSpellScript(spell_ozruk_elementium_spike_shield); RegisterSpellScript(spell_ozruk_paralyze); RegisterAuraScript(spell_ozruk_paralyze_stun);