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.
 
void JustReachedHome () override
 
bool DoTrampleIfValid ()
 
void MovementInform (uint32, 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 (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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.
 
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
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (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 *)
 
virtual void OwnerAttacked (Unit *)
 
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 ()
 
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 InitializeAI ()
 
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:
 
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.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
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)
 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

InstanceScriptpInstance
 
EventMap events
 
ObjectGuid TargetGUID
 
float destX
 
float destY
 
float destZ
 
- 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_icehowlAI()

boss_icehowl::boss_icehowlAI::boss_icehowlAI ( Creature pCreature)
inline
775 : ScriptedAI(pCreature)
776 {
777 pInstance = pCreature->GetInstanceScript();
780 if (IsHeroic())
787 //me->SetLootMode(0); // [LOOT]
788 }
@ SPELL_EFFECT_DISPEL
Definition SharedDefines.h:816
@ IMMUNITY_STATE
Definition SharedDefines.h:1395
@ IMMUNITY_EFFECT
Definition SharedDefines.h:1394
@ 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:373
@ REACT_PASSIVE
Definition Unit.h:548
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:13434
void AddUnitMovementFlag(uint32 f)
Definition Unit.h:743
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
Definition ScriptedCreature.h:190
bool IsHeroic() const
Definition ScriptedCreature.h:379
Creature * me
Definition ScriptedCreature.h:280
InstanceScript * pInstance
Definition boss_northrend_beasts.cpp:790

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.

796 {
799 }
ReactStates GetReactState() const
Definition Creature.h:96
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210

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

◆ DoTrampleIfValid()

bool boss_icehowl::boss_icehowlAI::DoTrampleIfValid ( )
inline
817 {
818 Map::PlayerList const& lPlayers = me->GetMap()->GetPlayers();
819 for( Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr )
820 if (Unit* p = itr->GetSource())
821 if (p->IsAlive() && p->GetExactDist(me) <= 12.0f )
822 {
824 return true;
825 }
826
827 return false;
828 }
@ SPELL_TRAMPLE
Definition boss_northrend_beasts.cpp:742
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:333
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:248
Definition Unit.h:636
Map * GetMap() const
Definition Object.h:536

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.

1004 {
1005 events.Reset();
1007 if (pInstance)
1009 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
events
Definition boss_sartura.cpp:43
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ TYPE_FAILED
Definition trial_of_the_crusader.h:33

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.

1012 {
1013 if (!pInstance)
1014 return;
1015
1017 }
@ DONE
Definition InstanceScript.h:61
@ TYPE_ICEHOWL
Definition trial_of_the_crusader.h:39

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

◆ JustEngagedWith()

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

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

802 {
803 me->setActive(true);
804 events.Reset();
805 events.ScheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 15s, 30s);
806 events.RescheduleEvent(EVENT_SPELL_WHIRL, 10s, 12s);
807 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 14s);
808 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s);
809 }
@ EVENT_SPELL_WHIRL
Definition boss_northrend_beasts.cpp:759
@ EVENT_SPELL_FEROCIOUS_BUTT
Definition boss_northrend_beasts.cpp:757
@ EVENT_SPELL_ARCTIC_BREATH
Definition boss_northrend_beasts.cpp:760
@ EVENT_JUMP_MIDDLE
Definition boss_northrend_beasts.cpp:751
void setActive(bool isActiveObject)
Definition Object.cpp:1094

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.

812 {
813 me->setActive(false);
814 }

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

◆ MovementInform()

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

Reimplemented from CreatureAI.

831 {
832 if (id == EVENT_CHARGE)
833 {
834 events.Reset();
835 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
836 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
837 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
838 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
839
840 float angle = me->GetAngle(&Locs[LOC_CENTER]);
841 angle = angle >= M_PI ? angle - M_PI : angle + M_PI;
842
843 me->UpdatePosition(destX, destY, destZ, angle, true);
845
846 if (!DoTrampleIfValid())
847 {
849 me->CastSpell((Unit*)nullptr, SPELL_TRAMPLE, true);
851 events.DelayEvents(15000);
852 }
853 else
854 {
857 }
858
860 }
861 }
@ EVENT_CHARGE
Definition SharedDefines.h:3311
@ REACT_AGGRESSIVE
Definition Unit.h:550
@ SPELL_FROTHING_RAGE
Definition boss_northrend_beasts.cpp:743
@ SPELL_STAGGERED_DAZE
Definition boss_northrend_beasts.cpp:744
@ EMOTE_TRAMPLE_FAIL
Definition boss_northrend_beasts.cpp:74
@ EMOTE_TRAMPLE_CRASH
Definition boss_northrend_beasts.cpp:73
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:20077
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:1178
void StopMovingOnCurrentPos()
Definition Unit.cpp:16741
Talk
Definition hyjal.cpp:82
float GetAngle(const Position *pos) const
Definition Position.cpp:78
float destZ
Definition boss_northrend_beasts.cpp:793
float destX
Definition boss_northrend_beasts.cpp:793
bool DoTrampleIfValid()
Definition boss_northrend_beasts.cpp:816
float destY
Definition boss_northrend_beasts.cpp:793
const Position Locs[]
Definition trial_of_the_crusader.h:274
@ LOC_CENTER
Definition trial_of_the_crusader.h:304

References Unit::CastSpell(), destX, destY, destZ, DoTrampleIfValid(), EMOTE_TRAMPLE_CRASH, EMOTE_TRAMPLE_FAIL, EVENT_CHARGE, EVENT_JUMP_MIDDLE, EVENT_SPELL_ARCTIC_BREATH, EVENT_SPELL_FEROCIOUS_BUTT, EVENT_SPELL_WHIRL, Position::GetAngle(), LOC_CENTER, Locs, ScriptedAI::me, 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.

864 {
865 if (!UpdateVictim())
866 return;
867
868 events.Update(diff);
869
871 return;
872
873 switch (events.ExecuteEvent())
874 {
875 case 0:
876 break;
878 if (Unit* victim = me->GetVictim())
879 me->CastSpell(victim, SPELL_FEROCIOUS_BUTT, false);
880 events.Repeat(15s, 30s);
881 break;
883 me->CastSpell((Unit*)nullptr, SPELL_WHIRL, false);
884 events.Repeat(15s, 20s);
885 break;
887 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
888 me->CastSpell(target, SPELL_ARCTIC_BREATH, false);
889 events.Repeat(20s, 30s);
890 break;
892 me->StopMoving();
896 me->AttackStop();
897 me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY(), Locs[LOC_CENTER].GetPositionZ(), 40.0f, 12.0f);
899 events.Reset();
900 events.RescheduleEvent(EVENT_SPELL_MASSIVE_CRASH, 2s);
901 break;
904 me->CastSpell((Unit*)nullptr, SPELL_MASSIVE_CRASH, false);
905
906 events.RescheduleEvent(EVENT_GAZE, 2s);
907 break;
908 case EVENT_GAZE:
909 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 500.0f, true))
910 {
911 TargetGUID = target->GetGUID();
913 me->SetFacingToObject(target);
914 Talk(EMOTE_TRAMPLE_STARE, target);
916 events.RescheduleEvent(EVENT_JUMP_BACK, 2s);
917 }
918 else // in case something went wrong
919 {
920 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
921 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
922 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
923 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
926 }
927
928 break;
929 case EVENT_JUMP_BACK:
930 {
931 float angle;
933 angle = me->GetAngle(target);
934 else // in case something went wrong
935 angle = rand_norm() * 2 * M_PI;
936
937 float jumpangle = angle >= M_PI ? angle - M_PI : angle + M_PI;
938 float dist = 50.0f;
939 if (angle > 1.0f && angle < 2.0f) // near main gate
940 dist = 46.0f;
941 destX = Locs[LOC_CENTER].GetPositionX() + cos(angle) * dist;
942 destY = Locs[LOC_CENTER].GetPositionY() + std::sin(angle) * dist;
943 destZ = Locs[LOC_CENTER].GetPositionZ() + 1.0f;
944 me->StopMoving();
945 me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX() + cos(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionY() + std::sin(jumpangle) * 35.0f, Locs[LOC_CENTER].GetPositionZ() + 1.0f, 40.0f, 12.0f);
946
947 events.RescheduleEvent(EVENT_TRAMPLE, 1500ms);
948
949 if (pInstance)
950 switch (GetDifficulty())
951 {
955 break;
959 break;
962 break;
965 break;
966 }
967 }
968 break;
969 case EVENT_TRAMPLE:
970 //Talk(EMOTE_TRAMPLE_START);
971 me->DisableSpline();
973 me->GetMotionMaster()->MoveCharge(destX, destY, destZ + 1.0f, 65.0f);
975 events.RescheduleEvent(EVENT_CHECK_TRAMPLE_PLAYERS, 100ms);
976
977 break;
979 if (DoTrampleIfValid())
980 {
981 events.Reset();
982 events.RescheduleEvent(EVENT_SPELL_FEROCIOUS_BUTT, 5s, 15s);
983 events.RescheduleEvent(EVENT_SPELL_WHIRL, 2s, 5s);
984 events.RescheduleEvent(EVENT_SPELL_ARCTIC_BREATH, 5s, 8s);
985 events.RescheduleEvent(EVENT_JUMP_MIDDLE, 30s, 50s);
990 }
991 // no PopEvent() intended!
992 break;
994 //me->SetFacingTo(me->GetOrientation());
995
996 break;
997 }
998
999 if (me->GetReactState() != REACT_PASSIVE )
1001 }
@ RAID_DIFFICULTY_25MAN_HEROIC
Definition DBCEnums.h:276
@ RAID_DIFFICULTY_10MAN_NORMAL
Definition DBCEnums.h:273
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition DBCEnums.h:274
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition DBCEnums.h:275
double rand_norm()
Definition Random.cpp:77
@ EMOTE_ONESHOT_ROAR
Definition SharedDefines.h:1907
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FIELD_TARGET
Definition UpdateFields.h:92
@ SPELL_MASSIVE_CRASH
Definition boss_northrend_beasts.cpp:740
@ SPELL_FEROCIOUS_BUTT
Definition boss_northrend_beasts.cpp:736
@ SPELL_SURGE_OF_ADRENALINE
Definition boss_northrend_beasts.cpp:746
@ SPELL_ARCTIC_BREATH
Definition boss_northrend_beasts.cpp:738
@ SPELL_WHIRL
Definition boss_northrend_beasts.cpp:737
@ EMOTE_TRAMPLE_STARE
Definition boss_northrend_beasts.cpp:72
@ EVENT_SPELL_MASSIVE_CRASH
Definition boss_northrend_beasts.cpp:758
@ EVENT_CHECK_TRAMPLE_PLAYERS
Definition boss_northrend_beasts.cpp:755
@ EVENT_JUMP_BACK
Definition boss_northrend_beasts.cpp:753
@ EVENT_REFRESH_POSITION
Definition boss_northrend_beasts.cpp:756
@ EVENT_GAZE
Definition boss_northrend_beasts.cpp:752
@ EVENT_TRAMPLE
Definition boss_northrend_beasts.cpp:754
bool UpdateVictim()
Definition CreatureAI.cpp:280
void DoCastSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:694
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:683
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, const Movement::PointsArray *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:670
void MovementExpired(bool reset=true)
Definition MotionMaster.h:180
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition MotionMaster.h:229
void MoveIdle()
Definition MotionMaster.cpp:232
void Clear(bool reset=true)
Definition MotionMaster.h:167
static ObjectGuid const Empty
Definition ObjectGuid.h:120
void SetGuidValue(uint16 index, ObjectGuid value)
Definition Object.cpp:723
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
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:20591
void StopMoving()
Definition Unit.cpp:16702
void DisableSpline()
Definition Unit.cpp:636
Unit * GetVictim() const
Definition Unit.h:862
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2011
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:10448
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition ObjectAccessor.cpp:220
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
Difficulty GetDifficulty() const
Definition ScriptedCreature.h:382
ObjectGuid TargetGUID
Definition boss_northrend_beasts.cpp:792

References Unit::AttackStop(), Unit::CastSpell(), MotionMaster::Clear(), destX, destY, destZ, Unit::DisableSpline(), InstanceScript::DoCastSpellOnPlayers(), UnitAI::DoMeleeAttackIfReady(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), DoTrampleIfValid(), EMOTE_ONESHOT_ROAR, EMOTE_TRAMPLE_FAIL, EMOTE_TRAMPLE_STARE, ObjectGuid::Empty, EVENT_CHECK_TRAMPLE_PLAYERS, EVENT_GAZE, EVENT_JUMP_BACK, EVENT_JUMP_MIDDLE, EVENT_REFRESH_POSITION, EVENT_SPELL_ARCTIC_BREATH, EVENT_SPELL_FEROCIOUS_BUTT, EVENT_SPELL_MASSIVE_CRASH, EVENT_SPELL_WHIRL, EVENT_TRAMPLE, Position::GetAngle(), ScriptedAI::GetDifficulty(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Creature::GetReactState(), Unit::GetVictim(), Unit::HandleEmoteCommand(), Unit::HasUnitState(), LOC_CENTER, Locs, ScriptedAI::me, MotionMaster::MoveCharge(), MotionMaster::MoveIdle(), MotionMaster::MoveJump(), MotionMaster::MovementExpired(), pInstance, RAID_DIFFICULTY_10MAN_HEROIC, RAID_DIFFICULTY_10MAN_NORMAL, RAID_DIFFICULTY_25MAN_HEROIC, RAID_DIFFICULTY_25MAN_NORMAL, rand_norm(), Random, REACT_AGGRESSIVE, REACT_PASSIVE, UnitAI::SelectTarget(), Unit::SetFacingToObject(), Object::SetGuidValue(), Creature::SetReactState(), SPELL_ARCTIC_BREATH, SPELL_FEROCIOUS_BUTT, SPELL_FROTHING_RAGE, SPELL_MASSIVE_CRASH, SPELL_SURGE_OF_ADRENALINE, SPELL_WHIRL, Unit::StopMoving(), TargetGUID, 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

◆ TargetGUID

ObjectGuid boss_icehowl::boss_icehowlAI::TargetGUID

Referenced by UpdateAI().


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