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

Public Member Functions

 boss_bjarngrimAI (Creature *creature)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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
 
- 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
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
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 WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=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)
 
- 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
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. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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

InstanceScriptm_pInstance
 
EventMap events
 
SummonList summons
 
uint8 m_uiStance
 
- 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 npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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_bjarngrimAI()

boss_bjarngrim::boss_bjarngrimAI::boss_bjarngrimAI ( Creature creature)
inline
121 : npc_escortAI(creature), summons(creature)
122 {
123 m_pInstance = creature->GetInstanceScript();
124
125 // Init waypoints
126 AddWaypoint(1, 1262.18f, 99.3f, 33.5f, 0);
127 AddWaypoint(2, 1281.6f, 99.5f, 33.5f, 0);
128 AddWaypoint(3, 1311.7f, 99.4f, 40.1f, 0);
129 AddWaypoint(4, 1332.5f, 99.7f, 40.18f, 0);
130 AddWaypoint(5, 1311.7f, 99.4f, 40.1f, 0);
131 AddWaypoint(6, 1281.6f, 99.5f, 33.5f, 0);
132 AddWaypoint(7, 1262.18f, 99.3f, 33.5f, 0);
133 AddWaypoint(8, 1262, -26.9f, 33.5f, 0);
134 AddWaypoint(9, 1281.2f, -26.8f, 33.5f, 0);
135 AddWaypoint(10, 1311.3f, -26.9f, 40.03f, 0);
136 AddWaypoint(11, 1332, -26.6f, 40.18f, 0);
137 AddWaypoint(12, 1311.3f, -26.9f, 40.03f, 0);
138 AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
139 AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
140
141 Start(true, false, ObjectGuid::Empty, nullptr, false, true);
142 }
Definition: ScriptedEscortAI.h:53
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition: ScriptedEscortAI.cpp:396
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
SummonList summons
Definition: boss_bjarngrim.cpp:146
InstanceScript * m_pInstance
Definition: boss_bjarngrim.cpp:144

References npc_escortAI::AddWaypoint(), ObjectGuid::Empty, WorldObject::GetInstanceScript(), m_pInstance, and npc_escortAI::Start().

Member Function Documentation

◆ JustDied()

void boss_bjarngrim::boss_bjarngrimAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from npc_escortAI.

207 {
209
210 if (m_pInstance)
212 }
Talk
Definition: hyjal.cpp:82
@ SAY_DEATH
Definition: boss_bjarngrim.cpp:103
@ TYPE_BJARNGRIM
Definition: halls_of_lightning.h:29
@ DONE
Definition: InstanceScript.h:60
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References DONE, m_pInstance, SAY_DEATH, ZoneScript::SetData(), and TYPE_BJARNGRIM.

◆ JustEngagedWith()

void boss_bjarngrim::boss_bjarngrimAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

170 {
173
174 events.ScheduleEvent(EVENT_BJARNGRIM_CHANGE_STANCE, 20s, 0);
175
176 // DEFENSIVE STANCE
179 events.ScheduleEvent(EVENT_BJARNGRIM_KNOCK, 16s, STANCE_DEFENSIVE);
181
182 // BERSERKER STANCE
185
186 // BATTLE STANCE
188 events.ScheduleEvent(EVENT_BJARNGRIM_CLEAVE, 25s, STANCE_BATTLE);
189 events.ScheduleEvent(EVENT_BJARNGRIM_SLAM, 30s, STANCE_BATTLE);
190
191 if (m_pInstance)
192 {
195 }
196 }
events
Definition: boss_sartura.cpp:43
@ SAY_AGGRO
Definition: boss_bjarngrim.cpp:98
@ STANCE_BERSERKER
Definition: boss_bjarngrim.cpp:60
@ STANCE_BATTLE
Definition: boss_bjarngrim.cpp:61
@ STANCE_DEFENSIVE
Definition: boss_bjarngrim.cpp:59
@ EVENT_BJARNGRIM_REFLECTION
Definition: boss_bjarngrim.cpp:77
@ EVENT_BJARNGRIM_KNOCK
Definition: boss_bjarngrim.cpp:79
@ EVENT_BJARNGRIM_PUMMEL
Definition: boss_bjarngrim.cpp:78
@ EVENT_BJARNGRIM_CLEAVE
Definition: boss_bjarngrim.cpp:88
@ EVENT_BJARNGRIM_SLAM
Definition: boss_bjarngrim.cpp:89
@ EVENT_BJARNGRIM_CHANGE_STANCE
Definition: boss_bjarngrim.cpp:74
@ EVENT_BJARNGRIM_INTERCEPT
Definition: boss_bjarngrim.cpp:87
@ EVENT_BJARNGRIM_IRONFORM
Definition: boss_bjarngrim.cpp:80
@ EVENT_BJARNGRIM_MORTAL_STRIKE
Definition: boss_bjarngrim.cpp:83
@ EVENT_BJARNGRIM_WHIRLWIND
Definition: boss_bjarngrim.cpp:84
@ SPELL_TEMPORARY_ELECTRICAL_CHARGE
Definition: boss_bjarngrim.cpp:48
@ DATA_BJARNGRIM_ACHIEVEMENT
Definition: halls_of_lightning.h:36
@ IN_PROGRESS
Definition: InstanceScript.h:58
Creature * me
Definition: ScriptedCreature.h:280
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698

References 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, SAY_AGGRO, ZoneScript::SetData(), Creature::SetInCombatWithZone(), SPELL_TEMPORARY_ELECTRICAL_CHARGE, STANCE_BATTLE, STANCE_BERSERKER, STANCE_DEFENSIVE, and TYPE_BJARNGRIM.

◆ KilledUnit()

void boss_bjarngrim::boss_bjarngrimAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

199 {
200 if (!victim->IsPlayer())
201 return;
202
203 Talk(SAY_SLAY);
204 }
@ SAY_SLAY
Definition: boss_bjarngrim.cpp:102
bool IsPlayer() const
Definition: Object.h:200

References Object::IsPlayer(), and SAY_SLAY.

◆ RemoveStanceAura()

void boss_bjarngrim::boss_bjarngrimAI::RemoveStanceAura ( uint8  stance)
inline
215 {
216 switch (stance)
217 {
218 case STANCE_DEFENSIVE:
221 break;
222 case STANCE_BERSERKER:
225 break;
226 case STANCE_BATTLE:
229 break;
230 }
231 }
@ 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:4776

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::boss_bjarngrimAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

150 {
151 events.Reset();
153
154 for (uint8 i = 0; i < 2; ++i)
156 {
157 dwarf->GetMotionMaster()->MoveFollow(me, 3, rand_norm() * 2 * 3.14f);
158 summons.Summon(dwarf);
159 }
160
164
165 if (m_pInstance)
167 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
double rand_norm()
Definition: Random.cpp:77
std::uint8_t uint8
Definition: Define.h:109
@ NPC_STORMFORGED_LIEUTENANT
Definition: boss_bjarngrim.cpp:64
@ NOT_STARTED
Definition: InstanceScript.h:57
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
Definition: Creature.h:43
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
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:1167
void RemoveAllAuras()
Definition: Unit.cpp:5319
void RollStance(uint8 stance, uint8 force=0)
Definition: boss_bjarngrim.cpp:233

References Unit::CastSpell(), SummonList::DespawnAll(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), m_pInstance, ScriptedAI::me, NOT_STARTED, NPC_STORMFORGED_LIEUTENANT, rand_norm(), Unit::RemoveAllAuras(), RollStance(), ZoneScript::SetData(), SPELL_TEMPORARY_ELECTRICAL_CHARGE, STANCE_DEFENSIVE, SummonList::Summon(), WorldObject::SummonCreature(), summons, TYPE_BJARNGRIM, and urand().

Referenced by UpdateEscortAI().

◆ RollStance()

void boss_bjarngrim::boss_bjarngrimAI::RollStance ( uint8  stance,
uint8  force = 0 
)
inline
234 {
235 if (urand(0, 1))
236 stance = (++stance == 4 ? 1 : stance);
237 else
238 stance = (--stance == 0 ? 3 : stance);
239
240 if (force)
241 stance = force;
242
243 switch (stance)
244 {
245 case STANCE_DEFENSIVE:
247
250
251 events.DelayEvents(20000, STANCE_BERSERKER);
252 events.DelayEvents(20000, STANCE_BATTLE);
253
255 break;
256 case STANCE_BERSERKER:
258
261
262 events.DelayEvents(20000, STANCE_DEFENSIVE);
263 events.DelayEvents(20000, STANCE_BATTLE);
264
266 break;
267 case STANCE_BATTLE:
269
272
273 events.DelayEvents(20000, STANCE_BERSERKER);
274 events.DelayEvents(20000, STANCE_DEFENSIVE);
275
277 break;
278 }
279
280 m_uiStance = stance;
281 }
@ SAY_BATTLE_STANCE
Definition: boss_bjarngrim.cpp:100
@ SAY_DEFENSIVE_STANCE
Definition: boss_bjarngrim.cpp:99
@ SAY_BERSERKER_STANCE
Definition: boss_bjarngrim.cpp:101
@ EQUIP_SWORD
Definition: boss_bjarngrim.cpp:67
@ EQUIP_SHIELD
Definition: boss_bjarngrim.cpp:68
@ EQUIP_MACE
Definition: boss_bjarngrim.cpp:69
@ EQUIP_UNEQUIP
Definition: CreatureAI.h:66
@ EQUIP_NO_CHANGE
Definition: CreatureAI.h:65
void SetEquipmentSlots(bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
Definition: ScriptedCreature.cpp:529
uint8 m_uiStance
Definition: boss_bjarngrim.cpp:147

References Unit::CastSpell(), EQUIP_MACE, EQUIP_NO_CHANGE, EQUIP_SHIELD, EQUIP_SWORD, EQUIP_UNEQUIP, m_uiStance, ScriptedAI::me, 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 Reset(), and UpdateEscortAI().

◆ UpdateEscortAI()

void boss_bjarngrim::boss_bjarngrimAI::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

292 {
293 if (!me->IsInCombat())
294 return;
295
296 // Return since we have no target
297 if (!UpdateVictim())
298 {
299 Reset();
300 return;
301 }
302
303 events.Update(diff);
304
306 return;
307
308 switch (events.ExecuteEvent())
309 {
311 // roll new stance
314 events.Repeat(20s);
315 break;
316
322 events.Repeat(8s, 9s);
323 break;
325 me->CastSpell(me->GetVictim(), SPELL_PUMMEL, false);
326 events.Repeat(10s, 11s);
327 break;
330 events.Repeat(20s, 21s);
331 break;
333 me->CastSpell(me, SPELL_IRONFORM, true);
334 events.Repeat(18s, 23s);
335 break;
336
342 events.Repeat(10s);
343 break;
346 events.Repeat(25s);
347 break;
348
353 if (Unit* target = SelectTarget(SelectTargetMethod::Random))
354 me->CastSpell(target, SPELL_INTERCEPT, true);
355
356 events.Repeat(30s);
357 break;
359 me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
360 events.Repeat(25s);
361 break;
363 me->CastSpell(me->GetVictim(), SPELL_SLAM, false);
364 events.Repeat(10s, 12s);
365 break;
366 }
367
369 }
@ 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_KNOCK_AWAY
Definition: boss_bjarngrim.cpp:30
@ SPELL_BJARNGRIM_REFLETION
Definition: boss_bjarngrim.cpp:28
@ SPELL_WHIRLWIND
Definition: boss_bjarngrim.cpp:37
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
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:280
Definition: Unit.h:630
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
bool IsInCombat() const
Definition: Unit.h:884
void Reset() override
Definition: boss_bjarngrim.cpp:149
void RemoveStanceAura(uint8 stance)
Definition: boss_bjarngrim.cpp:214

References Unit::CastSpell(), 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, Unit::GetVictim(), Unit::HasUnitState(), Unit::IsInCombat(), m_uiStance, ScriptedAI::me, RemoveStanceAura(), Reset(), RollStance(), UnitAI::SelectTarget(), SPELL_BJARNGRIM_REFLETION, SPELL_CLEAVE, SPELL_INTERCEPT, SPELL_IRONFORM, SPELL_KNOCK_AWAY, SPELL_MORTAL_STRIKE, SPELL_PUMMEL, SPELL_SLAM, SPELL_WHIRLWIND, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

◆ WaypointReached()

void boss_bjarngrim::boss_bjarngrimAI::WaypointReached ( uint32  Point)
inlineoverridevirtual

Implements npc_escortAI.

284 {
285 if (Point == 1 || Point == 8)
287 else if (Point == 7 || Point == 14)
289 }

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

Member Data Documentation

◆ events

EventMap boss_bjarngrim::boss_bjarngrimAI::events

◆ m_pInstance

InstanceScript* boss_bjarngrim::boss_bjarngrimAI::m_pInstance

◆ m_uiStance

uint8 boss_bjarngrim::boss_bjarngrimAI::m_uiStance

Referenced by RollStance(), and UpdateEscortAI().

◆ summons

SummonList boss_bjarngrim::boss_bjarngrimAI::summons

Referenced by Reset().