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


struct  npc_maghar_captiveAI

Public Member Functions

 npc_maghar_captive ()
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_maghar_captive()

npc_maghar_captive::npc_maghar_captive ( )
70: CreatureScript("npc_maghar_captive") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_maghar_captive::GetAI ( Creature creature) const

Reimplemented from CreatureScript.

92 {
93 return new npc_maghar_captiveAI(creature);
94 }

◆ OnQuestAccept()

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

Reimplemented from CreatureScript.

73 {
74 if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
75 {
76 if (npc_maghar_captiveAI* EscortAI = dynamic_cast<npc_maghar_captiveAI*>(creature->AI()))
77 {
80 EscortAI->Start(true, false, player->GetGUID(), quest);
81 creature->AI()->Talk(SAY_MAG_START);
86 }
87 }
88 return true;
89 }
Definition: Object.h:45
Definition: Unit.h:53
Definition: zone_nagrand.cpp:56
Definition: zone_nagrand.cpp:58
Definition: zone_nagrand.cpp:43
Definition: zone_nagrand.cpp:61
Definition: zone_nagrand.cpp:59
static float m_afAmbushA[]
Definition: zone_nagrand.cpp:64
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
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2343
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
void SetStandState(uint8 state)
Definition: Unit.cpp:16994
uint32 GetQuestId() const
Definition: QuestDef.h:225

References Creature::AI(), FACTION_ESCORTEE_H_NEUTRAL_ACTIVE, Object::GetGUID(), Quest::GetQuestId(), m_afAmbushA, NPC_MURK_BRUTE, NPC_MURK_PUTRIFIER, NPC_MURK_RAIDER, QUEST_TOTEM_KARDASH_H, SAY_MAG_START, Unit::SetFaction(), Unit::SetStandState(), WorldObject::SummonCreature(), CreatureAI::Talk(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, and UNIT_STAND_STATE_STAND.