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. More...
 
void MoveInLineOfSight (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void JustSummoned (Creature *cr) override
 
void Reset () override
 
void JustReachedHome () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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
 

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:190
Creature * me
Definition: ScriptedCreature.h:280
SummonList summons
Definition: hallows_end.cpp:1017

Member Function Documentation

◆ DamageTaken()

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

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from ScriptedAI.

1110 {
1111 // We die... :(
1112 if (damage >= me->GetHealth())
1113 {
1114 damage = 0;
1119 events.CancelEvent(EVENT_HORSEMAN_CLEAVE);
1120
1121 // Summon Head
1122 Position pos = me->GetNearPosition(15.0f, rand_norm() * 2 * M_PI);
1124 {
1125 if (health)
1126 cr->SetHealth(health);
1127
1128 me->CastSpell(cr, SPELL_THROW_HEAD, true);
1129 cr->CastSpell(cr, SPELL_HORSEMAN_BODY_PHASE + phase, true);
1130 if (phase < 2)
1131 phase++;
1132
1133 events.ScheduleEvent(EVENT_HORSEMAN_WHIRLWIND, 6s);
1134 events.ScheduleEvent(EVENT_HORSEMAN_CHECK_HEALTH, 1s);
1135 }
1136 }
1137 }
double rand_norm()
Definition: Random.cpp:77
events
Definition: boss_sartura.cpp:43
@ 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
phase
Definition: boss_skadi.cpp:103
Definition: Creature.h:43
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:2366
Position GetNearPosition(float dist, float angle, bool disableWarning=false)
Definition: Object.cpp:2739
Definition: Position.h:27
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
uint32 GetHealth() const
Definition: Unit.h:1029
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:1167
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
1104{ return playerGUID ? ObjectAccessor::GetPlayer(*me, playerGUID) : nullptr; }
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:220
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 }
Talk
Definition: hyjal.cpp:82
@ TALK_DEATH
Definition: hallows_end.cpp:993
@ NPC_PUMPKIN_FIEND
Definition: hallows_end.cpp:946
@ DATA_HORSEMAN_EVENT
Definition: hallows_end.cpp:1009
@ DONE
Definition: InstanceScript.h:60
#define sLFGMgr
Definition: LFGMgr.h:641
@ 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:536
Map * FindMap() const
Definition: Object.h:537
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3097
Group * GetGroup()
Definition: Player.h:2468
ObjectGuid GetGUID() const
Definition: Group.cpp:2302
Definition: InstanceScript.h:142
PlayerList const & GetPlayers() const
Definition: Map.h:484
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.

1106{ me->SetInCombatWithZone(); }
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811

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

◆ JustReachedHome()

void boss_headless_horseman::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ JustSummoned()

void boss_headless_horseman::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

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

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.

1107{}

◆ 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
1094 me->SetDisableGravity(false);
1095
1097 inFight = true;
1098 events.ScheduleEvent(EVENT_HORSEMAN_FOLLOW, 500ms);
1099 events.ScheduleEvent(EVENT_HORSEMAN_CLEAVE, 7s);
1100 }
1101 }
1102 }
@ EVENT_HORSEMAN_FOLLOW
Definition: hallows_end.cpp:986
@ UNIT_FLAG_NONE
Definition: UnitDefines.h:228
@ WAYPOINT_MOTION_TYPE
Definition: MotionMaster.h:41
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:3205
void ReplaceAllUnitFlags(UnitFlags flags)
Remove the Unit flag specify only.
Definition: Unit.h:715
void StopMoving()
Definition: Unit.cpp:16650
bool inFight
Definition: hallows_end.cpp:1020

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

◆ Reset()

void boss_headless_horseman::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1142 {
1143 events.Reset();
1145 playerGUID.Clear();
1146 talkCount = 0;
1147 phase = 0;
1148 inFight = false;
1149 health = 0;
1150
1151 me->SetDisableGravity(true);
1152 me->SetSpeed(MOVE_WALK, 5.0f, true);
1153 }
@ MOVE_WALK
Definition: UnitDefines.h:328
void Clear()
Definition: ObjectGuid.h:138
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14429
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:1030
void SetHealth(uint32 val)
Definition: Unit.cpp:15478

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:112

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

◆ UpdateAI()

void boss_headless_horseman::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

1164 {
1165 events.Update(diff);
1167 return;
1168
1169 if (inFight && !UpdateVictim())
1170 return;
1171
1172 switch (events.ExecuteEvent())
1173 {
1175 {
1176 talkCount++;
1177 Player* player = GetRhymePlayer();
1178 if (!player)
1179 return;
1180
1181 switch (talkCount)
1182 {
1183 case 1:
1184 player->Say(TALK_PLAYER_RISE);
1185 break;
1186 case 2:
1188 if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS))
1189 trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
1190 break;
1191 case 3:
1192 me->SetDisableGravity(true);
1193 me->GetMotionMaster()->MovePath(236820, false);
1195 player->Say(TALK_PLAYER_FELT_DEATH);
1197 break;
1198 case 4:
1201 talkCount = 0;
1202 return; // pop and return, skip repeat
1203 }
1204 events.RepeatEvent(2000);
1205 break;
1206 }
1208 {
1209 if (Player* player = GetRhymePlayer())
1210 {
1212 AttackStart(player);
1213 me->GetMotionMaster()->MoveChase(player);
1214 }
1215 break;
1216 }
1218 {
1220 events.RepeatEvent(8000);
1221 break;
1222 }
1224 {
1226 {
1228 events.RepeatEvent(15000);
1229 break;
1230 }
1232 events.RepeatEvent(6000);
1233 break;
1234 }
1236 {
1237 if (me->GetHealth() == me->GetMaxHealth())
1238 {
1240 return;
1241 }
1242
1243 events.RepeatEvent(1000);
1244 break;
1245 }
1247 {
1248 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
1249 {
1250 me->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION, false);
1251 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
1253 }
1254
1255 events.RepeatEvent(12500);
1256 break;
1257 }
1259 {
1260 if (talkCount < 4)
1261 {
1262 events.RepeatEvent(1);
1263 talkCount++;
1265 }
1266 else
1267 {
1269 events.RepeatEvent(15000);
1270 talkCount = 0;
1271 }
1272
1273 break;
1274 }
1275 }
1276
1277 if (inFight)
1279 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
@ 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
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
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:280
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:2415
Definition: Player.h:1081
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:9370
Definition: Unit.h:630
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:5668
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:313
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:852
void MoveIdle()
Definition: MotionMaster.cpp:232
Player * GetRhymePlayer()
Definition: hallows_end.cpp:1104

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(), Creature::SetDisableGravity(), 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().