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

Classes

struct  npc_adventurous_dwarfAI
 

Public Member Functions

 npc_adventurous_dwarf ()
 
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
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_adventurous_dwarf::npc_adventurous_dwarf ( )
inline
558 : CreatureScript("npc_adventurous_dwarf") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

569  {
570  return new npc_adventurous_dwarfAI(creature);
571  }
bool npc_adventurous_dwarf::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

574  {
575  if (player->GetQuestStatus(QUEST_12634) != QUEST_STATUS_INCOMPLETE)
576  return false;
577 
578  if (player->GetItemCount(ITEM_ORANGE) < 1)
580 
581  if (player->GetItemCount(ITEM_BANANAS) < 2)
583 
584  if (player->GetItemCount(ITEM_PAPAYA) < 1)
586 
587  player->PlayerTalkClass->SendGossipMenu(GOSSIP_MENU_DWARF, creature->GetGUID());
588  return true;
589  }
Definition: ScriptedGossip.h:71
#define GOSSIP_OPTION_BANANAS
Definition: zone_sholazar_basin.cpp:534
#define GOSSIP_OPTION_PAPAYA
Definition: zone_sholazar_basin.cpp:535
Definition: zone_sholazar_basin.cpp:539
Definition: zone_sholazar_basin.cpp:541
Definition: zone_sholazar_basin.cpp:549
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_OPTION_ORANGE
Definition: zone_sholazar_basin.cpp:533
Definition: GossipDef.h:59
Definition: QuestDef.h:113
Definition: zone_sholazar_basin.cpp:543
Definition: zone_sholazar_basin.cpp:542

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

592  {
593  player->PlayerTalkClass->ClearMenus();
594  uint32 spellId = 0;
595 
596  switch (action)
597  {
598  case GOSSIP_ACTION_INFO_DEF + 1:
599  spellId = SPELL_ADD_ORANGE;
600  break;
601  case GOSSIP_ACTION_INFO_DEF + 2:
602  spellId = SPELL_ADD_BANANAS;
603  break;
604  case GOSSIP_ACTION_INFO_DEF + 3:
605  spellId = SPELL_ADD_PAPAYA;
606  break;
607  }
608 
609  if (spellId)
610  player->CastSpell(player, spellId, true);
611 
612  creature->AI()->Talk(SAY_DWARF_HELP);
613  creature->DespawnOrUnsummon();
614  return true;
615  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Definition: ScriptedGossip.h:71
Definition: zone_sholazar_basin.cpp:552
Definition: zone_sholazar_basin.cpp:547
CreatureAI * AI() const
Definition: Creature.h:525
uint32_t uint32
Definition: Define.h:150
Definition: zone_sholazar_basin.cpp:546
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: zone_sholazar_basin.cpp:545

+ Here is the call graph for this function:


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