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

Public Member Functions

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

npc_mcmanus::npc_mcmanus ( )
inline
448: CreatureScript("npc_mcmanus") {}
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

451 {
452 if (!player)
453 return true;
454
455 if (creature->IsQuestGiver())
456 player->PrepareQuestMenu(creature->GetGUID());
457
460
461 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
462 return true;
463 }
@ QUEST_STILL_AT_IT
Definition: zone_sholazar_basin.cpp:273
@ GOSSIP_MANUS_MENU
Definition: zone_sholazar_basin.cpp:274
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:112
void PrepareQuestMenu(ObjectGuid guid)
Definition: PlayerQuest.cpp:39
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
bool IsQuestGiver() const
Definition: Unit.h:762

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

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

466 {
467 if (!player)
468 return true;
469
470 if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
471 {
472 Creature* trigger = creature->FindNearestCreature(NPC_WANTS_BANANAS, 20.0f, true);
473 if (trigger && trigger->AI())
475 {
476 CAST_AI(npc_still_at_it_trigger::npc_still_at_it_triggerAI, trigger->AI())->playerGUID = player->GetGUID();
477 CAST_AI(npc_still_at_it_trigger::npc_still_at_it_triggerAI, trigger->AI())->thunderbrewGUID = creature->GetGUID();
479 }
480 }
481
482 CloseGossipMenuFor(player);
483 return true;
484 }
@ NPC_WANTS_BANANAS
Definition: zone_sholazar_basin.cpp:271
#define CAST_AI(a, b)
Definition: UnitAI.h:26
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
Definition: Creature.h:43
CreatureAI * AI() const
Definition: Creature.h:140
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
Definition: zone_sholazar_basin.cpp:298

References Creature::AI(), CAST_AI, CloseGossipMenuFor(), WorldObject::FindNearestCreature(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, and NPC_WANTS_BANANAS.