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

Classes

struct  npc_disciple_of_naralexAI
 

Public Member Functions

 npc_disciple_of_naralex ()
 
CreatureAIGetAI (Creature *creature) const override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
bool OnGossipHello (Player *player, Creature *creature) 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_disciple_of_naralex::npc_disciple_of_naralex ( )
inline
80 : CreatureScript("npc_disciple_of_naralex") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

83  {
84  return GetInstanceAI<npc_disciple_of_naralexAI>(creature);
85  }
bool npc_disciple_of_naralex::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

110  {
111  InstanceScript* instance = creature->GetInstanceScript();
112 
113  if (instance)
114  {
115  creature->CastSpell(player, SPELL_MARK_OF_THE_WILD_RANK_2, true);
116  if ((instance->GetData(TYPE_LORD_COBRAHN) == DONE) && (instance->GetData(TYPE_LORD_PYTHAS) == DONE) &&
117  (instance->GetData(TYPE_LADY_ANACONDRA) == DONE) && (instance->GetData(TYPE_LORD_SERPENTIS) == DONE))
118  {
119  player->ADD_GOSSIP_ITEM_DB(GOSSIP_OPTION_LET_EVENT_BEGIN, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
120  player->SEND_GOSSIP_MENU(NPC_TEXT_FANGLORDS_ARE_DEAD, creature->GetGUID());
121 
122  if (!instance->GetData(TYPE_NARALEX_YELLED))
123  {
124  creature->AI()->Talk(SAY_AT_LAST);
125  instance->SetData(TYPE_NARALEX_YELLED, 1);
126  }
127  }
128  else
129  {
130  player->SEND_GOSSIP_MENU(NPC_TEXT_NARALEX_SLEEPS_AGAIN, creature->GetGUID());
131  }
132  }
133  return true;
134  }
Definition: ScriptedGossip.h:71
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: inflate.h:49
Definition: wailing_caverns.cpp:62
Definition: wailing_caverns.h:27
Definition: wailing_caverns.h:35
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: wailing_caverns.cpp:42
CreatureAI * AI() const
Definition: Creature.h:525
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: wailing_caverns.cpp:65
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: wailing_caverns.h:26
Definition: InstanceScript.h:141
Definition: wailing_caverns.h:28
Definition: wailing_caverns.cpp:63
Definition: wailing_caverns.h:29
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: wailing_caverns.cpp:61

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

88  {
89  player->PlayerTalkClass->ClearMenus();
90  InstanceScript* instance = creature->GetInstanceScript();
91  if (action == GOSSIP_ACTION_INFO_DEF + 1)
92  {
93  player->CLOSE_GOSSIP_MENU();
94  if (instance)
96 
97  creature->AI()->Talk(SAY_MAKE_PREPARATIONS);
98 
99  creature->setFaction(250);
101 
102  ENSURE_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID());
103  ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
104  ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
105  }
106  return true;
107  }
Definition: ScriptedEscortAI.h:52
Definition: ScriptedGossip.h:71
Definition: wailing_caverns.cpp:43
Definition: wailing_caverns.h:30
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: Unit.h:681
void setFaction(uint32 faction)
Definition: Unit.h:1467
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
CreatureAI * AI() const
Definition: Creature.h:525
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:109
Definition: InstanceScript.h:141

+ Here is the call graph for this function:


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