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

Public Member Functions

 boss_ichoronAI (Creature *c)
 
void Reset () override
 
void DoAction (int32 param) override
 
void DoExplodeCompleted ()
 
void IchoronDoCastToAllHostilePlayers (uint32 spellId, bool triggered)
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void UpdateAI (uint32 uiDiff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustSummoned (Creature *pSummoned) override
 
void SummonedCreatureDespawn (Creature *pSummoned) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) override
 
void MoveInLineOfSight (Unit *) override
 
void EnterEvadeMode (EvadeReason why) 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
 

Public Attributes

InstanceScriptpInstance
 
SummonList globules
 
bool bIsExploded
 
bool bIsFrenzy
 
uint32 uiWaterBoltVolleyTimer
 
uint32 uiDrainedTimer
 
- 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_ichoronAI()

boss_ichoron::boss_ichoronAI::boss_ichoronAI ( Creature c)
inline
86 {
88 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * pInstance
Definition: boss_ichoron.cpp:90
SummonList globules
Definition: boss_ichoron.cpp:91

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DoAction()

void boss_ichoron::boss_ichoronAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

109 {
110 if (!me->IsAlive())
111 return;
112
113 switch (param)
114 {
116 if (pInstance)
119 if (bIsExploded)
121 break;
123 uint32 damage = me->CountPctFromMaxHealth(3);
124 damage = std::min(damage, me->GetHealth() - 1);
125 me->ModifyHealth(-int32(damage));
126 me->LowerPlayerDamageReq(damage);
127 break;
128 }
129 }
std::int32_t int32
Definition: Define.h:103
std::uint32_t uint32
Definition: Define.h:107
@ DATA_ACHIEV
Definition: violet_hold.h:151
#define ACTION_WATER_ELEMENT_KILLED
Definition: boss_ichoron.cpp:25
#define ACTION_WATER_ELEMENT_HIT
Definition: boss_ichoron.cpp:24
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition: Creature.cpp:3793
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:14048
bool IsAlive() const
Definition: Unit.h:1204
uint32 GetHealth() const
Definition: Unit.h:869
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:878
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void DoExplodeCompleted()
Definition: boss_ichoron.cpp:131
bool bIsExploded
Definition: boss_ichoron.cpp:92

References ACTION_WATER_ELEMENT_HIT, ACTION_WATER_ELEMENT_KILLED, bIsExploded, Unit::CountPctFromMaxHealth(), DATA_ACHIEV, DoExplodeCompleted(), Unit::GetHealth(), Unit::IsAlive(), Creature::LowerPlayerDamageReq(), ScriptedAI::me, Unit::ModifyHealth(), pInstance, and ZoneScript::SetData().

◆ DoExplodeCompleted()

void boss_ichoron::boss_ichoronAI::DoExplodeCompleted ( )
inline
132 {
133 bIsExploded = false;
135 if (!HealthBelowPct(25))
136 {
139 }
140
143 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ SAY_BUBBLE
Definition: boss_ichoron.cpp:45
@ SPELL_PROTECTIVE_BUBBLE
Definition: boss_ichoron.cpp:58
@ SPELL_DRAINED
Definition: boss_ichoron.cpp:55
Talk
Definition: hyjal.cpp:82
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:364
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition: Creature.cpp:3505
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4758
uint32 GetNativeDisplayId() const
Definition: Unit.h:1509
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
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684

References bIsExploded, Unit::CastSpell(), Unit::GetNativeDisplayId(), ScriptedAI::HealthBelowPct(), ScriptedAI::me, Unit::RemoveAura(), Unit::RemoveUnitFlag(), SAY_BUBBLE, Creature::SetDisplayId(), SPELL_DRAINED, SPELL_PROTECTIVE_BUBBLE, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by DoAction(), and UpdateAI().

◆ EnterEvadeMode()

void boss_ichoron::boss_ichoronAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

293 {
296
297 if (pInstance)
299 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ DATA_FAILED
Definition: violet_hold.h:146
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683

References DATA_FAILED, CreatureAI::EnterEvadeMode(), ScriptedAI::me, pInstance, ZoneScript::SetData(), Unit::SetUnitFlag(), and UNIT_FLAG_NON_ATTACKABLE.

◆ IchoronDoCastToAllHostilePlayers()

void boss_ichoron::boss_ichoronAI::IchoronDoCastToAllHostilePlayers ( uint32  spellId,
bool  triggered 
)
inline
146 {
147 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
148 if (PlayerList.IsEmpty())
149 return;
150
151 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
152 if (Player* plr = i->GetSource())
153 me->CastSpell(plr, spellId, triggered);
154 }
bool IsEmpty() const
Definition: LinkedList.h:97
Definition: LinkedList.h:139
Map * GetMap() const
Definition: Object.h:531
Definition: Player.h:1064
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References MapRefMgr::begin(), Unit::CastSpell(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), LinkedListHead::IsEmpty(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustDied()

void boss_ichoron::boss_ichoronAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

273 {
275 bIsExploded = false;
279 if (pInstance)
281 }
@ DATA_BOSS_DIED
Definition: violet_hold.h:145
@ SAY_DEATH
Definition: boss_ichoron.cpp:41
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71

References bIsExploded, DATA_BOSS_DIED, SummonList::DespawnAll(), Unit::GetNativeDisplayId(), globules, ScriptedAI::me, pInstance, Unit::RemoveUnitFlag(), SAY_DEATH, ZoneScript::SetData(), Creature::SetDisplayId(), and UNIT_FLAG_NOT_SELECTABLE.

◆ JustEngagedWith()

void boss_ichoron::boss_ichoronAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

157 {
158 bIsExploded = false;
159 bIsFrenzy = false;
160 uiDrainedTimer = 15000;
161 uiWaterBoltVolleyTimer = urand(7000, 12000);
165 if (pInstance)
167 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SAY_AGGRO
Definition: boss_ichoron.cpp:39
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
uint32 uiDrainedTimer
Definition: boss_ichoron.cpp:95
uint32 uiWaterBoltVolleyTimer
Definition: boss_ichoron.cpp:94
bool bIsFrenzy
Definition: boss_ichoron.cpp:93

References bIsExploded, bIsFrenzy, Unit::CastSpell(), DATA_ACHIEV, CreatureAI::DoZoneInCombat(), ScriptedAI::me, pInstance, SAY_AGGRO, ZoneScript::SetData(), SPELL_PROTECTIVE_BUBBLE, uiDrainedTimer, uiWaterBoltVolleyTimer, and urand().

◆ JustSummoned()

void boss_ichoron::boss_ichoronAI::JustSummoned ( Creature pSummoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

249 {
250 if (pSummoned)
251 {
252 pSummoned->SetSpeed(MOVE_RUN, 0.3f);
254 pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0);
255 me->CastSpell(pSummoned, SPELL_CREATE_GLOBULE_VISUAL, true); // triggered should ignore los
256 globules.Summon(pSummoned);
257 if (pInstance)
259 }
260 }
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ MOVE_RUN
Definition: UnitDefines.h:329
@ DATA_ADD_TRASH_MOB
Definition: violet_hold.h:134
@ SPELL_CREATE_GLOBULE_VISUAL
Definition: boss_ichoron.cpp:66
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14383
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:1612
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:46
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:409

References Unit::CastSpell(), DATA_ADD_TRASH_MOB, Object::GetGUID(), Unit::GetMotionMaster(), globules, ScriptedAI::me, MOVE_RUN, MotionMaster::MoveFollow(), MOVEMENTFLAG_WALKING, pInstance, Unit::RemoveUnitMovementFlag(), ZoneScript::SetGuidData(), Unit::SetSpeed(), SPELL_CREATE_GLOBULE_VISUAL, and SummonList::Summon().

◆ KilledUnit()

void boss_ichoron::boss_ichoronAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

284 {
285 if (victim && victim->GetGUID() == me->GetGUID())
286 return;
287 Talk(SAY_SLAY);
288 }
@ SAY_SLAY
Definition: boss_ichoron.cpp:40

References Object::GetGUID(), ScriptedAI::me, and SAY_SLAY.

◆ MoveInLineOfSight()

void boss_ichoron::boss_ichoronAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

290{}

◆ Reset()

◆ SummonedCreatureDespawn()

void boss_ichoron::boss_ichoronAI::SummonedCreatureDespawn ( Creature pSummoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

263 {
264 if (pSummoned)
265 {
266 globules.Despawn(pSummoned);
267 if (pInstance)
269 }
270 }
@ DATA_DELETE_TRASH_MOB
Definition: violet_hold.h:135
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References DATA_DELETE_TRASH_MOB, SummonList::Despawn(), Object::GetGUID(), globules, pInstance, and ZoneScript::SetGuidData().

◆ UpdateAI()

void boss_ichoron::boss_ichoronAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

170 {
171 if (!UpdateVictim())
172 return;
173
174 if (!bIsFrenzy && !bIsExploded && HealthBelowPct(25))
175 {
177 me->CastSpell(me, SPELL_FRENZY, true);
178 bIsFrenzy = true;
179 }
180
181 if (!bIsFrenzy)
182 {
183 if (!bIsExploded)
184 {
186 {
191 me->CastSpell(me, SPELL_DRAINED, true);
192 bIsExploded = true;
193 uiDrainedTimer = 15000;
195 me->SetDisplayId(11686);
196 for (uint8 i = 0; i < MAX_SPAWN_LOC; ++i)
197 {
198 float angle = rand_norm() * 2 * M_PI;
199 Position p1(SpawnLoc[i]), p2(SpawnLoc[i]);
200 p1.m_positionX += 2.5f * cos(angle);
201 p1.m_positionY += 2.5f * std::sin(angle);
202 p2.m_positionX -= 2.5f * cos(angle);
203 p2.m_positionY -= 2.5f * std::sin(angle);
206 }
207 }
208 }
209 else
210 {
211 if (uiDrainedTimer <= uiDiff)
213 else
214 {
215 uiDrainedTimer -= uiDiff;
216
217 bool bIsWaterElementsAlive = false;
218 if (!globules.empty())
219 {
220 for (ObjectGuid const& guid : globules)
221 if (Creature* pTemp = ObjectAccessor::GetCreature(*me, guid))
222 if (pTemp->IsAlive())
223 {
224 bIsWaterElementsAlive = true;
225 break;
226 }
227 }
228
229 if (!bIsWaterElementsAlive)
231 }
232 }
233 }
234
235 if (!bIsExploded)
236 {
237 if (uiWaterBoltVolleyTimer <= uiDiff)
238 {
239 me->CastSpell((Unit*)nullptr, SPELL_WATER_BOLT_VOLLEY, false);
240 uiWaterBoltVolleyTimer = urand(10000, 15000);
241 }
242 else uiWaterBoltVolleyTimer -= uiDiff;
243 }
244
246 }
double rand_norm()
Definition: Random.cpp:77
std::uint8_t uint8
Definition: Define.h:109
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: Object.h:45
@ SAY_SHATTER
Definition: boss_ichoron.cpp:44
@ SAY_ENRAGE
Definition: boss_ichoron.cpp:43
#define SPELL_WATER_BLAST
Definition: boss_ichoron.cpp:69
@ NPC_ICHOR_GLOBULE
Definition: boss_ichoron.cpp:50
static Position SpawnLoc[MAX_SPAWN_LOC]
Definition: boss_ichoron.cpp:28
#define MAX_SPAWN_LOC
Definition: boss_ichoron.cpp:27
#define SPELL_WATER_BOLT_VOLLEY
Definition: boss_ichoron.cpp:70
#define SPELL_FRENZY
Definition: boss_ichoron.cpp:71
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:413
bool UpdateVictim()
Definition: CreatureAI.cpp:269
bool empty() const
Definition: ScriptedCreature.h:73
Definition: Creature.h:46
Definition: ObjectGuid.h:118
Definition: Position.h:28
Definition: Unit.h:630
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4111
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
void IchoronDoCastToAllHostilePlayers(uint32 spellId, bool triggered)
Definition: boss_ichoron.cpp:145

References bIsExploded, bIsFrenzy, Unit::CastSpell(), DoExplodeCompleted(), UnitAI::DoMeleeAttackIfReady(), CreatureAI::DoSummon(), CreatureAI::DoZoneInCombat(), SummonList::empty(), ObjectAccessor::GetCreature(), globules, Unit::HasAura(), ScriptedAI::HealthBelowPct(), IchoronDoCastToAllHostilePlayers(), Unit::InterruptNonMeleeSpells(), Position::m_positionX, Position::m_positionY, MAX_SPAWN_LOC, ScriptedAI::me, NPC_ICHOR_GLOBULE, rand_norm(), SAY_ENRAGE, SAY_SHATTER, Creature::SetDisplayId(), Unit::SetUnitFlag(), SpawnLoc, SPELL_DRAINED, SPELL_FRENZY, SPELL_PROTECTIVE_BUBBLE, SPELL_WATER_BLAST, SPELL_WATER_BOLT_VOLLEY, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, uiDrainedTimer, uiWaterBoltVolleyTimer, UNIT_FLAG_NOT_SELECTABLE, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ bIsExploded

bool boss_ichoron::boss_ichoronAI::bIsExploded

◆ bIsFrenzy

bool boss_ichoron::boss_ichoronAI::bIsFrenzy

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

◆ globules

SummonList boss_ichoron::boss_ichoronAI::globules

◆ pInstance

◆ uiDrainedTimer

uint32 boss_ichoron::boss_ichoronAI::uiDrainedTimer

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

◆ uiWaterBoltVolleyTimer

uint32 boss_ichoron::boss_ichoronAI::uiWaterBoltVolleyTimer

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