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

Classes

struct  npc_thrall_old_hillsbradAI
 

Public Member Functions

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

Member Function Documentation

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

Reimplemented from CreatureScript.

189  {
190  return GetInstanceAI<npc_thrall_old_hillsbradAI>(creature);
191  }
bool npc_thrall_old_hillsbrad::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

244  {
245  if (creature->IsQuestGiver())
246  {
247  player->PrepareQuestMenu(creature->GetGUID());
248  player->SendPreparedQuest(creature->GetGUID());
249  }
250 
251  InstanceScript* instance = creature->GetInstanceScript();
252  if (instance)
253  {
254  if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE && !instance->GetData(TYPE_THRALL_EVENT))
255  {
257  player->SEND_GOSSIP_MENU(GOSSIP_ID_START, creature->GetGUID());
258  }
259 
260  if (instance->GetData(TYPE_THRALL_PART1) == DONE && !instance->GetData(TYPE_THRALL_PART2))
261  {
263  player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, creature->GetGUID());
264  }
265 
266  if (instance->GetData(TYPE_THRALL_PART2) == DONE && !instance->GetData(TYPE_THRALL_PART3))
267  {
269  player->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, creature->GetGUID());
270  }
271  }
272  return true;
273  }
Definition: old_hillsbrad.h:27
Definition: ScriptedGossip.h:71
Definition: old_hillsbrad.cpp:166
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
#define GOSSIP_ITEM_TARREN
Definition: old_hillsbrad.cpp:180
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: old_hillsbrad.h:30
Definition: inflate.h:49
Definition: old_hillsbrad.cpp:169
#define GOSSIP_ITEM_SKARLOC1
Definition: old_hillsbrad.cpp:178
bool IsQuestGiver() const
Definition: Unit.h:1566
Definition: old_hillsbrad.cpp:165
#define GOSSIP_ITEM_WALKING
Definition: old_hillsbrad.cpp:181
Definition: ScriptedGossip.h:73
Definition: old_hillsbrad.h:26
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: GossipDef.h:59
Definition: InstanceScript.h:141
Definition: old_hillsbrad.h:28
Definition: old_hillsbrad.h:29

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

194  {
195  player->PlayerTalkClass->ClearMenus();
196  InstanceScript* instance = creature->GetInstanceScript();
197  switch (action)
198  {
199  case GOSSIP_ACTION_INFO_DEF+1:
200  player->CLOSE_GOSSIP_MENU();
201  if (instance)
202  {
205  }
206 
207  creature->AI()->Talk(SAY_TH_START_EVENT_PART1);
208 
210  pEscortAI->Start(true, true, player->GetGUID());
211 
212  ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
213  ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
214  ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
215  break;
216 
217  case GOSSIP_ACTION_INFO_DEF+2:
219  player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, creature->GetGUID());
220  break;
221 
222  case GOSSIP_ACTION_INFO_DEF+20:
223  player->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, creature->GetGUID());
224  creature->SummonCreature(SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN, 12000);
225  if (instance)
227 
228  creature->AI()->Talk(SAY_TH_START_EVENT_PART2);
229 
231  break;
232 
233  case GOSSIP_ACTION_INFO_DEF+3:
234  player->CLOSE_GOSSIP_MENU();
235  if (instance)
238  break;
239  }
240  return true;
241  }
Definition: old_hillsbrad.cpp:160
Definition: old_hillsbrad.h:27
Definition: ScriptedEscortAI.h:52
Definition: ScriptedGossip.h:71
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
#define GOSSIP_ITEM_SKARLOC2
Definition: old_hillsbrad.cpp:179
Definition: old_hillsbrad.h:30
Definition: old_hillsbrad.cpp:104
#define ENSURE_AI(a, b)
Definition: ScriptedCreature.h:29
Definition: InstanceScript.h:59
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
Definition: Object.h:56
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
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: old_hillsbrad.cpp:167
Definition: GossipDef.h:59
Definition: old_hillsbrad.cpp:108
Definition: InstanceScript.h:141
Definition: old_hillsbrad.h:28
Definition: old_hillsbrad.h:29
Definition: old_hillsbrad.cpp:168
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:


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