Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo Ahune Ice Stone progression script. #401

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 25 additions & 67 deletions src/Bracket_1_19/scripts/events/midsummer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "GameObjectAI.h"
#include "Group.h"
#include "LFGMgr.h"
#include "Player.h"
Expand All @@ -23,61 +24,26 @@

#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;
}

bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) override
go_ahune_ice_stone_1_19(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }

bool GossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override
{
if (!player || !go)
return true;

if (action != GOSSIP_ACTION_INFO_DEF + 1337)
if (!player)
return true;

// Not allowed in RDF/LFG
Expand All @@ -87,34 +53,26 @@ class go_ahune_ice_stone_1_19 : public GameObjectScript
}

// Only allow summoning him in heroic
if (!go->GetMap()->IsHeroic())
if (!me->GetMap()->IsHeroic())
{
return true;
}

if (go->FindNearestCreature(NPC_AHUNE, 200.0f, true))
return true;
player->DestroyItemCount(ITEM_MAGMA_TOTEM, 1, true, false);
player->AreaExploredOrEventHappens(QUEST_SUMMON_AHUNE); //auto rewarded

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

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
Expand All @@ -133,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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Loading