TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_barnes Class Reference

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
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
const std::string & GetName () const
 
- 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 UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npc_barnes::npc_barnes ( )
inline
127 : CreatureScript("npc_barnes") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

408  {
409  return GetInstanceAI<npc_barnesAI>(creature);
410  }
bool npc_barnes::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

376  {
377  if (InstanceScript* instance = creature->GetInstanceScript())
378  {
379  // Check for death of Moroes and if opera event is not done already
380  if (instance->GetData(TYPE_MOROES) == DONE && instance->GetData(TYPE_OPERA) != DONE)
381  {
383 
384  if (player->IsGameMaster())
385  {
389  }
390 
391  if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()))
392  {
393  if (!pBarnesAI->RaidWiped)
394  player->SEND_GOSSIP_MENU(8970, creature->GetGUID());
395  else
396  player->SEND_GOSSIP_MENU(8975, creature->GetGUID());
397 
398  return true;
399  }
400  }
401  }
402 
403  player->SEND_GOSSIP_MENU(8978, creature->GetGUID());
404  return true;
405  }
Definition: karazhan.h:30
Definition: ScriptedGossip.h:71
Definition: GossipDef.h:69
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: inflate.h:49
#define OZ_GOSSIP1
Definition: karazhan.cpp:68
#define OZ_GM_GOSSIP2
Definition: karazhan.cpp:76
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
CreatureAI * AI() const
Definition: Creature.h:525
#define OZ_GM_GOSSIP3
Definition: karazhan.cpp:77
#define OZ_GM_GOSSIP1
Definition: karazhan.cpp:75
Definition: karazhan.h:27
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: karazhan.cpp:129
Definition: GossipDef.h:59
Definition: InstanceScript.h:141

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

341  {
342  player->PlayerTalkClass->ClearMenus();
343  npc_barnesAI* pBarnesAI = ENSURE_AI(npc_barnes::npc_barnesAI, creature->AI());
344 
345  switch (action)
346  {
347  case GOSSIP_ACTION_INFO_DEF+1:
349  player->SEND_GOSSIP_MENU(8971, creature->GetGUID());
350  break;
351  case GOSSIP_ACTION_INFO_DEF+2:
352  player->CLOSE_GOSSIP_MENU();
353  pBarnesAI->StartEvent();
354  break;
355  case GOSSIP_ACTION_INFO_DEF+3:
356  player->CLOSE_GOSSIP_MENU();
357  pBarnesAI->m_uiEventId = EVENT_OZ;
358  TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
359  break;
360  case GOSSIP_ACTION_INFO_DEF+4:
361  player->CLOSE_GOSSIP_MENU();
362  pBarnesAI->m_uiEventId = EVENT_HOOD;
363  TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
364  break;
365  case GOSSIP_ACTION_INFO_DEF+5:
366  player->CLOSE_GOSSIP_MENU();
367  pBarnesAI->m_uiEventId = EVENT_RAJ;
368  TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
369  break;
370  }
371 
372  return true;
373  }
Definition: ScriptedGossip.h:71
Definition: karazhan.h:62
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: karazhan.h:63
CreatureAI * AI() const
Definition: Creature.h:525
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: karazhan.cpp:129
#define OZ_GOSSIP2
Definition: karazhan.cpp:70
Definition: GossipDef.h:59
Definition: karazhan.h:64

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: