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

Public Member Functions

 npc_hallows_end_soh (Creature *creature)
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void MoveInLineOfSight (Unit *) override
 
void DoAction (int32 param) override
 
void GetPosToLand (float &x, float &y, float &z)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason) override
 
uint32 GetData (uint32) const override
 
void UpdateAI (uint32 diff) override
 
void CastFires (bool intial)
 
void FinishEvent (bool failed)
 
void MovementInform (uint32 type, uint32 point) override
 
void JustDied (Unit *) override
 
void CompleteQuest ()
 
- 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 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)
 
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 OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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
 

Public Attributes

EventMap events
 
uint32 playerCount
 
uint32 counter
 
GuidList unitList
 
int32 pos
 
TaskScheduler scheduler
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_hallows_end_soh()

npc_hallows_end_soh::npc_hallows_end_soh ( Creature creature)
inline
588 : ScriptedAI(creature)
589 {
590 pos = 0;
591 counter = 0;
592 unitList.clear();
594 me->SetSpeed(MOVE_WALK, 3.0f, true);
595 }
@ MOVE_WALK
Definition: Unit.h:378
@ SPELL_HORSEMAN_MOUNT
Definition: hallows_end.cpp:251
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
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
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14414
GuidList unitList
Definition: hallows_end.cpp:600
uint32 counter
Definition: hallows_end.cpp:599
int32 pos
Definition: hallows_end.cpp:601

References Unit::CastSpell(), counter, ScriptedAI::me, MOVE_WALK, pos, Unit::SetSpeed(), SPELL_HORSEMAN_MOUNT, and unitList.

Member Function Documentation

◆ CastFires()

void npc_hallows_end_soh::CastFires ( bool  intial)
inline
788 {
789 std::vector<Unit*> tmpList;
790 for (ObjectGuid const& guid : unitList)
791 {
792 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
793 {
794 if (!c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
795 {
796 tmpList.push_back(c);
797 }
798 }
799 }
800
801 if (tmpList.empty())
802 {
803 return;
804 }
805
806 std::list<Player*> players;
809 Cell::VisitWorldObjects(me, searcher, 60.f);
810 if (players.empty())
811 {
812 return;
813 }
814
815 playerCount = static_cast<uint32>(players.size()) - 1;
816
817 if (!intial)
818 {
819 float playerRate = std::max(0.f, 0.5f - playerCount * 0.25f);
820
821 // If there are more burning triggers than players, do not cast next fire
822 if (tmpList.size() < unitList.size() * playerRate)
823 {
824 return;
825 }
826 }
827 else
828 playerCount += 1;
829
830 uint32 sizeCount = (playerCount / 3) + 1;
831 if (intial && playerCount > 0)
832 {
833 sizeCount += playerCount % 2;
834 }
835
836 Acore::Containers::RandomResize(tmpList, sizeCount);
837 for (Unit* trigger : tmpList)
838 me->CastSpell(trigger, SPELL_START_FIRE, true);
839 }
std::uint32_t uint32
Definition: Define.h:108
@ SPELL_AURA_PERIODIC_DUMMY
Definition: SpellAuraDefines.h:289
@ SPELL_START_FIRE
Definition: hallows_end.cpp:253
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:81
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
Definition: ObjectGuid.h:120
Definition: Unit.h:1302
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:193
Definition: GridNotifiers.h:522
Definition: GridNotifiers.h:1350
uint32 playerCount
Definition: hallows_end.cpp:598

References Unit::CastSpell(), ObjectAccessor::GetUnit(), ScriptedAI::me, playerCount, Acore::Containers::RandomResize(), SPELL_AURA_PERIODIC_DUMMY, SPELL_START_FIRE, unitList, and Cell::VisitWorldObjects().

Referenced by UpdateAI().

◆ CompleteQuest()

void npc_hallows_end_soh::CompleteQuest ( )
inline
884 {
885 float radius = 100.0f;
886 std::list<Player*> players;
887 Acore::AnyPlayerInObjectRangeCheck checker(me, radius);
889 Cell::VisitWorldObjects(me, searcher, radius);
890
891 for (Player* player : players)
892 {
893 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_H);
894 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_A);
895 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_H);
896 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_A);
897 }
898 }
@ QUEST_LET_THE_FIRES_COME_A
Definition: hallows_end.cpp:245
@ QUEST_STOP_THE_FIRES_H
Definition: hallows_end.cpp:248
@ QUEST_STOP_THE_FIRES_A
Definition: hallows_end.cpp:247
@ QUEST_LET_THE_FIRES_COME_H
Definition: hallows_end.cpp:246
Definition: Player.h:1056

References ScriptedAI::me, QUEST_LET_THE_FIRES_COME_A, QUEST_LET_THE_FIRES_COME_H, QUEST_STOP_THE_FIRES_A, QUEST_STOP_THE_FIRES_H, and Cell::VisitWorldObjects().

Referenced by JustDied().

◆ DoAction()

void npc_hallows_end_soh::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

628 {
629 pos = param;
630 }

References pos.

◆ EnterEvadeMode()

void npc_hallows_end_soh::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

698 {
700 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117

References Creature::DespawnOrUnsummon(), and ScriptedAI::me.

◆ FinishEvent()

void npc_hallows_end_soh::FinishEvent ( bool  failed)
inline
842 {
843 if (failed)
844 {
846 for (ObjectGuid const& guid : unitList)
847 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
848 c->RemoveAllAuras();
849
851 }
852 else
853 {
855 float x, y, z;
856 GetPosToLand(x, y, z);
859 me->GetMotionMaster()->MovePoint(8, x, y, z);
860 }
861 }
@ TALK_SHADE_FAILED
Definition: hallows_end.cpp:275
@ TALK_SHADE_DEFEATED
Definition: hallows_end.cpp:276
Talk
Definition: boss_fathomlord_karathress.cpp:25
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void MoveIdle()
Definition: MotionMaster.cpp:232
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void GetPosToLand(float &x, float &y, float &z)
Definition: hallows_end.cpp:632

References MotionMaster::Clear(), Creature::DespawnOrUnsummon(), Unit::GetMotionMaster(), GetPosToLand(), ObjectAccessor::GetUnit(), ScriptedAI::me, MotionMaster::MoveIdle(), MotionMaster::MovePoint(), TALK_SHADE_DEFEATED, TALK_SHADE_FAILED, and unitList.

Referenced by UpdateAI().

◆ GetData()

uint32 npc_hallows_end_soh::GetData ( uint32  ) const
inlineoverridevirtual

Reimplemented from UnitAI.

703 {
704 return playerCount;
705 }

References playerCount.

◆ GetPosToLand()

void npc_hallows_end_soh::GetPosToLand ( float &  x,
float &  y,
float &  z 
)
inline
633 {
634 switch (pos)
635 {
636 case 235431:
637 x = -9445.1f;
638 y = 63.27f;
639 z = 58.16f;
640 break;
641 case 235432:
642 x = -5616.30f;
643 y = -481.89f;
644 z = 398.99f;
645 break;
646 case 235433:
647 x = -4198.1f;
648 y = -12509.13f;
649 z = 46.6f;
650 break;
651 case 235434:
652 x = 360.9f;
653 y = -4735.5f;
654 z = 11.773f;
655 break;
656 case 235435:
657 x = 2229.4f;
658 y = 263.1f;
659 z = 36.13f;
660 break;
661 case 235436:
662 x = 9532.9f;
663 y = -6833.8f;
664 z = 18.5f;
665 break;
666 default:
667 x = 0;
668 y = 0;
669 z = 0;
670 break;
671 }
672 }

References pos.

Referenced by FinishEvent(), and JustDied().

◆ JustDied()

void npc_hallows_end_soh::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

875 {
877 float x, y, z;
878 GetPosToLand(x, y, z);
879 me->CastSpell(x, y, z, SPELL_SUMMON_LANTERN, true);
881 }
@ TALK_SHADE_DEATH
Definition: hallows_end.cpp:277
@ SPELL_SUMMON_LANTERN
Definition: hallows_end.cpp:257
void CompleteQuest()
Definition: hallows_end.cpp:883

References Unit::CastSpell(), CompleteQuest(), GetPosToLand(), ScriptedAI::me, SPELL_SUMMON_LANTERN, and TALK_SHADE_DEATH.

◆ JustEngagedWith()

void npc_hallows_end_soh::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

605 {
606 scheduler.Schedule(6s, [this](TaskContext context)
607 {
608 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.f, true))
609 {
611 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
613 }
614
615 context.Repeat(12s);
616 })
617 .Schedule(7s, [this](TaskContext context)
618 {
620
621 context.Repeat(8s);
622 });
623 }
@ SPELL_HORSEMAN_CONFLAGRATION_SOUND
Definition: hallows_end.cpp:259
@ SPELL_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:258
@ SPELL_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:260
@ TALK_SHADE_CONFLAGRATION
Definition: hallows_end.cpp:271
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: TaskScheduler.h:418
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:488
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
TaskScheduler scheduler
Definition: hallows_end.cpp:602

References Unit::CastSpell(), UnitAI::DoCastVictim(), ScriptedAI::me, TaskContext::Repeat(), TaskScheduler::Schedule(), scheduler, UnitAI::SelectTarget(), SPELL_HORSEMAN_CLEAVE, SPELL_HORSEMAN_CONFLAGRATION, SPELL_HORSEMAN_CONFLAGRATION_SOUND, and TALK_SHADE_CONFLAGRATION.

◆ MoveInLineOfSight()

void npc_hallows_end_soh::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

625{}

◆ MovementInform()

void npc_hallows_end_soh::MovementInform ( uint32  type,
uint32  point 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

864 {
865 if (type == POINT_MOTION_TYPE && point == 8)
866 {
868 me->SetCanFly(false);
869 me->SetDisableGravity(false);
870 events.ScheduleEvent(4, 2000);
871 }
872 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
events
Definition: boss_sartura.cpp:43
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3194
void RemoveAllAuras()
Definition: Unit.cpp:5259

References ScriptedAI::me, POINT_MOTION_TYPE, Unit::RemoveAllAuras(), Creature::SetCanFly(), and Creature::SetDisableGravity().

◆ Reset()

void npc_hallows_end_soh::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

675 {
676 playerCount = 0;
677 unitList.clear();
678 std::list<Creature*> temp;
680 for (std::list<Creature*>::const_iterator itr = temp.begin(); itr != temp.end(); ++itr)
681 {
682 unitList.push_back((*itr)->GetGUID());
683 }
684
685 events.ScheduleEvent(1, 3s);
686 events.ScheduleEvent(2, 25s);
687 events.ScheduleEvent(2, 43s);
688 events.ScheduleEvent(3, 63s);
689
692
693 me->SetCanFly(true);
694 me->SetDisableGravity(true);
695 }
@ REACT_PASSIVE
Definition: Unit.h:1035
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ NPC_FIRE_TRIGGER
Definition: hallows_end.cpp:264
void SetReactState(ReactStates st)
Definition: Creature.h:90
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3040
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495

References WorldObject::GetCreaturesWithEntryInRange(), ScriptedAI::me, NPC_FIRE_TRIGGER, playerCount, REACT_PASSIVE, Creature::SetCanFly(), Creature::SetDisableGravity(), Creature::SetReactState(), Unit::SetUnitFlag(), UNIT_FLAG_NON_ATTACKABLE, and unitList.

◆ UpdateAI()

void npc_hallows_end_soh::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

708 {
709 events.Update(diff);
711 return;
712
713 switch (events.ExecuteEvent())
714 {
715 case 1:
717 break;
718 case 2:
719 {
720 CastFires(true);
721 break;
722 }
723 case 3:
724 {
725 bool checkBurningTriggers = false;
726 for (ObjectGuid const& guid : unitList)
727 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
728 if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
729 {
730 checkBurningTriggers = true;
731 break;
732 }
733
734 if (!checkBurningTriggers)
735 {
736 FinishEvent(false);
737 return;
738 }
739
740 counter++;
741 if (counter > 21)
742 {
743 bool failed = false;
744 for (ObjectGuid const& guid : unitList)
745 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
746 if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
747 {
748 failed = true;
749 break;
750 }
751
752 FinishEvent(failed);
753 return;
754 }
755 if (counter == 5)
756 {
758 }
759 else if (counter == 15)
760 {
762 }
763
764 CastFires(false);
765 events.RepeatEvent(15000);
766 break;
767 }
768 case 4:
769 {
772 if (Unit* target = me->SelectNearestPlayer(30.0f))
773 AttackStart(target);
774 break;
775 }
776 }
777
778 if (!UpdateVictim())
779 return;
780
781 scheduler.Update(diff, [this]
782 {
784 });
785 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ UNIT_FLAG_NONE
Definition: Unit.h:447
@ TALK_SHADE_PREPARE
Definition: hallows_end.cpp:272
@ TALK_SHADE_START_EVENT
Definition: hallows_end.cpp:273
@ TALK_SHADE_MORE_FIRES
Definition: hallows_end.cpp:274
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2461
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1497
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void FinishEvent(bool failed)
Definition: hallows_end.cpp:841
void CastFires(bool intial)
Definition: hallows_end.cpp:787

References ScriptedAI::AttackStart(), CastFires(), counter, UnitAI::DoMeleeAttackIfReady(), FinishEvent(), ObjectAccessor::GetUnit(), Unit::HasUnitState(), ScriptedAI::me, REACT_AGGRESSIVE, Unit::ReplaceAllUnitFlags(), scheduler, WorldObject::SelectNearestPlayer(), Creature::SetReactState(), SPELL_AURA_PERIODIC_DUMMY, TALK_SHADE_MORE_FIRES, TALK_SHADE_PREPARE, TALK_SHADE_START_EVENT, UNIT_FLAG_NONE, UNIT_STATE_CASTING, unitList, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ counter

uint32 npc_hallows_end_soh::counter

Referenced by npc_hallows_end_soh(), and UpdateAI().

◆ events

EventMap npc_hallows_end_soh::events

◆ playerCount

uint32 npc_hallows_end_soh::playerCount

Referenced by CastFires(), GetData(), and Reset().

◆ pos

int32 npc_hallows_end_soh::pos

◆ scheduler

TaskScheduler npc_hallows_end_soh::scheduler

Referenced by JustEngagedWith(), and UpdateAI().

◆ unitList

GuidList npc_hallows_end_soh::unitList