AzerothCore 3.3.5a
OpenSource WoW Emulator
No Matches
npc_torloth_the_magnificent::npc_torloth_the_magnificentAI Struct Reference
Inheritance diagram for npc_torloth_the_magnificent::npc_torloth_the_magnificentAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_torloth_the_magnificentAI (Creature *creature)
void Reset () override
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
void HandleAnimation ()
void UpdateAI (uint32 diff) override
void JustDied (Unit *killer) 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 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 HealDone (Unit *, uint32 &)
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 AnimationTimer
uint32 SpellTimer1
uint32 SpellTimer2
uint32 SpellTimer3
uint8 AnimationCount
ObjectGuid LordIllidanGUID
ObjectGuid AggroTargetGUID
bool Timers
- Public Attributes inherited from ScriptedAI
bool IsFleeing

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
- Public Types inherited from CreatureAI
enum  EvadeReason {
- 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
CreatureBoundary const * _boundary
bool _negateBoundary
- Protected Attributes inherited from UnitAI
Unit *const me

Detailed Description

Constructor & Destructor Documentation

◆ npc_torloth_the_magnificentAI()

npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::npc_torloth_the_magnificentAI ( Creature creature)
921: ScriptedAI(creature) { }
Definition: ScriptedCreature.h:192

Member Function Documentation

◆ HandleAnimation()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::HandleAnimation ( )
948 {
949 Creature* creature = me;
951 if (TorlothAnim[AnimationCount].creature == 1)
952 {
955 if (!creature)
956 return;
957 }
961 switch (AnimationCount)
962 {
963 case 0:
965 break;
966 case 3:
968 break;
969 case 5:
971 {
972 me->SetTarget(AggroTarget->GetGUID());
973 me->AddThreat(AggroTarget, 1);
975 }
976 break;
977 case 6:
979 {
983 float x, y, z;
984 AggroTarget->GetPosition(x, y, z);
985 me->GetMotionMaster()->MovePoint(0, x, y, z);
986 }
987 break;
988 }
990 }
Definition: UpdateFields.h:131
Definition: Unit.h:335
Definition: Unit.h:449
static TorlothCinematic TorlothAnim[]
Definition: zone_shadowmoon_valley.cpp:835
Definition: SharedDefines.h:1889
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:225
Creature * me
Definition: ScriptedCreature.h:282
Definition: Creature.h:46
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3424
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:860
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
Definition: Player.h:1046
void ClearUnitState(uint32 f)
Definition: Unit.h:1399
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14548
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1970
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1482
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
uint32 Timer
Definition: zone_shadowmoon_valley.cpp:831
uint32 AnimationTimer
Definition: zone_shadowmoon_valley.cpp:923
ObjectGuid AggroTargetGUID
Definition: zone_shadowmoon_valley.cpp:928
ObjectGuid LordIllidanGUID
Definition: zone_shadowmoon_valley.cpp:927
uint8 AnimationCount
Definition: zone_shadowmoon_valley.cpp:925

References Unit::AddThreat(), AggroTargetGUID, AnimationCount, AnimationTimer, Unit::ClearUnitState(), EMOTE_ONESHOT_POINT, ObjectAccessor::GetCreature(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), Unit::HandleEmoteCommand(), LordIllidanGUID, ScriptedAI::me, MotionMaster::MovePoint(), Object::RemoveFlag(), Unit::RemoveUnitFlag(), Creature::SetTarget(), Object::SetUInt32Value(), TorlothCinematic::Timer, TorlothAnim, UNIT_FIELD_BYTES_1, UNIT_FLAG_NON_ATTACKABLE, and UNIT_STATE_ROOT.

Referenced by UpdateAI().

◆ JustDied()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::JustDied ( Unit killer)

Reimplemented from ScriptedAI.

1043 {
1044 switch (killer->GetTypeId())
1045 {
1046 case TYPEID_UNIT:
1047 if (Unit* owner = killer->GetOwner())
1048 if (Player* player = owner->ToPlayer())
1049 player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
1050 break;
1051 case TYPEID_PLAYER:
1052 if (Player* player = killer->ToPlayer())
1053 player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
1054 break;
1055 default:
1056 break;
1057 }
1060 LordIllidan->AI()->EnterEvadeMode();
1061 }
Definition: ObjectGuid.h:37
Definition: ObjectGuid.h:38
Definition: zone_shadowmoon_valley.cpp:825
Player * ToPlayer()
Definition: Object.h:195
TypeID GetTypeId() const
Definition: Object.h:121
Definition: Unit.h:1290
Unit * GetOwner() const
Definition: Unit.cpp:10560

References ObjectAccessor::GetCreature(), Unit::GetOwner(), Object::GetTypeId(), LordIllidanGUID, ScriptedAI::me, QUEST_BATTLE_OF_THE_CRIMSON_WATCH, Object::ToPlayer(), TYPEID_PLAYER, and TYPEID_UNIT.

◆ JustEngagedWith()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::JustEngagedWith ( Unit )

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

945{ }

◆ Reset()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::Reset ( )

Reimplemented from ScriptedAI.

933 {
934 AnimationTimer = 4000;
935 AnimationCount = 0;
938 Timers = false;
942 me->SetTarget();
943 }
Definition: boss_anubshiah.cpp:32
void Clear()
Definition: ObjectGuid.h:140
void AddUnitState(uint32 f)
Definition: Unit.h:1397
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1481

References Unit::AddUnitState(), AggroTargetGUID, AnimationCount, AnimationTimer, ObjectGuid::Clear(), LordIllidanGUID, ScriptedAI::me, Creature::SetTarget(), Unit::SetUnitFlag(), UNIT_FLAG_NON_ATTACKABLE, and UNIT_STATE_ROOT.

◆ UpdateAI()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::UpdateAI ( uint32  diff)

Reimplemented from ScriptedAI.

993 {
994 if (AnimationTimer)
995 {
996 if (AnimationTimer <= diff)
997 {
999 }
1000 else AnimationTimer -= diff;
1001 }
1003 if (AnimationCount < 6)
1004 {
1005 me->CombatStop();
1006 }
1007 else if (!Timers)
1008 {
1012 Timers = true;
1013 }
1015 if (Timers)
1016 {
1017 if (SpellTimer1 <= diff)
1018 {
1019 DoCastVictim(SpawnCast[6].SpellId);//Cleave
1020 SpellTimer1 = SpawnCast[6].Timer2 + (rand() % 10 * 1000);
1021 }
1022 else SpellTimer1 -= diff;
1024 if (SpellTimer2 <= diff)
1025 {
1026 DoCastVictim(SpawnCast[7].SpellId);//Shadowfury
1027 SpellTimer2 = SpawnCast[7].Timer2 + (rand() % 5 * 1000);
1028 }
1029 else SpellTimer2 -= diff;
1031 if (SpellTimer3 <= diff)
1032 {
1033 DoCast(me, SpawnCast[8].SpellId);
1034 SpellTimer3 = SpawnCast[8].Timer2 + (rand() % 7 * 1000); //Spell Reflection
1035 }
1036 else SpellTimer3 -= diff;
1037 }
1040 }
static SpawnSpells SpawnCast[]
Definition: zone_shadowmoon_valley.cpp:892
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:178
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10401
uint32 Timer2
Definition: zone_silithus.cpp:284
uint32 Timer1
Definition: zone_silithus.cpp:284
uint32 SpellTimer3
Definition: zone_shadowmoon_valley.cpp:923
uint32 SpellTimer2
Definition: zone_shadowmoon_valley.cpp:923
uint32 SpellTimer1
Definition: zone_shadowmoon_valley.cpp:923
void HandleAnimation()
Definition: zone_shadowmoon_valley.cpp:947

References AnimationCount, AnimationTimer, Unit::CombatStop(), UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), HandleAnimation(), ScriptedAI::me, SpawnCast, SpellTimer1, SpellTimer2, SpellTimer3, SpawnSpells::Timer1, and SpawnSpells::Timer2.

Member Data Documentation

◆ AggroTargetGUID

ObjectGuid npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::AggroTargetGUID

Referenced by HandleAnimation(), and Reset().

◆ AnimationCount

uint8 npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::AnimationCount

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

◆ AnimationTimer

uint32 npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::AnimationTimer

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

◆ LordIllidanGUID

ObjectGuid npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::LordIllidanGUID

Referenced by HandleAnimation(), JustDied(), and Reset().

◆ SpellTimer1

uint32 npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::SpellTimer1

Referenced by UpdateAI().

◆ SpellTimer2

uint32 npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::SpellTimer2

Referenced by UpdateAI().

◆ SpellTimer3

uint32 npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::SpellTimer3

Referenced by UpdateAI().

◆ Timers

bool npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::Timers