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

Public Member Functions

 boss_bjarngrim (Creature *creature)
 
void InitializeWaypoints ()
 
void JustRespawned () override
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void KilledUnit (Unit *victim) override
 
void JustDied (Unit *) override
 
void RemoveStanceAura (uint8 stance)
 
void RollStance (uint8 stance, uint8 force=0)
 
void WaypointReached (uint32 Point) override
 
void UpdateEscortAI (uint32 diff) override
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
bool IsEscortNPC (bool=true) const override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
virtual void WaypointReached (uint32, uint32)
 
- 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 ()
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
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 void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

InstanceScript * m_pInstance
 
EventMap events
 
SummonList summons
 
uint8 m_uiStance
 

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 ()
 
- Public Attributes inherited from ScriptedAI
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
Player * GetPlayerForEscort ()
 
- 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)
 
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_bjarngrim()

boss_bjarngrim::boss_bjarngrim ( Creature *  creature)
inline
113 : npc_escortAI(creature), summons(creature), m_uiStance(STANCE_BATTLE)
114 {
115 m_pInstance = creature->GetInstanceScript();
117 me->SetWalk(true);
118 Start(true, ObjectGuid::Empty, nullptr, false, true);
119 }
@ STANCE_BATTLE
Definition boss_bjarngrim.cpp:60
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3393
static ObjectGuid const Empty
Definition ObjectGuid.h:123
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
Creature * me
Definition ScriptedCreature.h:281
void InitializeWaypoints()
Definition boss_bjarngrim.cpp:121
SummonList summons
Definition boss_bjarngrim.cpp:400
InstanceScript * m_pInstance
Definition boss_bjarngrim.cpp:398
uint8 m_uiStance
Definition boss_bjarngrim.cpp:401
Definition ScriptedEscortAI.h:53
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition ScriptedEscortAI.cpp:428

References ObjectGuid::Empty, WorldObject::GetInstanceScript(), InitializeWaypoints(), m_pInstance, ScriptedAI::me, Creature::SetWalk(), and npc_escortAI::Start().

Member Function Documentation

◆ InitializeWaypoints()

void boss_bjarngrim::InitializeWaypoints ( )
inline
122 {
123 AddWaypoint(1, 1262.0f, -26.9f, 33.5f, 10000);
124 AddWaypoint(2, 1262.18f, 99.3f, 33.5f, 10000);
125 AddWaypoint(3, 1262.0f, -26.9f, 33.5f, 0);
126 AddWaypoint(4, 1332.0f, -26.6f, 40.18f, 10000);
127 AddWaypoint(5, 1395.092f, 36.6425f, 50.038f, 10000);
128 AddWaypoint(6, 1332.0f, -26.6f, 40.18f, 0);
129 AddWaypoint(7, 1262.0f, -26.9f, 33.5f, 0);
130 }
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition ScriptedEscortAI.cpp:395

References npc_escortAI::AddWaypoint().

Referenced by boss_bjarngrim().

◆ JustDied()

void boss_bjarngrim::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

202 {
204
205 if (m_pInstance)
207 }
@ DONE
Definition InstanceScript.h:61
@ SAY_DEATH
Definition boss_bjarngrim.cpp:105
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
@ DATA_BJARNGRIM
Definition halls_of_lightning.h:29
Talk
Definition hyjal.cpp:82

References DATA_BJARNGRIM, DONE, m_pInstance, SAY_DEATH, and InstanceScript::SetBossState().

◆ JustEngagedWith()

void boss_bjarngrim::JustEngagedWith ( Unit *  )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

163 {
166
168
169 events.ScheduleEvent(EVENT_BJARNGRIM_CHANGE_STANCE, 20s, 0);
170
171 // DEFENSIVE STANCE
173 events.ScheduleEvent(EVENT_BJARNGRIM_KNOCK, 16s, STANCE_DEFENSIVE);
175
176 // BERSERKER STANCE
180
181 // BATTLE STANCE
182 events.ScheduleEvent(EVENT_BJARNGRIM_PUMMEL, 5s, STANCE_BATTLE);
184 events.ScheduleEvent(EVENT_BJARNGRIM_SLAM, 30s, STANCE_BATTLE);
185
186 if (m_pInstance)
187 {
190 }
191 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ SAY_AGGRO
Definition boss_bjarngrim.cpp:100
@ STANCE_BERSERKER
Definition boss_bjarngrim.cpp:59
@ STANCE_DEFENSIVE
Definition boss_bjarngrim.cpp:58
@ EVENT_BJARNGRIM_REFLECTION
Definition boss_bjarngrim.cpp:76
@ EVENT_BJARNGRIM_KNOCK
Definition boss_bjarngrim.cpp:78
@ EVENT_BJARNGRIM_PUMMEL
Definition boss_bjarngrim.cpp:77
@ EVENT_BJARNGRIM_CLEAVE
Definition boss_bjarngrim.cpp:87
@ EVENT_BJARNGRIM_SLAM
Definition boss_bjarngrim.cpp:88
@ EVENT_BJARNGRIM_CHANGE_STANCE
Definition boss_bjarngrim.cpp:73
@ EVENT_BJARNGRIM_INTERCEPT
Definition boss_bjarngrim.cpp:86
@ EVENT_BJARNGRIM_IRONFORM
Definition boss_bjarngrim.cpp:79
@ EVENT_BJARNGRIM_MORTAL_STRIKE
Definition boss_bjarngrim.cpp:82
@ EVENT_BJARNGRIM_WHIRLWIND
Definition boss_bjarngrim.cpp:83
@ SPELL_TEMPORARY_ELECTRICAL_CHARGE
Definition boss_bjarngrim.cpp:48
events
Definition boss_sartura.cpp:43
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2882
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5764
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ DATA_BJARNGRIM_ACHIEVEMENT
Definition halls_of_lightning.h:42
void RollStance(uint8 stance, uint8 force=0)
Definition boss_bjarngrim.cpp:228

References DATA_BJARNGRIM, DATA_BJARNGRIM_ACHIEVEMENT, EVENT_BJARNGRIM_CHANGE_STANCE, EVENT_BJARNGRIM_CLEAVE, EVENT_BJARNGRIM_INTERCEPT, EVENT_BJARNGRIM_IRONFORM, EVENT_BJARNGRIM_KNOCK, EVENT_BJARNGRIM_MORTAL_STRIKE, EVENT_BJARNGRIM_PUMMEL, EVENT_BJARNGRIM_REFLECTION, EVENT_BJARNGRIM_SLAM, EVENT_BJARNGRIM_WHIRLWIND, Unit::HasAura(), IN_PROGRESS, m_pInstance, ScriptedAI::me, RollStance(), SAY_AGGRO, InstanceScript::SetBossState(), ZoneScript::SetData(), Creature::SetInCombatWithZone(), SPELL_TEMPORARY_ELECTRICAL_CHARGE, STANCE_BATTLE, STANCE_BERSERKER, and STANCE_DEFENSIVE.

◆ JustRespawned()

void boss_bjarngrim::JustRespawned ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

133 {
135 me->SetWalk(true);
136 Start(true, ObjectGuid::Empty, nullptr, false, true);
137 }
void JustRespawned() override
Definition ScriptedEscortAI.cpp:169

References ObjectGuid::Empty, npc_escortAI::JustRespawned(), ScriptedAI::me, Creature::SetWalk(), and npc_escortAI::Start().

◆ KilledUnit()

void boss_bjarngrim::KilledUnit ( Unit *  victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

194 {
195 if (!victim->IsPlayer())
196 return;
197
198 Talk(SAY_SLAY);
199 }
@ SAY_SLAY
Definition boss_bjarngrim.cpp:104
bool IsPlayer() const
Definition Object.h:207

References Object::IsPlayer(), and SAY_SLAY.

◆ RemoveStanceAura()

void boss_bjarngrim::RemoveStanceAura ( uint8  stance)
inline
210 {
211 switch (stance)
212 {
213 case STANCE_DEFENSIVE:
216 break;
217 case STANCE_BERSERKER:
220 break;
221 case STANCE_BATTLE:
224 break;
225 }
226 }
@ SPELL_BATTLE_STANCE
Definition boss_bjarngrim.cpp:40
@ SPELL_DEFENSIVE_STANCE
Definition boss_bjarngrim.cpp:26
@ SPELL_BATTLE_AURA
Definition boss_bjarngrim.cpp:41
@ SPELL_DEFENSIVE_AURA
Definition boss_bjarngrim.cpp:27
@ SPELL_BERSERKER_AURA
Definition boss_bjarngrim.cpp:35
@ SPELL_BERSERKER_STANCE
Definition boss_bjarngrim.cpp:34
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4797

References ScriptedAI::me, Unit::RemoveAura(), SPELL_BATTLE_AURA, SPELL_BATTLE_STANCE, SPELL_BERSERKER_AURA, SPELL_BERSERKER_STANCE, SPELL_DEFENSIVE_AURA, SPELL_DEFENSIVE_STANCE, STANCE_BATTLE, STANCE_BERSERKER, and STANCE_DEFENSIVE.

Referenced by UpdateEscortAI().

◆ Reset()

void boss_bjarngrim::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

140 {
141 events.Reset();
143
144 for (uint8 i = 0; i < 2; ++i)
146 {
147 float angle = i == 0 ? 2.5f : 3.78f;
148 // Keep following as the default movement when chase/evade movement ends.
149 dwarf->GetMotionMaster()->MoveFollow(me, 3, angle, MOTION_SLOT_IDLE);
150 summons.Summon(dwarf);
151 }
152
154
155 if (m_pInstance)
157
160 }
@ EQUIP_NO_CHANGE
Definition CreatureAI.h:64
std::uint8_t uint8
Definition Define.h:109
@ NOT_STARTED
Definition InstanceScript.h:58
@ MOTION_SLOT_IDLE
Definition MotionMaster.h:64
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ EQUIP_SWORD
Definition boss_bjarngrim.cpp:66
@ NPC_STORMFORGED_LIEUTENANT
Definition boss_bjarngrim.cpp:63
@ EQUIP_SHIELD
Definition boss_bjarngrim.cpp:67
Definition Creature.h:47
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
void RemoveAllAuras()
Definition Unit.cpp:5359
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:2453
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition ScriptedCreature.cpp:557

References DATA_BJARNGRIM, SummonList::DespawnAll(), UnitAI::DoCastSelf(), EQUIP_NO_CHANGE, EQUIP_SHIELD, EQUIP_SWORD, Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), m_pInstance, ScriptedAI::me, MOTION_SLOT_IDLE, NOT_STARTED, NPC_STORMFORGED_LIEUTENANT, Unit::RemoveAllAuras(), InstanceScript::SetBossState(), ScriptedAI::SetEquipmentSlots(), SPELL_BATTLE_STANCE, SummonList::Summon(), WorldObject::SummonCreature(), summons, and urand().

Referenced by UpdateEscortAI().

◆ RollStance()

void boss_bjarngrim::RollStance ( uint8  stance,
uint8  force = 0 
)
inline
229 {
230 if (urand(0, 1))
231 stance = (++stance == 4 ? 1 : stance);
232 else
233 stance = (--stance == 0 ? 3 : stance);
234
235 if (force)
236 stance = force;
237
238 switch (stance)
239 {
240 case STANCE_DEFENSIVE:
242
245
246 events.DelayEvents(20s, STANCE_BERSERKER);
247 events.DelayEvents(20s, STANCE_BATTLE);
248
250 break;
251 case STANCE_BERSERKER:
253
256
257 events.DelayEvents(20s, STANCE_DEFENSIVE);
258 events.DelayEvents(20s, STANCE_BATTLE);
259
261 break;
262 case STANCE_BATTLE:
264
267
268 events.DelayEvents(20s, STANCE_BERSERKER);
269 events.DelayEvents(20s, STANCE_DEFENSIVE);
270
272 break;
273 }
274
275 m_uiStance = stance;
276 }
@ EQUIP_UNEQUIP
Definition CreatureAI.h:65
@ SAY_BATTLE_STANCE
Definition boss_bjarngrim.cpp:102
@ SAY_DEFENSIVE_STANCE
Definition boss_bjarngrim.cpp:101
@ SAY_BERSERKER_STANCE
Definition boss_bjarngrim.cpp:103
@ EQUIP_MACE
Definition boss_bjarngrim.cpp:68

References UnitAI::DoCastSelf(), EQUIP_MACE, EQUIP_NO_CHANGE, EQUIP_SHIELD, EQUIP_SWORD, EQUIP_UNEQUIP, m_uiStance, SAY_BATTLE_STANCE, SAY_BERSERKER_STANCE, SAY_DEFENSIVE_STANCE, ScriptedAI::SetEquipmentSlots(), SPELL_BATTLE_AURA, SPELL_BATTLE_STANCE, SPELL_BERSERKER_AURA, SPELL_BERSERKER_STANCE, SPELL_DEFENSIVE_AURA, SPELL_DEFENSIVE_STANCE, STANCE_BATTLE, STANCE_BERSERKER, STANCE_DEFENSIVE, and urand().

Referenced by JustEngagedWith(), and UpdateEscortAI().

◆ UpdateEscortAI()

void boss_bjarngrim::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

310 {
311 events.Update(diff);
312
313 if (!me->IsInCombat())
314 {
315 // Handle charge-up only when out of combat
316 if (uint32 eventId = events.ExecuteEvent())
317 {
318 if (eventId == EVENT_CHARGE_UP)
319 {
322 }
323 }
324 return;
325 }
326
327 // Return since we have no target
328 if (!UpdateVictim())
329 {
330 Reset();
331 return;
332 }
333
335 return;
336
337 switch (events.ExecuteEvent())
338 {
340 // roll new stance
343 events.Repeat(20s);
344 break;
345
346 case EVENT_CHARGE_UP:
349 break;
350
351 // DEFENSIVE STANCE
354 events.Repeat(8s, 9s);
355 break;
358 events.Repeat(10s, 11s);
359 break;
362 events.Repeat(20s, 21s);
363 break;
366 events.Repeat(18s, 23s);
367 break;
368
369 // BERSERKER STANCE
372 events.Repeat(10s);
373 break;
376 events.Repeat(25s);
377 break;
378
379 // BATTLE STANCE
381 DoCastRandomTarget(SPELL_INTERCEPT, 0, 40.0f, false, true);
382 events.Repeat(30s);
383 break;
386 events.Repeat(25s);
387 break;
390 events.Repeat(10s, 12s);
391 break;
392 }
393
395 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ EVENT_CHARGE_UP
Definition boss_bjarngrim.cpp:95
@ SPELL_CLEAVE
Definition boss_bjarngrim.cpp:43
@ SPELL_PUMMEL
Definition boss_bjarngrim.cpp:29
@ SPELL_SLAM
Definition boss_bjarngrim.cpp:44
@ SPELL_MORTAL_STRIKE
Definition boss_bjarngrim.cpp:36
@ SPELL_IRONFORM
Definition boss_bjarngrim.cpp:31
@ SPELL_INTERCEPT
Definition boss_bjarngrim.cpp:42
@ SPELL_CHARGE_UP
Definition boss_bjarngrim.cpp:47
@ SPELL_KNOCK_AWAY
Definition boss_bjarngrim.cpp:30
@ SPELL_BJARNGRIM_REFLETION
Definition boss_bjarngrim.cpp:28
@ SPELL_WHIRLWIND
Definition boss_bjarngrim.cpp:37
bool UpdateVictim()
Definition CreatureAI.cpp:350
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:286
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
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:278
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
bool IsInCombat() const
Definition Unit.h:941
void Reset() override
Definition boss_bjarngrim.cpp:139
void RemoveStanceAura(uint8 stance)
Definition boss_bjarngrim.cpp:209

References UnitAI::DoCastAOE(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EVENT_BJARNGRIM_CHANGE_STANCE, EVENT_BJARNGRIM_CLEAVE, EVENT_BJARNGRIM_INTERCEPT, EVENT_BJARNGRIM_IRONFORM, EVENT_BJARNGRIM_KNOCK, EVENT_BJARNGRIM_MORTAL_STRIKE, EVENT_BJARNGRIM_PUMMEL, EVENT_BJARNGRIM_REFLECTION, EVENT_BJARNGRIM_SLAM, EVENT_BJARNGRIM_WHIRLWIND, EVENT_CHARGE_UP, Unit::HasUnitState(), Unit::IsInCombat(), m_uiStance, ScriptedAI::me, RemoveStanceAura(), Reset(), RollStance(), SPELL_BJARNGRIM_REFLETION, SPELL_CHARGE_UP, SPELL_CLEAVE, SPELL_INTERCEPT, SPELL_IRONFORM, SPELL_KNOCK_AWAY, SPELL_MORTAL_STRIKE, SPELL_PUMMEL, SPELL_SLAM, SPELL_TEMPORARY_ELECTRICAL_CHARGE, SPELL_WHIRLWIND, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

◆ WaypointReached() [1/2]

void boss_bjarngrim::WaypointReached ( uint32  Point)
inlineoverridevirtual

Implements npc_escortAI.

280 {
281 if (Point == 1)
282 {
283 events.CancelEvent(EVENT_CHARGE_UP);
284 events.ScheduleEvent(EVENT_CHARGE_UP, 2500ms, 0);
285 }
286 else if (Point == 2)
287 {
288 events.CancelEvent(EVENT_CHARGE_UP);
289 }
290 else if (Point == 3)
291 {
293 }
294 else if (Point == 4)
295 {
296 events.CancelEvent(EVENT_CHARGE_UP);
297 events.ScheduleEvent(EVENT_CHARGE_UP, 2500ms, 0);
298 }
299 else if (Point == 5)
300 {
301 events.CancelEvent(EVENT_CHARGE_UP);
302 }
303 else if (Point == 6)
304 {
306 }
307 }

References EVENT_CHARGE_UP, ScriptedAI::me, Unit::RemoveAura(), and SPELL_TEMPORARY_ELECTRICAL_CHARGE.

◆ WaypointReached() [2/2]

virtual void CreatureAI::WaypointReached ( uint32  ,
uint32   
)
inlinevirtual

Reimplemented from CreatureAI.

196{ }

Member Data Documentation

◆ events

EventMap boss_bjarngrim::events
private

◆ m_pInstance

InstanceScript* boss_bjarngrim::m_pInstance
private

◆ m_uiStance

uint8 boss_bjarngrim::m_uiStance
private

Referenced by RollStance(), and UpdateEscortAI().

◆ summons

SummonList boss_bjarngrim::summons
private

Referenced by Reset().


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