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

Public Member Functions

 boss_prince_valanarAI (Creature *creature)
 
void InitializeAI () override
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged. More...
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void JustReachedHome () override
 
void JustSummoned (Creature *summon) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void DamageDealt (Unit *target, uint32 &damage, DamageEffectType) override
 Called at any Damage to any victim (before damage apply) More...
 
void KilledUnit (Unit *victim) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void DoAction (int32 action) override
 
bool CheckRoom ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void EnterEvadeMode (EvadeReason why) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) 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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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
 

Public Attributes

bool _isEmpowered
 
bool _evading
 
bool _canDie
 
uint32 invocationOrder [3]
 
uint8 currentInvocationIndex
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_prince_valanarAI()

boss_prince_valanar_icc::boss_prince_valanarAI::boss_prince_valanarAI ( Creature creature)
inline
740 {
741 if (!instance)
742 {
743 me->IsAIEnabled = false;
745 }
746 _canDie = true;
747 }
@ DATA_BLOOD_PRINCE_COUNCIL
Definition: icecrown_citadel.h:93
@ UNIT_STATE_EVADE
Definition: UnitDefines.h:170
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedCreature.h:467
InstanceScript *const instance
Definition: ScriptedCreature.h:474
void AddUnitState(uint32 f)
Definition: Unit.h:700
bool IsAIEnabled
Definition: Unit.h:1962
bool _canDie
Definition: boss_blood_prince_council.cpp:769

References _canDie, Unit::AddUnitState(), BossAI::instance, Unit::IsAIEnabled, ScriptedAI::me, and UNIT_STATE_EVADE.

Member Function Documentation

◆ CheckRoom()

bool boss_prince_valanar_icc::boss_prince_valanarAI::CheckRoom ( )
inline
964 {
967 if (keleseth && taldaram && IsInBoundary(me) && IsInBoundary(keleseth) && IsInBoundary(taldaram))
968 return true;
969
971 return false;
972 }
@ DATA_PRINCE_TALDARAM_GUID
Definition: icecrown_citadel.h:111
@ DATA_PRINCE_KELESETH_GUID
Definition: icecrown_citadel.h:110
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:93
bool IsInBoundary(Position const *who=nullptr) const
Definition: CreatureAI.cpp:386
Definition: Creature.h:43
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
void EnterEvadeMode(EvadeReason why) override
Definition: boss_blood_prince_council.cpp:1049

References DATA_PRINCE_KELESETH_GUID, DATA_PRINCE_TALDARAM_GUID, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, Map::GetCreature(), InstanceScript::GetGuidData(), BossAI::instance, InstanceScript::instance, CreatureAI::IsInBoundary(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ DamageDealt()

void boss_prince_valanar_icc::boss_prince_valanarAI::DamageDealt ( Unit ,
uint32 ,
DamageEffectType   
)
inlineoverridevirtual

Called at any Damage to any victim (before damage apply)

Reimplemented from UnitAI.

910 {
911 if (!target->IsPlayer())
912 return;
913
914 if (damage > RAID_MODE<uint32>(23000, 25000, 23000, 25000))
916 }
@ DATA_ORB_WHISPERER_ACHIEVEMENT
Definition: icecrown_citadel.h:109
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References DATA_ORB_WHISPERER_ACHIEVEMENT, BossAI::instance, Object::IsPlayer(), and ZoneScript::SetData().

◆ DamageTaken()

void boss_prince_valanar_icc::boss_prince_valanarAI::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 BossAI.

900 {
901 if (!_isEmpowered)
902 {
903 if (attacker)
904 me->AddThreat(attacker, float(damage));
905 damage = 0;
906 }
907 }
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14653
bool _isEmpowered
Definition: boss_blood_prince_council.cpp:767

References _isEmpowered, Unit::AddThreat(), and ScriptedAI::me.

◆ DoAction()

void boss_prince_valanar_icc::boss_prince_valanarAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

931 {
932 switch (action)
933 {
934 case ACTION_STAND_UP:
937 me->SetImmuneToAll(false);
941 me->ForceValuesUpdateAtIndex(UNIT_NPC_FLAGS); // was in sniff. don't ask why
945 break;
947 if (me->IsInCombat())
951 _isEmpowered = true;
952 break;
954 _isEmpowered = false;
957 break;
958 default:
959 break;
960 }
961 }
Talk
Definition: hyjal.cpp:82
@ ACTION_CAST_INVOCATION
Definition: boss_blood_prince_council.cpp:142
@ ACTION_STAND_UP
Definition: boss_blood_prince_council.cpp:141
@ ACTION_REMOVE_INVOCATION
Definition: boss_blood_prince_council.cpp:143
@ SPELL_INVOCATION_OF_BLOOD_VALANAR
Definition: boss_blood_prince_council.cpp:67
@ SPELL_INVOCATION_VISUAL_ACTIVE
Definition: boss_blood_prince_council.cpp:64
@ SAY_VALANAR_INVOCATION
Definition: boss_blood_prince_council.cpp:51
@ UNIT_DYNFLAG_DEAD
Definition: SharedDefines.h:3126
@ UNIT_NPC_FLAGS
Definition: UpdateFields.h:139
#define WORLD_TRIGGER
Definition: Unit.h:37
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ UNIT_FLAG2_FEIGN_DEATH
Definition: UnitDefines.h:268
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition: UnitDefines.h:258
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
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
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
SummonList summons
Definition: ScriptedCreature.h:511
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:124
void ForceValuesUpdateAtIndex(uint32)
Definition: Object.cpp:2078
EventProcessor m_Events
Definition: Object.h:642
uint32 GetMaxHealth() const
Definition: Unit.h:1030
void SetHealth(uint32 val)
Definition: Unit.cpp:15478
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:720
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:1167
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
bool IsInCombat() const
Definition: Unit.h:884
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
Definition: boss_blood_prince_council.cpp:154
void DoAction(int32 action) override
Definition: boss_blood_prince_council.cpp:930

References _isEmpowered, ACTION_CAST_INVOCATION, ACTION_REMOVE_INVOCATION, ACTION_STAND_UP, EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Unit::CastSpell(), SummonList::DespawnEntry(), DoAction(), Object::ForceValuesUpdateAtIndex(), Unit::GetMaxHealth(), Unit::IsInCombat(), WorldObject::m_Events, ScriptedAI::me, REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), Object::RemoveDynamicFlag(), Unit::RemoveUnitFlag(), Unit::RemoveUnitFlag2(), SAY_VALANAR_INVOCATION, Unit::SetHealth(), Unit::SetImmuneToAll(), Creature::SetReactState(), SPELL_INVOCATION_OF_BLOOD_VALANAR, SPELL_INVOCATION_VISUAL_ACTIVE, BossAI::summons, UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH, UNIT_FLAG_NOT_SELECTABLE, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT, UNIT_NPC_FLAGS, and WORLD_TRIGGER.

Referenced by DoAction(), EnterEvadeMode(), JustEngagedWith(), JustReachedHome(), and SpellHit().

◆ EnterEvadeMode()

void boss_prince_valanar_icc::boss_prince_valanarAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from BossAI.

1050 {
1051 if (_evading)
1052 return;
1053 _canDie = false;
1056 _evading = true;
1058 keleseth->AI()->EnterEvadeMode(why);
1060 taldaram->AI()->EnterEvadeMode(why);
1062 _evading = false;
1063 }
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition: ScriptedCreature.h:498
bool _evading
Definition: boss_blood_prince_council.cpp:768

References _canDie, _evading, ACTION_REMOVE_INVOCATION, DATA_PRINCE_KELESETH_GUID, DATA_PRINCE_TALDARAM_GUID, DoAction(), BossAI::EnterEvadeMode(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMaxHealth(), BossAI::instance, ScriptedAI::me, and Unit::SetHealth().

Referenced by CheckRoom(), JustEngagedWith(), and UpdateAI().

◆ InitializeAI()

void boss_prince_valanar_icc::boss_prince_valanarAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

750 {
752 if (me->IsAlive())
753 {
755 {
756 c->SetObjectScale(1.75f);
757 c->CastSpell(c, SPELL_FEIGN_DEATH, true);
758 }
759
762 me->SetImmuneToAll(true);
764 }
765 }
@ SPELL_FEIGN_DEATH
Definition: boss_blood_prince_council.cpp:62
@ REACT_PASSIVE
Definition: Unit.h:548
virtual void InitializeAI()
Definition: UnitAI.h:204
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:338
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:123
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:719
bool IsAlive() const
Definition: Unit.h:1654

References Creature::GetHomePosition(), UnitAI::InitializeAI(), Unit::IsAlive(), ScriptedAI::me, REACT_PASSIVE, Object::SetDynamicFlag(), Unit::SetImmuneToAll(), Creature::SetReactState(), Unit::SetUnitFlag2(), SPELL_FEIGN_DEATH, WorldObject::SummonCreature(), UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH, and WORLD_TRIGGER.

◆ JustDied()

void boss_prince_valanar_icc::boss_prince_valanarAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

838 {
839 events.Reset();
842
843 if (!_canDie)
844 {
845 me->RemoveCorpse(false);
846 me->SetRespawnTime(10);
850 me->GetMotionMaster()->Clear(false);
853 return;
854 }
855
859 if (keleseth->IsAlive())
860 Unit::Kill(keleseth, keleseth);
862 if (taldaram->IsAlive())
863 Unit::Kill(taldaram, taldaram);
864 }
events
Definition: boss_sartura.cpp:43
@ SAY_VALANAR_DEATH
Definition: boss_blood_prince_council.cpp:57
Position const homePos
Definition: boss_chromaggus.cpp:71
@ ENCOUNTER_FRAME_DISENGAGE
Definition: InstanceScript.h:46
@ DONE
Definition: InstanceScript.h:60
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SaveRespawnTime() override
Definition: Creature.cpp:2617
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3775
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:400
Definition: Position.h:27
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17702
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20025
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16689
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:373
void SendEncounterUnit(uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
Definition: InstanceScript.cpp:739
void MoveIdle()
Definition: MotionMaster.cpp:232
void Clear(bool reset=true)
Definition: MotionMaster.h:167

References _canDie, MotionMaster::Clear(), DATA_BLOOD_PRINCE_COUNCIL, DATA_PRINCE_KELESETH_GUID, DATA_PRINCE_TALDARAM_GUID, SummonList::DespawnAll(), DONE, ENCOUNTER_FRAME_DISENGAGE, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Creature::GetHomePosition(), Unit::GetMotionMaster(), homePos, BossAI::instance, Unit::Kill(), ScriptedAI::me, MotionMaster::MoveIdle(), Creature::RemoveCorpse(), Creature::SaveRespawnTime(), SAY_VALANAR_DEATH, InstanceScript::SendEncounterUnit(), InstanceScript::SetBossState(), Creature::SetRespawnTime(), Unit::StopMovingOnCurrentPos(), BossAI::summons, and Unit::UpdatePosition().

◆ JustEngagedWith()

void boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

785 {
786 bool valid = true;
788 if (!keleseth->IsAlive() || keleseth->IsInEvadeMode())
789 valid = false;
791 if (!taldaram->IsAlive() || taldaram->IsInEvadeMode())
792 valid = false;
794 if (!valanar->IsAlive() || valanar->IsInEvadeMode())
795 valid = false;
796 if (!valid)
797 {
799 return;
800 }
801
805 me->setActive(true);
807 if (!me->hasLootRecipient())
808 me->SetLootRecipient(who);
812
814 if (!keleseth->IsInEvadeMode())
815 keleseth->SetInCombatWithZone();
817 if (!taldaram->IsInEvadeMode())
818 taldaram->SetInCombatWithZone();
819
825
826 events.ScheduleEvent(EVENT_BERSERK, 10min);
827 events.ScheduleEvent(EVENT_KINETIC_BOMB, 18s, 24s);
828 events.ScheduleEvent(EVENT_SHOCK_VORTEX, 15s, 20s);
829 events.ScheduleEvent(EVENT_INVOCATION_OF_BLOOD, 45s);
830 if (IsHeroic())
831 {
834 }
835 }
@ SPELL_SHADOW_PRISON
Definition: boss_blood_prince_council.cpp:70
@ SPELL_SHADOW_PRISON_DUMMY
Definition: boss_blood_prince_council.cpp:72
@ EVENT_KINETIC_BOMB
Definition: boss_blood_prince_council.cpp:133
@ EVENT_INVOCATION_OF_BLOOD
Definition: boss_blood_prince_council.cpp:122
@ EVENT_SHOCK_VORTEX
Definition: boss_blood_prince_council.cpp:134
@ EVENT_BERSERK
Definition: boss_blood_prince_council.cpp:123
@ DATA_PRINCE_VALANAR_GUID
Definition: icecrown_citadel.h:112
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:25
@ ENCOUNTER_FRAME_ENGAGE
Definition: InstanceScript.h:45
@ IN_PROGRESS
Definition: InstanceScript.h:58
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:106
bool IsHeroic() const
Definition: ScriptedCreature.h:379
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1320
bool hasLootRecipient() const
Definition: Creature.h:231
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition: Creature.cpp:3806
void setActive(bool isActiveObject)
Definition: Object.cpp:1094
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
uint8 currentInvocationIndex
Definition: boss_blood_prince_council.cpp:771
uint32 invocationOrder[3]
Definition: boss_blood_prince_council.cpp:770

References ACTION_CAST_INVOCATION, Unit::AddAura(), Unit::CastSpell(), currentInvocationIndex, DATA_BLOOD_PRINCE_COUNCIL, DATA_ORB_WHISPERER_ACHIEVEMENT, DATA_PRINCE_KELESETH_GUID, DATA_PRINCE_TALDARAM_GUID, DATA_PRINCE_VALANAR_GUID, DoAction(), CreatureAI::DoZoneInCombat(), ENCOUNTER_FRAME_ENGAGE, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BERSERK, EVENT_INVOCATION_OF_BLOOD, EVENT_KINETIC_BOMB, EVENT_SHOCK_VORTEX, Map::GetCreature(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMaxHealth(), Creature::hasLootRecipient(), IN_PROGRESS, BossAI::instance, InstanceScript::instance, invocationOrder, ScriptedAI::IsHeroic(), Creature::LowerPlayerDamageReq(), ScriptedAI::me, RAND(), REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), InstanceScript::SendEncounterUnit(), WorldObject::setActive(), InstanceScript::SetBossState(), ZoneScript::SetData(), Creature::SetLootRecipient(), Creature::SetReactState(), SPELL_FEIGN_DEATH, SPELL_SHADOW_PRISON, and SPELL_SHADOW_PRISON_DUMMY.

◆ JustReachedHome()

◆ JustRespawned()

void boss_prince_valanar_icc::boss_prince_valanarAI::JustRespawned ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

867 {
870 }
virtual void JustRespawned()
Definition: CreatureAI.h:154
void JustReachedHome() override
Definition: boss_blood_prince_council.cpp:872

References JustReachedHome(), and CreatureAI::JustRespawned().

◆ JustSummoned()

void boss_prince_valanar_icc::boss_prince_valanarAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

883 {
884 summons.Summon(summon);
885 switch (summon->GetEntry())
886 {
889 summon->CastSpell(summon, SPELL_KINETIC_BOMB, true, nullptr, nullptr, me->GetGUID());
890 break;
891 case NPC_SHOCK_VORTEX:
892 summon->m_Events.AddEvent(new ShockVortexExplodeEvent(*summon), summon->m_Events.CalculateTime(4500));
893 break;
894 default:
895 break;
896 }
897 }
@ SPELL_KINETIC_BOMB
Definition: boss_blood_prince_council.cpp:101
@ NPC_SHOCK_VORTEX
Definition: icecrown_citadel.h:284
@ NPC_KINETIC_BOMB_TARGET
Definition: icecrown_citadel.h:282
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Definition: boss_blood_prince_council.cpp:169

References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), Unit::CastSpell(), Object::GetEntry(), Object::GetGUID(), WorldObject::m_Events, ScriptedAI::me, NPC_KINETIC_BOMB_TARGET, NPC_SHOCK_VORTEX, REACT_PASSIVE, Creature::SetReactState(), SPELL_KINETIC_BOMB, SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_prince_valanar_icc::boss_prince_valanarAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

919 {
920 if (victim->IsPlayer())
922 }
@ SAY_VALANAR_KILL
Definition: boss_blood_prince_council.cpp:55
bool IsPlayer() const
Definition: Object.h:200

References Object::IsPlayer(), and SAY_VALANAR_KILL.

◆ Reset()

void boss_prince_valanar_icc::boss_prince_valanarAI::Reset ( )
inlineoverridevirtual

◆ SpellHit()

void boss_prince_valanar_icc::boss_prince_valanarAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

925 {
926 if (spell->Id == 71070 && me->IsInCombat() && !me->IsInEvadeMode())
928 }
bool IsInEvadeMode() const
Definition: Creature.h:134

References ACTION_CAST_INVOCATION, DoAction(), SpellInfo::Id, Unit::IsInCombat(), Creature::IsInEvadeMode(), and ScriptedAI::me.

◆ UpdateAI()

void boss_prince_valanar_icc::boss_prince_valanarAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from BossAI.

975 {
976 if (!UpdateVictim() || !CheckRoom())
977 return;
978
979 events.Update(diff);
980
982 return;
983
984 switch (events.ExecuteEvent())
985 {
987 {
988 uint32 visualSpellId = 0;
990 if (++currentInvocationIndex >= 3)
994 {
996 visualSpellId = 71080;
997 break;
999 visualSpellId = 71081;
1000 break;
1002 visualSpellId = 71070;
1003 break;
1004 }
1005 if (!visualSpellId || !current || !next || !current->IsInCombat() || !next->IsInCombat())
1006 {
1008 return;
1009 }
1010 next->SetHealth(current->GetHealth());
1012 current->SetHealth(1);
1013 current->CastSpell((Unit*)nullptr, visualSpellId, true);
1014 next->AI()->Talk(1);
1015 }
1016 events.ScheduleEvent(EVENT_INVOCATION_OF_BLOOD, 46s);
1017 break;
1018 case EVENT_BERSERK:
1019 me->CastSpell(me, SPELL_BERSERK, true);
1021 break;
1022 case EVENT_KINETIC_BOMB:
1023 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
1024 {
1025 me->CastSpell(target, SPELL_KINETIC_BOMB_TARGET, false);
1027 }
1028 events.ScheduleEvent(EVENT_KINETIC_BOMB, me->GetMap()->Is25ManRaid() ? 20s + 500ms : 30s + 500ms);
1029 break;
1030 case EVENT_SHOCK_VORTEX:
1031 if (_isEmpowered)
1032 {
1035 events.ScheduleEvent(EVENT_SHOCK_VORTEX, 30s);
1036 }
1037 else
1038 {
1039 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
1040 me->CastSpell(target, SPELL_SHOCK_VORTEX, false);
1041 events.ScheduleEvent(EVENT_SHOCK_VORTEX, 18s, 23s);
1042 }
1043 break;
1044 }
1045
1047 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_KINETIC_BOMB_TARGET
Definition: boss_blood_prince_council.cpp:100
@ SPELL_EMPOWERED_SHOCK_VORTEX
Definition: boss_blood_prince_council.cpp:103
@ SPELL_SHOCK_VORTEX
Definition: boss_blood_prince_council.cpp:102
@ SAY_VALANAR_SPECIAL
Definition: boss_blood_prince_council.cpp:53
@ EMOTE_VALANAR_SHOCK_VORTEX
Definition: boss_blood_prince_council.cpp:54
@ SAY_VALANAR_BERSERK
Definition: boss_blood_prince_council.cpp:56
#define SPELL_BERSERK
Definition: boss_ignis.cpp:40
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
virtual void DoAction(int32)
Definition: UnitAI.h:212
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
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.
Definition: CreatureAI.cpp:50
bool UpdateVictim()
Definition: CreatureAI.cpp:280
CreatureAI * AI() const
Definition: Creature.h:140
Map * GetMap() const
Definition: Object.h:536
Definition: Unit.h:630
uint32 GetHealth() const
Definition: Unit.h:1029
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
bool Is25ManRaid() const
Definition: Map.h:451
bool CheckRoom()
Definition: boss_blood_prince_council.cpp:963

References _isEmpowered, ACTION_REMOVE_INVOCATION, Creature::AI(), Unit::CastSpell(), CheckRoom(), currentInvocationIndex, DATA_PRINCE_KELESETH_GUID, DATA_PRINCE_TALDARAM_GUID, DATA_PRINCE_VALANAR_GUID, UnitAI::DoAction(), UnitAI::DoMeleeAttackIfReady(), EMOTE_VALANAR_SHOCK_VORTEX, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BERSERK, EVENT_INVOCATION_OF_BLOOD, EVENT_KINETIC_BOMB, EVENT_SHOCK_VORTEX, Map::GetCreature(), InstanceScript::GetGuidData(), Unit::GetHealth(), WorldObject::GetMap(), Unit::HasUnitState(), BossAI::instance, InstanceScript::instance, invocationOrder, Map::Is25ManRaid(), Unit::IsInCombat(), ScriptedAI::me, SAY_VALANAR_BERSERK, SAY_VALANAR_SPECIAL, UnitAI::SelectTarget(), Unit::SetHealth(), SPELL_BERSERK, SPELL_EMPOWERED_SHOCK_VORTEX, SPELL_KINETIC_BOMB_TARGET, SPELL_SHOCK_VORTEX, CreatureAI::Talk(), UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _canDie

bool boss_prince_valanar_icc::boss_prince_valanarAI::_canDie

◆ _evading

bool boss_prince_valanar_icc::boss_prince_valanarAI::_evading

Referenced by EnterEvadeMode(), and Reset().

◆ _isEmpowered

bool boss_prince_valanar_icc::boss_prince_valanarAI::_isEmpowered

Referenced by DamageTaken(), DoAction(), Reset(), and UpdateAI().

◆ currentInvocationIndex

uint8 boss_prince_valanar_icc::boss_prince_valanarAI::currentInvocationIndex

Referenced by JustEngagedWith(), and UpdateAI().

◆ invocationOrder

uint32 boss_prince_valanar_icc::boss_prince_valanarAI::invocationOrder[3]

Referenced by JustEngagedWith(), and UpdateAI().