AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_sartharion_dragonAI Struct Reference
Inheritance diagram for boss_sartharion_dragonAI:
BossAI ScriptedAI CreatureAI UnitAI boss_sartharion_shadron boss_sartharion_tenebron boss_sartharion_vesperon

Public Member Functions

 boss_sartharion_dragonAI (Creature *creature, uint32 bossId)
 
void Reset () override
 
void DoAction (int32 param) final
 
void MoveInLineOfSight (Unit *who) final
 
void MovementInform (uint32 type, uint32 pointId) final
 
void JustSummoned (Creature *summon) override
 
void JustEngagedWith (Unit *) final
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) final
 
void UpdateAI (uint32 diff) final
 Use to start attacking a target. Called just before JustEngagedWith()
 
virtual void ClearInstance ()
 
void HandleExtraEvent (uint32 const eventId)
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
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)
 
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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- 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)
 
WorldObjectGetSummoner () 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 IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
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)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, 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 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 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
 

Protected Member Functions

void RemoveTwilightPortal ()
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- 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

EventMap extraEvents
 
ObjectGuid portalGUID
 
bool isCalledBySartharion
 
uint8 currentPatrolPoint
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- 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
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- 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 CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_sartharion_dragonAI()

boss_sartharion_dragonAI::boss_sartharion_dragonAI ( Creature creature,
uint32  bossId 
)
inline
695: BossAI(creature, bossId), isCalledBySartharion(false), currentPatrolPoint(0) { }
Definition ScriptedCreature.h:485
uint8 currentPatrolPoint
Definition boss_sartharion.cpp:1001
bool isCalledBySartharion
Definition boss_sartharion.cpp:1000

Member Function Documentation

◆ ClearInstance()

virtual void boss_sartharion_dragonAI::ClearInstance ( )
inlinevirtual

Reimplemented in boss_sartharion_tenebron, and boss_sartharion_vesperon.

917 {
918 events.Reset();
920 // Remove phase shift
923 }
events
Definition boss_sartura.cpp:43
InstanceScript *const instance
Definition ScriptedCreature.h:492
SummonList summons
Definition ScriptedCreature.h:539
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:694
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void RemoveTwilightPortal()
Definition boss_sartharion.cpp:987

References SummonList::DespawnAll(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), BossAI::instance, RemoveTwilightPortal(), SPELL_TWILIGHT_SHIFT, and BossAI::summons.

Referenced by boss_sartharion_tenebron::ClearInstance(), boss_sartharion_vesperon::ClearInstance(), JustDied(), Reset(), and boss_sartharion_shadron::SummonedCreatureDies().

◆ DoAction()

void boss_sartharion_dragonAI::DoAction ( int32  param)
inlinefinalvirtual

Reimplemented from UnitAI.

716 {
718 {
721 }
722 else if (param == ACTION_START_PATROL)
724 }
@ ACTION_CALL_DRAGON
Definition boss_sartharion.cpp:133
@ EVENT_MINIDRAKE_SPEECH
Definition boss_sartharion.cpp:179
@ EVENT_DRAGON_START_PATROL
Definition boss_sartharion.cpp:161
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:70
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:48
@ ACTION_START_PATROL
Definition obsidian_sanctum.h:63
EventMap extraEvents
Definition boss_sartharion.cpp:998

References ACTION_CALL_DRAGON, ACTION_START_PATROL, EVENT_DRAGON_START_PATROL, EVENT_MINIDRAKE_SPEECH, extraEvents, isCalledBySartharion, EventMap::RescheduleEvent(), and EventMap::ScheduleEvent().

◆ HandleExtraEvent()

void boss_sartharion_dragonAI::HandleExtraEvent ( uint32 const  eventId)
inline
926 {
927 if (eventId == EVENT_MINIDRAKE_SPEECH)
928 {
929 // Dragon speaks and starts flying to landing position
933 me->SetDisableGravity(true);
934 me->SetHover(true);
936 me->SetSpeed(MOVE_FLIGHT, 3.0f);
938 }
939 else if (eventId == EVENT_DRAGON_START_PATROL)
940 {
942 me->SetDisableGravity(true);
943 me->SetHover(true);
946
947 // Start patrol using custom waypoint system
949 }
950 else if (eventId == EVENT_DRAGON_PATROL_WAYPOINT)
951 {
952 // Only continue patrol if not in combat and still selectable flag is set
954 {
955 // Ensure flying flags are maintained
956 me->SetDisableGravity(true);
957 me->SetHover(true);
959
960 // Get the appropriate patrol path based on creature entry
961 Position const* patrolPath = nullptr;
962 switch (me->GetEntry())
963 {
964 case NPC_VESPERON:
965 patrolPath = VesperonPatrolPath;
966 break;
967 case NPC_TENEBRON:
968 patrolPath = TenebronPatrolPath;
969 break;
970 case NPC_SHADRON:
971 patrolPath = ShadronPatrolPath;
972 break;
973 default:
974 return;
975 }
976
977 // Move to next patrol point (use pointId 100+ to identify patrol points)
979
980 // Cycle to next waypoint
982 }
983 }
984 }
@ MOVE_FLIGHT
Definition UnitDefines.h:362
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
const Position TenebronPatrolPath[8]
Definition boss_sartharion.cpp:243
@ SAY_DRAKE_RESPOND
Definition boss_sartharion.cpp:39
const Position VesperonPatrolPath[8]
Definition boss_sartharion.cpp:230
@ POINT_LANDING
Definition boss_sartharion.cpp:137
static Position const & GetDragonLandingPos(uint32 entry)
Definition boss_sartharion.cpp:291
const Position ShadronPatrolPath[8]
Definition boss_sartharion.cpp:256
@ EVENT_DRAGON_PATROL_WAYPOINT
Definition boss_sartharion.cpp:162
void CancelEvent(EventId eventId)
Definition EventMap.cpp:160
void Clear(bool reset=true)
Definition MotionMaster.h:193
void MovePoint(uint32 id, const Position &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:240
uint32 GetEntry() const
Definition Object.h:117
void SetAnimTier(AnimTier animTier)
Definition Unit.cpp:11915
MotionMaster * GetMotionMaster()
Definition Unit.h:1759
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:747
void SetHover(bool enable)
Definition Unit.cpp:16634
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:11296
void SetDisableGravity(bool disable)
Definition Unit.cpp:16497
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
bool IsInCombat() const
Definition Unit.h:935
Talk
Definition hyjal.cpp:82
@ NPC_VESPERON
Definition obsidian_sanctum.h:44
@ NPC_SHADRON
Definition obsidian_sanctum.h:43
@ NPC_TENEBRON
Definition obsidian_sanctum.h:42
Definition Position.h:27
Creature * me
Definition ScriptedCreature.h:281

References EventMap::CancelEvent(), MotionMaster::Clear(), currentPatrolPoint, EVENT_DRAGON_PATROL_WAYPOINT, EVENT_DRAGON_START_PATROL, EVENT_MINIDRAKE_SPEECH, extraEvents, Fly, GetDragonLandingPos(), Object::GetEntry(), Unit::GetMotionMaster(), Unit::HasUnitFlag(), Unit::IsInCombat(), ScriptedAI::me, MOVE_FLIGHT, MotionMaster::MovePoint(), NPC_SHADRON, NPC_TENEBRON, NPC_VESPERON, POINT_LANDING, SAY_DRAKE_RESPOND, EventMap::ScheduleEvent(), Unit::SetAnimTier(), Unit::SetDisableGravity(), Unit::SetHover(), Unit::SetSpeed(), Unit::SetUnitFlag(), ShadronPatrolPath, TenebronPatrolPath, UNIT_FLAG_NOT_SELECTABLE, and VesperonPatrolPath.

Referenced by UpdateAI().

◆ JustDied()

void boss_sartharion_dragonAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

Reimplemented in boss_sartharion_tenebron.

810 {
811 //_JustDied();
812 events.Reset();
813
814 // Despawn minions only if not called by Sartharion
817
818 switch (me->GetEntry())
819 {
820 case NPC_TENEBRON:
821 {
825 break;
826 }
827 case NPC_SHADRON:
828 {
831 {
833 sartharion->RemoveAura(SPELL_GIFT_OF_TWILIGHT_FIRE);
834 }
835
838 break;
839 }
840 case NPC_VESPERON:
841 {
848 break;
849 }
850 }
851
853 {
856 }
857 else
858 {
860 sartharion->AI()->DoAction(ACTION_DRAKE_DIED);
861 }
862 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ DONE
Definition InstanceScript.h:61
@ SAY_TENEBRON_DEATH
Definition boss_sartharion.cpp:44
@ SAY_SHADRON_DEATH
Definition boss_sartharion.cpp:52
@ SAY_VESPERON_DEATH
Definition boss_sartharion.cpp:60
@ ACTION_DRAKE_DIED
Definition boss_sartharion.cpp:134
@ SPELL_TWILIGHT_TORMENT_VESPERON
Definition boss_sartharion.cpp:80
@ SPELL_GIFT_OF_TWILIGHT_FIRE
Definition boss_sartharion.cpp:100
Definition Creature.h:47
void PermBindAllPlayers()
Definition Map.cpp:2187
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:396
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:111
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
virtual void DoAction(int32)
Definition InstanceScript.h:286
InstanceMap * ToInstanceMap()
Definition Map.h:381
Map * GetMap() const
Definition Object.h:625
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:210
@ DATA_VESPERON
Definition obsidian_sanctum.h:32
@ DATA_TENEBRON
Definition obsidian_sanctum.h:31
@ DATA_SARTHARION
Definition obsidian_sanctum.h:30
@ DATA_SHADRON
Definition obsidian_sanctum.h:33
@ SPELL_TWILIGHT_TORMENT_SARTHARION
Definition obsidian_sanctum.h:53
@ ACTION_CLEAR_PORTAL
Definition obsidian_sanctum.h:59
virtual void ClearInstance()
Definition boss_sartharion.cpp:916

References ACTION_CLEAR_PORTAL, ACTION_DRAKE_DIED, ClearInstance(), DATA_SARTHARION, DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, SummonList::DespawnAll(), InstanceScript::DoAction(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), Object::GetEntry(), InstanceScript::GetGuidData(), WorldObject::GetMap(), IN_PROGRESS, BossAI::instance, isCalledBySartharion, ScriptedAI::me, NPC_SHADRON, NPC_TENEBRON, NPC_VESPERON, InstanceMap::PermBindAllPlayers(), SAY_SHADRON_DEATH, SAY_TENEBRON_DEATH, SAY_VESPERON_DEATH, InstanceScript::SetBossState(), SPELL_GIFT_OF_TWILIGHT_FIRE, SPELL_TWILIGHT_TORMENT_SARTHARION, SPELL_TWILIGHT_TORMENT_VESPERON, BossAI::summons, and Map::ToInstanceMap().

Referenced by boss_sartharion_tenebron::JustDied().

◆ JustEngagedWith()

void boss_sartharion_dragonAI::JustEngagedWith ( Unit )
inlinefinalvirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

767 {
768 me->setActive(true);
771
772 if (me->IsFlying())
773 {
774 me->SetSpeed(MOVE_FLIGHT, 1.0f);
775 }
776
778 {
779 switch (me->GetEntry())
780 {
781 case NPC_TENEBRON:
782 {
784 break;
785 }
786 case NPC_SHADRON:
787 {
789 break;
790 }
791 case NPC_VESPERON:
792 {
794 break;
795 }
796 }
797 }
798
800 me->SetLootMode(0);
801
803 {
804 if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 500, true, false))
805 AttackStart(target);
806 }
807 }
@ SAY_TENEBRON_AGGRO
Definition boss_sartharion.cpp:42
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:117
void SetLootMode(uint16 lootMode)
Definition Creature.h:247
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:111
Definition Unit.h:664
bool IsFlying() const
Definition Unit.h:1714
void setActive(bool isActiveObject)
Definition Object.cpp:1082
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References ScriptedAI::AttackStart(), DATA_SARTHARION, DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, DONE, CreatureAI::DoZoneInCombat(), InstanceScript::GetBossState(), Object::GetEntry(), IN_PROGRESS, BossAI::instance, isCalledBySartharion, Unit::IsFlying(), MaxThreat, ScriptedAI::me, MOVE_FLIGHT, NPC_SHADRON, NPC_TENEBRON, NPC_VESPERON, SAY_TENEBRON_AGGRO, UnitAI::SelectTarget(), WorldObject::setActive(), InstanceScript::SetBossState(), Creature::SetLootMode(), and Unit::SetSpeed().

◆ JustSummoned()

void boss_sartharion_dragonAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

Reimplemented in boss_sartharion_tenebron.

755 {
756 // Transfer summons to Sartharion
758 {
760 sartharion->AI()->JustSummoned(summon);
761 }
762
763 BossAI::JustSummoned(summon);
764 }
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725

References DATA_SARTHARION, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), IN_PROGRESS, BossAI::instance, isCalledBySartharion, BossAI::JustSummoned(), and ScriptedAI::me.

◆ KilledUnit()

void boss_sartharion_dragonAI::KilledUnit ( Unit victim)
inlinefinalvirtual

Reimplemented from CreatureAI.

865 {
866 if (!victim->IsPlayer() || urand(0, 2))
867 return;
868
869 switch (me->GetEntry())
870 {
871 case NPC_TENEBRON:
872 {
874 break;
875 }
876 case NPC_SHADRON:
877 {
879 break;
880 }
881 case NPC_VESPERON:
882 {
884 break;
885 }
886 }
887 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_SHADRON_SLAY
Definition boss_sartharion.cpp:51
@ SAY_TENEBRON_SLAY
Definition boss_sartharion.cpp:43
@ SAY_VESPERON_SLAY
Definition boss_sartharion.cpp:59
bool IsPlayer() const
Definition Object.h:201

References Object::GetEntry(), ScriptedAI::me, NPC_SHADRON, NPC_TENEBRON, NPC_VESPERON, SAY_SHADRON_SLAY, SAY_TENEBRON_SLAY, SAY_VESPERON_SLAY, and urand().

◆ MoveInLineOfSight()

void boss_sartharion_dragonAI::MoveInLineOfSight ( Unit who)
inlinefinalvirtual

Reimplemented from CreatureAI.

727 {
728 // Prevent aggro during patrol (NOT_SELECTABLE set) and while flying to landing position
730 return;
731
733 }
virtual void MoveInLineOfSight(Unit *)
Definition CreatureAI.cpp:180

References Unit::HasUnitFlag(), isCalledBySartharion, ScriptedAI::me, CreatureAI::MoveInLineOfSight(), and UNIT_FLAG_NOT_SELECTABLE.

◆ MovementInform()

void boss_sartharion_dragonAI::MovementInform ( uint32  type,
uint32  pointId 
)
inlinefinalvirtual

Reimplemented from CreatureAI.

736 {
737 if (type == POINT_MOTION_TYPE && pointId == POINT_LANDING)
738 {
739 // Dragon has landed - set ground flags
741 me->SetDisableGravity(false);
742 me->SetHover(false);
744 me->SetImmuneToNPC(false);
746 }
747 else if (type == POINT_MOTION_TYPE && pointId >= 100 && pointId < 200)
748 {
749 // Patrol waypoint reached - schedule next waypoint
751 }
752 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2850
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10644
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749

References EVENT_DRAGON_PATROL_WAYPOINT, extraEvents, Ground, ScriptedAI::me, POINT_LANDING, POINT_MOTION_TYPE, Unit::RemoveUnitFlag(), EventMap::ScheduleEvent(), Unit::SetAnimTier(), Unit::SetDisableGravity(), Unit::SetHover(), Unit::SetImmuneToNPC(), Creature::SetInCombatWithZone(), and UNIT_FLAG_NOT_SELECTABLE.

◆ RemoveTwilightPortal()

void boss_sartharion_dragonAI::RemoveTwilightPortal ( )
inlineprotected
988 {
989 if (portalGUID)
990 {
992 gobj->Delete();
993
995 }
996 }
Definition GameObject.h:120
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2354
void Clear()
Definition ObjectGuid.h:138
ObjectGuid portalGUID
Definition boss_sartharion.cpp:999

References ObjectGuid::Clear(), Map::GetGameObject(), WorldObject::GetMap(), ScriptedAI::me, and portalGUID.

Referenced by ClearInstance(), and boss_sartharion_tenebron::ExecuteEvent().

◆ Reset()

◆ UpdateAI()

void boss_sartharion_dragonAI::UpdateAI ( uint32  )
inlinefinalvirtual

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

Implements UnitAI.

890 {
891 extraEvents.Update(diff);
892 while (uint32 const eventId = extraEvents.ExecuteEvent())
893 {
894 HandleExtraEvent(eventId);
895 }
896
897 if (!UpdateVictim())
898 return;
899
900 events.Update(diff);
901
903 return;
904
905 while (uint32 const eventId = events.ExecuteEvent())
906 {
907 ExecuteEvent(eventId);
908
910 return;
911 }
912
914 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
virtual void ExecuteEvent(uint32)
Definition ScriptedCreature.h:520
bool UpdateVictim()
Definition CreatureAI.cpp:350
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:86
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void HandleExtraEvent(uint32 const eventId)
Definition boss_sartharion.cpp:925

References UnitAI::DoMeleeAttackIfReady(), EventMap::ExecuteEvent(), BossAI::ExecuteEvent(), extraEvents, HandleExtraEvent(), Unit::HasUnitState(), ScriptedAI::me, UNIT_STATE_CASTING, EventMap::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ currentPatrolPoint

uint8 boss_sartharion_dragonAI::currentPatrolPoint
protected

Referenced by HandleExtraEvent().

◆ extraEvents

EventMap boss_sartharion_dragonAI::extraEvents
protected

◆ isCalledBySartharion

◆ portalGUID


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