AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_bug_trio Struct Reference
Inheritance diagram for boss_bug_trio:
BossAI ScriptedAI CreatureAI UnitAI boss_kri boss_vem boss_yauj

Public Member Functions

 boss_bug_trio (Creature *creature)
 
bool CheckInRoom () override
 
void EnterCombatWithTrio (Unit *who)
 
void EvadeAllBosses (EvadeReason why)
 
void DoAction (int32 action) override
 
void MovementInform (uint32 type, uint32 id) override
 
void EnterEvadeMode (EvadeReason why) override
 
void Reset () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void DoFinalSpell ()
 
void JustDied (Unit *killer) override
 
- 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)
 
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()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=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.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
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 InitializeAI ()
 
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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

TaskScheduler _scheduler
 
bool _dying
 
bool _isEating
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Static Public Attributes

static uint32 _creatureDying = 0
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 

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

boss_bug_trio::boss_bug_trio ( Creature creature)
inline
67: BossAI(creature, DATA_BUG_TRIO) { Reset(); }
Definition ScriptedCreature.h:467
void Reset() override
Definition boss_bug_trio.cpp:195
@ DATA_BUG_TRIO
Definition temple_of_ahnqiraj.h:29

References Reset().

Member Function Documentation

◆ CheckInRoom()

bool boss_bug_trio::CheckInRoom ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

70 {
71 if (me->GetExactDist2d(resetPoint) <= 10.f)
72 {
74 return false;
75 }
76
77 return true;
78 }
const Position resetPoint
Definition boss_bug_trio.cpp:62
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:90
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170
Creature * me
Definition ScriptedCreature.h:280
void EnterEvadeMode(EvadeReason why) override
Definition boss_bug_trio.cpp:189

References EnterEvadeMode(), CreatureAI::EVADE_REASON_BOUNDARY, Position::GetExactDist2d(), ScriptedAI::me, and resetPoint.

Referenced by UpdateAI().

◆ DamageTaken()

void boss_bug_trio::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

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

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

Reimplemented from UnitAI.

224 {
225 if (_dying && who && who->GetGUID() != me->GetGUID())
226 damage = 0;
227
229 {
230 damage = 0;
231 if (_isEating)
232 return;
233
236 _dying = true;
237 float x, y, z;
238 // Move the other bugs to this bug position
240 {
241 if (vem->GetGUID() != me->GetGUID())
242 {
243 if (vem->IsAlive())
244 {
245 vem->AI()->DoAction(ACTION_CONSUME);
246 me->GetRandomContactPoint(vem, x, y, z);
247 vem->GetMotionMaster()->MovePoint(POINT_CONSUME, x, y, z);
248 }
249 }
251 }
253 {
254 if (kri->GetGUID() != me->GetGUID())
255 {
256 if (kri->IsAlive())
257 {
258 kri->AI()->DoAction(ACTION_CONSUME);
259 me->GetRandomContactPoint(kri, x, y, z);
260 kri->GetMotionMaster()->MovePoint(POINT_CONSUME, x, y, z);
261 }
262 }
264 }
266 {
267 if (yauj->GetGUID() != me->GetGUID())
268 {
269 if (yauj->IsAlive())
270 {
271 yauj->AI()->DoAction(ACTION_CONSUME);
272 me->GetRandomContactPoint(yauj, x, y, z);
273 yauj->GetMotionMaster()->MovePoint(POINT_CONSUME, x, y, z);
274 }
275 }
277 }
278 }
279 }
@ REACT_PASSIVE
Definition Unit.h:548
@ ACTION_CONSUME
Definition boss_bug_trio.cpp:52
@ POINT_CONSUME
Definition boss_bug_trio.cpp:57
InstanceScript *const instance
Definition ScriptedCreature.h:474
Definition Creature.h:43
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
TaskScheduler & CancelAll()
Definition TaskScheduler.cpp:45
bool GetRandomContactPoint(Unit const *target, float &x, float &y, float &z, bool force=false) const
Definition Unit.cpp:700
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1047
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
TaskScheduler _scheduler
Definition boss_bug_trio.cpp:320
bool _isEating
Definition boss_bug_trio.cpp:322
bool _dying
Definition boss_bug_trio.cpp:321
static uint32 _creatureDying
Definition boss_bug_trio.cpp:323
@ DATA_BUG_TRIO_DEATH
Definition temple_of_ahnqiraj.h:43
@ DATA_KRI
Definition temple_of_ahnqiraj.h:40
@ DATA_VEM
Definition temple_of_ahnqiraj.h:41
@ DATA_YAUJ
Definition temple_of_ahnqiraj.h:42

References _creatureDying, _dying, _isEating, _scheduler, ACTION_CONSUME, TaskScheduler::CancelAll(), DATA_BUG_TRIO_DEATH, DATA_KRI, DATA_VEM, DATA_YAUJ, InstanceScript::GetCreature(), ZoneScript::GetData(), Object::GetGUID(), Unit::GetRandomContactPoint(), Unit::HealthBelowPctDamaged(), BossAI::instance, ScriptedAI::me, POINT_CONSUME, REACT_PASSIVE, and Creature::SetReactState().

◆ DoAction()

void boss_bug_trio::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

144 {
145 if (action == ACTION_CONSUME && !_dying)
146 {
147 _isEating = true;
148 me->SetSpeed(MOVE_RUN, 45.f / 7.f); // From sniffs
151 }
152
153 if (action == ACTION_EXPLODE && _dying)
154 {
156 _dying = false;
157 }
158 }
@ MOVE_RUN
Definition UnitDefines.h:350
@ ACTION_EXPLODE
Definition boss_bug_trio.cpp:53
@ SPELL_BLOODY_DEATH
Definition boss_bug_trio.cpp:26
TaskScheduler & DelayAll(std::chrono::duration< _Rep, _Period > const &duration)
Delays all tasks with the given duration.
Definition TaskScheduler.h:283
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:392
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:14481

References _dying, _isEating, _scheduler, ACTION_CONSUME, ACTION_EXPLODE, TaskScheduler::DelayAll(), UnitAI::DoCastSelf(), ScriptedAI::me, MOVE_RUN, REACT_PASSIVE, Creature::SetReactState(), Unit::SetSpeed(), and SPELL_BLOODY_DEATH.

◆ DoFinalSpell()

void boss_bug_trio::DoFinalSpell ( )
inline
282 {
283 switch (me->GetEntry())
284 {
285 case NPC_KRI:
287 break;
288 case NPC_VEM:
290 break;
291 case NPC_YAUJ:
292 for (uint8 i = 0; i < 10; ++i)
293 {
294 Position randomPos;
295 me->GetRandomContactPoint(me, randomPos.m_positionX, randomPos.m_positionY, randomPos.m_positionZ);
296 if (Creature* summon = me->SummonCreature(NPC_YAUJ_BROOD, randomPos))
297 DoZoneInCombat(summon);
298 }
299 break;
300 default:
301 break;
302 }
303 }
std::uint8_t uint8
Definition Define.h:109
@ SPELL_VENGEANCE
Definition boss_bug_trio.cpp:39
@ NPC_YAUJ_BROOD
Definition boss_bug_trio.cpp:47
@ SPELL_POISON_CLOUD
Definition boss_bug_trio.cpp:33
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:106
uint32 GetEntry() const
Definition Object.h:115
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:2368
Definition Position.h:27
float m_positionZ
Definition Position.h:57
float m_positionX
Definition Position.h:55
float m_positionY
Definition Position.h:56
@ NPC_YAUJ
Definition temple_of_ahnqiraj.h:72
@ NPC_KRI
Definition temple_of_ahnqiraj.h:71
@ NPC_VEM
Definition temple_of_ahnqiraj.h:70

References UnitAI::DoCastSelf(), CreatureAI::DoZoneInCombat(), Object::GetEntry(), Unit::GetRandomContactPoint(), Position::m_positionX, Position::m_positionY, Position::m_positionZ, ScriptedAI::me, NPC_KRI, NPC_VEM, NPC_YAUJ, NPC_YAUJ_BROOD, SPELL_POISON_CLOUD, SPELL_VENGEANCE, and WorldObject::SummonCreature().

Referenced by JustDied().

◆ EnterCombatWithTrio()

void boss_bug_trio::EnterCombatWithTrio ( Unit who)
inline
81 {
83
85 {
86 if (vem->GetGUID() != me->GetGUID())
87 {
88 vem->GetAI()->AttackStart(who);
89 }
90 }
92 {
93 if (kri->GetGUID() != me->GetGUID())
94 {
95 kri->GetAI()->AttackStart(who);
96 }
97 }
99 {
100 if (yauj->GetGUID() != me->GetGUID())
101 {
102 yauj->GetAI()->AttackStart(who);
103 }
104 }
105 }
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition ScriptedCreature.h:503

References DATA_KRI, DATA_VEM, DATA_YAUJ, InstanceScript::GetCreature(), Object::GetGUID(), BossAI::instance, BossAI::JustEngagedWith(), and ScriptedAI::me.

Referenced by boss_kri::JustEngagedWith(), boss_vem::JustEngagedWith(), and boss_yauj::JustEngagedWith().

◆ EnterEvadeMode()

void boss_bug_trio::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

190 {
192 EvadeAllBosses(why);
193 }
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:504
void EvadeAllBosses(EvadeReason why)
Definition boss_bug_trio.cpp:107

References BossAI::EnterEvadeMode(), and EvadeAllBosses().

Referenced by CheckInRoom().

◆ EvadeAllBosses()

void boss_bug_trio::EvadeAllBosses ( EvadeReason  why)
inline
108 {
110 {
111 if (vem->GetGUID() != me->GetGUID())
112 {
113 if (vem->IsAlive() && !vem->IsInEvadeMode())
114 vem->AI()->EnterEvadeMode(why);
115 else
116 vem->Respawn();
117 }
118 }
119
121 {
122 if (kri->GetGUID() != me->GetGUID())
123 {
124 if (kri->IsAlive() && !kri->IsInEvadeMode())
125 kri->AI()->EnterEvadeMode(why);
126 else
127 kri->Respawn();
128 }
129 }
130
132 {
133 if (yauj->GetGUID() != me->GetGUID())
134 {
135 if (yauj->IsAlive() && !yauj->IsInEvadeMode())
136 yauj->AI()->EnterEvadeMode(why);
137 else
138 yauj->Respawn();
139 }
140 }
141 }

References DATA_KRI, DATA_VEM, DATA_YAUJ, InstanceScript::GetCreature(), Object::GetGUID(), BossAI::instance, and ScriptedAI::me.

Referenced by EnterEvadeMode().

◆ JustDied()

void boss_bug_trio::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from CreatureAI.

306 {
309 {
311 DoFinalSpell();
313 me->DespawnOrUnsummon(3000);
314 return;
315 }
316
317 BossAI::JustDied(killer);
318 }
@ UNIT_DYNFLAG_LOOTABLE
Definition SharedDefines.h:3121
@ EMOTE_DEVOURED
Definition boss_bug_trio.cpp:55
void JustDied(Unit *) override
Definition ScriptedCreature.h:505
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:124
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
Talk
Definition hyjal.cpp:82
void DoFinalSpell()
Definition boss_bug_trio.cpp:281

References DATA_BUG_TRIO_DEATH, Creature::DespawnOrUnsummon(), DoFinalSpell(), EMOTE_DEVOURED, ZoneScript::GetData(), BossAI::instance, BossAI::JustDied(), ScriptedAI::me, Object::RemoveDynamicFlag(), ZoneScript::SetData(), and UNIT_DYNFLAG_LOOTABLE.

◆ MovementInform()

void boss_bug_trio::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

161 {
162 if (type != POINT_MOTION_TYPE || id != POINT_CONSUME)
163 return;
164
166 me->SetSpeed(MOVE_RUN, 15.f/7.f); // From sniffs
171 {
172 dying->AI()->DoAction(ACTION_EXPLODE);
173 me->SetTarget(dying->GetGUID());
174 }
175
176 _scheduler.Schedule(2s, [this](TaskContext /*context*/)
177 {
179 _isEating = false;
180 if (Unit* target = me->GetVictim())
181 {
182 me->GetMotionMaster()->Clear();
183 me->GetMotionMaster()->MoveChase(target);
184 AttackStart(target);
185 }
186 });
187 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ REACT_AGGRESSIVE
Definition Unit.h:550
@ SPELL_FULL_HEAL
Definition boss_bug_trio.cpp:27
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3562
void MoveIdle()
Definition MotionMaster.cpp:232
Definition TaskScheduler.h:421
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
float GetThreatListSize() const
Definition ThreatMgr.h:221
Definition Unit.h:636
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
Unit * GetVictim() const
Definition Unit.h:862
ThreatMgr & GetThreatMgr()
Definition Unit.h:912
void DoResetThreatList()
Definition ScriptedCreature.cpp:445

References _creatureDying, _isEating, _scheduler, ACTION_EXPLODE, UnitAI::DoCastSelf(), ScriptedAI::DoResetThreatList(), InstanceScript::GetCreature(), Unit::GetMotionMaster(), ThreatMgr::GetThreatListSize(), Unit::GetThreatMgr(), Unit::GetVictim(), BossAI::instance, ScriptedAI::me, MOVE_RUN, MotionMaster::MoveIdle(), POINT_CONSUME, POINT_MOTION_TYPE, REACT_AGGRESSIVE, TaskScheduler::Schedule(), Creature::SetReactState(), Unit::SetSpeed(), Creature::SetTarget(), and SPELL_FULL_HEAL.

◆ Reset()

void boss_bug_trio::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

196 {
199 _dying = false;
200 _isEating = false;
201 _creatureDying = 0;
203 me->SetSpeed(MOVE_RUN, 15.f / 7.f); // From sniffs
204
205 if (me->GetEntry() == NPC_VEM)
206 {
208 }
209 }
@ VEM_WAYPOINT_PATH
Definition boss_bug_trio.cpp:59
void Reset() override
Definition ScriptedCreature.h:502
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:852

References _creatureDying, _dying, _isEating, _scheduler, TaskScheduler::CancelAll(), DATA_BUG_TRIO_DEATH, Object::GetEntry(), Unit::GetMotionMaster(), BossAI::instance, ScriptedAI::me, MOVE_RUN, MotionMaster::MovePath(), NPC_VEM, BossAI::Reset(), ZoneScript::SetData(), Unit::SetSpeed(), and VEM_WAYPOINT_PATH.

Referenced by boss_bug_trio().

◆ UpdateAI()

void boss_bug_trio::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

212 {
213 if (!UpdateVictim() || !CheckInRoom())
214 return;
215
216 _scheduler.Update(diff, [this]
217 {
218 if (!_dying && !_isEating)
220 });
221 }
bool UpdateVictim()
Definition CreatureAI.cpp:280
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
bool CheckInRoom() override
Definition boss_bug_trio.cpp:69

References _dying, _isEating, _scheduler, CheckInRoom(), UnitAI::DoMeleeAttackIfReady(), TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _creatureDying

uint32 boss_bug_trio::_creatureDying = 0
static

Referenced by DamageTaken(), MovementInform(), and Reset().

◆ _dying

bool boss_bug_trio::_dying

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

◆ _isEating

bool boss_bug_trio::_isEating

◆ _scheduler


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