diff --git a/sql/updates/world/custom/custom_2019_04_06_01_world.sql b/sql/updates/world/custom/custom_2019_04_06_01_world.sql new file mode 100644 index 00000000000..fad492701b6 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_04_06_01_world.sql @@ -0,0 +1,23 @@ +DELETE FROM `phase_area` WHERE `AreaId` IN (4990, 4979, 5020, 4861, 5014); +INSERT INTO `phase_area` (`AreaId`, `PhaseId`, `Comment`) VALUES +(4861, 194, 'Mount Hyjal - The Regrowth - Phase 194'), +(5014, 194, 'Mount Hyjal - The Inferno - Phase 194'), +(4990, 194, 'Mount Hyjal - Shrine of Aviana - Phase 194'), +(4979, 195, 'Mount Hyjal - Shrine of Goldrinn - Phase 195'), +(5020, 194, 'Mount Hyjal - The Flamewake - Phase 194'); + +UPDATE `creature` SET `terrainSwapMap`= 719 WHERE `id` IN (39939, 39974, 39997, 39999, 40336, 39998, 39927); + +DELETE FROM `creature` WHERE `guid` IN (386151, 386152, 386154, 386155, 386241, 386247, 386248, 386249, 386250, 386251, 386451, 386468, 386469, 386470, 386472, 386473, 386474, 386475, 386476, 386477, 386478, 386479, 386480, 386481, 386489, 386490, 386491, 386493, 386494, 386495, 386496, 386497, 386498, 386499, 386500, 386501, 386502, 386503, 386504, 386505, 386523, 386524, 386526); + +DELETE FROM `creature_addon` WHERE `guid` IN (386151, 386152, 386154, 386155, 386241, 386247, 386248, 386249, 386250, 386251, 386451, 386468, 386469, 386470, 386472, 386473, 386474, 386475, 386476, 386477, 386478, 386479, 386480, 386481, 386489, 386490, 386491, 386493, 386494, 386495, 386496, 386497, 386498, 386499, 386500, 386501, 386502, 386503, 386504, 386505, 386523, 386524, 386526); + +UPDATE `creature_template` SET `ScriptName`= 'npc_mh_raging_firestorm', `AIName`= '' WHERE `entry`= 39939; +DELETE FROM `smart_scripts` WHERE `entryorguid`=39939 AND `source_type`=0; + +-- Creature Grove Warden 39941 SAI +SET @ENTRY := 39941; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 7, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On evade - Self: Despawn instantly // "); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 6f41011cde1..9f92a704980 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5195,6 +5195,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY; }); + // Gout of Flame + ApplySpellFix({ 80550 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_1].BasePoints = 7; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Kalimdor/zone_mount_hyjal.cpp b/src/server/scripts/Kalimdor/zone_mount_hyjal.cpp index 43fea88ec33..99ffb9929ca 100644 --- a/src/server/scripts/Kalimdor/zone_mount_hyjal.cpp +++ b/src/server/scripts/Kalimdor/zone_mount_hyjal.cpp @@ -473,6 +473,120 @@ private: EventMap _events; }; + +enum RagingFirestorm +{ + NPC_GROVE_WARDEN = 39941, + NPC_LAINA_NIGHTSKY = 39927, + SPELL_SUMMON_TREES = 74565, + SPELL_GOUT_OF_FLAME = 80549, + + EVENT_GOUT_OF_FLAME = 1 +}; + +Position const GroveWardenSummonPositions[] = +{ + { 5041.51f, -1730.29f, 1323.29f, 1.6057f }, + { 5031.45f, -1734.11f, 1322.15f, 1.6057f }, + { 5033.78f, -1732.86f, 1322.35f, 1.6057f }, + { 5034.65f, -1729.32f, 1322.3f, 1.6057f }, + { 5042.12f, -1734.71f, 1323.35f, 1.6057f }, + { 5033.48f, -1737.55f, 1322.51f, 1.6057f } +}; + +Position const GroveWardenWaypointPosition1 = { 5026.774f, -1657.001f, 1326.92f }; +Position const GroveWardenWaypointPosition2 = { 5028.423f, -1645.738f, 1327.722f }; + +struct npc_mh_raging_firestorm : public ScriptedAI +{ + npc_mh_raging_firestorm(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + _allowWardenCombat = me->GetExactDist2d(GroveWardenWaypointPosition1) < 140.0f; + } + + void AttackStart(Unit* victim) override + { + if (victim->GetTypeId() == TYPEID_UNIT && victim->GetEntry() == NPC_GROVE_WARDEN && victim->GetExactDist2d(me) > me->GetCombatReach()) + return; + + ScriptedAI::AttackStart(victim); + } + + void Reset() override + { + _events.Reset(); + if (_allowWardenCombat) + SummonGroveWarden(); + } + + void JustSummoned(Creature* summon) override + { + _summons.Summon(summon); + } + + void JustEngagedWith(Unit* /*who*/) override + { + _events.ScheduleEvent(EVENT_GOUT_OF_FLAME, 8s, 10s); + } + + void UpdateAI(uint32 diff) override + { + UpdateVictim(); + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_GOUT_OF_FLAME: + DoCastVictim(SPELL_GOUT_OF_FLAME); + _events.Repeat(21s); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } +private: + EventMap _events; + bool _allowWardenCombat; + + void SummonGroveWarden() + { + uint8 spawnIndex = urand(0, 5); + if (Creature* warden = DoSummon(NPC_GROVE_WARDEN, GroveWardenSummonPositions[spawnIndex], 20000)) + { + warden->SetDisplayId(warden->GetCreatureTemplate()->Modelid1); + Position waypointPos = GroveWardenWaypointPosition1; + Position homePos = me->GetHomePosition(); + if (me->GetExactDist2d(GroveWardenWaypointPosition1) < me->GetExactDist2d(GroveWardenWaypointPosition2)) + waypointPos = GroveWardenWaypointPosition2; + + if (Creature* laina = warden->FindNearestCreature(NPC_LAINA_NIGHTSKY, 20.0f, true)) + warden->CastSpell(laina, SPELL_SUMMON_TREES); + + warden->m_Events.AddEventAtOffset([warden, waypointPos, homePos]() + { + Movement::MoveSplineInit init(warden); + init.MoveTo(waypointPos.GetPositionX(), waypointPos.GetPositionY(), waypointPos.GetPositionZ()); + if (int32 travelTime = init.Launch()) + warden->m_Events.AddEventAtOffset([warden, homePos]() + { + warden->GetMotionMaster()->MovePoint(POINT_NONE, homePos); + }, Milliseconds(travelTime)); + }, 2s + 500ms); + } + } +}; + class spell_mh_summon_emerald_flameweaver : public SpellScript { PrepareSpellScript(spell_mh_summon_emerald_flameweaver); @@ -529,6 +643,7 @@ void AddSC_mount_hyjal() RegisterCreatureAI(npc_mh_faerie_dragon); RegisterCreatureAI(npc_mh_twilight_inciter); RegisterCreatureAI(npc_mh_emerald_flameweaver); + RegisterCreatureAI(npc_mh_raging_firestorm); RegisterSpellScript(spell_mh_summon_emerald_flameweaver); RegisterSpellScript(spell_mh_ragnaros); RegisterAuraScript(spell_mh_flamebreaker);