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

Classes

struct  npc_rocknotAI
 

Public Member Functions

 npc_rocknot ()
 
bool OnQuestReward (Player *, Creature *creature, Quest const *quest, uint32) override
 
CreatureAIGetAI (Creature *creature) const override
 
- Public Member Functions inherited from CreatureScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 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_rocknot::npc_rocknot ( )
inline
639 : CreatureScript("npc_rocknot") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

672  {
673  return GetInstanceAI<npc_rocknotAI>(creature);
674  }
bool npc_rocknot::OnQuestReward ( Player ,
Creature creature,
Quest const quest,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

642  {
643  InstanceScript* instance = creature->GetInstanceScript();
644  if (!instance)
645  return true;
646 
647  if (instance->GetData(TYPE_BAR) == DONE || instance->GetData(TYPE_BAR) == SPECIAL)
648  return true;
649 
650  if (quest->GetQuestId() == QUEST_ALE)
651  {
652  if (instance->GetData(TYPE_BAR) != IN_PROGRESS)
653  instance->SetData(TYPE_BAR, IN_PROGRESS);
654 
655  instance->SetData(TYPE_BAR, SPECIAL);
656 
657  //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
658  if (instance->GetData(TYPE_BAR) == SPECIAL)
659  {
660  creature->AI()->Talk(SAY_GOT_BEER);
661  creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
662 
663  if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
664  escortAI->Start(false, false);
665  }
666  }
667 
668  return true;
669  }
Definition: ScriptedEscortAI.h:52
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
Definition: blackrock_depths.cpp:676
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Definition: inflate.h:49
Definition: InstanceScript.h:59
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
CreatureAI * AI() const
Definition: Creature.h:525
Definition: InstanceScript.h:62
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: blackrock_depths.cpp:633
Definition: blackrock_depths.cpp:628
Definition: blackrock_depths.h:35
Definition: InstanceScript.h:141
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: blackrock_depths.cpp:623

+ Here is the call graph for this function:


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