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


struct  npc_giltharesAI

Public Member Functions

 npc_gilthares ()
bool OnQuestAccept (Player *player, Creature *creature, const Quest *quest) 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
- 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)
virtual ~ScriptObject ()=default
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default

Detailed Description

Constructor & Destructor Documentation

◆ npc_gilthares()

npc_gilthares::npc_gilthares ( )
63: CreatureScript("npc_gilthares") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_gilthares::GetAI ( Creature creature) const

Reimplemented from CreatureScript.

81 {
82 return new npc_giltharesAI(creature);
83 }

◆ OnQuestAccept()

bool npc_gilthares::OnQuestAccept ( Player player,
Creature creature,
const Quest quest 

Reimplemented from CreatureScript.

66 {
67 if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD)
68 {
69 creature->SetFaction(FACTION_ESCORTEE_H_NEUTRAL_ACTIVE); //guessed, possible not needed for this quest
72 creature->AI()->Talk(SAY_GIL_START, player);
74 if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI()))
75 pEscortAI->Start(false, false, player->GetGUID(), quest);
76 }
77 return true;
78 }
#define CAST_AI(a, b)
Definition: ScriptedCreature.h:28
Definition: Unit.h:53
Definition: zone_the_barrens.cpp:56
Definition: zone_the_barrens.cpp:47
Definition: SharedDefines.h:215
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:49
CreatureAI * AI() const
Definition: Creature.h:136
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
void SetStandState(uint8 state)
Definition: Unit.cpp:16994
uint32 GetQuestId() const
Definition: QuestDef.h:225
Definition: zone_the_barrens.cpp:86

References Creature::AI(), CAST_AI, FACTION_ESCORTEE_H_NEUTRAL_ACTIVE, Object::GetGUID(), Quest::GetQuestId(), QUEST_FREE_FROM_HOLD, SAY_GIL_START, Unit::SetFaction(), Unit::SetStandState(), CreatureAI::Talk(), and UNIT_STAND_STATE_STAND.