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
 
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_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:107
@ QUEST_STAVE_OF_THE_ANCIENTS
Definition: npc_stave_of_ancients.h:35
@ GOSSIP_EVENT_START_OPTION_ID
Definition: npc_stave_of_ancients.h:26
@ NELSON_HEAD
Definition: npc_stave_of_ancients.h:104
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
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:205
uint32 GossipMenuId
Definition: CreatureData.h:194
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:655
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404

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 }
@ EVENT_ENCOUNTER_START
Definition: npc_stave_of_ancients.h:29
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
virtual void DoAction(int32)
Definition: UnitAI.h:212
CreatureAI * AI() const
Definition: Creature.h:140

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