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

Classes

struct  npc_death_knight_initiateAI
 

Public Member Functions

 npc_death_knight_initiate ()
 
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_death_knight_initiate::npc_death_knight_initiate ( )
inline
478 : CreatureScript("npc_death_knight_initiate") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

626  {
627  return new npc_death_knight_initiateAI(creature);
628  }
bool npc_death_knight_initiate::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

506  {
507  if (player->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && creature->IsFullHealth())
508  {
509  if (player->HealthBelowPct(10))
510  return true;
511 
512  if (player->IsInCombat() || creature->IsInCombat())
513  return true;
514 
515  player->ADD_GOSSIP_ITEM_DB(Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
516  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
517  }
518  return true;
519  }
Definition: ScriptedGossip.h:71
bool IsInCombat() const
Definition: Unit.h:1584
bool IsFullHealth() const
Definition: Unit.h:1429
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: QuestDef.h:113
Definition: chapter1.cpp:471

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

481  {
482  player->PlayerTalkClass->ClearMenus();
483  if (action == GOSSIP_ACTION_INFO_DEF)
484  {
485  player->CLOSE_GOSSIP_MENU();
486 
487  if (player->IsInCombat() || creature->IsInCombat())
488  return true;
489 
490  if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiate::npc_death_knight_initiateAI, creature->AI()))
491  {
492  if (pInitiateAI->m_bIsDuelInProgress)
493  return true;
494  }
495 
498 
499  player->CastSpell(creature, SPELL_DUEL, false);
500  player->CastSpell(player, SPELL_DUEL_FLAG, true);
501  }
502  return true;
503  }
Definition: chapter1.cpp:460
Definition: ScriptedGossip.h:71
bool IsInCombat() const
Definition: Unit.h:1584
Definition: Unit.h:681
Definition: Unit.h:688
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
Definition: chapter1.cpp:457
CreatureAI * AI() const
Definition: Creature.h:525
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:109

+ Here is the call graph for this function:


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