AzeorthCore 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 EnterCombat (Unit *) override
 
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 EnterCombat (Unit *) override
 
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)
 Cast Spell. More...
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 Play sound. More...
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoResetThreat ()
 Reset Threat. More...
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 Modify Unit Threat. More...
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 Teleport player. More...
 
void DoTeleportAll (float x, float y, float z, float o)
 Teleport all. More...
 
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)
 Set Combat Movement. More...
 
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)
 
 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
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 ================== 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 *)
 
- 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, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectTargetMethod targetType)
 
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)
 
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
557 : ScriptedAI(creature)
558 {
559 pos = 0;
560 counter = 0;
561 unitList.clear();
563 me->SetSpeed(MOVE_WALK, 3.0f, true);
564 }
@ MOVE_WALK
Definition: Unit.h:378
@ SPELL_HORSEMAN_MOUNT
Definition: hallows_end.cpp:220
Definition: ScriptedCreature.h:177
Creature * me
Definition: ScriptedCreature.h:267
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:1428
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:15157
GuidList unitList
Definition: hallows_end.cpp:569
uint32 counter
Definition: hallows_end.cpp:568
int32 pos
Definition: hallows_end.cpp:570

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
757 {
758 std::vector<Unit*> tmpList;
759 for (ObjectGuid const& guid : unitList)
760 {
761 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
762 {
763 if (!c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
764 {
765 tmpList.push_back(c);
766 }
767 }
768 }
769
770 if (tmpList.empty())
771 {
772 return;
773 }
774
775 std::list<Player*> players;
778 Cell::VisitWorldObjects(me, searcher, 60.f);
779 if (players.empty())
780 {
781 return;
782 }
783
784 playerCount = static_cast<uint32>(players.size()) - 1;
785
786 if (!intial)
787 {
788 float playerRate = std::max(0.f, 0.5f - playerCount * 0.25f);
789
790 // If there are more burning triggers than players, do not cast next fire
791 if (tmpList.size() < unitList.size() * playerRate)
792 {
793 return;
794 }
795 }
796 else
797 playerCount += 1;
798
799 uint32 sizeCount = (playerCount / 3) + 1;
800 if (intial && playerCount > 0)
801 {
802 sizeCount += playerCount % 2;
803 }
804
805 Acore::Containers::RandomResize(tmpList, sizeCount);
806 for (Unit* trigger : tmpList)
807 me->CastSpell(trigger, SPELL_START_FIRE, true);
808 }
std::uint32_t uint32
Definition: Define.h:108
@ SPELL_AURA_PERIODIC_DUMMY
Definition: SpellAuraDefines.h:289
@ SPELL_START_FIRE
Definition: hallows_end.cpp:222
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:1353
uint32 playerCount
Definition: hallows_end.cpp:567

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
853 {
854 float radius = 100.0f;
855 std::list<Player*> players;
856 Acore::AnyPlayerInObjectRangeCheck checker(me, radius);
858 Cell::VisitWorldObjects(me, searcher, radius);
859
860 for (Player* player : players)
861 {
862 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_H);
863 player->AreaExploredOrEventHappens(QUEST_STOP_THE_FIRES_A);
864 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_H);
865 player->AreaExploredOrEventHappens(QUEST_LET_THE_FIRES_COME_A);
866 }
867 }
@ QUEST_LET_THE_FIRES_COME_A
Definition: hallows_end.cpp:214
@ QUEST_STOP_THE_FIRES_H
Definition: hallows_end.cpp:217
@ QUEST_STOP_THE_FIRES_A
Definition: hallows_end.cpp:216
@ QUEST_LET_THE_FIRES_COME_H
Definition: hallows_end.cpp:215
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.

597 {
598 pos = param;
599 }

References pos.

◆ EnterCombat()

void npc_hallows_end_soh::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

574 {
575 scheduler.Schedule(6s, [this](TaskContext context)
576 {
577 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.f, true))
578 {
580 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
582 }
583
584 context.Repeat(12s);
585 })
586 .Schedule(7s, [this](TaskContext context)
587 {
589
590 context.Repeat(8s);
591 });
592 }
@ SPELL_HORSEMAN_CONFLAGRATION_SOUND
Definition: hallows_end.cpp:228
@ SPELL_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:227
@ SPELL_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:229
@ TALK_SHADE_CONFLAGRATION
Definition: hallows_end.cpp:240
Talk
Definition: boss_fathomlord_karathress.cpp:23
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, int32 aura=0)
Definition: UnitAI.cpp:111
TaskScheduler scheduler
Definition: hallows_end.cpp:571

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.

◆ EnterEvadeMode()

void npc_hallows_end_soh::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

667 {
669 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Despawn or Unsummon creature. If creature is a TempSummon it will be unsummoned.
Definition: Creature.cpp:2154

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

◆ FinishEvent()

void npc_hallows_end_soh::FinishEvent ( bool  failed)
inline
811 {
812 if (failed)
813 {
815 for (ObjectGuid const& guid : unitList)
816 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
817 c->RemoveAllAuras();
818
820 }
821 else
822 {
824 float x, y, z;
825 GetPosToLand(x, y, z);
828 me->GetMotionMaster()->MovePoint(8, x, y, z);
829 }
830 }
@ TALK_SHADE_FAILED
Definition: hallows_end.cpp:244
@ TALK_SHADE_DEFEATED
Definition: hallows_end.cpp:245
MotionMaster * GetMotionMaster()
Definition: Unit.h:2530
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:601

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.

672 {
673 return playerCount;
674 }

References playerCount.

◆ GetPosToLand()

void npc_hallows_end_soh::GetPosToLand ( float &  x,
float &  y,
float &  z 
)
inline
602 {
603 switch (pos)
604 {
605 case 235431:
606 x = -9445.1f;
607 y = 63.27f;
608 z = 58.16f;
609 break;
610 case 235432:
611 x = -5616.30f;
612 y = -481.89f;
613 z = 398.99f;
614 break;
615 case 235433:
616 x = -4198.1f;
617 y = -12509.13f;
618 z = 46.6f;
619 break;
620 case 235434:
621 x = 360.9f;
622 y = -4735.5f;
623 z = 11.773f;
624 break;
625 case 235435:
626 x = 2229.4f;
627 y = 263.1f;
628 z = 36.13f;
629 break;
630 case 235436:
631 x = 9532.9f;
632 y = -6833.8f;
633 z = 18.5f;
634 break;
635 default:
636 x = 0;
637 y = 0;
638 z = 0;
639 break;
640 }
641 }

References pos.

Referenced by FinishEvent(), and JustDied().

◆ JustDied()

void npc_hallows_end_soh::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

844 {
846 float x, y, z;
847 GetPosToLand(x, y, z);
848 me->CastSpell(x, y, z, SPELL_SUMMON_LANTERN, true);
850 }
@ TALK_SHADE_DEATH
Definition: hallows_end.cpp:246
@ SPELL_SUMMON_LANTERN
Definition: hallows_end.cpp:226
void CompleteQuest()
Definition: hallows_end.cpp:852

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

◆ MoveInLineOfSight()

void npc_hallows_end_soh::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

594{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

833 {
834 if (type == POINT_MOTION_TYPE && point == 8)
835 {
837 me->SetCanFly(false);
838 me->SetDisableGravity(false);
839 events.ScheduleEvent(4, 2000);
840 }
841 }
@ 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:3197
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3282
void RemoveAllAuras()
Definition: Unit.cpp:6083

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

◆ Reset()

void npc_hallows_end_soh::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

644 {
645 playerCount = 0;
646 unitList.clear();
647 std::list<Creature*> temp;
649 for (std::list<Creature*>::const_iterator itr = temp.begin(); itr != temp.end(); ++itr)
650 {
651 unitList.push_back((*itr)->GetGUID());
652 }
653
654 events.ScheduleEvent(1, 3000);
655 events.ScheduleEvent(2, 25000);
656 events.ScheduleEvent(2, 43000);
657 events.ScheduleEvent(3, 63000);
658
661
662 me->SetCanFly(true);
663 me->SetDisableGravity(true);
664 }
@ REACT_PASSIVE
Definition: Unit.h:1023
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ NPC_FIRE_TRIGGER
Definition: hallows_end.cpp:233
void SetReactState(ReactStates st)
Definition: Creature.h:88
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3000
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1479

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.

677 {
678 events.Update(diff);
680 return;
681
682 switch (events.ExecuteEvent())
683 {
684 case 1:
686 break;
687 case 2:
688 {
689 CastFires(true);
690 break;
691 }
692 case 3:
693 {
694 bool checkBurningTriggers = false;
695 for (ObjectGuid const& guid : unitList)
696 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
697 if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
698 {
699 checkBurningTriggers = true;
700 break;
701 }
702
703 if (!checkBurningTriggers)
704 {
705 FinishEvent(false);
706 return;
707 }
708
709 counter++;
710 if (counter > 21)
711 {
712 bool failed = false;
713 for (ObjectGuid const& guid : unitList)
714 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
715 if (c->HasAuraType(SPELL_AURA_PERIODIC_DUMMY))
716 {
717 failed = true;
718 break;
719 }
720
721 FinishEvent(failed);
722 return;
723 }
724 if (counter == 5)
725 {
727 }
728 else if (counter == 15)
729 {
731 }
732
733 CastFires(false);
734 events.RepeatEvent(15000);
735 break;
736 }
737 case 4:
738 {
741 if (Unit* target = me->SelectNearestPlayer(30.0f))
742 AttackStart(target);
743 break;
744 }
745 }
746
747 if (!UpdateVictim())
748 return;
749
750 scheduler.Update(diff, [this]
751 {
753 });
754 }
@ 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:241
@ TALK_SHADE_START_EVENT
Definition: hallows_end.cpp:242
@ TALK_SHADE_MORE_FIRES
Definition: hallows_end.cpp:243
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:15
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:206
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2421
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1481
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
void FinishEvent(bool failed)
Definition: hallows_end.cpp:810
void CastFires(bool intial)
Definition: hallows_end.cpp:756

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 EnterCombat(), and UpdateAI().

◆ unitList

GuidList npc_hallows_end_soh::unitList