AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_wild_wyrm Struct Reference
Inheritance diagram for npc_wild_wyrm:
VehicleAI CreatureAI UnitAI

Public Member Functions

 npc_wild_wyrm (Creature *creature)
 
void InitSpellsForPhase ()
 
void Reset () override
 
void DoAction (int32 action) override
 
void SpellHit (Unit *caster, SpellInfo const *spellInfo) override
 
void MovementInform (uint32 type, uint32 id) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void PassengerBoarded (Unit *passenger, int8 seatId, bool apply) override
 == Fields =======================================
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from VehicleAI
 VehicleAI (Creature *creature)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 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
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
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 SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
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)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, 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 EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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
 

Private Attributes

uint8 _phase {PHASE_INITIAL}
 
ObjectGuid _playerGuid
 

Additional Inherited Members

- 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 VehicleAI
static int32 Permissible (Creature const *creature)
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_wild_wyrm()

npc_wild_wyrm::npc_wild_wyrm ( Creature creature)
inlineexplicit
915: VehicleAI(creature) { }
Definition CombatAI.h:99

Member Function Documentation

◆ DamageTaken()

void npc_wild_wyrm::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.

1003 {
1004 if (damage >= me->GetHealth())
1005 {
1006 damage = me->GetHealth() - 1;
1007
1008 if (_phase == PHASE_DEAD)
1009 return;
1010
1012 scheduler.CancelAll().Async([this]
1013 {
1015
1017 player->VehicleSpellInitialize();
1018
1021
1024
1026
1028 });
1029 }
1030 }
@ UNIT_NPC_FLAG_NONE
Definition UnitDefines.h:321
TaskScheduler scheduler
Definition CreatureAI.h:74
Creature *const me
Definition CreatureAI.h:71
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
The unit will fall. Used when in the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:688
Definition Player.h:1084
TaskScheduler & CancelAll()
Definition TaskScheduler.cpp:45
TaskScheduler & Async(std::function< void()> const &callable)
Definition TaskScheduler.cpp:39
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
uint32 GetHealth() const
Definition Unit.h:1108
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5157
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:766
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:220
uint8 _phase
Definition zone_storm_peaks.cpp:1099
void InitSpellsForPhase()
Definition zone_storm_peaks.cpp:917
ObjectGuid _playerGuid
Definition zone_storm_peaks.cpp:1100
@ PHASE_DEAD
Definition zone_storm_peaks.cpp:901
@ SPELL_JAWS_OF_DEATH_PERIODIC
Definition zone_storm_peaks.cpp:873
@ SPELL_FALLING_DRAGON_FEIGN_DEATH
Definition zone_storm_peaks.cpp:878
@ SPELL_WYRM_KILL_CREDIT
Definition zone_storm_peaks.cpp:877
@ POINT_FALL
Definition zone_storm_peaks.cpp:894
@ SPELL_PRY_JAWS_OPEN
Definition zone_storm_peaks.cpp:870

References _phase, _playerGuid, TaskScheduler::Async(), TaskScheduler::CancelAll(), UnitAI::DoCastAOE(), Unit::GetHealth(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), InitSpellsForPhase(), CreatureAI::me, MotionMaster::MoveFall(), PHASE_DEAD, POINT_FALL, Unit::RemoveAurasDueToSpell(), Unit::ReplaceAllNpcFlags(), CreatureAI::scheduler, SPELL_FALLING_DRAGON_FEIGN_DEATH, SPELL_JAWS_OF_DEATH_PERIODIC, SPELL_PRY_JAWS_OPEN, SPELL_WYRM_KILL_CREDIT, and UNIT_NPC_FLAG_NONE.

◆ DoAction()

void npc_wild_wyrm::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

937 {
939 if (!player)
940 return;
941
942 switch (action)
943 {
945 Talk(SAY_SWIPE, player);
946 break;
948 Talk(SAY_DODGED, player);
949 break;
951 Talk(SAY_GRIP_WARN, player);
952 break;
953 case ACTION_GRIP_LOST:
955 break;
957 Talk(SAY_STRIKE_MISS, player);
958 break;
959 default:
960 break;
961 }
962 }
Talk
Definition hyjal.cpp:82
@ SAY_DODGED
Definition zone_storm_peaks.cpp:882
@ SPELL_EJECT_PASSENGER_1
Definition zone_storm_peaks.cpp:869
@ SAY_STRIKE_MISS
Definition zone_storm_peaks.cpp:885
@ ACTION_GRIP_FAILING
Definition zone_storm_peaks.cpp:889
@ ACTION_FATAL_STRIKE_MISS
Definition zone_storm_peaks.cpp:891
@ ACTION_GRIP_LOST
Definition zone_storm_peaks.cpp:890
@ ACTION_CLAW_SWIPE_DODGE
Definition zone_storm_peaks.cpp:888
@ SAY_GRIP_WARN
Definition zone_storm_peaks.cpp:884
@ ACTION_CLAW_SWIPE_WARN
Definition zone_storm_peaks.cpp:887
@ SAY_SWIPE
Definition zone_storm_peaks.cpp:881

References _playerGuid, ACTION_CLAW_SWIPE_DODGE, ACTION_CLAW_SWIPE_WARN, ACTION_FATAL_STRIKE_MISS, ACTION_GRIP_FAILING, ACTION_GRIP_LOST, UnitAI::DoCastAOE(), ObjectAccessor::GetPlayer(), CreatureAI::me, SAY_DODGED, SAY_GRIP_WARN, SAY_STRIKE_MISS, SAY_SWIPE, and SPELL_EJECT_PASSENGER_1.

◆ InitSpellsForPhase()

void npc_wild_wyrm::InitSpellsForPhase ( )
inline
918 {
920 for (uint8 i = 0; i < ControllableSpellsCount; ++i)
922 }
std::uint8_t uint8
Definition Define.h:109
#define ASSERT
Definition Errors.h:68
uint32 m_spells[MAX_CREATURE_SPELLS]
Definition Creature.h:253
constexpr uint8 ControllableSpellsCount
Definition zone_storm_peaks.cpp:905
@ PHASE_MAX
Definition zone_storm_peaks.cpp:902
constexpr uint32 WyrmControlSpells[PHASE_MAX][ControllableSpellsCount]
Definition zone_storm_peaks.cpp:906

References _phase, ASSERT, ControllableSpellsCount, Creature::m_spells, CreatureAI::me, PHASE_MAX, and WyrmControlSpells.

Referenced by DamageTaken(), PassengerBoarded(), and Reset().

◆ MovementInform()

void npc_wild_wyrm::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

977 {
978 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
979 return;
980
981 switch (id)
982 {
984 {
986 if (!player)
987 return;
988
991 break;
992 }
993 case POINT_FALL:
995 me->KillSelf();
996 break;
997 default:
998 break;
999 }
1000 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition MotionMaster.h:56
void Clear(bool reset=true)
Definition MotionMaster.h:193
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:178
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1234
@ POINT_START_FIGHT
Definition zone_storm_peaks.cpp:893
@ SPELL_PLAYER_MOUNT_WYRM
Definition zone_storm_peaks.cpp:855
@ SPELL_EJECT_ALL_PASSENGERS
Definition zone_storm_peaks.cpp:879

References _playerGuid, MotionMaster::Clear(), UnitAI::DoCast(), UnitAI::DoCastAOE(), EFFECT_MOTION_TYPE, Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), Unit::KillSelf(), CreatureAI::me, POINT_FALL, POINT_MOTION_TYPE, POINT_START_FIGHT, SPELL_EJECT_ALL_PASSENGERS, and SPELL_PLAYER_MOUNT_WYRM.

◆ PassengerBoarded()

void npc_wild_wyrm::PassengerBoarded ( Unit ,
int8  ,
bool   
)
inlineoverridevirtual

== Fields =======================================

Reimplemented from CreatureAI.

1033 {
1034 if (!apply)
1035 {
1036 // The player is automatically moved from SEAT_INITIAL to SEAT_MOUTH during phase transition.
1037 // Only evade if player exits during the respective active phase.
1038 bool initialPhaseExit = (seatId == SEAT_INITIAL && _phase == PHASE_INITIAL);
1039 bool mouthPhaseExit = (seatId == SEAT_MOUTH && _phase == PHASE_MOUTH);
1040 if (initialPhaseExit || mouthPhaseExit)
1042 return;
1043 }
1044
1045 if (passenger->GetGUID() != _playerGuid)
1046 return;
1047
1048 if (seatId == SEAT_INITIAL)
1049 {
1052
1053 scheduler.Async([this]
1054 {
1055 me->GetMotionMaster()->MoveWaypoint(me->GetWaypointPath(), true);
1056 }).Schedule(500ms, [this](TaskContext context)
1057 {
1058 if (_phase == PHASE_MOUTH)
1059 return;
1060
1061 if (me->HealthBelowPct(25))
1062 {
1064 context.Async([this]
1065 {
1070
1072 Talk(SAY_PHASE_2, player);
1073
1077 });
1078 return;
1079 }
1080
1081 context.Repeat();
1082 });
1083 }
1084 }
@ SPELLVALUE_AURA_STACK
Definition SpellDefines.h:118
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:88
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
uint32 GetWaypointPath() const
Definition Creature.h:355
Definition TaskScheduler.h:421
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:493
TaskContext & Async(std::function< void()> const &callable)
Definition TaskScheduler.cpp:253
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1407
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1116
@ PHASE_INITIAL
Definition zone_storm_peaks.cpp:899
@ SEAT_INITIAL
Definition zone_storm_peaks.cpp:896
@ SPELL_FLY_STATE_VISUAL
Definition zone_storm_peaks.cpp:874
@ PHASE_MOUTH
Definition zone_storm_peaks.cpp:900
@ SAY_PHASE_2
Definition zone_storm_peaks.cpp:883
@ SPELL_GRIP
Definition zone_storm_peaks.cpp:858
@ SPELL_CLAW_SWIPE_PERIODIC
Definition zone_storm_peaks.cpp:863
@ SPELL_LOW_HEALTH_TRIGGER
Definition zone_storm_peaks.cpp:866
@ SEAT_MOUTH
Definition zone_storm_peaks.cpp:897

References _phase, _playerGuid, TaskScheduler::Async(), TaskContext::Async(), Unit::CastCustomSpell(), UnitAI::DoCastAOE(), CreatureAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, Object::GetGUID(), Unit::GetMotionMaster(), ObjectAccessor::GetPlayer(), Creature::GetWaypointPath(), Unit::HealthBelowPct(), InitSpellsForPhase(), CreatureAI::me, PHASE_INITIAL, PHASE_MOUTH, Unit::RemoveAurasDueToSpell(), TaskContext::Repeat(), SAY_PHASE_2, CreatureAI::scheduler, SEAT_INITIAL, SEAT_MOUTH, SPELL_CLAW_SWIPE_PERIODIC, SPELL_EJECT_PASSENGER_1, SPELL_FLY_STATE_VISUAL, SPELL_GRIP, SPELL_JAWS_OF_DEATH_PERIODIC, SPELL_LOW_HEALTH_TRIGGER, and SPELLVALUE_AURA_STACK.

◆ Reset()

void npc_wild_wyrm::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

925 {
927
930
932
933 me->SetImmuneToPC(false);
934 }
void Clear()
Definition ObjectGuid.h:138
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10597

References _phase, _playerGuid, TaskScheduler::CancelAll(), ObjectGuid::Clear(), InitSpellsForPhase(), CreatureAI::me, PHASE_INITIAL, CreatureAI::scheduler, and Unit::SetImmuneToPC().

◆ SpellHit()

void npc_wild_wyrm::SpellHit ( Unit caster,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

965 {
966 if (!_playerGuid.IsEmpty() || spellInfo->Id != SPELL_SPEAR_OF_HODIR)
967 return;
968
969 _playerGuid = caster->GetGUID();
971 me->SetImmuneToPC(true);
972
974 }
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
bool IsEmpty() const
Definition ObjectGuid.h:161
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
@ SPELL_SPEAR_OF_HODIR
Definition zone_storm_peaks.cpp:857
@ SPELL_FULL_HEAL_MANA
Definition zone_storm_peaks.cpp:865

References _playerGuid, UnitAI::DoCastAOE(), Object::GetGUID(), Unit::GetMotionMaster(), SpellInfo::Id, ObjectGuid::IsEmpty(), CreatureAI::me, MotionMaster::MovePoint(), POINT_START_FIGHT, Unit::SetImmuneToPC(), SPELL_FULL_HEAL_MANA, and SPELL_SPEAR_OF_HODIR.

◆ UpdateAI()

void npc_wild_wyrm::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

1087 {
1088 if (!_playerGuid)
1089 {
1090 if (UpdateVictim())
1092 return;
1093 }
1094
1095 scheduler.Update(diff);
1096 }
bool UpdateVictim()
Definition CreatureAI.cpp:353
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40

References _playerGuid, UnitAI::DoMeleeAttackIfReady(), CreatureAI::scheduler, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _phase

uint8 npc_wild_wyrm::_phase {PHASE_INITIAL}
private

◆ _playerGuid

ObjectGuid npc_wild_wyrm::_playerGuid
private

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