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

Classes

struct  npc_ulduar_keeperAI
 

Public Member Functions

 npc_ulduar_keeper ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) 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_ulduar_keeper()

npc_ulduar_keeper::npc_ulduar_keeper ( )
inline
88: CreatureScript("npc_ulduar_keeper_gossip") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_ulduar_keeper::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

148 {
149 return GetUlduarAI<npc_ulduar_keeperAI>(creature);
150 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

153 {
154 uint32 gossipMenuId = 0;
155 uint32 gossipTextId = 0;
156 switch (creature->GetEntry())
157 {
158 case NPC_FREYA_GOSSIP:
159 gossipMenuId = GOSSIP_MENU_FREYA;
160 gossipTextId = NPC_TEXT_FREYA;
161 break;
162 case NPC_HODIR_GOSSIP:
163 gossipMenuId = GOSSIP_MENU_HODIR;
164 gossipTextId = NPC_TEXT_HODIR;
165 break;
167 gossipMenuId = GOSSIP_MENU_MIMIRON;
168 gossipTextId = NPC_TEXT_MIMIRON;
169 break;
171 gossipMenuId = GOSSIP_MENU_THORIM;
172 gossipTextId = NPC_TEXT_THORIM;
173 break;
174 }
175
176 AddGossipItemFor(player, gossipMenuId, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
177 SendGossipMenuFor(player, gossipTextId, creature->GetGUID());
178 return true;
179 }
std::uint32_t uint32
Definition: Define.h:107
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
@ NPC_TEXT_FREYA
Definition: ulduar.cpp:36
@ GOSSIP_MENU_THORIM
Definition: ulduar.cpp:47
@ NPC_TEXT_THORIM
Definition: ulduar.cpp:48
@ NPC_TEXT_MIMIRON
Definition: ulduar.cpp:44
@ GOSSIP_MENU_HODIR
Definition: ulduar.cpp:39
@ GOSSIP_MENU_FREYA
Definition: ulduar.cpp:35
@ NPC_TEXT_HODIR
Definition: ulduar.cpp:40
@ GOSSIP_MENU_MIMIRON
Definition: ulduar.cpp:43
@ NPC_THORIM_GOSSIP
Definition: ulduar.h:144
@ NPC_FREYA_GOSSIP
Definition: ulduar.h:142
@ NPC_MIMIRON_GOSSIP
Definition: ulduar.h:145
@ NPC_HODIR_GOSSIP
Definition: ulduar.h:143
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109

References AddGossipItemFor(), Object::GetEntry(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_FREYA, GOSSIP_MENU_HODIR, GOSSIP_MENU_MIMIRON, GOSSIP_MENU_THORIM, GOSSIP_SENDER_MAIN, NPC_FREYA_GOSSIP, NPC_HODIR_GOSSIP, NPC_MIMIRON_GOSSIP, NPC_TEXT_FREYA, NPC_TEXT_HODIR, NPC_TEXT_MIMIRON, NPC_TEXT_THORIM, NPC_THORIM_GOSSIP, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

182 {
183 ClearGossipMenuFor(player);
184 switch (action)
185 {
188 SendGossipMenuFor(player, NPC_TEXT_CONFIRM, creature);
189 break;
191 {
193 CloseGossipMenuFor(player);
194
195 creature->AI()->Talk(SAY_KEEPER_CHOSEN_TO_PLAYER, player);
196 creature->AI()->Talk(SAY_KEEPER_CHOSEN_ANNOUNCE);
197 creature->AI()->DoAction(ACTION_KEEPER_OUTRO);
198 }
199 }
200 return true;
201 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ SAY_KEEPER_CHOSEN_ANNOUNCE
Definition: ulduar.cpp:56
@ NPC_TEXT_CONFIRM
Definition: ulduar.cpp:52
@ SAY_KEEPER_CHOSEN_TO_PLAYER
Definition: ulduar.cpp:55
@ GOSSIP_MENU_CONFIRM
Definition: ulduar.cpp:51
@ ACTION_KEEPER_OUTRO
Definition: ulduar.cpp:61
virtual void DoAction(int32)
Definition: UnitAI.h:212
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
CreatureAI * AI() const
Definition: Creature.h:143
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:696

References ACTION_KEEPER_OUTRO, AddGossipItemFor(), Creature::AI(), ClearGossipMenuFor(), CloseGossipMenuFor(), UnitAI::DoAction(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_CONFIRM, GOSSIP_SENDER_MAIN, NPC_TEXT_CONFIRM, Unit::RemoveNpcFlag(), SAY_KEEPER_CHOSEN_ANNOUNCE, SAY_KEEPER_CHOSEN_TO_PLAYER, SendGossipMenuFor(), CreatureAI::Talk(), and UNIT_NPC_FLAG_GOSSIP.