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

Classes

struct  npc_fos_leaderAI
 

Public Member Functions

 npc_fos_leader ()
 
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_fos_leader()

npc_fos_leader::npc_fos_leader ( )
inline
57: CreatureScript("npc_fos_leader") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

222 {
223 return GetForgeOfSoulsAI<npc_fos_leaderAI>(creature);
224 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

190 {
191 if (creature->IsQuestGiver())
192 player->PrepareQuestMenu(creature->GetGUID());
193
194 if (creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
195 {
196 if (creature->GetEntry() == NPC_JAINA_PART1)
198 else
200 }
201
202 SendGossipMenuFor(player, 15207, creature->GetGUID());
203 return true;
204 }
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
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ NPC_JAINA_PART1
Definition: forge_of_souls.h:42
@ GOSSIP_SYLVANAS_INTRO
Definition: forge_of_souls.cpp:51
@ GOSSIP_JAINA_INTRO
Definition: forge_of_souls.cpp:50
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
bool IsQuestGiver() const
Definition: Unit.h:718
bool HasNpcFlag(NPCFlags flags) const
Definition: Unit.h:694

References AddGossipItemFor(), Object::GetEntry(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_JAINA_INTRO, GOSSIP_SENDER_MAIN, GOSSIP_SYLVANAS_INTRO, Unit::HasNpcFlag(), Unit::IsQuestGiver(), NPC_JAINA_PART1, Player::PrepareQuestMenu(), SendGossipMenuFor(), and UNIT_NPC_FLAG_GOSSIP.

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

207 {
208 ClearGossipMenuFor(player);
209 switch (uiAction)
210 {
212 CloseGossipMenuFor(player);
213 if (creature->AI())
214 creature->AI()->DoAction(1);
215 break;
216 }
217
218 return true;
219 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
virtual void DoAction(int32)
Definition: UnitAI.h:212
CreatureAI * AI() const
Definition: Creature.h:143

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