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 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)
 
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=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
 
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=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)
 
WorldObjectGetSummoner () 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 IsSummonedBy (WorldObject *)
 
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
 
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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
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
 
- 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
 
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
1039 : ScriptedAI(pCreature)
1040 {
1042 _hasDied = false;
1043 }
@ NPC_ANCIENT_WATER_SPIRIT
Definition boss_freya.cpp:198
@ NPC_STORM_LASHER
Definition boss_freya.cpp:197
@ NPC_SNAPLASHER
Definition boss_freya.cpp:199
uint32 GetEntry() const
Definition Object.h:117
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
bool _hasDied
Definition boss_freya.cpp:1046
bool _isTrio
Definition boss_freya.cpp:1047

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

Member Function Documentation

◆ JustDied()

void boss_freya_summons::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1080 {
1081 if (InstanceScript* instance = me->GetInstanceScript())
1082 {
1083 if (Creature* freya = instance->GetCreature(BOSS_FREYA))
1084 {
1085 if (!_hasDied)
1086 {
1087 uint32 doseSpell = 0;
1088 int32 stackAction = 0;
1089 switch (me->GetEntry())
1090 {
1093 stackAction = ACTION_REMOVE_25_STACK;
1094 break;
1096 case NPC_STORM_LASHER:
1097 case NPC_SNAPLASHER:
1099 stackAction = ACTION_REMOVE_10_STACK;
1100 break;
1103 stackAction = ACTION_REMOVE_2_STACK;
1104 break;
1105 }
1106
1107 me->CastSpell(freya, doseSpell, true);
1108 freya->AI()->DoAction(stackAction);
1109 }
1110
1111 if (_isTrio)
1112 {
1113 freya->AI()->DoAction(ACTION_TRIO_MEMBER_DOWN);
1114 _hasDied = true;
1116
1117 // The corpse keeps ticking its events, so each member counts
1118 // down its own revive window instead of sharing one with Freya
1119 me->m_Events.AddEventAtOffset([this]()
1120 {
1122 }, 11s);
1123 }
1124 else
1125 freya->AI()->DoAction(ACTION_ADD_DIED);
1126 }
1127 }
1129 me->CastSpell(me, SPELL_DETONATE, true);
1130 }
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
@ ACTION_TRIO_MEMBER_DOWN
Definition boss_freya.cpp:214
@ ACTION_REMOVE_10_STACK
Definition boss_freya.cpp:211
@ ACTION_REMOVE_2_STACK
Definition boss_freya.cpp:213
@ ACTION_REMOVE_25_STACK
Definition boss_freya.cpp:212
@ ACTION_ADD_DIED
Definition boss_freya.cpp:217
@ NPC_DETONATING_LASHER
Definition boss_freya.cpp:206
@ NPC_ANCIENT_CONSERVATOR
Definition boss_freya.cpp:202
@ EMOTE_TRIO_WITHERS
Definition boss_freya.cpp:184
@ 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
Definition Creature.h:47
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:1361
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1242
EventProcessor m_Events
Definition Object.h:742
Talk
Definition hyjal.cpp:82
void ReviveWithAllies()
Definition boss_freya.cpp:1132
@ BOSS_FREYA
Definition ulduar.h:38

References _hasDied, _isTrio, ACTION_ADD_DIED, ACTION_REMOVE_10_STACK, ACTION_REMOVE_25_STACK, ACTION_REMOVE_2_STACK, ACTION_TRIO_MEMBER_DOWN, EventProcessor::AddEventAtOffset(), BOSS_FREYA, Unit::CastSpell(), 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.

1153 {
1155 {
1157 events.ScheduleEvent(EVENT_ANCIENT_CONSERVATOR_GRIP, 6s);
1159 }
1160 else if (me->GetEntry() == NPC_ANCIENT_WATER_SPIRIT)
1161 events.ScheduleEvent(EVENT_WATER_SPIRIT_CHARGE, 12s);
1162 else if (me->GetEntry() == NPC_STORM_LASHER)
1163 {
1164 events.ScheduleEvent(EVENT_STORM_LASHER_LIGHTNING_LASH, 10s);
1165 events.ScheduleEvent(EVENT_STORM_LASHER_STORMBOLT, 6s);
1166 }
1167 else if (me->GetEntry() == NPC_DETONATING_LASHER)
1168 events.ScheduleEvent(EVENT_DETONATING_LASHER_FLAME_LASH, 10s);
1169 else if (me->GetEntry() == NPC_SNAPLASHER)
1171 }
@ EVENT_STORM_LASHER_STORMBOLT
Definition boss_freya.cpp:158
@ EVENT_ANCIENT_CONSERVATOR_GRIP
Definition boss_freya.cpp:154
@ EVENT_ANCIENT_CONSERVATOR_NATURE_FURY
Definition boss_freya.cpp:153
@ EVENT_WATER_SPIRIT_CHARGE
Definition boss_freya.cpp:155
@ EVENT_STORM_LASHER_LIGHTNING_LASH
Definition boss_freya.cpp:157
@ EVENT_DETONATING_LASHER_FLAME_LASH
Definition boss_freya.cpp:159
@ 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.

1050 {
1051 events.Reset();
1052
1053 // Detonating Lashers spawn submerged in the ground and stay passive for a
1054 // few seconds, then burst out with the emerge/birth animation (driven by
1055 // the SUBMERGED -> STAND stand state change, like XT-002) and only start
1056 // attacking once it has played out, so the jump is not cut short by
1057 // combat movement (see issue #26255). They remain hostile and attackable
1058 // while submerged, matching retail.
1060 {
1062 me->m_Events.AddEventAtOffset([this]()
1063 {
1065 }, 4s);
1066 me->m_Events.AddEventAtOffset([this]()
1067 {
1069 if (Unit* target = SelectTargetFromPlayerList(70))
1070 AttackStart(target);
1071 }, 5s);
1072 return;
1073 }
1074
1075 if (Unit* target = SelectTargetFromPlayerList(70))
1076 AttackStart(target);
1077 }
@ 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:5189
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
1133 {
1134 InstanceScript* instance = me->GetInstanceScript();
1135 if (!instance)
1136 return;
1137
1138 Creature* freya = instance->GetCreature(BOSS_FREYA);
1139 if (!freya)
1140 return;
1141
1142 // A member only comes back while at least one of its allies is still up
1143 if (freya->AI()->GetData(DATA_TRIO_DOWN) >= 3)
1144 return;
1145
1148 Reset();
1150 }
@ ACTION_TRIO_MEMBER_REVIVED
Definition boss_freya.cpp:218
@ DATA_TRIO_DOWN
Definition boss_freya.cpp:225
@ EMOTE_TRIO_REGENERATES
Definition boss_freya.cpp:185
void setDeathState(DeathState s, bool despawn=false) override
A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned....
Definition Creature.cpp:1956
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:1049

References ACTION_TRIO_MEMBER_REVIVED, Creature::AI(), BOSS_FREYA, 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.

1174 {
1175 if (!UpdateVictim())
1176 return;
1177
1178 events.Update(diff);
1180 return;
1181
1182 switch (events.ExecuteEvent())
1183 {
1185 DoCastRandomTarget(SPELL_NATURE_FURY, 0, 100.0f, true, false, true, -SPELL_NATURE_FURY);
1186 events.Repeat(14s);
1187 break;
1190 break;
1194 events.Repeat(12s);
1195 events.ScheduleEvent(EVENT_WATER_SPIRIT_DAMAGE, 3s);
1196 break;
1199 break;
1202 me->CastSpell(target, SPELL_LIGHTNING_LASH, false);
1203 events.Repeat(10s);
1204 break;
1207 events.Repeat(6s);
1208 break;
1212 if (Unit* target = SelectTargetFromPlayerList(80))
1213 AttackStart(target);
1214 else
1215 me->DespawnOrUnsummon(1ms);
1216 events.Repeat(10s);
1217 break;
1218 }
1219
1221 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ EVENT_WATER_SPIRIT_DAMAGE
Definition boss_freya.cpp:156
@ 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
@ SPELL_TIDAL_WAVE_DAMAGE
Definition boss_freya.cpp:99
@ SPELL_TIDAL_WAVE_AURA
Definition boss_freya.cpp:100
bool UpdateVictim()
Definition CreatureAI.cpp:350
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2199
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 ScriptedAI::AttackStart(), Unit::CastSpell(), 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, EVENT_WATER_SPIRIT_DAMAGE, 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, SPELL_TIDAL_WAVE_AURA, SPELL_TIDAL_WAVE_DAMAGE, 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().

◆ events

EventMap boss_freya_summons::events

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