From a1ffb288042d59de0a6b301c6ed08fa8c76ea677 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 21 Aug 2018 23:25:00 +0200 Subject: [PATCH] Scripts/TotT: * use own calculations for Shock Defense lightning destinations to come as close as possible to retail behaivior * removed some random movements and auras from several trash npc's within the instance --- .../custom/custom_2018_08_21_01_world.sql | 9 +++++++ .../ThroneOfTheTides/throne_of_the_tides.cpp | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sql/updates/world/custom/custom_2018_08_21_01_world.sql diff --git a/sql/updates/world/custom/custom_2018_08_21_01_world.sql b/sql/updates/world/custom/custom_2018_08_21_01_world.sql new file mode 100644 index 00000000000..502cbba20af --- /dev/null +++ b/sql/updates/world/custom/custom_2018_08_21_01_world.sql @@ -0,0 +1,9 @@ +UPDATE `creature_template_addon` SET `auras`= '' WHERE `entry`= 40925; +UPDATE `creature_addon` SET `auras`= '' WHERE `guid` IN (255117, 255119, 255120, 255115); +UPDATE `creature` SET `MovementType`= 0, `spawndist`= 0 WHERE `guid` IN (255021, 255022, 255023, 255019); + +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_tott_shock_defense'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(86611, 'spell_tott_shock_defense'), +(86613, 'spell_tott_shock_defense'), +(86614, 'spell_tott_shock_defense'); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp index 8409d2e1ff9..9d1196a7eda 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.cpp @@ -428,6 +428,29 @@ class spell_tott_ulthok_intro_visual_impact: public SpellScript } }; +class spell_tott_shock_defense : public SpellScript +{ + PrepareSpellScript(spell_tott_shock_defense); + + void SetDest(SpellDestination& dest) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + float x = caster->GetPositionX() + frand(-80.0f, 80.0f); + float y = caster->GetPositionY() + frand(-80.0f, 80.0f); + float z = caster->GetPositionZ() + frand(-80.0f, 80.0f); + + dest.Relocate({ x, y, z, 0.0f }); + } + + void Register() + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_tott_shock_defense::SetDest, EFFECT_0, TARGET_DEST_CASTER_RANDOM); + } +}; + enum OzumatTentacle { SPELL_TENTACLE_KNOCKBACK = 84566 @@ -503,6 +526,7 @@ void AddSC_throne_of_the_tides() RegisterSpellScript(spell_tott_camera); RegisterSpellScript(spell_tott_shock_defense_script); RegisterSpellScript(spell_tott_ulthok_intro_visual_impact); + RegisterSpellScript(spell_tott_shock_defense); new at_tott_first_invader_event(); new at_tott_tentacle_knockback(); new at_tott_lady_nazjar_gauntlet();