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

Public Member Functions

 boss_lady_vashjAI (Creature *creature)
 
void Reset () override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *killer) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void JustSummoned (Creature *summon) override
 
void MoveInLineOfSight (Unit *who) override
 
void MovementInform (uint32 type, uint32 id) override
 
void UpdateAI (uint32 diff) override
 
bool CheckEvadeIfOutOfCombatArea () const 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
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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
 
void UpdateAI (uint32 diff) override
 
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 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 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
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.
 
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 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
 
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 ==================
 
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 ()
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
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

bool intro
 
int32 count
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

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 BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
bool _ProccessHealthCheckEvent (uint8 healthPct, uint32 damage, std::function< void()> exec) const
 
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
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_lady_vashjAI()

boss_lady_vashj::boss_lady_vashjAI::boss_lady_vashjAI ( Creature creature)
inline
112 : BossAI(creature, DATA_LADY_VASHJ)
113 {
114 intro = false;
115 }
@ DATA_LADY_VASHJ
Definition: serpent_shrine.h:40
Definition: ScriptedCreature.h:456
bool intro
Definition: boss_lady_vashj.cpp:117

References intro.

Member Function Documentation

◆ CheckEvadeIfOutOfCombatArea()

bool boss_lady_vashj::boss_lady_vashjAI::CheckEvadeIfOutOfCombatArea ( ) const
inlineoverridevirtual

Reimplemented from ScriptedAI.

291 {
292 return me->GetHomePosition().GetExactDist2d(me) > 80.0f || !SelectTargetFromPlayerList(100.0f);
293 }
Creature * me
Definition: ScriptedCreature.h:282
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:526
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:330

References Creature::GetHomePosition(), ScriptedAI::me, and ScriptedAI::SelectTargetFromPlayerList().

◆ JustDied()

void boss_lady_vashj::boss_lady_vashjAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from BossAI.

136 {
138 BossAI::JustDied(killer);
139 }
Talk
Definition: boss_fathomlord_karathress.cpp:23
@ SAY_DEATH
Definition: boss_lady_vashj.cpp:34
void JustDied(Unit *) override
Definition: ScriptedCreature.h:484

References BossAI::JustDied(), and SAY_DEATH.

◆ JustEngagedWith()

void boss_lady_vashj::boss_lady_vashjAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

142 {
145
147 events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000);
148 events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000);
149 events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000);
150 events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
151 }
events
Definition: boss_sartura.cpp:43
@ SAY_AGGRO
Definition: boss_lady_vashj.cpp:28
@ EVENT_SPELL_STATIC_CHARGE
Definition: boss_lady_vashj.cpp:69
@ EVENT_SPELL_ENTANGLE
Definition: boss_lady_vashj.cpp:70
@ EVENT_CHECK_HEALTH
Definition: boss_lady_vashj.cpp:71
@ EVENT_SPELL_SHOCK_BLAST
Definition: boss_lady_vashj.cpp:68
@ SPELL_REMOVE_TAINTED_CORES
Definition: boss_lady_vashj.cpp:53
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition: ScriptedCreature.h:483
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:1169

References Unit::CastSpell(), EVENT_CHECK_HEALTH, EVENT_SPELL_ENTANGLE, EVENT_SPELL_SHOCK_BLAST, EVENT_SPELL_STATIC_CHARGE, BossAI::JustEngagedWith(), ScriptedAI::me, SAY_AGGRO, and SPELL_REMOVE_TAINTED_CORES.

◆ JustSummoned()

void boss_lady_vashj::boss_lady_vashjAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

154 {
155 summons.Summon(summon);
156 if (summon->GetEntry() == WORLD_TRIGGER)
157 summon->CastSpell(summon, SPELL_MAGIC_BARRIER, false);
158 else if (summon->GetEntry() == NPC_ENCHANTED_ELEMENTAL)
159 {
160 summon->SetWalk(true);
161 summon->m_Events.AddEvent(new startFollow(summon), summon->m_Events.CalculateTime(0));
162 }
163 else if (summon->GetEntry() == NPC_TOXIC_SPOREBAT)
164 summon->GetMotionMaster()->MoveRandom(30.0f);
165 else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL)
167 }
#define WORLD_TRIGGER
Definition: Unit.h:36
@ POINT_HOME
Definition: boss_lady_vashj.cpp:66
@ SPELL_MAGIC_BARRIER
Definition: boss_lady_vashj.cpp:44
@ NPC_ENCHANTED_ELEMENTAL
Definition: serpent_shrine.h:61
@ NPC_TAINTED_ELEMENTAL
Definition: serpent_shrine.h:64
@ NPC_TOXIC_SPOREBAT
Definition: serpent_shrine.h:65
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:105
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:158
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:497
bool SetWalk(bool enable) override
Definition: Creature.cpp:3081
uint32 GetEntry() const
Definition: Object.h:109
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
EventProcessor m_Events
Definition: Unit.h:2094
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void MoveRandom(float wanderDistance=0.0f)
Definition: MotionMaster.cpp:238
Definition: boss_lady_vashj.cpp:84

References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Unit::CastSpell(), Object::GetEntry(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::m_Events, ScriptedAI::me, MotionMaster::MovePoint(), MotionMaster::MoveRandom(), NPC_ENCHANTED_ELEMENTAL, NPC_TAINTED_ELEMENTAL, NPC_TOXIC_SPOREBAT, POINT_HOME, Creature::SetWalk(), SPELL_MAGIC_BARRIER, SummonList::Summon(), BossAI::summons, and WORLD_TRIGGER.

◆ KilledUnit()

void boss_lady_vashj::boss_lady_vashjAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

127 {
128 if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
129 {
130 Talk(SAY_SLAY);
131 events.ScheduleEvent(EVENT_KILL_TALK, 6000);
132 }
133 }
@ SAY_SLAY
Definition: boss_lady_vashj.cpp:33
@ EVENT_KILL_TALK
Definition: boss_lady_vashj.cpp:80

References EVENT_KILL_TALK, and SAY_SLAY.

◆ MoveInLineOfSight()

void boss_lady_vashj::boss_lady_vashjAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

170 {
171 if (!intro && who->GetTypeId() == TYPEID_PLAYER)
172 {
173 intro = true;
175 }
176
178 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SAY_INTRO
Definition: boss_lady_vashj.cpp:27
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:158
TypeID GetTypeId() const
Definition: Object.h:121

References Object::GetTypeId(), intro, CreatureAI::MoveInLineOfSight(), SAY_INTRO, and TYPEID_PLAYER.

◆ MovementInform()

void boss_lady_vashj::boss_lady_vashjAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

181 {
182 if (type != POINT_MOTION_TYPE || id != POINT_HOME)
183 return;
184
185 me->SetFacingTo(me->GetHomePosition().GetOrientation());
187 events.Reset();
188 events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, 3000);
189 events.ScheduleEvent(EVENT_SUMMON_A, 0);
190 events.ScheduleEvent(EVENT_SUMMON_B, 45000);
191 events.ScheduleEvent(EVENT_SUMMON_C, 60000);
192 events.ScheduleEvent(EVENT_SUMMON_D, 50000);
193 events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000);
194 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ EVENT_SUMMON_C
Definition: boss_lady_vashj.cpp:75
@ EVENT_SUMMON_A
Definition: boss_lady_vashj.cpp:73
@ EVENT_SUMMON_B
Definition: boss_lady_vashj.cpp:74
@ EVENT_SUMMON_D
Definition: boss_lady_vashj.cpp:76
@ EVENT_CHECK_HEALTH2
Definition: boss_lady_vashj.cpp:77
@ EVENT_SPELL_FORKED_LIGHTNING
Definition: boss_lady_vashj.cpp:72
@ DATA_ACTIVATE_SHIELD
Definition: serpent_shrine.h:47
InstanceScript *const instance
Definition: ScriptedCreature.h:461
void SetFacingTo(float ori)
Definition: Unit.cpp:20782
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References DATA_ACTIVATE_SHIELD, EVENT_CHECK_HEALTH2, EVENT_SPELL_FORKED_LIGHTNING, EVENT_SUMMON_A, EVENT_SUMMON_B, EVENT_SUMMON_C, EVENT_SUMMON_D, Creature::GetHomePosition(), BossAI::instance, ScriptedAI::me, POINT_HOME, POINT_MOTION_TYPE, ZoneScript::SetData(), and Unit::SetFacingTo().

◆ Reset()

void boss_lady_vashj::boss_lady_vashjAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

121 {
122 count = 0;
124 }
void Reset() override
Definition: ScriptedCreature.h:482
int32 count
Definition: boss_lady_vashj.cpp:118

References count, and BossAI::Reset().

◆ UpdateAI()

void boss_lady_vashj::boss_lady_vashjAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

197 {
198 if (!UpdateVictim())
199 return;
200
201 events.Update(diff);
203 return;
204
205 switch (events.ExecuteEvent())
206 {
209 events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, urand(10000, 20000));
210 break;
212 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f))
213 me->CastSpell(target, SPELL_STATIC_CHARGE, false);
214 events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 20000);
215 break;
217 me->CastSpell(me, SPELL_ENTANGLE, false);
218 events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 30000);
219 break;
221 if (me->HealthBelowPct(71))
222 {
225 me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true);
226 break;
227 }
228 events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
229 break;
231 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f))
232 me->CastSpell(target, SPELL_FORKED_LIGHTNING, false);
233 events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, urand(2500, 5000));
234 break;
235 case EVENT_SUMMON_A:
237 events.ScheduleEvent(EVENT_SUMMON_A, 2500);
238 break;
239 case EVENT_SUMMON_B:
241 events.ScheduleEvent(EVENT_SUMMON_B, 45000);
242 break;
243 case EVENT_SUMMON_C:
245 events.ScheduleEvent(EVENT_SUMMON_C, 60000);
246 break;
247 case EVENT_SUMMON_D:
249 events.ScheduleEvent(EVENT_SUMMON_D, 50000);
250 break;
253 {
257 events.Reset();
258 events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000);
259 events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000);
260 events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000);
261 events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 5000);
262 break;
263 }
264 events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000);
265 break;
268 events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 20000 - 1000 * std::min(count++, 16));
269 break;
270 }
271
273 return;
274
276 {
280 if (roll_chance_i(15))
282 }
283 else
284 {
287 }
288 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
bool roll_chance_i(int chance)
Definition: Random.h:59
@ REACT_PASSIVE
Definition: Unit.h:1023
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
@ SHEATH_STATE_MELEE
Definition: Unit.h:127
@ SHEATH_STATE_RANGED
Definition: Unit.h:128
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SAY_PHASE3
Definition: boss_lady_vashj.cpp:31
@ SAY_BOWSHOT
Definition: boss_lady_vashj.cpp:32
@ SAY_PHASE2
Definition: boss_lady_vashj.cpp:30
@ EVENT_SUMMON_SPOREBAT
Definition: boss_lady_vashj.cpp:78
@ SPELL_SHOOT
Definition: boss_lady_vashj.cpp:39
@ SPELL_SHOCK_BLAST
Definition: boss_lady_vashj.cpp:41
@ SPELL_SUMMON_COILFANG_ELITE
Definition: boss_lady_vashj.cpp:48
@ SPELL_SUMMON_TOXIC_SPOREBAT
Definition: boss_lady_vashj.cpp:54
@ SPELL_SUMMON_ENCHANTED_ELEMENTAL
Definition: boss_lady_vashj.cpp:47
@ SPELL_ENTANGLE
Definition: boss_lady_vashj.cpp:43
@ SPELL_SUMMON_COILFANG_STRIDER
Definition: boss_lady_vashj.cpp:49
@ SPELL_MULTI_SHOT
Definition: boss_lady_vashj.cpp:40
@ SPELL_STATIC_CHARGE
Definition: boss_lady_vashj.cpp:42
@ SPELL_SUMMON_TAINTED_ELEMENTAL
Definition: boss_lady_vashj.cpp:50
@ SPELL_FORKED_LIGHTNING
Definition: boss_lady_vashj.cpp:45
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void SetReactState(ReactStates st)
Definition: Creature.h:89
ReactStates GetReactState() const
Definition: Creature.h:90
Definition: Unit.h:1290
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5610
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:683
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1492
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:1444
Unit * GetVictim() const
Definition: Unit.h:1386
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1343
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:661
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:299

References Unit::CastSpell(), count, UnitAI::DoMeleeAttackIfReady(), EVENT_CHECK_HEALTH, EVENT_CHECK_HEALTH2, EVENT_SPELL_ENTANGLE, EVENT_SPELL_FORKED_LIGHTNING, EVENT_SPELL_SHOCK_BLAST, EVENT_SPELL_STATIC_CHARGE, EVENT_SUMMON_A, EVENT_SUMMON_B, EVENT_SUMMON_C, EVENT_SUMMON_D, EVENT_SUMMON_SPOREBAT, Creature::GetHomePosition(), Unit::GetMotionMaster(), Creature::GetReactState(), Unit::GetVictim(), Unit::HasAura(), Unit::HasUnitState(), Unit::HealthBelowPct(), Unit::isAttackReady(), Unit::IsWithinMeleeRange(), ScriptedAI::me, MotionMaster::MoveChase(), MotionMaster::MovePoint(), POINT_HOME, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::resetAttackTimer(), roll_chance_i(), SAY_BOWSHOT, SAY_PHASE2, SAY_PHASE3, UnitAI::SelectTarget(), Creature::SetReactState(), Unit::SetSheath(), SHEATH_STATE_MELEE, SHEATH_STATE_RANGED, SPELL_ENTANGLE, SPELL_FORKED_LIGHTNING, SPELL_MAGIC_BARRIER, SPELL_MULTI_SHOT, SPELL_SHOCK_BLAST, SPELL_SHOOT, SPELL_STATIC_CHARGE, SPELL_SUMMON_COILFANG_ELITE, SPELL_SUMMON_COILFANG_STRIDER, SPELL_SUMMON_ENCHANTED_ELEMENTAL, SPELL_SUMMON_TAINTED_ELEMENTAL, SPELL_SUMMON_TOXIC_SPOREBAT, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ count

int32 boss_lady_vashj::boss_lady_vashjAI::count

Referenced by Reset(), and UpdateAI().

◆ intro

bool boss_lady_vashj::boss_lady_vashjAI::intro