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.
 
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.
 
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.
 
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
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
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)
 
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 *)
 
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 ()
 
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 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 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
 
- 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
693: BossAI(creature, bossId), isCalledBySartharion(false), currentPatrolPoint(0) { }
Definition ScriptedCreature.h:485
uint8 currentPatrolPoint
Definition boss_sartharion.cpp:993
bool isCalledBySartharion
Definition boss_sartharion.cpp:992

Member Function Documentation

◆ ClearInstance()

virtual void boss_sartharion_dragonAI::ClearInstance ( )
inlinevirtual

Reimplemented in boss_sartharion_tenebron, and boss_sartharion_vesperon.

910 {
911 events.Reset();
913 // Remove phase shift
916 }
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:683
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void RemoveTwilightPortal()
Definition boss_sartharion.cpp:979

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.

714 {
716 {
719 }
720 else if (param == ACTION_START_PATROL)
722 }
@ 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:990

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
919 {
920 if (eventId == EVENT_MINIDRAKE_SPEECH)
921 {
922 // Dragon speaks and starts flying to landing position
925 me->SetDisableGravity(true);
926 me->SetHover(true);
928 me->SetSpeed(MOVE_FLIGHT, 3.0f);
930 }
931 else if (eventId == EVENT_DRAGON_START_PATROL)
932 {
934 me->SetDisableGravity(true);
935 me->SetHover(true);
938
939 // Start patrol using custom waypoint system
941 }
942 else if (eventId == EVENT_DRAGON_PATROL_WAYPOINT)
943 {
944 // Only continue patrol if not in combat and still selectable flag is set
946 {
947 // Ensure flying flags are maintained
948 me->SetDisableGravity(true);
949 me->SetHover(true);
951
952 // Get the appropriate patrol path based on creature entry
953 Position const* patrolPath = nullptr;
954 switch (me->GetEntry())
955 {
956 case NPC_VESPERON:
957 patrolPath = VesperonPatrolPath;
958 break;
959 case NPC_TENEBRON:
960 patrolPath = TenebronPatrolPath;
961 break;
962 case NPC_SHADRON:
963 patrolPath = ShadronPatrolPath;
964 break;
965 default:
966 return;
967 }
968
969 // Move to next patrol point (use pointId 100+ to identify patrol points)
971
972 // Cycle to next waypoint
974 }
975 }
976 }
@ 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 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:12084
MotionMaster * GetMotionMaster()
Definition Unit.h:1748
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:747
void SetHover(bool enable)
Definition Unit.cpp:16862
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:11390
void SetDisableGravity(bool disable)
Definition Unit.cpp:16725
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
bool IsInCombat() const
Definition Unit.h:934
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 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.

808 {
809 //_JustDied();
810 events.Reset();
811
812 // Despawn minions only if not called by Sartharion
815
816 switch (me->GetEntry())
817 {
818 case NPC_TENEBRON:
819 {
823 break;
824 }
825 case NPC_SHADRON:
826 {
829 {
831 sartharion->RemoveAura(SPELL_GIFT_OF_TWILIGHT_FIRE);
832 }
833
836 break;
837 }
838 case NPC_VESPERON:
839 {
844 break;
845 }
846 }
847
850 else
851 {
853 sartharion->AI()->DoAction(ACTION_DRAKE_DIED);
854 }
855 }
@ 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_GIFT_OF_TWILIGHT_FIRE
Definition boss_sartharion.cpp:100
Definition Creature.h:47
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:385
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:242
virtual void DoAction(int32)
Definition InstanceScript.h:274
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
@ ACTION_CLEAR_PORTAL
Definition obsidian_sanctum.h:59
virtual void ClearInstance()
Definition boss_sartharion.cpp:909

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

Referenced by boss_sartharion_tenebron::JustDied().

◆ JustEngagedWith()

void boss_sartharion_dragonAI::JustEngagedWith ( Unit )
inlinefinalvirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

765 {
766 me->setActive(true);
769
770 if (me->IsFlying())
771 {
772 me->SetSpeed(MOVE_FLIGHT, 1.0f);
773 }
774
776 {
777 switch (me->GetEntry())
778 {
779 case NPC_TENEBRON:
780 {
782 break;
783 }
784 case NPC_SHADRON:
785 {
787 break;
788 }
789 case NPC_VESPERON:
790 {
792 break;
793 }
794 }
795 }
796
798 me->SetLootMode(0);
799
801 {
802 if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 500, true, false))
803 AttackStart(target);
804 }
805 }
@ SAY_TENEBRON_AGGRO
Definition boss_sartharion.cpp:42
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:103
void SetLootMode(uint16 lootMode)
Definition Creature.h:244
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:110
Definition Unit.h:664
bool IsFlying() const
Definition Unit.h:1703
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.

753 {
754 // Transfer summons to Sartharion
756 {
758 sartharion->AI()->JustSummoned(summon);
759 }
760
761 BossAI::JustSummoned(summon);
762 }
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:724

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.

858 {
859 if (!victim->IsPlayer() || urand(0, 2))
860 return;
861
862 switch (me->GetEntry())
863 {
864 case NPC_TENEBRON:
865 {
867 break;
868 }
869 case NPC_SHADRON:
870 {
872 break;
873 }
874 case NPC_VESPERON:
875 {
877 break;
878 }
879 }
880 }
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.

725 {
726 // Prevent aggro during patrol (NOT_SELECTABLE set) and while flying to landing position
728 return;
729
731 }
virtual void MoveInLineOfSight(Unit *)
Definition CreatureAI.cpp:166

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.

734 {
735 if (type == POINT_MOTION_TYPE && pointId == POINT_LANDING)
736 {
737 // Dragon has landed - set ground flags
739 me->SetDisableGravity(false);
740 me->SetHover(false);
742 me->SetImmuneToNPC(false);
744 }
745 else if (type == POINT_MOTION_TYPE && pointId >= 100 && pointId < 200)
746 {
747 // Patrol waypoint reached - schedule next waypoint
749 }
750 }
@ 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:2789
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10565
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
980 {
981 if (portalGUID)
982 {
984 gobj->Delete();
985
987 }
988 }
Definition GameObject.h:120
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2362
void Clear()
Definition ObjectGuid.h:138
Map * GetMap() const
Definition Object.h:624
ObjectGuid portalGUID
Definition boss_sartharion.cpp:991

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.

883 {
884 extraEvents.Update(diff);
885 while (uint32 const eventId = extraEvents.ExecuteEvent())
886 {
887 HandleExtraEvent(eventId);
888 }
889
890 if (!UpdateVictim())
891 return;
892
893 events.Update(diff);
894
896 return;
897
898 while (uint32 const eventId = events.ExecuteEvent())
899 {
900 ExecuteEvent(eventId);
901
903 return;
904 }
905
907 }
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:277
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:86
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void HandleExtraEvent(uint32 const eventId)
Definition boss_sartharion.cpp:918

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: