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

Public Member Functions

 boss_headless_horseman (Creature *creature)
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void DoAction (int32 param) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spellInfo) override
 
void SpellHit (Unit *, SpellInfo const *spellInfo) override
 
void MovementInform (uint32 type, uint32 point) override
 
PlayerGetRhymePlayer ()
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void MoveInLineOfSight (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void JustSummoned (Creature *cr) override
 
void Reset () override
 
void JustReachedHome () override
 
void UpdateAI (uint32 diff) override
 
- 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
 
SummonList summons
 
ObjectGuid playerGUID
 
uint8 talkCount
 
bool inFight
 
uint8 phase
 
uint32 health
 
- 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

◆ boss_headless_horseman()

boss_headless_horseman::boss_headless_horseman ( Creature creature)
inline
1014: ScriptedAI(creature), summons(me) { }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
SummonList summons
Definition: hallows_end.cpp:1017

Member Function Documentation

◆ DamageTaken()

void boss_headless_horseman::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1108 {
1109 // We die... :(
1110 if (damage >= me->GetHealth())
1111 {
1112 damage = 0;
1117 events.CancelEvent(EVENT_HORSEMAN_CLEAVE);
1118
1119 // Summon Head
1120 Position pos = me->GetNearPosition(15.0f, rand_norm() * 2 * M_PI);
1122 {
1123 if (health)
1124 cr->SetHealth(health);
1125
1126 me->CastSpell(cr, SPELL_THROW_HEAD, true);
1127 cr->CastSpell(cr, SPELL_HORSEMAN_BODY_PHASE + phase, true);
1128 if (phase < 2)
1129 phase++;
1130
1131 events.ScheduleEvent(EVENT_HORSEMAN_WHIRLWIND, 6s);
1132 events.ScheduleEvent(EVENT_HORSEMAN_CHECK_HEALTH, 1s);
1133 }
1134 }
1135 }
double rand_norm()
Definition: Random.cpp:77
@ EVENT_HORSEMAN_WHIRLWIND
Definition: hallows_end.cpp:982
@ EVENT_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:981
@ SPELL_HORSEMAN_BODY_REGEN_CONFUSE
Definition: hallows_end.cpp:957
@ NPC_HORSEMAN_HEAD
Definition: hallows_end.cpp:945
@ SPELL_HORSEMAN_BODY_REGEN
Definition: hallows_end.cpp:956
@ SPELL_THROW_HEAD
Definition: hallows_end.cpp:962
@ SPELL_HEAD_VISUAL
Definition: hallows_end.cpp:954
@ SPELL_HORSEMAN_IMMUNITY
Definition: hallows_end.cpp:958
@ EVENT_HORSEMAN_CHECK_HEALTH
Definition: hallows_end.cpp:983
@ SPELL_HORSEMAN_BODY_PHASE
Definition: hallows_end.cpp:964
events
Definition: boss_sartura.cpp:43
phase
Definition: boss_skadi.cpp:103
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2343
Position GetNearPosition(float dist, float angle)
Definition: Object.cpp:2716
Definition: Position.h:28
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4722
uint32 GetHealth() const
Definition: Unit.h:1454
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
uint32 health
Definition: hallows_end.cpp:1022

References Unit::CastSpell(), EVENT_HORSEMAN_CHECK_HEALTH, EVENT_HORSEMAN_CLEAVE, EVENT_HORSEMAN_WHIRLWIND, Unit::GetHealth(), WorldObject::GetNearPosition(), health, ScriptedAI::me, NPC_HORSEMAN_HEAD, rand_norm(), Unit::RemoveAura(), SPELL_HEAD_VISUAL, SPELL_HORSEMAN_BODY_PHASE, SPELL_HORSEMAN_BODY_REGEN, SPELL_HORSEMAN_BODY_REGEN_CONFUSE, SPELL_HORSEMAN_IMMUNITY, SPELL_THROW_HEAD, and WorldObject::SummonCreature().

◆ DoAction()

void boss_headless_horseman::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

1047 {
1048 health = param;
1049 }

References health.

◆ GetRhymePlayer()

Player * boss_headless_horseman::GetRhymePlayer ( )
inline
1102{ return playerGUID ? ObjectAccessor::GetPlayer(*me, playerGUID) : nullptr; }
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
ObjectGuid playerGUID
Definition: hallows_end.cpp:1018

References ObjectAccessor::GetPlayer(), ScriptedAI::me, and playerGUID.

Referenced by UpdateAI().

◆ JustDied()

void boss_headless_horseman::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1025 {
1028 std::list<Creature*> unitList;
1030 for (std::list<Creature*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
1031 (*itr)->ToCreature()->DespawnOrUnsummon(500);
1032
1033 Map::PlayerList const& players = me->GetMap()->GetPlayers();
1034 if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
1035 sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, me->FindMap());
1036
1037 if (InstanceScript* instance = me->GetInstanceScript())
1038 instance->SetData(DATA_HORSEMAN_EVENT, DONE);
1039 }
#define sLFGMgr
Definition: LFGMgr.h:641
@ DONE
Definition: InstanceScript.h:60
@ TALK_DEATH
Definition: hallows_end.cpp:993
@ NPC_PUMPKIN_FIEND
Definition: hallows_end.cpp:946
@ DATA_HORSEMAN_EVENT
Definition: hallows_end.cpp:1009
Talk
Definition: boss_fathomlord_karathress.cpp:25
@ LFG_DUNGEON_HEADLESS_HORSEMAN
Definition: LFGMgr.h:148
bool IsEmpty() const
Definition: LinkedList.h:97
FROM * GetSource() const
Definition: Reference.h:97
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
Map * GetMap() const
Definition: Object.h:517
Map * FindMap() const
Definition: Object.h:518
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3040
Group * GetGroup()
Definition: Player.h:2431
ObjectGuid GetGUID() const
Definition: Group.cpp:2245
Definition: InstanceScript.h:141
PlayerList const & GetPlayers() const
Definition: Map.h:485
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36

References MapRefMgr::begin(), DATA_HORSEMAN_EVENT, SummonList::DespawnAll(), DONE, WorldObject::FindMap(), WorldObject::GetCreaturesWithEntryInRange(), Player::GetGroup(), Group::GetGUID(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), Map::GetPlayers(), Reference< TO, FROM >::GetSource(), LinkedListHead::IsEmpty(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, ScriptedAI::me, NPC_PUMPKIN_FIEND, sLFGMgr, summons, and TALK_DEATH.

◆ JustEngagedWith()

void boss_headless_horseman::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

1104{ me->SetInCombatWithZone(); }
void SetInCombatWithZone()
Definition: Creature.cpp:2732

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

◆ JustReachedHome()

void boss_headless_horseman::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

1154 {
1155 if (InstanceScript* instance = me->GetInstanceScript())
1156 instance->SetData(DATA_HORSEMAN_EVENT, FAIL);
1157
1159 }
@ FAIL
Definition: InstanceScript.h:59
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117

References DATA_HORSEMAN_EVENT, Creature::DespawnOrUnsummon(), FAIL, WorldObject::GetInstanceScript(), and ScriptedAI::me.

◆ JustSummoned()

void boss_headless_horseman::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1137{ summons.Summon(cr); }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90

References SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_headless_horseman::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1042 {
1044 }
@ TALK_PLAYER_DEATH
Definition: hallows_end.cpp:994

References TALK_PLAYER_DEATH.

◆ MoveInLineOfSight()

void boss_headless_horseman::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1105{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

1084 {
1085 if (type == WAYPOINT_MOTION_TYPE)
1086 {
1087 if (point == 0)
1089 else if (point == 11)
1090 {
1092 me->StopMoving();
1093
1095 inFight = true;
1096 events.ScheduleEvent(EVENT_HORSEMAN_FOLLOW, 500ms);
1097 events.ScheduleEvent(EVENT_HORSEMAN_CLEAVE, 7s);
1098 }
1099 }
1100 }
@ UNIT_FLAG_NONE
Definition: Unit.h:447
@ WAYPOINT_MOTION_TYPE
Definition: MotionMaster.h:39
@ EVENT_HORSEMAN_FOLLOW
Definition: hallows_end.cpp:986
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1497
void StopMoving()
Definition: Unit.cpp:16918
bool inFight
Definition: hallows_end.cpp:1020

References Unit::CastSpell(), EVENT_HORSEMAN_CLEAVE, EVENT_HORSEMAN_FOLLOW, inFight, ScriptedAI::me, Unit::ReplaceAllUnitFlags(), Creature::SetInCombatWithZone(), SPELL_HEAD_VISUAL, Unit::StopMoving(), UNIT_FLAG_NONE, and WAYPOINT_MOTION_TYPE.

◆ Reset()

void boss_headless_horseman::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1140 {
1141 events.Reset();
1143 playerGUID.Clear();
1144 talkCount = 0;
1145 phase = 0;
1146 inFight = false;
1147 health = 0;
1148
1149 me->SetDisableGravity(true);
1150 me->SetSpeed(MOVE_WALK, 5.0f, true);
1151 }
@ MOVE_WALK
Definition: Unit.h:378
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
void Clear()
Definition: ObjectGuid.h:140
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14414
uint8 talkCount
Definition: hallows_end.cpp:1019

References ObjectGuid::Clear(), SummonList::DespawnAll(), health, inFight, ScriptedAI::me, MOVE_WALK, playerGUID, Creature::SetDisableGravity(), Unit::SetSpeed(), summons, and talkCount.

◆ SpellHit()

void boss_headless_horseman::SpellHit ( Unit ,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1061 {
1062 if (spellInfo->Id == SPELL_THROW_HEAD_BACK)
1063 {
1071 events.CancelEvent(EVENT_HORSEMAN_WHIRLWIND);
1073 events.CancelEvent(EVENT_SUMMON_PUMPKIN);
1075
1076 if (phase == 1)
1077 events.ScheduleEvent(EVENT_HORSEMAN_CONFLAGRATION, 6s);
1078 else if (phase == 2)
1079 events.ScheduleEvent(EVENT_SUMMON_PUMPKIN, 6s);
1080 }
1081 }
@ EVENT_SUMMON_PUMPKIN
Definition: hallows_end.cpp:985
@ SPELL_HORSEMAN_WHIRLWIND
Definition: hallows_end.cpp:966
@ TALK_REJOINED
Definition: hallows_end.cpp:990
@ SPELL_THROW_HEAD_BACK
Definition: hallows_end.cpp:963
@ EVENT_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:984
uint32 GetMaxHealth() const
Definition: Unit.h:1455
void SetHealth(uint32 val)
Definition: Unit.cpp:15464

References Unit::CastSpell(), EVENT_HORSEMAN_CHECK_HEALTH, EVENT_HORSEMAN_CONFLAGRATION, EVENT_HORSEMAN_WHIRLWIND, EVENT_SUMMON_PUMPKIN, Unit::GetMaxHealth(), SpellInfo::Id, ScriptedAI::me, Unit::RemoveAura(), Unit::SetHealth(), SPELL_HEAD_VISUAL, SPELL_HORSEMAN_BODY_REGEN, SPELL_HORSEMAN_BODY_REGEN_CONFUSE, SPELL_HORSEMAN_IMMUNITY, SPELL_HORSEMAN_WHIRLWIND, SPELL_THROW_HEAD_BACK, and TALK_REJOINED.

◆ SpellHitTarget()

void boss_headless_horseman::SpellHitTarget ( Unit target,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1052 {
1053 if (spellInfo->Id == SPELL_SUMMONING_RHYME_TARGET)
1054 {
1055 playerGUID = target->GetGUID();
1056 events.ScheduleEvent(EVENT_HH_PLAYER_TALK, 2s);
1057 }
1058 }
@ SPELL_SUMMONING_RHYME_TARGET
Definition: hallows_end.cpp:953
@ EVENT_HH_PLAYER_TALK
Definition: hallows_end.cpp:980
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106

References EVENT_HH_PLAYER_TALK, Object::GetGUID(), SpellInfo::Id, playerGUID, and SPELL_SUMMONING_RHYME_TARGET.

◆ UpdateAI()

void boss_headless_horseman::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1162 {
1163 events.Update(diff);
1165 return;
1166
1167 if (inFight && !UpdateVictim())
1168 return;
1169
1170 switch (events.ExecuteEvent())
1171 {
1173 {
1174 talkCount++;
1175 Player* player = GetRhymePlayer();
1176 if (!player)
1177 return;
1178
1179 switch (talkCount)
1180 {
1181 case 1:
1182 player->Say(TALK_PLAYER_RISE);
1183 break;
1184 case 2:
1186 if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS))
1187 trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
1188 break;
1189 case 3:
1190 me->GetMotionMaster()->MovePath(236820, false);
1192 player->Say(TALK_PLAYER_FELT_DEATH);
1194 break;
1195 case 4:
1198 talkCount = 0;
1199 return; // pop and return, skip repeat
1200 }
1201 events.RepeatEvent(2000);
1202 break;
1203 }
1205 {
1206 if (Player* player = GetRhymePlayer())
1207 {
1209 AttackStart(player);
1210 me->GetMotionMaster()->MoveChase(player);
1211 }
1212 break;
1213 }
1215 {
1217 events.RepeatEvent(8000);
1218 break;
1219 }
1221 {
1223 {
1225 events.RepeatEvent(15000);
1226 break;
1227 }
1229 events.RepeatEvent(6000);
1230 break;
1231 }
1233 {
1234 if (me->GetHealth() == me->GetMaxHealth())
1235 {
1237 return;
1238 }
1239
1240 events.RepeatEvent(1000);
1241 break;
1242 }
1244 {
1245 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
1246 {
1247 me->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION, false);
1248 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
1250 }
1251
1252 events.RepeatEvent(12500);
1253 break;
1254 }
1256 {
1257 if (talkCount < 4)
1258 {
1259 events.RepeatEvent(1);
1260 talkCount++;
1262 }
1263 else
1264 {
1266 events.RepeatEvent(15000);
1267 talkCount = 0;
1268 }
1269
1270 break;
1271 }
1272 }
1273
1274 if (inFight)
1276 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:55
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ 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
@ SPELL_SHAKE_CAMERA_SMALL
Definition: hallows_end.cpp:951
@ SPELL_EARTH_EXPLOSION
Definition: hallows_end.cpp:955
@ SPELL_SHAKE_CAMERA_MEDIUM
Definition: hallows_end.cpp:950
@ TALK_PLAYER_KNOW_DEMISE
Definition: hallows_end.cpp:1004
@ TALK_CONFLAGRATION
Definition: hallows_end.cpp:991
@ SPELL_BODY_RESTORED_INFO
Definition: hallows_end.cpp:960
@ TALK_ENTRANCE
Definition: hallows_end.cpp:989
@ TALK_PLAYER_TIME_IS_NIGH
Definition: hallows_end.cpp:1002
@ TALK_SPROUTING_PUMPKINS
Definition: hallows_end.cpp:992
@ SPELL_SUMMON_PUMPKIN
Definition: hallows_end.cpp:967
@ TALK_PLAYER_RISE
Definition: hallows_end.cpp:1001
@ TALK_PLAYER_FELT_DEATH
Definition: hallows_end.cpp:1003
@ EFFECT_0
Definition: SharedDefines.h:31
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2392
Definition: Player.h:1056
void Say(std::string_view text, Language language, WorldObject const *=nullptr) override
Handles said message in regular chat based on declared language and in config pre-defined Range.
Definition: Player.cpp:9251
Definition: Unit.h:1302
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:5606
Unit * GetVictim() const
Definition: Unit.h:1398
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:300
void MovePath(uint32 path_id, bool repeatable)
Definition: MotionMaster.cpp:800
void MoveIdle()
Definition: MotionMaster.cpp:232
Player * GetRhymePlayer()
Definition: hallows_end.cpp:1102

References ScriptedAI::AttackStart(), Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), EFFECT_0, EVENT_HH_PLAYER_TALK, EVENT_HORSEMAN_CHECK_HEALTH, EVENT_HORSEMAN_CLEAVE, EVENT_HORSEMAN_CONFLAGRATION, EVENT_HORSEMAN_FOLLOW, EVENT_HORSEMAN_WHIRLWIND, EVENT_SUMMON_PUMPKIN, Unit::GetHealth(), Unit::GetMaxHealth(), Unit::GetMotionMaster(), GetRhymePlayer(), Unit::GetVictim(), Unit::HasAuraEffect(), Unit::HasUnitState(), IN_MILLISECONDS, inFight, ScriptedAI::me, MotionMaster::MoveChase(), MotionMaster::MoveIdle(), MotionMaster::MovePath(), Unit::RemoveAura(), Player::Say(), UnitAI::SelectTarget(), SPELL_BODY_RESTORED_INFO, SPELL_EARTH_EXPLOSION, SPELL_HORSEMAN_CLEAVE, SPELL_HORSEMAN_CONFLAGRATION, SPELL_HORSEMAN_CONFLAGRATION_SOUND, SPELL_HORSEMAN_WHIRLWIND, SPELL_SHAKE_CAMERA_MEDIUM, SPELL_SHAKE_CAMERA_SMALL, SPELL_SUMMON_PUMPKIN, WorldObject::SummonTrigger(), TALK_CONFLAGRATION, TALK_ENTRANCE, TALK_PLAYER_FELT_DEATH, TALK_PLAYER_KNOW_DEMISE, TALK_PLAYER_RISE, TALK_PLAYER_TIME_IS_NIGH, TALK_SPROUTING_PUMPKINS, talkCount, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ events

EventMap boss_headless_horseman::events

◆ health

uint32 boss_headless_horseman::health

Referenced by DamageTaken(), DoAction(), and Reset().

◆ inFight

bool boss_headless_horseman::inFight

Referenced by MovementInform(), Reset(), and UpdateAI().

◆ phase

uint8 boss_headless_horseman::phase

◆ playerGUID

ObjectGuid boss_headless_horseman::playerGUID

◆ summons

SummonList boss_headless_horseman::summons

Referenced by JustDied(), JustSummoned(), and Reset().

◆ talkCount

uint8 boss_headless_horseman::talkCount

Referenced by Reset(), and UpdateAI().