AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_malygos::boss_malygosAI Struct Reference
Inheritance diagram for boss_malygos::boss_malygosAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_malygosAI (Creature *c)
 
void InitializeAI () override
 
void Reset () override
 
void MovementInform (uint32 type, uint32 id) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *victim) override
 
void DamageTaken (Unit *, uint32 &damage, 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 *victim) override
 
void JustSummoned (Creature *summon) override
 
void MoveInLineOfSight (Unit *) override
 
void EnterEvadeMode (EvadeReason why) override
 
void HandleIntroSpeech (const uint32 diff)
 
- 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 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 bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellCastFinished (SpellInfo const *, SpellFinishReason)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 ()
 
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 DoAction (int32)
 
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
 

Public Attributes

InstanceScriptpInstance
 
EventMap events
 
SummonList summons
 
uint32 timer1
 
uint32 timer2
 
uint8 IntroCounter
 
bool bLockHealthCheck
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 ()
 
- 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)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_malygosAI()

boss_malygos::boss_malygosAI::boss_malygosAI ( Creature c)
inline
203 : ScriptedAI(c), summons(me)
204 {
206 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1214
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
InstanceScript * pInstance
Definition boss_malygos.cpp:208
SummonList summons
Definition boss_malygos.cpp:210

References WorldObject::GetInstanceScript(), ScriptedAI::me, and pInstance.

Member Function Documentation

◆ AttackStart()

void boss_malygos::boss_malygosAI::AttackStart ( Unit victim)
inlineoverridevirtual

Reimplemented from UnitAI.

329 {
330 if (!victim)
331 return;
332
334 {
336 me->SetTarget(victim->GetGUID());
337 }
338 else if (me->Attack(victim, true))
339 {
341 me->GetMotionMaster()->MoveChase(victim);
342 else
343 me->SetTarget();
344 }
345 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:271
@ UNIT_FIELD_TARGET
Definition UpdateFields.h:92
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3435
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:314
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:113
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:326
MotionMaster * GetMotionMaster()
Definition Unit.h:1738
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:737
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:10451
Unit * GetVictim() const
Definition Unit.h:893

References Unit::Attack(), Object::GetGUID(), Object::GetGuidValue(), Unit::GetMotionMaster(), Unit::GetVictim(), Unit::HasUnitFlag(), ScriptedAI::me, MotionMaster::MoveChase(), Creature::SetTarget(), UNIT_FIELD_TARGET, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_PACIFIED.

Referenced by UpdateAI().

◆ DamageTaken()

void boss_malygos::boss_malygosAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

348 {
349 if (damage >= me->GetHealth() && !me->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) // allow dying only in phase 3!
350 {
351 damage = 0;
352 return;
353 }
354
355 if (!bLockHealthCheck && me->HealthBelowPctDamaged(50, damage))
356 {
357 bLockHealthCheck = true;
358 events.RescheduleEvent(EVENT_START_PHASE_2, 0ms, 1);
359 }
360 }
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:256
@ EVENT_START_PHASE_2
Definition boss_malygos.cpp:107
events
Definition boss_sartura.cpp:43
uint32 GetHealth() const
Definition Unit.h:1093
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1102
bool bLockHealthCheck
Definition boss_malygos.cpp:214

References bLockHealthCheck, EVENT_START_PHASE_2, Unit::GetHealth(), Unit::HasUnitFlag(), Unit::HealthBelowPctDamaged(), ScriptedAI::me, and UNIT_FLAG_DISABLE_MOVE.

◆ EnterEvadeMode()

void boss_malygos::boss_malygosAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

804 {
805 me->SetDisableGravity(true);
807
810 }
@ LIGHT_GET_DEFAULT_FOR_MAP
Definition boss_malygos.cpp:184
#define AREA_EYE_OF_ETERNITY
Definition boss_malygos.cpp:180
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:205
void SetZoneOverrideLight(uint32 zoneId, uint32 lightId, Milliseconds fadeInTime)
Definition Map.cpp:2898
void SetDisableGravity(bool disable)
Definition Unit.cpp:20547
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:739
Map * GetMap() const
Definition Object.h:620

References AREA_EYE_OF_ETERNITY, CreatureAI::EnterEvadeMode(), WorldObject::GetMap(), LIGHT_GET_DEFAULT_FOR_MAP, ScriptedAI::me, Unit::RemoveUnitFlag(), Unit::SetDisableGravity(), Map::SetZoneOverrideLight(), and UNIT_FLAG_DISABLE_MOVE.

◆ HandleIntroSpeech()

void boss_malygos::boss_malygosAI::HandleIntroSpeech ( const uint32  diff)
inline
813 {
814 if (me->IsInCombat() || me->isDead())
815 return;
816
817 // speech timer
818 if (timer1 <= diff)
819 {
822 if (++IntroCounter >= 5)
823 IntroCounter = 0;
824 }
825 else
826 timer1 -= diff;
827
828 // movement timer
829 if (timer2)
830 {
831 if (timer2 <= diff)
832 {
833 timer2 = 0;
834 uint32 tmp = urand(0, 3);
837 }
838 else
839 timer2 -= diff;
840 }
841 }
std::uint32_t uint32
Definition Define.h:107
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ MOVEMENTFLAG_WALKING
Definition UnitDefines.h:377
@ MI_POINT_INTRO_SIDE_0
Definition boss_malygos.cpp:34
@ SAY_INTRO
Definition boss_malygos.cpp:141
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:238
void RemoveUnitMovementFlag(uint32 f)
Definition Unit.h:763
bool IsInCombat() const
Definition Unit.h:924
bool isDead() const
Definition Unit.h:1775
const uint32 MalygosIntroIntervals[]
Definition eye_of_eternity.h:105
const Position FourSidesPos[]
Definition eye_of_eternity.h:95
Talk
Definition hyjal.cpp:82
uint8 IntroCounter
Definition boss_malygos.cpp:213
uint32 timer1
Definition boss_malygos.cpp:212
uint32 timer2
Definition boss_malygos.cpp:212

References FourSidesPos, Unit::GetMotionMaster(), IntroCounter, Unit::isDead(), Unit::IsInCombat(), MalygosIntroIntervals, ScriptedAI::me, MI_POINT_INTRO_SIDE_0, MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), Unit::RemoveUnitMovementFlag(), SAY_INTRO, timer1, timer2, and urand().

Referenced by UpdateAI().

◆ InitializeAI()

void boss_malygos::boss_malygosAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

217 {
218 me->SetDisableGravity(true);
219 Reset();
220 }
void Reset() override
Definition boss_malygos.cpp:222

References ScriptedAI::me, Reset(), and Unit::SetDisableGravity().

◆ JustDied()

void boss_malygos::boss_malygosAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

762 {
764 if (pInstance)
765 {
768 }
769 }
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition DBCEnums.h:122
@ DONE
Definition InstanceScript.h:61
@ SAY_DEATH
Definition boss_malygos.cpp:158
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition InstanceScript.cpp:656
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ NPC_MALYGOS
Definition eye_of_eternity.h:39
@ DATA_ENCOUNTER_STATUS
Definition eye_of_eternity.h:57

References ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, DATA_ENCOUNTER_STATUS, DONE, InstanceScript::DoUpdateAchievementCriteria(), NPC_MALYGOS, pInstance, SAY_DEATH, and ZoneScript::SetData().

◆ JustEngagedWith()

void boss_malygos::boss_malygosAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

317 {
318 events.Reset();
320
322
323 events.RescheduleEvent(EVENT_INTRO_MOVE_CENTER, 0ms, 1);
324 if (pInstance)
326 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ SAY_PHASE_1
Definition boss_malygos.cpp:142
@ EVENT_INTRO_MOVE_CENTER
Definition boss_malygos.cpp:91
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:103

References DATA_ENCOUNTER_STATUS, CreatureAI::DoZoneInCombat(), EVENT_INTRO_MOVE_CENTER, IN_PROGRESS, pInstance, SAY_PHASE_1, and ZoneScript::SetData().

◆ JustSummoned()

void boss_malygos::boss_malygosAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

785 {
786 if (!summon)
787 return;
788 summons.Summon(summon);
789 switch (summon->GetEntry())
790 {
792 summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
793 summon->DespawnOrUnsummon(45s);
794 break;
795 case NPC_STATIC_FIELD:
796 summon->DespawnOrUnsummon(20s);
797 break;
798 }
799 }
@ SPELL_ARCANE_OVERLOAD_DMG
Definition boss_malygos.cpp:70
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2178
uint32 GetEntry() const
Definition Object.h:116
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1194
@ NPC_ARCANE_OVERLOAD
Definition eye_of_eternity.h:47
@ NPC_STATIC_FIELD
Definition eye_of_eternity.h:50

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), Object::GetEntry(), NPC_ARCANE_OVERLOAD, NPC_STATIC_FIELD, SPELL_ARCANE_OVERLOAD_DMG, SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_malygos::boss_malygosAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

772 {
773 if (victim && victim->GetGUID() == me->GetGUID())
774 return;
775
776 if (events.IsInPhase(PHASE_ONE))
778 else if (events.IsInPhase(PHASE_TWO))
780 else
782 }
@ PHASE_ONE
Definition boss_malygos.cpp:173
@ PHASE_TWO
Definition boss_malygos.cpp:174
@ SAY_SLAY_P1
Definition boss_malygos.cpp:144
@ SAY_SLAY_P2
Definition boss_malygos.cpp:149
@ SAY_SLAY_P3
Definition boss_malygos.cpp:156

References Object::GetGUID(), ScriptedAI::me, PHASE_ONE, PHASE_TWO, SAY_SLAY_P1, SAY_SLAY_P2, and SAY_SLAY_P3.

◆ MoveInLineOfSight()

void boss_malygos::boss_malygosAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

801{}

◆ MovementInform()

void boss_malygos::boss_malygosAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

247 {
248 if (type == POINT_MOTION_TYPE)
249 {
250 switch (id)
251 {
256 {
257 float angle = me->GetOrientation();
258 float dist = 75.0f;
259 if (Creature* c = me->SummonCreature(NPC_PORTAL, me->GetPositionX() + cos(angle) * dist, me->GetPositionY() + std::sin(angle) * dist, me->GetPositionZ(), FourSidesPos[id].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 13000))
260 me->CastSpell(c, SPELL_PORTAL_BEAM, false);
262 }
263 break;
264
266 events.RescheduleEvent(EVENT_INTRO_LAND, 0ms, 1);
267 break;
270 c->CastSpell(c, SPELL_VORTEX_VISUAL, true);
271 events.RescheduleEvent(EVENT_START_VORTEX_REAL, 1s, 1);
272 break;
274 events.RescheduleEvent(EVENT_START_PHASE_2_FLY_UP, 0ms, 1);
275 break;
277 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 0ms, 1);
278 break;
280 events.RescheduleEvent(EVENT_SURGE_OF_POWER_WARNING, 0ms, 1);
281 break;
283 me->SetDisableGravity(false);
284 events.RescheduleEvent(EVENT_START_FIGHT, 0ms, 1);
285 break;
287 events.RescheduleEvent(EVENT_VORTEX_FLY_TO_CENTER, 0ms, 1);
288 break;
290 me->SetDisableGravity(false);
291 events.RescheduleEvent(EVENT_VORTEX_LAND_1, 0ms, 1);
292 break;
295 break;
297 events.RescheduleEvent(EVENT_START_PHASE_3, 6s, 1);
298 break;
299 }
300 }
301 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
@ LIGHT_ARCANE_RUNES
Definition boss_malygos.cpp:187
@ MI_POINT_CIRCLE_OUTSIDE_PH_2
Definition boss_malygos.cpp:47
@ MI_POINT_VORTEX_CENTER
Definition boss_malygos.cpp:42
@ MI_POINT_INTRO_SIDE_3
Definition boss_malygos.cpp:37
@ MI_POINT_INTRO_SIDE_2
Definition boss_malygos.cpp:36
@ MI_POINT_INTRO_SIDE_1
Definition boss_malygos.cpp:35
@ MI_POINT_PH_3_FIGHT_POSITION
Definition boss_malygos.cpp:51
@ MI_POINT_SURGE_OF_POWER_CENTER
Definition boss_malygos.cpp:48
@ MI_POINT_VORTEX_LAND
Definition boss_malygos.cpp:43
@ MI_POINT_CENTER_GROUND_PH_2
Definition boss_malygos.cpp:45
@ MI_POINT_INTRO_CENTER_AIR
Definition boss_malygos.cpp:39
@ MI_POINT_VORTEX_TAKEOFF
Definition boss_malygos.cpp:41
@ MI_POINT_INTRO_LAND
Definition boss_malygos.cpp:40
@ MI_POINT_CENTER_AIR_PH_2
Definition boss_malygos.cpp:46
@ SPELL_VORTEX_VISUAL
Definition boss_malygos.cpp:63
@ EVENT_START_FIGHT
Definition boss_malygos.cpp:93
@ EVENT_START_PHASE_3
Definition boss_malygos.cpp:125
@ EVENT_VORTEX_LAND_1
Definition boss_malygos.cpp:104
@ EVENT_SURGE_OF_POWER_WARNING
Definition boss_malygos.cpp:118
@ EVENT_START_PHASE_2_FLY_UP
Definition boss_malygos.cpp:108
@ EVENT_START_VORTEX_REAL
Definition boss_malygos.cpp:102
@ EVENT_RESUME_FLYING_CIRCLES_PH_2
Definition boss_malygos.cpp:116
@ EVENT_VORTEX_FLY_TO_CENTER
Definition boss_malygos.cpp:101
@ EVENT_INTRO_LAND
Definition boss_malygos.cpp:92
@ NPC_PORTAL
Definition boss_terestian_illhoof.cpp:54
Definition Creature.h:47
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2352
@ NPC_WORLD_TRIGGER_LAOI
Definition eye_of_eternity.h:41
#define INTRO_MOVEMENT_INTERVAL
Definition eye_of_eternity.h:91
@ SPELL_PORTAL_BEAM
Definition eye_of_eternity.h:65
const Position CenterPos
Definition halls_of_reflection.h:308
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References AREA_EYE_OF_ETERNITY, Unit::CastSpell(), CenterPos, EVENT_INTRO_LAND, EVENT_RESUME_FLYING_CIRCLES_PH_2, EVENT_START_FIGHT, EVENT_START_PHASE_2_FLY_UP, EVENT_START_PHASE_3, EVENT_START_VORTEX_REAL, EVENT_SURGE_OF_POWER_WARNING, EVENT_VORTEX_FLY_TO_CENTER, EVENT_VORTEX_LAND_1, FourSidesPos, WorldObject::GetMap(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), INTRO_MOVEMENT_INTERVAL, LIGHT_ARCANE_RUNES, ScriptedAI::me, MI_POINT_CENTER_AIR_PH_2, MI_POINT_CENTER_GROUND_PH_2, MI_POINT_CIRCLE_OUTSIDE_PH_2, MI_POINT_INTRO_CENTER_AIR, MI_POINT_INTRO_LAND, MI_POINT_INTRO_SIDE_0, MI_POINT_INTRO_SIDE_1, MI_POINT_INTRO_SIDE_2, MI_POINT_INTRO_SIDE_3, MI_POINT_PH_3_FIGHT_POSITION, MI_POINT_SURGE_OF_POWER_CENTER, MI_POINT_VORTEX_CENTER, MI_POINT_VORTEX_LAND, MI_POINT_VORTEX_TAKEOFF, NPC_PORTAL, NPC_WORLD_TRIGGER_LAOI, POINT_MOTION_TYPE, Unit::SetDisableGravity(), Map::SetZoneOverrideLight(), SPELL_PORTAL_BEAM, SPELL_VORTEX_VISUAL, WorldObject::SummonCreature(), TEMPSUMMON_TIMED_DESPAWN, and timer2.

◆ Reset()

void boss_malygos::boss_malygosAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

223 {
224 events.Reset();
225 events.SetPhase(PHASE_NONE);
227
230 IntroCounter = 0;
231 bLockHealthCheck = false;
232
236
238
239 if (pInstance)
240 {
243 }
244 }
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:110
@ NOT_STARTED
Definition InstanceScript.h:58
@ EMOTE_ONESHOT_NONE
Definition SharedDefines.h:1905
@ UNIT_NPC_EMOTESTATE
Definition UpdateFields.h:140
@ PHASE_NONE
Definition boss_malygos.cpp:172
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:674
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetAnimTier(AnimTier animTier)
Definition Unit.cpp:15287
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21414
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:738
@ ACHIEV_YOU_DONT_HAVE_AN_ENTERNITY_EVENT
Definition eye_of_eternity.h:86

References ACHIEV_YOU_DONT_HAVE_AN_ENTERNITY_EVENT, ACHIEVEMENT_TIMED_TYPE_EVENT, bLockHealthCheck, DATA_ENCOUNTER_STATUS, SummonList::DespawnAll(), InstanceScript::DoStopTimedAchievement(), EMOTE_ONESHOT_NONE, Fly, INTRO_MOVEMENT_INTERVAL, IntroCounter, MalygosIntroIntervals, ScriptedAI::me, NOT_STARTED, PHASE_NONE, pInstance, Unit::RemoveUnitFlag(), Unit::SetAnimTier(), ZoneScript::SetData(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), summons, timer1, timer2, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_PACIFIED, and UNIT_NPC_EMOTESTATE.

Referenced by InitializeAI().

◆ SpellHit()

void boss_malygos::boss_malygosAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

304 {
305 if (spell->Id == SPELL_POWER_SPARK_MALYGOS_BUFF)
306 {
307 if (!bLockHealthCheck)
308 {
310 }
311 else
313 }
314 }
@ SAY_BUFFED_BY_SPARK
Definition boss_malygos.cpp:155
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4895
@ SPELL_POWER_SPARK_MALYGOS_BUFF
Definition eye_of_eternity.h:69

References bLockHealthCheck, SpellInfo::Id, ScriptedAI::me, Unit::RemoveAura(), SAY_BUFFED_BY_SPARK, and SPELL_POWER_SPARK_MALYGOS_BUFF.

◆ UpdateAI()

void boss_malygos::boss_malygosAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

363 {
364 HandleIntroSpeech(diff);
365
366 if (!UpdateVictim())
367 return;
368
369 events.Update(diff);
370
372 return;
373
374 switch (events.ExecuteEvent())
375 {
376 case 0:
377 break;
378 case EVENT_BERSERK:
379 me->CastSpell(me, SPELL_BERSERK, true);
381
382 break;
384 {
385 if (pInstance)
390 float angle = CenterPos.GetAngle(me);
391 float x = CenterPos.GetPositionX() + cos(angle) * 35.0f;
392 float y = CenterPos.GetPositionY() + std::sin(angle) * 35.0f;
393 float z = FourSidesPos[0].GetPositionZ();
396 break;
397 }
398 case EVENT_INTRO_LAND:
399 {
401 break;
402 }
404 {
405 if (pInstance)
406 {
409 }
411 if (Unit* target = me->SelectNearestTarget(250.0f))
412 {
413 AttackStart(target);
414 me->GetMotionMaster()->MoveChase(target);
415 }
416
417 events.SetPhase(PHASE_ONE);
418 events.RescheduleEvent(EVENT_BERSERK, 10min, 0);
419 events.RescheduleEvent(EVENT_SPELL_ARCANE_BREATH, 9s, 12s, 1);
420 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 2s, 5s, 1);
421 events.RescheduleEvent(EVENT_SUMMON_POWER_SPARK, 10s, 15s, 1);
422 events.RescheduleEvent(EVENT_START_VORTEX_0, 30s, 1);
423 break;
424 }
427 events.Repeat(12s, 15s);
428 break;
431 events.Repeat(10s, 15s);
432 break;
434 {
435 uint8 random = urand(0, 3);
437 c->CastSpell(c, SPELL_PORTAL_BEAM, false);
439 {
440 c->AI()->DoAction(1);
441 c->AI()->Talk(EMOTE_POWER_SPARK);
442 }
443
444 events.Repeat(20s, 30s);
445 }
446 break;
448 {
449 bLockHealthCheck = true;
452 summons.DoAction(2, pred); // stop following
454
456 me->SetTarget();
457
459 me->StopMoving();
460 me->SetDisableGravity(true);
462
463 events.DelayEvents(25s, 1); // don't delay berserk (group 0)
464 }
465 break;
468 break;
470 {
474
475 Position pos;
476 float angle = (me->GetOrientation() >= M_PI / 4 ? me->GetOrientation() - M_PI / 4 : 7 * M_PI / 4 + me->GetOrientation());
477 pos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 40.0f;
478 pos.m_positionY = CenterPos.GetPositionY() + std::sin(angle) * 40.0f;
479 pos.m_positionZ = CenterPos.GetPositionZ() + 20.0f;
481
483 {
484 vp->SetDisableGravity(true);
485
486 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
487 if (!PlayerList.IsEmpty())
488 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
489 if (Player* pPlayer = i->GetSource())
490 {
491 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
492 continue;
493
494 Position plrpos;
495 float playerAngle = CenterPos.GetAngle(pPlayer);
496 plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f;
497 plrpos.m_positionY = CenterPos.GetPositionY() + std::sin(playerAngle) * 5.0f;
498 plrpos.m_positionZ = CenterPos.GetPositionZ() + 18.0f;
499 plrpos.SetOrientation(plrpos.GetAngle(&CenterPos));
500
502 {
503 pPlayer->CastSpell(pPlayer, SPELL_FREEZE_ANIM, true);
504 pPlayer->CastSpell(c, SPELL_VORTEX_CONTROL_VEHICLE, true);
505 if (!pPlayer->GetVehicle()) // didn't work somehow, try again with a different way, if fails - break
506 {
507 pPlayer->EnterVehicle(c, 0);
508 if (!pPlayer->GetVehicle())
509 continue;
510 }
511 //pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE);
512
513 Movement::MoveSplineInit init(pPlayer); // TODO: has to be removed and handled with vehicle exit and vehicle enter code
515 init.SetFacing(pPlayer->GetOrientation());
516 init.SetTransportExit();
517 init.Launch();
518
519 pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
520 pPlayer->SetDisableGravity(true);
521
523 data << pPlayer->GetPackGUID();
524 pPlayer->SendMessageToSet(&data, true);
525
526 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
527
528 pPlayer->SetGuidValue(PLAYER_FARSIGHT, vp->GetGUID());
529 c->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
530 }
531 }
532 }
533
534 events.RescheduleEvent(EVENT_VORTEX_LAND_0, 11s, 1);
535 break;
536 }
539
540 break;
542 {
543 bLockHealthCheck = false;
545 summons.DoAction(1, pred); // resume following
547 if (Unit* target = me->GetVictim())
548 {
549 AttackStart(target);
550 me->GetMotionMaster()->MoveChase(target);
551 }
552 events.RescheduleEvent(EVENT_START_VORTEX_0, 60s, 1);
553 break;
554 }
556 events.SetPhase(PHASE_TWO);
560 me->SetTarget();
562 me->DisableSpline();
564 events.CancelEventGroup(1); // don't cancel berserk (group 0)
565 break;
567 {
570 me->DisableSpline();
571 me->SetDisableGravity(true);
573 events.RescheduleEvent(EVENT_START_PHASE_2_MOVE_TO_SIDE, 22s + 500ms, 1);
574 break;
575 }
580 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
581 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 8s, 1);
582 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 55s, 1);
583 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
584
585 for (int i = 0; i < MAX_NEXUS_LORDS; i++)
586 {
587 float dist = 22.0f;
588 float angle = M_PI / 2 + ((float)i / MAX_NEXUS_LORDS) * 2 * M_PI;
589 if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + std::sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
591 {
592 c->EnterVehicle(disk, 0);
593 disk->AI()->DoAction(1); // start moving
594 }
595 }
596 for (int i = 0; i < MAX_SCIONS_OF_ETERNITY; i++)
597 {
598 float dist = 30.0f;
599 float angle = 0.0f + ((float)i / MAX_SCIONS_OF_ETERNITY) * 2 * M_PI;
600 if (Creature* disk = me->SummonCreature(NPC_HOVER_DISK, CenterPos.GetPositionX() + cos(angle) * dist, CenterPos.GetPositionY() + std::sin(angle) * dist, CenterPos.GetPositionZ() + 30.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
602 {
603 c->EnterVehicle(disk, 0);
604 disk->AI()->DoAction(1); // start moving
605 }
606 }
607
608 break;
610 {
612 me->StopMoving();
613 float dist = urand(5, 30);
614 float angle = rand_norm() * 2 * M_PI;
615 float posx = CenterPos.GetPositionX() + cos(angle) * dist;
616 float posy = CenterPos.GetPositionY() + std::sin(angle) * dist;
617 me->SetFacingTo(me->GetAngle(posx, posy));
618 me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true);
619 events.Repeat(15s);
620 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 3s, 1);
621 }
622 break;
624 {
625 float angle = CenterPos.GetAngle(me);
627 float newangle = angle + 0.5f;
628 if (newangle >= 2 * M_PI) newangle -= 2 * M_PI;
630 }
631 break;
633 {
635 float angle = CenterPos.GetAngle(me);
637 me->StopMoving();
639 events.CancelEventGroup(1); // everything beside berserk
640 }
641 break;
644 events.RescheduleEvent(EVENT_SPELL_SURGE_OF_POWER, 1500ms, 1);
645 break;
650 events.RescheduleEvent(EVENT_CLEAR_TARGET, 10s, 1);
651 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 10s, 1);
652 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 17s, 25s, 1);
653 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 16s, 1);
654 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 65s, 1);
655 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
656 break;
659 me->SetTarget();
660 break;
662 {
664 events.Repeat(3s);
665 else
666 {
668 me->SetTarget();
669 events.CancelEventGroup(1);
671 // start phase 3
675 me->StopMoving();
677 events.RescheduleEvent(EVENT_LIGHT_DIMENSION_CHANGE, 1s, 1);
678 events.RescheduleEvent(EVENT_DESTROY_PLATFORM_0, 10s, 1);
679 }
680 }
681 break;
684 break;
687 {
688 c->SetFaction(me->GetFaction());
689 c->CastSpell(c, SPELL_DESTROY_PLATFORM_VISUAL, true);
690 c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false);
691 }
693 events.RescheduleEvent(EVENT_MOVE_TO_PHASE_3_POSITION, 2s, 1);
694 break;
696 {
699
700 me->GetThreatMgr().ClearAllThreat(); // players on vehicle are unattackable -> leads to EnterEvadeMode() because target is not acceptable!
701
702 // mount players:
703 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
704 if (!PlayerList.IsEmpty())
705 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
706 if (Player* pPlayer = i->GetSource())
707 {
708 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
709
710 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
711 continue;
712
713 if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
714 {
715 c->SetFaction(pPlayer->GetFaction());
716 //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
717 c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
718 AttackStart(c);
719 }
720 }
721
722 events.RescheduleEvent(EVENT_SAY_PHASE_3_INTRO, 3s, 1);
723 }
724 break;
727 break;
729 events.SetPhase(PHASE_THREE);
733 if (Unit* target = me->GetVictim())
734 AttackStart(target);
735 events.RescheduleEvent(EVENT_SPELL_ARCANE_PULSE, 0ms, 1);
736 events.RescheduleEvent(EVENT_SPELL_STATIC_FIELD, 1s, 4s, 1);
737 events.RescheduleEvent(EVENT_SPELL_PH3_SURGE_OF_POWER, 4s, 7s, 1);
738 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
739 break;
742 events.Repeat(3s);
743 break;
745 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, false))
746 {
747 me->SetFacingToObject(target);
748 me->CastSpell(target, SPELL_STATIC_FIELD_MAIN, true);
749 }
750 events.Repeat(12s);
751 break;
753 me->CastSpell((Unit*)nullptr, SPELL_PH3_SURGE_OF_POWER, false);
754 events.Repeat(7s);
755 break;
756 }
757
759 }
std::uint8_t uint8
Definition Define.h:109
@ MOTION_SLOT_ACTIVE
Definition MotionMaster.h:64
@ FORCED_MOVEMENT_RUN
Definition MotionMaster.h:87
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:55
double rand_norm()
Definition Random.cpp:85
#define sScriptMgr
Definition ScriptMgr.h:719
@ EMOTE_STATE_CUSTOM_SPELL_01
Definition SharedDefines.h:2021
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:117
@ MOVEMENTFLAG_NONE
Definition UnitDefines.h:368
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:279
@ PLAYER_FARSIGHT
Definition UpdateFields.h:334
@ LIGHT_CHANGE_DIMENSIONS
Definition boss_malygos.cpp:186
@ LIGHT_OBSCURE_ARCANE_RUNES
Definition boss_malygos.cpp:188
@ LIGHT_OBSCURE_SPACE
Definition boss_malygos.cpp:185
@ MI_POINT_START_PH_3
Definition boss_malygos.cpp:50
@ PHASE_THREE
Definition boss_malygos.cpp:175
@ SAY_END_P1
Definition boss_malygos.cpp:145
@ EMOTE_POWER_SPARK
Definition boss_malygos.cpp:162
@ SAY_DEEP_BREATH
Definition boss_malygos.cpp:143
@ SAY_PHASE_2
Definition boss_malygos.cpp:146
@ SAY_SURGE_OF_POWER
Definition boss_malygos.cpp:154
@ SAY_END_P2
Definition boss_malygos.cpp:150
@ SAY_MAGIC_BLAST
Definition boss_malygos.cpp:148
@ EMOTE_BERSERK
Definition boss_malygos.cpp:160
@ EMOTE_SURGE_OF_POWER_WARNING_P2
Definition boss_malygos.cpp:153
@ SAY_INTRO_PHASE_3
Definition boss_malygos.cpp:151
@ SPELL_ARCANE_STORM
Definition boss_malygos.cpp:61
@ SPELL_FREEZE_ANIM
Definition boss_malygos.cpp:65
@ SPELL_ARCANE_PULSE
Definition boss_malygos.cpp:80
@ SPELL_DESTROY_PLATFORM_VISUAL
Definition boss_malygos.cpp:78
@ SPELL_ARCANE_BREATH
Definition boss_malygos.cpp:60
@ SPELL_VORTEX_CONTROL_VEHICLE
Definition boss_malygos.cpp:64
@ SPELL_SURGE_OF_POWER
Definition boss_malygos.cpp:74
@ SPELL_DESTROY_PLATFORM_EFFECT
Definition boss_malygos.cpp:77
@ SPELL_PH3_SURGE_OF_POWER
Definition boss_malygos.cpp:81
@ SPELL_STATIC_FIELD_MAIN
Definition boss_malygos.cpp:83
@ SPELL_ARCANE_OVERLOAD
Definition boss_malygos.cpp:67
@ SPELL_BERSERK
Definition boss_malygos.cpp:59
#define MAX_SCIONS_OF_ETERNITY
Definition boss_malygos.cpp:179
@ EVENT_SPELL_ARCANE_PULSE
Definition boss_malygos.cpp:127
@ EVENT_CLEAR_TARGET
Definition boss_malygos.cpp:112
@ EVENT_VORTEX_LAND_0
Definition boss_malygos.cpp:103
@ EVENT_SPELL_ARCANE_BREATH
Definition boss_malygos.cpp:97
@ EVENT_DESTROY_PLATFORM_0
Definition boss_malygos.cpp:123
@ EVENT_SPELL_SURGE_OF_POWER
Definition boss_malygos.cpp:119
@ EVENT_START_PHASE_2_MOVE_TO_SIDE
Definition boss_malygos.cpp:110
@ EVENT_MOVE_TO_PHASE_3_POSITION
Definition boss_malygos.cpp:124
@ EVENT_LIGHT_DIMENSION_CHANGE
Definition boss_malygos.cpp:122
@ EVENT_START_VORTEX_0
Definition boss_malygos.cpp:100
@ EVENT_SUMMON_POWER_SPARK
Definition boss_malygos.cpp:99
@ EVENT_BERSERK
Definition boss_malygos.cpp:94
@ EVENT_SPELL_STATIC_FIELD
Definition boss_malygos.cpp:128
@ EVENT_SPELL_ARCANE_OVERLOAD
Definition boss_malygos.cpp:114
@ EVENT_CHECK_TRASH_DEAD
Definition boss_malygos.cpp:111
@ EVENT_SAY_PHASE_3_INTRO
Definition boss_malygos.cpp:126
@ EVENT_SPELL_PH3_SURGE_OF_POWER
Definition boss_malygos.cpp:129
@ EVENT_MOVE_TO_SURGE_OF_POWER
Definition boss_malygos.cpp:117
@ EVENT_SPELL_ARCANE_STORM
Definition boss_malygos.cpp:98
#define MAX_NEXUS_LORDS
Definition boss_malygos.cpp:178
bool UpdateVictim()
Definition CreatureAI.cpp:277
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
Select nearest hostile unit within the given distance (regardless of threat list).
Definition Creature.cpp:2388
Definition ScriptedCreature.h:168
Definition eye_of_eternity.h:108
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:665
Definition LinkedList.h:139
bool IsEmpty() const
Definition LinkedList.h:97
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
PlayerList const & GetPlayers() const
Definition Map.h:326
void MoveIdle()
Definition MotionMaster.cpp:233
void Clear(bool reset=true)
Definition MotionMaster.h:192
Definition MoveSplineInit.h:63
Definition Player.h:1071
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void ClearAllThreat()
Definition ThreatMgr.cpp:417
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
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:655
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:20506
void SetFacingTo(float ori)
Definition Unit.cpp:20496
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4176
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1251
void StopMoving()
Definition Unit.cpp:16866
uint32 GetFaction() const
Definition Unit.h:841
void DisableSpline()
Definition Unit.cpp:637
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
void SendMeleeAttackStop(Unit *victim=nullptr)
Send to the client SMSG_ATTACKSTOP but doesn't clear UNIT_STATE_MELEE_ATTACKING on server side or int...
Definition Unit.cpp:3115
void RemoveAllAuras()
Definition Unit.cpp:5438
ThreatMgr & GetThreatMgr()
Definition Unit.h:943
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2036
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2443
Definition WorldPacket.h:26
@ NPC_SCION_OF_ETERNITY
Definition eye_of_eternity.h:45
@ NPC_NEXUS_LORD
Definition eye_of_eternity.h:44
@ NPC_POWER_SPARK
Definition eye_of_eternity.h:42
@ NPC_HOVER_DISK
Definition eye_of_eternity.h:46
@ NPC_SURGE_OF_POWER
Definition eye_of_eternity.h:48
@ NPC_WYRMREST_SKYTALON
Definition eye_of_eternity.h:49
const Position Phase2NorthPos
Definition eye_of_eternity.h:103
@ DATA_SET_IRIS_INACTIVE
Definition eye_of_eternity.h:58
@ DATA_HIDE_IRIS_AND_PORTAL
Definition eye_of_eternity.h:59
@ SMSG_SPLINE_MOVE_UNROOT
Definition Opcodes.h:802
Definition Position.h:27
float m_positionZ
Definition Position.h:57
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170
float m_positionX
Definition Position.h:55
float m_positionY
Definition Position.h:56
void SetOrientation(float orientation)
Definition Position.h:116
float GetAngle(const Position *pos) const
Definition Position.cpp:85
const T & DUNGEON_MODE(const T &normal5, const T &heroic10) const
Definition ScriptedCreature.h:389
void AttackStart(Unit *victim) override
Definition boss_malygos.cpp:328
void HandleIntroSpeech(const uint32 diff)
Definition boss_malygos.cpp:812
@ NPC_VORTEX
Definition zone_undercity.cpp:514

References ACHIEV_YOU_DONT_HAVE_AN_ENTERNITY_EVENT, ACHIEVEMENT_TIMED_TYPE_EVENT, AREA_EYE_OF_ETERNITY, AttackStart(), MapRefMgr::begin(), bLockHealthCheck, Unit::CastCustomSpell(), Unit::CastSpell(), CenterPos, MotionMaster::Clear(), ThreatMgr::ClearAllThreat(), DATA_HIDE_IRIS_AND_PORTAL, DATA_SET_IRIS_INACTIVE, SummonList::DespawnAll(), Unit::DisableSpline(), SummonList::DoAction(), UnitAI::DoMeleeAttackIfReady(), InstanceScript::DoStartTimedAchievement(), ScriptedAI::DUNGEON_MODE(), EMOTE_BERSERK, EMOTE_POWER_SPARK, EMOTE_STATE_CUSTOM_SPELL_01, EMOTE_SURGE_OF_POWER_WARNING_P2, MapRefMgr::end(), EVENT_BERSERK, EVENT_CHECK_TRASH_DEAD, EVENT_CLEAR_TARGET, EVENT_DESTROY_PLATFORM_0, EVENT_INTRO_LAND, EVENT_INTRO_MOVE_CENTER, EVENT_LIGHT_DIMENSION_CHANGE, EVENT_MOVE_TO_PHASE_3_POSITION, EVENT_MOVE_TO_SURGE_OF_POWER, EVENT_RESUME_FLYING_CIRCLES_PH_2, EVENT_SAY_PHASE_3_INTRO, EVENT_SPELL_ARCANE_BREATH, EVENT_SPELL_ARCANE_OVERLOAD, EVENT_SPELL_ARCANE_PULSE, EVENT_SPELL_ARCANE_STORM, EVENT_SPELL_PH3_SURGE_OF_POWER, EVENT_SPELL_STATIC_FIELD, EVENT_SPELL_SURGE_OF_POWER, EVENT_START_FIGHT, EVENT_START_PHASE_2, EVENT_START_PHASE_2_FLY_UP, EVENT_START_PHASE_2_MOVE_TO_SIDE, EVENT_START_PHASE_3, EVENT_START_VORTEX_0, EVENT_START_VORTEX_REAL, EVENT_SUMMON_POWER_SPARK, EVENT_SURGE_OF_POWER_WARNING, EVENT_VORTEX_FLY_TO_CENTER, EVENT_VORTEX_LAND_0, EVENT_VORTEX_LAND_1, WorldObject::FindNearestCreature(), Fly, FORCED_MOVEMENT_RUN, FourSidesPos, Position::GetAngle(), Position::GetExactDist2d(), Unit::GetFaction(), WorldObject::GetMap(), Unit::GetMotionMaster(), Position::GetOrientation(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetThreatMgr(), Unit::GetVictim(), Ground, Unit::HandleEmoteCommand(), HandleIntroSpeech(), Unit::HasUnitState(), Unit::InterruptNonMeleeSpells(), LinkedListHead::IsEmpty(), Movement::MoveSplineInit::Launch(), LIGHT_CHANGE_DIMENSIONS, LIGHT_OBSCURE_ARCANE_RUNES, LIGHT_OBSCURE_SPACE, Position::m_positionX, Position::m_positionY, Position::m_positionZ, MAX_NEXUS_LORDS, MAX_SCIONS_OF_ETERNITY, ScriptedAI::me, MI_POINT_CENTER_AIR_PH_2, MI_POINT_CENTER_GROUND_PH_2, MI_POINT_CIRCLE_OUTSIDE_PH_2, MI_POINT_INTRO_CENTER_AIR, MI_POINT_INTRO_LAND, MI_POINT_PH_3_FIGHT_POSITION, MI_POINT_START_PH_3, MI_POINT_SURGE_OF_POWER_CENTER, MI_POINT_VORTEX_CENTER, MI_POINT_VORTEX_LAND, MI_POINT_VORTEX_TAKEOFF, MOTION_SLOT_ACTIVE, MotionMaster::MoveChase(), MotionMaster::MoveIdle(), MOVEMENTFLAG_NONE, MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), Movement::MoveSplineInit::MoveTo(), NPC_HOVER_DISK, NPC_NEXUS_LORD, NPC_PORTAL, NPC_POWER_SPARK, NPC_SCION_OF_ETERNITY, NPC_SURGE_OF_POWER, NPC_VORTEX, NPC_WORLD_TRIGGER_LAOI, NPC_WYRMREST_SKYTALON, Phase2NorthPos, PHASE_ONE, PHASE_THREE, PHASE_TWO, pInstance, PLAYER_FARSIGHT, rand_norm(), Random, Unit::RemoveAllAuras(), Unit::RemoveUnitFlag(), Unit::RemoveUnitMovementFlag(), SAY_DEEP_BREATH, SAY_END_P1, SAY_END_P2, SAY_INTRO_PHASE_3, SAY_MAGIC_BLAST, SAY_PHASE_2, SAY_SURGE_OF_POWER, Creature::SelectNearestTarget(), UnitAI::SelectTarget(), Unit::SendMeleeAttackStop(), ZoneScript::SetData(), Unit::SetDisableGravity(), Movement::MoveSplineInit::SetFacing(), Unit::SetFacingTo(), Unit::SetFacingToObject(), Position::SetOrientation(), Creature::SetTarget(), Movement::MoveSplineInit::SetTransportExit(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), Map::SetZoneOverrideLight(), SMSG_SPLINE_MOVE_UNROOT, SPELL_ARCANE_BREATH, SPELL_ARCANE_OVERLOAD, SPELL_ARCANE_PULSE, SPELL_ARCANE_STORM, SPELL_BERSERK, SPELL_DESTROY_PLATFORM_EFFECT, SPELL_DESTROY_PLATFORM_VISUAL, SPELL_FREEZE_ANIM, SPELL_PH3_SURGE_OF_POWER, SPELL_PORTAL_BEAM, SPELL_STATIC_FIELD_MAIN, SPELL_SURGE_OF_POWER, SPELL_VORTEX_CONTROL_VEHICLE, SPELLVALUE_MAX_TARGETS, sScriptMgr, Unit::StopMoving(), WorldObject::SummonCreature(), summons, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_FLAG_PACIFIED, UNIT_NPC_EMOTESTATE, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ bLockHealthCheck

bool boss_malygos::boss_malygosAI::bLockHealthCheck

Referenced by DamageTaken(), Reset(), SpellHit(), and UpdateAI().

◆ events

EventMap boss_malygos::boss_malygosAI::events

◆ IntroCounter

uint8 boss_malygos::boss_malygosAI::IntroCounter

Referenced by HandleIntroSpeech(), and Reset().

◆ pInstance

InstanceScript* boss_malygos::boss_malygosAI::pInstance

◆ summons

SummonList boss_malygos::boss_malygosAI::summons

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

◆ timer1

uint32 boss_malygos::boss_malygosAI::timer1

Referenced by HandleIntroSpeech(), and Reset().

◆ timer2

uint32 boss_malygos::boss_malygosAI::timer2

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