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

Public Member Functions

 npc_steward_of_time ()
 
bool OnQuestAccept (Player *player, Creature *, Quest const *quest) override
 
bool OnGossipSelect (Player *player, Creature *, uint32, uint32 action) 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_steward_of_time()

npc_steward_of_time::npc_steward_of_time ( )
inline
290: CreatureScript("npc_steward_of_time") { }
Definition: ScriptMgr.h:718

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

310 {
311 if (creature->IsQuestGiver())
312 {
313 player->PrepareQuestMenu(creature->GetGUID());
314 }
315
316 if (player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279))
317 {
319 SendGossipMenuFor(player, 9978, creature->GetGUID());
320 }
321 else
322 {
323 SendGossipMenuFor(player, 9977, creature->GetGUID());
324 }
325
326 return true;
327 }
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
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1392
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:38
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1407
bool IsQuestGiver() const
Definition: Unit.h:1689

References AddGossipItemFor(), Object::GetGUID(), Player::GetQuestRewardStatus(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_STATUS_INCOMPLETE, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_steward_of_time::OnGossipSelect ( Player player,
Creature ,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

301 {
302 ClearGossipMenuFor(player);
303 if (action == GOSSIP_ACTION_INFO_DEF + 1)
304 player->CastSpell(player, 34891, true); //(Flight through Caverns)
305
306 return true;
307 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1428

References Unit::CastSpell(), ClearGossipMenuFor(), and GOSSIP_ACTION_INFO_DEF.

◆ OnQuestAccept()

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

Reimplemented from CreatureScript.

293 {
294 if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair
295 player->CastSpell(player, 34891, true); //(Flight through Caverns)
296
297 return false;
298 }

References Unit::CastSpell(), and Quest::GetQuestId().