TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_arthas Class Reference

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
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
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 UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npc_arthas::npc_arthas ( )
inline
255 : CreatureScript("npc_arthas") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

345  {
346  return GetInstanceAI<npc_arthasAI>(creature);
347  }
bool npc_arthas::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

301  {
302  npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
303 
304  if (ai && ai->bStepping == false)
305  {
306  switch (ai->gossipStep)
307  {
308  case 0: //This one is a workaround since the very beggining of the script is wrong.
309  {
310  QuestStatus status = player->GetQuestStatus(13149);
311  if (status != QUEST_STATUS_COMPLETE && status != QUEST_STATUS_REWARDED)
312  return false;
314  player->SEND_GOSSIP_MENU(907, creature->GetGUID());
315  break;
316  }
317  case 1:
319  player->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_1, creature->GetGUID());
320  break;
321  case 2:
323  player->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_2, creature->GetGUID());
324  break;
325  case 3:
327  player->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_3, creature->GetGUID());
328  break;
329  case 4:
331  player->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_4, creature->GetGUID());
332  break;
333  case 5:
335  player->SEND_GOSSIP_MENU(GOSSIP_MENU_ARTHAS_5, creature->GetGUID());
336  break;
337  default:
338  return false;
339  }
340  }
341  return true;
342  }
Definition: QuestDef.h:111
Definition: culling_of_stratholme.cpp:149
Definition: ScriptedGossip.h:71
QuestStatus
Definition: QuestDef.h:108
Definition: culling_of_stratholme.cpp:148
#define GOSSIP_ITEM_ARTHAS_4
Definition: culling_of_stratholme.cpp:249
Definition: QuestDef.h:116
#define GOSSIP_ITEM_ARTHAS_2
Definition: culling_of_stratholme.cpp:247
Definition: culling_of_stratholme.cpp:349
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
CreatureAI * AI() const
Definition: Creature.h:525
#define GOSSIP_ITEM_ARTHAS_0
Definition: culling_of_stratholme.cpp:245
Definition: ScriptedGossip.h:73
Definition: culling_of_stratholme.cpp:146
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define GOSSIP_ITEM_ARTHAS_1
Definition: culling_of_stratholme.cpp:246
#define GOSSIP_ITEM_ARTHAS_3
Definition: culling_of_stratholme.cpp:248
Definition: GossipDef.h:59
Definition: culling_of_stratholme.cpp:147
#define GOSSIP_ITEM_ARTHAS_5
Definition: culling_of_stratholme.cpp:250
Definition: culling_of_stratholme.cpp:145

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

258  {
259  player->PlayerTalkClass->ClearMenus();
260  npc_arthasAI* ai = CAST_AI(npc_arthas::npc_arthasAI, creature->AI());
261 
262  if (!ai)
263  return false;
264 
265  switch (action)
266  {
268  ai->Start(true, true, player->GetGUID(), 0, false, false);
269  ai->SetDespawnAtEnd(false);
270  ai->bStepping = false;
271  ai->step = 1;
272  break;
273  case GOSSIP_ACTION_INFO_DEF+1:
274  ai->bStepping = true;
275  ai->step = 24;
276  break;
277  case GOSSIP_ACTION_INFO_DEF+2:
278  ai->SetHoldState(false);
279  ai->bStepping = false;
280  ai->step = 61;
281  break;
282  case GOSSIP_ACTION_INFO_DEF+3:
283  ai->SetHoldState(false);
284  break;
285  case GOSSIP_ACTION_INFO_DEF+4:
286  ai->bStepping = true;
287  ai->step = 84;
288  break;
289  case GOSSIP_ACTION_INFO_DEF+5:
290  ai->bStepping = true;
291  ai->step = 85;
292  break;
293  }
294  player->CLOSE_GOSSIP_MENU();
295  ai->SetDespawnAtFar(false);
297  return true;
298  }
Definition: Unit.h:735
Definition: ScriptedGossip.h:71
Definition: culling_of_stratholme.cpp:349
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
CreatureAI * AI() const
Definition: Creature.h:525
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:135

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: