TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_lady_vashj::boss_lady_vashjAI Struct Reference

Public Member Functions

 boss_lady_vashjAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EventTaintedElementalDeath ()
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void StartEvent ()
 
void EnterCombat (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void CastShootOrMultishot ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
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 constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, 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
 
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
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 IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.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 void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- 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 (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

InstanceScriptinstance
 
ObjectGuid ShieldGeneratorChannel [4]
 
uint32 AggroTimer
 
uint32 ShockBlastTimer
 
uint32 EntangleTimer
 
uint32 StaticChargeTimer
 
uint32 ForkedLightningTimer
 
uint32 CheckTimer
 
uint32 EnchantedElementalTimer
 
uint32 TaintedElementalTimer
 
uint32 CoilfangEliteTimer
 
uint32 CoilfangStriderTimer
 
uint32 SummonSporebatTimer
 
uint32 SummonSporebatStaticTimer
 
uint8 EnchantedElementalPos
 
uint8 Phase
 
bool Entangle
 
bool Intro
 
bool CanAttack
 
bool JustCreated
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- 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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_lady_vashj::boss_lady_vashjAI::boss_lady_vashjAI ( Creature creature)
inline
148  : ScriptedAI(creature)
149  {
150  Initialize();
151  instance = creature->GetInstanceScript();
152  Intro = false;
153  JustCreated = true;
154  CanAttack = false;
155  creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
156  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
Definition: Unit.h:674
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void Initialize()
Definition: boss_lady_vashj.cpp:158
bool JustCreated
Definition: boss_lady_vashj.cpp:200
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
InstanceScript * instance
Definition: boss_lady_vashj.cpp:178
bool CanAttack
Definition: boss_lady_vashj.cpp:199
Definition: UpdateFields.h:109
bool Intro
Definition: boss_lady_vashj.cpp:198

+ Here is the call graph for this function:

Member Function Documentation

void boss_lady_vashj::boss_lady_vashjAI::CastShootOrMultishot ( )
inline
298  {
299  switch (urand(0, 1))
300  {
301  case 0:
302  // Shoot
303  // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
305  break;
306  case 1:
307  // Multishot
308  // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
310  break;
311  }
312  if (rand32() % 3)
313  {
314  Talk(SAY_BOWSHOT);
315  }
316  }
Definition: boss_lady_vashj.cpp:40
Definition: boss_lady_vashj.cpp:50
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_lady_vashj.cpp:45
uint32 rand32()
Definition: Random.cpp:64
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from ScriptedAI.

258  {
259  // remove old tainted cores to prevent cheating in phase 2
260  Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
261  for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
262  if (Player* player = itr->GetSource())
263  player->DestroyItemCount(31088, 1, true);
264  StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event
265 
266  if (Phase != 2)
267  AttackStart(who);
268  }
Map * GetMap() const
Definition: Object.h:543
iterator begin()
Definition: MapRefManager.h:37
Creature *const me
Definition: CreatureAI.h:71
Definition: LinkedList.h:141
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
void StartEvent()
Definition: boss_lady_vashj.cpp:248
Phase
Definition: boss_kiljaeden.cpp:153
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:

void boss_lady_vashj::boss_lady_vashjAI::EventTaintedElementalDeath ( )
inline
231  {
232  // the next will spawn 50 seconds after the previous one's death
233  if (TaintedElementalTimer > 50000)
234  TaintedElementalTimer = 50000;
235  }
uint32 TaintedElementalTimer
Definition: boss_lady_vashj.cpp:189
void boss_lady_vashj::boss_lady_vashjAI::Initialize ( void  )
inline
159  {
160  AggroTimer = 19000;
161  ShockBlastTimer = 1 + rand32() % 60000;
162  EntangleTimer = 30000;
163  StaticChargeTimer = 10000 + rand32() % 15000;
164  ForkedLightningTimer = 2000;
165  CheckTimer = 15000;
167  TaintedElementalTimer = 50000;
168  CoilfangEliteTimer = 45000 + rand32() % 5000;
169  CoilfangStriderTimer = 60000 + rand32() % 10000;
170  SummonSporebatTimer = 10000;
173  Phase = 0;
174 
175  Entangle = false;
176  }
uint32 EntangleTimer
Definition: boss_lady_vashj.cpp:184
uint32 AggroTimer
Definition: boss_lady_vashj.cpp:182
uint32 CheckTimer
Definition: boss_lady_vashj.cpp:187
uint32 SummonSporebatTimer
Definition: boss_lady_vashj.cpp:192
uint32 ShockBlastTimer
Definition: boss_lady_vashj.cpp:183
uint32 ForkedLightningTimer
Definition: boss_lady_vashj.cpp:186
uint8 EnchantedElementalPos
Definition: boss_lady_vashj.cpp:194
uint32 CoilfangStriderTimer
Definition: boss_lady_vashj.cpp:191
bool Entangle
Definition: boss_lady_vashj.cpp:197
uint32 EnchantedElementalTimer
Definition: boss_lady_vashj.cpp:188
uint32 TaintedElementalTimer
Definition: boss_lady_vashj.cpp:189
uint32 SummonSporebatStaticTimer
Definition: boss_lady_vashj.cpp:193
uint32 StaticChargeTimer
Definition: boss_lady_vashj.cpp:185
uint32 rand32()
Definition: Random.cpp:64
Phase
Definition: boss_kiljaeden.cpp:153
uint32 CoilfangEliteTimer
Definition: boss_lady_vashj.cpp:190

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from ScriptedAI.

242  {
243  Talk(SAY_DEATH);
244 
246  }
Definition: boss_lady_vashj.cpp:42
Definition: inflate.h:49
InstanceScript * instance
Definition: boss_lady_vashj.cpp:178
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: serpent_shrine.h:40

+ Here is the call graph for this function:

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

Reimplemented from ScriptedAI.

237  {
238  Talk(SAY_SLAY);
239  }
Definition: boss_lady_vashj.cpp:41
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42

+ Here is the call graph for this function:

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

Reimplemented from CreatureAI.

272  {
273  if (!Intro)
274  {
275  Intro = true;
276  Talk(SAY_INTRO);
277  }
278  if (!CanAttack)
279  return;
280  if (!who || me->GetVictim())
281  return;
282 
283  if (me->CanCreatureAttack(who))
284  {
285  float attackRadius = me->GetAttackDistance(who);
286  if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
287  {
288  if (!me->IsInCombat()) // AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
289  StartEvent();
290 
291  if (Phase != 2)
292  AttackStart(who);
293  }
294  }
295  }
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
#define CREATURE_Z_ATTACK_RANGE
Definition: Creature.h:459
bool IsInCombat() const
Definition: Unit.h:1584
float GetDistanceZ(WorldObject const *obj) const
Definition: Object.cpp:1546
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
float GetAttackDistance(Unit const *player) const
Definition: Creature.cpp:1586
bool CanAttack
Definition: boss_lady_vashj.cpp:199
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: boss_lady_vashj.cpp:35
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
bool CanCreatureAttack(Unit const *victim, bool force=true) const
Definition: Creature.cpp:2170
void StartEvent()
Definition: boss_lady_vashj.cpp:248
Phase
Definition: boss_kiljaeden.cpp:153
bool Intro
Definition: boss_lady_vashj.cpp:198

+ Here is the call graph for this function:

void boss_lady_vashj::boss_lady_vashjAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

203  {
204  Initialize();
205 
206  if (JustCreated)
207  {
208  CanAttack = false;
209  JustCreated = false;
210  } else CanAttack = true;
211 
212  for (uint8 i = 0; i < 4; ++i)
213  {
214  if (!ShieldGeneratorChannel[i].IsEmpty())
215  {
217  {
218  remo->setDeathState(JUST_DIED);
220  }
221  }
222  }
223 
225 
226  me->SetCorpseDelay(1000*60*60);
227  }
ObjectGuid ShieldGeneratorChannel[4]
Definition: boss_lady_vashj.cpp:180
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: Unit.h:542
void Initialize()
Definition: boss_lady_vashj.cpp:158
bool JustCreated
Definition: boss_lady_vashj.cpp:200
Creature *const me
Definition: CreatureAI.h:71
InstanceScript * instance
Definition: boss_lady_vashj.cpp:178
bool CanAttack
Definition: boss_lady_vashj.cpp:199
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: InstanceScript.h:58
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:492
void Clear()
Definition: ObjectGuid.h:215
uint8_t uint8
Definition: Define.h:152
Definition: serpent_shrine.h:40
Definition: Unit.h:1305

+ Here is the call graph for this function:

void boss_lady_vashj::boss_lady_vashjAI::StartEvent ( )
inline
249  {
250  Talk(SAY_AGGRO);
251 
252  Phase = 1;
253 
255  }
Definition: boss_lady_vashj.cpp:36
InstanceScript * instance
Definition: boss_lady_vashj.cpp:178
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: serpent_shrine.h:40
Phase
Definition: boss_kiljaeden.cpp:153

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from ScriptedAI.

319  {
320  if (!CanAttack && Intro)
321  {
322  if (AggroTimer <= diff)
323  {
324  CanAttack = true;
326  AggroTimer=19000;
327  }
328  else
329  {
330  AggroTimer-=diff;
331  return;
332  }
333  }
334  // to prevent abuses during phase 2
335  if (Phase == 2 && !me->GetVictim() && me->IsInCombat())
336  {
337  EnterEvadeMode();
338  return;
339  }
340  // Return since we have no target
341  if (!UpdateVictim())
342  return;
343 
344  if (Phase == 1 || Phase == 3)
345  {
346  // ShockBlastTimer
347  if (ShockBlastTimer <= diff)
348  {
349  // Shock Burst
350  // Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
352  me->TauntApply(me->GetVictim());
353 
354  ShockBlastTimer = 1000 + rand32() % 14000; // random cooldown
355  } else ShockBlastTimer -= diff;
356 
357  // StaticChargeTimer
358  if (StaticChargeTimer <= diff)
359  {
360  // Static Charge
361  // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
362  Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
363  if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
364  DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds
365 
366  StaticChargeTimer = 10000 + rand32() % 20000;
367  } else StaticChargeTimer -= diff;
368 
369  // EntangleTimer
370  if (EntangleTimer <= diff)
371  {
372  if (!Entangle)
373  {
374  // Entangle
375  // Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
377  Entangle = true;
378  EntangleTimer = 10000;
379  }
380  else
381  {
383  Entangle = false;
384  EntangleTimer = 20000 + rand32() % 5000;
385  }
386  } else EntangleTimer -= diff;
387 
388  // Phase 1
389  if (Phase == 1)
390  {
391  // Start phase 2
392  if (HealthBelowPct(70))
393  {
394  // Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
395  Phase = 2;
396 
397  me->GetMotionMaster()->Clear();
399 
400  for (uint8 i = 0; i < 4; ++i)
402  ShieldGeneratorChannel[i] = creature->GetGUID();
403 
404  Talk(SAY_PHASE2);
405  }
406  }
407  // Phase 3
408  else
409  {
410  // SummonSporebatTimer
411  if (SummonSporebatTimer <= diff)
412  {
414  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
415  sporebat->AI()->AttackStart(target);
416 
417  // summon sporebats faster and faster
418  if (SummonSporebatStaticTimer > 1000)
420 
422 
423  if (SummonSporebatTimer < 5000)
424  SummonSporebatTimer = 5000;
425 
426  } else SummonSporebatTimer -= diff;
427  }
428 
429  // Melee attack
431 
432  // CheckTimer - used to check if somebody is in melee range
433  if (CheckTimer <= diff)
434  {
435  bool inMeleeRange = false;
436  std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
437  for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
438  {
439  Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
440  if (target && target->IsWithinDistInMap(me, 5)) // if in melee range
441  {
442  inMeleeRange = true;
443  break;
444  }
445  }
446 
447  // if nobody is in melee range
448  if (!inMeleeRange)
450 
451  CheckTimer = 5000;
452  } else CheckTimer -= diff;
453  }
454  // Phase 2
455  else
456  {
457  // ForkedLightningTimer
458  if (ForkedLightningTimer <= diff)
459  {
460  // Forked Lightning
461  // Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
462  Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
463 
464  if (!target)
465  target = me->GetVictim();
466 
468 
469  ForkedLightningTimer = 2000 + rand32() % 6000;
470  } else ForkedLightningTimer -= diff;
471 
472  // EnchantedElementalTimer
473  if (EnchantedElementalTimer <= diff)
474  {
475  me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElementalPos][0], ElementPos[EnchantedElementalPos][1], ElementPos[EnchantedElementalPos][2], ElementPos[EnchantedElementalPos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
476 
477  if (EnchantedElementalPos == 7)
478  EnchantedElementalPos = 0;
479  else
481 
482  EnchantedElementalTimer = 10000 + rand32() % 5000;
483  } else EnchantedElementalTimer -= diff;
484 
485  // TaintedElementalTimer
486  if (TaintedElementalTimer <= diff)
487  {
488  uint32 pos = rand32() % 8;
490 
491  TaintedElementalTimer = 120000;
492  } else TaintedElementalTimer -= diff;
493 
494  // CoilfangEliteTimer
495  if (CoilfangEliteTimer <= diff)
496  {
497  uint32 pos = rand32() % 3;
499  if (coilfangElite)
500  {
501  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
502  coilfangElite->AI()->AttackStart(target);
503  else if (me->GetVictim())
504  coilfangElite->AI()->AttackStart(me->GetVictim());
505  }
506  CoilfangEliteTimer = 45000 + rand32() % 5000;
507  } else CoilfangEliteTimer -= diff;
508 
509  // CoilfangStriderTimer
510  if (CoilfangStriderTimer <= diff)
511  {
512  uint32 pos = rand32() % 3;
514  {
515  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
516  CoilfangStrider->AI()->AttackStart(target);
517  else if (me->GetVictim())
518  CoilfangStrider->AI()->AttackStart(me->GetVictim());
519  }
520  CoilfangStriderTimer = 60000 + rand32() % 10000;
521  } else CoilfangStriderTimer -= diff;
522 
523  // CheckTimer
524  if (CheckTimer <= diff)
525  {
526  // Start Phase 3
528  {
529  // set life 50%
531 
533 
534  Talk(SAY_PHASE3);
535 
536  Phase = 3;
537 
538  // return to the tank
540  }
541  CheckTimer = 1000;
542  } else CheckTimer -= diff;
543  }
544  }
Definition: boss_lady_vashj.cpp:60
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
Definition: boss_lady_vashj.cpp:49
Definition: boss_lady_vashj.cpp:58
uint32 EntangleTimer
Definition: boss_lady_vashj.cpp:184
ObjectGuid ShieldGeneratorChannel[4]
Definition: boss_lady_vashj.cpp:180
Definition: boss_lady_vashj.cpp:55
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
#define SPOREBAT_Y
Definition: boss_lady_vashj.cpp:69
uint32 AggroTimer
Definition: boss_lady_vashj.cpp:182
void Clear(bool reset=true)
Definition: MotionMaster.h:138
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
#define SPOREBAT_Z
Definition: boss_lady_vashj.cpp:70
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
bool IsInCombat() const
Definition: Unit.h:1584
uint32 CheckTimer
Definition: boss_lady_vashj.cpp:187
uint32 SummonSporebatTimer
Definition: boss_lady_vashj.cpp:192
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
#define SPOREBAT_X
Definition: boss_lady_vashj.cpp:68
Definition: Object.h:58
Definition: Creature.h:467
Definition: Object.h:60
float ShieldGeneratorChannelPos[4][4]
Definition: boss_lady_vashj.cpp:128
void DoTeleportTo(float x, float y, float z, uint32 time=0)
Definition: ScriptedCreature.cpp:280
Definition: boss_lady_vashj.cpp:59
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
#define MIDDLE_Z
Definition: boss_lady_vashj.cpp:66
Definition: serpent_shrine.h:33
Creature *const me
Definition: CreatureAI.h:71
InstanceScript * instance
Definition: boss_lady_vashj.cpp:178
Definition: UnitAI.h:35
bool CanAttack
Definition: boss_lady_vashj.cpp:199
uint32 ShockBlastTimer
Definition: boss_lady_vashj.cpp:183
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: boss_lady_vashj.cpp:46
uint32 ForkedLightningTimer
Definition: boss_lady_vashj.cpp:186
Definition: boss_lady_vashj.cpp:57
CreatureAI * AI() const
Definition: Creature.h:525
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: boss_lady_vashj.cpp:39
uint32_t uint32
Definition: Define.h:150
uint8 EnchantedElementalPos
Definition: boss_lady_vashj.cpp:194
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void CastShootOrMultishot()
Definition: boss_lady_vashj.cpp:297
float CoilfangStriderPos[3][4]
Definition: boss_lady_vashj.cpp:121
Definition: boss_lady_vashj.cpp:38
uint32 CoilfangStriderTimer
Definition: boss_lady_vashj.cpp:191
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: boss_lady_vashj.cpp:47
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
bool Entangle
Definition: boss_lady_vashj.cpp:197
uint32 EnchantedElementalTimer
Definition: boss_lady_vashj.cpp:188
uint32 TaintedElementalTimer
Definition: boss_lady_vashj.cpp:189
uint32 SummonSporebatStaticTimer
Definition: boss_lady_vashj.cpp:193
Definition: UpdateFields.h:109
uint32 StaticChargeTimer
Definition: boss_lady_vashj.cpp:185
#define MIDDLE_Y
Definition: boss_lady_vashj.cpp:65
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint32 rand32()
Definition: Random.cpp:64
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
uint8_t uint8
Definition: Define.h:152
float ElementPos[8][4]
Definition: boss_lady_vashj.cpp:78
#define MIDDLE_X
Definition: boss_lady_vashj.cpp:64
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_lady_vashj.cpp:56
void TauntApply(Unit *victim)
Definition: Unit.cpp:10709
void SetHealth(uint32 val)
Definition: Unit.cpp:11537
#define SPOREBAT_O
Definition: boss_lady_vashj.cpp:71
Definition: Unit.h:1305
Phase
Definition: boss_kiljaeden.cpp:153
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
bool Intro
Definition: boss_lady_vashj.cpp:198
uint32 CoilfangEliteTimer
Definition: boss_lady_vashj.cpp:190
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
float CoilfangElitePos[3][4]
Definition: boss_lady_vashj.cpp:114
Definition: boss_lady_vashj.cpp:53
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:1435
Definition: boss_lady_vashj.cpp:48

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_lady_vashj::boss_lady_vashjAI::AggroTimer
bool boss_lady_vashj::boss_lady_vashjAI::CanAttack
uint32 boss_lady_vashj::boss_lady_vashjAI::CheckTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::CoilfangEliteTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::CoilfangStriderTimer
uint8 boss_lady_vashj::boss_lady_vashjAI::EnchantedElementalPos
uint32 boss_lady_vashj::boss_lady_vashjAI::EnchantedElementalTimer
bool boss_lady_vashj::boss_lady_vashjAI::Entangle
uint32 boss_lady_vashj::boss_lady_vashjAI::EntangleTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::ForkedLightningTimer
InstanceScript* boss_lady_vashj::boss_lady_vashjAI::instance
bool boss_lady_vashj::boss_lady_vashjAI::Intro
bool boss_lady_vashj::boss_lady_vashjAI::JustCreated
uint8 boss_lady_vashj::boss_lady_vashjAI::Phase
ObjectGuid boss_lady_vashj::boss_lady_vashjAI::ShieldGeneratorChannel[4]
uint32 boss_lady_vashj::boss_lady_vashjAI::ShockBlastTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::StaticChargeTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::SummonSporebatStaticTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::SummonSporebatTimer
uint32 boss_lady_vashj::boss_lady_vashjAI::TaintedElementalTimer

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