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
 Called at any Damage from any attacker (before damage apply)
 
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()
 
- 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 EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
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.
 
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 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:
 
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
 
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)
 
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
1015: ScriptedAI(creature), summons(me) { }
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition hallows_end.cpp:1018

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

1111 {
1112 // We die... :(
1113 if (damage >= me->GetHealth())
1114 {
1115 damage = 0;
1120 events.CancelEvent(EVENT_HORSEMAN_CLEAVE);
1121
1122 // Summon Head
1123 Position pos = me->GetNearPosition(15.0f, rand_norm() * 2 * M_PI);
1125 {
1126 if (health)
1127 cr->SetHealth(health);
1128
1129 me->CastSpell(cr, SPELL_THROW_HEAD, true);
1130 cr->CastSpell(cr, SPELL_HORSEMAN_BODY_PHASE + phase, true);
1131 if (phase < 2)
1132 phase++;
1133
1134 events.ScheduleEvent(EVENT_HORSEMAN_WHIRLWIND, 6s);
1135 events.ScheduleEvent(EVENT_HORSEMAN_CHECK_HEALTH, 1s);
1136 }
1137 }
1138 }
double rand_norm()
Definition Random.cpp:85
events
Definition boss_sartura.cpp:43
phase
Definition boss_skadi.cpp:103
Definition Creature.h:43
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4809
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:1179
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:2368
Position GetNearPosition(float dist, float angle)
Definition Object.cpp:2741
@ EVENT_HORSEMAN_WHIRLWIND
Definition hallows_end.cpp:983
@ EVENT_HORSEMAN_CLEAVE
Definition hallows_end.cpp:982
@ SPELL_HORSEMAN_BODY_REGEN_CONFUSE
Definition hallows_end.cpp:958
@ NPC_HORSEMAN_HEAD
Definition hallows_end.cpp:946
@ SPELL_HORSEMAN_BODY_REGEN
Definition hallows_end.cpp:957
@ SPELL_THROW_HEAD
Definition hallows_end.cpp:963
@ SPELL_HEAD_VISUAL
Definition hallows_end.cpp:955
@ SPELL_HORSEMAN_IMMUNITY
Definition hallows_end.cpp:959
@ EVENT_HORSEMAN_CHECK_HEALTH
Definition hallows_end.cpp:984
@ SPELL_HORSEMAN_BODY_PHASE
Definition hallows_end.cpp:965
Definition Position.h:27
uint32 health
Definition hallows_end.cpp:1023

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.

1048 {
1049 health = param;
1050 }

References health.

◆ GetRhymePlayer()

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

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

Referenced by UpdateAI().

◆ JustDied()

void boss_headless_horseman::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1026 {
1029 std::list<Creature*> unitList;
1031 for (std::list<Creature*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
1032 (*itr)->ToCreature()->DespawnOrUnsummon(500);
1033
1034 Map::PlayerList const& players = me->GetMap()->GetPlayers();
1035 if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
1036 sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, me->FindMap());
1037
1038 if (InstanceScript* instance = me->GetInstanceScript())
1039 instance->SetData(DATA_HORSEMAN_EVENT, DONE);
1040 }
@ DONE
Definition InstanceScript.h:61
#define sLFGMgr
Definition LFGMgr.h:641
ObjectGuid GetGUID() const
Definition Group.cpp:2305
Definition InstanceScript.h:143
bool IsEmpty() const
Definition LinkedList.h:97
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
PlayerList const & GetPlayers() const
Definition Map.h:333
Group * GetGroup()
Definition Player.h:2478
FROM * GetSource() const
Definition Reference.h:97
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71
Map * GetMap() const
Definition Object.h:537
Map * FindMap() const
Definition Object.h:538
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3097
@ TALK_DEATH
Definition hallows_end.cpp:994
@ NPC_PUMPKIN_FIEND
Definition hallows_end.cpp:947
@ DATA_HORSEMAN_EVENT
Definition hallows_end.cpp:1010
Talk
Definition hyjal.cpp:82
@ LFG_DUNGEON_HEADLESS_HORSEMAN
Definition LFGMgr.h:148

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

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

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

◆ JustReachedHome()

void boss_headless_horseman::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ JustSummoned()

void boss_headless_horseman::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

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

1043 {
1045 }
@ TALK_PLAYER_DEATH
Definition hallows_end.cpp:995

References TALK_PLAYER_DEATH.

◆ MoveInLineOfSight()

void boss_headless_horseman::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1108{}

◆ MovementInform()

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

Reimplemented from CreatureAI.

1085 {
1086 if (type == WAYPOINT_MOTION_TYPE)
1087 {
1088 if (point == 0)
1090 else if (point == 11)
1091 {
1093 me->StopMoving();
1094
1095 me->SetDisableGravity(false);
1096
1098 inFight = true;
1099 events.ScheduleEvent(EVENT_HORSEMAN_FOLLOW, 500ms);
1100 events.ScheduleEvent(EVENT_HORSEMAN_CLEAVE, 7s);
1101 }
1102 }
1103 }
@ WAYPOINT_MOTION_TYPE
Definition MotionMaster.h:41
@ UNIT_FLAG_NONE
Definition UnitDefines.h:249
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
void ReplaceAllUnitFlags(UnitFlags flags)
Remove the Unit flag specify only.
Definition Unit.h:705
void StopMoving()
Definition Unit.cpp:16683
@ EVENT_HORSEMAN_FOLLOW
Definition hallows_end.cpp:987
bool inFight
Definition hallows_end.cpp:1021

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

1143 {
1144 events.Reset();
1146 playerGUID.Clear();
1147 talkCount = 0;
1148 phase = 0;
1149 inFight = false;
1150 health = 0;
1151
1152 me->SetDisableGravity(true);
1153 me->SetSpeed(MOVE_WALK, 5.0f, true);
1154 }
@ MOVE_WALK
Definition UnitDefines.h:349
void Clear()
Definition ObjectGuid.h:138
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:14480
uint8 talkCount
Definition hallows_end.cpp:1020

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

1062 {
1063 if (spellInfo->Id == SPELL_THROW_HEAD_BACK)
1064 {
1072 events.CancelEvent(EVENT_HORSEMAN_WHIRLWIND);
1074 events.CancelEvent(EVENT_SUMMON_PUMPKIN);
1076
1077 if (phase == 1)
1078 events.ScheduleEvent(EVENT_HORSEMAN_CONFLAGRATION, 6s);
1079 else if (phase == 2)
1080 events.ScheduleEvent(EVENT_SUMMON_PUMPKIN, 6s);
1081 }
1082 }
uint32 GetMaxHealth() const
Definition Unit.h:1030
void SetHealth(uint32 val)
Definition Unit.cpp:15529
@ EVENT_SUMMON_PUMPKIN
Definition hallows_end.cpp:986
@ SPELL_HORSEMAN_WHIRLWIND
Definition hallows_end.cpp:967
@ TALK_REJOINED
Definition hallows_end.cpp:991
@ SPELL_THROW_HEAD_BACK
Definition hallows_end.cpp:964
@ EVENT_HORSEMAN_CONFLAGRATION
Definition hallows_end.cpp:985

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

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

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

Implements UnitAI.

1165 {
1166 events.Update(diff);
1168 return;
1169
1170 if (inFight && !UpdateVictim())
1171 return;
1172
1173 switch (events.ExecuteEvent())
1174 {
1176 {
1177 talkCount++;
1178 Player* player = GetRhymePlayer();
1179 if (!player)
1180 return;
1181
1182 switch (talkCount)
1183 {
1184 case 1:
1185 player->Say(TALK_PLAYER_RISE);
1186 break;
1187 case 2:
1189 if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS))
1190 trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
1191 break;
1192 case 3:
1193 me->SetDisableGravity(true);
1194 me->GetMotionMaster()->MovePath(236820, false);
1196 player->Say(TALK_PLAYER_FELT_DEATH);
1198 break;
1199 case 4:
1202 talkCount = 0;
1203 return; // pop and return, skip repeat
1204 }
1205 events.RepeatEvent(2000);
1206 break;
1207 }
1209 {
1210 if (Player* player = GetRhymePlayer())
1211 {
1213 AttackStart(player);
1214 me->GetMotionMaster()->MoveChase(player);
1215 }
1216 break;
1217 }
1219 {
1221 events.RepeatEvent(8000);
1222 break;
1223 }
1225 {
1227 {
1229 events.RepeatEvent(15000);
1230 break;
1231 }
1233 events.RepeatEvent(6000);
1234 break;
1235 }
1237 {
1238 if (me->GetHealth() == me->GetMaxHealth())
1239 {
1241 return;
1242 }
1243
1244 events.RepeatEvent(1000);
1245 break;
1246 }
1248 {
1250 {
1251 me->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION, false);
1252 target->CastSpell(target, SPELL_HORSEMAN_CONFLAGRATION_SOUND, true);
1254 }
1255
1256 events.RepeatEvent(12500);
1257 break;
1258 }
1260 {
1261 if (talkCount < 4)
1262 {
1263 events.RepeatEvent(1);
1264 talkCount++;
1266 }
1267 else
1268 {
1270 events.RepeatEvent(15000);
1271 talkCount = 0;
1272 }
1273
1274 break;
1275 }
1276 }
1277
1278 if (inFight)
1280 }
constexpr auto IN_MILLISECONDS
Definition Common.h:53
@ EFFECT_0
Definition SharedDefines.h:31
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
bool UpdateVictim()
Definition CreatureAI.cpp:282
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
Definition Player.h:1082
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:9348
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
Definition Unit.h:620
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition Unit.cpp:5701
Unit * GetVictim() const
Definition Unit.h:846
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
Creature * SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
Definition Object.cpp:2417
@ 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
@ SPELL_SHAKE_CAMERA_SMALL
Definition hallows_end.cpp:952
@ SPELL_EARTH_EXPLOSION
Definition hallows_end.cpp:956
@ SPELL_SHAKE_CAMERA_MEDIUM
Definition hallows_end.cpp:951
@ TALK_PLAYER_KNOW_DEMISE
Definition hallows_end.cpp:1005
@ TALK_CONFLAGRATION
Definition hallows_end.cpp:992
@ SPELL_BODY_RESTORED_INFO
Definition hallows_end.cpp:961
@ TALK_ENTRANCE
Definition hallows_end.cpp:990
@ TALK_PLAYER_TIME_IS_NIGH
Definition hallows_end.cpp:1003
@ TALK_SPROUTING_PUMPKINS
Definition hallows_end.cpp:993
@ SPELL_SUMMON_PUMPKIN
Definition hallows_end.cpp:968
@ TALK_PLAYER_RISE
Definition hallows_end.cpp:1002
@ TALK_PLAYER_FELT_DEATH
Definition hallows_end.cpp:1004
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210
Player * GetRhymePlayer()
Definition hallows_end.cpp:1105

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


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