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

Classes

struct  npc_franklinAI
 

Public Member Functions

 npc_franklin ()
 
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_franklin()

npc_franklin::npc_franklin ( )
inline
1053: CreatureScript("npc_franklin") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

1056 {
1057 return new npc_franklinAI(creature);
1058 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

1212 {
1214 {
1215 uint32 gossipMenuId = creature->GetCreatureTemplate()->GossipMenuId;
1217 }
1218
1219 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
1220
1221 return true;
1222 }
std::uint32_t uint32
Definition: Define.h:107
@ FRANKLIN_HEAD
Definition: npc_stave_of_ancients.h:126
@ QUEST_STAVE_OF_THE_ANCIENTS
Definition: npc_stave_of_ancients.h:35
@ GOSSIP_EVENT_START_OPTION_ID
Definition: npc_stave_of_ancients.h:26
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(), FRANKLIN_HEAD, Creature::GetCreatureTemplate(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_EVENT_START_OPTION_ID, GOSSIP_SENDER_MAIN, CreatureTemplate::GossipMenuId, Player::HasItemCount(), QUEST_STATUS_INCOMPLETE, QUEST_STAVE_OF_THE_ANCIENTS, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

1201 {
1202 CloseGossipMenuFor(player);
1203 if (creature->AI() && CAST_AI(npc_franklin::npc_franklinAI, creature->AI()))
1204 {
1205 CAST_AI(npc_franklin::npc_franklinAI, creature->AI())->ScheduleEncounterStart(player->GetGUID());
1206 }
1207
1208 return true;
1209 }
#define CAST_AI(a, b)
Definition: UnitAI.h:26
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
CreatureAI * AI() const
Definition: Creature.h:140
Definition: npc_stave_of_ancients.cpp:1061

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