Skip to content

Commit

Permalink
Init.
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsbench authored Jun 21, 2024
1 parent 317c0ee commit fcddfa8
Showing 1 changed file with 20 additions and 63 deletions.
83 changes: 20 additions & 63 deletions src/Bracket_1_19/scripts/events/midsummer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -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
Expand Down

0 comments on commit fcddfa8

Please sign in to comment.