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

Public Member Functions

 boss_akilzonAI (Creature *creature)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *who) override
 
void SetWeather (uint32 weather, float grade)
 
void HandleStormSequence (Unit *Cloud)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) 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
 
- 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)
 
 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
 

Private Attributes

ObjectGuid BirdGUIDs [8]
 
ObjectGuid TargetGUID
 
ObjectGuid CycloneGUID
 
ObjectGuid CloudGUID
 
uint8 StormCount
 
bool isRaining
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_akilzonAI()

boss_akilzon::boss_akilzonAI::boss_akilzonAI ( Creature creature)
inline
88 : BossAI(creature, DATA_AKILZONEVENT)
89 {
90 }
@ DATA_AKILZONEVENT
Definition: zulaman.h:30
Definition: ScriptedCreature.h:457

Member Function Documentation

◆ HandleStormSequence()

void boss_akilzon::boss_akilzonAI::HandleStormSequence ( Unit Cloud)
inline
155 {
156 if (StormCount < 10 && StormCount > 1)
157 {
158 // deal damage
159 int32 bp0 = 800;
160 for (uint8 i = 2; i < StormCount; ++i)
161 bp0 *= 2;
162
163 std::list<Unit*> tempUnitMap;
164
168
169 // deal damage
170 for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
171 {
172 if (Unit* target = (*i))
173 {
174 if (Cloud && !Cloud->IsWithinDist(target, 6, false))
175 Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, me->GetGUID());
176 }
177 }
178
179 // visual
180 float x, y, z;
181 z = me->GetPositionZ();
182 for (uint8 i = 0; i < 5 + rand() % 5; ++i)
183 {
184 x = 343.0f + rand() % 60;
185 y = 1380.0f + rand() % 60;
186 if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000))
187 {
188 trigger->SetFaction(FACTION_FRIENDLY);
189 trigger->SetMaxHealth(100000);
190 trigger->SetHealth(100000);
191 trigger->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
192 if (Cloud)
193 Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, nullptr, nullptr, true, 0, 0, Cloud->GetGUID());
194 }
195 }
196 }
197
198 ++StormCount;
199
200 if (StormCount > 10)
201 {
202 StormCount = 0; // finish
203 events.ScheduleEvent(EVENT_SUMMON_EAGLES, 5000);
206 if (Cloud)
207 Unit::DealDamage(Cloud, Cloud, Cloud->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
209 isRaining = false;
210 }
211 events.ScheduleEvent(EVENT_STORM_SEQUENCE, 1000);
212 }
#define SIZE_OF_GRIDS
Definition: MapDefines.h:25
std::int32_t int32
Definition: Define.h:103
std::uint8_t uint8
Definition: Define.h:109
@ DIRECT_DAMAGE
Definition: Unit.h:248
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ SPELL_ZAP
Definition: boss_akilzon.cpp:45
@ EVENT_SUMMON_EAGLES
Definition: boss_akilzon.cpp:76
@ EVENT_STORM_SEQUENCE
Definition: boss_akilzon.cpp:77
events
Definition: boss_sartura.cpp:43
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:297
@ WEATHER_STATE_FINE
Definition: Weather.h:47
Creature * me
Definition: ScriptedCreature.h:280
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1316
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2404
void Clear()
Definition: ObjectGuid.h:138
float GetPositionZ() const
Definition: Position.h:119
Definition: Unit.h:630
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111
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:1225
uint32 GetHealth() const
Definition: Unit.h:869
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false, Spell const *spell=nullptr)
Definition: Unit.cpp:811
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:207
Definition: GridNotifiers.h:423
Definition: GridNotifiers.h:1077
bool isRaining
Definition: boss_akilzon.cpp:363
void SetWeather(uint32 weather, float grade)
Definition: boss_akilzon.cpp:142
ObjectGuid CloudGUID
Definition: boss_akilzon.cpp:361
uint8 StormCount
Definition: boss_akilzon.cpp:362

References Unit::CastCustomSpell(), ObjectGuid::Clear(), CloudGUID, Unit::DealDamage(), DIRECT_DAMAGE, EVENT_STORM_SEQUENCE, EVENT_SUMMON_EAGLES, FACTION_FRIENDLY, Object::GetGUID(), Unit::GetHealth(), Position::GetPositionZ(), Unit::InterruptNonMeleeSpells(), isRaining, WorldObject::IsWithinDist(), ScriptedAI::me, SetWeather(), SIZE_OF_GRIDS, SPELL_SCHOOL_MASK_NORMAL, SPELL_ZAP, StormCount, WorldObject::SummonTrigger(), UNIT_FLAG_NOT_SELECTABLE, Cell::VisitAllObjects(), and WEATHER_STATE_FINE.

Referenced by UpdateAI().

◆ JustDied()

void boss_akilzon::boss_akilzonAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

129 {
131 _JustDied();
132 if (instance)
134 }
@ DONE
Definition: InstanceScript.h:60
@ SAY_DEATH
Definition: boss_akilzon.cpp:56
Talk
Definition: hyjal.cpp:82
InstanceScript *const instance
Definition: ScriptedCreature.h:464
void _JustDied()
Definition: ScriptedCreature.cpp:614
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References BossAI::_JustDied(), DATA_AKILZONEVENT, DONE, BossAI::instance, SAY_DEATH, and ZoneScript::SetData().

◆ JustEngagedWith()

void boss_akilzon::boss_akilzonAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

113 {
114 events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 20000)); // 10 to 20 seconds (bosskillers)
115 events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000)); // 20 to 30 seconds(bosskillers)
116 events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(10000, 20000)); // totaly random timer. can't find any info on this
117 events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
118 events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
119 events.ScheduleEvent(EVENT_ENRAGE, 10 * MINUTE * IN_MILLISECONDS); // 10 minutes till enrage(bosskillers)
120
122 //DoZoneInCombat();
123
124 if (instance)
126 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
constexpr auto MINUTE
Definition: Common.h:47
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ SAY_AGGRO
Definition: boss_akilzon.cpp:51
@ EVENT_CALL_LIGHTNING
Definition: boss_akilzon.cpp:73
@ EVENT_ENRAGE
Definition: boss_akilzon.cpp:78
@ EVENT_GUST_OF_WIND
Definition: boss_akilzon.cpp:72
@ EVENT_RAIN
Definition: boss_akilzon.cpp:75
@ EVENT_ELECTRICAL_STORM
Definition: boss_akilzon.cpp:74
@ EVENT_STATIC_DISRUPTION
Definition: boss_akilzon.cpp:71

References DATA_AKILZONEVENT, EVENT_CALL_LIGHTNING, EVENT_ELECTRICAL_STORM, EVENT_ENRAGE, EVENT_GUST_OF_WIND, EVENT_RAIN, EVENT_STATIC_DISRUPTION, IN_MILLISECONDS, IN_PROGRESS, BossAI::instance, MINUTE, SAY_AGGRO, ZoneScript::SetData(), and urand().

◆ KilledUnit()

void boss_akilzon::boss_akilzonAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

137 {
138 if (who->IsPlayer())
139 Talk(SAY_KILL);
140 }
@ SAY_KILL
Definition: boss_akilzon.cpp:55
bool IsPlayer() const
Definition: Object.h:197

References Object::IsPlayer(), and SAY_KILL.

◆ Reset()

void boss_akilzon::boss_akilzonAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

93 {
94 _Reset();
95
99
100 for (uint8 i = 0; i < 8; ++i)
101 BirdGUIDs[i].Clear();
102
103 StormCount = 0;
104 isRaining = false;
105
106 if (instance)
108
110 }
@ NOT_STARTED
Definition: InstanceScript.h:57
void _Reset()
Definition: ScriptedCreature.cpp:598
ObjectGuid TargetGUID
Definition: boss_akilzon.cpp:359
ObjectGuid CycloneGUID
Definition: boss_akilzon.cpp:360
ObjectGuid BirdGUIDs[8]
Definition: boss_akilzon.cpp:358

References BossAI::_Reset(), BirdGUIDs, ObjectGuid::Clear(), CloudGUID, CycloneGUID, DATA_AKILZONEVENT, BossAI::instance, isRaining, NOT_STARTED, ZoneScript::SetData(), SetWeather(), StormCount, TargetGUID, and WEATHER_STATE_FINE.

◆ SetWeather()

void boss_akilzon::boss_akilzonAI::SetWeather ( uint32  weather,
float  grade 
)
inline
143 {
144 Map* map = me->GetMap();
145 if (!map->IsDungeon())
146 return;
147
148 WorldPacket data(SMSG_WEATHER, (4 + 4 + 4));
149 data << uint32(weather) << float(grade) << uint8(0);
150
151 map->SendToPlayers(&data);
152 }
std::uint32_t uint32
Definition: Define.h:107
@ SMSG_WEATHER
Definition: Opcodes.h:786
Map * GetMap() const
Definition: Object.h:531
Definition: Map.h:313
bool IsDungeon() const
Definition: Map.h:448
void SendToPlayers(WorldPacket const *data) const
Definition: Map.cpp:2754
Definition: WorldPacket.h:27

References WorldObject::GetMap(), Map::IsDungeon(), ScriptedAI::me, Map::SendToPlayers(), and SMSG_WEATHER.

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

◆ UpdateAI()

void boss_akilzon::boss_akilzonAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Todo:
: fix it in correct way, that causes player to can fly until logout

Reimplemented from BossAI.

215 {
216 if (!UpdateVictim())
217 return;
218
219 events.Update(diff);
220
221 while (uint32 eventId = events.ExecuteEvent())
222 {
223 switch (eventId)
224 {
226 {
227 Unit* target = SelectTarget(SelectTargetMethod::Random, 1);
228 if (!target)
229 target = me->GetVictim();
230 if (target)
231 {
232 TargetGUID = target->GetGUID();
233 DoCast(target, SPELL_STATIC_DISRUPTION, false);
235 }
236 /*if (float dist = me->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f;
237 SDisruptAOEVisual_Timer = 1000 + std::floor(dist / 30 * 1000.0f);*/
238 events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 18000));
239 break;
240 }
242 {
243 Unit* target = SelectTarget(SelectTargetMethod::Random, 1);
244 if (!target)
245 target = me->GetVictim();
246 if (target)
247 DoCast(target, SPELL_GUST_OF_WIND);
248 events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000));
249 break;
250 }
253 events.ScheduleEvent(EVENT_CALL_LIGHTNING, urand(12000, 17000)); // totaly random timer. can't find any info on this
254 break;
256 {
257 Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50, true);
258 if (!target)
259 {
261 return;
262 }
263 target->CastSpell(target, 44007, true); // cloud visual
264 DoCast(target, SPELL_ELECTRICAL_STORM, false); // storm cyclon + visual
265 float x, y, z;
266 target->GetPosition(x, y, z);
268 /*
269 if (target)
270 {
271 target->SetDisableGravity(true);
272 target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
273 }
274 */
275
276 Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ() + 16, 0, 15000);
277 if (Cloud)
278 {
279 CloudGUID = Cloud->GetGUID();
280 Cloud->SetDisableGravity(true);
281 Cloud->StopMoving();
282 Cloud->SetObjectScale(1.0f);
284 Cloud->SetMaxHealth(9999999);
285 Cloud->SetHealth(9999999);
287 }
288 StormCount = 1;
289 events.ScheduleEvent(EVENT_ELECTRICAL_STORM, 60000); // 60 seconds(bosskillers)
290 events.ScheduleEvent(EVENT_RAIN, urand(47000, 52000));
291 break;
292 }
293 case EVENT_RAIN:
294 if (!isRaining)
295 {
297 isRaining = true;
298 }
299 else
300 events.ScheduleEvent(EVENT_RAIN, 1000);
301 break;
303 {
305 if (!target || !target->IsAlive())
306 {
308 return;
309 }
310 else if (Unit* Cyclone = ObjectAccessor::GetUnit(*me, CycloneGUID))
311 Cyclone->CastSpell(target, SPELL_SAND_STORM, true); // keep casting or...
312 HandleStormSequence(target);
313 break;
314 }
317
318 float x, y, z;
319 me->GetPosition(x, y, z);
320
321 for (uint8 i = 0; i < 8; ++i)
322 {
324 if (!bird) //they despawned on die
325 {
326 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
327 {
328 x = target->GetPositionX() + irand(-10, 10);
329 y = target->GetPositionY() + irand(-10, 10);
330 z = target->GetPositionZ() + urand(16, 20);
331 if (z > 95)
332 z = 95.0f - urand(0, 5);
333 }
335 if (creature)
336 {
337 creature->AddThreat(me->GetVictim(), 1.0f);
338 creature->AI()->AttackStart(me->GetVictim());
339 BirdGUIDs[i] = creature->GetGUID();
340 }
341 }
342 }
343 break;
344 case EVENT_ENRAGE:
346 DoCast(me, SPELL_BERSERK, true);
347 events.ScheduleEvent(EVENT_ENRAGE, 600000);
348 break;
349 default:
350 break;
351 }
352 }
353
355 }
int32 irand(int32 min, int32 max)
Definition: Random.cpp:37
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:49
@ SAY_ENRAGE
Definition: boss_akilzon.cpp:54
@ SAY_SUMMON
Definition: boss_akilzon.cpp:52
@ SPELL_SAND_STORM
Definition: boss_akilzon.cpp:46
@ SPELL_STATIC_DISRUPTION
Definition: boss_akilzon.cpp:37
@ SPELL_GUST_OF_WIND
Definition: boss_akilzon.cpp:40
@ SPELL_CALL_LIGHTNING
Definition: boss_akilzon.cpp:39
@ SPELL_ELECTRICAL_STORM
Definition: boss_akilzon.cpp:41
@ SPELL_BERSERK
Definition: boss_akilzon.cpp:42
constexpr auto NPC_SOARING_EAGLE
Definition: boss_akilzon.cpp:59
@ WEATHER_STATE_HEAVY_RAIN
Definition: Weather.h:51
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition: ScriptedCreature.h:488
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:143
virtual void SetObjectScale(float scale)
Definition: Object.h:116
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:2355
float GetPositionX() const
Definition: Position.h:117
void GetPosition(float &x, float &y) const
Definition: Position.h:122
float GetPositionY() const
Definition: Position.h:118
void SetFaction(uint32 faction)
Definition: Unit.cpp:10018
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14608
bool IsAlive() const
Definition: Unit.h:1204
void StopMoving()
Definition: Unit.cpp:16606
void SetHealth(uint32 val)
Definition: Unit.cpp:15433
virtual bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:20520
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:1168
Unit * GetVictim() const
Definition: Unit.h:789
void SetMaxHealth(uint32 val)
Definition: Unit.cpp:15483
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20477
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684
void HandleStormSequence(Unit *Cloud)
Definition: boss_akilzon.cpp:154

References Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), BirdGUIDs, Unit::CastSpell(), CloudGUID, CycloneGUID, UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), BossAI::EnterEvadeMode(), EVENT_CALL_LIGHTNING, EVENT_ELECTRICAL_STORM, EVENT_ENRAGE, EVENT_GUST_OF_WIND, EVENT_RAIN, EVENT_STATIC_DISRUPTION, EVENT_STORM_SEQUENCE, EVENT_SUMMON_EAGLES, FACTION_FRIENDLY, Object::GetGUID(), Position::GetPosition(), Position::GetPositionZ(), ObjectAccessor::GetUnit(), Unit::GetVictim(), HandleStormSequence(), irand(), Unit::IsAlive(), isRaining, ScriptedAI::me, NPC_SOARING_EAGLE, Unit::RemoveUnitFlag(), SAY_ENRAGE, SAY_SUMMON, UnitAI::SelectTarget(), Unit::SetDisableGravity(), Unit::SetFaction(), Unit::SetHealth(), Unit::SetInFront(), Unit::SetMaxHealth(), Object::SetObjectScale(), SetWeather(), SPELL_BERSERK, SPELL_CALL_LIGHTNING, SPELL_ELECTRICAL_STORM, SPELL_GUST_OF_WIND, SPELL_SAND_STORM, SPELL_STATIC_DISRUPTION, Unit::StopMoving(), StormCount, WorldObject::SummonCreature(), WorldObject::SummonTrigger(), TargetGUID, TEMPSUMMON_CORPSE_DESPAWN, UNIT_FLAG_NOT_SELECTABLE, CreatureAI::UpdateVictim(), urand(), and WEATHER_STATE_HEAVY_RAIN.

Member Data Documentation

◆ BirdGUIDs

ObjectGuid boss_akilzon::boss_akilzonAI::BirdGUIDs[8]
private

Referenced by Reset(), and UpdateAI().

◆ CloudGUID

ObjectGuid boss_akilzon::boss_akilzonAI::CloudGUID
private

◆ CycloneGUID

ObjectGuid boss_akilzon::boss_akilzonAI::CycloneGUID
private

Referenced by Reset(), and UpdateAI().

◆ isRaining

bool boss_akilzon::boss_akilzonAI::isRaining
private

◆ StormCount

uint8 boss_akilzon::boss_akilzonAI::StormCount
private

◆ TargetGUID

ObjectGuid boss_akilzon::boss_akilzonAI::TargetGUID
private

Referenced by Reset(), and UpdateAI().