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

Public Member Functions

 boss_deathbringer_saurfangAI (Creature *creature)
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged. More...
 
void JustDied (Unit *) override
 
bool CanAIAttack (Unit const *) const override
 
void AttackStart (Unit *victim) override
 
void MoveInLineOfSight (Unit *) override
 
void JustReachedHome () override
 
void KilledUnit (Unit *victim) override
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void MovementInform (uint32 type, uint32 id) override
 
void SpellHitTarget (Unit *, SpellInfo const *spell) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void DoAction (int32 action) override
 
uint32 GetData (uint32 type) const override
 
void EnterEvadeMode (EvadeReason why) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () 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) 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
 
- 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)
 
 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
 

Private Attributes

uint32 _fallenChampionCastCount
 
bool _introDone
 
bool _frenzied
 
uint16 _transportCheckTimer
 

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 BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- 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 BossAI
SummonList summons
 
- 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_deathbringer_saurfangAI()

boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::boss_deathbringer_saurfangAI ( Creature creature)
inline
249 {
250 ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists
251 }
#define ASSERT
Definition: Errors.h:68
@ DATA_DEATHBRINGER_SAURFANG
Definition: icecrown_citadel.h:95
Definition: ScriptedCreature.h:457
Vehicle * GetVehicleKit() const
Definition: Unit.h:1672

References ASSERT, and Unit::GetVehicleKit().

Member Function Documentation

◆ AttackStart()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::AttackStart ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

327 {
328 if (!_introDone || me->IsImmuneToPC())
329 return;
330
332 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:208
Creature * me
Definition: ScriptedCreature.h:280
bool IsImmuneToPC() const
Definition: Unit.h:813
bool _introDone
Definition: boss_deathbringer_saurfang.cpp:509

References _introDone, ScriptedAI::AttackStart(), Unit::IsImmuneToPC(), and ScriptedAI::me.

◆ CanAIAttack()

bool boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::CanAIAttack ( Unit const *  ) const
inlineoverridevirtual

Reimplemented from UnitAI.

322 {
323 return _introDone;
324 }

References _introDone.

◆ DamageTaken()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from BossAI.

349 {
350 if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below
351 {
352 _frenzied = true;
353 DoCast(me, SPELL_FRENZY, true);
355 }
356 }
@ SPELL_FRENZY
Definition: boss_deathbringer_saurfang.cpp:101
@ SAY_FRENZY
Definition: boss_deathbringer_saurfang.cpp:42
Talk
Definition: hyjal.cpp:82
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:364
bool _frenzied
Definition: boss_deathbringer_saurfang.cpp:510

References _frenzied, UnitAI::DoCast(), ScriptedAI::HealthBelowPct(), ScriptedAI::me, SAY_FRENZY, and SPELL_FRENZY.

◆ DoAction()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

466 {
467 switch (action)
468 {
470 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
471 {
475 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
476 bloodPower->RecalculateAmountOfEffects();
477 }
478 break;
480 _introDone = true;
481 break;
482 default:
483 break;
484 }
485 }
@ ACTION_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:200
@ ACTION_INTRO_DONE
Definition: boss_deathbringer_saurfang.cpp:197
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:107
@ SPELL_BLOOD_POWER
Definition: boss_deathbringer_saurfang.cpp:104
@ POWER_ENERGY
Definition: SharedDefines.h:272
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
Definition: Unit.h:630
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5552
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15521
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:1168
Definition: SpellAuras.h:87
uint32 _fallenChampionCastCount
Definition: boss_deathbringer_saurfang.cpp:508

References _fallenChampionCastCount, _introDone, ACTION_INTRO_DONE, ACTION_MARK_OF_THE_FALLEN_CHAMPION, Unit::CastSpell(), Unit::GetAura(), ScriptedAI::me, POWER_ENERGY, UnitAI::SelectTarget(), Unit::SetPower(), SPELL_BLOOD_POWER, and SPELL_MARK_OF_THE_FALLEN_CHAMPION.

◆ EnterEvadeMode()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from BossAI.

501 {
504 creature->AI()->DoAction(ACTION_EVADE);
505 }
@ DATA_SAURFANG_EVENT_NPC
Definition: icecrown_citadel.h:110
@ ACTION_EVADE
Definition: boss_deathbringer_saurfang.cpp:198
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
InstanceScript *const instance
Definition: ScriptedCreature.h:464
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition: ScriptedCreature.h:488
Definition: Creature.h:46
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95

References ACTION_EVADE, DATA_SAURFANG_EVENT_NPC, BossAI::EnterEvadeMode(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), BossAI::instance, and ScriptedAI::me.

Referenced by JustEngagedWith(), and UpdateAI().

◆ GetData()

uint32 boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from UnitAI.

488 {
489 if (type == DATA_MADE_A_MESS)
490 {
491 if (_fallenChampionCastCount < RAID_MODE<uint32>(3, 5, 3, 5))
492 return 1;
493 }
494 else if (type == FALLEN_CHAMPION_CAST_COUNT)
496
497 return 0;
498 }
#define FALLEN_CHAMPION_CAST_COUNT
Definition: boss_deathbringer_saurfang.cpp:204
#define DATA_MADE_A_MESS
Definition: boss_deathbringer_saurfang.cpp:203

References _fallenChampionCastCount, DATA_MADE_A_MESS, and FALLEN_CHAMPION_CAST_COUNT.

◆ JustDied()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

311 {
312 _JustDied();
315
318 creature->AI()->DoAction(ACTION_START_OUTRO);
319 }
@ ACTION_START_OUTRO
Definition: boss_deathbringer_saurfang.cpp:195
@ SPELL_ACHIEVEMENT
Definition: boss_deathbringer_saurfang.cpp:117
@ SAY_DEATH
Definition: boss_deathbringer_saurfang.cpp:44
void _JustDied()
Definition: ScriptedCreature.cpp:614
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639

References BossAI::_JustDied(), ACTION_START_OUTRO, DATA_SAURFANG_EVENT_NPC, UnitAI::DoCast(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), BossAI::instance, ScriptedAI::me, SAY_DEATH, SPELL_ACHIEVEMENT, and SPELL_MARK_OF_THE_FALLEN_CHAMPION.

◆ JustEngagedWith()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

275 {
276 if (!_introDone)
277 {
278 me->CombatStop();
279 return;
280 }
281
282 // pussywizard: without this, the aura is not recalculated the first time
285
287 {
290 return;
291 }
292
293 // oh just screw intro, enter combat - no exploits please
294 me->setActive(true);
297
298 events.Reset();
299 events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 30s);
300 events.ScheduleEvent(EVENT_BERSERK, (IsHeroic() ? 6min : 8min));
301 events.ScheduleEvent(EVENT_BOILING_BLOOD, 15s + 500ms, 0);
302 events.ScheduleEvent(EVENT_BLOOD_NOVA, 17s, 0);
303 events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20s, 0);
304
308 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ LIGHT_S_HAMMER_TELEPORT
Definition: icecrown_citadel.h:80
@ EVENT_SUMMON_BLOOD_BEAST
Definition: boss_deathbringer_saurfang.cpp:146
@ EVENT_BERSERK
Definition: boss_deathbringer_saurfang.cpp:145
@ EVENT_BLOOD_NOVA
Definition: boss_deathbringer_saurfang.cpp:149
@ EVENT_BOILING_BLOOD
Definition: boss_deathbringer_saurfang.cpp:148
@ EVENT_RUNE_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:150
@ SAY_AGGRO
Definition: boss_deathbringer_saurfang.cpp:38
events
Definition: boss_sartura.cpp:43
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:94
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
bool IsHeroic() const
Definition: ScriptedCreature.h:379
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10398
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:650
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
Definition: InstanceScript.h:248
void EnterEvadeMode(EvadeReason why) override
Definition: boss_deathbringer_saurfang.cpp:500

References _fallenChampionCastCount, _introDone, InstanceScript::CheckRequiredBosses(), Unit::CombatStop(), DATA_DEATHBRINGER_SAURFANG, UnitAI::DoCast(), InstanceScript::DoCastSpellOnPlayers(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), CreatureAI::DoZoneInCombat(), EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BERSERK, EVENT_BLOOD_NOVA, EVENT_BOILING_BLOOD, EVENT_RUNE_OF_BLOOD, EVENT_SUMMON_BLOOD_BEAST, IN_PROGRESS, BossAI::instance, ScriptedAI::IsHeroic(), LIGHT_S_HAMMER_TELEPORT, ScriptedAI::me, Unit::RemoveAurasDueToSpell(), SAY_AGGRO, WorldObject::setActive(), InstanceScript::SetBossState(), SPELL_BLOOD_POWER, SPELL_MARK_OF_THE_FALLEN_CHAMPION, and Object::ToPlayer().

◆ JustReachedHome()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

337 {
340 }
@ FAIL
Definition: InstanceScript.h:59
void _JustReachedHome()
Definition: ScriptedCreature.h:496

References BossAI::_JustReachedHome(), DATA_DEATHBRINGER_SAURFANG, FAIL, BossAI::instance, and InstanceScript::SetBossState().

◆ JustSummoned()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

359 {
360 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
361 summon->AI()->AttackStart(target);
362
363 //if (IsHeroic())
364 // DoCast(summon, SPELL_SCENT_OF_BLOOD);
365
366 summon->AI()->DoCast(summon, SPELL_BLOOD_LINK_BEAST, true);
367 summon->AI()->DoCast(summon, SPELL_RESISTANT_SKIN, true);
368 summons.Summon(summon);
369 DoZoneInCombat(summon);
370 }
@ SPELL_RESISTANT_SKIN
Definition: boss_deathbringer_saurfang.cpp:113
@ SPELL_BLOOD_LINK_BEAST
Definition: boss_deathbringer_saurfang.cpp:112
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
SummonList summons
Definition: ScriptedCreature.h:501
CreatureAI * AI() const
Definition: Creature.h:143

References Creature::AI(), UnitAI::AttackStart(), UnitAI::DoCast(), CreatureAI::DoZoneInCombat(), UnitAI::SelectTarget(), SPELL_BLOOD_LINK_BEAST, SPELL_RESISTANT_SKIN, SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

343 {
344 if (victim->IsPlayer())
345 Talk(SAY_KILL);
346 }
@ SAY_KILL
Definition: boss_deathbringer_saurfang.cpp:41
bool IsPlayer() const
Definition: Object.h:197

References Object::IsPlayer(), and SAY_KILL.

◆ MoveInLineOfSight()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

334{}

◆ MovementInform()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

378 {
379 if (type != POINT_MOTION_TYPE && id != POINT_SAURFANG)
380 return;
381
383 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ GO_SAURFANG_S_DOOR
Definition: icecrown_citadel.h:418
@ POINT_SAURFANG
Definition: boss_deathbringer_saurfang.cpp:208
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:110

References InstanceScript::GetGuidData(), GO_SAURFANG_S_DOOR, InstanceScript::HandleGameObject(), BossAI::instance, POINT_MOTION_TYPE, and POINT_SAURFANG.

◆ Reset()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

254 {
255 _Reset();
256 me->SetImmuneToAll(true);
258 events.Reset();
259 _introDone = false;
260 _frenzied = false;
264 DoCast(me, SPELL_ZERO_POWER, true);
265 DoCast(me, SPELL_BLOOD_LINK, true);
272 }
@ REACT_DEFENSIVE
Definition: Unit.h:549
#define SPELL_BERSERK
Definition: boss_ignis.cpp:41
@ SPELL_ZERO_POWER
Definition: boss_deathbringer_saurfang.cpp:93
@ SPELL_BLOOD_LINK
Definition: boss_deathbringer_saurfang.cpp:95
@ SPELL_RUNE_OF_BLOOD_S
Definition: boss_deathbringer_saurfang.cpp:97
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION_S
Definition: boss_deathbringer_saurfang.cpp:96
void _Reset()
Definition: ScriptedCreature.cpp:598
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:97
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
uint16 _transportCheckTimer
Definition: boss_deathbringer_saurfang.cpp:511

References _fallenChampionCastCount, _frenzied, _introDone, BossAI::_Reset(), _transportCheckTimer, UnitAI::DoCast(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), BossAI::instance, ScriptedAI::me, POWER_ENERGY, REACT_DEFENSIVE, Unit::RemoveAurasDueToSpell(), Unit::SetImmuneToAll(), Unit::SetPower(), Creature::SetReactState(), SPELL_BERSERK, SPELL_BLOOD_LINK, SPELL_BLOOD_POWER, SPELL_FRENZY, SPELL_MARK_OF_THE_FALLEN_CHAMPION, SPELL_MARK_OF_THE_FALLEN_CHAMPION_S, SPELL_RUNE_OF_BLOOD_S, and SPELL_ZERO_POWER.

◆ SpellHitTarget()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::SpellHitTarget ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

386 {
387 switch (spell->Id)
388 {
391 break;
392 }
393 }
@ SAY_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:39

References SpellInfo::Id, SAY_MARK_OF_THE_FALLEN_CHAMPION, and SPELL_MARK_OF_THE_FALLEN_CHAMPION.

◆ SummonedCreatureDespawn()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

373 {
374 summons.Despawn(summon);
375 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References SummonList::Despawn(), and BossAI::summons.

◆ UpdateAI()

void boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from BossAI.

396 {
397 if (!UpdateVictim())
398 return;
399
400 events.Update(diff);
401
402 if (_transportCheckTimer <= diff)
403 {
405 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
406 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
407 if (Player* p = itr->GetSource())
408 if (p->GetTransport())
409 {
411 return;
412 }
413 }
414 else
415 _transportCheckTimer -= diff;
416
418 return;
419
420 if (uint32 eventId = events.ExecuteEvent())
421 {
422 switch (eventId)
423 {
425 for (uint32 i10 = 0; i10 < 2; ++i10)
427 if (Is25ManRaid())
428 for (uint32 i25 = 0; i25 < 3; ++i25)
431 events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 40s);
432 if (IsHeroic())
433 events.ScheduleEvent(EVENT_BLOOD_BEAST_SCENT_OF_BLOOD, 10s);
434 break;
438 break;
439 case EVENT_BLOOD_NOVA:
440 {
441 me->CastSpell((Unit*)nullptr, SPELL_BLOOD_NOVA_TRIGGER, false);
442 events.ScheduleEvent(EVENT_BLOOD_NOVA, 20s, 25s);
443 break;
444 }
447 events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20s, 25s);
448 break;
450 me->CastSpell((Unit*)nullptr, SPELL_BOILING_BLOOD, false);
451 events.ScheduleEvent(EVENT_BOILING_BLOOD, 15s, 20s);
452 break;
453 case EVENT_BERSERK:
456 break;
457 default:
458 break;
459 }
460 }
461
463 }
std::uint32_t uint32
Definition: Define.h:107
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ ACTION_GAIN_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:199
@ SPELL_BOILING_BLOOD
Definition: boss_deathbringer_saurfang.cpp:108
@ SPELL_BLOOD_NOVA_TRIGGER
Definition: boss_deathbringer_saurfang.cpp:102
@ SPELL_SUMMON_BLOOD_BEAST
Definition: boss_deathbringer_saurfang.cpp:99
@ SPELL_RUNE_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:109
@ SPELL_SUMMON_BLOOD_BEAST_25_MAN
Definition: boss_deathbringer_saurfang.cpp:100
@ EVENT_BLOOD_BEAST_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:147
@ EMOTE_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:45
@ SAY_BLOOD_BEASTS
Definition: boss_deathbringer_saurfang.cpp:40
@ SAY_BERSERK
Definition: boss_deathbringer_saurfang.cpp:43
Definition: LinkedList.h:139
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
bool Is25ManRaid() const
Definition: ScriptedCreature.h:385
Map * GetMap() const
Definition: Object.h:531
Definition: Player.h:1064
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References _transportCheckTimer, ACTION_GAIN_SCENT_OF_BLOOD, MapRefMgr::begin(), Unit::CastSpell(), SummonList::DoAction(), UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EMOTE_SCENT_OF_BLOOD, MapRefMgr::end(), EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BERSERK, EVENT_BLOOD_BEAST_SCENT_OF_BLOOD, EVENT_BLOOD_NOVA, EVENT_BOILING_BLOOD, EVENT_RUNE_OF_BLOOD, EVENT_SUMMON_BLOOD_BEAST, WorldObject::GetMap(), Map::GetPlayers(), Unit::HasUnitState(), ScriptedAI::Is25ManRaid(), ScriptedAI::IsHeroic(), ScriptedAI::me, SAY_BERSERK, SAY_BLOOD_BEASTS, SPELL_BERSERK, SPELL_BLOOD_NOVA_TRIGGER, SPELL_BOILING_BLOOD, SPELL_RUNE_OF_BLOOD, SPELL_SUMMON_BLOOD_BEAST, SPELL_SUMMON_BLOOD_BEAST_25_MAN, BossAI::summons, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _fallenChampionCastCount

uint32 boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::_fallenChampionCastCount
private

◆ _frenzied

bool boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::_frenzied
private

Referenced by DamageTaken(), and Reset().

◆ _introDone

bool boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::_introDone
private

◆ _transportCheckTimer

uint16 boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::_transportCheckTimer
private

Referenced by Reset(), and UpdateAI().