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

Public Member Functions

 boss_leotheras_the_blindAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void CheckChannelers ()
 
void MoveInLineOfSight (Unit *who) override
 
void StartEvent ()
 
void CheckBanish ()
 
void DespawnDemon ()
 
void CastConsumingMadness ()
 
void KilledUnit (Unit *victim) override
 
void JustDied (Unit *) override
 
void EnterCombat (Unit *) override
 
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
 
uint32 Whirlwind_Timer
 
uint32 ChaosBlast_Timer
 
uint32 SwitchToDemon_Timer
 
uint32 SwitchToHuman_Timer
 
uint32 Berserk_Timer
 
uint32 InnerDemons_Timer
 
uint32 BanishTimer
 
bool DealDamage
 
bool NeedThreatReset
 
bool DemonForm
 
bool IsFinalForm
 
bool EnrageUsed
 
float x
 
float y
 
float z
 
ObjectGuid InnderDemon [5]
 
uint32 InnerDemon_Count
 
ObjectGuid Demon
 
ObjectGuid SpellBinderGUID [3]
 
- 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_leotheras_the_blind::boss_leotheras_the_blindAI::boss_leotheras_the_blindAI ( Creature creature)
inline
194  : ScriptedAI(creature)
195  {
196  Initialize();
197  creature->GetPosition(x, y, z);
198  instance = creature->GetInstanceScript();
199  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void GetPosition(float &x, float &y) const
Definition: Position.h:109
float y
Definition: boss_leotheras_the_blind.cpp:235
void Initialize()
Definition: boss_leotheras_the_blind.cpp:201
InstanceScript * instance
Definition: boss_leotheras_the_blind.cpp:220
float z
Definition: boss_leotheras_the_blind.cpp:235
float x
Definition: boss_leotheras_the_blind.cpp:235

+ Here is the call graph for this function:

Member Function Documentation

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::CastConsumingMadness ( )
inline
373  {
374  for (uint8 i = 0; i < 5; ++i)
375  {
376  if (!InnderDemon[i].IsEmpty())
377  {
379  if (unit && unit->IsAlive())
380  {
381  Unit* unit_target = ObjectAccessor::GetUnit(*unit, unit->AI()->GetGUID(INNER_DEMON_VICTIM));
382  if (unit_target && unit_target->IsAlive())
383  {
384  unit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true);
385  DoModifyThreatPercent(unit_target, -100);
386  }
387  }
388  }
389  }
390  }
virtual ObjectGuid GetGUID(int32=0) const
Definition: UnitAI.h:142
Definition: boss_leotheras_the_blind.cpp:53
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
void DoModifyThreatPercent(Unit *unit, int32 pct)
Definition: ScriptedCreature.cpp:273
bool IsAlive() const
Definition: Unit.h:1692
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid InnderDemon[5]
Definition: boss_leotheras_the_blind.cpp:237
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint8_t uint8
Definition: Define.h:152
Definition: Unit.h:1305
Definition: boss_leotheras_the_blind.cpp:60
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::CheckBanish ( )
inline
304  {
305  uint8 AliveChannelers = 0;
306  for (uint8 i = 0; i < 3; ++i)
307  {
309  if (add && add->IsAlive())
310  ++AliveChannelers;
311  }
312 
313  // channelers == 0 remove banish aura
314  if (AliveChannelers == 0 && me->HasAura(AURA_BANISH))
315  {
316  // removing banish aura
318 
319  // Leotheras is getting immune again
321 
322  // changing model to bloodelf
324 
325  // and reseting equipment
326  me->LoadEquipment();
327 
329  {
330  Unit* victim = NULL;
332  if (victim)
333  me->getThreatManager().addThreat(victim, 1);
334  StartEvent();
335  }
336  }
337  else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH))
338  {
339  // channelers != 0 apply banish aura
340  // removing Leotheras banish immune to apply AURA_BANISH
343 
344  // changing model
346 
347  // and removing weapons
348  me->SetVirtualItem(0, 0);
349  me->SetVirtualItem(1, 0);
350  }
351  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0)
Definition: Unit.cpp:16427
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
void addThreat(Unit *victim, float threat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: ThreatManager.cpp:406
ObjectGuid SpellBinderGUID[3]
Definition: boss_leotheras_the_blind.cpp:240
Definition: SharedDefines.h:1808
arena_t NULL
Definition: jemalloc_internal.h:624
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
Definition: boss_leotheras_the_blind.cpp:57
Definition: serpent_shrine.h:53
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1429
bool IsAlive() const
Definition: Unit.h:1692
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void StartEvent()
Definition: boss_leotheras_the_blind.cpp:297
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: boss_leotheras_the_blind.cpp:42
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint8_t uint8
Definition: Define.h:152
InstanceScript * instance
Definition: boss_leotheras_the_blind.cpp:220
Definition: Unit.h:1305
Definition: SharedDefines.h:1865
Definition: boss_leotheras_the_blind.cpp:56
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::CheckChannelers ( )
inline
257  {
258  for (uint8 i = 0; i < 3; ++i)
259  {
261  add->DisappearAndDie();
262 
263  float nx = x;
264  float ny = y;
265  float o = 2.4f;
266  if (i == 0) {nx += 10; ny -= 5; o=2.5f;}
267  if (i == 1) {nx -= 8; ny -= 7; o=0.9f;}
268  if (i == 2) {nx -= 3; ny += 9; o=5.0f;}
270  if (binder)
271  SpellBinderGUID[i] = binder->GetGUID();
272  }
273  }
ObjectGuid SpellBinderGUID[3]
Definition: boss_leotheras_the_blind.cpp:240
Definition: Creature.h:467
Definition: Object.h:60
Definition: boss_leotheras_the_blind.cpp:59
Creature *const me
Definition: CreatureAI.h:71
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
float y
Definition: boss_leotheras_the_blind.cpp:235
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint8_t uint8
Definition: Define.h:152
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
float z
Definition: boss_leotheras_the_blind.cpp:235
float x
Definition: boss_leotheras_the_blind.cpp:235

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::DespawnDemon ( )
inline
355  {
356  for (uint8 i = 0; i < 5; ++i)
357  {
358  if (!InnderDemon[i].IsEmpty())
359  {
360  //delete creature
362  if (creature && creature->IsAlive())
363  creature->DespawnOrUnsummon();
364 
365  InnderDemon[i].Clear();
366  }
367  }
368 
369  InnerDemon_Count = 0;
370  }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
bool IsAlive() const
Definition: Unit.h:1692
ObjectGuid InnderDemon[5]
Definition: boss_leotheras_the_blind.cpp:237
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void Clear()
Definition: ObjectGuid.h:215
uint32 InnerDemon_Count
Definition: boss_leotheras_the_blind.cpp:238
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

413  {
414  if (me->HasAura(AURA_BANISH))
415  return;
416 
417  me->LoadEquipment();
418  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
Creature *const me
Definition: CreatureAI.h:71
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1429
Definition: boss_leotheras_the_blind.cpp:42

+ Here is the call graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::Initialize ( void  )
inline
202  {
203  BanishTimer = 1000;
204  Whirlwind_Timer = 15000;
205  ChaosBlast_Timer = 1000;
206  SwitchToDemon_Timer = 45000;
207  SwitchToHuman_Timer = 60000;
208  Berserk_Timer = 600000;
209  InnerDemons_Timer = 30000;
210 
211  DealDamage = true;
212  DemonForm = false;
213  IsFinalForm = false;
214  NeedThreatReset = false;
215  EnrageUsed = false;
216  memset(InnderDemon, 0, sizeof(InnderDemon));
217  InnerDemon_Count = 0;
218  }
uint32 ChaosBlast_Timer
Definition: boss_leotheras_the_blind.cpp:223
uint32 InnerDemons_Timer
Definition: boss_leotheras_the_blind.cpp:227
uint32 BanishTimer
Definition: boss_leotheras_the_blind.cpp:228
uint32 Whirlwind_Timer
Definition: boss_leotheras_the_blind.cpp:222
bool EnrageUsed
Definition: boss_leotheras_the_blind.cpp:234
bool DealDamage
Definition: boss_leotheras_the_blind.cpp:230
uint32 Berserk_Timer
Definition: boss_leotheras_the_blind.cpp:226
uint32 SwitchToDemon_Timer
Definition: boss_leotheras_the_blind.cpp:224
ObjectGuid InnderDemon[5]
Definition: boss_leotheras_the_blind.cpp:237
uint32 InnerDemon_Count
Definition: boss_leotheras_the_blind.cpp:238
bool IsFinalForm
Definition: boss_leotheras_the_blind.cpp:233
bool DemonForm
Definition: boss_leotheras_the_blind.cpp:232
uint32 SwitchToHuman_Timer
Definition: boss_leotheras_the_blind.cpp:225
bool NeedThreatReset
Definition: boss_leotheras_the_blind.cpp:231

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

401  {
402  Talk(SAY_DEATH);
403 
404  //despawn copy
405  if (!Demon.IsEmpty())
406  if (Creature* pDemon = ObjectAccessor::GetCreature(*me, Demon))
407  pDemon->DespawnOrUnsummon();
408 
410  }
Definition: serpent_shrine.h:41
Definition: inflate.h:49
Definition: Creature.h:467
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_leotheras_the_blind.cpp:69
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
ObjectGuid Demon
Definition: boss_leotheras_the_blind.cpp:239
InstanceScript * instance
Definition: boss_leotheras_the_blind.cpp:220
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

393  {
394  if (victim->GetTypeId() != TYPEID_PLAYER)
395  return;
396 
398  }
Definition: boss_leotheras_the_blind.cpp:66
TypeID GetTypeId() const
Definition: Object.h:113
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_leotheras_the_blind.cpp:65
Definition: ObjectGuid.h:33
bool DemonForm
Definition: boss_leotheras_the_blind.cpp:232

+ Here is the call graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

276  {
277  if (me->HasAura(AURA_BANISH))
278  return;
279 
280  if (!me->GetVictim() && me->CanCreatureAttack(who))
281  {
283  return;
284 
285  float attackRadius = me->GetAttackDistance(who);
286  if (me->IsWithinDistInMap(who, attackRadius))
287  {
288  // Check first that object is in an angle in front of this one before LoS check
289  if (me->HasInArc(float(M_PI) / 2.0f, who) && me->IsWithinLOSInMap(who))
290  {
291  AttackStart(who);
292  }
293  }
294  }
295  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
#define M_PI
Definition: Common.h:163
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
#define CREATURE_Z_ATTACK_RANGE
Definition: Creature.h:459
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
Unit * GetVictim() const
Definition: Unit.h:1379
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
Definition: Position.cpp:129
Definition: boss_leotheras_the_blind.cpp:42
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
bool CanCreatureAttack(Unit const *victim, bool force=true) const
Definition: Creature.cpp:2170

+ Here is the call graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

243  {
244  CheckChannelers();
245  Initialize();
246  me->SetCanDualWield(true);
247  me->SetSpeed(MOVE_RUN, 2.0f, true);
249  me->SetVirtualItem(0, 0);
250  me->SetVirtualItem(1, 0);
251  DoCast(me, SPELL_DUAL_WIELD, true);
252  me->SetCorpseDelay(1000*60*60);
254  }
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0)
Definition: Unit.cpp:16427
void SetCanDualWield(bool value) override
Definition: Creature.cpp:1423
Definition: serpent_shrine.h:41
Definition: boss_leotheras_the_blind.cpp:38
Definition: boss_leotheras_the_blind.cpp:57
Creature *const me
Definition: CreatureAI.h:71
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: InstanceScript.h:58
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:492
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Initialize()
Definition: boss_leotheras_the_blind.cpp:201
Definition: Unit.h:600
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
InstanceScript * instance
Definition: boss_leotheras_the_blind.cpp:220
void CheckChannelers()
Definition: boss_leotheras_the_blind.cpp:256

+ Here is the call graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::StartEvent ( )
inline
298  {
299  Talk(SAY_AGGRO);
301  }
Definition: serpent_shrine.h:41
Definition: InstanceScript.h:59
Definition: boss_leotheras_the_blind.cpp:62
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
InstanceScript * instance
Definition: boss_leotheras_the_blind.cpp:220

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_leotheras_the_blind::boss_leotheras_the_blindAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

421  {
422  //Return since we have no target
423  if (me->HasAura(AURA_BANISH) || !UpdateVictim())
424  {
425  if (BanishTimer <= diff)
426  {
427  CheckBanish();//no need to check every update tick
428  BanishTimer = 1000;
429  } else BanishTimer -= diff;
430  return;
431  }
432  if (me->HasAura(SPELL_WHIRLWIND))
433  {
434  if (Whirlwind_Timer <= diff)
435  {
436  Unit* newTarget = SelectTarget(SELECT_TARGET_RANDOM, 0);
437  if (newTarget)
438  {
439  DoResetThreat();
440  me->GetMotionMaster()->Clear();
441  me->GetMotionMaster()->MovePoint(0, newTarget->GetPositionX(), newTarget->GetPositionY(), newTarget->GetPositionZ());
442  }
443  Whirlwind_Timer = 2000;
444  } else Whirlwind_Timer -= diff;
445  }
446 
447  // reseting after changing forms and after ending whirlwind
449  {
450  // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
451  if (DemonForm)
452  InnerDemons_Timer = 30000;
453  else
454  Whirlwind_Timer = 15000;
455 
456  NeedThreatReset = false;
457  DoResetThreat();
458  me->GetMotionMaster()->Clear();
460  }
461 
462  //Enrage_Timer (10 min)
463  if (Berserk_Timer < diff && !EnrageUsed)
464  {
465  me->InterruptNonMeleeSpells(false);
467  EnrageUsed = true;
468  } else Berserk_Timer -= diff;
469 
470  if (!DemonForm)
471  {
472  //Whirldind Timer
473  if (!me->HasAura(SPELL_WHIRLWIND))
474  {
475  if (Whirlwind_Timer <= diff)
476  {
478  // while whirlwinding this variable is used to countdown target's change
479  Whirlwind_Timer = 2000;
480  NeedThreatReset = true;
481  } else Whirlwind_Timer -= diff;
482  }
483  //Switch_Timer
484 
485  if (!IsFinalForm)
486  {
487  if (SwitchToDemon_Timer <= diff)
488  {
489  //switch to demon form
493  me->SetVirtualItem(0, 0);
494  me->SetVirtualItem(1, 0);
495  DemonForm = true;
496  NeedThreatReset = true;
497  SwitchToDemon_Timer = 45000;
498  } else SwitchToDemon_Timer -= diff;
499  }
501  }
502  else
503  {
504  //ChaosBlast_Timer
505  if (!me->GetVictim())
506  return;
507  if (me->IsWithinDist(me->GetVictim(), 30))
508  me->StopMoving();
509  if (ChaosBlast_Timer <= diff)
510  {
511  // will cast only when in range of spell
512  if (me->IsWithinDist(me->GetVictim(), 30))
513  {
514  //DoCastVictim(SPELL_CHAOS_BLAST, true);
515  int damage = 100;
516  me->CastCustomSpell(me->GetVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID());
517  }
518  ChaosBlast_Timer = 3000;
519  } else ChaosBlast_Timer -= diff;
520  //Summon Inner Demon
521  if (InnerDemons_Timer <= diff)
522  {
524  std::vector<Unit*> TargetList;
525  for (ThreatContainer::StorageType::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
526  {
527  Unit* tempTarget = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
528  if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->EnsureVictim()->GetGUID() && TargetList.size()<5)
529  TargetList.push_back(tempTarget);
530  }
531  //SpellInfo* spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER);
532  for (std::vector<Unit*>::const_iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr)
533  {
534  if ((*itr) && (*itr)->IsAlive())
535  {
536  Creature* demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
537  if (demon)
538  {
539  demon->AI()->AttackStart((*itr));
540  demon->AI()->SetGUID((*itr)->GetGUID(), INNER_DEMON_VICTIM);
541 
542  (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr);
543 
544  if (InnerDemon_Count > 4)
545  InnerDemon_Count = 0;
546 
547  //Safe storing of creatures
549 
550  //Update demon count
552  }
553  }
554  }
556 
557  InnerDemons_Timer = 999999;
558  } else InnerDemons_Timer -= diff;
559 
560  //Switch_Timer
561  if (SwitchToHuman_Timer <= diff)
562  {
563  //switch to nightelf form
565  me->LoadEquipment();
566 
568  DespawnDemon();
569 
570  DemonForm = false;
571  NeedThreatReset = true;
572 
573  SwitchToHuman_Timer = 60000;
574  } else SwitchToHuman_Timer -= diff;
575  }
576 
577  if (!IsFinalForm && HealthBelowPct(15))
578  {
579  //at this point he divides himself in two parts
581  DespawnDemon();
582  Creature* Copy = NULL;
584  if (Copy)
585  {
586  Demon = Copy->GetGUID();
587  if (me->GetVictim())
588  Copy->AI()->AttackStart(me->GetVictim());
589  }
590  //set nightelf final form
591  IsFinalForm = true;
592  DemonForm = false;
593 
596  me->LoadEquipment();
597  }
598  }
uint32 ChaosBlast_Timer
Definition: boss_leotheras_the_blind.cpp:223
Definition: boss_leotheras_the_blind.cpp:34
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
Unit * EnsureVictim() const
Definition: Unit.h:1381
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0)
Definition: Unit.cpp:16427
Definition: boss_leotheras_the_blind.cpp:67
void DespawnDemon()
Definition: boss_leotheras_the_blind.cpp:354
bool UpdateVictim()
Definition: CreatureAI.cpp:233
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
uint32 InnerDemons_Timer
Definition: boss_leotheras_the_blind.cpp:227
void Clear(bool reset=true)
Definition: MotionMaster.h:138
Definition: boss_leotheras_the_blind.cpp:63
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
uint32 BanishTimer
Definition: boss_leotheras_the_blind.cpp:228
Definition: boss_leotheras_the_blind.cpp:58
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 Whirlwind_Timer
Definition: boss_leotheras_the_blind.cpp:222
arena_t NULL
Definition: jemalloc_internal.h:624
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_leotheras_the_blind.cpp:37
bool EnrageUsed
Definition: boss_leotheras_the_blind.cpp:234
Definition: Creature.h:467
virtual void SetGUID(ObjectGuid, int32=0)
Definition: UnitAI.h:141
Definition: boss_leotheras_the_blind.cpp:57
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1658
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1429
Definition: UnitAI.h:35
Unit * GetVictim() const
Definition: Unit.h:1379
float GetPositionY() const
Definition: Position.h:105
void CheckBanish()
Definition: boss_leotheras_the_blind.cpp:303
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
float GetPositionZ() const
Definition: Position.h:106
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
uint32 Berserk_Timer
Definition: boss_leotheras_the_blind.cpp:226
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition: ScriptedCreature.cpp:177
uint32 SwitchToDemon_Timer
Definition: boss_leotheras_the_blind.cpp:224
ObjectGuid InnderDemon[5]
Definition: boss_leotheras_the_blind.cpp:237
Definition: boss_leotheras_the_blind.cpp:35
void CastConsumingMadness()
Definition: boss_leotheras_the_blind.cpp:372
uint32 InnerDemon_Count
Definition: boss_leotheras_the_blind.cpp:238
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: boss_leotheras_the_blind.cpp:42
void DoResetThreat()
Definition: ScriptedCreature.cpp:248
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: boss_leotheras_the_blind.cpp:64
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
Definition: ObjectGuid.h:33
bool IsFinalForm
Definition: boss_leotheras_the_blind.cpp:233
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ObjectGuid Demon
Definition: boss_leotheras_the_blind.cpp:239
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
ThreatManager & getThreatManager()
Definition: Unit.h:1998
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool DemonForm
Definition: boss_leotheras_the_blind.cpp:232
Definition: boss_leotheras_the_blind.cpp:49
Definition: boss_leotheras_the_blind.cpp:36
uint32 SwitchToHuman_Timer
Definition: boss_leotheras_the_blind.cpp:225
float GetPositionX() const
Definition: Position.h:104
Definition: Unit.h:1305
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743
Definition: boss_leotheras_the_blind.cpp:60
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
Definition: boss_leotheras_the_blind.cpp:56
bool NeedThreatReset
Definition: boss_leotheras_the_blind.cpp:231
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:920
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::BanishTimer
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::Berserk_Timer
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::ChaosBlast_Timer
bool boss_leotheras_the_blind::boss_leotheras_the_blindAI::DealDamage
ObjectGuid boss_leotheras_the_blind::boss_leotheras_the_blindAI::Demon
bool boss_leotheras_the_blind::boss_leotheras_the_blindAI::DemonForm
bool boss_leotheras_the_blind::boss_leotheras_the_blindAI::EnrageUsed
ObjectGuid boss_leotheras_the_blind::boss_leotheras_the_blindAI::InnderDemon[5]
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::InnerDemon_Count
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::InnerDemons_Timer
InstanceScript* boss_leotheras_the_blind::boss_leotheras_the_blindAI::instance
bool boss_leotheras_the_blind::boss_leotheras_the_blindAI::IsFinalForm
bool boss_leotheras_the_blind::boss_leotheras_the_blindAI::NeedThreatReset
ObjectGuid boss_leotheras_the_blind::boss_leotheras_the_blindAI::SpellBinderGUID[3]
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::SwitchToDemon_Timer
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::SwitchToHuman_Timer
uint32 boss_leotheras_the_blind::boss_leotheras_the_blindAI::Whirlwind_Timer
float boss_leotheras_the_blind::boss_leotheras_the_blindAI::x
float boss_leotheras_the_blind::boss_leotheras_the_blindAI::y
float boss_leotheras_the_blind::boss_leotheras_the_blindAI::z

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