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

Public Attributes

EventMap events
 
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
 
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
1012: ScriptedAI(creature), summons(me) { }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
SummonList summons
Definition: hallows_end.cpp:1015

Member Function Documentation

◆ DamageTaken()

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

Reimplemented from ScriptedAI.

1106 {
1107 // We die... :(
1108 if (damage >= me->GetHealth())
1109 {
1110 damage = 0;
1115 events.CancelEvent(EVENT_HORSEMAN_CLEAVE);
1116
1117 // Summon Head
1118 Position pos = me->GetNearPosition(15.0f, rand_norm() * 2 * M_PI);
1120 {
1121 if (health)
1122 cr->SetHealth(health);
1123
1124 me->CastSpell(cr, SPELL_THROW_HEAD, true);
1125 cr->CastSpell(cr, SPELL_HORSEMAN_BODY_PHASE + phase, true);
1126 if (phase < 2)
1127 phase++;
1128
1129 events.ScheduleEvent(EVENT_HORSEMAN_WHIRLWIND, 6s);
1130 events.ScheduleEvent(EVENT_HORSEMAN_CHECK_HEALTH, 1s);
1131 }
1132 }
1133 }
double rand_norm()
Definition: Random.cpp:77
@ EVENT_HORSEMAN_WHIRLWIND
Definition: hallows_end.cpp:980
@ EVENT_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:979
@ SPELL_HORSEMAN_BODY_REGEN_CONFUSE
Definition: hallows_end.cpp:955
@ NPC_HORSEMAN_HEAD
Definition: hallows_end.cpp:943
@ SPELL_HORSEMAN_BODY_REGEN
Definition: hallows_end.cpp:954
@ SPELL_THROW_HEAD
Definition: hallows_end.cpp:960
@ SPELL_HEAD_VISUAL
Definition: hallows_end.cpp:952
@ SPELL_HORSEMAN_IMMUNITY
Definition: hallows_end.cpp:956
@ EVENT_HORSEMAN_CHECK_HEALTH
Definition: hallows_end.cpp:981
@ SPELL_HORSEMAN_BODY_PHASE
Definition: hallows_end.cpp:962
events
Definition: boss_sartura.cpp:43
phase
Definition: boss_skadi.cpp:102
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:2318
Position GetNearPosition(float dist, float angle)
Definition: Object.cpp:2691
Definition: Position.h:28
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4708
uint32 GetHealth() const
Definition: Unit.h:1440
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:1020

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.

1045 {
1046 health = param;
1047 }

References health.

◆ GetRhymePlayer()

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

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

Referenced by UpdateAI().

◆ JustDied()

void boss_headless_horseman::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1023 {
1026 std::list<Creature*> unitList;
1028 for (std::list<Creature*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
1029 (*itr)->ToCreature()->DespawnOrUnsummon(500);
1030
1031 Map::PlayerList const& players = me->GetMap()->GetPlayers();
1032 if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
1033 sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, me->FindMap());
1034
1035 if (InstanceScript* instance = me->GetInstanceScript())
1036 instance->SetData(DATA_HORSEMAN_EVENT, DONE);
1037 }
#define sLFGMgr
Definition: LFGMgr.h:638
@ DONE
Definition: InstanceScript.h:59
@ TALK_DEATH
Definition: hallows_end.cpp:991
@ NPC_PUMPKIN_FIEND
Definition: hallows_end.cpp:944
@ DATA_HORSEMAN_EVENT
Definition: hallows_end.cpp:1007
Talk
Definition: boss_fathomlord_karathress.cpp:23
@ 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:67
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:3015
Group * GetGroup()
Definition: Player.h:2418
ObjectGuid GetGUID() const
Definition: Group.cpp:2245
Definition: InstanceScript.h:140
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.

1102{ me->SetInCombatWithZone(); }
void SetInCombatWithZone()
Definition: Creature.cpp:2723

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

◆ JustReachedHome()

void boss_headless_horseman::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ JustSummoned()

void boss_headless_horseman::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1135{ 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.

1040 {
1042 }
@ TALK_PLAYER_DEATH
Definition: hallows_end.cpp:992

References TALK_PLAYER_DEATH.

◆ MoveInLineOfSight()

void boss_headless_horseman::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1103{}

◆ MovementInform()

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

Reimplemented from ScriptedAI.

1082 {
1083 if (type == WAYPOINT_MOTION_TYPE)
1084 {
1085 if (point == 0)
1087 else if (point == 11)
1088 {
1090 me->StopMoving();
1091
1093 inFight = true;
1094 events.ScheduleEvent(EVENT_HORSEMAN_FOLLOW, 500ms);
1095 events.ScheduleEvent(EVENT_HORSEMAN_CLEAVE, 7s);
1096 }
1097 }
1098 }
@ UNIT_FLAG_NONE
Definition: Unit.h:447
@ WAYPOINT_MOTION_TYPE
Definition: MotionMaster.h:39
@ EVENT_HORSEMAN_FOLLOW
Definition: hallows_end.cpp:984
void ReplaceAllUnitFlags(UnitFlags flags)
Definition: Unit.h:1483
void StopMoving()
Definition: Unit.cpp:16824
bool inFight
Definition: hallows_end.cpp:1018

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.

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

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.

1059 {
1060 if (spellInfo->Id == SPELL_THROW_HEAD_BACK)
1061 {
1069 events.CancelEvent(EVENT_HORSEMAN_WHIRLWIND);
1071 events.CancelEvent(EVENT_SUMMON_PUMPKIN);
1073
1074 if (phase == 1)
1075 events.ScheduleEvent(EVENT_HORSEMAN_CONFLAGRATION, 6s);
1076 else if (phase == 2)
1077 events.ScheduleEvent(EVENT_SUMMON_PUMPKIN, 6s);
1078 }
1079 }
@ EVENT_SUMMON_PUMPKIN
Definition: hallows_end.cpp:983
@ SPELL_HORSEMAN_WHIRLWIND
Definition: hallows_end.cpp:964
@ TALK_REJOINED
Definition: hallows_end.cpp:988
@ SPELL_THROW_HEAD_BACK
Definition: hallows_end.cpp:961
@ EVENT_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:982
uint32 GetMaxHealth() const
Definition: Unit.h:1441
void SetHealth(uint32 val)
Definition: Unit.cpp:15370

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.

1050 {
1051 if (spellInfo->Id == SPELL_SUMMONING_RHYME_TARGET)
1052 {
1053 playerGUID = target->GetGUID();
1054 events.ScheduleEvent(EVENT_HH_PLAYER_TALK, 2s);
1055 }
1056 }
@ SPELL_SUMMONING_RHYME_TARGET
Definition: hallows_end.cpp:951
@ EVENT_HH_PLAYER_TALK
Definition: hallows_end.cpp:978
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.

1160 {
1161 events.Update(diff);
1163 return;
1164
1165 if (inFight && !UpdateVictim())
1166 return;
1167
1168 switch (events.ExecuteEvent())
1169 {
1171 {
1172 talkCount++;
1173 Player* player = GetRhymePlayer();
1174 if (!player)
1175 return;
1176
1177 switch (talkCount)
1178 {
1179 case 1:
1180 player->Say(TALK_PLAYER_RISE);
1181 break;
1182 case 2:
1184 if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS))
1185 trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
1186 break;
1187 case 3:
1188 me->GetMotionMaster()->MovePath(236820, false);
1190 player->Say(TALK_PLAYER_FELT_DEATH);
1192 break;
1193 case 4:
1196 talkCount = 0;
1197 return; // pop and return, skip repeat
1198 }
1199 events.RepeatEvent(2000);
1200 break;
1201 }
1203 {
1204 if (Player* player = GetRhymePlayer())
1205 {
1207 AttackStart(player);
1208 me->GetMotionMaster()->MoveChase(player);
1209 }
1210 break;
1211 }
1213 {
1215 events.RepeatEvent(8000);
1216 break;
1217 }
1219 {
1221 {
1223 events.RepeatEvent(15000);
1224 break;
1225 }
1227 events.RepeatEvent(6000);
1228 break;
1229 }
1231 {
1232 if (me->GetHealth() == me->GetMaxHealth())
1233 {
1235 return;
1236 }
1237
1238 events.RepeatEvent(1000);
1239 break;
1240 }
1242 {
1243 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
1244 {
1245 me->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION, false);
1246 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
1248 }
1249
1250 events.RepeatEvent(12500);
1251 break;
1252 }
1254 {
1255 if (talkCount < 4)
1256 {
1257 events.RepeatEvent(1);
1258 talkCount++;
1260 }
1261 else
1262 {
1264 events.RepeatEvent(15000);
1265 talkCount = 0;
1266 }
1267
1268 break;
1269 }
1270 }
1271
1272 if (inFight)
1274 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELL_HORSEMAN_CONFLAGRATION_SOUND
Definition: hallows_end.cpp:257
@ SPELL_HORSEMAN_CONFLAGRATION
Definition: hallows_end.cpp:256
@ SPELL_HORSEMAN_CLEAVE
Definition: hallows_end.cpp:258
@ SPELL_SHAKE_CAMERA_SMALL
Definition: hallows_end.cpp:949
@ SPELL_EARTH_EXPLOSION
Definition: hallows_end.cpp:953
@ SPELL_SHAKE_CAMERA_MEDIUM
Definition: hallows_end.cpp:948
@ TALK_PLAYER_KNOW_DEMISE
Definition: hallows_end.cpp:1002
@ TALK_CONFLAGRATION
Definition: hallows_end.cpp:989
@ SPELL_BODY_RESTORED_INFO
Definition: hallows_end.cpp:958
@ TALK_ENTRANCE
Definition: hallows_end.cpp:987
@ TALK_PLAYER_TIME_IS_NIGH
Definition: hallows_end.cpp:1000
@ TALK_SPROUTING_PUMPKINS
Definition: hallows_end.cpp:990
@ SPELL_SUMMON_PUMPKIN
Definition: hallows_end.cpp:965
@ TALK_PLAYER_RISE
Definition: hallows_end.cpp:999
@ TALK_PLAYER_FELT_DEATH
Definition: hallows_end.cpp:1001
@ EFFECT_0
Definition: SharedDefines.h:30
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:206
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition: Object.cpp:2367
Definition: Player.h:1046
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:9230
Definition: Unit.h:1290
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:5580
Unit * GetVictim() const
Definition: Unit.h:1386
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:299
void MovePath(uint32 path_id, bool repeatable)
Definition: MotionMaster.cpp:758
void MoveIdle()
Definition: MotionMaster.cpp:231
Player * GetRhymePlayer()
Definition: hallows_end.cpp:1100

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().