From 0dec5be501f9bab27f168a9934e1b5bd5e66332a Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 24 Jan 2019 12:50:27 +0100 Subject: [PATCH] Scripts/TotT: corrected multiple mechanics for Lady Naz'jar's encounter * corrected some damage values for encounter related creatures --- .../custom/custom_2019_01_24_00_world.sql | 3 + src/server/game/Spells/SpellMgr.cpp | 6 ++ .../ThroneOfTheTides/boss_lady_nazjar.cpp | 71 ++++++++++++++++--- .../instance_throne_of_the_todes.cpp | 62 +++++++++++----- .../ThroneOfTheTides/throne_of_the_tides.h | 3 +- 5 files changed, 115 insertions(+), 30 deletions(-) create mode 100644 sql/updates/world/custom/custom_2019_01_24_00_world.sql diff --git a/sql/updates/world/custom/custom_2019_01_24_00_world.sql b/sql/updates/world/custom/custom_2019_01_24_00_world.sql new file mode 100644 index 00000000000..677923e76a6 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_01_24_00_world.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `DamageModifier`= 30 WHERE `entry`= 40633; +UPDATE `creature_template` SET `DamageModifier`= 60 WHERE `entry`= 49084; +UPDATE `creature_template` SET `DamageModifier`= 120 WHERE `entry`= 49104; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index f7f8940fd8b..4f1f878d9d2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4444,6 +4444,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd }); + // Waterspout + ApplySpellFix({ 90461 }, [](SpellInfo* spellInfo) + { + spellInfo->Speed = 6.0f; + }); + // END OF THRONE OF THE TIDES SPELLS // diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp index 66dbf99f659..4cfc52a7f17 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/boss_lady_nazjar.cpp @@ -39,10 +39,16 @@ enum Spells // Lady Naz'jar SPELL_SUMMON_GEYSER = 75722, SPELL_FUNGAL_SPORES = 76001, - SPELL_WATERSPOUT_SUMMON = 90495, + SPELL_WATERSPOUT_SUMMON_1 = 90495, + SPELL_WATERSPOUT_SUMMON_2 = 90497, SPELL_WATERSPOUT_SHIELD = 75683, SPELL_ACHIEVEMENT_OLD_FAITHFUL = 94042, // Serverside spell. Handled via UpdateAchievementCriteria + // Waterspout + SPELL_EJECT_ALL_PASSENGERS = 63109, + SPELL_WATERSPOUT = 90440, + SPELL_WATERSPOUT_CHARGE = 90461, + // Geyser SPELL_GEYSER_VISUAL = 75699, SPELL_GEYSER_ERUPTION = 75700, @@ -127,6 +133,39 @@ class PrepareDelayedAttackEvent : public BasicEvent Creature* _owner; }; +class EjectAllPassengersEvent : public BasicEvent +{ + public: + EjectAllPassengersEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + _owner->RemoveAurasDueToSpell(SPELL_WATERSPOUT); + _owner->CastSpell(_owner, SPELL_EJECT_ALL_PASSENGERS); + return true; + } + + private: + Creature* _owner; +}; + +class WaterSpoutChargeEvent : public BasicEvent +{ + public: + WaterSpoutChargeEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + _owner->RemoveAurasDueToSpell(SPELL_WATERSPOUT); + _owner->CastSpell(_owner, SPELL_EJECT_ALL_PASSENGERS); + return true; + } + + private: + Creature* _owner; +}; + + Position const LadyNazjarCenterPosition = { 191.5f, 802.7f, 807.6f, 4.414708f }; Position const LadyNazjarAddPositions[] = @@ -187,6 +226,7 @@ struct boss_lady_nazjar : public BossAI instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FUNGAL_SPORES_AURA); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHTNING_SURGE); + instance->SetData(DATA_LADY_NAZJAR_GEYSERS, NOT_STARTED); summons.DespawnAll(); _DespawnAtEvade(); } @@ -199,6 +239,7 @@ struct boss_lady_nazjar : public BossAI instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FUNGAL_SPORES_AURA); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHTNING_SURGE); + instance->SetData(DATA_LADY_NAZJAR_GEYSERS, NOT_STARTED); } void JustSummoned(Creature* summon) override @@ -214,12 +255,12 @@ struct boss_lady_nazjar : public BossAI case NPC_WATERSPOUT: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0)) { - float angle = me->GetAngle(target) - me->GetOrientation(); - Position pos = me->GetPosition(); - pos.m_positionZ += 5.0f; // To make sure that we wont get stuck at the inner arena ring - me->MovePositionToFirstCollision(pos, 60.0f, angle); - summon->GetMotionMaster()->MovePoint(0, pos, false); - summon->DespawnOrUnsummon(summon->movespline->Duration()); + summon->CastSpell(target, SPELL_WATERSPOUT_CHARGE); + if (uint32 duration = summon->movespline->Duration()) + { + summon->m_Events.AddEventAtOffset(new EjectAllPassengersEvent(summon), Milliseconds(duration)); + summon->DespawnOrUnsummon(duration + (5 * IN_MILLISECONDS)); + } } break; default: @@ -235,7 +276,8 @@ struct boss_lady_nazjar : public BossAI if (_killedAdds == 3 && me->HasAura(SPELL_WATERSPOUT_SHIELD)) { me->RemoveAurasDueToSpell(SPELL_WATERSPOUT_SHIELD); - me->RemoveAurasDueToSpell(SPELL_WATERSPOUT_SUMMON); + me->RemoveAurasDueToSpell(SPELL_WATERSPOUT_SUMMON_1); + me->RemoveAurasDueToSpell(SPELL_WATERSPOUT_SUMMON_2); events.RescheduleEvent(EVENT_REENGAGE, 1ms); } @@ -258,6 +300,10 @@ struct boss_lady_nazjar : public BossAI void DamageTaken(Unit* /*attacker*/, uint32& damage) override { + // Oneshot cases + if (damage >= me->GetHealth()) + return; + if ((me->HealthBelowPctDamaged(60, damage) && _waterspoutPhaseCount == 0) || (me->HealthBelowPctDamaged(30, damage) && _waterspoutPhaseCount == 1)) { @@ -266,16 +312,20 @@ struct boss_lady_nazjar : public BossAI me->SetReactState(REACT_PASSIVE); me->InterruptNonMeleeSpells(true); me->NearTeleportTo(LadyNazjarCenterPosition); + instance->SetData(DATA_LADY_NAZJAR_GEYSERS, IN_PROGRESS); Talk(SAY_SUMMON_ADDS); if (IsHeroic()) - DoCastSelf(SPELL_WATERSPOUT_SUMMON); + { + DoCastSelf(SPELL_WATERSPOUT_SUMMON_1); + DoCastSelf(SPELL_WATERSPOUT_SUMMON_2); + } DoCastSelf(SPELL_WATERSPOUT_SHIELD); events.ScheduleEvent(EVENT_REENGAGE, 1min + 1s + 500ms); _killedAdds = 0; for (uint8 i = 0; i < 3; i++) { - if (Creature* invader = DoSummon((i == 0 ? NPC_NAZJAR_HONOR_GUARD : NPC_NAZJAR_TEMPEST_WITCH), LadyNazjarAddPositions[i], 4000)) + if (Creature* invader = DoSummon((i == 0 ? NPC_NAZJAR_HONOR_GUARD : NPC_NAZJAR_TEMPEST_WITCH), LadyNazjarAddPositions[i], 4 * IN_MILLISECONDS)) { invader->SetReactState(REACT_PASSIVE); invader->SetDisableGravity(true); @@ -326,6 +376,7 @@ struct boss_lady_nazjar : public BossAI if (Unit* target = me->GetVictim()) AttackStart(target); + instance->SetData(DATA_LADY_NAZJAR_GEYSERS, NOT_STARTED); events.ScheduleEvent(EVENT_SUMMON_GEYSER, 11s, 16s); events.ScheduleEvent(EVENT_FUNGAL_SPORES, 13s, 19s); events.ScheduleEvent(EVENT_SHOCK_BLAST, 13s, 16s); diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp index 922b5deb880..fc8ebd1ba64 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/instance_throne_of_the_todes.cpp @@ -151,6 +151,22 @@ class EmoteStateEvent : public BasicEvent Creature* _owner; }; +class GeyserActivationEvent : public BasicEvent +{ + public: + GeyserActivationEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + _owner->RemoveAurasDueToSpell(SPELL_GEYSER_DUMMY); + _owner->CastSpell(_owner, SPELL_GEYSER_DUMMY_KNOCKBACK); + return true; + } + + private: + Creature* _owner; +}; + class instance_throne_of_the_tides : public InstanceMapScript { public: @@ -181,23 +197,6 @@ class instance_throne_of_the_tides : public InstanceMapScript switch (type) { case DATA_LADY_NAZJAR: - for (ObjectGuid guid : _geyserGUIDs) - { - if (Creature* geyser = instance->GetCreature(guid)) - { - if (state == IN_PROGRESS) - { - geyser->CastSpell(geyser, SPELL_GEYSER_DUMMY); - geyser->CastSpell(geyser, SPELL_GEYSER_DUMMY_KNOCKBACK); - } - else - { - geyser->RemoveAurasDueToSpell(SPELL_GEYSER_DUMMY); - geyser->RemoveAurasDueToSpell(SPELL_GEYSER_DUMMY_KNOCKBACK); - } - } - } - if (state == DONE) if (GameObject* defenseSystem = GetGameObject(DATA_THRONE_OF_THE_TIDES_DEFENSE_SYSTEM)) defenseSystem->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); @@ -232,18 +231,25 @@ class instance_throne_of_the_tides : public InstanceMapScript creature->setActive(true); creature->SetFarVisible(true); - _infiniteAOIDummyGUIDs.push_back(creature->GetGUID()); - if (creature->GetExactDist2d(fallingRocksDummyPos) < 1.0f) { _fallingRocksDummyGUID = creature->GetGUID(); if (_eventIndex < EVENT_INDEX_DEFENSE_SYSTEM_ACTIVATED) events.ScheduleEvent(EVENT_FALLING_ROCKS, 1min + 15s); + break; } else if (creature->GetExactDist2d(shockDefenseDummyPos) < 1.0f) + { _shockDefenseDummyGUID = creature->GetGUID(); + break; + } else if (creature->GetExactDist2d(ulthokIntroDummyPos) < 1.0f) + { _ulthokIntroDummyGUID = creature->GetGUID(); + break; + } + + _infiniteAOIDummyGUIDs.push_back(creature->GetGUID()); break; case NPC_GEYSER_DUMMY: _geyserGUIDs.push_back(creature->GetGUID()); @@ -412,6 +418,24 @@ class instance_throne_of_the_tides : public InstanceMapScript SaveToDB(); break; + case DATA_LADY_NAZJAR_GEYSERS: + for (ObjectGuid guid : _geyserGUIDs) + { + if (Creature* geyser = instance->GetCreature(guid)) + { + if (data == IN_PROGRESS) + { + geyser->CastSpell(geyser, SPELL_GEYSER_DUMMY); + geyser->m_Events.AddEventAtOffset(new GeyserActivationEvent(geyser), 6s); + } + else + { + geyser->RemoveAllAuras(); + geyser->m_Events.KillAllEvents(true); + } + } + } + break; default: break; } diff --git a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h index 7888b82df0a..d6b3005312d 100644 --- a/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h +++ b/src/server/scripts/EasternKingdoms/ThroneOfTheTides/throne_of_the_tides.h @@ -46,7 +46,8 @@ enum TotTDataTypes DATA_LEVIATHAN_TENTACLE_2 = 13, DATA_ABYSSAL_CORAL_CHUNK = 14, DATA_NEPTULON = 15, - DATA_OZUMAT_VEHICLE = 16 + DATA_OZUMAT_VEHICLE = 16, + DATA_LADY_NAZJAR_GEYSERS = 17 }; enum TotTCreatureIds