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
 
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
 
void UpdateAI (uint32 diff) override
 
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 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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
 
- 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)
 
 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 EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
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 *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
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
 
bool IsFleeing
 

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 }
@ MOVEMENTFLAG_WALKING
Definition: Unit.h:560
@ REACT_PASSIVE
Definition: Unit.h:1035
@ 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
@ SPELL_EFFECT_DISPEL
Definition: SharedDefines.h:816
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1394
Definition: ScriptedCreature.h:192
bool IsHeroic() const
Definition: ScriptedCreature.h:391
Creature * me
Definition: ScriptedCreature.h:282
void SetReactState(ReactStates st)
Definition: Creature.h:90
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13383
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:2286
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 ScriptedAI.

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

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
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
Map * GetMap() const
Definition: Object.h:517
Definition: Unit.h:1302
PlayerList const & GetPlayers() const
Definition: Map.h:485
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

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: Unit.h:449
events
Definition: boss_sartura.cpp:43
@ TYPE_FAILED
Definition: trial_of_the_crusader.h:34
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

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 ScriptedAI.

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

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 ScriptedAI.

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:1085

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 ScriptedAI.

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 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
@ 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
const Position Locs[]
Definition: trial_of_the_crusader.h:274
@ LOC_CENTER
Definition: trial_of_the_crusader.h:304
Talk
Definition: boss_fathomlord_karathress.cpp:25
@ EVENT_CHARGE
Definition: SharedDefines.h:3311
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20296
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:1169
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16957
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

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  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

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 }
double rand_norm()
Definition: Random.cpp:77
@ UNIT_FIELD_TARGET
Definition: UpdateFields.h:92
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ 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
@ RAID_DIFFICULTY_25MAN_HEROIC
Definition: DBCEnums.h:284
@ RAID_DIFFICULTY_10MAN_NORMAL
Definition: DBCEnums.h:281
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition: DBCEnums.h:282
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition: DBCEnums.h:283
@ EMOTE_ONESHOT_ROAR
Definition: SharedDefines.h:1907
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:268
Difficulty GetDifficulty() const
Definition: ScriptedCreature.h:394
void SetGuidValue(uint16 index, ObjectGuid value)
Definition: Object.cpp:723
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20894
void StopMoving()
Definition: Unit.cpp:16918
void DisableSpline()
Definition: Unit.cpp:655
Unit * GetVictim() const
Definition: Unit.h:1398
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1980
bool AttackStop()
Definition: Unit.cpp:10407
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:649
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:638
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)
Definition: MotionMaster.cpp:628
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition: MotionMaster.h:227
void MoveIdle()
Definition: MotionMaster.cpp:232
void Clear(bool reset=true)
Definition: MotionMaster.h:165
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(), 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().