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

Public Member Functions

 npc_announcer_toc10 ()
 
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_announcer_toc10()

npc_announcer_toc10::npc_announcer_toc10 ( )
inline
35: CreatureScript("npc_announcer_toc10") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

38 {
39 if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
40 return true;
41
42 InstanceScript* pInstance = creature->GetInstanceScript();
43 if (!pInstance)
44 return true;
45
46 uint32 gossipTextId = 0;
47 switch (pInstance->GetData(TYPE_INSTANCE_PROGRESS))
48 {
50 gossipTextId = MSG_TESTED;
51 break;
56 gossipTextId = MSG_NEXT_STAGE;
57 break;
59 gossipTextId = MSG_CRUSADERS;
60 break;
63 return true;
64 default:
65 return true;
66 }
67
69 SendGossipMenuFor(player, gossipTextId, creature->GetGUID());
70 return true;
71 }
std::uint32_t uint32
Definition: Define.h:107
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
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ GOSSIP_ICON_CHAT
Definition: GossipDef.h:60
@ MSG_CRUSADERS
Definition: trial_of_the_crusader.cpp:28
@ MSG_TESTED
Definition: trial_of_the_crusader.cpp:26
@ MSG_NEXT_STAGE
Definition: trial_of_the_crusader.cpp:27
@ INSTANCE_PROGRESS_INTRO_DONE
Definition: trial_of_the_crusader.h:53
@ INSTANCE_PROGRESS_BEASTS_DEAD
Definition: trial_of_the_crusader.h:54
@ INSTANCE_PROGRESS_DONE
Definition: trial_of_the_crusader.h:60
@ INSTANCE_PROGRESS_VALKYR_DEAD
Definition: trial_of_the_crusader.h:58
@ INSTANCE_PROGRESS_JARAXXUS_DEAD
Definition: trial_of_the_crusader.h:56
@ INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD
Definition: trial_of_the_crusader.h:57
@ TYPE_INSTANCE_PROGRESS
Definition: trial_of_the_crusader.h:31
@ INSTANCE_PROGRESS_INITIAL
Definition: trial_of_the_champion.h:52
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:696
bool HasNpcFlag(NPCFlags flags) const
Definition: Unit.h:694
Definition: InstanceScript.h:142
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52

References AddGossipItemFor(), ZoneScript::GetData(), Object::GetGUID(), WorldObject::GetInstanceScript(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ICON_CHAT, GOSSIP_SENDER_MAIN, Unit::HasNpcFlag(), INSTANCE_PROGRESS_BEASTS_DEAD, INSTANCE_PROGRESS_DONE, INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD, INSTANCE_PROGRESS_INITIAL, INSTANCE_PROGRESS_INTRO_DONE, INSTANCE_PROGRESS_JARAXXUS_DEAD, INSTANCE_PROGRESS_VALKYR_DEAD, MSG_CRUSADERS, MSG_NEXT_STAGE, MSG_TESTED, Unit::RemoveNpcFlag(), SendGossipMenuFor(), TYPE_INSTANCE_PROGRESS, and UNIT_NPC_FLAG_GOSSIP.

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

74 {
75 if (!creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
76 return true;
77
78 InstanceScript* pInstance = creature->GetInstanceScript();
79 if (!pInstance)
80 return true;
81
82 if (uiAction == GOSSIP_ACTION_INFO_DEF + 1337)
83 {
86 }
87
88 CloseGossipMenuFor(player);
89 return true;
90 }
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ TYPE_ANNOUNCER_GOSSIP_SELECT
Definition: trial_of_the_crusader.h:32
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References CloseGossipMenuFor(), WorldObject::GetInstanceScript(), GOSSIP_ACTION_INFO_DEF, Unit::HasNpcFlag(), Unit::RemoveNpcFlag(), ZoneScript::SetData(), TYPE_ANNOUNCER_GOSSIP_SELECT, and UNIT_NPC_FLAG_GOSSIP.