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

Classes

struct  npc_barnesAI
 

Public Member Functions

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

npc_barnes::npc_barnes ( )
inline
135: CreatureScript("npc_barnes") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

372 {
373 return GetKarazhanAI<npc_barnesAI>(creature);
374 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

339 {
340 if (InstanceScript* instance = creature->GetInstanceScript())
341 {
342 // Check for death of Moroes and if opera event is not done already
343 if (instance->GetBossState(DATA_MOROES) == DONE && instance->GetBossState(DATA_OPERA_PERFORMANCE) != DONE)
344 {
346
347 if (player->IsGameMaster())
348 {
352 }
353
354 if (instance->GetBossState(DATA_OPERA_PERFORMANCE) != FAIL)
355 {
356 SendGossipMenuFor(player, BARNES_TEXT_IS_READY, creature->GetGUID());
357 }
358 else
359 {
360 SendGossipMenuFor(player, BARNES_TEXT_WIPED, creature->GetGUID());
361 }
362
363 return true;
364 }
365 }
366
367 SendGossipMenuFor(player, BARNES_TEXT_NOT_READY, creature->GetGUID());
368 return true;
369 }
#define OZ_GM_GOSSIP2
Definition: karazhan.cpp:84
@ OZ_GOSSIP1_OID
Definition: karazhan.cpp:70
@ OZ_GOSSIP1_MID
Definition: karazhan.cpp:69
@ BARNES_TEXT_WIPED
Definition: karazhan.cpp:80
@ BARNES_TEXT_IS_READY
Definition: karazhan.cpp:78
@ BARNES_TEXT_NOT_READY
Definition: karazhan.cpp:77
#define OZ_GM_GOSSIP3
Definition: karazhan.cpp:85
#define OZ_GM_GOSSIP1
Definition: karazhan.cpp:83
@ DATA_MOROES
Definition: karazhan.h:31
@ DATA_OPERA_PERFORMANCE
Definition: karazhan.h:34
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
@ FAIL
Definition: InstanceScript.h:59
@ DONE
Definition: InstanceScript.h:60
@ GOSSIP_ICON_DOT
Definition: GossipDef.h:71
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
bool IsGameMaster() const
Definition: Player.h:1175
Definition: InstanceScript.h:142

References AddGossipItemFor(), BARNES_TEXT_IS_READY, BARNES_TEXT_NOT_READY, BARNES_TEXT_WIPED, DATA_MOROES, DATA_OPERA_PERFORMANCE, DONE, FAIL, Object::GetGUID(), WorldObject::GetInstanceScript(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_DOT, GOSSIP_SENDER_MAIN, Player::IsGameMaster(), OZ_GM_GOSSIP1, OZ_GM_GOSSIP2, OZ_GM_GOSSIP3, OZ_GOSSIP1_MID, OZ_GOSSIP1_OID, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

307 {
308 ClearGossipMenuFor(player);
309 npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI());
310
311 switch (action)
312 {
315 SendGossipMenuFor(player, BARNES_TEXT_IS_READY2, creature->GetGUID());
316 break;
318 CloseGossipMenuFor(player);
319 pBarnesAI->StartEvent();
320 break;
322 CloseGossipMenuFor(player);
323 pBarnesAI->m_uiEventId = EVENT_OZ;
324 break;
326 CloseGossipMenuFor(player);
327 pBarnesAI->m_uiEventId = EVENT_HOOD;
328 break;
330 CloseGossipMenuFor(player);
331 pBarnesAI->m_uiEventId = EVENT_RAJ;
332 break;
333 }
334
335 return true;
336 }
@ OZ_GOSSIP2_MID
Definition: karazhan.cpp:71
@ OZ_GOSSIP2_OID
Definition: karazhan.cpp:72
@ BARNES_TEXT_IS_READY2
Definition: karazhan.cpp:79
@ EVENT_HOOD
Definition: karazhan.h:82
@ EVENT_OZ
Definition: karazhan.h:81
@ EVENT_RAJ
Definition: karazhan.h:83
#define CAST_AI(a, b)
Definition: UnitAI.h:26
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
CreatureAI * AI() const
Definition: Creature.h:140
Definition: karazhan.cpp:138

References AddGossipItemFor(), Creature::AI(), BARNES_TEXT_IS_READY2, CAST_AI, ClearGossipMenuFor(), CloseGossipMenuFor(), EVENT_HOOD, EVENT_OZ, EVENT_RAJ, Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_MAIN, npc_barnes::npc_barnesAI::m_uiEventId, OZ_GOSSIP2_MID, OZ_GOSSIP2_OID, SendGossipMenuFor(), and npc_barnes::npc_barnesAI::StartEvent().