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

Classes

struct  npc_captain_saeedAI
 

Public Member Functions

 npc_captain_saeed ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 uiAction) override
 
bool OnGossipHello (Player *player, Creature *creature) 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_captain_saeed()

npc_captain_saeed::npc_captain_saeed ( )
inline
61: CreatureScript("npc_captain_saeed") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

287 {
288 return new npc_captain_saeedAI(creature);
289 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

269 {
270 if (creature->IsQuestGiver())
271 player->PrepareQuestMenu(creature->GetGUID());
272
274 {
275 if (!creature->AI()->GetData(1))
277 else
279 }
280
282
283 return true;
284 }
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
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_DIMENSIUS_DEVOURING
Definition: zone_netherstorm.cpp:49
@ GOSSIP_MENU_SAEED
Definition: zone_netherstorm.cpp:53
@ TEXT_NPC_SAEED_DEFAULT
Definition: zone_netherstorm.cpp:54
@ TEXT_NPC_SAEED_START_FIGHT
Definition: zone_netherstorm.cpp:55
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
CreatureAI * AI() const
Definition: Creature.h:143
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
bool IsQuestGiver() const
Definition: Unit.h:718

References AddGossipItemFor(), Creature::AI(), UnitAI::GetData(), Object::GetGUID(), Player::GetQuestStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_SAEED, GOSSIP_SENDER_MAIN, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), QUEST_DIMENSIUS_DEVOURING, QUEST_STATUS_INCOMPLETE, SendGossipMenuFor(), TEXT_NPC_SAEED_DEFAULT, and TEXT_NPC_SAEED_START_FIGHT.

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

252 {
253 ClearGossipMenuFor(player);
254 if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
255 {
256 creature->AI()->SetGUID(player->GetGUID(), DATA_START_ENCOUNTER);
257 player->KilledMonsterCredit(creature->GetEntry());
258 }
259 else if (uiAction == GOSSIP_ACTION_INFO_DEF + 2)
260 {
261 creature->AI()->SetGUID(player->GetGUID(), DATA_START_FIGHT);
262 }
263
264 CloseGossipMenuFor(player);
265 return true;
266 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ DATA_START_FIGHT
Definition: zone_netherstorm.cpp:41
@ DATA_START_ENCOUNTER
Definition: zone_netherstorm.cpp:40
virtual void SetGUID(ObjectGuid, int32=0)
Definition: UnitAI.h:215
uint32 GetEntry() const
Definition: Object.h:112
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: PlayerQuest.cpp:1921

References Creature::AI(), ClearGossipMenuFor(), CloseGossipMenuFor(), DATA_START_ENCOUNTER, DATA_START_FIGHT, Object::GetEntry(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, Player::KilledMonsterCredit(), and UnitAI::SetGUID().