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

Public Member Functions

 npc_grandmother ()
 
bool OnGossipSelect (Player *player, Creature *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
 
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_grandmother()

npc_grandmother::npc_grandmother ( )
inline
706: CreatureScript("npc_grandmother") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

733 {
735 SendGossipMenuFor(player, GRANDMOTHER_TEXT1, creature->GetGUID());
736
737 return true;
738 }
@ GRANDMOTHER_TEXT1
Definition: bosses_opera.cpp:699
@ GRANDMOTHER_GOSSIP_MENU1
Definition: bosses_opera.cpp:695
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
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112

References AddGossipItemFor(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_MAIN, GRANDMOTHER_GOSSIP_MENU1, GRANDMOTHER_TEXT1, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

709 {
710 ClearGossipMenuFor(player);
711
712 switch (action)
713 {
716 SendGossipMenuFor(player, GRANDMOTHER_TEXT2, creature->GetGUID());
717 break;
718 case GOSSIP_ACTION_INFO_DEF + 1:
720 SendGossipMenuFor(player, GRANDMOTHER_TEXT3, creature->GetGUID());
721 break;
722 case GOSSIP_ACTION_INFO_DEF + 2:
723 if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS))
724 {
725 pBigBadWolf->AI()->AttackStart(player);
726 }
727 creature->DespawnOrUnsummon();
728 }
729 return true;
730 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto HOUR
Definition: Common.h:48
@ GRANDMOTHER_TEXT3
Definition: bosses_opera.cpp:701
@ GRANDMOTHER_GOSSIP_MENU2
Definition: bosses_opera.cpp:696
@ CREATURE_BIG_BAD_WOLF
Definition: bosses_opera.cpp:693
@ GRANDMOTHER_TEXT2
Definition: bosses_opera.cpp:700
@ GRANDMOTHER_GOSSIP_MENU3
Definition: bosses_opera.cpp:697
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: Object.h:46
Definition: Creature.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366

References AddGossipItemFor(), ClearGossipMenuFor(), CREATURE_BIG_BAD_WOLF, Creature::DespawnOrUnsummon(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_SENDER_MAIN, GRANDMOTHER_GOSSIP_MENU2, GRANDMOTHER_GOSSIP_MENU3, GRANDMOTHER_TEXT2, GRANDMOTHER_TEXT3, HOUR, IN_MILLISECONDS, SendGossipMenuFor(), WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_OR_DEAD_DESPAWN.