AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI Struct Reference
Inheritance diagram for npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_overlord_drakuru_betrayalAI (Creature *creature)
 
void EnterEvadeMode (EvadeReason why) override
 
void Reset () override
 
void MoveInLineOfSight (Unit *who) override
 
void JustSummoned (Creature *cr) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void SpellHitTarget (Unit *target, SpellInfo const *spellInfo) override
 
void SpellHit (Unit *, SpellInfo const *spellInfo) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
ObjectGuid playerGUID
 
ObjectGuid lichGUID
 
- 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_overlord_drakuru_betrayalAI()

npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::npc_overlord_drakuru_betrayalAI ( Creature creature)
inline
383 : ScriptedAI(creature), summons(me)
384 {
385 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
SummonList summons
Definition: zone_zuldrak.cpp:388

Member Function Documentation

◆ DamageTaken()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

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

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

Reimplemented from ScriptedAI.

468 {
469 if (damage >= me->GetHealth() && !me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE))
470 {
471 damage = 0;
473 me->CombatStop();
476 events.Reset();
477 events.ScheduleEvent(EVENT_BETRAYAL_4, 1s);
478 }
479 }
events
Definition: boss_sartura.cpp:43
@ EVENT_BETRAYAL_4
Definition: zone_zuldrak.cpp:340
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10436
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:712
uint32 GetHealth() const
Definition: Unit.h:1029
void RemoveAllAuras()
Definition: Unit.cpp:5319
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713

References Unit::CombatStop(), EVENT_BETRAYAL_4, FACTION_FRIENDLY, Unit::GetHealth(), Unit::HasUnitFlag(), ScriptedAI::me, Unit::RemoveAllAuras(), Unit::SetFaction(), Unit::SetUnitFlag(), and UNIT_FLAG_NON_ATTACKABLE.

◆ EnterEvadeMode()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

393 {
394 if (playerGUID)
396 if (player->IsWithinDistInMap(me, 80))
397 return;
401 }
@ FACTION_UNDEAD_SCOURGE
Definition: SharedDefines.h:225
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:220
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
Definition: Player.h:1081
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
ObjectGuid playerGUID
Definition: zone_zuldrak.cpp:389

References CreatureAI::EnterEvadeMode(), FACTION_UNDEAD_SCOURGE, ObjectAccessor::GetPlayer(), ScriptedAI::me, playerGUID, Unit::RemoveUnitFlag(), Unit::SetFaction(), and UNIT_FLAG_NON_ATTACKABLE.

Referenced by MoveInLineOfSight(), and UpdateAI().

◆ JustEngagedWith()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

460 {
462 events.ScheduleEvent(EVENT_BETRAYAL_SHADOW_BOLT, 2s);
463 events.ScheduleEvent(EVENT_BETRAYAL_CRYSTAL, 5s);
464 events.ScheduleEvent(EVENT_BETRAYAL_COMBAT_TALK, 20s);
465 }
Talk
Definition: hyjal.cpp:82
@ EVENT_BETRAYAL_COMBAT_TALK
Definition: zone_zuldrak.cpp:353
@ EVENT_BETRAYAL_CRYSTAL
Definition: zone_zuldrak.cpp:352
@ EVENT_BETRAYAL_SHADOW_BOLT
Definition: zone_zuldrak.cpp:351
@ SAY_DRAKURU_3
Definition: zone_zuldrak.cpp:358

References EVENT_BETRAYAL_COMBAT_TALK, EVENT_BETRAYAL_CRYSTAL, EVENT_BETRAYAL_SHADOW_BOLT, and SAY_DRAKURU_3.

◆ JustSummoned()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

446 {
447 summons.Summon(cr);
448 if (cr->GetEntry() == NPC_BLIGHTBLOOD_TROLL)
449 cr->CastSpell(cr, SPELL_TELEPORT_EFFECT, true);
450 else
451 {
453 lichGUID = cr->GetGUID();
454 float o = me->GetAngle(cr);
455 cr->GetMotionMaster()->MovePoint(0, me->GetPositionX() + cos(o) * 6.0f, me->GetPositionY() + std::sin(o) * 6.0f, me->GetPositionZ());
456 }
457 }
@ SPELL_TELEPORT_EFFECT
Definition: zone_zuldrak.cpp:323
@ NPC_BLIGHTBLOOD_TROLL
Definition: zone_zuldrak.cpp:334
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
float GetAngle(const Position *pos) const
Definition: Position.cpp:78
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213
ObjectGuid lichGUID
Definition: zone_zuldrak.cpp:390

References Unit::CastSpell(), Position::GetAngle(), Object::GetEntry(), Object::GetGUID(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), lichGUID, ScriptedAI::me, MotionMaster::MovePoint(), NPC_BLIGHTBLOOD_TROLL, Unit::SetFacingToObject(), SPELL_TELEPORT_EFFECT, SummonList::Summon(), and summons.

◆ MoveInLineOfSight()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

415 {
416 if (who->IsPlayer())
417 {
418 if (playerGUID)
419 {
420 if (who->GetGUID() != playerGUID)
421 {
423 if (player && player->IsWithinDistInMap(me, 80))
424 who->ToPlayer()->NearTeleportTo(6143.76f, -1969.7f, 417.57f, 2.08f);
425 else
426 {
428 return;
429 }
430 }
431 else
433 }
435 {
436 me->SetVisible(true);
437 playerGUID = who->GetGUID();
438 events.ScheduleEvent(EVENT_BETRAYAL_1, 5s);
439 }
440 }
441 else
443 }
@ EVENT_BETRAYAL_1
Definition: zone_zuldrak.cpp:337
@ QUEST_BETRAYAL
Definition: zone_zuldrak.cpp:332
@ SPELL_SCOURGE_DISGUISE
Definition: zone_zuldrak.cpp:324
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:169
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:93
bool IsPlayer() const
Definition: Object.h:200
Player * ToPlayer()
Definition: Object.h:201
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1429
void SetVisible(bool x)
Definition: Unit.cpp:14232
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:19979
void EnterEvadeMode(EvadeReason why) override
Definition: zone_zuldrak.cpp:392

References EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BETRAYAL_1, Object::GetGUID(), ObjectAccessor::GetPlayer(), Player::GetQuestStatus(), Unit::HasAura(), Object::IsPlayer(), WorldObject::IsWithinDistInMap(), ScriptedAI::me, CreatureAI::MoveInLineOfSight(), Unit::NearTeleportTo(), playerGUID, QUEST_BETRAYAL, QUEST_STATUS_INCOMPLETE, Unit::SetVisible(), SPELL_SCOURGE_DISGUISE, and Object::ToPlayer().

◆ Reset()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

404 {
405 events.Reset();
408 lichGUID.Clear();
410 me->SetVisible(false);
412 }
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void Clear()
Definition: ObjectGuid.h:138

References ObjectGuid::Clear(), SummonList::DespawnAll(), FACTION_UNDEAD_SCOURGE, lichGUID, ScriptedAI::me, playerGUID, Unit::RemoveUnitFlag(), Unit::SetFaction(), Unit::SetVisible(), summons, and UNIT_FLAG_NON_ATTACKABLE.

◆ SpellHit()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::SpellHit ( Unit ,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

489 {
490 if (spellInfo->Id == SPELL_TOUCH_OF_DEATH)
491 {
494 }
495 }
@ SPELL_DRAKURU_DEATH
Definition: zone_zuldrak.cpp:329
@ SPELL_TOUCH_OF_DEATH
Definition: zone_zuldrak.cpp:328
@ SPELL_SUMMON_SKULL
Definition: zone_zuldrak.cpp:330

References Unit::CastSpell(), SpellInfo::Id, ScriptedAI::me, SPELL_DRAKURU_DEATH, SPELL_SUMMON_SKULL, and SPELL_TOUCH_OF_DEATH.

◆ SpellHitTarget()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::SpellHitTarget ( Unit target,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

482 {
483 if (spellInfo->Id == SPELL_THROW_PORTAL_CRYSTAL)
484 if (Aura* aura = target->AddAura(SPELL_ARTHAS_PORTAL, target))
485 aura->SetDuration(48000);
486 }
@ SPELL_ARTHAS_PORTAL
Definition: zone_zuldrak.cpp:327
@ SPELL_THROW_PORTAL_CRYSTAL
Definition: zone_zuldrak.cpp:326
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
Definition: SpellAuras.h:87

References Unit::AddAura(), SpellInfo::Id, SPELL_ARTHAS_PORTAL, and SPELL_THROW_PORTAL_CRYSTAL.

◆ UpdateAI()

void npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

498 {
499 events.Update(diff);
500 switch (events.ExecuteEvent())
501 {
502 case EVENT_BETRAYAL_1:
504 events.ScheduleEvent(EVENT_BETRAYAL_2, 5s);
505 break;
506 case EVENT_BETRAYAL_2:
507 me->SummonCreature(NPC_BLIGHTBLOOD_TROLL, 6184.1f, -1969.9f, 586.76f, 4.5f);
508 me->SummonCreature(NPC_BLIGHTBLOOD_TROLL, 6222.9f, -2026.5f, 586.76f, 2.9f);
509 me->SummonCreature(NPC_BLIGHTBLOOD_TROLL, 6166.2f, -2065.4f, 586.76f, 1.4f);
510 me->SummonCreature(NPC_BLIGHTBLOOD_TROLL, 6127.5f, -2008.7f, 586.76f, 0.0f);
511 events.ScheduleEvent(EVENT_BETRAYAL_3, 5s);
512 break;
513 case EVENT_BETRAYAL_3:
517 player->CastSpell(player, SPELL_SCOURGE_DISGUISE_EXPIRING, true);
518 if (Aura* aur = me->AddAura(SPELL_BLIGHT_FOG, me))
519 aur->SetDuration(22000);
520 break;
521 case EVENT_BETRAYAL_4:
523 events.ScheduleEvent(EVENT_BETRAYAL_5, 6s);
524 break;
525 case EVENT_BETRAYAL_5:
528 events.ScheduleEvent(EVENT_BETRAYAL_6, 8s);
529 break;
530 case EVENT_BETRAYAL_6:
531 me->SummonCreature(NPC_LICH_KING, 6142.9f, -2011.6f, 590.86f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 41000);
532 events.ScheduleEvent(EVENT_BETRAYAL_7, 8s);
533 break;
534 case EVENT_BETRAYAL_7:
536 events.ScheduleEvent(EVENT_BETRAYAL_8, 5s);
537 break;
538 case EVENT_BETRAYAL_8:
540 lich->AI()->Talk(SAY_LICH_7);
541 events.ScheduleEvent(EVENT_BETRAYAL_9, 6s);
542 break;
543 case EVENT_BETRAYAL_9:
545 {
546 lich->AI()->Talk(SAY_LICH_8);
547 lich->CastSpell(me, SPELL_TOUCH_OF_DEATH, false);
548 }
549 events.ScheduleEvent(EVENT_BETRAYAL_10, 4s);
550 break;
552 me->SetVisible(false);
554 lich->AI()->Talk(SAY_LICH_9);
555 events.ScheduleEvent(EVENT_BETRAYAL_11, 4s);
556 break;
559 lich->AI()->Talk(SAY_LICH_10);
560 events.ScheduleEvent(EVENT_BETRAYAL_12, 6s);
561 break;
564 lich->AI()->Talk(SAY_LICH_11);
565 events.ScheduleEvent(EVENT_BETRAYAL_13, 3s);
566 break;
569 {
570 lich->AI()->Talk(SAY_LICH_12);
571 lich->GetMotionMaster()->MovePoint(0, 6143.8f, -2011.5f, 590.9f);
572 }
573 events.ScheduleEvent(EVENT_BETRAYAL_14, 7s);
574 break;
578 break;
579 }
580
582 return;
583
584 if (!UpdateVictim())
585 return;
586
587 switch (events.ExecuteEvent())
588 {
592 events.Repeat(2s);
593 break;
597 events.Repeat(6s, 15s);
598 break;
601 events.Repeat(20s);
602 break;
603 }
604
606 }
@ EVENT_BETRAYAL_7
Definition: zone_zuldrak.cpp:343
@ EVENT_BETRAYAL_8
Definition: zone_zuldrak.cpp:344
@ EVENT_BETRAYAL_2
Definition: zone_zuldrak.cpp:338
@ SAY_DRAKURU_4
Definition: zone_zuldrak.cpp:359
@ SAY_LICH_12
Definition: zone_zuldrak.cpp:368
@ EVENT_BETRAYAL_5
Definition: zone_zuldrak.cpp:341
@ SAY_LICH_11
Definition: zone_zuldrak.cpp:367
@ EVENT_BETRAYAL_6
Definition: zone_zuldrak.cpp:342
@ SAY_DRAKURU_2
Definition: zone_zuldrak.cpp:357
@ SAY_DRAKURU_0
Definition: zone_zuldrak.cpp:355
@ EVENT_BETRAYAL_13
Definition: zone_zuldrak.cpp:349
@ EVENT_BETRAYAL_10
Definition: zone_zuldrak.cpp:346
@ SPELL_BLIGHT_FOG
Definition: zone_zuldrak.cpp:325
@ SPELL_SCOURGE_DISGUISE_EXPIRING
Definition: zone_zuldrak.cpp:321
@ SPELL_SHADOW_BOLT
Definition: zone_zuldrak.cpp:320
@ EVENT_BETRAYAL_12
Definition: zone_zuldrak.cpp:348
@ SAY_LICH_7
Definition: zone_zuldrak.cpp:363
@ SAY_LICH_8
Definition: zone_zuldrak.cpp:364
@ SPELL_THROW_BRIGHT_CRYSTAL
Definition: zone_zuldrak.cpp:322
@ SAY_LICH_10
Definition: zone_zuldrak.cpp:366
@ EVENT_BETRAYAL_14
Definition: zone_zuldrak.cpp:350
@ NPC_LICH_KING
Definition: zone_zuldrak.cpp:335
@ EVENT_BETRAYAL_11
Definition: zone_zuldrak.cpp:347
@ SAY_DRAKURU_5
Definition: zone_zuldrak.cpp:360
@ SAY_DRAKURU_7
Definition: zone_zuldrak.cpp:362
@ SAY_LICH_9
Definition: zone_zuldrak.cpp:365
@ EVENT_BETRAYAL_3
Definition: zone_zuldrak.cpp:339
@ SAY_DRAKURU_1
Definition: zone_zuldrak.cpp:356
@ SAY_DRAKURU_6
Definition: zone_zuldrak.cpp:361
@ EVENT_BETRAYAL_9
Definition: zone_zuldrak.cpp:345
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_STATE_STUNNED
Definition: UnitDefines.h:152
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:280
Definition: Creature.h:43
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
uint32 GetFaction() const
Definition: Unit.h:808
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:664
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701

References Unit::AddAura(), Unit::CastSpell(), ObjectGuid::Clear(), UnitAI::DoMeleeAttackIfReady(), EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_BETRAYAL_1, EVENT_BETRAYAL_10, EVENT_BETRAYAL_11, EVENT_BETRAYAL_12, EVENT_BETRAYAL_13, EVENT_BETRAYAL_14, EVENT_BETRAYAL_2, EVENT_BETRAYAL_3, EVENT_BETRAYAL_4, EVENT_BETRAYAL_5, EVENT_BETRAYAL_6, EVENT_BETRAYAL_7, EVENT_BETRAYAL_8, EVENT_BETRAYAL_9, EVENT_BETRAYAL_COMBAT_TALK, EVENT_BETRAYAL_CRYSTAL, EVENT_BETRAYAL_SHADOW_BOLT, FACTION_FRIENDLY, ObjectAccessor::GetCreature(), Unit::GetFaction(), ObjectAccessor::GetPlayer(), Unit::GetVictim(), Unit::HasUnitState(), Unit::IsWithinMeleeRange(), lichGUID, ScriptedAI::me, NPC_BLIGHTBLOOD_TROLL, NPC_LICH_KING, playerGUID, SAY_DRAKURU_0, SAY_DRAKURU_1, SAY_DRAKURU_2, SAY_DRAKURU_4, SAY_DRAKURU_5, SAY_DRAKURU_6, SAY_DRAKURU_7, SAY_LICH_10, SAY_LICH_11, SAY_LICH_12, SAY_LICH_7, SAY_LICH_8, SAY_LICH_9, Unit::SetVisible(), SPELL_BLIGHT_FOG, SPELL_SCOURGE_DISGUISE_EXPIRING, SPELL_SHADOW_BOLT, SPELL_THROW_BRIGHT_CRYSTAL, SPELL_THROW_PORTAL_CRYSTAL, SPELL_TOUCH_OF_DEATH, WorldObject::SummonCreature(), TEMPSUMMON_TIMED_DESPAWN, UNIT_STATE_CASTING, UNIT_STATE_STUNNED, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ events

EventMap npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::events

◆ lichGUID

ObjectGuid npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::lichGUID

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

◆ playerGUID

ObjectGuid npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::playerGUID

◆ summons

SummonList npc_overlord_drakuru_betrayal::npc_overlord_drakuru_betrayalAI::summons

Referenced by JustSummoned(), and Reset().