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
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 
- 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

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

npc_grand_magister_rommath::npc_grand_magister_rommathAI::npc_grand_magister_rommathAI ( Creature c)
inline
500 : NullCreatureAI(c)
501 {
502 announced = false;
505 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
Definition: PassiveAI.h:53
Creature *const me
Definition: CreatureAI.h:73
void SetReactState(ReactStates st)
Definition: Creature.h:90
void Clear()
Definition: ObjectGuid.h:140
bool announced
Definition: zone_isle_of_queldanas.cpp:508
ObjectGuid playerGUID
Definition: zone_isle_of_queldanas.cpp:509

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.

523 {
524 if (a == -1 && !me->isActiveObject())
525 {
526 me->SummonGameObject(GO_QUEL_DELAR, 1688.24f, 621.769f, 29.1745f, 0.523177f, 0.0f, 0.0f, 0.0f, 0.0f, 86400);
527 me->SummonCreature(NPC_SUNWELL_VISUAL_BUNNY, 1688.24f, 621.769f, 29.1745f, 0.523177f, TEMPSUMMON_MANUAL_DESPAWN);
528 me->setActive(true);
529 events.Reset();
530 events.ScheduleEvent(1, 1000); // guard talk
531 events.ScheduleEvent(2, 4000); // theron talk
532 events.ScheduleEvent(3, 10000); // npcs walk
533 events.ScheduleEvent(4, 17000); // rommath talk
534 events.ScheduleEvent(5, 20000); // theron talk
535 events.ScheduleEvent(6, 28000); // theron talk
536 events.ScheduleEvent(7, 37000); // rommath talk
537 events.ScheduleEvent(8, 44000); // rommath talk
538 events.ScheduleEvent(9, 52000); // rommath talk
539 events.ScheduleEvent(10, 60000); // auric talk
540 events.ScheduleEvent(11, 66000); // auric talk
541 events.ScheduleEvent(12, 76000); // rommath talk
542 events.ScheduleEvent(13, 80000); // move home
543 }
544 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ GO_QUEL_DELAR
Definition: zone_isle_of_queldanas.cpp:451
@ NPC_SUNWELL_VISUAL_BUNNY
Definition: zone_isle_of_queldanas.cpp:452
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:2343
bool isActiveObject() const
Definition: Object.h:560
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
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:2357

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 NullCreatureAI.

512 {
513 if (!announced && who->GetTypeId() == TYPEID_PLAYER && who->GetPositionZ() < 30.0f)
514 {
515 announced = true;
516 playerGUID = who->GetGUID();
517 if (Creature* c = me->FindNearestCreature(NPC_GALIROS, 100.0f, true))
518 c->AI()->Talk(0, who);
519 }
520 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ NPC_GALIROS
Definition: zone_isle_of_queldanas.cpp:455
Definition: Creature.h:46
TypeID GetTypeId() const
Definition: Object.h:121
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
float GetPositionZ() const
Definition: Position.h:119

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

◆ UpdateAI()

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

Reimplemented from NullCreatureAI.

547 {
548 if (!me->isActiveObject())
549 return;
550
551 events.Update(diff);
552
553 switch (events.ExecuteEvent())
554 {
555 case 1:
557 c->AI()->Talk(0);
558 break;
559 case 2:
560 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
561 c->AI()->Talk(0);
562 break;
563 case 3:
564 me->SetWalk(true);
565 me->GetMotionMaster()->MovePath(me->GetEntry() * 100, false);
566 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
567 {
568 c->SetWalk(true);
569 c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false);
570 }
571 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
572 {
573 c->SetWalk(true);
574 c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false);
575 }
576 break;
577 case 4:
578 Talk(0);
579 break;
580 case 5:
581 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
582 c->AI()->Talk(1);
583 break;
584 case 6:
585 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
586 c->AI()->Talk(2, ObjectAccessor::GetPlayer(*me, playerGUID));
587 break;
588 case 7:
590 break;
591 case 8:
592 Talk(2);
593 break;
594 case 9:
595 Talk(3);
596 break;
597 case 10:
598 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
599 c->AI()->Talk(0);
600 break;
601 case 11:
602 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
603 c->AI()->Talk(1);
604 break;
605 case 12:
607 Talk(p->GetTeamId() == TEAM_ALLIANCE ? 5 : 4, p);
608 break;
609 case 13:
610 me->setActive(false);
612 c->DespawnOrUnsummon(1);
614 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
615 me->SetWalk(true);
616 if (me->GetCreatureData())
618 if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true))
619 {
620 c->SetWalk(true);
621 if (c->GetCreatureData())
622 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
623 }
624 if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true))
625 {
626 c->SetWalk(true);
627 if (c->GetCreatureData())
628 c->GetMotionMaster()->MovePoint(0, c->GetCreatureData()->posX, c->GetCreatureData()->posY, c->GetCreatureData()->posZ);
629 }
630 break;
631 }
632 }
@ 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
Talk
Definition: boss_fathomlord_karathress.cpp:25
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
CreatureData const * GetCreatureData() const
Definition: Creature.h:200
bool SetWalk(bool enable) override
Definition: Creature.cpp:3098
float posY
Definition: CreatureData.h:369
float posX
Definition: CreatureData.h:368
float posZ
Definition: CreatureData.h:370
Definition: GameObject.h:122
uint32 GetEntry() const
Definition: Object.h:109
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2443
Definition: Player.h:1056
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void MovePath(uint32 path_id, bool repeatable)
Definition: MotionMaster.cpp:800

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