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
 Use to start attacking a target. Called just before JustEngagedWith()
 
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
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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)
 
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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () 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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
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.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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)
 To specify the caster as target if the spell is self-cast.
 
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, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not 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)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char 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
 

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
358: ScriptedAI(c) {}
Definition ScriptedCreature.h:190

Member Function Documentation

◆ DoAction()

void npc_costumed_orphan_matron::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

421 {
422 if (param == ACTION_START_EVENT)
423 {
424 allowQuest = true;
425 eventStarted = 1;
426 float x = 0, y = 0, z = 0, o = 0;
427 uint32 path = 0;
428 GetInitXYZ(x, y, z, o, path);
430 {
431 cr->GetMotionMaster()->MovePath(path, true);
432 cr->AI()->DoAction(path);
433 horseGUID = cr->GetGUID();
434 }
435 }
436 }
std::uint32_t uint32
Definition Define.h:107
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:52
Definition Creature.h:43
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:2368
@ NPC_SHADE_OF_HORSEMAN
Definition hallows_end.cpp:264
@ ACTION_START_EVENT
Definition hallows_end.cpp:269
Creature * me
Definition ScriptedCreature.h:280
void GetInitXYZ(float &x, float &y, float &z, float &o, uint32 &path)
Definition hallows_end.cpp:371
uint32 eventStarted
Definition hallows_end.cpp:360
bool allowQuest
Definition hallows_end.cpp:361
ObjectGuid horseGUID
Definition hallows_end.cpp:362

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
372 {
373 switch (me->GetAreaId())
374 {
375 case AREA_GOLDSHIRE:
376 x = -9494.4f;
377 y = 48.53f;
378 z = 70.5f;
379 o = 0.5f;
380 path = 235431;
381 break;
382 case AREA_KHARANOS:
383 x = -5558.34f;
384 y = -499.46f;
385 z = 414.12f;
386 o = 2.08f;
387 path = 235432;
388 break;
389 case AREA_AZURE_WATCH:
390 x = -4163.58f;
391 y = -12460.30f;
392 z = 63.02f;
393 o = 4.31f;
394 path = 235433;
395 break;
396 case AREA_RAZOR_HILL:
397 x = 373.2f;
398 y = -4723.4f;
399 z = 31.2f;
400 o = 3.2f;
401 path = 235434;
402 break;
403 case AREA_BRILL:
404 x = 2195.2f;
405 y = 264.0f;
406 z = 55.62f;
407 o = 0.15f;
408 path = 235435;
409 break;
411 x = 9547.91f;
412 y = -6809.9f;
413 z = 27.96f;
414 o = 3.4f;
415 path = 235436;
416 break;
417 }
418 }
@ AREA_FALCONWING_SQUARE
Definition AreaDefines.h:113
@ AREA_GOLDSHIRE
Definition AreaDefines.h:48
@ AREA_KHARANOS
Definition AreaDefines.h:51
@ AREA_AZURE_WATCH
Definition AreaDefines.h:110
@ AREA_BRILL
Definition AreaDefines.h:55
@ AREA_RAZOR_HILL
Definition AreaDefines.h:64
uint32 GetAreaId() const
Definition Object.cpp:3156

References AREA_AZURE_WATCH, AREA_BRILL, AREA_FALCONWING_SQUARE, AREA_GOLDSHIRE, AREA_KHARANOS, AREA_RAZOR_HILL, WorldObject::GetAreaId(), and ScriptedAI::me.

Referenced by DoAction().

◆ Reset()

void npc_costumed_orphan_matron::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

365 {
366 eventStarted = 0;
367 allowQuest = false;
369 }
void Clear()
Definition ObjectGuid.h:138

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

◆ sGossipHello()

void npc_costumed_orphan_matron::sGossipHello ( Player player)
inlineoverridevirtual

Reimplemented from UnitAI.

452 {
453 QuestRelationBounds pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry());
454 QuestRelationBounds pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(me->GetEntry());
455
456 QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
457 qm.ClearMenu();
458
459 for (QuestRelations::const_iterator i = pObjectQIR.first; i != pObjectQIR.second; ++i)
460 {
461 uint32 quest_id = i->second;
462 QuestStatus status = player->GetQuestStatus(quest_id);
463 if (status == QUEST_STATUS_COMPLETE)
464 {
465 qm.AddMenuItem(quest_id, 4);
466 }
467 else if (status == QUEST_STATUS_INCOMPLETE)
468 {
469 qm.AddMenuItem(quest_id, 4);
470 }
471 }
472
473 for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i)
474 {
475 uint32 quest_id = i->second;
476 Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
477 if (!pQuest)
478 {
479 continue;
480 }
481
482 if (!player->CanTakeQuest(pQuest, false))
483 {
484 continue;
485 }
486 else if (player->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
487 {
488 switch (quest_id)
489 {
492 if (!allowQuest)
493 {
494 qm.AddMenuItem(quest_id, 2);
495 }
496 break;
499 if (allowQuest)
500 {
501 qm.AddMenuItem(quest_id, 2);
502 }
503 break;
504 default:
505 qm.AddMenuItem(quest_id, 2);
506 break;
507 }
508 }
509 }
510
511 player->SendPreparedQuest(me->GetGUID());
512 }
std::pair< QuestRelations::const_iterator, QuestRelations::const_iterator > QuestRelationBounds
Definition ObjectMgr.h:525
#define sObjectMgr
Definition ObjectMgr.h:1650
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
uint32 GetEntry() const
Definition Object.h:116
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
QuestMenu & GetQuestMenu()
Definition GossipDef.h:265
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:1430
PlayerMenu * PlayerTalkClass
Definition Player.h:2249
Definition GossipDef.h:229
void ClearMenu()
Definition GossipDef.cpp:310
void AddMenuItem(uint32 QuestId, uint8 Icon)
Definition GossipDef.cpp:286
Definition QuestDef.h:210
@ QUEST_LET_THE_FIRES_COME_A
Definition hallows_end.cpp:246
@ QUEST_STOP_THE_FIRES_H
Definition hallows_end.cpp:249
@ QUEST_STOP_THE_FIRES_A
Definition hallows_end.cpp:248
@ QUEST_LET_THE_FIRES_COME_H
Definition hallows_end.cpp:247

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.

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

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  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

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

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


The documentation for this struct was generated from the following file: