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

Public Member Functions

 boss_valithria_dreamwalkerAI (Creature *creature)
 
void Reset () override
 
void AttackStart (Unit *) override
 
void MoveInLineOfSight (Unit *) override
 
void DoAction (int32 action) override
 
void HealReceived (Unit *healer, uint32 &heal) override
 Called when the creature receives heal. More...
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
uint32 GetData (uint32 type) const 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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
 
- 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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

EventMap _events
 
InstanceScript_instance
 
uint32 const _portalCount
 
uint32 _missedPortals
 
bool _under25PercentTalkDone
 
bool _over75PercentTalkDone
 
bool _justDied
 
bool _done
 

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 ScriptedAI
Creatureme
 
- 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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- 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_valithria_dreamwalkerAI()

boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::boss_valithria_dreamwalkerAI ( Creature creature)
inline
294 : ScriptedAI(creature),
295 _instance(creature->GetInstanceScript()), _portalCount(RAID_MODE<uint32>(3, 8, 3, 8))
296 {
298 }
@ REACT_PASSIVE
Definition: Unit.h:548
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:97
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * _instance
Definition: boss_valithria_dreamwalker.cpp:485
uint32 const _portalCount
Definition: boss_valithria_dreamwalker.cpp:486

References ScriptedAI::me, REACT_PASSIVE, and Creature::SetReactState().

Member Function Documentation

◆ AttackStart()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

318{}

◆ DamageTaken()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::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 ScriptedAI.

375 {
376 if (me->HealthBelowPctDamaged(25, damage))
377 {
379 {
382 }
383
384 if (damage >= me->GetHealth())
385 {
386 damage = 0;
387 if (!_justDied)
388 {
389 _justDied = true;
393 trigger->AI()->EnterEvadeMode();
394 }
395 }
396 }
397 }
@ ENCOUNTER_FRAME_DISENGAGE
Definition: InstanceScript.h:46
@ SAY_VALITHRIA_25_PERCENT
Definition: boss_valithria_dreamwalker.cpp:39
@ SAY_VALITHRIA_DEATH
Definition: boss_valithria_dreamwalker.cpp:40
@ DATA_VALITHRIA_TRIGGER
Definition: icecrown_citadel.h:132
Talk
Definition: hyjal.cpp:82
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
uint32 GetHealth() const
Definition: Unit.h:869
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:874
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
void SendEncounterUnit(uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
Definition: InstanceScript.cpp:713
bool _justDied
Definition: boss_valithria_dreamwalker.cpp:490
bool _under25PercentTalkDone
Definition: boss_valithria_dreamwalker.cpp:488

References _instance, _justDied, _under25PercentTalkDone, DATA_VALITHRIA_TRIGGER, ENCOUNTER_FRAME_DISENGAGE, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetHealth(), Unit::HealthBelowPctDamaged(), ScriptedAI::me, SAY_VALITHRIA_25_PERCENT, SAY_VALITHRIA_DEATH, and InstanceScript::SendEncounterUnit().

◆ DoAction()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

322 {
323 if (action != ACTION_ENTER_COMBAT)
324 return;
325
327 _events.Reset();
330 if (IsHeroic())
332 }
@ ENCOUNTER_FRAME_ENGAGE
Definition: InstanceScript.h:45
@ ACTION_ENTER_COMBAT
Definition: boss_valithria_dreamwalker.cpp:144
@ EVENT_DREAM_PORTAL
Definition: boss_valithria_dreamwalker.cpp:111
@ EVENT_BERSERK
Definition: boss_valithria_dreamwalker.cpp:110
@ EVENT_INTRO_TALK
Definition: boss_valithria_dreamwalker.cpp:109
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void Reset()
Definition: EventMap.cpp:21
bool IsHeroic() const
Definition: ScriptedCreature.h:379
EventMap _events
Definition: boss_valithria_dreamwalker.cpp:484

References _events, _instance, ACTION_ENTER_COMBAT, ENCOUNTER_FRAME_ENGAGE, EVENT_BERSERK, EVENT_DREAM_PORTAL, EVENT_INTRO_TALK, ScriptedAI::IsHeroic(), ScriptedAI::me, EventMap::Reset(), EventMap::ScheduleEvent(), and InstanceScript::SendEncounterUnit().

◆ GetData()

uint32 boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from UnitAI.

476 {
477 if (type == MISSED_PORTALS)
478 return _missedPortals;
479
480 return 0;
481 }
@ MISSED_PORTALS
Definition: boss_valithria_dreamwalker.cpp:145
uint32 _missedPortals
Definition: boss_valithria_dreamwalker.cpp:487

References _missedPortals, and MISSED_PORTALS.

◆ HealReceived()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::HealReceived ( Unit ,
uint32  
)
inlineoverridevirtual

Called when the creature receives heal.

Reimplemented from UnitAI.

335 {
336 if (!me->hasLootRecipient())
337 me->SetLootRecipient(healer);
339
340 // encounter complete
341 if (me->HealthAbovePctHealed(100, heal) && !_done)
342 {
343 _done = true;
349 me->CastSpell((Unit*)nullptr, SPELL_DREAMWALKERS_RAGE, false);
350 _events.Reset();
353
355 trigger->AI()->EnterEvadeMode();
357 lichKing->AI()->Reset();
358 }
359 else if (!_over75PercentTalkDone && me->HealthAbovePctHealed(75, heal))
360 {
363 }
365 {
367 {
368 trigger->AI()->DoAction(ACTION_ENTER_COMBAT);
370 }
371 }
372 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
@ SPELL_ACHIEVEMENT_CHECK
Definition: boss_valithria_dreamwalker.cpp:60
@ SPELL_CORRUPTION_VALITHRIA
Definition: boss_valithria_dreamwalker.cpp:63
@ SPELL_DREAMWALKERS_RAGE
Definition: boss_valithria_dreamwalker.cpp:58
@ SAY_VALITHRIA_75_PERCENT
Definition: boss_valithria_dreamwalker.cpp:38
@ SAY_VALITHRIA_SUCCESS
Definition: boss_valithria_dreamwalker.cpp:43
@ EVENT_DREAM_SLIP
Definition: boss_valithria_dreamwalker.cpp:112
@ DATA_VALITHRIA_LICH_KING
Definition: icecrown_citadel.h:133
@ DATA_VALITHRIA_DREAMWALKER
Definition: icecrown_citadel.h:102
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1315
bool hasLootRecipient() const
Definition: Creature.h:232
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition: Creature.cpp:3793
Definition: Unit.h:630
bool HealthAbovePctHealed(int32 pct, uint32 heal) const
Definition: Unit.h:876
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:1168
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
bool _over75PercentTalkDone
Definition: boss_valithria_dreamwalker.cpp:489
bool _done
Definition: boss_valithria_dreamwalker.cpp:491

References _done, _events, _instance, _over75PercentTalkDone, ACTION_ENTER_COMBAT, Unit::CastSpell(), DATA_VALITHRIA_DREAMWALKER, DATA_VALITHRIA_LICH_KING, DATA_VALITHRIA_TRIGGER, DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), ENCOUNTER_FRAME_DISENGAGE, EVENT_DREAM_SLIP, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Creature::hasLootRecipient(), Unit::HealthAbovePctHealed(), IN_PROGRESS, Creature::LowerPlayerDamageReq(), ScriptedAI::me, NOT_STARTED, Unit::RemoveAurasDueToSpell(), EventMap::Reset(), SAY_VALITHRIA_75_PERCENT, SAY_VALITHRIA_SUCCESS, EventMap::ScheduleEvent(), InstanceScript::SendEncounterUnit(), InstanceScript::SetBossState(), Creature::SetLootRecipient(), SPELL_ACHIEVEMENT_CHECK, SPELL_CORRUPTION_VALITHRIA, and SPELL_DREAMWALKERS_RAGE.

◆ JustSummoned()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

416 {
417 if (summon->GetEntry() == NPC_DREAM_PORTAL_PRE_EFFECT)
418 {
419 summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_DREAM_PORTAL, me->GetGUID(), 6000), summon->m_Events.CalculateTime(15000));
421 }
422 else if (summon->GetEntry() == NPC_NIGHTMARE_PORTAL_PRE_EFFECT)
423 {
424 summon->m_Events.AddEvent(new DelayedCastEvent(summon, SPELL_SUMMON_NIGHTMARE_PORTAL, me->GetGUID(), 6000), summon->m_Events.CalculateTime(15000));
426 }
427 }
@ SPELL_SUMMON_NIGHTMARE_PORTAL
Definition: boss_valithria_dreamwalker.cpp:57
@ SPELL_SUMMON_DREAM_PORTAL
Definition: boss_valithria_dreamwalker.cpp:56
@ SPELL_NIGHTMARE_PORTAL_VISUAL_PRE
Definition: boss_valithria_dreamwalker.cpp:51
@ SPELL_DREAM_PORTAL_VISUAL_PRE
Definition: boss_valithria_dreamwalker.cpp:50
@ NPC_NIGHTMARE_PORTAL_PRE_EFFECT
Definition: icecrown_citadel.h:326
@ NPC_DREAM_PORTAL_PRE_EFFECT
Definition: icecrown_citadel.h:325
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:103
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:159
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
EventProcessor m_Events
Definition: Unit.h:1792
Definition: boss_valithria_dreamwalker.cpp:177
Definition: boss_valithria_dreamwalker.cpp:199

References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Object::GetEntry(), Object::GetGUID(), Unit::m_Events, ScriptedAI::me, NPC_DREAM_PORTAL_PRE_EFFECT, NPC_NIGHTMARE_PORTAL_PRE_EFFECT, SPELL_DREAM_PORTAL_VISUAL_PRE, SPELL_NIGHTMARE_PORTAL_VISUAL_PRE, SPELL_SUMMON_DREAM_PORTAL, and SPELL_SUMMON_NIGHTMARE_PORTAL.

◆ MoveInLineOfSight()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

319{}

◆ Reset()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

301 {
302 _events.Reset();
303 me->SetHealth(me->GetMaxHealth() * 0.5f); // starts at 50% health
304 me->LoadCreaturesAddon(true);
305 // immune to percent heals
308 // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints
309 me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true);
311 _missedPortals = 0;
314 _justDied = false;
315 _done = false;
316 }
@ SPELL_AURA_OBS_MOD_HEALTH
Definition: SpellAuraDefines.h:83
@ SPELL_EFFECT_HEAL_PCT
Definition: SharedDefines.h:914
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1394
@ IMMUNITY_ID
Definition: SharedDefines.h:1400
bool LoadCreaturesAddon(bool reload=false)
Definition: Creature.cpp:2705
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13346
uint32 GetMaxHealth() const
Definition: Unit.h:870
void SetHealth(uint32 val)
Definition: Unit.cpp:15433

References _done, _events, _instance, _justDied, _missedPortals, _over75PercentTalkDone, _under25PercentTalkDone, Unit::ApplySpellImmune(), ENCOUNTER_FRAME_DISENGAGE, Unit::GetMaxHealth(), IMMUNITY_EFFECT, IMMUNITY_ID, IMMUNITY_STATE, Creature::LoadCreaturesAddon(), ScriptedAI::me, EventMap::Reset(), InstanceScript::SendEncounterUnit(), Unit::SetHealth(), SPELL_AURA_OBS_MOD_HEALTH, and SPELL_EFFECT_HEAL_PCT.

◆ SpellHit()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

400 {
401 if (spell->Id == SPELL_DREAM_SLIP)
402 {
405 // this display id was found in sniff instead of the one on aura
406 me->SetDisplayId(11686);
408 me->DespawnOrUnsummon(4000);
410 lichKing->CastSpell(lichKing, SPELL_SPAWN_CHEST, false);
411 _instance->SetData(DATA_WEEKLY_QUEST_ID, 0); // show hidden npc if necessary
412 }
413 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ SPELL_DREAM_SLIP
Definition: boss_valithria_dreamwalker.cpp:59
@ SPELL_AWARD_REPUTATION_BOSS_KILL
Definition: boss_valithria_dreamwalker.cpp:62
@ SPELL_SPAWN_CHEST
Definition: boss_valithria_dreamwalker.cpp:73
@ SPELL_CLEAR_ALL
Definition: boss_valithria_dreamwalker.cpp:61
@ DATA_WEEKLY_QUEST_ID
Definition: icecrown_citadel.h:143
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition: Creature.cpp:3505
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References _instance, Unit::CastSpell(), DATA_VALITHRIA_LICH_KING, DATA_WEEKLY_QUEST_ID, Creature::DespawnOrUnsummon(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), SpellInfo::Id, ScriptedAI::me, ZoneScript::SetData(), Creature::SetDisplayId(), Unit::SetUnitFlag(), SPELL_AWARD_REPUTATION_BOSS_KILL, SPELL_CLEAR_ALL, SPELL_DREAM_SLIP, SPELL_SPAWN_CHEST, and UNIT_FLAG_NOT_SELECTABLE.

◆ SummonedCreatureDespawn()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

430 {
431 if (summon->GetEntry() == NPC_DREAM_PORTAL || summon->GetEntry() == NPC_NIGHTMARE_PORTAL)
432 if (summon->AI()->GetData(MISSED_PORTALS))
434 }
@ NPC_NIGHTMARE_PORTAL
Definition: icecrown_citadel.h:328
@ NPC_DREAM_PORTAL
Definition: icecrown_citadel.h:327
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
CreatureAI * AI() const
Definition: Creature.h:143

References _missedPortals, Creature::AI(), UnitAI::GetData(), Object::GetEntry(), MISSED_PORTALS, NPC_DREAM_PORTAL, and NPC_NIGHTMARE_PORTAL.

◆ UpdateAI()

void boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

437 {
438 // does not enter combat
440 {
441 uint32 startingHealth = me->GetMaxHealth() * 0.5f;
442 if (me->GetHealth() != startingHealth) // healing when boss cannot be engaged (lower spire not finished, cheating) doesn't start the fight, prevent winning this way
443 me->SetHealth(startingHealth);
444 return;
445 }
446
447 _events.Update(diff);
448
450 return;
451
452 switch (_events.ExecuteEvent())
453 {
454 case EVENT_INTRO_TALK:
456 break;
457 case EVENT_BERSERK:
459 break;
461 if (!IsHeroic())
463 for (uint32 i = 0; i < _portalCount; ++i)
464 me->CastSpell(me, SUMMON_PORTAL, false);
466 break;
467 case EVENT_DREAM_SLIP:
469 break;
470 default:
471 break;
472 }
473 }
std::uint32_t uint32
Definition: Define.h:107
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
#define SUMMON_PORTAL
Definition: boss_valithria_dreamwalker.cpp:103
@ SAY_VALITHRIA_DREAM_PORTAL
Definition: boss_valithria_dreamwalker.cpp:37
@ SAY_VALITHRIA_ENTER_COMBAT
Definition: boss_valithria_dreamwalker.cpp:36
@ SAY_VALITHRIA_BERSERK
Definition: boss_valithria_dreamwalker.cpp:42
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673

References _events, _instance, _portalCount, Unit::CastSpell(), DATA_VALITHRIA_DREAMWALKER, EVENT_BERSERK, EVENT_DREAM_PORTAL, EVENT_DREAM_SLIP, EVENT_INTRO_TALK, EventMap::ExecuteEvent(), InstanceScript::GetBossState(), Unit::GetHealth(), Unit::GetMaxHealth(), Unit::HasUnitState(), ScriptedAI::IsHeroic(), ScriptedAI::me, NOT_STARTED, SAY_VALITHRIA_BERSERK, SAY_VALITHRIA_DREAM_PORTAL, SAY_VALITHRIA_ENTER_COMBAT, EventMap::ScheduleEvent(), Unit::SetHealth(), SPELL_DREAM_SLIP, SUMMON_PORTAL, UNIT_STATE_CASTING, and EventMap::Update().

Member Data Documentation

◆ _done

bool boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_done
private

Referenced by HealReceived(), and Reset().

◆ _events

EventMap boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_events
private

◆ _instance

InstanceScript* boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_instance
private

◆ _justDied

bool boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_justDied
private

Referenced by DamageTaken(), and Reset().

◆ _missedPortals

uint32 boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_missedPortals
private

◆ _over75PercentTalkDone

bool boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_over75PercentTalkDone
private

Referenced by HealReceived(), and Reset().

◆ _portalCount

uint32 const boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_portalCount
private

Referenced by UpdateAI().

◆ _under25PercentTalkDone

bool boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::_under25PercentTalkDone
private

Referenced by DamageTaken(), and Reset().