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

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
250 {
251 ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists
252 }
#define ASSERT
Definition: Errors.h:68
@ DATA_DEATHBRINGER_SAURFANG
Definition: icecrown_citadel.h:89
Definition: ScriptedCreature.h:467
Vehicle * GetVehicleKit() const
Definition: Unit.h:1785

References ASSERT, and Unit::GetVehicleKit().

Member Function Documentation

◆ AttackStart()

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

Reimplemented from ScriptedAI.

328 {
329 if (!_introDone || me->IsImmuneToPC())
330 return;
331
333 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
Creature * me
Definition: ScriptedCreature.h:280
bool IsImmuneToPC() const
Definition: Unit.h:877
bool _introDone
Definition: boss_deathbringer_saurfang.cpp:510

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.

323 {
324 return _introDone;
325 }

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.

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

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.

467 {
468 switch (action)
469 {
471 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true, true, -SPELL_MARK_OF_THE_FALLEN_CHAMPION))
472 {
476 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
477 bloodPower->RecalculateAmountOfEffects();
478 }
479 break;
481 _introDone = true;
482 break;
483 default:
484 break;
485 }
486 }
@ ACTION_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:201
@ ACTION_INTRO_DONE
Definition: boss_deathbringer_saurfang.cpp:198
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:108
@ SPELL_BLOOD_POWER
Definition: boss_deathbringer_saurfang.cpp:105
@ 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:5581
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15566
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
Definition: SpellAuras.h:87
uint32 _fallenChampionCastCount
Definition: boss_deathbringer_saurfang.cpp:509

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.

502 {
505 creature->AI()->DoAction(ACTION_EVADE);
506 }
@ DATA_SAURFANG_EVENT_NPC
Definition: icecrown_citadel.h:104
@ ACTION_EVADE
Definition: boss_deathbringer_saurfang.cpp:199
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
InstanceScript *const instance
Definition: ScriptedCreature.h:474
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition: ScriptedCreature.h:498
Definition: Creature.h:43
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98

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.

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

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.

312 {
313 _JustDied();
316
319 creature->AI()->DoAction(ACTION_START_OUTRO);
320 }
@ ACTION_START_OUTRO
Definition: boss_deathbringer_saurfang.cpp:196
@ SPELL_ACHIEVEMENT
Definition: boss_deathbringer_saurfang.cpp:118
@ SAY_DEATH
Definition: boss_deathbringer_saurfang.cpp:45
void _JustDied()
Definition: ScriptedCreature.cpp:643
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:665

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.

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

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.

338 {
341 }
@ FAIL
Definition: InstanceScript.h:59
void _JustReachedHome()
Definition: ScriptedCreature.h:506

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.

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

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.

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

References Object::IsPlayer(), and SAY_KILL.

◆ MoveInLineOfSight()

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

Reimplemented from CreatureAI.

335{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

379 {
380 if (type != POINT_MOTION_TYPE && id != POINT_SAURFANG)
381 return;
382
384 }
@ GO_SAURFANG_S_DOOR
Definition: icecrown_citadel.h:412
@ POINT_SAURFANG
Definition: boss_deathbringer_saurfang.cpp:209
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:48
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:113

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.

255 {
256 _Reset();
257 me->SetImmuneToAll(true);
259 events.Reset();
260 _introDone = false;
261 _frenzied = false;
265 DoCast(me, SPELL_ZERO_POWER, true);
266 DoCast(me, SPELL_BLOOD_LINK, true);
273 }
@ SPELL_ZERO_POWER
Definition: boss_deathbringer_saurfang.cpp:94
@ SPELL_BLOOD_LINK
Definition: boss_deathbringer_saurfang.cpp:96
@ SPELL_RUNE_OF_BLOOD_S
Definition: boss_deathbringer_saurfang.cpp:98
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION_S
Definition: boss_deathbringer_saurfang.cpp:97
#define SPELL_BERSERK
Definition: boss_ignis.cpp:40
@ REACT_DEFENSIVE
Definition: Unit.h:549
void _Reset()
Definition: ScriptedCreature.cpp:624
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
uint16 _transportCheckTimer
Definition: boss_deathbringer_saurfang.cpp:512

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.

387 {
388 switch (spell->Id)
389 {
392 break;
393 }
394 }
@ SAY_MARK_OF_THE_FALLEN_CHAMPION
Definition: boss_deathbringer_saurfang.cpp:40

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.

374 {
375 summons.Despawn(summon);
376 }
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.

397 {
398 if (!UpdateVictim())
399 return;
400
401 events.Update(diff);
402
403 if (_transportCheckTimer <= diff)
404 {
406 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
407 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
408 if (Player* p = itr->GetSource())
409 if (p->GetTransport())
410 {
412 return;
413 }
414 }
415 else
416 _transportCheckTimer -= diff;
417
419 return;
420
421 if (uint32 eventId = events.ExecuteEvent())
422 {
423 switch (eventId)
424 {
426 for (uint32 i10 = 0; i10 < 2; ++i10)
428 if (Is25ManRaid())
429 for (uint32 i25 = 0; i25 < 3; ++i25)
432 events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 40s);
433 if (IsHeroic())
434 events.ScheduleEvent(EVENT_BLOOD_BEAST_SCENT_OF_BLOOD, 10s);
435 break;
439 break;
440 case EVENT_BLOOD_NOVA:
441 {
442 me->CastSpell((Unit*)nullptr, SPELL_BLOOD_NOVA_TRIGGER, false);
443 events.ScheduleEvent(EVENT_BLOOD_NOVA, 20s, 25s);
444 break;
445 }
448 events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20s, 25s);
449 break;
451 me->CastSpell((Unit*)nullptr, SPELL_BOILING_BLOOD, false);
452 events.ScheduleEvent(EVENT_BOILING_BLOOD, 15s, 20s);
453 break;
454 case EVENT_BERSERK:
457 break;
458 default:
459 break;
460 }
461 }
462
464 }
std::uint32_t uint32
Definition: Define.h:107
@ ACTION_GAIN_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:200
@ SPELL_BOILING_BLOOD
Definition: boss_deathbringer_saurfang.cpp:109
@ SPELL_BLOOD_NOVA_TRIGGER
Definition: boss_deathbringer_saurfang.cpp:103
@ SPELL_SUMMON_BLOOD_BEAST
Definition: boss_deathbringer_saurfang.cpp:100
@ SPELL_RUNE_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:110
@ SPELL_SUMMON_BLOOD_BEAST_25_MAN
Definition: boss_deathbringer_saurfang.cpp:101
@ EVENT_BLOOD_BEAST_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:148
@ EMOTE_SCENT_OF_BLOOD
Definition: boss_deathbringer_saurfang.cpp:46
@ SAY_BLOOD_BEASTS
Definition: boss_deathbringer_saurfang.cpp:41
@ SAY_BERSERK
Definition: boss_deathbringer_saurfang.cpp:44
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
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:280
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
bool Is25ManRaid() const
Definition: ScriptedCreature.h:385
Map * GetMap() const
Definition: Object.h:536
Definition: Player.h:1081
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
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().