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

Public Member Functions

 boss_svalaAI (Creature *creature)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void SetData (uint32 data, uint32 param) override
 
void JustSummoned (Creature *summon) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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

ObjectGuid ArthasGUID
 
bool Started
 
InstanceScriptinstance
 
EventMap events
 
EventMap events2
 
SummonList summons
 
- 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 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_svalaAI()

boss_svala::boss_svalaAI::boss_svalaAI ( Creature creature)
inline
111 : ScriptedAI(creature), summons(me)
112 {
113 instance = creature->GetInstanceScript();
114 Started = false;
116 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
void Clear()
Definition: ObjectGuid.h:138
SummonList summons
Definition: boss_svala.cpp:123
ObjectGuid ArthasGUID
Definition: boss_svala.cpp:118
InstanceScript * instance
Definition: boss_svala.cpp:120
bool Started
Definition: boss_svala.cpp:119

References ArthasGUID, ObjectGuid::Clear(), WorldObject::GetInstanceScript(), instance, and Started.

Member Function Documentation

◆ EnterEvadeMode()

void boss_svala::boss_svalaAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

147 {
150 }
@ UNIT_STATE_ROOT
Definition: UnitDefines.h:159
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18034

References CreatureAI::EnterEvadeMode(), ScriptedAI::me, Unit::SetControlled(), and UNIT_STATE_ROOT.

◆ JustDied()

void boss_svala::boss_svalaAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

193 {
196 if (instance)
198 }
Talk
Definition: hyjal.cpp:82
@ SAY_DEATH
Definition: boss_svala.cpp:36
@ DATA_SVALA_SORROWGRAVE
Definition: utgarde_pinnacle.h:29
@ DONE
Definition: InstanceScript.h:60
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References DATA_SVALA_SORROWGRAVE, SummonList::DespawnAll(), DONE, instance, SAY_DEATH, ZoneScript::SetData(), and summons.

◆ JustEngagedWith()

void boss_svala::boss_svalaAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

180 {
183
184 events.ScheduleEvent(EVENT_SORROWGRAVE_SS, 3s);
185 events.ScheduleEvent(EVENT_SORROWGRAVE_FLAMES, 11s);
186 events.ScheduleEvent(EVENT_SORROWGRAVE_RITUAL, 25s);
187
188 if (instance)
190 }
events
Definition: boss_sartura.cpp:43
@ SAY_AGGRO
Definition: boss_svala.cpp:34
@ EVENT_SORROWGRAVE_RITUAL
Definition: boss_svala.cpp:83
@ EVENT_SORROWGRAVE_FLAMES
Definition: boss_svala.cpp:81
@ EVENT_SORROWGRAVE_SS
Definition: boss_svala.cpp:80
@ IN_PROGRESS
Definition: InstanceScript.h:58
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811

References DATA_SVALA_SORROWGRAVE, EVENT_SORROWGRAVE_FLAMES, EVENT_SORROWGRAVE_RITUAL, EVENT_SORROWGRAVE_SS, IN_PROGRESS, instance, ScriptedAI::me, SAY_AGGRO, ZoneScript::SetData(), and Creature::SetInCombatWithZone().

◆ JustSummoned()

void boss_svala::boss_svalaAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

173 {
174 summons.Summon(summon);
175 if (summon->GetEntry() == NPC_RITUAL_CHANNELER)
176 summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true);
177 }
@ SPELL_TELEPORT_VISUAL
Definition: boss_svala.cpp:57
@ NPC_RITUAL_CHANNELER
Definition: boss_svala.cpp:60
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
uint32 GetEntry() const
Definition: Object.h:115
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

References Unit::CastSpell(), Object::GetEntry(), NPC_RITUAL_CHANNELER, SPELL_TELEPORT_VISUAL, SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_svala::boss_svalaAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

201 {
202 if (victim->GetEntry() == NPC_SCOURGE_HULK && instance)
203 {
206 }
207
208 if (victim->IsPlayer())
209 Talk(SAY_SLAY);
210 }
@ SAY_SLAY
Definition: boss_svala.cpp:35
@ NPC_SCOURGE_HULK
Definition: utgarde_pinnacle.h:63
@ DATA_SVALA_ACHIEVEMENT
Definition: utgarde_pinnacle.h:49
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:122
bool IsPlayer() const
Definition: Object.h:200
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:638

References ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, DATA_SVALA_ACHIEVEMENT, InstanceScript::DoUpdateAchievementCriteria(), Object::GetEntry(), instance, Object::IsPlayer(), NPC_SCOURGE_HULK, SAY_SLAY, and ZoneScript::SetData().

◆ Reset()

void boss_svala::boss_svalaAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

126 {
127 if (instance)
128 {
131 }
132
134 events.Reset();
135 events2.Reset();
136 if (!Started)
137 me->SetImmuneToAll(true);
138 else
139 {
141 me->SetImmuneToAll(false);
142 me->SetHover(true);
143 }
144 }
@ NOT_STARTED
Definition: InstanceScript.h:57
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
void Reset()
Definition: EventMap.cpp:21
bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3370
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
EventMap events2
Definition: boss_svala.cpp:122

References DATA_SVALA_ACHIEVEMENT, DATA_SVALA_SORROWGRAVE, SummonList::DespawnAll(), events2, instance, ScriptedAI::me, NOT_STARTED, Unit::RemoveUnitFlag(), EventMap::Reset(), ZoneScript::SetData(), Creature::SetHover(), Unit::SetImmuneToAll(), Started, summons, and UNIT_FLAG_NON_ATTACKABLE.

◆ SetData()

void boss_svala::boss_svalaAI::SetData ( uint32  data,
uint32  param 
)
inlineoverridevirtual

Reimplemented from UnitAI.

153 {
154 if (data != 1 || param != 1 || Started || (instance && instance->GetData(DATA_SVALA_SORROWGRAVE) == DONE))
155 return;
156
157 me->SetImmuneToAll(true);
158 Started = true;
159 me->setActive(true);
161 if (Creature* pArthas = me->SummonCreature(NPC_ARTHAS, 295.81f, -366.16f, 92.57f, 1.58f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 59000))
162 ArthasGUID = pArthas->GetGUID();
163
164 if (instance)
165 {
168 mirror->SetGoState(GO_STATE_READY);
169 }
170 }
@ NPC_ARTHAS
Definition: boss_svala.cpp:61
@ EVENT_SVALA_START
Definition: boss_svala.cpp:68
@ GO_SVALA_MIRROR
Definition: utgarde_pinnacle.h:60
@ GO_STATE_READY
Definition: GameObjectData.h:690
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: Object.h:47
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
Definition: Creature.h:43
Definition: GameObject.h:120
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 setActive(bool isActiveObject)
Definition: Object.cpp:1094
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51

References ArthasGUID, DATA_SVALA_SORROWGRAVE, DONE, EVENT_SVALA_START, events2, ZoneScript::GetData(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_STATE_READY, GO_SVALA_MIRROR, IN_PROGRESS, instance, ScriptedAI::me, NPC_ARTHAS, EventMap::ScheduleEvent(), WorldObject::setActive(), ZoneScript::SetData(), Unit::SetImmuneToAll(), Started, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN.

◆ UpdateAI()

void boss_svala::boss_svalaAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

213 {
214 events2.Update(diff);
215 switch (events2.ExecuteEvent())
216 {
220 break;
223 Arthas->AI()->Talk(TALK_INTRO_A1);
225 break;
228 Arthas->CastSpell(me, SPELL_ARTHAS_TRANSFORMING_SVALA, false);
231 break;
234 me->SetHover(true);
236 events2.ScheduleEvent(30, 1s);
238 break;
239 case 30:
240 {
242 data << me->GetPackGUID();
243 me->SendMessageToSet(&data, false);
244 break;
245 }
247 {
252 me->SetImmuneToAll(true);
254 Arthas->InterruptNonMeleeSpells(false);
256 me->SetWalk(false);
258
259 std::list<Creature*> creatureList;
261 for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
262 (*itr)->AI()->SetData(1, 2);
263
264 break;
265 }
269 break;
272 Arthas->AI()->Talk(TALK_INTRO_A2);
274 break;
276 me->SetFacingTo(M_PI / 2.0f);
279 mirror->SetGoState(GO_STATE_ACTIVE);
281 break;
283 me->GetMotionMaster()->MoveFall(0, true);
285 break;
288 me->SetImmuneToAll(false);
289 me->LoadEquipment(1, true);
290 me->setActive(false);
291 if (Player* target = SelectTargetFromPlayerList(100.0f))
292 AttackStart(target);
293 return;
294 }
295
296 if (!UpdateVictim())
297 return;
298
299 events.Update(diff);
301 return;
302
303 switch (events.ExecuteEvent())
304 {
307 events.ScheduleEvent(EVENT_SORROWGRAVE_SS, 3s, 5s);
308 break;
312 events.ScheduleEvent(EVENT_SORROWGRAVE_FLAMES2, 500ms);
313 events.ScheduleEvent(EVENT_SORROWGRAVE_FLAMES2, 1s);
314 events.ScheduleEvent(EVENT_SORROWGRAVE_FLAMES, 8s, 12s);
315 break;
317 {
318 std::list<Creature*> braziers;
320 if (!braziers.empty())
321 {
322 for (std::list<Creature*>::const_iterator itr = braziers.begin(); itr != braziers.end(); ++itr)
323 (*itr)->CastCustomSpell(SPELL_BALL_OF_FLAME, SPELLVALUE_MAX_TARGETS, 1, (*itr), true);
324 }
325 break;
326 }
328 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
329 {
331
332 for (uint8 i = 0; i < 3; ++i)
334 cr->AI()->AttackStart(target);
335
337 DoTeleportPlayer(target, 296.632f, -346.075f, 90.63f, 4.6f);
338 me->NearTeleportTo(296.632f, -346.075f, 110.0f, 4.6f, false);
343 }
344
345 events.DelayEvents(25001); // +1 just to be sure
346 events.ScheduleEvent(EVENT_SORROWGRAVE_RITUAL_SPELLS, 0ms);
347 events.ScheduleEvent(EVENT_SORROWGRAVE_FINISH_RITUAL, 25s);
348 return;
350 //me->CastSpell(me, SPELL_RITUAL_OF_THE_SWORD, false);
352 return;
357 me->GetMotionMaster()->MoveFall(0, true);
359 break;
360 }
361
363 }
std::uint8_t uint8
Definition: Define.h:109
@ TALK_INTRO_S1
Definition: boss_svala.cpp:31
@ NPC_FLAME_BRAZIER
Definition: boss_svala.cpp:62
@ SPELL_SINSTER_STRIKE_N
Definition: boss_svala.cpp:50
@ SAY_SACRIFICE_PLAYER
Definition: boss_svala.cpp:37
@ SPELL_BALL_OF_FLAME
Definition: boss_svala.cpp:47
@ TALK_INTRO_A2
Definition: boss_svala.cpp:30
@ SPELL_ARTHAS_TRANSFORMING_SVALA
Definition: boss_svala.cpp:41
@ SPELL_RITUAL_STRIKE
Definition: boss_svala.cpp:49
@ TALK_INTRO_S2
Definition: boss_svala.cpp:32
@ SPELL_SVALA_TRANSFORMING1
Definition: boss_svala.cpp:42
@ SPELL_CALL_FLAMES
Definition: boss_svala.cpp:46
@ SPELL_SVALA_TRANSFORMING2
Definition: boss_svala.cpp:43
@ TALK_INTRO_S3
Definition: boss_svala.cpp:33
@ TALK_INTRO_A1
Definition: boss_svala.cpp:29
@ SPELL_SINSTER_STRIKE_H
Definition: boss_svala.cpp:51
const Position RitualChannelerLoc[3]
Definition: boss_svala.cpp:88
@ EVENT_SVALA_TALK6
Definition: boss_svala.cpp:74
@ EVENT_SVALA_TALK4
Definition: boss_svala.cpp:72
@ EVENT_SVALA_TALK8
Definition: boss_svala.cpp:76
@ EVENT_SVALA_TALK3
Definition: boss_svala.cpp:71
@ EVENT_SVALA_TALK5
Definition: boss_svala.cpp:73
@ EVENT_SORROWGRAVE_FINISH_RITUAL
Definition: boss_svala.cpp:85
@ EVENT_SVALA_TALK9
Definition: boss_svala.cpp:77
@ EVENT_SVALA_TALK7
Definition: boss_svala.cpp:75
@ EVENT_SVALA_TALK2
Definition: boss_svala.cpp:70
@ EVENT_SVALA_TALK1
Definition: boss_svala.cpp:69
@ EVENT_SORROWGRAVE_RITUAL_SPELLS
Definition: boss_svala.cpp:84
@ EVENT_SORROWGRAVE_FLAMES2
Definition: boss_svala.cpp:82
@ NPC_SVALA_SORROWGRAVE
Definition: utgarde_pinnacle.h:65
@ NPC_DRAGONFLAYER_SPECTATOR
Definition: utgarde_pinnacle.h:64
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:117
@ SPELL_AURA_PERIODIC_DAMAGE
Definition: SpellAuraDefines.h:66
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
Definition: SpellAuraDefines.h:152
@ CONFIG_CORPSE_DECAY_ELITE
Definition: IWorld.h:302
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
@ UNIT_FIELD_HOVERHEIGHT
Definition: UpdateFields.h:173
@ UNIT_STATE_NO_ENVIRONMENT_UPD
Definition: UnitDefines.h:177
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ SMSG_SPLINE_MOVE_SET_HOVER
Definition: Opcodes.h:805
#define sWorld
Definition: World.h:443
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
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
bool UpdateVictim()
Definition: CreatureAI.cpp:280
bool IsHeroic() const
Definition: ScriptedCreature.h:379
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
void DoTeleportPlayer(Unit *unit, float x, float y, float z, float o)
Definition: ScriptedCreature.cpp:464
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
void LoadEquipment(int8 id=1, bool force=false)
Definition: Creature.cpp:1798
bool UpdateEntry(uint32 entry, const CreatureData *data=nullptr, bool changelevel=true, bool updateAI=false)
Definition: Creature.cpp:539
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:70
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition: Creature.cpp:3191
PackedGuid const & GetPackGUID() const
Definition: Object.h:114
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:737
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition: Object.cpp:2091
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3097
Definition: Player.h:1081
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void AddUnitState(uint32 f)
Definition: Unit.h:700
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void RemoveAllAuras()
Definition: Unit.cpp:5319
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition: Unit.cpp:5110
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:19979
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void MoveIdle()
Definition: MotionMaster.cpp:232
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
The unit will fall. Used when in the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:627
Definition: WorldPacket.h:26

References Unit::AddUnitState(), ArthasGUID, ScriptedAI::AttackStart(), Unit::CastSpell(), CONFIG_CORPSE_DECAY_ELITE, SummonList::DespawnAll(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoTeleportPlayer(), EVENT_SORROWGRAVE_FINISH_RITUAL, EVENT_SORROWGRAVE_FLAMES, EVENT_SORROWGRAVE_FLAMES2, EVENT_SORROWGRAVE_RITUAL, EVENT_SORROWGRAVE_RITUAL_SPELLS, EVENT_SORROWGRAVE_SS, EVENT_SVALA_START, EVENT_SVALA_TALK1, EVENT_SVALA_TALK2, EVENT_SVALA_TALK3, EVENT_SVALA_TALK4, EVENT_SVALA_TALK5, EVENT_SVALA_TALK6, EVENT_SVALA_TALK7, EVENT_SVALA_TALK8, EVENT_SVALA_TALK9, events2, EventMap::ExecuteEvent(), ObjectAccessor::GetCreature(), WorldObject::GetCreaturesWithEntryInRange(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Object::GetPackGUID(), Unit::GetVictim(), GO_STATE_ACTIVE, GO_SVALA_MIRROR, Unit::HasUnitState(), instance, ScriptedAI::IsHeroic(), Creature::LoadEquipment(), ScriptedAI::me, MotionMaster::MoveFall(), MotionMaster::MoveIdle(), Unit::NearTeleportTo(), NPC_DRAGONFLAYER_SPECTATOR, NPC_FLAME_BRAZIER, NPC_RITUAL_CHANNELER, NPC_SVALA_SORROWGRAVE, Unit::RemoveAllAuras(), Unit::RemoveAurasByType(), Unit::RemoveUnitFlag(), RitualChannelerLoc, SAY_SACRIFICE_PLAYER, EventMap::ScheduleEvent(), UnitAI::SelectTarget(), ScriptedAI::SelectTargetFromPlayerList(), WorldObject::SendMessageToSet(), WorldObject::setActive(), Unit::SetControlled(), Creature::SetCorpseDelay(), Unit::SetFacingTo(), Object::SetFloatValue(), Creature::SetHover(), Unit::SetImmuneToAll(), Unit::SetUnitFlag(), Creature::SetWalk(), SMSG_SPLINE_MOVE_SET_HOVER, SPELL_ARTHAS_TRANSFORMING_SVALA, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE_PERCENT, SPELL_BALL_OF_FLAME, SPELL_CALL_FLAMES, SPELL_RITUAL_STRIKE, SPELL_SINSTER_STRIKE_H, SPELL_SINSTER_STRIKE_N, SPELL_SVALA_TRANSFORMING1, SPELL_SVALA_TRANSFORMING2, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), summons, sWorld, TALK_INTRO_A1, TALK_INTRO_A2, TALK_INTRO_S1, TALK_INTRO_S2, TALK_INTRO_S3, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, UNIT_FIELD_HOVERHEIGHT, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, UNIT_STATE_NO_ENVIRONMENT_UPD, UNIT_STATE_ROOT, EventMap::Update(), Creature::UpdateEntry(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ ArthasGUID

ObjectGuid boss_svala::boss_svalaAI::ArthasGUID

Referenced by boss_svalaAI(), SetData(), and UpdateAI().

◆ events

EventMap boss_svala::boss_svalaAI::events

◆ events2

EventMap boss_svala::boss_svalaAI::events2

Referenced by Reset(), SetData(), and UpdateAI().

◆ instance

InstanceScript* boss_svala::boss_svalaAI::instance

◆ Started

bool boss_svala::boss_svalaAI::Started

Referenced by boss_svalaAI(), Reset(), and SetData().

◆ summons

SummonList boss_svala::boss_svalaAI::summons