AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
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 ()
 
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
130 : ScriptedAI(c), summons(me)
131 {
132 }
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
SummonList summons
Definition zone_isle_of_queldanas.cpp:135

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.

213 {
214 if (damage >= me->GetHealth())
215 {
216 damage = 0;
217 me->setActive(false);
219 }
220 }
@ EVADE_REASON_OTHER
Definition CreatureAI.h:93
uint32 GetHealth() const
Definition Unit.h:1038
void setActive(bool isActiveObject)
Definition Object.cpp:1094
void EnterEvadeMode(EvadeReason why) override
Definition zone_isle_of_queldanas.cpp:428

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.

429 {
430 if (me->isActiveObject())
431 return;
433 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:208
bool isActiveObject() const
Definition Object.h:580

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.

173 {
174 summons.Summon(summon);
175 }
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.

423 {
424 if (type == POINT_MOTION_TYPE && id == EVENT_CHARGE)
425 events.ScheduleEvent(EVENT_SET_FACING, 0);
426 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EVENT_CHARGE
Definition SharedDefines.h:3311
events
Definition boss_sartura.cpp:43
@ EVENT_SET_FACING
Definition zone_isle_of_queldanas.cpp:78

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.

140 {
141 me->SetVisible(false);
148 if (Creature* c = me->FindNearestCreature(NPC_THALORIEN_REMAINS, 100.0f, true))
149 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
150 events.Reset();
151 events.ScheduleEvent(EVENT_CHECK_PLAYER, 5000);
152 events.ScheduleEvent(EVENT_SUMMON_SOLDIERS, 0);
153 events.ScheduleEvent(EVENT_TALK_INTRO_0, 3000);
154 events.ScheduleEvent(EVENT_TALK_INTRO_1, 8000);
155 events.ScheduleEvent(EVENT_TALK_INTRO_2, 15000);
156 events.ScheduleEvent(EVENT_TALK_INTRO_3, 22000);
157 events.ScheduleEvent(EVENT_SALUTE, 24000);
158 events.ScheduleEvent(EVENT_SOLDIERS_RUN_AWAY, 30000);
159 events.ScheduleEvent(EVENT_GO_FIGHTPOINT, 31000);
160 events.ScheduleEvent(EVENT_TALK_SPAWN_0, 38000);
161 events.ScheduleEvent(EVENT_SUMMON_MORLEN, 44000);
162 events.ScheduleEvent(EVENT_TALK_SPAWN_1, 47000);
163 events.ScheduleEvent(EVENT_TALK_MORLEN_0, 52000);
164 events.ScheduleEvent(EVENT_TALK_MORLEN_1, 58000);
165 events.ScheduleEvent(EVENT_SPAWN_WAVE_1, 61000);
166
167 events.ScheduleEvent(EVENT_SPELL_BLADESTORM, urand(6000, 15000));
168 events.ScheduleEvent(EVENT_SPELL_MORTAL_STRIKE, urand(3000, 7000));
169 events.ScheduleEvent(EVENT_SPELL_HEROIC_STRIKE, urand(4000, 10000));
170 }
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:21372
void SetStandState(uint8 state)
Definition Unit.cpp:16778
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2459
ObjectGuid playerGUID
Definition zone_isle_of_queldanas.cpp:136
ObjectGuid morlenGUID
Definition zone_isle_of_queldanas.cpp:137
@ NPC_THALORIEN_REMAINS
Definition zone_isle_of_queldanas.cpp:42
@ EVENT_SOLDIERS_RUN_AWAY
Definition zone_isle_of_queldanas.cpp:61
@ EVENT_TALK_SPAWN_0
Definition zone_isle_of_queldanas.cpp:63
@ EVENT_TALK_INTRO_2
Definition zone_isle_of_queldanas.cpp:58
@ EVENT_SALUTE
Definition zone_isle_of_queldanas.cpp:60
@ EVENT_CHECK_PLAYER
Definition zone_isle_of_queldanas.cpp:54
@ EVENT_TALK_SPAWN_1
Definition zone_isle_of_queldanas.cpp:64
@ EVENT_SUMMON_SOLDIERS
Definition zone_isle_of_queldanas.cpp:55
@ EVENT_SUMMON_MORLEN
Definition zone_isle_of_queldanas.cpp:65
@ EVENT_TALK_MORLEN_0
Definition zone_isle_of_queldanas.cpp:66
@ EVENT_TALK_INTRO_0
Definition zone_isle_of_queldanas.cpp:56
@ EVENT_GO_FIGHTPOINT
Definition zone_isle_of_queldanas.cpp:62
@ EVENT_TALK_INTRO_1
Definition zone_isle_of_queldanas.cpp:57
@ EVENT_TALK_INTRO_3
Definition zone_isle_of_queldanas.cpp:59
@ EVENT_SPELL_HEROIC_STRIKE
Definition zone_isle_of_queldanas.cpp:81
@ EVENT_SPAWN_WAVE_1
Definition zone_isle_of_queldanas.cpp:68
@ EVENT_SPELL_BLADESTORM
Definition zone_isle_of_queldanas.cpp:79
@ EVENT_SPELL_MORTAL_STRIKE
Definition zone_isle_of_queldanas.cpp:80
@ EVENT_TALK_MORLEN_1
Definition zone_isle_of_queldanas.cpp:67

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.

436 {
437 if (type == 1 && id == 1 && !me->isActiveObject())
438 if (Player* p = me->SelectNearestPlayer(50.0f))
439 {
440 me->SetVisible(true);
442 me->setActive(true);
443 playerGUID = p->GetGUID();
444 }
445 }
Definition Player.h:1081
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.

178 {
179 summons.Despawn(summon);
180 if (summon->GetEntry() != NPC_SUNWELL_DEFENDER && me->isActiveObject())
181 {
182 if (summon->GetEntry() == NPC_MORLEN_COLDGRIP)
183 {
186 me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
187 events.ScheduleEvent(EVENT_OUTRO_0, 0);
188 events.ScheduleEvent(EVENT_OUTRO_1, 5000);
189 events.ScheduleEvent(EVENT_OUTRO_2, 12000);
190 events.ScheduleEvent(EVENT_OUTRO_3, 19000);
191 }
192 else if (summons.size() == 1)
193 {
195 me->GetMotionMaster()->MoveCharge(11779.30f, -7065.43f, 24.92f, me->GetSpeed(MOVE_RUN), EVENT_CHARGE);
196 switch (summon->GetEntry())
197 {
199 events.ScheduleEvent(EVENT_SPAWN_WAVE_2, 3000);
200 break;
202 events.ScheduleEvent(EVENT_SPAWN_WAVE_3, 3000);
203 break;
204 case NPC_CRYPT_RAIDER:
205 events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
206 break;
207 }
208 }
209 }
210 }
@ 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:115
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:1673
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4941
@ NPC_SCOURGE_ZOMBIE
Definition zone_isle_of_queldanas.cpp:46
@ NPC_GHOUL_INVADER
Definition zone_isle_of_queldanas.cpp:47
@ NPC_CRYPT_RAIDER
Definition zone_isle_of_queldanas.cpp:48
@ NPC_SUNWELL_DEFENDER
Definition zone_isle_of_queldanas.cpp:43
@ NPC_MORLEN_COLDGRIP
Definition zone_isle_of_queldanas.cpp:45
@ EVENT_SPAWN_WAVE_2
Definition zone_isle_of_queldanas.cpp:69
@ EVENT_OUTRO_2
Definition zone_isle_of_queldanas.cpp:74
@ EVENT_OUTRO_3
Definition zone_isle_of_queldanas.cpp:75
@ EVENT_SPAWN_WAVE_3
Definition zone_isle_of_queldanas.cpp:70
@ EVENT_OUTRO_1
Definition zone_isle_of_queldanas.cpp:73
@ EVENT_OUTRO_0
Definition zone_isle_of_queldanas.cpp:72
@ EVENT_SUMMONS_ATTACK
Definition zone_isle_of_queldanas.cpp:71

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.

223 {
224 if (!me->isActiveObject())
225 return;
226
227 UpdateVictim();
228
229 events.Update(diff);
230
232 return;
233
234 switch (uint32 evId = events.ExecuteEvent())
235 {
236 case 0:
237 break;
240 if (p->GetExactDist(me) <= 50.0f)
241 {
242 events.RepeatEvent(5000);
243 break;
244 }
245 me->setActive(false);
247 return;
249 for (uint8 i = 0; i < SUNWELL_DEFENDER_NUM; ++i)
251 break;
257 break;
258 case EVENT_SALUTE:
260 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
261 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
262 c->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
263 break;
265 {
266 uint8 count = 0;
267 for (SummonList::iterator itr = summons.begin(); itr != summons.end();)
268 {
269 ++count;
270 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
271 {
272 c->SetWalk(false);
273 c->GetMotionMaster()->MovePoint(0, 11863.35f, -7073.44f, 27.40f);
274 }
275 SummonList::iterator itr2 = itr++;
276 summons.erase(itr2);
277 if (count >= 5)
278 {
279 if (!summons.empty())
280 {
281 events.RepeatEvent(5000);
282 return;
283 }
284 else
285 {
286 return;
287 }
288 }
289 }
290 }
291 break;
293 me->SetWalk(true);
294 me->GetMotionMaster()->MovePoint(0, 11779.30f, -7065.43f, 24.92f);
296 break;
300 break;
302 if (Creature* c = me->SummonCreature(NPC_MORLEN_COLDGRIP, 11766.70f, -7050.57f, 25.17f, 5.56f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
303 morlenGUID = c->GetGUID();
304 break;
308 c->AI()->Talk(SAY_MORLEN_0 + (evId - EVENT_TALK_MORLEN_0));
309 break;
314 {
315 c->AI()->Talk(SAY_MORLEN_1 + (evId - EVENT_SPAWN_WAVE_1));
316 switch (evId)
317 {
318 // emerge cast tr false 66947
320 {
321 Position spawnPos = c->GetPosition();
322 spawnPos.SetOrientation(5.80f);
323 spawnPos.m_positionX += 5.0f * cos(4.5f);
324 spawnPos.m_positionY += 5.0f * std::sin(4.5f);
325 for (uint8 i = 0; i < 5; ++i)
327 {
328 spawnPos.m_positionX += 2.5f * cos(4.5f);
329 spawnPos.m_positionY += 2.5f * std::sin(4.5f);
330 }
331 }
332 break;
334 {
335 Position spawnPos = c->GetPosition();
336 spawnPos.SetOrientation(5.80f);
337 spawnPos.m_positionX += 7.0f * cos(4.0f);
338 spawnPos.m_positionY += 7.0f * std::sin(4.0f);
339 for (uint8 i = 0; i < 3; ++i)
341 {
342 s->CastSpell(s, 66947, false); // emerge effect
343 spawnPos.m_positionX += 4.0f * cos(4.5f);
344 spawnPos.m_positionY += 4.0f * std::sin(4.5f);
345 }
346 }
347 break;
349 {
350 Position spawnPos = c->GetPosition();
351 spawnPos.SetOrientation(5.80f);
352 spawnPos.m_positionX += 8.0f * cos(4.0f);
353 spawnPos.m_positionY += 8.0f * std::sin(4.0f);
354 for (uint8 i = 0; i < 3; ++i)
356 {
357 s->CastSpell(s, 66947, false); // emerge effect
358 spawnPos.m_positionX += 4.0f * cos(4.5f);
359 spawnPos.m_positionY += 4.0f * std::sin(4.5f);
360 }
361 }
362 break;
363 }
364 }
365 events.ScheduleEvent(EVENT_SUMMONS_ATTACK, 3000);
366 break;
368 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
369 if (Creature* c = ObjectAccessor::GetCreature(*me, *itr))
370 {
371 if (c->GetEntry() == NPC_MORLEN_COLDGRIP && summons.size() != 1)
372 continue;
373 else
374 c->AI()->Talk(SAY_MORLEN_4);
375 c->SetImmuneToAll(false);
376 c->AI()->AttackStart(me);
377 }
378 break;
379 case EVENT_OUTRO_0:
380 case EVENT_OUTRO_1:
381 case EVENT_OUTRO_2:
382 case EVENT_OUTRO_3:
383 Talk(SAY_OUTRO_0 + (evId - EVENT_OUTRO_0));
384 if (evId == EVENT_OUTRO_3)
385 events.ScheduleEvent(EVENT_OUTRO_KNEEL, 6000);
386 break;
389 p->KilledMonsterCredit(NPC_THALORIEN_KILL_CREDIT);
391 events.ScheduleEvent(EVENT_DISAPPEAR, 6000);
392 break;
393 case EVENT_DISAPPEAR:
394 me->SetVisible(false);
395 me->setActive(false);
397 break;
398 case EVENT_SET_FACING:
399 me->SetFacingTo(2.45f);
400 break;
401
404 me->CastSpell(me->GetVictim(), 67541, false);
405 events.RepeatEvent(urand(25000, 35000));
406 break;
409 me->CastSpell(me->GetVictim(), 67542, false);
410 events.RepeatEvent(urand(7000, 12000));
411 break;
414 me->CastSpell(me->GetVictim(), 57846, false);
415 events.RepeatEvent(urand(5000, 10000));
416 break;
417 }
418
420 }
std::uint8_t uint8
Definition Define.h:109
std::uint32_t uint32
Definition Define.h:107
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:48
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:51
@ 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:280
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3208
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:20581
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition Unit.cpp:664
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:1178
Unit * GetVictim() const
Definition Unit.h:862
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2011
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:104
@ NPC_THALORIEN_KILL_CREDIT
Definition zone_isle_of_queldanas.cpp:44
@ EVENT_OUTRO_KNEEL
Definition zone_isle_of_queldanas.cpp:76
@ EVENT_DISAPPEAR
Definition zone_isle_of_queldanas.cpp:77
#define SUNWELL_DEFENDER_NUM
Definition zone_isle_of_queldanas.cpp:103
@ SAY_MORLEN_1
Definition zone_isle_of_queldanas.cpp:93
@ SAY_SPAWN_0
Definition zone_isle_of_queldanas.cpp:90
@ SAY_MORLEN_0
Definition zone_isle_of_queldanas.cpp:92
@ SAY_OUTRO_0
Definition zone_isle_of_queldanas.cpp:97
@ SAY_INTRO_0
Definition zone_isle_of_queldanas.cpp:86
@ SAY_MORLEN_4
Definition zone_isle_of_queldanas.cpp:96

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: