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

Public Member Functions

 boss_freya_summons (Creature *pCreature)
 
void IsSummonedBy (WorldObject *summoner) override
 
void Reset () override
 
void JustDied (Unit *) override
 
void ReviveWithAllies ()
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- 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)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
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.
 
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.
 
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

EventMap events
 
bool _hasDied
 
bool _isTrio
 
uint8 _setId
 
- Public Attributes inherited from ScriptedAI
Creature * me
 

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 AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_freya_summons()

boss_freya_summons::boss_freya_summons ( Creature *  pCreature)
inline
1058 : ScriptedAI(pCreature)
1059 {
1061 _hasDied = false;
1062 _setId = 0;
1063 }
@ NPC_ANCIENT_WATER_SPIRIT
Definition boss_freya.cpp:195
@ NPC_STORM_LASHER
Definition boss_freya.cpp:194
@ NPC_SNAPLASHER
Definition boss_freya.cpp:196
uint32 GetEntry() const
Definition Object.h:123
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
bool _hasDied
Definition boss_freya.cpp:1066
uint8 _setId
Definition boss_freya.cpp:1068
bool _isTrio
Definition boss_freya.cpp:1067

References _hasDied, _isTrio, _setId, Object::GetEntry(), ScriptedAI::me, NPC_ANCIENT_WATER_SPIRIT, NPC_SNAPLASHER, and NPC_STORM_LASHER.

Member Function Documentation

◆ IsSummonedBy()

void boss_freya_summons::IsSummonedBy ( WorldObject *  summoner)
inlineoverridevirtual

Reimplemented from CreatureAI.

1071 {
1072 if (Creature* freya = summoner->ToCreature())
1073 {
1074 if (freya->GetEntry() == NPC_FREYA)
1075 _setId = freya->AI()->GetData(DATA_CURRENT_SET_ID);
1076 }
1077 }
@ NPC_FREYA
Definition ScriptedCreature.cpp:588
@ DATA_CURRENT_SET_ID
Definition boss_freya.cpp:225
Definition Creature.h:47
Creature * ToCreature()
Definition Object.h:212

References _setId, DATA_CURRENT_SET_ID, NPC_FREYA, and Object::ToCreature().

◆ JustDied()

void boss_freya_summons::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

1110 {
1111 if (InstanceScript* instance = me->GetInstanceScript())
1112 {
1113 if (Creature* freya = instance->GetCreature(BOSS_FREYA))
1114 {
1115 bool const isCurrentSet = _setId == freya->AI()->GetData(DATA_CURRENT_SET_ID);
1116
1117 if (!_hasDied)
1118 {
1119 uint32 doseSpell = 0;
1120 int32 stackAction = 0;
1121 switch (me->GetEntry())
1122 {
1125 stackAction = ACTION_REMOVE_25_STACK;
1126 break;
1128 case NPC_STORM_LASHER:
1129 case NPC_SNAPLASHER:
1131 stackAction = ACTION_REMOVE_10_STACK;
1132 break;
1135 stackAction = ACTION_REMOVE_2_STACK;
1136 break;
1137 }
1138
1139 me->CastSpell(freya, doseSpell, true);
1140 freya->AI()->DoAction(stackAction);
1141 }
1142
1143 if (_isTrio)
1144 {
1145 freya->AI()->DoAction(ACTION_TRIO_MEMBER_DOWN);
1146 if (isCurrentSet)
1147 freya->AI()->DoAction(ACTION_TRIO_MEMBER_DOWN_CURRENT);
1148 _hasDied = true;
1150
1151 // The corpse keeps ticking its events, so each member counts
1152 // down its own revive window instead of sharing one with Freya
1153 me->m_Events.AddEventAtOffset([this]()
1154 {
1156 }, 11s);
1157 }
1158 else if (isCurrentSet)
1159 freya->AI()->DoAction(ACTION_ADD_DIED);
1160 }
1161 }
1163 me->CastSpell(me, SPELL_DETONATE, true);
1164 }
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
@ ACTION_TRIO_MEMBER_DOWN
Definition boss_freya.cpp:211
@ ACTION_TRIO_MEMBER_DOWN_CURRENT
Definition boss_freya.cpp:213
@ ACTION_REMOVE_10_STACK
Definition boss_freya.cpp:208
@ ACTION_REMOVE_2_STACK
Definition boss_freya.cpp:210
@ ACTION_REMOVE_25_STACK
Definition boss_freya.cpp:209
@ ACTION_ADD_DIED
Definition boss_freya.cpp:216
@ NPC_DETONATING_LASHER
Definition boss_freya.cpp:203
@ NPC_ANCIENT_CONSERVATOR
Definition boss_freya.cpp:199
@ EMOTE_TRIO_WITHERS
Definition boss_freya.cpp:182
@ SPELL_DETONATE
Definition boss_freya.cpp:114
@ SPELL_ATTUNED_TO_NATURE_2_DOSE
Definition boss_freya.cpp:39
@ SPELL_ATTUNED_TO_NATURE_25_DOSE
Definition boss_freya.cpp:41
@ SPELL_ATTUNED_TO_NATURE_10_DOSE
Definition boss_freya.cpp:40
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, uint8 eventGroup=0)
Definition EventProcessor.h:108
Definition InstanceScript.h:143
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:1372
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
EventProcessor m_Events
Definition Object.h:749
Talk
Definition hyjal.cpp:82
void ReviveWithAllies()
Definition boss_freya.cpp:1166
@ BOSS_FREYA
Definition ulduar.h:38

References _hasDied, _isTrio, _setId, ACTION_ADD_DIED, ACTION_REMOVE_10_STACK, ACTION_REMOVE_25_STACK, ACTION_REMOVE_2_STACK, ACTION_TRIO_MEMBER_DOWN, ACTION_TRIO_MEMBER_DOWN_CURRENT, EventProcessor::AddEventAtOffset(), BOSS_FREYA, Unit::CastSpell(), DATA_CURRENT_SET_ID, EMOTE_TRIO_WITHERS, Object::GetEntry(), WorldObject::GetInstanceScript(), WorldObject::m_Events, ScriptedAI::me, NPC_ANCIENT_CONSERVATOR, NPC_ANCIENT_WATER_SPIRIT, NPC_DETONATING_LASHER, NPC_SNAPLASHER, NPC_STORM_LASHER, ReviveWithAllies(), SPELL_ATTUNED_TO_NATURE_10_DOSE, SPELL_ATTUNED_TO_NATURE_25_DOSE, SPELL_ATTUNED_TO_NATURE_2_DOSE, and SPELL_DETONATE.

◆ JustEngagedWith()

void boss_freya_summons::JustEngagedWith ( Unit *  )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

1189 {
1191 {
1193 events.ScheduleEvent(EVENT_ANCIENT_CONSERVATOR_GRIP, 6s);
1195 }
1196 else if (me->GetEntry() == NPC_ANCIENT_WATER_SPIRIT)
1197 events.ScheduleEvent(EVENT_WATER_SPIRIT_CHARGE, 12s);
1198 else if (me->GetEntry() == NPC_STORM_LASHER)
1199 {
1200 events.ScheduleEvent(EVENT_STORM_LASHER_LIGHTNING_LASH, 10s);
1201 events.ScheduleEvent(EVENT_STORM_LASHER_STORMBOLT, 6s);
1202 }
1203 else if (me->GetEntry() == NPC_DETONATING_LASHER)
1204 events.ScheduleEvent(EVENT_DETONATING_LASHER_FLAME_LASH, 10s);
1205 else if (me->GetEntry() == NPC_SNAPLASHER)
1207 }
@ EVENT_STORM_LASHER_STORMBOLT
Definition boss_freya.cpp:156
@ EVENT_ANCIENT_CONSERVATOR_GRIP
Definition boss_freya.cpp:153
@ EVENT_ANCIENT_CONSERVATOR_NATURE_FURY
Definition boss_freya.cpp:152
@ EVENT_WATER_SPIRIT_CHARGE
Definition boss_freya.cpp:154
@ EVENT_STORM_LASHER_LIGHTNING_LASH
Definition boss_freya.cpp:155
@ EVENT_DETONATING_LASHER_FLAME_LASH
Definition boss_freya.cpp:157
@ SPELL_HEALTHY_SPORE_SUMMON
Definition boss_freya.cpp:111
@ SPELL_HARDENED_BARK
Definition boss_freya.cpp:95
events
Definition boss_sartura.cpp:43

References Unit::CastSpell(), EVENT_ANCIENT_CONSERVATOR_GRIP, EVENT_ANCIENT_CONSERVATOR_NATURE_FURY, EVENT_DETONATING_LASHER_FLAME_LASH, EVENT_STORM_LASHER_LIGHTNING_LASH, EVENT_STORM_LASHER_STORMBOLT, EVENT_WATER_SPIRIT_CHARGE, Object::GetEntry(), ScriptedAI::me, NPC_ANCIENT_CONSERVATOR, NPC_ANCIENT_WATER_SPIRIT, NPC_DETONATING_LASHER, NPC_SNAPLASHER, NPC_STORM_LASHER, SPELL_HARDENED_BARK, and SPELL_HEALTHY_SPORE_SUMMON.

◆ Reset()

void boss_freya_summons::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

1080 {
1081 events.Reset();
1082
1083 // Detonating Lashers spawn submerged in the ground and stay passive for a
1084 // few seconds, then burst out with the emerge/birth animation (driven by
1085 // the SUBMERGED -> STAND stand state change, like XT-002) and only start
1086 // attacking once it has played out, so the jump is not cut short by
1087 // combat movement (see issue #26255). They remain hostile and attackable
1088 // while submerged, matching retail.
1090 {
1092 me->m_Events.AddEventAtOffset([this]()
1093 {
1095 }, 4s);
1096 me->m_Events.AddEventAtOffset([this]()
1097 {
1099 if (Unit* target = SelectTargetFromPlayerList(70))
1100 AttackStart(target);
1101 }, 5s);
1102 return;
1103 }
1104
1105 if (Unit* target = SelectTargetFromPlayerList(70))
1106 AttackStart(target);
1107 }
@ REACT_PASSIVE
Definition Unit.h:567
@ REACT_AGGRESSIVE
Definition Unit.h:569
@ SPELL_SUBMERGE_VISUAL
Definition boss_freya.cpp:116
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
Definition Unit.h:665
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4936
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591

References EventProcessor::AddEventAtOffset(), ScriptedAI::AttackStart(), Object::GetEntry(), WorldObject::m_Events, ScriptedAI::me, NPC_DETONATING_LASHER, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAurasDueToSpell(), ScriptedAI::SelectTargetFromPlayerList(), Creature::SetReactState(), and SPELL_SUBMERGE_VISUAL.

Referenced by ReviveWithAllies().

◆ ReviveWithAllies()

void boss_freya_summons::ReviveWithAllies ( )
inline
1167 {
1168 InstanceScript* instance = me->GetInstanceScript();
1169 if (!instance)
1170 return;
1171
1172 Creature* freya = instance->GetCreature(BOSS_FREYA);
1173 if (!freya)
1174 return;
1175
1176 // A member only comes back while at least one of its allies is still up
1177 if (freya->AI()->GetData(DATA_TRIO_DOWN) >= 3)
1178 return;
1179
1182 Reset();
1184 if (_setId == freya->AI()->GetData(DATA_CURRENT_SET_ID))
1186 }
@ ACTION_TRIO_MEMBER_REVIVED_CURRENT
Definition boss_freya.cpp:214
@ ACTION_TRIO_MEMBER_REVIVED
Definition boss_freya.cpp:217
@ DATA_TRIO_DOWN
Definition boss_freya.cpp:224
@ EMOTE_TRIO_REGENERATES
Definition boss_freya.cpp:183
void setDeathState(DeathState s, bool despawn=false) override
A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned....
Definition Creature.cpp:1973
CreatureAI * AI() const
Definition Creature.h:144
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
virtual void DoAction(int32)
Definition UnitAI.h:217
virtual uint32 GetData(uint32) const
Definition UnitAI.h:218
void Reset() override
Definition boss_freya.cpp:1079

References _setId, ACTION_TRIO_MEMBER_REVIVED, ACTION_TRIO_MEMBER_REVIVED_CURRENT, Creature::AI(), BOSS_FREYA, DATA_CURRENT_SET_ID, DATA_TRIO_DOWN, UnitAI::DoAction(), EMOTE_TRIO_REGENERATES, InstanceScript::GetCreature(), UnitAI::GetData(), WorldObject::GetInstanceScript(), JustRespawned, ScriptedAI::me, Reset(), and Creature::setDeathState().

Referenced by JustDied().

◆ UpdateAI()

void boss_freya_summons::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

1210 {
1211 if (!UpdateVictim())
1212 return;
1213
1214 events.Update(diff);
1216 return;
1217
1218 switch (events.ExecuteEvent())
1219 {
1221 DoCastRandomTarget(SPELL_NATURE_FURY, 0, 100.0f, true, false, true, -SPELL_NATURE_FURY);
1222 events.Repeat(14s);
1223 break;
1226 break;
1229 events.Repeat(12s);
1230 break;
1233 me->CastSpell(target, SPELL_LIGHTNING_LASH, false);
1234 events.Repeat(10s);
1235 break;
1238 events.Repeat(6s);
1239 break;
1243 if (Unit* target = SelectTargetFromPlayerList(80))
1244 AttackStart(target);
1245 else
1246 {
1247 // Despawning still counts the add as cleared so the set's wave can accelerate
1248 if (InstanceScript* instance = me->GetInstanceScript())
1249 if (Creature* freya = instance->GetCreature(BOSS_FREYA))
1250 if (_setId == freya->AI()->GetData(DATA_CURRENT_SET_ID))
1251 freya->AI()->DoAction(ACTION_ADD_DIED);
1252 me->DespawnOrUnsummon(1ms);
1253 }
1254 events.Repeat(10s);
1255 break;
1256 }
1257
1259 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_LIGHTNING_LASH
Definition boss_freya.cpp:103
@ SPELL_STORMBOLT
Definition boss_freya.cpp:104
@ SPELL_NATURE_FURY
Definition boss_freya.cpp:108
@ SPELL_TIDAL_WAVE
Definition boss_freya.cpp:98
@ SPELL_FLAME_LASH
Definition boss_freya.cpp:115
@ SPELL_CONSERVATOR_GRIP
Definition boss_freya.cpp:107
bool UpdateVictim()
Definition CreatureAI.cpp:350
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2216
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
Cast the spell on a random unit from the threat list.
Definition UnitAI.cpp:301
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
Unit * GetVictim() const
Definition Unit.h:904
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
void DoResetThreatList()
Definition ScriptedCreature.cpp:473

References _setId, ACTION_ADD_DIED, ScriptedAI::AttackStart(), BOSS_FREYA, Unit::CastSpell(), DATA_CURRENT_SET_ID, Creature::DespawnOrUnsummon(), UnitAI::DoCastRandomTarget(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoResetThreatList(), EVENT_ANCIENT_CONSERVATOR_GRIP, EVENT_ANCIENT_CONSERVATOR_NATURE_FURY, EVENT_DETONATING_LASHER_FLAME_LASH, EVENT_STORM_LASHER_LIGHTNING_LASH, EVENT_STORM_LASHER_STORMBOLT, EVENT_WATER_SPIRIT_CHARGE, WorldObject::GetInstanceScript(), Unit::GetVictim(), Unit::HasUnitState(), ScriptedAI::me, Random, UnitAI::SelectTarget(), ScriptedAI::SelectTargetFromPlayerList(), SPELL_CONSERVATOR_GRIP, SPELL_FLAME_LASH, SPELL_LIGHTNING_LASH, SPELL_NATURE_FURY, SPELL_STORMBOLT, SPELL_TIDAL_WAVE, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _hasDied

bool boss_freya_summons::_hasDied

Referenced by boss_freya_summons(), and JustDied().

◆ _isTrio

bool boss_freya_summons::_isTrio

Referenced by boss_freya_summons(), and JustDied().

◆ _setId

uint8 boss_freya_summons::_setId

◆ events

EventMap boss_freya_summons::events

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