From fcddfa88fb587e27f5f21abe9ffd258ba27d44b9 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Fri, 21 Jun 2024 08:27:16 -0400 Subject: [PATCH 1/3] Init. --- src/Bracket_1_19/scripts/events/midsummer.cpp | 83 +++++-------------- 1 file changed, 20 insertions(+), 63 deletions(-) diff --git a/src/Bracket_1_19/scripts/events/midsummer.cpp b/src/Bracket_1_19/scripts/events/midsummer.cpp index c5afd383..455e5528 100644 --- a/src/Bracket_1_19/scripts/events/midsummer.cpp +++ b/src/Bracket_1_19/scripts/events/midsummer.cpp @@ -23,63 +23,28 @@ #include "ProgressionSystem.h" -#define GOSSIP_TEXT_ID 15864 -#define QUEST_SUMMON_AHUNE 11691 -#define ITEM_MAGMA_TOTEM 34953 -#define AHUNE_DEFAULT_MODEL 23344 - -const Position AhuneSummonPos = { -97.3473f, -233.139f, -1.27587f, M_PI / 2 }; - enum Misc { - NPC_AHUNE = 25740, - NPC_AHUNE_SUMMON_LOC_BUNNY = 25745, - SPELL_STARTING_BEAM = 46593, - SPELL_CHILLING_AURA = 46542, - - SET_GUID_INVOKER = 1 + SPELL_SUMMONING_RHYME_AURA = 45926, + ACTION_START_EVENT = -2574500, + QUEST_SUMMON_AHUNE = 11691, + ITEM_MAGMA_TOTEM = 34953, + DATA_AHUNE_BUNNY = 5, + DATA_LUMA_SKYMOTHER = 16, + SPELL_CHILLING_AURA = 46542 }; -class go_ahune_ice_stone_1_19 : public GameObjectScript +class go_ahune_ice_stone_1_19 : public GameObjectAI { public: - go_ahune_ice_stone_1_19() : GameObjectScript("go_ahune_ice_stone") { } - - bool OnGossipHello(Player* player, GameObject* go) override - { - if (!player || !go) - return true; - - // Not allowed in RDF/LFG - if (player->GetGroup() && player->GetGroup()->isLFGGroup()) - { - return true; - } - - // Only allow summoning him in heroic - if (!go->GetMap()->IsHeroic()) - { - player->SendSystemMessage("Ahune may only be summoned in Heroic difficulty."); - return true; - } - - if (go->FindNearestCreature(NPC_AHUNE, 200.0f, true)) - return true; - - AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Disturb the stone and summon Lord Ahune.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1337); - SendGossipMenuFor(player, GOSSIP_TEXT_ID, go->GetGUID()); - return true; - } - + go_ahune_ice_stone_1_19() : GameObjectAI("go_ahune_ice_stone") { } + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override { if (!player || !go) return true; - if (action != GOSSIP_ACTION_INFO_DEF + 1337) - return true; - // Not allowed in RDF/LFG if (player->GetGroup() && player->GetGroup()->isLFGGroup()) { @@ -92,29 +57,21 @@ class go_ahune_ice_stone_1_19 : public GameObjectScript return true; } - if (go->FindNearestCreature(NPC_AHUNE, 200.0f, true)) - return true; - - if (Creature* c = go->SummonCreature(NPC_AHUNE, AhuneSummonPos, TEMPSUMMON_MANUAL_DESPAWN)) - { - player->DestroyItemCount(ITEM_MAGMA_TOTEM, 1, true, false); - player->AreaExploredOrEventHappens(QUEST_SUMMON_AHUNE); // auto rewarded + player->DestroyItemCount(ITEM_MAGMA_TOTEM, 1, true, false); + player->AreaExploredOrEventHappens(QUEST_SUMMON_AHUNE); //auto rewarded - c->SetVisible(false); - c->SetDisplayId(AHUNE_DEFAULT_MODEL); - c->SetFloatValue(UNIT_FIELD_COMBATREACH, 18.0f); - if (c->AI()) - { - c->AI()->SetGUID(player->GetGUID(), SET_GUID_INVOKER); - } - if (Creature* bunny = go->SummonCreature(NPC_AHUNE_SUMMON_LOC_BUNNY, AhuneSummonPos, TEMPSUMMON_TIMED_DESPAWN, 12000)) - if (Creature* crystal_trigger = go->SummonCreature(WORLD_TRIGGER, go->GetPositionX(), go->GetPositionY(), 5.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000)) - crystal_trigger->CastSpell(bunny, SPELL_STARTING_BEAM, false); - } + if (Creature* ahuneBunny = _instance->GetCreature(DATA_AHUNE_BUNNY)) + ahuneBunny->AI()->DoAction(ACTION_START_EVENT); + if (Creature* luma = _instance->GetCreature(DATA_LUMA_SKYMOTHER)) + luma->CastSpell(player, SPELL_SUMMONING_RHYME_AURA, true); CloseGossipMenuFor(player); + me->Delete(); return true; } + +private: + InstanceScript* _instance; }; class global_midsummer_tuning_script : public GlobalScript From 099c278a497da5f1fc5bc46e7cf4aa4302f6720d Mon Sep 17 00:00:00 2001 From: heyitsbench Date: Fri, 21 Jun 2024 08:50:57 -0400 Subject: [PATCH 2/3] Update. --- src/Bracket_1_19/scripts/events/midsummer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bracket_1_19/scripts/events/midsummer.cpp b/src/Bracket_1_19/scripts/events/midsummer.cpp index 455e5528..56263f09 100644 --- a/src/Bracket_1_19/scripts/events/midsummer.cpp +++ b/src/Bracket_1_19/scripts/events/midsummer.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "GameObjectAI.h" #include "Group.h" #include "LFGMgr.h" #include "Player.h" @@ -38,11 +39,11 @@ enum Misc class go_ahune_ice_stone_1_19 : public GameObjectAI { public: - go_ahune_ice_stone_1_19() : GameObjectAI("go_ahune_ice_stone") { } + go_ahune_ice_stone_1_19(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { } - bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override + bool GossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override { - if (!player || !go) + if (!player) return true; // Not allowed in RDF/LFG @@ -52,7 +53,7 @@ class go_ahune_ice_stone_1_19 : public GameObjectAI } // Only allow summoning him in heroic - if (!go->GetMap()->IsHeroic()) + if (!me->GetMap()->IsHeroic()) { return true; } @@ -90,6 +91,6 @@ class global_midsummer_tuning_script : public GlobalScript void AddSC_event_midsummer_1_19() { - new go_ahune_ice_stone_1_19(); + RegisterGameObjectAI(go_ahune_ice_stone_1_19); new global_midsummer_tuning_script(); } From f85482e5d4f33013197c6c302ae8430c3904e24c Mon Sep 17 00:00:00 2001 From: heyitsbench Date: Fri, 21 Jun 2024 08:54:27 -0400 Subject: [PATCH 3/3] Update Skar'this level. --- .../sql/world/progression_1_19_world_event_Ahune.sql | 2 +- .../sql/world/progression_1_19_world_event_Ahune_down.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bracket_1_19/sql/world/progression_1_19_world_event_Ahune.sql b/src/Bracket_1_19/sql/world/progression_1_19_world_event_Ahune.sql index 63bbf5d9..1e105a83 100644 --- a/src/Bracket_1_19/sql/world/progression_1_19_world_event_Ahune.sql +++ b/src/Bracket_1_19/sql/world/progression_1_19_world_event_Ahune.sql @@ -28,5 +28,5 @@ INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Chance`, `GroupId`, `M UPDATE `quest_template` SET `MinLevel` = 65 WHERE (`ID` = 11972); UPDATE `item_template` SET `RequiredLevel` = 65 WHERE (`entry` = 35723); -UPDATE `creature_template` SET `MaxLevel` = 70, `MinLevel` = 70 WHERE `entry` IN (25755, 25756, 25757, 26340, 26341, 26342, 26339, 25865); +UPDATE `creature_template` SET `MaxLevel` = 70, `MinLevel` = 70 WHERE `entry` IN (25755, 25756, 25757, 26340, 26341, 26342, 26339, 25865, 40446); UPDATE `creature_template` SET `MaxLevel` = 72, `MinLevel` = 72 WHERE `entry` IN (25740, 26338, 26865, 26339); diff --git a/src/Bracket_80_1/sql/world/progression_1_19_world_event_Ahune_down.sql b/src/Bracket_80_1/sql/world/progression_1_19_world_event_Ahune_down.sql index a8e967dc..d63501b3 100644 --- a/src/Bracket_80_1/sql/world/progression_1_19_world_event_Ahune_down.sql +++ b/src/Bracket_80_1/sql/world/progression_1_19_world_event_Ahune_down.sql @@ -25,5 +25,5 @@ INSERT INTO `gameobject_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, UPDATE `quest_template` SET `MinLevel` = 75 WHERE (`ID` = 11972); UPDATE `item_template` SET `RequiredLevel` = 75 WHERE (`entry` = 35723); -UPDATE `creature_template` SET `MaxLevel` = 80, `MinLevel` = 80 WHERE `entry` IN (25755, 25756, 25757, 26340, 26341, 26342, 26339, 25865); +UPDATE `creature_template` SET `MaxLevel` = 80, `MinLevel` = 80 WHERE `entry` IN (25755, 25756, 25757, 26340, 26341, 26342, 26339, 25865, 40446); UPDATE `creature_template` SET `MaxLevel` = 82, `MinLevel` = 82 WHERE `entry` IN (25740, 26338, 26865, 26339);