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

Public Member Functions

 boss_icehowlAI (Creature *pCreature)
 
void AttackStart (Unit *who) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustReachedHome () override
 
bool DoTrampleIfValid ()
 
void MovementInform (uint32 type, uint32 id) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason) override
 
void JustDied (Unit *) 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)
 
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
 
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.
 
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

InstanceScript * pInstance
 
EventMap events
 
ObjectGuid StalkerGUID
 
float destX
 
float destY
 
float destZ
 
- 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_icehowlAI()

boss_icehowl::boss_icehowlAI::boss_icehowlAI ( Creature *  pCreature)
inline
1017 : ScriptedAI(pCreature)
1018 {
1019 pInstance = pCreature->GetInstanceScript();
1022 if (IsHeroic())
1028 me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED, true); // judgement of justice
1029 //me->SetLootMode(0); // [LOOT]
1030 }
@ SPELL_EFFECT_DISPEL
Definition SharedDefines.h:804
@ IMMUNITY_STATE
Definition SharedDefines.h:1399
@ IMMUNITY_EFFECT
Definition SharedDefines.h:1398
@ SPELL_AURA_MOD_SPEED_NOT_STACK
Definition SpellAuraDefines.h:234
@ SPELL_AURA_MOD_SPEED_SLOW_ALL
Definition SpellAuraDefines.h:315
@ SPELL_AURA_MOD_SPEED_ALWAYS
Definition SpellAuraDefines.h:192
@ SPELL_AURA_MOD_DECREASE_SPEED
Definition SpellAuraDefines.h:96
@ SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
Definition SpellAuraDefines.h:254
@ MOVEMENTFLAG_WALKING
Definition UnitDefines.h:380
@ REACT_PASSIVE
Definition Unit.h:574
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:10247
void AddUnitMovementFlag(uint32 f)
Definition Unit.h:778
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
Definition ScriptedCreature.h:202
bool IsHeroic() const
Definition ScriptedCreature.h:394
Creature * me
Definition ScriptedCreature.h:292
InstanceScript * pInstance
Definition boss_northrend_beasts.cpp:1032

References Unit::AddUnitMovementFlag(), Unit::ApplySpellImmune(), WorldObject::GetInstanceScript(), IMMUNITY_EFFECT, IMMUNITY_STATE, ScriptedAI::IsHeroic(), ScriptedAI::me, MOVEMENTFLAG_WALKING, pInstance, REACT_PASSIVE, Creature::SetReactState(), SPELL_AURA_MOD_DECREASE_SPEED, SPELL_AURA_MOD_SPEED_ALWAYS, SPELL_AURA_MOD_SPEED_NOT_STACK, SPELL_AURA_MOD_SPEED_SLOW_ALL, SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED, and SPELL_EFFECT_DISPEL.

Member Function Documentation

◆ AttackStart()

void boss_icehowl::boss_icehowlAI::AttackStart ( Unit *  who)
inlineoverridevirtual

Reimplemented from UnitAI.

1038 {
1039 if (me->GetReactState() != REACT_PASSIVE)
1041 }
ReactStates GetReactState() const
Definition Creature.h:100
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References ScriptedAI::AttackStart(), Creature::GetReactState(), ScriptedAI::me, and REACT_PASSIVE.

◆ DoTrampleIfValid()

bool boss_icehowl::boss_icehowlAI::DoTrampleIfValid ( )
inline
1059 {
1060 Map::PlayerList const& lPlayers = me->GetMap()->GetPlayers();
1061 for( Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr )
1062 if (Unit* p = itr->GetSource())
1063 if (p->IsAlive() && p->GetExactDist(me) <= 12.0f )
1064 {
1066 return true;
1067 }
1068
1069 return false;
1070 }
@ SPELL_TRAMPLE
Definition boss_northrend_beasts.cpp:973
Definition LinkedList.h:139
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
PlayerList const & GetPlayers() const
Definition Map.h:335
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:282
Definition Unit.h:670
Map * GetMap() const
Definition Object.h:637

References MapRefMgr::begin(), UnitAI::DoCastAOE(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), ScriptedAI::me, and SPELL_TRAMPLE.

Referenced by MovementInform(), and UpdateAI().

◆ EnterEvadeMode()

void boss_icehowl::boss_icehowlAI::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

1234 {
1235 events.Reset();
1237 if (pInstance)
1239 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
events
Definition boss_sartura.cpp:43
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:754
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ TYPE_FAILED
Definition trial_of_the_crusader.h:44

References ScriptedAI::me, pInstance, ZoneScript::SetData(), Unit::SetUnitFlag(), TYPE_FAILED, and UNIT_FLAG_NON_ATTACKABLE.

◆ JustDied()

void boss_icehowl::boss_icehowlAI::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

1242 {
1243 if (!pInstance)
1244 return;
1245
1247 }
@ DONE
Definition InstanceScript.h:61
@ TYPE_ICEHOWL
Definition trial_of_the_crusader.h:48

References DONE, pInstance, ZoneScript::SetData(), and TYPE_ICEHOWL.

◆ JustEngagedWith()

void boss_icehowl::boss_icehowlAI::JustEngagedWith ( Unit *  )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

1044 {
1045 me->setActive(true);
1046 events.Reset();
1047 events.ScheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 8500ms, 9s);
1048 events.RescheduleEvent(EVENT_SPELL_WHIRL, 16s);
1049 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 17s, 20s);
1050 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 35s);
1051 }
@ EVENT_SPELL_WHIRL
Definition boss_northrend_beasts.cpp:1001
@ EVENT_SPELL_FEROCIOUS_BUTT
Definition boss_northrend_beasts.cpp:999
@ EVENT_SPELL_ARCTIC_BREATH
Definition boss_northrend_beasts.cpp:1002
@ EVENT_JUMP_MIDDLE
Definition boss_northrend_beasts.cpp:992
void setActive(bool isActiveObject)
Definition Object.cpp:1091

References EVENT_JUMP_MIDDLE, EVENT_SPELL_ARCTIC_BREATH, EVENT_SPELL_FEROCIOUS_BUTT, EVENT_SPELL_WHIRL, ScriptedAI::me, and WorldObject::setActive().

◆ JustReachedHome()

void boss_icehowl::boss_icehowlAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

1054 {
1055 me->setActive(false);
1056 }

References ScriptedAI::me, and WorldObject::setActive().

◆ MovementInform()

void boss_icehowl::boss_icehowlAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

1073 {
1074 if (type == EFFECT_MOTION_TYPE && id == POINT_ICEHOWL_MIDDLE)
1075 events.RescheduleEvent(EVENT_SPELL_MASSIVE_CRASH, 900ms);
1076 else if (id == EVENT_CHARGE)
1077 {
1078 events.Reset();
1079 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
1080 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
1081 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
1082 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
1083
1084 float angle = me->GetAngle(&Locs[LOC_CENTER]);
1085 angle = angle >= M_PI ? angle - M_PI : angle + M_PI;
1086
1087 me->UpdatePosition(destX, destY, destZ, angle, true);
1089
1090 if (!DoTrampleIfValid())
1091 {
1093 me->CastSpell((Unit*)nullptr, SPELL_TRAMPLE, true);
1095 events.DelayEvents(15s);
1096 }
1097 else
1098 {
1101 }
1102
1104 }
1105 }
@ EFFECT_MOTION_TYPE
Definition MotionMaster.h:56
@ EVENT_CHARGE
Definition SharedDefines.h:3560
@ REACT_AGGRESSIVE
Definition Unit.h:576
@ POINT_ICEHOWL_MIDDLE
Definition boss_northrend_beasts.cpp:987
@ SPELL_FROTHING_RAGE
Definition boss_northrend_beasts.cpp:974
@ SPELL_STAGGERED_DAZE
Definition boss_northrend_beasts.cpp:975
@ EMOTE_TRAMPLE_FAIL
Definition boss_northrend_beasts.cpp:82
@ EMOTE_TRAMPLE_CRASH
Definition boss_northrend_beasts.cpp:81
@ EVENT_SPELL_MASSIVE_CRASH
Definition boss_northrend_beasts.cpp:1000
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:15696
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:1378
void StopMovingOnCurrentPos()
Definition Unit.cpp:12748
Talk
Definition hyjal.cpp:82
float GetAngle(Position const *pos) const
Definition Position.cpp:85
float destZ
Definition boss_northrend_beasts.cpp:1035
float destX
Definition boss_northrend_beasts.cpp:1035
bool DoTrampleIfValid()
Definition boss_northrend_beasts.cpp:1058
float destY
Definition boss_northrend_beasts.cpp:1035
@ LOC_CENTER
Definition trial_of_the_crusader.h:353
Position const Locs[]
Definition trial_of_the_crusader.h:320

References Unit::CastSpell(), destX, destY, destZ, DoTrampleIfValid(), EFFECT_MOTION_TYPE, EMOTE_TRAMPLE_CRASH, EMOTE_TRAMPLE_FAIL, EVENT_CHARGE, EVENT_JUMP_MIDDLE, EVENT_SPELL_ARCTIC_BREATH, EVENT_SPELL_FEROCIOUS_BUTT, EVENT_SPELL_MASSIVE_CRASH, EVENT_SPELL_WHIRL, Position::GetAngle(), LOC_CENTER, Locs, ScriptedAI::me, POINT_ICEHOWL_MIDDLE, REACT_AGGRESSIVE, Creature::SetReactState(), SPELL_FROTHING_RAGE, SPELL_STAGGERED_DAZE, SPELL_TRAMPLE, Unit::StopMovingOnCurrentPos(), and Unit::UpdatePosition().

◆ UpdateAI()

void boss_icehowl::boss_icehowlAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

1108 {
1109 if (!UpdateVictim())
1110 return;
1111
1112 events.Update(diff);
1113
1115 return;
1116
1117 switch (events.ExecuteEvent())
1118 {
1119 case 0:
1120 break;
1122 if (Unit* victim = me->GetVictim())
1123 me->CastSpell(victim, SPELL_FEROCIOUS_BUTT, false);
1124 events.Repeat(14s, 17s);
1125 break;
1126 case EVENT_SPELL_WHIRL:
1127 me->CastSpell((Unit*)nullptr, SPELL_WHIRL, false);
1128 events.Repeat(16s);
1129 break;
1131 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
1132 DoCast(target, SPELL_ARCTIC_BREATH);
1133 events.Repeat(20s, 30s);
1134 break;
1135 case EVENT_JUMP_MIDDLE:
1136 me->StopMoving();
1137 me->GetMotionMaster()->Clear();
1140 me->AttackStop();
1141 events.Reset();
1142 me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY(), Locs[LOC_CENTER].GetPositionZ(), 40.0f, 12.0f, POINT_ICEHOWL_MIDDLE);
1144 break;
1146 me->GetMotionMaster()->Clear();
1147 me->CastSpell((Unit*)nullptr, SPELL_MASSIVE_CRASH, false);
1148
1149 events.RescheduleEvent(EVENT_GAZE, 3900ms);
1150 break;
1151 case EVENT_GAZE:
1152 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true))
1153 {
1154 me->SetGuidValue(UNIT_FIELD_TARGET, target->GetGUID());
1155 Talk(EMOTE_TRAMPLE_STARE, target);
1156
1157 // The charge runs through the glared position and on into the arena wall
1158 float angle = Locs[LOC_CENTER].GetAngle(target);
1159 float dist = 50.0f;
1160 if (angle > 1.0f && angle < 2.0f) // near main gate
1161 dist = 46.0f;
1162 destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
1163 destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
1164 destZ = Locs[LOC_CENTER].GetPositionZ() + 1.0f;
1165
1167 {
1168 StalkerGUID = stalker->GetGUID();
1169 me->SetFacingToObject(stalker);
1170 }
1171
1172 events.RescheduleEvent(EVENT_ROAR, 1800ms);
1173 }
1174 else // in case something went wrong
1175 {
1176 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
1177 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
1178 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
1179 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
1182 }
1183
1184 break;
1185 case EVENT_ROAR:
1187 DoCast(stalker, SPELL_ROAR);
1188 events.RescheduleEvent(EVENT_JUMP_BACK, 2800ms);
1189 break;
1190 case EVENT_JUMP_BACK:
1192 {
1193 me->SetFacingToObject(stalker);
1194 DoCast(stalker, SPELL_JUMP_BACK);
1195 }
1196 events.RescheduleEvent(EVENT_TRAMPLE, 2s);
1197 break;
1198 case EVENT_TRAMPLE:
1199 //Talk(EMOTE_TRAMPLE_START);
1200 me->DisableSpline();
1201 me->GetMotionMaster()->Clear();
1202 me->GetMotionMaster()->MoveCharge(destX, destY, destZ + 1.0f, 65.0f);
1204 events.RescheduleEvent(EVENT_CHECK_TRAMPLE_PLAYERS, 100ms);
1205
1206 break;
1208 if (DoTrampleIfValid())
1209 {
1210 events.Reset();
1211 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
1212 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
1213 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
1214 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
1219 }
1220 else
1221 events.Repeat(100ms);
1222 break;
1224 //me->SetFacingTo(me->GetOrientation());
1225
1226 break;
1227 }
1228
1229 if (me->GetReactState() != REACT_PASSIVE )
1231 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:52
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ UNIT_FIELD_TARGET
Definition UpdateFields.h:92
@ SPELL_MASSIVE_CRASH
Definition boss_northrend_beasts.cpp:970
@ SPELL_FEROCIOUS_BUTT
Definition boss_northrend_beasts.cpp:966
@ SPELL_ROAR
Definition boss_northrend_beasts.cpp:971
@ SPELL_JUMP_BACK
Definition boss_northrend_beasts.cpp:972
@ SPELL_ARCTIC_BREATH
Definition boss_northrend_beasts.cpp:968
@ SPELL_WHIRL
Definition boss_northrend_beasts.cpp:967
@ EMOTE_TRAMPLE_STARE
Definition boss_northrend_beasts.cpp:80
@ NPC_FURIOUS_CHARGE_STALKER
Definition boss_northrend_beasts.cpp:982
@ EVENT_CHECK_TRAMPLE_PLAYERS
Definition boss_northrend_beasts.cpp:997
@ EVENT_JUMP_BACK
Definition boss_northrend_beasts.cpp:995
@ EVENT_ROAR
Definition boss_northrend_beasts.cpp:994
@ EVENT_REFRESH_POSITION
Definition boss_northrend_beasts.cpp:998
@ EVENT_GAZE
Definition boss_northrend_beasts.cpp:993
@ EVENT_TRAMPLE
Definition boss_northrend_beasts.cpp:996
bool UpdateVictim()
Definition CreatureAI.cpp:350
Definition Creature.h:47
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, Movement::PointsArray const *path=nullptr, bool generatePath=false, float orientation=0.0f, ObjectGuid targetGUID=ObjectGuid::Empty)
The unit will charge the target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:825
void MovementExpired(bool reset=true)
Definition MotionMaster.h:207
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition MotionMaster.h:257
void MoveIdle()
Definition MotionMaster.cpp:235
void Clear(bool reset=true)
Definition MotionMaster.h:194
static ObjectGuid const Empty
Definition ObjectGuid.h:123
void SetGuidValue(uint16 index, ObjectGuid value)
Definition Object.cpp:721
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:108
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:175
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16167
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
void StopMoving()
Definition Unit.cpp:12709
void DisableSpline()
Definition Unit.cpp:763
Unit * GetVictim() const
Definition Unit.h:910
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7270
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2460
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
ObjectGuid StalkerGUID
Definition boss_northrend_beasts.cpp:1034

References Unit::AttackStop(), Unit::CastSpell(), MotionMaster::Clear(), destX, destY, destZ, Unit::DisableSpline(), UnitAI::DoCast(), UnitAI::DoMeleeAttackIfReady(), DoTrampleIfValid(), EMOTE_TRAMPLE_FAIL, EMOTE_TRAMPLE_STARE, ObjectGuid::Empty, EVENT_CHECK_TRAMPLE_PLAYERS, EVENT_GAZE, EVENT_JUMP_BACK, EVENT_JUMP_MIDDLE, EVENT_REFRESH_POSITION, EVENT_ROAR, EVENT_SPELL_ARCTIC_BREATH, EVENT_SPELL_FEROCIOUS_BUTT, EVENT_SPELL_MASSIVE_CRASH, EVENT_SPELL_WHIRL, EVENT_TRAMPLE, Position::GetAngle(), ObjectAccessor::GetCreature(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Creature::GetReactState(), Unit::GetVictim(), Unit::HasUnitState(), LOC_CENTER, Locs, ScriptedAI::me, MotionMaster::MoveCharge(), MotionMaster::MoveIdle(), MotionMaster::MoveJump(), MotionMaster::MovementExpired(), NPC_FURIOUS_CHARGE_STALKER, POINT_ICEHOWL_MIDDLE, Random, REACT_AGGRESSIVE, REACT_PASSIVE, UnitAI::SelectTarget(), Unit::SetFacingToObject(), Object::SetGuidValue(), Creature::SetReactState(), SPELL_ARCTIC_BREATH, SPELL_FEROCIOUS_BUTT, SPELL_FROTHING_RAGE, SPELL_JUMP_BACK, SPELL_MASSIVE_CRASH, SPELL_ROAR, SPELL_WHIRL, StalkerGUID, Unit::StopMoving(), WorldObject::SummonCreature(), TEMPSUMMON_TIMED_DESPAWN, UNIT_FIELD_TARGET, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ destX

float boss_icehowl::boss_icehowlAI::destX

Referenced by MovementInform(), and UpdateAI().

◆ destY

float boss_icehowl::boss_icehowlAI::destY

Referenced by MovementInform(), and UpdateAI().

◆ destZ

float boss_icehowl::boss_icehowlAI::destZ

Referenced by MovementInform(), and UpdateAI().

◆ events

EventMap boss_icehowl::boss_icehowlAI::events

◆ pInstance

InstanceScript* boss_icehowl::boss_icehowlAI::pInstance

◆ StalkerGUID

ObjectGuid boss_icehowl::boss_icehowlAI::StalkerGUID

Referenced by UpdateAI().


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