AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_rocknot Class Reference
Inheritance diagram for npc_rocknot:
CreatureScript ScriptObject UpdatableScript< Creature >

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
bool IsDatabaseBound () const override
 
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 bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
uint16 GetTotalAvailableHooks ()
 
- 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 ScriptObject
 ScriptObject (const char *name, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_rocknot()

npc_rocknot::npc_rocknot ( )
inline
581: CreatureScript("npc_rocknot") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

614 {
615 return GetBlackrockDepthsAI<npc_rocknotAI>(creature);
616 }

◆ OnQuestReward()

bool npc_rocknot::OnQuestReward ( Player ,
Creature creature,
Quest const *  quest,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureScript.

584 {
585 InstanceScript* instance = creature->GetInstanceScript();
586 if (!instance)
587 return true;
588
589 if (instance->GetData(TYPE_BAR) == DONE || instance->GetData(TYPE_BAR) == SPECIAL)
590 return true;
591
592 if (quest->GetQuestId() == QUEST_ALE)
593 {
594 if (instance->GetData(TYPE_BAR) != IN_PROGRESS)
595 instance->SetData(TYPE_BAR, IN_PROGRESS);
596
597 instance->SetData(TYPE_BAR, SPECIAL);
598
599 //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress
600 if (instance->GetData(TYPE_BAR) == SPECIAL)
601 {
602 creature->AI()->Talk(SAY_GOT_BEER);
603 creature->CastSpell(creature, SPELL_DRUNKEN_RAGE, false);
604
605 if (npc_escortAI* escortAI = CAST_AI(npc_rocknot::npc_rocknotAI, creature->AI()))
606 escortAI->Start(false, false);
607 }
608 }
609
610 return true;
611 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ SPECIAL
Definition: InstanceScript.h:61
#define CAST_AI(a, b)
Definition: UnitAI.h:26
@ TYPE_BAR
Definition: blackrock_depths.h:42
@ SAY_GOT_BEER
Definition: blackrock_depths.cpp:565
@ QUEST_ALE
Definition: blackrock_depths.cpp:575
@ SPELL_DRUNKEN_RAGE
Definition: blackrock_depths.cpp:570
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
Definition: ScriptedEscortAI.h:53
CreatureAI * AI() const
Definition: Creature.h:143
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
Definition: InstanceScript.h:142
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
Definition: blackrock_depths.cpp:619

References Creature::AI(), CAST_AI, Unit::CastSpell(), DONE, ZoneScript::GetData(), WorldObject::GetInstanceScript(), Quest::GetQuestId(), IN_PROGRESS, QUEST_ALE, SAY_GOT_BEER, ZoneScript::SetData(), SPECIAL, SPELL_DRUNKEN_RAGE, CreatureAI::Talk(), and TYPE_BAR.