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

Classes

struct  npc_arthasAI
 

Public Member Functions

 npc_arthas ()
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) 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_arthas()

npc_arthas::npc_arthas ( )
inline
286: CreatureScript("npc_arthas") { }
Definition: CreatureScript.h:25

Referenced by AddSC_culling_of_stratholme().

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

366 {
367 return GetCullingOfStratholmeAI<npc_arthasAI>(creature);
368 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

334 {
335 InstanceScript* pInstance = creature->GetInstanceScript();
336 if (!pInstance)
337 return false;
338
339 switch (pInstance->GetData(DATA_ARTHAS_EVENT))
340 {
343 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_1, creature->GetGUID());
344 break;
347 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_2, creature->GetGUID());
348 break;
351 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_4, creature->GetGUID());
352 break;
355 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_5, creature->GetGUID());
356 break;
359 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_6, creature->GetGUID());
360 break;
361 }
362 return true;
363 }
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
@ COS_PROGRESS_REACHED_TOWN_HALL
Definition: culling_of_stratholme.h:132
@ COS_PROGRESS_KILLED_EPOCH
Definition: culling_of_stratholme.h:133
@ COS_PROGRESS_LAST_CITY
Definition: culling_of_stratholme.h:134
@ COS_PROGRESS_FINISHED_INTRO
Definition: culling_of_stratholme.h:128
@ COS_PROGRESS_BEFORE_MALGANIS
Definition: culling_of_stratholme.h:135
@ DATA_ARTHAS_EVENT
Definition: culling_of_stratholme.h:28
@ GOSSIP_MENU_ARTHAS_1
Definition: culling_of_stratholme.cpp:155
@ GOSSIP_MENU_ARTHAS_2
Definition: culling_of_stratholme.cpp:156
@ GOSSIP_MENU_ARTHAS_5
Definition: culling_of_stratholme.cpp:159
@ GOSSIP_MENU_ARTHAS_6
Definition: culling_of_stratholme.cpp:160
@ GOSSIP_MENU_ARTHAS_4
Definition: culling_of_stratholme.cpp:158
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: InstanceScript.h:142
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52

References AddGossipItemFor(), COS_PROGRESS_BEFORE_MALGANIS, COS_PROGRESS_FINISHED_INTRO, COS_PROGRESS_KILLED_EPOCH, COS_PROGRESS_LAST_CITY, COS_PROGRESS_REACHED_TOWN_HALL, DATA_ARTHAS_EVENT, ZoneScript::GetData(), Object::GetGUID(), WorldObject::GetInstanceScript(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_ARTHAS_1, GOSSIP_MENU_ARTHAS_2, GOSSIP_MENU_ARTHAS_4, GOSSIP_MENU_ARTHAS_5, GOSSIP_MENU_ARTHAS_6, GOSSIP_SENDER_MAIN, and SendGossipMenuFor().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

289 {
290 if (creature->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP))
291 {
292 switch (action)
293 {
295 creature->AI()->DoAction(ACTION_START_CITY);
297 CloseGossipMenuFor(player);
298 break;
300 ClearGossipMenuFor(player);
302 SendGossipMenuFor(player, GOSSIP_MENU_ARTHAS_3, creature->GetGUID());
303 break;
305 // Start Town Hall part
306 creature->AI()->DoAction(ACTION_START_TOWN_HALL);
308 CloseGossipMenuFor(player);
309 break;
311 // After killing epoch
314 creature->SetTarget();
315 CloseGossipMenuFor(player);
316 break;
318 creature->AI()->DoAction(ACTION_START_LAST_CITY);
320 CloseGossipMenuFor(player);
321 break;
323 creature->AI()->DoAction(ACTION_START_MALGANIS);
325 CloseGossipMenuFor(player);
326 break;
327 }
328 }
329
330 return true;
331 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ ACTION_START_CITY
Definition: culling_of_stratholme.h:142
@ ACTION_START_LAST_CITY
Definition: culling_of_stratholme.h:146
@ ACTION_START_TOWN_HALL
Definition: culling_of_stratholme.h:144
@ ACTION_START_SECRET_PASSAGE
Definition: culling_of_stratholme.h:145
@ ACTION_START_MALGANIS
Definition: culling_of_stratholme.h:148
@ GOSSIP_MENU_ARTHAS_3
Definition: culling_of_stratholme.cpp:157
virtual void DoAction(int32)
Definition: UnitAI.h:212
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3532
CreatureAI * AI() const
Definition: Creature.h:143
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:696
bool HasNpcFlag(NPCFlags flags) const
Definition: Unit.h:694

References ACTION_START_CITY, ACTION_START_LAST_CITY, ACTION_START_MALGANIS, ACTION_START_SECRET_PASSAGE, ACTION_START_TOWN_HALL, AddGossipItemFor(), Creature::AI(), ClearGossipMenuFor(), CloseGossipMenuFor(), UnitAI::DoAction(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_ARTHAS_3, GOSSIP_SENDER_MAIN, Unit::HasNpcFlag(), Unit::RemoveNpcFlag(), SendGossipMenuFor(), Creature::SetTarget(), and UNIT_NPC_FLAG_GOSSIP.