AzerothCore 3.3.5a
OpenSource WoW Emulator
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI Struct Reference
Inheritance diagram for npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_bh_thalorien_dawnseekerAI (Creature *c)
 
void Reset () override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void DamageTaken (Unit *, uint32 &damage, 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 MovementInform (uint32 type, uint32 id) override
 
void EnterEvadeMode (EvadeReason why) override
 
void SetData (uint32 type, uint32 id) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
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
 
ObjectGuid morlenGUID
 
- 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

◆ npc_bh_thalorien_dawnseekerAI()

npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::npc_bh_thalorien_dawnseekerAI ( Creature c)
inline
118 : ScriptedAI(c), summons(me)
119 {
120 }
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition zone_isle_of_queldanas.cpp:123

Member Function Documentation

◆ DamageTaken()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::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.

201 {
202 if (damage >= me->GetHealth())
203 {
204 damage = 0;
205 me->setActive(false);
207 }
208 }
@ EVADE_REASON_OTHER
Definition CreatureAI.h:93
uint32 GetHealth() const
Definition Unit.h:1029
void setActive(bool isActiveObject)
Definition Object.cpp:1094
void EnterEvadeMode(EvadeReason why) override
Definition zone_isle_of_queldanas.cpp:416

References EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, Unit::GetHealth(), ScriptedAI::me, and WorldObject::setActive().

◆ EnterEvadeMode()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

417 {
418 if (me->isActiveObject())
419 return;
421 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:210
bool isActiveObject() const
Definition Object.h:581

References CreatureAI::EnterEvadeMode(), WorldObject::isActiveObject(), and ScriptedAI::me.

Referenced by DamageTaken(), and UpdateAI().

◆ JustSummoned()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

161 {
162 summons.Summon(summon);
163 }
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ MovementInform()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

411 {
412 if (type == POINT_MOTION_TYPE && id == EVENT_CHARGE)
413 events.ScheduleEvent(EVENT_SET_FACING, 0);
414 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EVENT_CHARGE
Definition SharedDefines.h:3327
events
Definition boss_sartura.cpp:43
@ EVENT_SET_FACING
Definition zone_isle_of_queldanas.cpp:66

References EVENT_CHARGE, EVENT_SET_FACING, and POINT_MOTION_TYPE.

◆ Reset()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

128 {
129 me->SetVisible(false);
136 if (Creature* c = me->FindNearestCreature(NPC_THALORIEN_REMAINS, 100.0f, true))
137 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
138 events.Reset();
139 events.ScheduleEvent(EVENT_CHECK_PLAYER, 5000);
140 events.ScheduleEvent(EVENT_SUMMON_SOLDIERS, 0);
141 events.ScheduleEvent(EVENT_TALK_INTRO_0, 3000);
142 events.ScheduleEvent(EVENT_TALK_INTRO_1, 8000);
143 events.ScheduleEvent(EVENT_TALK_INTRO_2, 15000);
144 events.ScheduleEvent(EVENT_TALK_INTRO_3, 22000);
145 events.ScheduleEvent(EVENT_SALUTE, 24000);
146 events.ScheduleEvent(EVENT_SOLDIERS_RUN_AWAY, 30000);
147 events.ScheduleEvent(EVENT_GO_FIGHTPOINT, 31000);
148 events.ScheduleEvent(EVENT_TALK_SPAWN_0, 38000);
149 events.ScheduleEvent(EVENT_SUMMON_MORLEN, 44000);
150 events.ScheduleEvent(EVENT_TALK_SPAWN_1, 47000);
151 events.ScheduleEvent(EVENT_TALK_MORLEN_0, 52000);
152 events.ScheduleEvent(EVENT_TALK_MORLEN_1, 58000);
153 events.ScheduleEvent(EVENT_SPAWN_WAVE_1, 61000);
154
155 events.ScheduleEvent(EVENT_SPELL_BLADESTORM, urand(6000, 15000));
156 events.ScheduleEvent(EVENT_SPELL_MORTAL_STRIKE, urand(3000, 7000));
157 events.ScheduleEvent(EVENT_SPELL_HEROIC_STRIKE, urand(4000, 10000));
158 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ EMOTE_ONESHOT_NONE
Definition SharedDefines.h:1894
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:32
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:315
@ UNIT_NPC_EMOTESTATE
Definition UpdateFields.h:140
Definition Creature.h:43
void SetRegeneratingHealth(bool enable)
Definition Creature.h:322
void Clear()
Definition ObjectGuid.h:138
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71
void SetVisible(bool x)
Definition Unit.cpp:14284
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21141
void SetStandState(uint8 state)
Definition Unit.cpp:16760
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459
ObjectGuid playerGUID
Definition zone_isle_of_queldanas.cpp:124
ObjectGuid morlenGUID
Definition zone_isle_of_queldanas.cpp:125
@ NPC_THALORIEN_REMAINS
Definition zone_isle_of_queldanas.cpp:30
@ EVENT_SOLDIERS_RUN_AWAY
Definition zone_isle_of_queldanas.cpp:49
@ EVENT_TALK_SPAWN_0
Definition zone_isle_of_queldanas.cpp:51
@ EVENT_TALK_INTRO_2
Definition zone_isle_of_queldanas.cpp:46
@ EVENT_SALUTE
Definition zone_isle_of_queldanas.cpp:48
@ EVENT_CHECK_PLAYER
Definition zone_isle_of_queldanas.cpp:42
@ EVENT_TALK_SPAWN_1
Definition zone_isle_of_queldanas.cpp:52
@ EVENT_SUMMON_SOLDIERS
Definition zone_isle_of_queldanas.cpp:43
@ EVENT_SUMMON_MORLEN
Definition zone_isle_of_queldanas.cpp:53
@ EVENT_TALK_MORLEN_0
Definition zone_isle_of_queldanas.cpp:54
@ EVENT_TALK_INTRO_0
Definition zone_isle_of_queldanas.cpp:44
@ EVENT_GO_FIGHTPOINT
Definition zone_isle_of_queldanas.cpp:50
@ EVENT_TALK_INTRO_1
Definition zone_isle_of_queldanas.cpp:45
@ EVENT_TALK_INTRO_3
Definition zone_isle_of_queldanas.cpp:47
@ EVENT_SPELL_HEROIC_STRIKE
Definition zone_isle_of_queldanas.cpp:69
@ EVENT_SPAWN_WAVE_1
Definition zone_isle_of_queldanas.cpp:56
@ EVENT_SPELL_BLADESTORM
Definition zone_isle_of_queldanas.cpp:67
@ EVENT_SPELL_MORTAL_STRIKE
Definition zone_isle_of_queldanas.cpp:68
@ EVENT_TALK_MORLEN_1
Definition zone_isle_of_queldanas.cpp:55

References ObjectGuid::Clear(), SummonList::DespawnAll(), EMOTE_ONESHOT_NONE, EVENT_CHECK_PLAYER, EVENT_GO_FIGHTPOINT, EVENT_SALUTE, EVENT_SOLDIERS_RUN_AWAY, EVENT_SPAWN_WAVE_1, EVENT_SPELL_BLADESTORM, EVENT_SPELL_HEROIC_STRIKE, EVENT_SPELL_MORTAL_STRIKE, EVENT_SUMMON_MORLEN, EVENT_SUMMON_SOLDIERS, EVENT_TALK_INTRO_0, EVENT_TALK_INTRO_1, EVENT_TALK_INTRO_2, EVENT_TALK_INTRO_3, EVENT_TALK_MORLEN_0, EVENT_TALK_MORLEN_1, EVENT_TALK_SPAWN_0, EVENT_TALK_SPAWN_1, WorldObject::FindNearestCreature(), ScriptedAI::me, morlenGUID, NPC_THALORIEN_REMAINS, playerGUID, Creature::SetRegeneratingHealth(), Unit::SetStandState(), Unit::SetUInt32Value(), Unit::SetVisible(), summons, UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, UNIT_STAND_STATE_STAND, and urand().

◆ SetData()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::SetData ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from UnitAI.

424 {
425 if (type == 1 && id == 1 && !me->isActiveObject())
426 if (Player* p = me->SelectNearestPlayer(50.0f))
427 {
428 me->SetVisible(true);
430 me->setActive(true);
431 playerGUID = p->GetGUID();
432 }
433 }
Definition Player.h:1083
Player * SelectNearestPlayer(float distance=0) const
Definition Object.cpp:2486

References WorldObject::isActiveObject(), ScriptedAI::me, playerGUID, WorldObject::SelectNearestPlayer(), WorldObject::setActive(), Creature::SetRegeneratingHealth(), and Unit::SetVisible().

◆ SummonedCreatureDespawn()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

166 {
167 summons.Despawn(summon);
168 if (summon->GetEntry() != NPC_SUNWELL_DEFENDER && me->isActiveObject())
169 {
170 if (summon->GetEntry() == NPC_MORLEN_COLDGRIP)
171 {
174 me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
175 events.ScheduleEvent(EVENT_OUTRO_0, 0);
176 events.ScheduleEvent(EVENT_OUTRO_1, 5000);
177 events.ScheduleEvent(EVENT_OUTRO_2, 12000);
178 events.ScheduleEvent(EVENT_OUTRO_3, 19000);
179 }
180 else if (summons.size() == 1)
181 {
183 me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
184 switch (summon->GetEntry())
185 {
187 events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);
188 break;
190 events.ScheduleEvent(EVENT_SPAWN_WAVE_3, 3000);
191 break;
192 case NPC_CRYPT_RAIDER:
193 events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
194 break;
195 }
196 }
197 }
198 }
@ MOVE_RUN
Definition UnitDefines.h:350
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, const Movement::PointsArray *path=nullptr, bool generatePath=false, float orientation=0.0f, ObjectGuid targetGUID=ObjectGuid::Empty)
The unit will charge the target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:670
uint32 GetEntry() const
Definition Object.h:116
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89
size_type size() const
Definition ScriptedCreature.h:78
float GetSpeed(UnitMoveType mtype) const
Definition Unit.cpp:14476
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4943
@ NPC_SCOURGE_ZOMBIE
Definition zone_isle_of_queldanas.cpp:34
@ NPC_GHOUL_INVADER
Definition zone_isle_of_queldanas.cpp:35
@ NPC_CRYPT_RAIDER
Definition zone_isle_of_queldanas.cpp:36
@ NPC_SUNWELL_DEFENDER
Definition zone_isle_of_queldanas.cpp:31
@ NPC_MORLEN_COLDGRIP
Definition zone_isle_of_queldanas.cpp:33
@ EVENT_SPAWN_WAVE_2
Definition zone_isle_of_queldanas.cpp:57
@ EVENT_OUTRO_2
Definition zone_isle_of_queldanas.cpp:62
@ EVENT_OUTRO_3
Definition zone_isle_of_queldanas.cpp:63
@ EVENT_SPAWN_WAVE_3
Definition zone_isle_of_queldanas.cpp:58
@ EVENT_OUTRO_1
Definition zone_isle_of_queldanas.cpp:61
@ EVENT_OUTRO_0
Definition zone_isle_of_queldanas.cpp:60
@ EVENT_SUMMONS_ATTACK
Definition zone_isle_of_queldanas.cpp:59

References SummonList::Despawn(), EMOTE_ONESHOT_NONE, EVENT_CHARGE, EVENT_OUTRO_0, EVENT_OUTRO_1, EVENT_OUTRO_2, EVENT_OUTRO_3, EVENT_SPAWN_WAVE_2, EVENT_SPAWN_WAVE_3, EVENT_SUMMONS_ATTACK, Object::GetEntry(), Unit::GetMotionMaster(), Unit::GetSpeed(), WorldObject::isActiveObject(), ScriptedAI::me, MOVE_RUN, MotionMaster::MoveCharge(), NPC_CRYPT_RAIDER, NPC_GHOUL_INVADER, NPC_MORLEN_COLDGRIP, NPC_SCOURGE_ZOMBIE, NPC_SUNWELL_DEFENDER, Unit::RemoveAurasDueToSpell(), Unit::SetUInt32Value(), SummonList::size(), summons, and UNIT_NPC_EMOTESTATE.

◆ UpdateAI()

void npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

211 {
212 if (!me->isActiveObject())
213 return;
214
215 UpdateVictim();
216
217 events.Update(diff);
218
220 return;
221
222 switch (uint32 evId = events.ExecuteEvent())
223 {
224 case 0:
225 break;
228 if (p->GetExactDist(me) <= 50.0f)
229 {
230 events.RepeatEvent(5000);
231 break;
232 }
233 me->setActive(false);
235 return;
237 for (uint8 i = 0; i < SUNWELL_DEFENDER_NUM; ++i)
239 break;
245 break;
246 case EVENT_SALUTE:
248 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
249 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
250 c->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
251 break;
253 {
254 uint8 count = 0;
255 for (SummonList::iterator itr = summons.begin(); itr != summons.end();)
256 {
257 ++count;
258 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
259 {
260 c->SetWalk(false);
261 c->GetMotionMaster()->MovePoint(0, 11863.35f, -7073.44f, 27.40f);
262 }
263 SummonList::iterator itr2 = itr++;
264 summons.erase(itr2);
265 if (count >= 5)
266 {
267 if (!summons.empty())
268 {
269 events.RepeatEvent(5000);
270 return;
271 }
272 else
273 {
274 return;
275 }
276 }
277 }
278 }
279 break;
281 me->SetWalk(true);
282 me->GetMotionMaster()->MovePoint(0, 11779.30f, -7065.43f, 24.92f);
284 break;
288 break;
290 if (Creature* c = me->SummonCreature(NPC_MORLEN_COLDGRIP, 11766.70f, -7050.57f, 25.17f, 5.56f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
291 morlenGUID = c->GetGUID();
292 break;
296 c->AI()->Talk(SAY_MORLEN_0 + (evId - EVENT_TALK_MORLEN_0));
297 break;
302 {
303 c->AI()->Talk(SAY_MORLEN_1 + (evId - EVENT_SPAWN_WAVE_1));
304 switch (evId)
305 {
306 // emerge cast tr false 66947
308 {
309 Position spawnPos = c->GetPosition();
310 spawnPos.SetOrientation(5.80f);
311 spawnPos.m_positionX += 5.0f * cos(4.5f);
312 spawnPos.m_positionY += 5.0f * std::sin(4.5f);
313 for (uint8 i = 0; i < 5; ++i)
315 {
316 spawnPos.m_positionX += 2.5f * cos(4.5f);
317 spawnPos.m_positionY += 2.5f * std::sin(4.5f);
318 }
319 }
320 break;
322 {
323 Position spawnPos = c->GetPosition();
324 spawnPos.SetOrientation(5.80f);
325 spawnPos.m_positionX += 7.0f * cos(4.0f);
326 spawnPos.m_positionY += 7.0f * std::sin(4.0f);
327 for (uint8 i = 0; i < 3; ++i)
329 {
330 s->CastSpell(s, 66947, false); // emerge effect
331 spawnPos.m_positionX += 4.0f * cos(4.5f);
332 spawnPos.m_positionY += 4.0f * std::sin(4.5f);
333 }
334 }
335 break;
337 {
338 Position spawnPos = c->GetPosition();
339 spawnPos.SetOrientation(5.80f);
340 spawnPos.m_positionX += 8.0f * cos(4.0f);
341 spawnPos.m_positionY += 8.0f * std::sin(4.0f);
342 for (uint8 i = 0; i < 3; ++i)
344 {
345 s->CastSpell(s, 66947, false); // emerge effect
346 spawnPos.m_positionX += 4.0f * cos(4.5f);
347 spawnPos.m_positionY += 4.0f * std::sin(4.5f);
348 }
349 }
350 break;
351 }
352 }
353 events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
354 break;
356 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
357 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
358 {
359 if (c->GetEntry() == NPC_MORLEN_COLDGRIP && summons.size() != 1)
360 continue;
361 else
362 c->AI()->Talk(SAY_MORLEN_4);
363 c->SetImmuneToAll(false);
364 c->AI()->AttackStart(me);
365 }
366 break;
367 case EVENT_OUTRO_0:
368 case EVENT_OUTRO_1:
369 case EVENT_OUTRO_2:
370 case EVENT_OUTRO_3:
371 Talk(SAY_OUTRO_0 + (evId - EVENT_OUTRO_0));
372 if (evId == EVENT_OUTRO_3)
373 events.ScheduleEvent(EVENT_OUTRO_KNEEL, 6000);
374 break;
377 p->KilledMonsterCredit(NPC_THALORIEN_KILL_CREDIT);
379 events.ScheduleEvent(EVENT_DISAPPEAR, 6000);
380 break;
381 case EVENT_DISAPPEAR:
382 me->SetVisible(false);
383 me->setActive(false);
385 break;
386 case EVENT_SET_FACING:
387 me->SetFacingTo(2.45f);
388 break;
389
392 me->CastSpell(me->GetVictim(), 67541, false);
393 events.RepeatEvent(urand(25000, 35000));
394 break;
397 me->CastSpell(me->GetVictim(), 67542, false);
398 events.RepeatEvent(urand(7000, 12000));
399 break;
402 me->CastSpell(me->GetVictim(), 57846, false);
403 events.RepeatEvent(urand(5000, 10000));
404 break;
405 }
406
408 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:49
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:52
@ EMOTE_ONESHOT_SALUTE
Definition SharedDefines.h:1942
@ EMOTE_STATE_READY2H
Definition SharedDefines.h:1970
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:40
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
bool UpdateVictim()
Definition CreatureAI.cpp:282
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3212
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
bool empty() const
Definition ScriptedCreature.h:73
iterator erase(iterator i)
Definition ScriptedCreature.h:68
iterator begin()
Definition ScriptedCreature.h:48
StorageType::const_iterator const_iterator
Definition ScriptedCreature.h:37
iterator end()
Definition ScriptedCreature.h:58
StorageType::iterator iterator
Definition ScriptedCreature.h:36
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
void SetFacingTo(float ori)
Definition Unit.cpp:20328
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition Unit.cpp:665
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:1180
Unit * GetVictim() const
Definition Unit.h:846
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2013
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
Talk
Definition hyjal.cpp:82
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition ObjectAccessor.cpp:220
Definition Position.h:27
float m_positionX
Definition Position.h:55
float m_positionY
Definition Position.h:56
void SetOrientation(float orientation)
Definition Position.h:116
void GetPosition(float &x, float &y) const
Definition Position.h:126
const Position SunwellDefenderPos[SUNWELL_DEFENDER_NUM]
Definition zone_isle_of_queldanas.cpp:92
@ NPC_THALORIEN_KILL_CREDIT
Definition zone_isle_of_queldanas.cpp:32
@ EVENT_OUTRO_KNEEL
Definition zone_isle_of_queldanas.cpp:64
@ EVENT_DISAPPEAR
Definition zone_isle_of_queldanas.cpp:65
#define SUNWELL_DEFENDER_NUM
Definition zone_isle_of_queldanas.cpp:91
@ SAY_MORLEN_1
Definition zone_isle_of_queldanas.cpp:81
@ SAY_SPAWN_0
Definition zone_isle_of_queldanas.cpp:78
@ SAY_MORLEN_0
Definition zone_isle_of_queldanas.cpp:80
@ SAY_OUTRO_0
Definition zone_isle_of_queldanas.cpp:85
@ SAY_INTRO_0
Definition zone_isle_of_queldanas.cpp:74
@ SAY_MORLEN_4
Definition zone_isle_of_queldanas.cpp:84

References SummonList::begin(), Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), EMOTE_ONESHOT_SALUTE, EMOTE_STATE_READY2H, SummonList::empty(), SummonList::end(), EnterEvadeMode(), SummonList::erase(), CreatureAI::EVADE_REASON_OTHER, EVENT_CHECK_PLAYER, EVENT_DISAPPEAR, EVENT_GO_FIGHTPOINT, EVENT_OUTRO_0, EVENT_OUTRO_1, EVENT_OUTRO_2, EVENT_OUTRO_3, EVENT_OUTRO_KNEEL, EVENT_SALUTE, EVENT_SET_FACING, EVENT_SOLDIERS_RUN_AWAY, EVENT_SPAWN_WAVE_1, EVENT_SPAWN_WAVE_2, EVENT_SPAWN_WAVE_3, EVENT_SPELL_BLADESTORM, EVENT_SPELL_HEROIC_STRIKE, EVENT_SPELL_MORTAL_STRIKE, EVENT_SUMMON_MORLEN, EVENT_SUMMON_SOLDIERS, EVENT_SUMMONS_ATTACK, EVENT_TALK_INTRO_0, EVENT_TALK_INTRO_1, EVENT_TALK_INTRO_2, EVENT_TALK_INTRO_3, EVENT_TALK_MORLEN_0, EVENT_TALK_MORLEN_1, EVENT_TALK_SPAWN_0, EVENT_TALK_SPAWN_1, ObjectAccessor::GetCreature(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), Position::GetPosition(), Unit::GetVictim(), Unit::HandleEmoteCommand(), Unit::HasUnitState(), WorldObject::isActiveObject(), Unit::IsWithinMeleeRange(), Position::m_positionX, Position::m_positionY, ScriptedAI::me, morlenGUID, MotionMaster::MovePoint(), NPC_CRYPT_RAIDER, NPC_GHOUL_INVADER, NPC_MORLEN_COLDGRIP, NPC_SCOURGE_ZOMBIE, NPC_SUNWELL_DEFENDER, NPC_THALORIEN_KILL_CREDIT, playerGUID, SAY_INTRO_0, SAY_MORLEN_0, SAY_MORLEN_1, SAY_MORLEN_4, SAY_OUTRO_0, SAY_SPAWN_0, WorldObject::setActive(), Unit::SetFacingTo(), Position::SetOrientation(), Unit::SetStandState(), Unit::SetUInt32Value(), Unit::SetVisible(), Creature::SetWalk(), SummonList::size(), WorldObject::SummonCreature(), summons, SUNWELL_DEFENDER_NUM, SunwellDefenderPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_NPC_EMOTESTATE, UNIT_STAND_STATE_KNEEL, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ events

EventMap npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::events

◆ morlenGUID

ObjectGuid npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::morlenGUID

Referenced by Reset(), and UpdateAI().

◆ playerGUID

ObjectGuid npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::playerGUID

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

◆ summons

SummonList npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::summons

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