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

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
 
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
586 : ScriptedAI(creature)
587 {
588 pos = 0;
589 counter = 0;
590 unitList.clear();
592 me->SetSpeed(MOVE_WALK, 3.0f, true);
593 }
@ MOVE_WALK
Definition: Unit.h:378
@ SPELL_HORSEMAN_MOUNT
Definition: hallows_end.cpp:249
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:14323
GuidList unitList
Definition: hallows_end.cpp:598
uint32 counter
Definition: hallows_end.cpp:597
int32 pos
Definition: hallows_end.cpp:599

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

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
882 {
883 float radius = 100.0f;
884 std::list<Player*> players;
885 Acore::AnyPlayerInObjectRangeCheck checker(me, radius);
887 Cell::VisitWorldObjects(me, searcher, radius);
888
889 for (Player* player : players)
890 {
891 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_H);
892 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_A);
893 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_H);
894 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_A);
895 }
896 }
@ QUEST_LET_THE_FIRES_COME_A
Definition: hallows_end.cpp:243
@ QUEST_STOP_THE_FIRES_H
Definition: hallows_end.cpp:246
@ QUEST_STOP_THE_FIRES_A
Definition: hallows_end.cpp:245
@ QUEST_LET_THE_FIRES_COME_H
Definition: hallows_end.cpp:244
Definition: Player.h:1046

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.

626 {
627 pos = param;
628 }

References pos.

◆ EnterEvadeMode()

void npc_hallows_end_soh::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ FinishEvent()

void npc_hallows_end_soh::FinishEvent ( bool  failed)
inline
840 {
841 if (failed)
842 {
844 for (ObjectGuid const& guid : unitList)
845 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
846 c->RemoveAllAuras();
847
849 }
850 else
851 {
853 float x, y, z;
854 GetPosToLand(x, y, z);
857 me->GetMotionMaster()->MovePoint(8, x, y, z);
858 }
859 }
@ TALK_SHADE_FAILED
Definition: hallows_end.cpp:273
@ TALK_SHADE_DEFEATED
Definition: hallows_end.cpp:274
Talk
Definition: boss_fathomlord_karathress.cpp:23
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void MoveIdle()
Definition: MotionMaster.cpp:231
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void GetPosToLand(float &x, float &y, float &z)
Definition: hallows_end.cpp:630

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.

701 {
702 return playerCount;
703 }

References playerCount.

◆ GetPosToLand()

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

References pos.

Referenced by FinishEvent(), and JustDied().

◆ JustDied()

void npc_hallows_end_soh::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

873 {
875 float x, y, z;
876 GetPosToLand(x, y, z);
877 me->CastSpell(x, y, z, SPELL_SUMMON_LANTERN, true);
879 }
@ TALK_SHADE_DEATH
Definition: hallows_end.cpp:275
@ SPELL_SUMMON_LANTERN
Definition: hallows_end.cpp:255
void CompleteQuest()
Definition: hallows_end.cpp:881

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.

603 {
604 scheduler.Schedule(6s, [this](TaskContext context)
605 {
606 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.f, true))
607 {
609 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
611 }
612
613 context.Repeat(12s);
614 })
615 .Schedule(7s, [this](TaskContext context)
616 {
618
619 context.Repeat(8s);
620 });
621 }
@ SPELL_HORSEMAN_CONFLAGRATION_SOUND
Definition: hallows_end.cpp:257
@ SPELL_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:256
@ SPELL_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:258
@ TALK_SHADE_CONFLAGRATION
Definition: hallows_end.cpp:269
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:217
Definition: TaskScheduler.h:400
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:470
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
TaskScheduler scheduler
Definition: hallows_end.cpp:600

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.

623{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

862 {
863 if (type == POINT_MOTION_TYPE && point == 8)
864 {
866 me->SetCanFly(false);
867 me->SetDisableGravity(false);
868 events.ScheduleEvent(4, 2000);
869 }
870 }
@ 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:3092
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3177
void RemoveAllAuras()
Definition: Unit.cpp:5239

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

◆ Reset()

void npc_hallows_end_soh::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

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

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.

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

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