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

Public Member Functions

 boss_victor_nefariusAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustReachedHome () override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void DoAction (int32 action) override
 
void JustDied (Unit *) override
 
void BeginEvent ()
 
void SetData (uint32 type, uint32 data) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void sGossipSelect (Player *player, uint32 sender, uint32 action) 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 KilledAdds
 
uint32 _nefarianRightTunnel
 
uint32 _nefarianLeftTunnel
 

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_victor_nefariusAI()

boss_victor_nefarius::boss_victor_nefariusAI::boss_victor_nefariusAI ( Creature creature)
inline
240 : BossAI(creature, DATA_NEFARIAN)
241 {
242 Initialize();
243
246
248 {
249 // Victor Nefarius weekly mechanic drakonid spawn
250 // Pick 2 drakonids and keep them for the whole save duration (the drakonids can't be repeated).
251 std::vector<uint32> nefarianDrakonidSpawners = { NPC_BLACK_SPAWNER, NPC_BLUE_SPAWNER, NPC_BRONZE_SPAWNER, NPC_GREEN_SPAWNER, NPC_RED_SPAWNER };
252 Acore::Containers::RandomResize(nefarianDrakonidSpawners, 2);
253
254 _nefarianRightTunnel = nefarianDrakonidSpawners[0];
255 _nefarianLeftTunnel = nefarianDrakonidSpawners[1];
256
257 // save it to instance
260 }
261 }
@ DATA_NEFARIAN_RIGHT_TUNNEL
Definition: blackwing_lair.h:119
@ DATA_NEFARIAN_LEFT_TUNNEL
Definition: blackwing_lair.h:118
@ DATA_NEFARIAN
Definition: blackwing_lair.h:38
@ NPC_RED_SPAWNER
Definition: blackwing_lair.h:72
@ NPC_BRONZE_SPAWNER
Definition: blackwing_lair.h:74
@ NPC_BLACK_SPAWNER
Definition: blackwing_lair.h:71
@ NPC_BLUE_SPAWNER
Definition: blackwing_lair.h:75
@ NPC_GREEN_SPAWNER
Definition: blackwing_lair.h:73
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:79
Definition: ScriptedCreature.h:467
InstanceScript *const instance
Definition: ScriptedCreature.h:474
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
uint32 _nefarianLeftTunnel
Definition: boss_nefarian.cpp:524
void Initialize()
Definition: boss_nefarian.cpp:263
uint32 _nefarianRightTunnel
Definition: boss_nefarian.cpp:523

References _nefarianLeftTunnel, _nefarianRightTunnel, DATA_NEFARIAN_LEFT_TUNNEL, DATA_NEFARIAN_RIGHT_TUNNEL, ZoneScript::GetData(), Initialize(), BossAI::instance, NPC_BLACK_SPAWNER, NPC_BLUE_SPAWNER, NPC_BRONZE_SPAWNER, NPC_GREEN_SPAWNER, NPC_RED_SPAWNER, Acore::Containers::RandomResize(), and ZoneScript::SetData().

Member Function Documentation

◆ BeginEvent()

void boss_victor_nefarius::boss_victor_nefariusAI::BeginEvent ( )
inline
367 {
369
371
373 me->SetCombatMovement(false);
374 me->SetImmuneToPC(false);
375 AttackStart(SelectTarget(SelectTargetMethod::Random, 0, 200.f, true));
376 events.ScheduleEvent(EVENT_SHADOWBLINK, 500ms);
377 events.ScheduleEvent(EVENT_SHADOW_BOLT, 3s);
378 events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 13s, 15s);
379 events.ScheduleEvent(EVENT_FEAR, 10s, 20s);
380 events.ScheduleEvent(EVENT_SILENCE, 20s, 25s);
381 events.ScheduleEvent(EVENT_MIND_CONTROL, 30s, 35s);
382 events.ScheduleEvent(EVENT_SPAWN_ADDS, 10s);
383 }
events
Definition: boss_sartura.cpp:43
Talk
Definition: hyjal.cpp:82
@ SAY_GAMESBEGIN_2
Definition: boss_nefarian.cpp:77
@ SPELL_NEFARIANS_BARRIER
Definition: boss_nefarian.cpp:145
@ EVENT_SHADOW_BOLT_VOLLEY
Definition: boss_nefarian.cpp:39
@ EVENT_MIND_CONTROL
Definition: boss_nefarian.cpp:42
@ EVENT_FEAR
Definition: boss_nefarian.cpp:40
@ EVENT_SPAWN_ADDS
Definition: boss_nefarian.cpp:35
@ EVENT_SHADOWBLINK
Definition: boss_nefarian.cpp:43
@ EVENT_SILENCE
Definition: boss_nefarian.cpp:41
@ EVENT_SHADOW_BOLT
Definition: boss_nefarian.cpp:38
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
Creature * me
Definition: ScriptedCreature.h:280
void _JustEngagedWith()
Definition: ScriptedCreature.cpp:656
void SetCombatMovement(bool allowMovement)
Definition: Creature.cpp:3846
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13611

References BossAI::_JustEngagedWith(), ScriptedAI::AttackStart(), UnitAI::DoCast(), EVENT_FEAR, EVENT_MIND_CONTROL, EVENT_SHADOW_BOLT, EVENT_SHADOW_BOLT_VOLLEY, EVENT_SHADOWBLINK, EVENT_SILENCE, EVENT_SPAWN_ADDS, ScriptedAI::me, SAY_GAMESBEGIN_2, UnitAI::SelectTarget(), Creature::SetCombatMovement(), Unit::SetImmuneToPC(), and SPELL_NEFARIANS_BARRIER.

Referenced by UpdateAI().

◆ DoAction()

void boss_victor_nefarius::boss_victor_nefariusAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

327 {
328 if (action == ACTION_RESET)
329 {
332 }
333
334 if (action == ACTION_ADD_KILLED)
335 {
336 KilledAdds++;
337
339 {
341 {
342 nefarian->setActive(true);
343 nefarian->SetCanFly(true);
344 nefarian->SetDisableGravity(true);
345 nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false);
346 }
347
348 events.Reset();
350 me->SetVisible(false);
351 // Stop spawning adds
356 }
357 }
358 }
@ NPC_NEFARIAN
Definition: blackwing_lair.h:68
Position const NefarianSpawn
Definition: boss_nefarian.cpp:198
@ MAX_DRAKONID_KILLED
Definition: boss_nefarian.cpp:189
@ SPELL_ROOT_SELF
Definition: boss_nefarian.cpp:174
@ NEFARIAN_PATH
Definition: boss_nefarian.cpp:109
@ ACTION_SPAWNER_STOP
Definition: boss_nefarian.cpp:65
@ ACTION_RESET
Definition: boss_nefarian.cpp:62
@ ACTION_ADD_KILLED
Definition: boss_nefarian.cpp:64
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
Definition: ScriptedCreature.h:167
SummonList summons
Definition: ScriptedCreature.h:511
Definition: Creature.h:43
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
void SetVisible(bool x)
Definition: Unit.cpp:14232
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
uint32 KilledAdds
Definition: boss_nefarian.cpp:522

References _nefarianLeftTunnel, _nefarianRightTunnel, ACTION_ADD_KILLED, ACTION_RESET, ACTION_SPAWNER_STOP, SummonList::DespawnAll(), SummonList::DoAction(), UnitAI::DoCastSelf(), KilledAdds, MAX_DRAKONID_KILLED, ScriptedAI::me, NEFARIAN_PATH, NefarianSpawn, NPC_NEFARIAN, Unit::RemoveAura(), Unit::SetVisible(), SPELL_ROOT_SELF, WorldObject::SummonCreature(), and BossAI::summons.

◆ Initialize()

void boss_victor_nefarius::boss_victor_nefariusAI::Initialize ( )
inline
264 {
265 KilledAdds = 0;
266 }

References KilledAdds.

Referenced by boss_victor_nefariusAI(), and Reset().

◆ JustDied()

void boss_victor_nefarius::boss_victor_nefariusAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

361 {
364 }
@ DONE
Definition: InstanceScript.h:60
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:373
void SaveToDB()
Definition: InstanceScript.cpp:41

References DATA_NEFARIAN, DONE, BossAI::instance, InstanceScript::SaveToDB(), and InstanceScript::SetBossState().

◆ JustReachedHome()

void boss_victor_nefarius::boss_victor_nefariusAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

304 {
305 Reset();
306 }
void Reset() override
Definition: boss_nefarian.cpp:268

References Reset().

◆ JustSummoned()

void boss_victor_nefarius::boss_victor_nefariusAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

309 {
310 if (summon->GetEntry() != NPC_NEFARIAN)
311 {
312 BossAI::JustSummoned(summon);
313 }
314 }
void JustSummoned(Creature *summon) override
Definition: ScriptedCreature.cpp:703
uint32 GetEntry() const
Definition: Object.h:115

References Object::GetEntry(), BossAI::JustSummoned(), and NPC_NEFARIAN.

◆ Reset()

void boss_victor_nefarius::boss_victor_nefariusAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

269 {
270 Initialize();
271
272 if (me->GetMapId() == 469)
273 {
274 if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true))
275 {
276 // Nefarian is spawned and he didn't finish his intro path yet, despawn it manually.
277 if (nefarian->GetMotionMaster()->GetCurrentMovementGeneratorType() == MovementGeneratorType::WAYPOINT_MOTION_TYPE)
278 {
279 nefarian->DespawnOrUnsummon();
280 }
281 std::list<GameObject*> drakonidBones;
283 for (auto const& bones : drakonidBones)
284 {
285 bones->DespawnOrUnsummon();
286 }
287 }
288 else
289 {
290 _Reset();
291 }
292
293 me->SetVisible(true);
294 me->SetPhaseMask(1, true);
300 }
301 }
@ GO_DRAKONID_BONES
Definition: boss_nefarian.cpp:114
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
#define DEFAULT_VISIBILITY_INSTANCE
Definition: ObjectDefines.h:41
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
Definition: UnitDefines.h:38
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
void _Reset()
Definition: ScriptedCreature.cpp:624
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2504
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
uint32 GetMapId() const
Definition: Position.h:275
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:726
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: Unit.cpp:19049
void SetStandState(uint8 state)
Definition: Unit.cpp:16726
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714

References BossAI::_Reset(), DEFAULT_VISIBILITY_INSTANCE, FACTION_FRIENDLY, WorldObject::FindNearestCreature(), WorldObject::GetGameObjectListWithEntryInGrid(), WorldLocation::GetMapId(), GO_DRAKONID_BONES, Initialize(), ScriptedAI::me, NPC_NEFARIAN, Unit::RemoveAura(), Unit::RemoveUnitFlag(), Unit::SetFaction(), Unit::SetNpcFlag(), Unit::SetPhaseMask(), Unit::SetStandState(), Unit::SetVisible(), SPELL_NEFARIANS_BARRIER, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_FLAG_GOSSIP, and UNIT_STAND_STATE_SIT_HIGH_CHAIR.

Referenced by JustReachedHome().

◆ SetData()

void boss_victor_nefarius::boss_victor_nefariusAI::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from UnitAI.

386 {
387 if (type == 1 && data == 1)
388 {
389 me->StopMoving();
390 events.ScheduleEvent(EVENT_PATH_2, 9s);
391 }
392
393 if (type == 1 && data == 2)
394 events.ScheduleEvent(EVENT_SUCCESS_1, 5s);
395 }
@ EVENT_SUCCESS_1
Definition: boss_nefarian.cpp:55
@ EVENT_PATH_2
Definition: boss_nefarian.cpp:53
void StopMoving()
Definition: Unit.cpp:16650

References EVENT_PATH_2, EVENT_SUCCESS_1, ScriptedAI::me, and Unit::StopMoving().

◆ sGossipSelect()

void boss_victor_nefarius::boss_victor_nefariusAI::sGossipSelect ( Player player,
uint32  sender,
uint32  action 
)
inlineoverridevirtual

Reimplemented from UnitAI.

502 {
503 if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID)
504 {
505 // pussywizard:
508 return;
509
510 CloseGossipMenuFor(player);
512 events.ScheduleEvent(EVENT_START_EVENT, 4s);
517 me->SetImmuneToPC(true);
518 }
519 }
@ SAY_GAMESBEGIN_1
Definition: boss_nefarian.cpp:76
@ GOSSIP_OPTION_ID
Definition: boss_nefarian.cpp:102
@ GOSSIP_ID
Definition: boss_nefarian.cpp:101
@ EVENT_START_EVENT
Definition: boss_nefarian.cpp:37
@ FACTION_DRAGONFLIGHT_BLACK
Definition: SharedDefines.h:210
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
Definition: InstanceScript.h:142
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235

References CloseGossipMenuFor(), DATA_NEFARIAN, DONE, EVENT_START_EVENT, FACTION_DRAGONFLIGHT_BLACK, InstanceScript::GetBossState(), WorldObject::GetInstanceScript(), GOSSIP_ID, GOSSIP_OPTION_ID, BossAI::instance, ScriptedAI::me, Unit::RemoveNpcFlag(), SAY_GAMESBEGIN_1, Unit::SetFaction(), Unit::SetImmuneToPC(), Unit::SetStandState(), Unit::SetUnitFlag(), UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_FLAG_GOSSIP, and UNIT_STAND_STATE_STAND.

◆ SummonedCreatureDies()

void boss_victor_nefarius::boss_victor_nefariusAI::SummonedCreatureDies ( Creature summon,
Unit  
)
inlineoverridevirtual

Reimplemented from CreatureAI.

317 {
318 if (summon->GetEntry() == NPC_NEFARIAN)
319 {
322 me->KillSelf();
323 }
324 }
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:1159

References _nefarianLeftTunnel, _nefarianRightTunnel, SummonList::DespawnEntry(), Object::GetEntry(), Unit::KillSelf(), ScriptedAI::me, NPC_NEFARIAN, and BossAI::summons.

◆ UpdateAI()

void boss_victor_nefarius::boss_victor_nefariusAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from BossAI.

398 {
399 if (!UpdateVictim())
400 {
401 events.Update(diff);
402
403 while (uint32 eventId = events.ExecuteEvent())
404 {
405 switch (eventId)
406 {
407 case EVENT_PATH_2:
409 events.ScheduleEvent(EVENT_CHAOS_1, 7s);
410 break;
411 case EVENT_CHAOS_1:
412 if (Creature* gyth = me->FindNearestCreature(NPC_GYTH, 75.0f, true))
413 {
414 me->SetFacingToObject(gyth);
416 }
417 events.ScheduleEvent(EVENT_CHAOS_2, 2s);
418 break;
419 case EVENT_CHAOS_2:
421 me->SetFacingTo(1.570796f);
422 break;
423 case EVENT_SUCCESS_1:
424 if (Unit* player = me->SelectNearestPlayer(60.0f))
425 {
426 me->SetFacingToObject(player);
428 if (GameObject* portcullis1 = me->FindNearestGameObject(GO_PORTCULLIS_ACTIVE, 65.0f))
429 portcullis1->SetGoState(GO_STATE_ACTIVE);
431 portcullis2->SetGoState(GO_STATE_ACTIVE);
432 }
433 events.ScheduleEvent(EVENT_SUCCESS_2, 4s);
434 break;
435 case EVENT_SUCCESS_2:
437 me->DespawnOrUnsummon(1000);
438 break;
439 case EVENT_PATH_3:
441 break;
443 BeginEvent();
444 break;
445 default:
446 break;
447 }
448 }
449 return;
450 }
451
452 // Only do this if we haven't spawned nefarian yet
454 {
455 events.Update(diff);
456
458 return;
459
460 while (uint32 eventId = events.ExecuteEvent())
461 {
462 switch (eventId)
463 {
466 events.ScheduleEvent(EVENT_SHADOW_BOLT, 2s, 4s);
467 break;
470 events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 19s, 25s);
471 break;
472 case EVENT_FEAR:
474 events.ScheduleEvent(EVENT_FEAR, 10s, 20s);
475 break;
476 case EVENT_SILENCE:
478 events.ScheduleEvent(EVENT_SILENCE, 14s,23s);
479 break;
482 events.ScheduleEvent(EVENT_MIND_CONTROL, 24s, 30s);
483 break;
486 events.ScheduleEvent(EVENT_SHADOWBLINK, 30s, 40s);
487 break;
488 case EVENT_SPAWN_ADDS:
489 // Spawn the spawners.
492 break;
493 }
494
496 return;
497 }
498 }
499 }
std::uint32_t uint32
Definition: Define.h:107
@ GO_PORTCULLIS_TOBOSSROOMS
Definition: boss_nefarian.cpp:116
@ GO_PORTCULLIS_ACTIVE
Definition: boss_nefarian.cpp:115
@ SAY_CHAOS_SPELL
Definition: boss_nefarian.cpp:72
@ SAY_SUCCESS
Definition: boss_nefarian.cpp:73
@ NPC_GYTH
Definition: boss_nefarian.cpp:126
@ SPELL_SHADOW_COMMAND
Definition: boss_nefarian.cpp:139
@ SPELL_SHADOWBLINK
Definition: boss_nefarian.cpp:141
@ SPELL_SILENCE
Definition: boss_nefarian.cpp:138
@ SPELL_FEAR
Definition: boss_nefarian.cpp:140
@ SPELL_SHADOWBOLT
Definition: boss_nefarian.cpp:136
@ SPELL_CHROMATIC_CHAOS
Definition: boss_nefarian.cpp:133
@ SPELL_SHADOWBOLT_VOLLEY
Definition: boss_nefarian.cpp:137
@ SPELL_VAELASTRASZZ_SPAWN
Definition: boss_nefarian.cpp:134
@ NEFARIUS_PATH_2
Definition: boss_nefarian.cpp:107
@ NEFARIUS_PATH_3
Definition: boss_nefarian.cpp:108
@ EVENT_CHAOS_1
Definition: boss_nefarian.cpp:51
@ EVENT_CHAOS_2
Definition: boss_nefarian.cpp:52
@ EVENT_PATH_3
Definition: boss_nefarian.cpp:54
@ EVENT_SUCCESS_2
Definition: boss_nefarian.cpp:56
Position const spawnerPositions[2]
Definition: boss_nefarian.cpp:192
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
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.
Definition: UnitAI.cpp:259
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
bool UpdateVictim()
Definition: CreatureAI.cpp:280
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
Definition: GameObject.h:120
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2466
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2484
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:852
void BeginEvent()
Definition: boss_nefarian.cpp:366

References _nefarianLeftTunnel, _nefarianRightTunnel, BeginEvent(), Creature::DespawnOrUnsummon(), UnitAI::DoCast(), UnitAI::DoCastAOE(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastSelf(), EVENT_CHAOS_1, EVENT_CHAOS_2, EVENT_FEAR, EVENT_MIND_CONTROL, EVENT_PATH_2, EVENT_PATH_3, EVENT_SHADOW_BOLT, EVENT_SHADOW_BOLT_VOLLEY, EVENT_SHADOWBLINK, EVENT_SILENCE, EVENT_SPAWN_ADDS, EVENT_START_EVENT, EVENT_SUCCESS_1, EVENT_SUCCESS_2, WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), Unit::GetMotionMaster(), GO_PORTCULLIS_ACTIVE, GO_PORTCULLIS_TOBOSSROOMS, GO_STATE_ACTIVE, Unit::HasUnitState(), KilledAdds, MAX_DRAKONID_KILLED, ScriptedAI::me, MotionMaster::MovePath(), NEFARIUS_PATH_2, NEFARIUS_PATH_3, NPC_GYTH, SAY_CHAOS_SPELL, SAY_SUCCESS, WorldObject::SelectNearestPlayer(), Unit::SetFacingTo(), Unit::SetFacingToObject(), spawnerPositions, SPELL_CHROMATIC_CHAOS, SPELL_FEAR, SPELL_SHADOW_COMMAND, SPELL_SHADOWBLINK, SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_VOLLEY, SPELL_SILENCE, SPELL_VAELASTRASZZ_SPAWN, WorldObject::SummonCreature(), UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _nefarianLeftTunnel

uint32 boss_victor_nefarius::boss_victor_nefariusAI::_nefarianLeftTunnel
private

◆ _nefarianRightTunnel

uint32 boss_victor_nefarius::boss_victor_nefariusAI::_nefarianRightTunnel
private

◆ KilledAdds

uint32 boss_victor_nefarius::boss_victor_nefariusAI::KilledAdds
private

Referenced by DoAction(), Initialize(), and UpdateAI().