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.
 
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
 
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
 
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
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

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
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
bool _ProccessHealthCheckEvent (uint8 healthPct, uint32 damage, std::function< void()> exec) const
 
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
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
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
247 {
248 ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists
249 }
#define ASSERT
Definition: Errors.h:68
@ DATA_DEATHBRINGER_SAURFANG
Definition: icecrown_citadel.h:96
Definition: ScriptedCreature.h:456
Vehicle * GetVehicleKit() const
Definition: Unit.h:2353

References ASSERT, and Unit::GetVehicleKit().

Member Function Documentation

◆ AttackStart()

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

Reimplemented from ScriptedAI.

325 {
326 if (!_introDone || me->IsImmuneToPC())
327 return;
328
330 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:206
Creature * me
Definition: ScriptedCreature.h:282
bool IsImmuneToPC() const
Definition: Unit.h:1681
bool _introDone
Definition: boss_deathbringer_saurfang.cpp:507

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.

320 {
321 return _introDone;
322 }

References _introDone.

◆ DamageTaken()

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

Reimplemented from BossAI.

347 {
348 if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below
349 {
350 _frenzied = true;
351 DoCast(me, SPELL_FRENZY, true);
353 }
354 }
@ SPELL_FRENZY
Definition: boss_deathbringer_saurfang.cpp:99
@ SAY_FRENZY
Definition: boss_deathbringer_saurfang.cpp:40
Talk
Definition: boss_fathomlord_karathress.cpp:23
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:178
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:356
bool _frenzied
Definition: boss_deathbringer_saurfang.cpp:508

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.

464 {
465 switch (action)
466 {
468 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
469 {
473 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
474 bloodPower->RecalculateAmountOfEffects();
475 }
476 break;
478 _introDone = true;
479 break;
480 default:
481 break;
482 }
483 }
@ ACTION_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:198
@ ACTION_INTRO_DONE
Definition: boss_deathbringer_saurfang.cpp:195
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:105
@ SPELL_BLOOD_POWER
Definition: boss_deathbringer_saurfang.cpp:102
@ POWER_ENERGY
Definition: SharedDefines.h:244
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
Definition: Unit.h:1290
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5499
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15458
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
Definition: SpellAuras.h:87
uint32 _fallenChampionCastCount
Definition: boss_deathbringer_saurfang.cpp:506

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

499 {
502 creature->AI()->DoAction(ACTION_EVADE);
503 }
@ ACTION_EVADE
Definition: boss_deathbringer_saurfang.cpp:196
@ DATA_SAURFANG_EVENT_NPC
Definition: icecrown_citadel.h:111
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197
InstanceScript *const instance
Definition: ScriptedCreature.h:461
Definition: Creature.h:46
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94

References ACTION_EVADE, DATA_SAURFANG_EVENT_NPC, CreatureAI::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.

486 {
487 if (type == DATA_MADE_A_MESS)
488 {
489 if (_fallenChampionCastCount < RAID_MODE<uint32>(3, 5, 3, 5))
490 return 1;
491 }
492 else if (type == FALLEN_CHAMPION_CAST_COUNT)
494
495 return 0;
496 }
#define FALLEN_CHAMPION_CAST_COUNT
Definition: boss_deathbringer_saurfang.cpp:202
#define DATA_MADE_A_MESS
Definition: boss_deathbringer_saurfang.cpp:201

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.

309 {
310 _JustDied();
313
316 creature->AI()->DoAction(ACTION_START_OUTRO);
317 }
@ ACTION_START_OUTRO
Definition: boss_deathbringer_saurfang.cpp:193
@ SPELL_ACHIEVEMENT
Definition: boss_deathbringer_saurfang.cpp:115
@ SAY_DEATH
Definition: boss_deathbringer_saurfang.cpp:42
void _JustDied()
Definition: ScriptedCreature.cpp:585
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:587

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.

273 {
274 if (!_introDone)
275 {
276 me->CombatStop();
277 return;
278 }
279
280 // pussywizard: without this, the aura is not recalculated the first time
283
285 {
288 return;
289 }
290
291 // oh just screw intro, enter combat - no exploits please
292 me->setActive(true);
295
296 events.Reset();
297 events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 30s);
298 events.ScheduleEvent(EVENT_BERSERK, (IsHeroic() ? 6min : 8min));
299 events.ScheduleEvent(EVENT_BOILING_BLOOD, 15s + 500ms, 0);
300 events.ScheduleEvent(EVENT_BLOOD_NOVA, 17s, 0);
301 events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20s, 0);
302
306 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
events
Definition: boss_sartura.cpp:43
@ EVENT_SUMMON_BLOOD_BEAST
Definition: boss_deathbringer_saurfang.cpp:144
@ EVENT_BERSERK
Definition: boss_deathbringer_saurfang.cpp:143
@ EVENT_BLOOD_NOVA
Definition: boss_deathbringer_saurfang.cpp:147
@ EVENT_BOILING_BLOOD
Definition: boss_deathbringer_saurfang.cpp:146
@ EVENT_RUNE_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:148
@ SAY_AGGRO
Definition: boss_deathbringer_saurfang.cpp:36
@ LIGHT_S_HAMMER_TELEPORT
Definition: icecrown_citadel.h:81
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:92
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:10401
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:317
void DoCastSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:605
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
Definition: InstanceScript.h:243
void EnterEvadeMode(EvadeReason why) override
Definition: boss_deathbringer_saurfang.cpp:498

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.

335 {
338 }
@ FAIL
Definition: InstanceScript.h:58
void _JustReachedHome()
Definition: ScriptedCreature.h:491

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.

357 {
358 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
359 summon->AI()->AttackStart(target);
360
361 //if (IsHeroic())
362 // DoCast(summon, SPELL_SCENT_OF_BLOOD);
363
364 summon->AI()->DoCast(summon, SPELL_BLOOD_LINK_BEAST, true);
365 summon->AI()->DoCast(summon, SPELL_RESISTANT_SKIN, true);
366 summons.Summon(summon);
367 DoZoneInCombat(summon);
368 }
@ SPELL_RESISTANT_SKIN
Definition: boss_deathbringer_saurfang.cpp:111
@ SPELL_BLOOD_LINK_BEAST
Definition: boss_deathbringer_saurfang.cpp:110
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:497
CreatureAI * AI() const
Definition: Creature.h:135

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.

341 {
342 if (victim->GetTypeId() == TYPEID_PLAYER)
343 Talk(SAY_KILL);
344 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SAY_KILL
Definition: boss_deathbringer_saurfang.cpp:39
TypeID GetTypeId() const
Definition: Object.h:121

References Object::GetTypeId(), SAY_KILL, and TYPEID_PLAYER.

◆ MoveInLineOfSight()

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

Reimplemented from CreatureAI.

332{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

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

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.

252 {
253 _Reset();
254 me->SetImmuneToAll(true);
256 events.Reset();
257 _introDone = false;
258 _frenzied = false;
262 DoCast(me, SPELL_ZERO_POWER, true);
263 DoCast(me, SPELL_BLOOD_LINK, true);
270 }
@ REACT_DEFENSIVE
Definition: Unit.h:1024
@ SPELL_ZERO_POWER
Definition: boss_deathbringer_saurfang.cpp:91
@ SPELL_BLOOD_LINK
Definition: boss_deathbringer_saurfang.cpp:93
@ SPELL_RUNE_OF_BLOOD_S
Definition: boss_deathbringer_saurfang.cpp:95
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION_S
Definition: boss_deathbringer_saurfang.cpp:94
#define SPELL_BERSERK
Definition: boss_ignis.cpp:39
void _Reset()
Definition: ScriptedCreature.cpp:570
void SetReactState(ReactStates st)
Definition: Creature.h:89
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1678
uint16 _transportCheckTimer
Definition: boss_deathbringer_saurfang.cpp:509

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.

384 {
385 switch (spell->Id)
386 {
389 break;
390 }
391 }
@ SAY_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:37

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.

371 {
372 summons.Despawn(summon);
373 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:91

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

◆ UpdateAI()

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

Reimplemented from BossAI.

394 {
395 if (!UpdateVictim())
396 return;
397
398 events.Update(diff);
399
400 if (_transportCheckTimer <= diff)
401 {
403 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
404 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
405 if (Player* p = itr->GetSource())
406 if (p->GetTransport())
407 {
409 return;
410 }
411 }
412 else
413 _transportCheckTimer -= diff;
414
416 return;
417
418 if (uint32 eventId = events.ExecuteEvent())
419 {
420 switch (eventId)
421 {
423 for (uint32 i10 = 0; i10 < 2; ++i10)
425 if (Is25ManRaid())
426 for (uint32 i25 = 0; i25 < 3; ++i25)
429 events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 40s);
430 if (IsHeroic())
431 events.ScheduleEvent(EVENT_BLOOD_BEAST_SCENT_OF_BLOOD, 10s);
432 break;
436 break;
437 case EVENT_BLOOD_NOVA:
438 {
439 me->CastSpell((Unit*)nullptr, SPELL_BLOOD_NOVA_TRIGGER, false);
440 events.ScheduleEvent(EVENT_BLOOD_NOVA, 20s, 25s);
441 break;
442 }
445 events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20s, 25s);
446 break;
448 me->CastSpell((Unit*)nullptr, SPELL_BOILING_BLOOD, false);
449 events.ScheduleEvent(EVENT_BOILING_BLOOD, 15s, 20s);
450 break;
451 case EVENT_BERSERK:
454 break;
455 default:
456 break;
457 }
458 }
459
461 }
std::uint32_t uint32
Definition: Define.h:108
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ ACTION_GAIN_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:197
@ SPELL_BOILING_BLOOD
Definition: boss_deathbringer_saurfang.cpp:106
@ SPELL_BLOOD_NOVA_TRIGGER
Definition: boss_deathbringer_saurfang.cpp:100
@ SPELL_SUMMON_BLOOD_BEAST
Definition: boss_deathbringer_saurfang.cpp:97
@ SPELL_RUNE_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:107
@ SPELL_SUMMON_BLOOD_BEAST_25_MAN
Definition: boss_deathbringer_saurfang.cpp:98
@ EVENT_BLOOD_BEAST_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:145
@ EMOTE_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:43
@ SAY_BLOOD_BEASTS
Definition: boss_deathbringer_saurfang.cpp:38
@ SAY_BERSERK
Definition: boss_deathbringer_saurfang.cpp:41
Definition: LinkedList.h:139
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:104
bool Is25ManRaid() const
Definition: ScriptedCreature.h:385
Map * GetMap() const
Definition: Object.h:517
Definition: Player.h:1046
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
PlayerList const & GetPlayers() const
Definition: Map.h:484
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().