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

Classes

struct  npc_nelsonAI
 

Public Member Functions

 npc_nelson ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32) 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
 
- 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)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_nelson()

npc_nelson::npc_nelson ( )
inline
840: CreatureScript("npc_nelson") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

843 {
844 return new npc_nelsonAI(creature);
845 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

1037 {
1039 {
1040 uint32 gossipMenuId = creature->GetCreatureTemplate()->GossipMenuId;
1042 }
1043
1044 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
1045
1046 return true;
1047 }
std::uint32_t uint32
Definition: Define.h:108
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
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ QUEST_STAVE_OF_THE_ANCIENTS
Definition: npc_stave_of_ancients.h:36
@ GOSSIP_EVENT_START_OPTION_ID
Definition: npc_stave_of_ancients.h:27
@ NELSON_HEAD
Definition: npc_stave_of_ancients.h:105
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:199
uint32 GossipMenuId
Definition: CreatureData.h:187
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:683
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1416
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:403

References AddGossipItemFor(), Creature::GetCreatureTemplate(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_EVENT_START_OPTION_ID, GOSSIP_SENDER_MAIN, CreatureTemplate::GossipMenuId, Player::HasItemCount(), NELSON_HEAD, QUEST_STATUS_INCOMPLETE, QUEST_STAVE_OF_THE_ANCIENTS, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

1029 {
1030 CloseGossipMenuFor(player);
1031 creature->AI()->DoAction(EVENT_ENCOUNTER_START);
1032
1033 return true;
1034 }
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ EVENT_ENCOUNTER_START
Definition: npc_stave_of_ancients.h:30
virtual void DoAction(int32)
Definition: UnitAI.h:201
CreatureAI * AI() const
Definition: Creature.h:136

References Creature::AI(), CloseGossipMenuFor(), UnitAI::DoAction(), and EVENT_ENCOUNTER_START.