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

Classes

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

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

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

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

◆ OnQuestAccept()

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

Reimplemented from CreatureScript.

72 {
73 if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
74 {
75 if (npc_maghar_captiveAI* EscortAI = dynamic_cast<npc_maghar_captiveAI*>(creature->AI()))
76 {
79 EscortAI->Start(true, false, player->GetGUID(), quest);
80 creature->AI()->Talk(SAY_MAG_START);
81
85 }
86 }
87 return true;
88 }
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:48
@ QUEST_TOTEM_KARDASH_H
Definition: zone_nagrand.cpp:55
@ NPC_MURK_RAIDER
Definition: zone_nagrand.cpp:57
@ SAY_MAG_START
Definition: zone_nagrand.cpp:42
@ NPC_MURK_PUTRIFIER
Definition: zone_nagrand.cpp:60
@ NPC_MURK_BRUTE
Definition: zone_nagrand.cpp:58
static float m_afAmbushA[]
Definition: zone_nagrand.cpp:63
@ FACTION_ESCORTEE_H_NEUTRAL_ACTIVE
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:50
CreatureAI * AI() const
Definition: Creature.h:143
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
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:2355
void SetFaction(uint32 faction)
Definition: Unit.cpp:10018
void SetStandState(uint8 state)
Definition: Unit.cpp:16682
uint32 GetQuestId() const
Definition: QuestDef.h:228

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.