AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_braug_dimspirit Class Reference
Inheritance diagram for npc_braug_dimspirit:
CreatureScript ScriptObject UpdatableScript< Creature >

Public Member Functions

 npc_braug_dimspirit ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_braug_dimspirit()

npc_braug_dimspirit::npc_braug_dimspirit ( )
inline
49: CreatureScript("npc_braug_dimspirit") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool npc_braug_dimspirit::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

68 {
69 if (creature->IsQuestGiver())
70 player->PrepareQuestMenu(creature->GetGUID());
71
72 if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE)
73 {
79
80 SendGossipMenuFor(player, 5820, creature->GetGUID());
81 }
82 else
83 SendGossipMenuFor(player, 5819, creature->GetGUID());
84
85 return true;
86 }
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
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
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:60
#define GOSSIP_HBD4
Definition: zone_stonetalon_mountains.cpp:43
#define GOSSIP_HBD5
Definition: zone_stonetalon_mountains.cpp:44
#define GOSSIP_HBD1
Definition: zone_stonetalon_mountains.cpp:40
#define GOSSIP_HBD3
Definition: zone_stonetalon_mountains.cpp:42
#define GOSSIP_HBD2
Definition: zone_stonetalon_mountains.cpp:41
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1424
bool IsQuestGiver() const
Definition: Unit.h:718

References AddGossipItemFor(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_HBD1, GOSSIP_HBD2, GOSSIP_HBD3, GOSSIP_HBD4, GOSSIP_HBD5, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_STATUS_INCOMPLETE, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_braug_dimspirit::OnGossipSelect ( Player player,
Creature creature,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

52 {
53 ClearGossipMenuFor(player);
54 if (action == GOSSIP_ACTION_INFO_DEF + 1)
55 {
56 CloseGossipMenuFor(player);
57 creature->CastSpell(player, 6766, false);
58 }
59 if (action == GOSSIP_ACTION_INFO_DEF + 2)
60 {
61 CloseGossipMenuFor(player);
62 player->AreaExploredOrEventHappens(6627);
63 }
64 return true;
65 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1785
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168

References Player::AreaExploredOrEventHappens(), Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), and GOSSIP_ACTION_INFO_DEF.