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

Classes

struct  npc_riggle_bassbaitAI
 

Public Member Functions

 npc_riggle_bassbait ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnQuestReward (Player *player, Creature *creature, Quest const *quest, uint32) override
 
CreatureAIGetAI (Creature *pCreature) 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
 
- 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_riggle_bassbait()

npc_riggle_bassbait::npc_riggle_bassbait ( )
inline
218: CreatureScript("npc_riggle_bassbait") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_riggle_bassbait::GetAI ( Creature pCreature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

318 {
319 return new npc_riggle_bassbaitAI (pCreature);
320 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

288 {
289 if (creature->IsQuestGiver())
290 {
291 player->PrepareQuestMenu(creature->GetGUID());
292 }
293
294 if (sWorld->getWorldState(STV_FISHING_HAS_WINNER))
295 {
296 SendGossipMenuFor(player, GOSSIP_EVENT_OVER, creature->GetGUID());
297 }
298 else
299 {
300 SendGossipMenuFor(player, GOSSIP_EVENT_ACTIVE, creature->GetGUID());
301 }
302 return true;
303 }
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
@ GOSSIP_EVENT_ACTIVE
Definition: npcs_special.cpp:211
@ GOSSIP_EVENT_OVER
Definition: npcs_special.cpp:212
@ STV_FISHING_HAS_WINNER
Definition: npcs_special.cpp:195
#define sWorld
Definition: World.h:447
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
bool IsQuestGiver() const
Definition: Unit.h:1667

References Object::GetGUID(), GOSSIP_EVENT_ACTIVE, GOSSIP_EVENT_OVER, Unit::IsQuestGiver(), Player::PrepareQuestMenu(), SendGossipMenuFor(), STV_FISHING_HAS_WINNER, and sWorld.

◆ OnQuestReward()

bool npc_riggle_bassbait::OnQuestReward ( Player player,
Creature creature,
Quest const *  quest,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

306 {
307 if (quest->GetQuestId() == QUEST_MASTER_ANGLER)
308 {
310 creature->AI()->Talk(RIGGLE_SAY_WINNER, player);
311 sWorld->setWorldState(STV_FISHING_PREV_WIN_TIME, GameTime::GetGameTime().count());
312 sWorld->setWorldState(STV_FISHING_HAS_WINNER, 1);
313 }
314 return true;
315 }
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: Unit.h:517
@ RIGGLE_SAY_WINNER
Definition: npcs_special.cpp:204
@ QUEST_MASTER_ANGLER
Definition: npcs_special.cpp:206
@ STV_FISHING_PREV_WIN_TIME
Definition: npcs_special.cpp:194
Seconds GetGameTime()
Definition: GameTime.cpp:38
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:49
CreatureAI * AI() const
Definition: Creature.h:136
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:1662

References Creature::AI(), GameTime::GetGameTime(), Quest::GetQuestId(), QUEST_MASTER_ANGLER, Unit::RemoveNpcFlag(), RIGGLE_SAY_WINNER, STV_FISHING_HAS_WINNER, STV_FISHING_PREV_WIN_TIME, sWorld, CreatureAI::Talk(), and UNIT_NPC_FLAG_QUESTGIVER.