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:1221
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
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.

333 {
334 if (!victim)
335 return;
336
338 {
340 me->SetTarget(victim->GetGUID());
341 }
342 else if (me->Attack(victim, true))
343 {
345 me->GetMotionMaster()->MoveChase(victim);
346 else
347 me->SetTarget();
348 }
349 }
@ 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:3439
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:1713
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:732
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:10323
Unit * GetVictim() const
Definition Unit.h:886

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.

352 {
353 if (damage >= me->GetHealth() && !me->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) // allow dying only in phase 3!
354 {
355 damage = 0;
356 return;
357 }
358
359 if (!bLockHealthCheck && me->HealthBelowPctDamaged(50, damage))
360 {
361 bLockHealthCheck = true;
362 events.RescheduleEvent(EVENT_START_PHASE_2, 0ms, 1);
363 }
364 }
@ 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:1070
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1079
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.

808 {
809 me->SetDisableGravity(true);
811
814 }
@ 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:215
void SetZoneOverrideLight(uint32 zoneId, uint32 lightId, Milliseconds fadeInTime)
Definition Map.cpp:2898
void SetDisableGravity(bool disable)
Definition Unit.cpp:20331
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:734
Map * GetMap() const
Definition Object.h:621

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
817 {
818 if (me->IsInCombat() || me->isDead())
819 return;
820
821 // speech timer
822 if (timer1 <= diff)
823 {
826 if (++IntroCounter >= 5)
827 IntroCounter = 0;
828 }
829 else
830 timer1 -= diff;
831
832 // movement timer
833 if (timer2)
834 {
835 if (timer2 <= diff)
836 {
837 timer2 = 0;
838 uint32 tmp = urand(0, 3);
841 }
842 else
843 timer2 -= diff;
844 }
845 }
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)
Definition MotionMaster.h:228
void RemoveUnitMovementFlag(uint32 f)
Definition Unit.h:758
bool IsInCombat() const
Definition Unit.h:917
bool isDead() const
Definition Unit.h:1750
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.

766 {
768 if (pInstance)
769 {
772 }
773 }
@ 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.

321 {
322 events.Reset();
324
326
327 events.RescheduleEvent(EVENT_INTRO_MOVE_CENTER, 0ms, 1);
328 if (pInstance)
330 }
@ 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:113

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.

789 {
790 if (!summon)
791 return;
792 summons.Summon(summon);
793 switch (summon->GetEntry())
794 {
796 summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
797 summon->DespawnOrUnsummon(45s);
798 break;
799 case NPC_STATIC_FIELD:
800 summon->DespawnOrUnsummon(20s);
801 break;
802 }
803 }
@ SPELL_ARCANE_OVERLOAD_DMG
Definition boss_malygos.cpp:70
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2182
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.

776 {
777 if (victim && victim->GetGUID() == me->GetGUID())
778 return;
779
780 if (events.IsInPhase(PHASE_ONE))
782 else if (events.IsInPhase(PHASE_TWO))
784 else
786 }
@ 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.

805{}

◆ MovementInform()

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

Reimplemented from CreatureAI.

245 {
246 if (type == POINT_MOTION_TYPE)
247 {
248 switch (id)
249 {
254 {
255 float angle = me->GetOrientation();
256 float dist = 75.0f;
257 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))
258 me->CastSpell(c, SPELL_PORTAL_BEAM, false);
260 }
261 break;
262
264 events.RescheduleEvent(EVENT_INTRO_LAND, 0ms, 1);
265 break;
268 c->CastSpell(c, SPELL_VORTEX_VISUAL, true);
269 events.RescheduleEvent(EVENT_START_VORTEX_REAL, 1s, 1);
270 break;
272 events.RescheduleEvent(EVENT_START_PHASE_2_FLY_UP, 0ms, 1);
273 break;
275 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 0ms, 1);
276 break;
278 events.RescheduleEvent(EVENT_SURGE_OF_POWER_WARNING, 0ms, 1);
279 break;
280 }
281 }
282 else if (type == EFFECT_MOTION_TYPE)
283 {
284 switch (id)
285 {
287 me->SetDisableGravity(false);
288 events.RescheduleEvent(EVENT_START_FIGHT, 0ms, 1);
289 break;
291 events.RescheduleEvent(EVENT_VORTEX_FLY_TO_CENTER, 0ms, 1);
292 break;
294 me->SetDisableGravity(false);
295 events.RescheduleEvent(EVENT_VORTEX_LAND_1, 0ms, 1);
296 break;
299 break;
301 events.RescheduleEvent(EVENT_START_PHASE_3, 6s, 1);
302 break;
303 }
304 }
305 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition MotionMaster.h:56
@ 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:2359
@ 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, EFFECT_MOTION_TYPE, 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
237 if (pInstance)
238 {
241 }
242 }
@ 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:71
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21198
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:733
@ 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, INTRO_MOVEMENT_INTERVAL, IntroCounter, MalygosIntroIntervals, ScriptedAI::me, NOT_STARTED, PHASE_NONE, pInstance, Unit::RemoveUnitFlag(), 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.

308 {
309 if (spell->Id == SPELL_POWER_SPARK_MALYGOS_BUFF)
310 {
311 if (!bLockHealthCheck)
312 {
314 }
315 else
317 }
318 }
@ SAY_BUFFED_BY_SPARK
Definition boss_malygos.cpp:155
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4844
@ 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.

367 {
368 HandleIntroSpeech(diff);
369
370 if (!UpdateVictim())
371 return;
372
373 events.Update(diff);
374
376 return;
377
378 switch (events.ExecuteEvent())
379 {
380 case 0:
381 break;
382 case EVENT_BERSERK:
383 me->CastSpell(me, SPELL_BERSERK, true);
385
386 break;
388 {
389 if (pInstance)
394 float angle = CenterPos.GetAngle(me);
395 float x = CenterPos.GetPositionX() + cos(angle) * 35.0f;
396 float y = CenterPos.GetPositionY() + std::sin(angle) * 35.0f;
397 float z = FourSidesPos[0].GetPositionZ();
400 break;
401 }
402 case EVENT_INTRO_LAND:
403 {
405 break;
406 }
408 {
409 if (pInstance)
410 {
413 }
415 if (Unit* target = me->SelectNearestTarget(250.0f))
416 {
417 AttackStart(target);
418 me->GetMotionMaster()->MoveChase(target);
419 }
420
421 events.SetPhase(PHASE_ONE);
422 events.RescheduleEvent(EVENT_BERSERK, 10min, 0);
423 events.RescheduleEvent(EVENT_SPELL_ARCANE_BREATH, 9s, 12s, 1);
424 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 2s, 5s, 1);
425 events.RescheduleEvent(EVENT_SUMMON_POWER_SPARK, 10s, 15s, 1);
426 events.RescheduleEvent(EVENT_START_VORTEX_0, 30s, 1);
427 break;
428 }
431 events.Repeat(12s, 15s);
432 break;
435 events.Repeat(10s, 15s);
436 break;
438 {
439 uint8 random = urand(0, 3);
441 c->CastSpell(c, SPELL_PORTAL_BEAM, false);
443 {
444 c->AI()->DoAction(1);
445 c->AI()->Talk(EMOTE_POWER_SPARK);
446 }
447
448 events.Repeat(20s, 30s);
449 }
450 break;
452 {
453 bLockHealthCheck = true;
456 summons.DoAction(2, pred); // stop following
458
460 me->SetTarget();
461
463 me->StopMoving();
464 me->SetDisableGravity(true);
466
467 events.DelayEvents(25s, 1); // don't delay berserk (group 0)
468 }
469 break;
472 break;
474 {
478
479 Position pos;
480 float angle = (me->GetOrientation() >= M_PI / 4 ? me->GetOrientation() - M_PI / 4 : 7 * M_PI / 4 + me->GetOrientation());
481 pos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 40.0f;
482 pos.m_positionY = CenterPos.GetPositionY() + std::sin(angle) * 40.0f;
483 pos.m_positionZ = CenterPos.GetPositionZ() + 20.0f;
485
487 {
488 vp->SetDisableGravity(true);
489
490 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
491 if (!PlayerList.IsEmpty())
492 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
493 if (Player* pPlayer = i->GetSource())
494 {
495 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
496 continue;
497
498 Position plrpos;
499 float playerAngle = CenterPos.GetAngle(pPlayer);
500 plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f;
501 plrpos.m_positionY = CenterPos.GetPositionY() + std::sin(playerAngle) * 5.0f;
502 plrpos.m_positionZ = CenterPos.GetPositionZ() + 18.0f;
503 plrpos.SetOrientation(plrpos.GetAngle(&CenterPos));
504
506 {
507 pPlayer->CastSpell(pPlayer, SPELL_FREEZE_ANIM, true);
508 pPlayer->CastSpell(c, SPELL_VORTEX_CONTROL_VEHICLE, true);
509 if (!pPlayer->GetVehicle()) // didn't work somehow, try again with a different way, if fails - break
510 {
511 pPlayer->EnterVehicle(c, 0);
512 if (!pPlayer->GetVehicle())
513 continue;
514 }
515 //pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE);
516
517 Movement::MoveSplineInit init(pPlayer); // TODO: has to be removed and handled with vehicle exit and vehicle enter code
519 init.SetFacing(pPlayer->GetOrientation());
520 init.SetTransportExit();
521 init.Launch();
522
523 pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
524 pPlayer->SetDisableGravity(true);
525
527 data << pPlayer->GetPackGUID();
528 pPlayer->SendMessageToSet(&data, true);
529
530 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
531
532 pPlayer->SetGuidValue(PLAYER_FARSIGHT, vp->GetGUID());
533 c->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
534 }
535 }
536 }
537
538 events.RescheduleEvent(EVENT_VORTEX_LAND_0, 11s, 1);
539 break;
540 }
543
544 break;
546 {
547 bLockHealthCheck = false;
549 summons.DoAction(1, pred); // resume following
551 if (Unit* target = me->GetVictim())
552 {
553 AttackStart(target);
554 me->GetMotionMaster()->MoveChase(target);
555 }
556 events.RescheduleEvent(EVENT_START_VORTEX_0, 60s, 1);
557 break;
558 }
560 events.SetPhase(PHASE_TWO);
564 me->SetTarget();
566 me->DisableSpline();
568 events.CancelEventGroup(1); // don't cancel berserk (group 0)
569 break;
571 {
574 me->DisableSpline();
575 me->SetDisableGravity(true);
577 events.RescheduleEvent(EVENT_START_PHASE_2_MOVE_TO_SIDE, 22s + 500ms, 1);
578 break;
579 }
584 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
585 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 8s, 1);
586 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 55s, 1);
587 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
588
589 for (int i = 0; i < MAX_NEXUS_LORDS; i++)
590 {
591 float dist = 22.0f;
592 float angle = M_PI / 2 + ((float)i / MAX_NEXUS_LORDS) * 2 * M_PI;
593 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))
595 {
596 c->EnterVehicle(disk, 0);
597 disk->AI()->DoAction(1); // start moving
598 }
599 }
600 for (int i = 0; i < MAX_SCIONS_OF_ETERNITY; i++)
601 {
602 float dist = 30.0f;
603 float angle = 0.0f + ((float)i / MAX_SCIONS_OF_ETERNITY) * 2 * M_PI;
604 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))
606 {
607 c->EnterVehicle(disk, 0);
608 disk->AI()->DoAction(1); // start moving
609 }
610 }
611
612 break;
614 {
616 me->StopMoving();
617 float dist = urand(5, 30);
618 float angle = rand_norm() * 2 * M_PI;
619 float posx = CenterPos.GetPositionX() + cos(angle) * dist;
620 float posy = CenterPos.GetPositionY() + std::sin(angle) * dist;
621 me->SetFacingTo(me->GetAngle(posx, posy));
622 me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true);
623 events.Repeat(15s);
624 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 3s, 1);
625 }
626 break;
628 {
629 float angle = CenterPos.GetAngle(me);
631 float newangle = angle + 0.5f;
632 if (newangle >= 2 * M_PI) newangle -= 2 * M_PI;
634 }
635 break;
637 {
639 float angle = CenterPos.GetAngle(me);
641 me->StopMoving();
643 events.CancelEventGroup(1); // everything beside berserk
644 }
645 break;
648 events.RescheduleEvent(EVENT_SPELL_SURGE_OF_POWER, 1500ms, 1);
649 break;
654 events.RescheduleEvent(EVENT_CLEAR_TARGET, 10s, 1);
655 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 10s, 1);
656 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 17s, 25s, 1);
657 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 16s, 1);
658 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 65s, 1);
659 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
660 break;
663 me->SetTarget();
664 break;
666 {
668 events.Repeat(3s);
669 else
670 {
672 me->SetTarget();
673 events.CancelEventGroup(1);
675 // start phase 3
679 me->StopMoving();
681 events.RescheduleEvent(EVENT_LIGHT_DIMENSION_CHANGE, 1s, 1);
682 events.RescheduleEvent(EVENT_DESTROY_PLATFORM_0, 10s, 1);
683 }
684 }
685 break;
688 break;
691 {
692 c->SetFaction(me->GetFaction());
693 c->CastSpell(c, SPELL_DESTROY_PLATFORM_VISUAL, true);
694 c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false);
695 }
697 events.RescheduleEvent(EVENT_MOVE_TO_PHASE_3_POSITION, 2s, 1);
698 break;
700 {
703
704 me->GetThreatMgr().ClearAllThreat(); // players on vehicle are unattackable -> leads to EnterEvadeMode() because target is not acceptable!
705
706 // mount players:
707 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
708 if (!PlayerList.IsEmpty())
709 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
710 if (Player* pPlayer = i->GetSource())
711 {
712 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
713
714 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
715 continue;
716
717 if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
718 {
719 c->SetFaction(pPlayer->GetFaction());
720 //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
721 c->m_Events.AddEventAtOffset(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), 500ms);
722 AttackStart(c);
723 }
724 }
725
726 events.RescheduleEvent(EVENT_SAY_PHASE_3_INTRO, 3s, 1);
727 }
728 break;
731 break;
733 events.SetPhase(PHASE_THREE);
737 if (Unit* target = me->GetVictim())
738 AttackStart(target);
739 events.RescheduleEvent(EVENT_SPELL_ARCANE_PULSE, 0ms, 1);
740 events.RescheduleEvent(EVENT_SPELL_STATIC_FIELD, 1s, 4s, 1);
741 events.RescheduleEvent(EVENT_SPELL_PH3_SURGE_OF_POWER, 4s, 7s, 1);
742 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
743 break;
746 events.Repeat(3s);
747 break;
749 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, false))
750 {
751 me->SetFacingToObject(target);
752 me->CastSpell(target, SPELL_STATIC_FIELD_MAIN, true);
753 }
754 events.Repeat(12s);
755 break;
757 me->CastSpell((Unit*)nullptr, SPELL_PH3_SURGE_OF_POWER, false);
758 events.Repeat(7s);
759 break;
760 }
761
763 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:55
double rand_norm()
Definition Random.cpp:85
#define sScriptMgr
Definition ScriptMgr.h:728
@ 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
@ MOVE_RUN
Definition UnitDefines.h:354
@ 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:287
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
Select nearest hostile unit within the given distance (regardless of threat list).
Definition Creature.cpp:2392
Definition ScriptedCreature.h:167
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 MoveTakeoff(uint32 id, Position const &pos, float speed=0.0f, bool skipAnimation=false)
Use to move the unit from the ground to the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:576
void MoveLand(uint32 id, Position const &pos, float speed=0.0f)
Use to move the unit from the air to the ground. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:541
void MoveIdle()
Definition MotionMaster.cpp:233
void Clear(bool reset=true)
Definition MotionMaster.h:182
Definition MoveSplineInit.h:71
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:650
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:20290
void SetFacingTo(float ori)
Definition Unit.cpp:20280
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:14512
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4188
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:16660
uint32 GetFaction() const
Definition Unit.h:834
void DisableSpline()
Definition Unit.cpp:637
bool HasUnitState(const uint32 f) const
Definition Unit.h:721
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:3114
void RemoveAllAuras()
Definition Unit.cpp:5387
ThreatMgr & GetThreatMgr()
Definition Unit.h:936
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2035
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2450
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:388
void AttackStart(Unit *victim) override
Definition boss_malygos.cpp:332
void HandleIntroSpeech(const uint32 diff)
Definition boss_malygos.cpp:816
@ 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(), FourSidesPos, Position::GetAngle(), Position::GetExactDist2d(), Unit::GetFaction(), WorldObject::GetMap(), Unit::GetMotionMaster(), Position::GetOrientation(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetSpeed(), Unit::GetThreatMgr(), Unit::GetVictim(), 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, MOVE_RUN, MotionMaster::MoveChase(), MotionMaster::MoveIdle(), MotionMaster::MoveLand(), MOVEMENTFLAG_NONE, MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), MotionMaster::MoveTakeoff(), 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: