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. More...
 
void AttackStart (Unit *victim) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, 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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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)
 
virtual void MoveInLineOfSight (Unit *)
 
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
210 : ScriptedAI(c), summons(me)
211 {
213 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
InstanceScript * pInstance
Definition: boss_malygos.cpp:215
SummonList summons
Definition: boss_malygos.cpp:217

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

Member Function Documentation

◆ AttackStart()

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

Reimplemented from ScriptedAI.

340 {
341 if (!victim)
342 return;
343
345 {
347 me->SetTarget(victim->GetGUID());
348 }
349 else if (me->Attack(victim, true))
350 {
352 me->GetMotionMaster()->MoveChase(victim);
353 else
354 me->SetTarget();
355 }
356 }
@ UNIT_FIELD_TARGET
Definition: UpdateFields.h:92
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ UNIT_FLAG_PACIFIED
Definition: UnitDefines.h:246
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition: Creature.cpp:3545
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
ObjectGuid GetGuidValue(uint16 index) const
Definition: Object.cpp:337
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:712
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10272
Unit * GetVictim() const
Definition: Unit.h:853
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:313

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 ScriptedAI.

359 {
360 if (damage >= me->GetHealth() && !me->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) // allow dying only in phase 3!
361 {
362 damage = 0;
363 return;
364 }
365
366 if (!bLockHealthCheck && me->HealthBelowPctDamaged(50, damage))
367 {
368 bLockHealthCheck = true;
369 events.RescheduleEvent(EVENT_START_PHASE_2, 0ms, 1);
370 }
371 }
events
Definition: boss_sartura.cpp:43
@ EVENT_START_PHASE_2
Definition: boss_malygos.cpp:114
@ UNIT_FLAG_DISABLE_MOVE
Definition: UnitDefines.h:231
uint32 GetHealth() const
Definition: Unit.h:1029
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1038
bool bLockHealthCheck
Definition: boss_malygos.cpp:221

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.

817 {
818 me->SetDisableGravity(true);
820
823 }
@ LIGHT_GET_DEFAULT_FOR_MAP
Definition: boss_malygos.cpp:191
#define AREA_EYE_OF_ETERNITY
Definition: boss_malygos.cpp:187
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
Map * GetMap() const
Definition: Object.h:536
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
void SetZoneOverrideLight(uint32 zoneId, uint32 lightId, Milliseconds fadeInTime)
Definition: Map.cpp:3803

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

◆ HandleIntroSpeech()

void boss_malygos::boss_malygosAI::HandleIntroSpeech ( const uint32  diff)
inline
826 {
827 if (me->IsInCombat() || me->isDead())
828 return;
829
830 // speech timer
831 if (timer1 <= diff)
832 {
835 if (++IntroCounter >= 5)
836 IntroCounter = 0;
837 }
838 else
839 timer1 -= diff;
840
841 // movement timer
842 if (timer2)
843 {
844 if (timer2 <= diff)
845 {
846 timer2 = 0;
847 uint32 tmp = urand(0, 3);
850 }
851 else
852 timer2 -= diff;
853 }
854 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint32_t uint32
Definition: Define.h:107
Talk
Definition: hyjal.cpp:82
@ MI_POINT_INTRO_SIDE_0
Definition: boss_malygos.cpp:34
@ SAY_INTRO
Definition: boss_malygos.cpp:148
const uint32 MalygosIntroIntervals[]
Definition: eye_of_eternity.h:108
const Position FourSidesPos[]
Definition: eye_of_eternity.h:98
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:735
bool IsInCombat() const
Definition: Unit.h:884
bool isDead() const
Definition: Unit.h:1656
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213
uint8 IntroCounter
Definition: boss_malygos.cpp:220
uint32 timer1
Definition: boss_malygos.cpp:219
uint32 timer2
Definition: boss_malygos.cpp:219

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.

224 {
225 me->SetDisableGravity(true);
226 Reset();
227 }
void Reset() override
Definition: boss_malygos.cpp:229

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

◆ JustDied()

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

Reimplemented from ScriptedAI.

775 {
777 if (pInstance)
778 {
781 }
782 }
@ SAY_DEATH
Definition: boss_malygos.cpp:165
@ NPC_MALYGOS
Definition: eye_of_eternity.h:39
@ DATA_ENCOUNTER_STATUS
Definition: eye_of_eternity.h:57
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:122
@ DONE
Definition: InstanceScript.h:60
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:638
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

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 ScriptedAI.

328 {
329 events.Reset();
331
333
334 events.RescheduleEvent(EVENT_INTRO_MOVE_CENTER, 0ms, 1);
335 if (pInstance)
337 }
@ SAY_PHASE_1
Definition: boss_malygos.cpp:149
@ EVENT_INTRO_MOVE_CENTER
Definition: boss_malygos.cpp:98
@ IN_PROGRESS
Definition: InstanceScript.h:58
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:106

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 ScriptedAI.

798 {
799 if (!summon)
800 return;
801 summons.Summon(summon);
802 switch (summon->GetEntry())
803 {
805 summon->CastSpell(summon, SPELL_ARCANE_OVERLOAD_DMG, true);
806 summon->DespawnOrUnsummon(45000);
807 break;
808 case NPC_STATIC_FIELD:
809 summon->DespawnOrUnsummon(20000);
810 break;
811 }
812 }
@ SPELL_ARCANE_OVERLOAD_DMG
Definition: boss_malygos.cpp:72
@ NPC_ARCANE_OVERLOAD
Definition: eye_of_eternity.h:47
@ NPC_STATIC_FIELD
Definition: eye_of_eternity.h:50
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
uint32 GetEntry() const
Definition: Object.h:115
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:1167

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 ScriptedAI.

785 {
786 if (victim && victim->GetGUID() == me->GetGUID())
787 return;
788
789 if (events.IsInPhase(PHASE_ONE))
791 else if (events.IsInPhase(PHASE_TWO))
793 else
795 }
@ PHASE_ONE
Definition: boss_malygos.cpp:180
@ PHASE_TWO
Definition: boss_malygos.cpp:181
@ SAY_SLAY_P1
Definition: boss_malygos.cpp:151
@ SAY_SLAY_P2
Definition: boss_malygos.cpp:156
@ SAY_SLAY_P3
Definition: boss_malygos.cpp:163

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.

814{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

252 {
253 if (type == POINT_MOTION_TYPE)
254 {
255 switch (id)
256 {
261 {
262 float angle = me->GetOrientation();
263 float dist = 75.0f;
264 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))
265 me->CastSpell(c, SPELL_PORTAL_BEAM, false);
267 }
268 break;
269
271 events.RescheduleEvent(EVENT_INTRO_LAND, 0ms, 1);
272 break;
275 c->CastSpell(c, SPELL_VORTEX_VISUAL, true);
276 events.RescheduleEvent(EVENT_START_VORTEX_REAL, 1s, 1);
277 break;
279 events.RescheduleEvent(EVENT_START_PHASE_2_FLY_UP, 0ms, 1);
280 break;
282 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 0ms, 1);
283 break;
285 events.RescheduleEvent(EVENT_SURGE_OF_POWER_WARNING, 0ms, 1);
286 break;
287 }
288 }
289 else if (type == EFFECT_MOTION_TYPE)
290 {
291 switch (id)
292 {
294 me->SetDisableGravity(false);
295 events.RescheduleEvent(EVENT_START_FIGHT, 0ms, 1);
296 break;
298 events.RescheduleEvent(EVENT_VORTEX_FLY_TO_CENTER, 0ms, 1);
299 break;
301 me->SetDisableGravity(false);
302 events.RescheduleEvent(EVENT_VORTEX_LAND_1, 0ms, 1);
303 break;
306 break;
308 events.RescheduleEvent(EVENT_START_PHASE_3, 6s, 1);
309 break;
310 }
311 }
312 }
const Position CenterPos
Definition: halls_of_reflection.h:314
@ LIGHT_ARCANE_RUNES
Definition: boss_malygos.cpp:194
@ 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:65
@ EVENT_START_FIGHT
Definition: boss_malygos.cpp:100
@ EVENT_START_PHASE_3
Definition: boss_malygos.cpp:132
@ EVENT_VORTEX_LAND_1
Definition: boss_malygos.cpp:111
@ EVENT_SURGE_OF_POWER_WARNING
Definition: boss_malygos.cpp:125
@ EVENT_START_PHASE_2_FLY_UP
Definition: boss_malygos.cpp:115
@ EVENT_START_VORTEX_REAL
Definition: boss_malygos.cpp:109
@ EVENT_RESUME_FLYING_CIRCLES_PH_2
Definition: boss_malygos.cpp:123
@ EVENT_VORTEX_FLY_TO_CENTER
Definition: boss_malygos.cpp:108
@ EVENT_INTRO_LAND
Definition: boss_malygos.cpp:99
@ NPC_WORLD_TRIGGER_LAOI
Definition: eye_of_eternity.h:41
#define INTRO_MOVEMENT_INTERVAL
Definition: eye_of_eternity.h:94
@ SPELL_PORTAL_BEAM
Definition: eye_of_eternity.h:65
@ NPC_PORTAL
Definition: boss_terestian_illhoof.cpp:54
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition: MotionMaster.h:56
Definition: Creature.h:43
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:2366
float GetPositionZ() const
Definition: Position.h:118
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117

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, Creature::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 ScriptedAI.

230 {
231 events.Reset();
232 events.SetPhase(PHASE_NONE);
234
237 IntroCounter = 0;
238 bLockHealthCheck = false;
239
243
244 if (pInstance)
245 {
248 }
249 }
@ PHASE_NONE
Definition: boss_malygos.cpp:179
@ ACHIEV_YOU_DONT_HAVE_AN_ENTERNITY_EVENT
Definition: eye_of_eternity.h:89
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:110
@ EMOTE_ONESHOT_NONE
Definition: SharedDefines.h:1894
@ NOT_STARTED
Definition: InstanceScript.h:57
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:656

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 ScriptedAI.

315 {
316 if (spell->Id == SPELL_POWER_SPARK_MALYGOS_BUFF)
317 {
318 if (!bLockHealthCheck)
319 {
321 }
322 else
324 }
325 }
@ SAY_BUFFED_BY_SPARK
Definition: boss_malygos.cpp:162
@ SPELL_POWER_SPARK_MALYGOS_BUFF
Definition: eye_of_eternity.h:69
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776

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()

Reimplemented from ScriptedAI.

374 {
375 HandleIntroSpeech(diff);
376
377 if (!UpdateVictim())
378 return;
379
380 events.Update(diff);
381
383 return;
384
385 switch (events.ExecuteEvent())
386 {
387 case 0:
388 break;
389 case EVENT_BERSERK:
390 me->CastSpell(me, SPELL_BERSERK, true);
392
393 break;
395 {
396 if (pInstance)
401 float angle = CenterPos.GetAngle(me);
402 float x = CenterPos.GetPositionX() + cos(angle) * 35.0f;
403 float y = CenterPos.GetPositionY() + std::sin(angle) * 35.0f;
404 float z = FourSidesPos[0].GetPositionZ();
407 break;
408 }
409 case EVENT_INTRO_LAND:
410 {
412 break;
413 }
415 {
416 if (pInstance)
417 {
420 }
422 if (Unit* target = me->SelectNearestTarget(250.0f))
423 {
424 AttackStart(target);
425 me->GetMotionMaster()->MoveChase(target);
426 }
427
428 events.SetPhase(PHASE_ONE);
429 events.RescheduleEvent(EVENT_BERSERK, 10min, 0);
430 events.RescheduleEvent(EVENT_SPELL_ARCANE_BREATH, 9s, 12s, 1);
431 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 2s, 5s, 1);
432 events.RescheduleEvent(EVENT_SUMMON_POWER_SPARK, 10s, 15s, 1);
433 events.RescheduleEvent(EVENT_START_VORTEX_0, 30s, 1);
434 break;
435 }
438 events.Repeat(12s, 15s);
439 break;
442 events.Repeat(10s, 15s);
443 break;
445 {
446 uint8 random = urand(0, 3);
448 c->CastSpell(c, SPELL_PORTAL_BEAM, false);
450 {
451 c->AI()->DoAction(1);
452 c->AI()->Talk(EMOTE_POWER_SPARK);
453 }
454
455 events.Repeat(20s, 30s);
456 }
457 break;
459 {
460 bLockHealthCheck = true;
463 summons.DoAction(2, pred); // stop following
465
467 me->SetTarget();
468
470 me->StopMoving();
471 me->SetDisableGravity(true);
473
474 events.DelayEvents(25000, 1); // don't delay berserk (group 0)
475 }
476 break;
479 break;
481 {
485
486 Position pos;
487 float angle = (me->GetOrientation() >= M_PI / 4 ? me->GetOrientation() - M_PI / 4 : 7 * M_PI / 4 + me->GetOrientation());
488 pos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 40.0f;
489 pos.m_positionY = CenterPos.GetPositionY() + std::sin(angle) * 40.0f;
490 pos.m_positionZ = CenterPos.GetPositionZ() + 20.0f;
492
494 {
495 vp->SetDisableGravity(true);
496
497 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
498 if (!PlayerList.IsEmpty())
499 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
500 if (Player* pPlayer = i->GetSource())
501 {
502 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
503 continue;
504
505 Position plrpos;
506 float playerAngle = CenterPos.GetAngle(pPlayer);
507 plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f;
508 plrpos.m_positionY = CenterPos.GetPositionY() + std::sin(playerAngle) * 5.0f;
509 plrpos.m_positionZ = CenterPos.GetPositionZ() + 18.0f;
510 plrpos.SetOrientation(plrpos.GetAngle(&CenterPos));
511
513 {
514 pPlayer->CastSpell(pPlayer, SPELL_FREEZE_ANIM, true);
515 pPlayer->CastSpell(c, SPELL_VORTEX_CONTROL_VEHICLE, true);
516 if (!pPlayer->GetVehicle()) // didn't work somehow, try again with a different way, if fails - break
517 {
518 pPlayer->EnterVehicle(c, 0);
519 if (!pPlayer->GetVehicle())
520 continue;
521 }
522 //pPlayer->ClearUnitState(UNIT_STATE_ONVEHICLE);
523
524 Movement::MoveSplineInit init(pPlayer);
526 init.SetFacing(pPlayer->GetOrientation());
527 init.SetTransportExit();
528 init.Launch();
529
530 pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
531 pPlayer->SetDisableGravity(true, true);
532
533 sScriptMgr->AnticheatSetCanFlybyServer(pPlayer, true);
534
536 data << pPlayer->GetPackGUID();
537 pPlayer->SendMessageToSet(&data, true);
538
539 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
540
541 pPlayer->SetGuidValue(PLAYER_FARSIGHT, vp->GetGUID());
542 c->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
543 }
544 }
545 }
546
547 events.RescheduleEvent(EVENT_VORTEX_LAND_0, 11s, 1);
548 break;
549 }
552
553 break;
555 {
556 bLockHealthCheck = false;
558 summons.DoAction(1, pred); // resume following
560 if (Unit* target = me->GetVictim())
561 {
562 AttackStart(target);
563 me->GetMotionMaster()->MoveChase(target);
564 }
565 events.RescheduleEvent(EVENT_START_VORTEX_0, 60s, 1);
566 break;
567 }
569 events.SetPhase(PHASE_TWO);
573 me->SetTarget();
575 me->DisableSpline();
577 events.CancelEventGroup(1); // don't cancel berserk (group 0)
578 break;
580 {
583 me->DisableSpline();
584 me->SetDisableGravity(true);
586 events.RescheduleEvent(EVENT_START_PHASE_2_MOVE_TO_SIDE, 22s + 500ms, 1);
587 break;
588 }
593 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
594 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 8s, 1);
595 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 55s, 1);
596 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
597
598 for (int i = 0; i < MAX_NEXUS_LORDS; i++)
599 {
600 float dist = 22.0f;
601 float angle = M_PI / 2 + ((float)i / MAX_NEXUS_LORDS) * 2 * M_PI;
602 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))
604 {
605 c->EnterVehicle(disk, 0);
606 disk->AI()->DoAction(1); // start moving
607 }
608 }
609 for (int i = 0; i < MAX_SCIONS_OF_ETERNITY; i++)
610 {
611 float dist = 30.0f;
612 float angle = 0.0f + ((float)i / MAX_SCIONS_OF_ETERNITY) * 2 * M_PI;
613 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))
615 {
616 c->EnterVehicle(disk, 0);
617 disk->AI()->DoAction(1); // start moving
618 }
619 }
620
621 break;
623 {
625 me->StopMoving();
626 float dist = urand(5, 30);
627 float angle = rand_norm() * 2 * M_PI;
628 float posx = CenterPos.GetPositionX() + cos(angle) * dist;
629 float posy = CenterPos.GetPositionY() + std::sin(angle) * dist;
630 me->SetFacingTo(me->GetAngle(posx, posy));
631 me->CastSpell(posx, posy, CenterPos.GetPositionZ() + 1.5f, SPELL_ARCANE_OVERLOAD, true);
632 events.Repeat(15s);
633 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 3s, 1);
634 }
635 break;
637 {
638 float angle = CenterPos.GetAngle(me);
640 float newangle = angle + 0.5f;
641 if (newangle >= 2 * M_PI) newangle -= 2 * M_PI;
643 }
644 break;
646 {
648 float angle = CenterPos.GetAngle(me);
650 me->StopMoving();
652 events.CancelEventGroup(1); // everything beside berserk
653 }
654 break;
657 events.RescheduleEvent(EVENT_SPELL_SURGE_OF_POWER, 1500ms, 1);
658 break;
663 events.RescheduleEvent(EVENT_CLEAR_TARGET, 10s, 1);
664 events.RescheduleEvent(EVENT_RESUME_FLYING_CIRCLES_PH_2, 10s, 1);
665 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 17s, 25s, 1);
666 events.RescheduleEvent(EVENT_SPELL_ARCANE_OVERLOAD, 16s, 1);
667 events.RescheduleEvent(EVENT_MOVE_TO_SURGE_OF_POWER, 65s, 1);
668 events.RescheduleEvent(EVENT_CHECK_TRASH_DEAD, 3s, 1);
669 break;
672 me->SetTarget();
673 break;
675 {
677 events.RepeatEvent(3000);
678 else
679 {
681 me->SetTarget();
682 events.CancelEventGroup(1);
684 // start phase 3
688 me->StopMoving();
690 events.RescheduleEvent(EVENT_LIGHT_DIMENSION_CHANGE, 1s, 1);
691 events.RescheduleEvent(EVENT_DESTROY_PLATFORM_0, 10s, 1);
692 }
693 }
694 break;
697 break;
700 {
701 c->SetFaction(me->GetFaction());
702 c->CastSpell(c, SPELL_DESTROY_PLATFORM_VISUAL, true);
703 c->CastSpell(c, SPELL_DESTROY_PLATFORM_EFFECT, false);
704 }
706 events.RescheduleEvent(EVENT_MOVE_TO_PHASE_3_POSITION, 2s, 1);
707 break;
709 {
712
713 me->GetThreatMgr().ClearAllThreat(); // players on vehicle are unattackable -> leads to EnterEvadeMode() because target is not acceptable!
714
715 // mount players:
716 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
717 if (!PlayerList.IsEmpty())
718 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
719 if (Player* pPlayer = i->GetSource())
720 {
721 sScriptMgr->AnticheatSetUnderACKmount(pPlayer);
722
723 if (!pPlayer->IsAlive() || pPlayer->IsGameMaster())
724 continue;
725
726 if (Creature* c = me->SummonCreature(NPC_WYRMREST_SKYTALON, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() - 20.0f, 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 0))
727 {
728 c->SetFaction(pPlayer->GetFaction());
729 //pPlayer->CastCustomSpell(60683, SPELLVALUE_BASE_POINT0, 1, c, true);
730 c->m_Events.AddEvent(new EoEDrakeEnterVehicleEvent(*c, pPlayer->GetGUID()), c->m_Events.CalculateTime(500));
731 AttackStart(c);
732 }
733 }
734
735 events.RescheduleEvent(EVENT_SAY_PHASE_3_INTRO, 3s, 1);
736 }
737 break;
740 break;
742 events.SetPhase(PHASE_THREE);
746 if (Unit* target = me->GetVictim())
747 AttackStart(target);
748 events.RescheduleEvent(EVENT_SPELL_ARCANE_PULSE, 0ms, 1);
749 events.RescheduleEvent(EVENT_SPELL_STATIC_FIELD, 1s, 4s, 1);
750 events.RescheduleEvent(EVENT_SPELL_PH3_SURGE_OF_POWER, 4s, 7s, 1);
751 events.RescheduleEvent(EVENT_SPELL_ARCANE_STORM, 12s, 15s, 1);
752 break;
755 events.Repeat(3s);
756 break;
758 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, false))
759 {
760 me->SetFacingToObject(target);
761 me->CastSpell(target, SPELL_STATIC_FIELD_MAIN, true);
762 }
763 events.Repeat(12s);
764 break;
766 me->CastSpell((Unit*)nullptr, SPELL_PH3_SURGE_OF_POWER, false);
767 events.Repeat(7s);
768 break;
769 }
770
772 }
double rand_norm()
Definition: Random.cpp:77
std::uint8_t uint8
Definition: Define.h:109
@ LIGHT_CHANGE_DIMENSIONS
Definition: boss_malygos.cpp:193
@ LIGHT_OBSCURE_ARCANE_RUNES
Definition: boss_malygos.cpp:195
@ LIGHT_OBSCURE_SPACE
Definition: boss_malygos.cpp:192
@ MI_POINT_START_PH_3
Definition: boss_malygos.cpp:50
@ PHASE_THREE
Definition: boss_malygos.cpp:182
#define SPELL_ARCANE_BREATH
Definition: boss_malygos.cpp:92
@ SAY_END_P1
Definition: boss_malygos.cpp:152
@ EMOTE_POWER_SPARK
Definition: boss_malygos.cpp:169
@ SAY_DEEP_BREATH
Definition: boss_malygos.cpp:150
@ SAY_PHASE_2
Definition: boss_malygos.cpp:153
@ SAY_SURGE_OF_POWER
Definition: boss_malygos.cpp:161
@ SAY_END_P2
Definition: boss_malygos.cpp:157
@ SAY_MAGIC_BLAST
Definition: boss_malygos.cpp:155
@ EMOTE_BERSERK
Definition: boss_malygos.cpp:167
@ EMOTE_SURGE_OF_POWER_WARNING_P2
Definition: boss_malygos.cpp:160
@ SAY_INTRO_PHASE_3
Definition: boss_malygos.cpp:158
#define SPELL_ARCANE_STORM
Definition: boss_malygos.cpp:93
@ SPELL_FREEZE_ANIM
Definition: boss_malygos.cpp:67
@ SPELL_ARCANE_PULSE
Definition: boss_malygos.cpp:82
@ SPELL_DESTROY_PLATFORM_VISUAL
Definition: boss_malygos.cpp:80
@ SPELL_VORTEX_CONTROL_VEHICLE
Definition: boss_malygos.cpp:66
@ SPELL_SURGE_OF_POWER
Definition: boss_malygos.cpp:76
@ SPELL_DESTROY_PLATFORM_EFFECT
Definition: boss_malygos.cpp:79
@ SPELL_STATIC_FIELD_MAIN
Definition: boss_malygos.cpp:86
@ SPELL_ARCANE_OVERLOAD
Definition: boss_malygos.cpp:69
@ SPELL_BERSERK
Definition: boss_malygos.cpp:59
#define MAX_SCIONS_OF_ETERNITY
Definition: boss_malygos.cpp:186
@ EVENT_SPELL_ARCANE_PULSE
Definition: boss_malygos.cpp:134
@ EVENT_CLEAR_TARGET
Definition: boss_malygos.cpp:119
@ EVENT_VORTEX_LAND_0
Definition: boss_malygos.cpp:110
@ EVENT_SPELL_ARCANE_BREATH
Definition: boss_malygos.cpp:104
@ EVENT_DESTROY_PLATFORM_0
Definition: boss_malygos.cpp:130
@ EVENT_SPELL_SURGE_OF_POWER
Definition: boss_malygos.cpp:126
@ EVENT_START_PHASE_2_MOVE_TO_SIDE
Definition: boss_malygos.cpp:117
@ EVENT_MOVE_TO_PHASE_3_POSITION
Definition: boss_malygos.cpp:131
@ EVENT_LIGHT_DIMENSION_CHANGE
Definition: boss_malygos.cpp:129
@ EVENT_START_VORTEX_0
Definition: boss_malygos.cpp:107
@ EVENT_SUMMON_POWER_SPARK
Definition: boss_malygos.cpp:106
@ EVENT_BERSERK
Definition: boss_malygos.cpp:101
@ EVENT_SPELL_STATIC_FIELD
Definition: boss_malygos.cpp:135
@ EVENT_SPELL_ARCANE_OVERLOAD
Definition: boss_malygos.cpp:121
@ EVENT_CHECK_TRASH_DEAD
Definition: boss_malygos.cpp:118
@ EVENT_SAY_PHASE_3_INTRO
Definition: boss_malygos.cpp:133
@ EVENT_SPELL_PH3_SURGE_OF_POWER
Definition: boss_malygos.cpp:136
@ EVENT_MOVE_TO_SURGE_OF_POWER
Definition: boss_malygos.cpp:124
@ EVENT_SPELL_ARCANE_STORM
Definition: boss_malygos.cpp:105
#define MAX_NEXUS_LORDS
Definition: boss_malygos.cpp:185
#define SPELL_PH3_SURGE_OF_POWER
Definition: boss_malygos.cpp:94
@ 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:106
@ DATA_SET_IRIS_INACTIVE
Definition: eye_of_eternity.h:58
@ DATA_HIDE_IRIS_AND_PORTAL
Definition: eye_of_eternity.h:59
@ NPC_VORTEX
Definition: zone_undercity.cpp:527
@ EMOTE_STATE_CUSTOM_SPELL_01
Definition: SharedDefines.h:2010
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:117
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ PLAYER_FARSIGHT
Definition: UpdateFields.h:334
@ MOVEMENTFLAG_NONE
Definition: UnitDefines.h:343
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
#define sScriptMgr
Definition: ScriptMgr.h:709
@ SMSG_SPLINE_MOVE_UNROOT
Definition: Opcodes.h:802
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
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
bool UpdateVictim()
Definition: CreatureAI.cpp:280
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
Definition: ScriptedCreature.h:167
const T & DUNGEON_MODE(const T &normal5, const T &heroic10) const
Definition: ScriptedCreature.h:388
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
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
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
Definition: Position.h:27
float m_positionZ
Definition: Position.h:57
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:165
float m_positionX
Definition: Position.h:55
float m_positionY
Definition: Position.h:56
void SetOrientation(float orientation)
Definition: Position.h:111
float GetAngle(const Position *pos) const
Definition: Position.cpp:78
Definition: Player.h:1081
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:14424
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
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:1224
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
void StopMoving()
Definition: Unit.cpp:16650
uint32 GetFaction() const
Definition: Unit.h:808
void DisableSpline()
Definition: Unit.cpp:636
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
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:3077
void RemoveAllAuras()
Definition: Unit.cpp:5319
ThreatMgr & GetThreatMgr()
Definition: Unit.h:903
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2000
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:647
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
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:523
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:488
void MoveIdle()
Definition: MotionMaster.cpp:232
void Clear(bool reset=true)
Definition: MotionMaster.h:167
Definition: MoveSplineInit.h:71
Definition: WorldPacket.h:26
void AttackStart(Unit *victim) override
Definition: boss_malygos.cpp:339
void HandleIntroSpeech(const uint32 diff)
Definition: boss_malygos.cpp:825
Definition: eye_of_eternity.h:111

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(), 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(), Creature::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