AzeorthCore 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 EnterCombat (Unit *) override
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 EnterCombat (Unit *) override
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)
 Cast Spell. More...
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 Play sound. More...
void DoPlayMusic (uint32 soundId, bool zone)
void DoResetThreat ()
 Reset Threat. More...
float DoGetThreat (Unit *unit)
void DoModifyThreatPercent (Unit *unit, int32 pct)
 Modify Unit Threat. More...
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 Teleport player. More...
void DoTeleportAll (float x, float y, float z, float o)
 Teleport all. More...
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)
 Set Combat Movement. More...
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)
 CreatureAI (Creature *creature)
 ~CreatureAI () override
void MoveCircleChecks ()
void MoveBackwardsChecks ()
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
void TriggerAlert (Unit const *who) const
virtual bool CanRespawn ()
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
virtual void EnterCombat (Unit *)
virtual void JustDied (Unit *)
virtual void KilledUnit (Unit *)
virtual void JustSummoned (Creature *)
virtual void IsSummonedBy (Unit *)
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 ================== More...
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
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, int32 aura=0)
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectTargetMethod targetType)
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)
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)
1092: ScriptedAI(creature) { }
Definition: ScriptedCreature.h:177

Member Function Documentation

◆ EnterCombat()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::EnterCombat ( Unit )

Reimplemented from ScriptedAI.

1116{ }

◆ HandleAnimation()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::HandleAnimation ( )
1119 {
1120 Creature* creature = me;
1122 if (TorlothAnim[AnimationCount].creature == 1)
1123 {
1126 if (!creature)
1127 return;
1128 }
1132 switch (AnimationCount)
1133 {
1134 case 0:
1136 break;
1137 case 3:
1139 break;
1140 case 5:
1141 if (Player* AggroTarget = ObjectAccessor::GetPlayer(*me, AggroTargetGUID))
1142 {
1143 me->SetTarget(AggroTarget->GetGUID());
1144 me->AddThreat(AggroTarget, 1);
1146 }
1147 break;
1148 case 6:
1149 if (Player* AggroTarget = ObjectAccessor::GetPlayer(*me, AggroTargetGUID))
1150 {
1154 float x, y, z;
1155 AggroTarget->GetPosition(x, y, z);
1156 me->GetMotionMaster()->MovePoint(0, x, y, z);
1157 }
1158 break;
1159 }
1161 }
Definition: UpdateFields.h:131
Definition: Unit.h:335
Definition: Unit.h:449
static TorlothCinematic TorlothAnim[]
Definition: zone_shadowmoon_valley.cpp:1006
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:267
Definition: Creature.h:46
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3529
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:862
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:652
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:15379
MotionMaster * GetMotionMaster()
Definition: Unit.h:2530
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2345
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1480
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
uint32 Timer
Definition: zone_shadowmoon_valley.cpp:1002
uint32 AnimationTimer
Definition: zone_shadowmoon_valley.cpp:1094
ObjectGuid AggroTargetGUID
Definition: zone_shadowmoon_valley.cpp:1099
ObjectGuid LordIllidanGUID
Definition: zone_shadowmoon_valley.cpp:1098
uint8 AnimationCount
Definition: zone_shadowmoon_valley.cpp:1096

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.

1214 {
1215 switch (killer->GetTypeId())
1216 {
1217 case TYPEID_UNIT:
1218 if (Unit* owner = killer->GetOwner())
1219 if (Player* player = owner->ToPlayer())
1220 player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
1221 break;
1222 case TYPEID_PLAYER:
1223 if (Player* player = killer->ToPlayer())
1224 player->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me);
1225 break;
1226 default:
1227 break;
1228 }
1231 LordIllidan->AI()->EnterEvadeMode();
1232 }
Definition: ObjectGuid.h:37
Definition: ObjectGuid.h:38
Definition: zone_shadowmoon_valley.cpp:996
Player * ToPlayer()
Definition: Object.h:195
TypeID GetTypeId() const
Definition: Object.h:121
Definition: Unit.h:1290
Unit * GetOwner() const
Definition: Unit.cpp:11404

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

◆ Reset()

void npc_torloth_the_magnificent::npc_torloth_the_magnificentAI::Reset ( )

Reimplemented from ScriptedAI.

1104 {
1105 AnimationTimer = 4000;
1106 AnimationCount = 0;
1109 Timers = false;
1113 me->SetTarget();
1114 }
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:1479

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.

1164 {
1165 if (AnimationTimer)
1166 {
1167 if (AnimationTimer <= diff)
1168 {
1170 }
1171 else AnimationTimer -= diff;
1172 }
1174 if (AnimationCount < 6)
1175 {
1176 me->CombatStop();
1177 }
1178 else if (!Timers)
1179 {
1183 Timers = true;
1184 }
1186 if (Timers)
1187 {
1188 if (SpellTimer1 <= diff)
1189 {
1190 DoCastVictim(SpawnCast[6].SpellId);//Cleave
1191 SpellTimer1 = SpawnCast[6].Timer2 + (rand() % 10 * 1000);
1192 }
1193 else SpellTimer1 -= diff;
1195 if (SpellTimer2 <= diff)
1196 {
1197 DoCastVictim(SpawnCast[7].SpellId);//Shadowfury
1198 SpellTimer2 = SpawnCast[7].Timer2 + (rand() % 5 * 1000);
1199 }
1200 else SpellTimer2 -= diff;
1202 if (SpellTimer3 <= diff)
1203 {
1204 DoCast(me, SpawnCast[8].SpellId);
1205 SpellTimer3 = SpawnCast[8].Timer2 + (rand() % 7 * 1000); //Spell Reflection
1206 }
1207 else SpellTimer3 -= diff;
1208 }
1211 }
static SpawnSpells SpawnCast[]
Definition: zone_shadowmoon_valley.cpp:1063
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:11245
uint32 Timer2
Definition: zone_silithus.cpp:284
uint32 Timer1
Definition: zone_silithus.cpp:284
uint32 SpellTimer3
Definition: zone_shadowmoon_valley.cpp:1094
uint32 SpellTimer2
Definition: zone_shadowmoon_valley.cpp:1094
uint32 SpellTimer1
Definition: zone_shadowmoon_valley.cpp:1094
void HandleAnimation()
Definition: zone_shadowmoon_valley.cpp:1118

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