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 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=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 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 SummonedCreatureEvade (Creature *)
 
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)
 
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 *)
 
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 void Reset ()
 
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 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)
 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 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)
 
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_grand_magister_rommathAI()

npc_grand_magister_rommath::npc_grand_magister_rommathAI::npc_grand_magister_rommathAI ( Creature c)
inline
489 : NullCreatureAI(c)
490 {
491 announced = false;
494 }
@ REACT_AGGRESSIVE
Definition Unit.h:550
Creature *const me
Definition CreatureAI.h:72
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
Definition PassiveAI.h:53
void Clear()
Definition ObjectGuid.h:138
bool announced
Definition zone_isle_of_queldanas.cpp:497
ObjectGuid playerGUID
Definition zone_isle_of_queldanas.cpp:498

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.

512 {
513 if (a == -1 && !me->isActiveObject())
514 {
515 me->SummonGameObject(GO_QUEL_DELAR, 1688.24f, 621.769f, 29.1745f, 0.523177f, 0.0f, 0.0f, 0.0f, 0.0f, 86400);
516 me->SummonCreature(NPC_SUNWELL_VISUAL_BUNNY, 1688.24f, 621.769f, 29.1745f, 0.523177f, TEMPSUMMON_MANUAL_DESPAWN);
517 me->setActive(true);
518 events.Reset();
519 events.ScheduleEvent(1, 1000); // guard talk
520 events.ScheduleEvent(2, 4000); // theron talk
521 events.ScheduleEvent(3, 10000); // npcs walk
522 events.ScheduleEvent(4, 17000); // rommath talk
523 events.ScheduleEvent(5, 20000); // theron talk
524 events.ScheduleEvent(6, 28000); // theron talk
525 events.ScheduleEvent(7, 37000); // rommath talk
526 events.ScheduleEvent(8, 44000); // rommath talk
527 events.ScheduleEvent(9, 52000); // rommath talk
528 events.ScheduleEvent(10, 60000); // auric talk
529 events.ScheduleEvent(11, 66000); // auric talk
530 events.ScheduleEvent(12, 76000); // rommath talk
531 events.ScheduleEvent(13, 80000); // move home
532 }
533 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:53
events
Definition boss_sartura.cpp: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
bool isActiveObject() const
Definition Object.h:580
void setActive(bool isActiveObject)
Definition Object.cpp:1094
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:2382
@ GO_QUEL_DELAR
Definition zone_isle_of_queldanas.cpp:451
@ NPC_SUNWELL_VISUAL_BUNNY
Definition zone_isle_of_queldanas.cpp:452

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.

501 {
502 if (!announced && who->IsPlayer() && who->GetPositionZ() < 30.0f)
503 {
504 announced = true;
505 playerGUID = who->GetGUID();
506 if (Creature* c = me->FindNearestCreature(NPC_GALIROS, 100.0f, true))
507 c->AI()->Talk(0, who);
508 }
509 }
Definition Creature.h:43
bool IsPlayer() const
Definition Object.h:200
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459
float GetPositionZ() const
Definition Position.h:123
@ NPC_GALIROS
Definition zone_isle_of_queldanas.cpp:455

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.

536 {
537 if (!me->isActiveObject())
538 return;
539
540 events.Update(diff);
541
542 switch (events.ExecuteEvent())
543 {
544 case 1:
546 c->AI()->Talk(0);
547 break;
548 case 2:
549 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
550 c->AI()->Talk(0);
551 break;
552 case 3:
553 me->SetWalk(true);
554 me->GetMotionMaster()->MovePath(me->GetEntry() * 100, false);
555 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
556 {
557 c->SetWalk(true);
558 c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false);
559 }
560 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
561 {
562 c->SetWalk(true);
563 c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false);
564 }
565 break;
566 case 4:
567 Talk(0);
568 break;
569 case 5:
570 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
571 c->AI()->Talk(1);
572 break;
573 case 6:
574 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
575 c->AI()->Talk(2, ObjectAccessor::GetPlayer(*me, playerGUID));
576 break;
577 case 7:
579 break;
580 case 8:
581 Talk(2);
582 break;
583 case 9:
584 Talk(3);
585 break;
586 case 10:
587 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
588 c->AI()->Talk(0);
589 break;
590 case 11:
591 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
592 c->AI()->Talk(1);
593 break;
594 case 12:
596 Talk(p->GetTeamId() == TEAM_ALLIANCE ? 5 : 4, p);
597 break;
598 case 13:
599 me->setActive(false);
601 c->DespawnOrUnsummon(1);
603 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
604 me->SetWalk(true);
605 if (me->GetCreatureData())
607 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
608 {
609 c->SetWalk(true);
610 if (c->GetCreatureData())
611 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
612 }
613 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
614 {
615 c->SetWalk(true);
616 if (c->GetCreatureData())
617 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
618 }
619 break;
620 }
621 }
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1607
@ TEAM_ALLIANCE
Definition SharedDefines.h:760
CreatureData const * GetCreatureData() const
Definition Creature.h:210
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3208
Definition GameObject.h:120
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:852
uint32 GetEntry() const
Definition Object.h:115
Definition Player.h:1081
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition Object.cpp:2468
Talk
Definition hyjal.cpp:82
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition ObjectAccessor.cpp:220
float posY
Definition CreatureData.h:380
float posX
Definition CreatureData.h:379
float posZ
Definition CreatureData.h:381
@ NPC_AURIC
Definition zone_isle_of_queldanas.cpp:457
@ NPC_SUNWELL_HONOR_GUARD
Definition zone_isle_of_queldanas.cpp:453
@ NPC_THERON
Definition zone_isle_of_queldanas.cpp:456

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::MovePath(), MotionMaster::MovePoint(), NPC_AURIC, NPC_SUNWELL_HONOR_GUARD, NPC_SUNWELL_VISUAL_BUNNY, NPC_THERON, playerGUID, CreatureData::posX, CreatureData::posY, CreatureData::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: