AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_grand_magister_rommath::npc_grand_magister_rommathAI Struct Reference
Inheritance diagram for npc_grand_magister_rommath::npc_grand_magister_rommathAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 npc_grand_magister_rommathAI (Creature *c)
 
void MoveInLineOfSight (Unit *who) override
 
void DoAction (int32 a) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void JustStartedThreateningMe (Unit *) override
 
void JustEnteredCombat (Unit *) override
 Called when the unit enters combat.
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
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 SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (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, int32 aura=0)
 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 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

EventMap events
 
bool announced
 
ObjectGuid playerGUID
 

Additional Inherited Members

- 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 NullCreatureAI
static int32 Permissible (Creature const *creature)
 
- 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 AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_grand_magister_rommathAI()

npc_grand_magister_rommath::npc_grand_magister_rommathAI::npc_grand_magister_rommathAI ( Creature *  c)
inline
477 : NullCreatureAI(c)
478 {
479 announced = false;
482 }
@ REACT_AGGRESSIVE
Definition Unit.h:569
Creature *const me
Definition CreatureAI.h:71
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
Definition PassiveAI.h:56
void Clear()
Definition ObjectGuid.h:141
bool announced
Definition zone_isle_of_queldanas.cpp:485
ObjectGuid playerGUID
Definition zone_isle_of_queldanas.cpp:486

References announced, ObjectGuid::Clear(), CreatureAI::me, playerGUID, REACT_AGGRESSIVE, and Creature::SetReactState().

Member Function Documentation

◆ DoAction()

void npc_grand_magister_rommath::npc_grand_magister_rommathAI::DoAction ( int32  a)
inlineoverridevirtual

Reimplemented from UnitAI.

500 {
501 if (a == -1 && !me->isActiveObject())
502 {
503 me->SummonGameObject(GO_QUEL_DELAR, 1688.24f, 621.769f, 29.1745f, 0.523177f, 0.0f, 0.0f, 0.0f, 0.0f, 86400);
504 me->SummonCreature(NPC_SUNWELL_VISUAL_BUNNY, 1688.24f, 621.769f, 29.1745f, 0.523177f, TEMPSUMMON_MANUAL_DESPAWN);
505 me->setActive(true);
506 events.Reset();
507 events.ScheduleEvent(1, 1s); // guard talk
508 events.ScheduleEvent(2, 4s); // theron talk
509 events.ScheduleEvent(3, 10s); // npcs walk
510 events.ScheduleEvent(4, 17s); // rommath talk
511 events.ScheduleEvent(5, 20s); // theron talk
512 events.ScheduleEvent(6, 28s); // theron talk
513 events.ScheduleEvent(7, 37s); // rommath talk
514 events.ScheduleEvent(8, 44s); // rommath talk
515 events.ScheduleEvent(9, 52s); // rommath talk
516 events.ScheduleEvent(10, 60s); // auric talk
517 events.ScheduleEvent(11, 66s); // auric talk
518 events.ScheduleEvent(12, 76s); // rommath talk
519 events.ScheduleEvent(13, 80s); // move home
520 }
521 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:57
events
Definition boss_sartura.cpp:43
bool isActiveObject() const
Definition Object.h:684
void setActive(bool isActiveObject)
Definition Object.cpp:1091
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2453
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition Object.cpp:2467
@ GO_QUEL_DELAR
Definition zone_isle_of_queldanas.cpp:439
@ NPC_SUNWELL_VISUAL_BUNNY
Definition zone_isle_of_queldanas.cpp:440

References GO_QUEL_DELAR, WorldObject::isActiveObject(), CreatureAI::me, NPC_SUNWELL_VISUAL_BUNNY, WorldObject::setActive(), WorldObject::SummonCreature(), WorldObject::SummonGameObject(), and TEMPSUMMON_MANUAL_DESPAWN.

◆ MoveInLineOfSight()

void npc_grand_magister_rommath::npc_grand_magister_rommathAI::MoveInLineOfSight ( Unit *  who)
inlineoverridevirtual

Reimplemented from CreatureAI.

489 {
490 if (!announced && who->IsPlayer() && who->GetPositionZ() < 30.0f)
491 {
492 announced = true;
493 playerGUID = who->GetGUID();
494 if (Creature* c = me->FindNearestCreature(NPC_GALIROS, 100.0f, true))
495 c->AI()->Talk(0, who);
496 }
497 }
Definition Creature.h:47
bool IsPlayer() const
Definition Object.h:207
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2558
float GetPositionZ() const
Definition Position.h:123
@ NPC_GALIROS
Definition zone_isle_of_queldanas.cpp:443

References announced, WorldObject::FindNearestCreature(), Object::GetGUID(), Position::GetPositionZ(), Object::IsPlayer(), CreatureAI::me, NPC_GALIROS, and playerGUID.

◆ UpdateAI()

void npc_grand_magister_rommath::npc_grand_magister_rommathAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

524 {
525 if (!me->isActiveObject())
526 return;
527
528 events.Update(diff);
529
530 switch (events.ExecuteEvent())
531 {
532 case 1:
534 c->AI()->Talk(0);
535 break;
536 case 2:
537 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
538 c->AI()->Talk(0);
539 break;
540 case 3:
541 me->SetWalk(true);
542 me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 100, false);
543 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
544 {
545 c->SetWalk(true);
546 c->GetMotionMaster()->MoveWaypoint(c->GetEntry() * 100, false);
547 }
548 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
549 {
550 c->SetWalk(true);
551 c->GetMotionMaster()->MoveWaypoint(c->GetEntry() * 100, false);
552 }
553 break;
554 case 4:
555 Talk(0);
556 break;
557 case 5:
558 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
559 c->AI()->Talk(1);
560 break;
561 case 6:
562 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
563 c->AI()->Talk(2, ObjectAccessor::GetPlayer(*me, playerGUID));
564 break;
565 case 7:
567 break;
568 case 8:
569 Talk(2);
570 break;
571 case 9:
572 Talk(3);
573 break;
574 case 10:
575 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
576 c->AI()->Talk(0);
577 break;
578 case 11:
579 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
580 c->AI()->Talk(1);
581 break;
582 case 12:
584 Talk(p->GetTeamId() == TEAM_ALLIANCE ? 5 : 4, p);
585 break;
586 case 13:
587 me->setActive(false);
589 c->DespawnOrUnsummon(1ms);
591 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
592 me->SetWalk(true);
593 if (me->GetCreatureData())
595 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
596 {
597 c->SetWalk(true);
598 if (c->GetCreatureData())
599 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
600 }
601 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
602 {
603 c->SetWalk(true);
604 if (c->GetCreatureData())
605 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
606 }
607 break;
608 }
609 }
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1611
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
CreatureData const * GetCreatureData() const
Definition Creature.h:208
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3393
Definition GameObject.h:120
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:241
void MoveWaypoint(uint32 path_id, bool repeatable, PathSource pathSource=PathSource::WAYPOINT_MGR)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:1014
uint32 GetEntry() const
Definition Object.h:123
Definition Player.h:1086
MotionMaster * GetMotionMaster()
Definition Unit.h:1761
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition Object.cpp:2567
Talk
Definition hyjal.cpp:82
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:244
float posX
Definition SpawnData.h:71
float posY
Definition SpawnData.h:72
float posZ
Definition SpawnData.h:73
@ NPC_AURIC
Definition zone_isle_of_queldanas.cpp:445
@ NPC_SUNWELL_HONOR_GUARD
Definition zone_isle_of_queldanas.cpp:441
@ NPC_THERON
Definition zone_isle_of_queldanas.cpp:444

References WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), Creature::GetCreatureData(), Object::GetEntry(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), GO_FLAG_NOT_SELECTABLE, GO_QUEL_DELAR, WorldObject::isActiveObject(), CreatureAI::me, MotionMaster::MovePoint(), MotionMaster::MoveWaypoint(), NPC_AURIC, NPC_SUNWELL_HONOR_GUARD, NPC_SUNWELL_VISUAL_BUNNY, NPC_THERON, playerGUID, SpawnData::posX, SpawnData::posY, SpawnData::posZ, WorldObject::setActive(), Creature::SetWalk(), and TEAM_ALLIANCE.

Member Data Documentation

◆ announced

bool npc_grand_magister_rommath::npc_grand_magister_rommathAI::announced

◆ events

EventMap npc_grand_magister_rommath::npc_grand_magister_rommathAI::events

◆ playerGUID

ObjectGuid npc_grand_magister_rommath::npc_grand_magister_rommathAI::playerGUID

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