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

Classes

struct  npc_finklesteinAI
 

Public Member Functions

 npc_finklestein ()
 
bool OnQuestAccept (Player *player, Creature *creature, Quest const *quest) override
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 uiAction) 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_finklestein()

npc_finklestein::npc_finklestein ( )
inline
47: CreatureScript("npc_finklestein") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

216 {
217 return new npc_finklesteinAI(creature);
218 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

184 {
185 if (creature->IsQuestGiver())
186 player->PrepareQuestMenu(creature->GetGUID());
187
188 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
189
191 {
192 if (creature->AI() && CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI()))
193 if (!CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI())->IsPlayerOnTask(player->GetGUID()))
194 AddGossipItemFor(player, GOSSIP_ICON_CHAT, "I'm ready to begin. What is the first ingredient you require?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
195
196 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
197 }
198
199 return true;
200 }
@ QUEST_ALCHEMIST_APPRENTICE
Definition: zone_zuldrak.cpp:31
#define CAST_AI(a, b)
Definition: UnitAI.h:26
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
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_ICON_CHAT
Definition: GossipDef.h:60
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
CreatureAI * AI() const
Definition: Creature.h:142
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1424
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762
Definition: zone_zuldrak.cpp:50

References AddGossipItemFor(), Creature::AI(), CAST_AI, Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_ALCHEMIST_APPRENTICE, QUEST_STATUS_INCOMPLETE, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

203 {
204 CloseGossipMenuFor(player);
205 if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
206 {
207 CloseGossipMenuFor(player);
208 if (creature->AI() && CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI()))
209 CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI())->StartNextTask(player->GetGUID(), 1);
210 }
211
212 return true;
213 }
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56

References Creature::AI(), CAST_AI, CloseGossipMenuFor(), Object::GetGUID(), and GOSSIP_ACTION_INFO_DEF.

◆ OnQuestAccept()

bool npc_finklestein::OnQuestAccept ( Player player,
Creature creature,
Quest const *  quest 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

175 {
176 if (quest->GetQuestId() == QUEST_ALCHEMIST_APPRENTICE)
177 if (creature->AI() && CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI()))
178 CAST_AI(npc_finklestein::npc_finklesteinAI, creature->AI())->ClearPlayerOnTask(player->GetGUID());
179
180 return true;
181 }

References Creature::AI(), CAST_AI, Object::GetGUID(), Quest::GetQuestId(), and QUEST_ALCHEMIST_APPRENTICE.