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

Public Member Functions

 boss_viscidus (Creature *creature)
 
bool CheckInRoom () override
 
void Reset () override
 
void SoftReset ()
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType effType, SpellSchoolMask spellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void SpellHit (Unit *caster, SpellInfo const *spellInfo) override
 
void SummonedCreatureDies (Creature *summon, Unit *killer) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void InitSpells ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- 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 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 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:
 
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
 

Private Attributes

uint8 _hitcounter
 
uint8 _phase
 

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

boss_viscidus::boss_viscidus ( Creature creature)
inline
101 : BossAI(creature, DATA_VISCIDUS)
102 {
104 me->m_CombatDistance = 60.f;
105 }
Definition ScriptedCreature.h:467
float m_CombatDistance
Definition Creature.h:377
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition Creature.cpp:3823
uint32 GetMaxHealth() const
Definition Unit.h:1039
Creature * me
Definition ScriptedCreature.h:280
@ DATA_VISCIDUS
Definition temple_of_ahnqiraj.h:32

References Unit::GetMaxHealth(), Creature::LowerPlayerDamageReq(), Creature::m_CombatDistance, and ScriptedAI::me.

Member Function Documentation

◆ CheckInRoom()

bool boss_viscidus::CheckInRoom ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

108 {
109 if (me->GetExactDist2d(resetPoint) <= 10.f)
110 {
112 return false;
113 }
114
115 return true;
116 }
Position const resetPoint
Definition boss_viscidus.cpp:95
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:504
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:90
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

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

Referenced by UpdateAI().

◆ DamageTaken()

void boss_viscidus::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.

135 {
136 if (me->HealthBelowPct(5))
137 damage = 0;
138
139 if (!attacker)
140 {
141 return;
142 }
143
144 if (_phase != PHASE_MELEE)
145 {
146 if (_phase == PHASE_FROST && effType == DIRECT_DAMAGE && (spellSchoolMask & SPELL_SCHOOL_MASK_FROST) != 0)
147 {
148 ++_hitcounter;
149 }
150
151 return;
152 }
153
154 if (effType == DIRECT_DAMAGE)
155 ++_hitcounter;
156
157 if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE)
158 {
159 if (me->GetHealthPct() <= 5.f)
160 {
161 Unit::Kill(attacker, me);
162 return;
163 }
164
167 events.Reset();
171 me->AttackStop();
172 me->CastStop();
173 me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); // not found in sniff, this is the best one I found
174 scheduler.Schedule(2500ms, [this](TaskContext /*context*/)
175 {
177 })
178 .Schedule(3000ms, [this](TaskContext /*context*/)
179 {
183 me->SetHealth(me->GetMaxHealth() * 0.01f); // set 1% health
189 });
190 }
193 else if (_hitcounter == HITCOUNTER_CRACK)
195 }
@ EMOTE_ONESHOT_FLYDEATH
Definition SharedDefines.h:2039
@ SPELL_SCHOOL_MASK_FROST
Definition SharedDefines.h:301
@ UNIT_STATE_MELEE_ATTACKING
Definition UnitDefines.h:171
@ REACT_PASSIVE
Definition Unit.h:548
@ DIRECT_DAMAGE
Definition Unit.h:248
events
Definition boss_sartura.cpp:43
@ EMOTE_CRACK
Definition boss_viscidus.cpp:67
@ EMOTE_EXPLODE
Definition boss_viscidus.cpp:69
@ EMOTE_SHATTER
Definition boss_viscidus.cpp:68
@ SPELL_INVIS_SELF
Definition boss_viscidus.cpp:38
@ SPELL_EXPLODE_TRIGGER
Definition boss_viscidus.cpp:36
@ SPELL_VISCIDUS_SHRINKS
Definition boss_viscidus.cpp:37
@ SPELL_VISCIDUS_FREEZE
Definition boss_viscidus.cpp:34
@ SPELL_STUN_SELF
Definition boss_viscidus.cpp:40
@ PHASE_GLOB
Definition boss_viscidus.cpp:58
@ PHASE_MELEE
Definition boss_viscidus.cpp:57
@ PHASE_FROST
Definition boss_viscidus.cpp:56
Position const roomCenter
Definition boss_viscidus.cpp:93
@ HITCOUNTER_CRACK
Definition boss_viscidus.cpp:78
@ HITCOUNTER_EXPLODE
Definition boss_viscidus.cpp:80
@ HITCOUNTER_SHATTER
Definition boss_viscidus.cpp:79
TaskScheduler scheduler
Definition CreatureAI.h:75
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
Definition TaskScheduler.h:421
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:392
float GetHealthPct() const
Definition Unit.h:1040
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4808
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.cpp:17754
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Definition Unit.cpp:18954
void SetHealth(uint32 val)
Definition Unit.cpp:15530
void CastStop(uint32 except_spellid=0, bool withInstant=true)
Interrupt the unit cast for all the current spells.
Definition Unit.cpp:1171
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1046
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:20031
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2011
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:10448
Talk
Definition hyjal.cpp:82
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void DoResetThreatList()
Definition ScriptedCreature.cpp:445
uint8 _hitcounter
Definition boss_viscidus.cpp:317
uint8 _phase
Definition boss_viscidus.cpp:318

References _hitcounter, _phase, Unit::AttackStop(), Unit::CastStop(), DIRECT_DAMAGE, UnitAI::DoCastSelf(), ScriptedAI::DoResetThreatList(), EMOTE_CRACK, EMOTE_EXPLODE, EMOTE_ONESHOT_FLYDEATH, EMOTE_SHATTER, Unit::GetHealthPct(), Unit::GetMaxHealth(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::HandleEmoteCommand(), Unit::HasUnitState(), Unit::HealthBelowPct(), HITCOUNTER_CRACK, HITCOUNTER_EXPLODE, HITCOUNTER_SHATTER, Unit::Kill(), Creature::LowerPlayerDamageReq(), ScriptedAI::me, Unit::NearTeleportTo(), PHASE_FROST, PHASE_GLOB, PHASE_MELEE, REACT_PASSIVE, Unit::RemoveAura(), roomCenter, TaskScheduler::Schedule(), CreatureAI::scheduler, Unit::SetAuraStack(), Unit::SetHealth(), Creature::SetReactState(), SPELL_EXPLODE_TRIGGER, SPELL_INVIS_SELF, SPELL_SCHOOL_MASK_FROST, SPELL_STUN_SELF, SPELL_VISCIDUS_FREEZE, SPELL_VISCIDUS_SHRINKS, and UNIT_STATE_MELEE_ATTACKING.

◆ InitSpells()

void boss_viscidus::InitSpells ( )
inline
272 {
273 events.ScheduleEvent(EVENT_TOXIN, 15s, 20s);
274 events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s);
275 events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s);
276 }
@ EVENT_POISONBOLT_VOLLEY
Definition boss_viscidus.cpp:48
@ EVENT_POISON_SHOCK
Definition boss_viscidus.cpp:49
@ EVENT_TOXIN
Definition boss_viscidus.cpp:50

References EVENT_POISON_SHOCK, EVENT_POISONBOLT_VOLLEY, and EVENT_TOXIN.

Referenced by JustEngagedWith(), and SummonedCreatureDies().

◆ JustEngagedWith()

void boss_viscidus::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

266 {
268 InitSpells();
269 }
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition ScriptedCreature.h:503
void InitSpells()
Definition boss_viscidus.cpp:271

References InitSpells(), and BossAI::JustEngagedWith().

◆ Reset()

void boss_viscidus::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

119 {
121 SoftReset();
123 }
void Reset() override
Definition ScriptedCreature.h:502
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4941
void SoftReset()
Definition boss_viscidus.cpp:125

References ScriptedAI::me, Unit::RemoveAurasDueToSpell(), BossAI::Reset(), SoftReset(), and SPELL_VISCIDUS_SHRINKS.

◆ SoftReset()

◆ SpellHit()

void boss_viscidus::SpellHit ( Unit caster,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

198 {
199 if (spellInfo->Id == SPELL_REJOIN_VISCIDUS)
200 {
202 }
203
204 SpellSchoolMask spellSchoolMask = spellInfo->GetSchoolMask();
205 if (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && spellInfo->EquippedItemSubClassMask & (1 << ITEM_SUBCLASS_WEAPON_WAND))
206 {
207 if (Item* pItem = caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK))
208 {
209 spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType);
210 }
211 }
212
213 if ((spellSchoolMask & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST)
214 {
215 ++_hitcounter;
216
218 {
219 _hitcounter = 0;
224 events.ScheduleEvent(EVENT_RESET_PHASE, 15s);
225 }
227 {
231 }
232 else if (_hitcounter == HITCOUNTER_SLOW)
233 {
236 }
237 }
238 }
@ ITEM_SUBCLASS_WEAPON_WAND
Definition ItemTemplate.h:363
@ ITEM_CLASS_WEAPON
Definition ItemTemplate.h:293
SpellSchoolMask
Definition SharedDefines.h:295
@ RANGED_ATTACK
Definition Unit.h:211
@ EMOTE_SLOW
Definition boss_viscidus.cpp:63
@ EMOTE_FREEZE
Definition boss_viscidus.cpp:64
@ EMOTE_FROZEN
Definition boss_viscidus.cpp:65
@ SPELL_VISCIDUS_SLOWED_MORE
Definition boss_viscidus.cpp:33
@ SPELL_VISCIDUS_SLOWED
Definition boss_viscidus.cpp:32
@ SPELL_REJOIN_VISCIDUS
Definition boss_viscidus.cpp:35
@ HITCOUNTER_SLOW
Definition boss_viscidus.cpp:74
@ HITCOUNTER_SLOW_MORE
Definition boss_viscidus.cpp:75
@ HITCOUNTER_FREEZE
Definition boss_viscidus.cpp:76
@ EVENT_RESET_PHASE
Definition boss_viscidus.cpp:51
Definition Item.h:220
Player * ToPlayer()
Definition Object.h:201
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition PlayerStorage.cpp:488
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4957

References _hitcounter, _phase, UnitAI::DoCastSelf(), EMOTE_FREEZE, EMOTE_FROZEN, EMOTE_SLOW, SpellInfo::EquippedItemClass, SpellInfo::EquippedItemSubClassMask, EVENT_RESET_PHASE, SpellInfo::GetSchoolMask(), Player::GetWeaponForAttack(), HITCOUNTER_FREEZE, HITCOUNTER_SLOW, HITCOUNTER_SLOW_MORE, SpellInfo::Id, ITEM_CLASS_WEAPON, ITEM_SUBCLASS_WEAPON_WAND, ScriptedAI::me, PHASE_FROST, PHASE_MELEE, RANGED_ATTACK, Unit::RemoveAura(), Unit::RemoveAuraFromStack(), SPELL_REJOIN_VISCIDUS, SPELL_SCHOOL_MASK_FROST, SPELL_VISCIDUS_FREEZE, SPELL_VISCIDUS_SHRINKS, SPELL_VISCIDUS_SLOWED, SPELL_VISCIDUS_SLOWED_MORE, and Object::ToPlayer().

◆ SummonedCreatureDies()

void boss_viscidus::SummonedCreatureDies ( Creature summon,
Unit killer 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

241 {
242 if (summon->GetEntry() != NPC_GLOB_OF_VISCIDUS)
243 return;
244
245 if (killer && killer->GetEntry() == NPC_GLOB_OF_VISCIDUS)
246 {
247 if (_phase == PHASE_GLOB)
248 {
251 }
252
253 int32 heal = me->GetMaxHealth() * 0.05f;
254 me->CastCustomSpell(me, SPELL_VISCIDUS_GROWS, &heal, nullptr, nullptr, true);
255 }
256
257 if (!summons.IsAnyCreatureWithEntryAlive(NPC_GLOB_OF_VISCIDUS)) // all globs were killed
258 {
259 SoftReset();
260 InitSpells();
262 }
263 }
std::int32_t int32
Definition Define.h:103
@ SPELL_VISCIDUS_GROWS
Definition boss_viscidus.cpp:39
SummonList summons
Definition ScriptedCreature.h:517
uint32 GetEntry() const
Definition Object.h:115
bool IsAnyCreatureWithEntryAlive(uint32 entry) const
Definition ScriptedCreature.cpp:160
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:1235
@ NPC_GLOB_OF_VISCIDUS
Definition temple_of_ahnqiraj.h:67

References _phase, Unit::CastCustomSpell(), Object::GetEntry(), Unit::GetMaxHealth(), InitSpells(), SummonList::IsAnyCreatureWithEntryAlive(), Creature::LowerPlayerDamageReq(), ScriptedAI::me, NPC_GLOB_OF_VISCIDUS, PHASE_FROST, PHASE_GLOB, Unit::RemoveAurasDueToSpell(), SoftReset(), SPELL_INVIS_SELF, SPELL_VISCIDUS_GROWS, and BossAI::summons.

◆ UpdateAI()

void boss_viscidus::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

279 {
280 if (!UpdateVictim() || !CheckInRoom())
281 return;
282
283 events.Update(diff);
284 scheduler.Update(diff);
285
286 while (uint32 eventId = events.ExecuteEvent())
287 {
288 switch (eventId)
289 {
292 events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s);
293 break;
296 events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s);
297 break;
298 case EVENT_TOXIN:
300 events.ScheduleEvent(EVENT_TOXIN, 15s, 20s);
301 break;
303 _hitcounter = 0;
306 break;
307 default:
308 break;
309 }
310 }
311
314 }
std::uint32_t uint32
Definition Define.h:107
@ SPELL_POISON_SHOCK
Definition boss_viscidus.cpp:28
@ SPELL_POISONBOLT_VOLLEY
Definition boss_viscidus.cpp:29
@ SPELL_SUMMON_TOXIN_SLIME
Definition boss_viscidus.cpp:30
bool UpdateVictim()
Definition CreatureAI.cpp:280
ReactStates GetReactState() const
Definition Creature.h:96
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
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.
Definition UnitAI.cpp:259
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
bool CheckInRoom() override
Definition boss_viscidus.cpp:107

References _hitcounter, _phase, CheckInRoom(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), EVENT_POISON_SHOCK, EVENT_POISONBOLT_VOLLEY, EVENT_RESET_PHASE, EVENT_TOXIN, Creature::GetReactState(), ScriptedAI::me, PHASE_FROST, PHASE_GLOB, REACT_AGGRESSIVE, Unit::RemoveAura(), CreatureAI::scheduler, SPELL_POISON_SHOCK, SPELL_POISONBOLT_VOLLEY, SPELL_SUMMON_TOXIN_SLIME, SPELL_VISCIDUS_FREEZE, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _hitcounter

uint8 boss_viscidus::_hitcounter
private

◆ _phase

uint8 boss_viscidus::_phase
private

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