AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_costumed_orphan_matron Struct Reference
Inheritance diagram for npc_costumed_orphan_matron:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_costumed_orphan_matron (Creature *c)
 
void Reset () override
 
void GetInitXYZ (float &x, float &y, float &z, float &o, uint32 &path)
 
void DoAction (int32 param) override
 
void UpdateAI (uint32 diff) override
 
void sGossipHello (Player *player) override
 
void sQuestAccept (Player *, Quest const *quest) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

uint32 eventStarted
 
bool allowQuest
 
ObjectGuid horseGUID
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_costumed_orphan_matron()

npc_costumed_orphan_matron::npc_costumed_orphan_matron ( Creature c)
inline
357: ScriptedAI(c) {}
Definition: ScriptedCreature.h:192

Member Function Documentation

◆ DoAction()

void npc_costumed_orphan_matron::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

420 {
421 if (param == ACTION_START_EVENT)
422 {
423 allowQuest = true;
424 eventStarted = 1;
425 float x = 0, y = 0, z = 0, o = 0;
426 uint32 path = 0;
427 GetInitXYZ(x, y, z, o, path);
429 {
430 cr->GetMotionMaster()->MovePath(path, true);
431 cr->AI()->DoAction(path);
432 horseGUID = cr->GetGUID();
433 }
434 }
435 }
std::uint32_t uint32
Definition: Define.h:108
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:47
@ NPC_SHADE_OF_HORSEMAN
Definition: hallows_end.cpp:263
@ ACTION_START_EVENT
Definition: hallows_end.cpp:268
Creature * me
Definition: ScriptedCreature.h:282
Definition: Creature.h:46
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 GetInitXYZ(float &x, float &y, float &z, float &o, uint32 &path)
Definition: hallows_end.cpp:370
uint32 eventStarted
Definition: hallows_end.cpp:359
bool allowQuest
Definition: hallows_end.cpp:360
ObjectGuid horseGUID
Definition: hallows_end.cpp:361

References ACTION_START_EVENT, allowQuest, eventStarted, GetInitXYZ(), horseGUID, ScriptedAI::me, NPC_SHADE_OF_HORSEMAN, WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by sQuestAccept().

◆ GetInitXYZ()

void npc_costumed_orphan_matron::GetInitXYZ ( float &  x,
float &  y,
float &  z,
float &  o,
uint32 path 
)
inline
371 {
372 switch (me->GetAreaId())
373 {
374 case 87: // Goldshire
375 x = -9494.4f;
376 y = 48.53f;
377 z = 70.5f;
378 o = 0.5f;
379 path = 235431;
380 break;
381 case 131: // Kharanos
382 x = -5558.34f;
383 y = -499.46f;
384 z = 414.12f;
385 o = 2.08f;
386 path = 235432;
387 break;
388 case 3576: // Azure Watch
389 x = -4163.58f;
390 y = -12460.30f;
391 z = 63.02f;
392 o = 4.31f;
393 path = 235433;
394 break;
395 case 362: // Razor Hill
396 x = 373.2f;
397 y = -4723.4f;
398 z = 31.2f;
399 o = 3.2f;
400 path = 235434;
401 break;
402 case 159: // Brill
403 x = 2195.2f;
404 y = 264.0f;
405 z = 55.62f;
406 o = 0.15f;
407 path = 235435;
408 break;
409 case 3665: // Falcon Wing Square
410 x = 9547.91f;
411 y = -6809.9f;
412 z = 27.96f;
413 o = 3.4f;
414 path = 235436;
415 break;
416 }
417 }
uint32 GetAreaId() const
Definition: Object.cpp:3108

References WorldObject::GetAreaId(), and ScriptedAI::me.

Referenced by DoAction().

◆ Reset()

void npc_costumed_orphan_matron::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

364 {
365 eventStarted = 0;
366 allowQuest = false;
368 }
void Clear()
Definition: ObjectGuid.h:140

References allowQuest, ObjectGuid::Clear(), eventStarted, and horseGUID.

◆ sGossipHello()

void npc_costumed_orphan_matron::sGossipHello ( Player player)
inlineoverridevirtual

Reimplemented from UnitAI.

451 {
452 QuestRelationBounds pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry());
453 QuestRelationBounds pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(me->GetEntry());
454
455 QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
456 qm.ClearMenu();
457
458 for (QuestRelations::const_iterator i = pObjectQIR.first; i != pObjectQIR.second; ++i)
459 {
460 uint32 quest_id = i->second;
461 QuestStatus status = player->GetQuestStatus(quest_id);
462 if (status == QUEST_STATUS_COMPLETE)
463 {
464 qm.AddMenuItem(quest_id, 4);
465 }
466 else if (status == QUEST_STATUS_INCOMPLETE)
467 {
468 qm.AddMenuItem(quest_id, 4);
469 }
470 }
471
472 for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i)
473 {
474 uint32 quest_id = i->second;
475 Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
476 if (!pQuest)
477 {
478 continue;
479 }
480
481 if (!player->CanTakeQuest(pQuest, false))
482 {
483 continue;
484 }
485 else if (player->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
486 {
487 switch (quest_id)
488 {
491 if (!allowQuest)
492 {
493 qm.AddMenuItem(quest_id, 2);
494 }
495 break;
498 if (allowQuest)
499 {
500 qm.AddMenuItem(quest_id, 2);
501 }
502 break;
503 default:
504 qm.AddMenuItem(quest_id, 2);
505 break;
506 }
507 }
508 }
509
510 player->SendPreparedQuest(me->GetGUID());
511 }
std::pair< QuestRelations::const_iterator, QuestRelations::const_iterator > QuestRelationBounds
Definition: ObjectMgr.h:519
#define sObjectMgr
Definition: ObjectMgr.h:1640
QuestStatus
Definition: QuestDef.h:99
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ QUEST_STATUS_NONE
Definition: QuestDef.h:100
@ QUEST_STATUS_COMPLETE
Definition: QuestDef.h:101
@ QUEST_LET_THE_FIRES_COME_A
Definition: hallows_end.cpp:245
@ QUEST_STOP_THE_FIRES_H
Definition: hallows_end.cpp:248
@ QUEST_STOP_THE_FIRES_A
Definition: hallows_end.cpp:247
@ QUEST_LET_THE_FIRES_COME_H
Definition: hallows_end.cpp:246
Definition: GossipDef.h:228
void ClearMenu()
Definition: GossipDef.cpp:312
void AddMenuItem(uint32 QuestId, uint8 Icon)
Definition: GossipDef.cpp:288
QuestMenu & GetQuestMenu()
Definition: GossipDef.h:264
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool CanTakeQuest(Quest const *quest, bool msg)
Definition: PlayerQuest.cpp:251
void SendPreparedQuest(ObjectGuid guid)
Definition: PlayerQuest.cpp:115
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1416
PlayerMenu * PlayerTalkClass
Definition: Player.h:2201
Definition: QuestDef.h:207

References QuestMenu::AddMenuItem(), allowQuest, Player::CanTakeQuest(), QuestMenu::ClearMenu(), Object::GetEntry(), Object::GetGUID(), PlayerMenu::GetQuestMenu(), Player::GetQuestStatus(), ScriptedAI::me, Player::PlayerTalkClass, QUEST_LET_THE_FIRES_COME_A, QUEST_LET_THE_FIRES_COME_H, QUEST_STATUS_COMPLETE, QUEST_STATUS_INCOMPLETE, QUEST_STATUS_NONE, QUEST_STOP_THE_FIRES_A, QUEST_STOP_THE_FIRES_H, Player::SendPreparedQuest(), and sObjectMgr.

◆ sQuestAccept()

void npc_costumed_orphan_matron::sQuestAccept ( Player ,
Quest const *  quest 
)
inlineoverridevirtual

Reimplemented from UnitAI.

514 {
515 if ((quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_A || quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_H) && !allowQuest)
516 {
518 }
519 }
void DoAction(int32 param) override
Definition: hallows_end.cpp:419

References ACTION_START_EVENT, allowQuest, DoAction(), Quest::GetQuestId(), QUEST_LET_THE_FIRES_COME_A, and QUEST_LET_THE_FIRES_COME_H.

◆ UpdateAI()

void npc_costumed_orphan_matron::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

438 {
439 if (eventStarted)
440 {
441 eventStarted += diff;
442 if (eventStarted >= 400 * IN_MILLISECONDS)
443 {
444 allowQuest = false;
445 eventStarted = 0;
446 }
447 }
448 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:55

References allowQuest, eventStarted, and IN_MILLISECONDS.

Member Data Documentation

◆ allowQuest

bool npc_costumed_orphan_matron::allowQuest

◆ eventStarted

uint32 npc_costumed_orphan_matron::eventStarted

Referenced by DoAction(), Reset(), and UpdateAI().

◆ horseGUID

ObjectGuid npc_costumed_orphan_matron::horseGUID

Referenced by DoAction(), and Reset().