AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
go_ahune_ice_stone Class Reference
Inheritance diagram for go_ahune_ice_stone:
GameObjectScript ScriptObject UpdatableScript< GameObject >

Public Member Functions

 go_ahune_ice_stone ()
 
bool OnGossipHello (Player *player, GameObject *go) override
 
bool OnGossipSelect (Player *player, GameObject *go, uint32, uint32 action) override
 
- Public Member Functions inherited from GameObjectScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, GameObject *)
 
virtual bool OnGossipSelect (Player *, GameObject *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, GameObject *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, GameObject *, Quest const *)
 
virtual bool OnQuestReward (Player *, GameObject *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, GameObject *)
 
virtual void OnDestroyed (GameObject *, Player *)
 
virtual void OnDamaged (GameObject *, Player *)
 
virtual void OnModifyHealth (GameObject *, Unit *, int32 &, SpellInfo const *)
 
virtual void OnLootStateChanged (GameObject *, uint32, Unit *)
 
virtual void OnGameObjectStateChanged (GameObject *, uint32)
 
virtual GameObjectAIGetAI (GameObject *) const
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< GameObject >
virtual void OnUpdate (GameObject *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from GameObjectScript
 GameObjectScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< GameObject >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ go_ahune_ice_stone()

go_ahune_ice_stone::go_ahune_ice_stone ( )
inline
332: GameObjectScript("go_ahune_ice_stone") { }
Definition: GameObjectScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool go_ahune_ice_stone::OnGossipHello ( Player player,
GameObject go 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

335 {
336 if (!player || !go)
337 return true;
338
339 if (!player->IsGameMaster())
340 {
341 if (Group const* group = player->GetGroup())
342 {
343 if (sLFGMgr->GetDungeon(group->GetGUID()) != lfg::LFG_DUNGEON_FROST_LORD_AHUNE)
344 {
345 return true;
346 }
347 }
348 }
349
350 if (go->FindNearestCreature(NPC_AHUNE, 200.0f, true))
351 return true;
352
353 AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Disturb the stone and summon Lord Ahune.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1337);
355 return true;
356 }
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
#define sLFGMgr
Definition: LFGMgr.h:641
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:60
#define GOSSIP_TEXT_ID
Definition: boss_ahune.cpp:28
@ NPC_AHUNE
Definition: the_slave_pens.h:51
@ LFG_DUNGEON_FROST_LORD_AHUNE
Definition: LFGMgr.h:149
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
Group * GetGroup()
Definition: Player.h:2431
bool IsGameMaster() const
Definition: Player.h:1148
Definition: Group.h:169

References AddGossipItemFor(), WorldObject::FindNearestCreature(), Player::GetGroup(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, GOSSIP_TEXT_ID, Player::IsGameMaster(), lfg::LFG_DUNGEON_FROST_LORD_AHUNE, NPC_AHUNE, SendGossipMenuFor(), and sLFGMgr.

◆ OnGossipSelect()

bool go_ahune_ice_stone::OnGossipSelect ( Player player,
GameObject go,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from GameObjectScript.

359 {
360 if (!player || !go)
361 return true;
362
363 if (!player->IsGameMaster())
364 {
365 if (Group const* group = player->GetGroup())
366 {
367 if (sLFGMgr->GetDungeon(group->GetGUID()) != lfg::LFG_DUNGEON_FROST_LORD_AHUNE)
368 {
369 return true;
370 }
371 }
372 }
373
374 if (action != GOSSIP_ACTION_INFO_DEF + 1337)
375 return true;
376 if (go->FindNearestCreature(NPC_AHUNE, 200.0f, true))
377 return true;
378
380 {
381 player->DestroyItemCount(ITEM_MAGMA_TOTEM, 1, true, false);
382 player->AreaExploredOrEventHappens(QUEST_SUMMON_AHUNE); // auto rewarded
383
384 c->SetVisible(false);
385 c->SetDisplayId(AHUNE_DEFAULT_MODEL);
386 c->SetFloatValue(UNIT_FIELD_COMBATREACH, 18.0f);
387 if (c->AI())
388 {
389 c->AI()->SetGUID(player->GetGUID(), SET_GUID_INVOKER);
390 }
391
393 if (Creature* crystal_trigger = go->SummonCreature(WORLD_TRIGGER, go->GetPositionX(), go->GetPositionY(), 5.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000))
394 crystal_trigger->CastSpell(bunny, SPELL_STARTING_BEAM, false);
395 }
396
397 CloseGossipMenuFor(player);
398 return true;
399 }
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ UNIT_FIELD_COMBATREACH
Definition: UpdateFields.h:123
#define WORLD_TRIGGER
Definition: Unit.h:36
@ SET_GUID_INVOKER
Definition: boss_ahune.cpp:94
#define QUEST_SUMMON_AHUNE
Definition: boss_ahune.cpp:29
#define AHUNE_DEFAULT_MODEL
Definition: boss_ahune.cpp:31
const Position AhuneSummonPos
Definition: boss_ahune.cpp:33
@ SPELL_STARTING_BEAM
Definition: boss_ahune.cpp:45
#define ITEM_MAGMA_TOTEM
Definition: boss_ahune.cpp:30
@ NPC_AHUNE_SUMMON_LOC_BUNNY
Definition: the_slave_pens.h:53
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2343
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
Definition: PlayerStorage.cpp:3143
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1777

References AHUNE_DEFAULT_MODEL, AhuneSummonPos, Player::AreaExploredOrEventHappens(), CloseGossipMenuFor(), Player::DestroyItemCount(), WorldObject::FindNearestCreature(), Player::GetGroup(), Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), GOSSIP_ACTION_INFO_DEF, Player::IsGameMaster(), ITEM_MAGMA_TOTEM, lfg::LFG_DUNGEON_FROST_LORD_AHUNE, NPC_AHUNE, NPC_AHUNE_SUMMON_LOC_BUNNY, QUEST_SUMMON_AHUNE, SET_GUID_INVOKER, sLFGMgr, SPELL_STARTING_BEAM, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_FIELD_COMBATREACH, and WORLD_TRIGGER.