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
 Use to start attacking a target. Called just before JustEngagedWith()
 
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
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 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.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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 InitializeAI ()
 
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:
 
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.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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.
 
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.
 
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.
 
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
 

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)
 
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
589 : ScriptedAI(creature)
590 {
591 pos = 0;
592 counter = 0;
593 unitList.clear();
595 me->SetSpeed(MOVE_WALK, 3.0f, true);
596 }
@ MOVE_WALK
Definition UnitDefines.h:349
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:1179
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:14480
@ SPELL_HORSEMAN_MOUNT
Definition hallows_end.cpp:252
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
GuidList unitList
Definition hallows_end.cpp:601
uint32 counter
Definition hallows_end.cpp:600
int32 pos
Definition hallows_end.cpp:602

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
789 {
790 std::vector<Unit*> tmpList;
791 for (ObjectGuid const& guid : unitList)
792 {
793 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
794 {
795 if (!c->HasPeriodicDummyAura())
796 {
797 tmpList.push_back(c);
798 }
799 }
800 }
801
802 if (tmpList.empty())
803 {
804 return;
805 }
806
807 std::list<Player*> players;
810 Cell::VisitWorldObjects(me, searcher, 60.f);
811 if (players.empty())
812 {
813 return;
814 }
815
816 playerCount = static_cast<uint32>(players.size()) - 1;
817
818 if (!intial)
819 {
820 float playerRate = std::max(0.f, 0.5f - playerCount * 0.25f);
821
822 // If there are more burning triggers than players, do not cast next fire
823 if (tmpList.size() < unitList.size() * playerRate)
824 {
825 return;
826 }
827 }
828 else
829 playerCount += 1;
830
831 uint32 sizeCount = (playerCount / 3) + 1;
832 if (intial && playerCount > 0)
833 {
834 sizeCount += playerCount % 2;
835 }
836
837 Acore::Containers::RandomResize(tmpList, sizeCount);
838 for (Unit* trigger : tmpList)
839 me->CastSpell(trigger, SPELL_START_FIRE, true);
840 }
std::uint32_t uint32
Definition Define.h:107
Definition GridNotifiers.h:1354
Definition ObjectGuid.h:118
Definition Unit.h:620
@ SPELL_START_FIRE
Definition hallows_end.cpp:254
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:79
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition ObjectAccessor.cpp:199
Definition GridNotifiers.h:525
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:175
uint32 playerCount
Definition hallows_end.cpp:599

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

Referenced by UpdateAI().

◆ CompleteQuest()

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

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.

629 {
630 pos = param;
631 }

References pos.

◆ EnterEvadeMode()

void npc_hallows_end_soh::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

699 {
701 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2177

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

◆ FinishEvent()

void npc_hallows_end_soh::FinishEvent ( bool  failed)
inline
843 {
844 if (failed)
845 {
847 for (ObjectGuid const& guid : unitList)
848 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
849 c->RemoveAllAuras();
850
852 }
853 else
854 {
856 float x, y, z;
857 GetPosToLand(x, y, z);
860 me->GetMotionMaster()->MovePoint(8, x, y, z);
861 }
862 }
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
void MoveIdle()
Definition MotionMaster.cpp:232
void Clear(bool reset=true)
Definition MotionMaster.h:167
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
@ TALK_SHADE_FAILED
Definition hallows_end.cpp:276
@ TALK_SHADE_DEFEATED
Definition hallows_end.cpp:277
Talk
Definition hyjal.cpp:82
Definition ObjectAccessor.h:61
void GetPosToLand(float &x, float &y, float &z)
Definition hallows_end.cpp:633

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.

704 {
705 return playerCount;
706 }

References playerCount.

◆ GetPosToLand()

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

References pos.

Referenced by FinishEvent(), and JustDied().

◆ JustDied()

void npc_hallows_end_soh::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

876 {
878 float x, y, z;
879 GetPosToLand(x, y, z);
880 me->CastSpell(x, y, z, SPELL_SUMMON_LANTERN, true);
882 }
@ TALK_SHADE_DEATH
Definition hallows_end.cpp:278
@ SPELL_SUMMON_LANTERN
Definition hallows_end.cpp:258
void CompleteQuest()
Definition hallows_end.cpp:884

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

606 {
607 scheduler.Schedule(6s, [this](TaskContext context)
608 {
609 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.f, true))
610 {
612 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
614 }
615
616 context.Repeat(12s);
617 })
618 .Schedule(7s, [this](TaskContext context)
619 {
621
622 context.Repeat(8s);
623 });
624 }
Definition TaskScheduler.h:421
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:493
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
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
@ SPELL_HORSEMAN_CONFLAGRATION_SOUND
Definition hallows_end.cpp:260
@ SPELL_HORSEMAN_CONFLAGRATION
Definition hallows_end.cpp:259
@ SPELL_HORSEMAN_CLEAVE
Definition hallows_end.cpp:261
@ TALK_SHADE_CONFLAGRATION
Definition hallows_end.cpp:272
TaskScheduler scheduler
Definition hallows_end.cpp:603

References Unit::CastSpell(), UnitAI::DoCastVictim(), ScriptedAI::me, Random, 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.

626{}

◆ MovementInform()

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

Reimplemented from CreatureAI.

865 {
866 if (type == POINT_MOTION_TYPE && point == 8)
867 {
869 me->SetCanFly(false);
870 me->SetDisableGravity(false);
871 events.ScheduleEvent(4, 2000);
872 }
873 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
events
Definition boss_sartura.cpp:43
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition Creature.cpp:3220
bool SetCanFly(bool enable, bool packetOnly=false) override
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Creature.cpp:3305
void RemoveAllAuras()
Definition Unit.cpp:5352

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

◆ Reset()

void npc_hallows_end_soh::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

676 {
677 playerCount = 0;
678 unitList.clear();
679 std::list<Creature*> temp;
681 for (std::list<Creature*>::const_iterator itr = temp.begin(); itr != temp.end(); ++itr)
682 {
683 unitList.push_back((*itr)->GetGUID());
684 }
685
686 events.ScheduleEvent(1, 3s);
687 events.ScheduleEvent(2, 25s);
688 events.ScheduleEvent(2, 43s);
689 events.ScheduleEvent(3, 63s);
690
693
694 me->SetCanFly(true);
695 me->SetDisableGravity(true);
696 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
@ REACT_PASSIVE
Definition Unit.h:549
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:703
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3097
@ NPC_FIRE_TRIGGER
Definition hallows_end.cpp:265

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

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

Implements UnitAI.

709 {
710 events.Update(diff);
712 return;
713
714 switch (events.ExecuteEvent())
715 {
716 case 1:
718 break;
719 case 2:
720 {
721 CastFires(true);
722 break;
723 }
724 case 3:
725 {
726 bool checkBurningTriggers = false;
727 for (ObjectGuid const& guid : unitList)
728 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
729 if (c->HasPeriodicDummyAura())
730 {
731 checkBurningTriggers = true;
732 break;
733 }
734
735 if (!checkBurningTriggers)
736 {
737 FinishEvent(false);
738 return;
739 }
740
741 counter++;
742 if (counter > 21)
743 {
744 bool failed = false;
745 for (ObjectGuid const& guid : unitList)
746 if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
747 if (c->HasPeriodicDummyAura())
748 {
749 failed = true;
750 break;
751 }
752
753 FinishEvent(failed);
754 return;
755 }
756 if (counter == 5)
757 {
759 }
760 else if (counter == 15)
761 {
763 }
764
765 CastFires(false);
766 events.RepeatEvent(15000);
767 break;
768 }
769 case 4:
770 {
773 if (Unit* target = me->SelectNearestPlayer(30.0f))
774 AttackStart(target);
775 break;
776 }
777 }
778
779 if (!UpdateVictim())
780 return;
781
782 scheduler.Update(diff, [this]
783 {
785 });
786 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FLAG_NONE
Definition UnitDefines.h:249
@ REACT_AGGRESSIVE
Definition Unit.h:551
bool UpdateVictim()
Definition CreatureAI.cpp:282
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
void ReplaceAllUnitFlags(UnitFlags flags)
Remove the Unit flag specify only.
Definition Unit.h:705
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
Player * SelectNearestPlayer(float distance=0) const
Definition Object.cpp:2486
@ TALK_SHADE_PREPARE
Definition hallows_end.cpp:273
@ TALK_SHADE_START_EVENT
Definition hallows_end.cpp:274
@ TALK_SHADE_MORE_FIRES
Definition hallows_end.cpp:275
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210
void FinishEvent(bool failed)
Definition hallows_end.cpp:842
void CastFires(bool intial)
Definition hallows_end.cpp:788

References ScriptedAI::AttackStart(), CastFires(), counter, UnitAI::DoMeleeAttackIfReady(), FinishEvent(), ObjectAccessor::GetUnit(), Unit::HasUnitState(), ScriptedAI::me, REACT_AGGRESSIVE, Unit::ReplaceAllUnitFlags(), scheduler, WorldObject::SelectNearestPlayer(), Creature::SetReactState(), 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

The documentation for this struct was generated from the following file: