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

Public Member Functions

 npc_hyjal_ground_trash (Creature *creature)
 
void Reset () override
 
void AttackStart (Unit *who) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void DoAction (int32 action) override
 
void PathEndReached (uint32 pathId) override
 
CreatureGetNearbyFriendlyTrashCreature (float radius)
 
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
 
- 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)
 
 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
 

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 ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- 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_hyjal_ground_trash()

npc_hyjal_ground_trash::npc_hyjal_ground_trash ( Creature creature)
inline
354 : ScriptedAI(creature)
355 {
357 {
359 });
360 }
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
Definition: TaskScheduler.h:194
TaskScheduler scheduler
Definition: CreatureAI.h:76
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673

References Unit::HasUnitState(), ScriptedAI::me, CreatureAI::scheduler, TaskScheduler::SetValidator(), and UNIT_STATE_CASTING.

Member Function Documentation

◆ AttackStart()

void npc_hyjal_ground_trash::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

368 {
369 switch (me->GetEntry())
370 {
371 case NPC_NECRO:
372 case NPC_BANSH:
373 if (!who)
374 return;
375
376 if (me->Attack(who, true))
377 me->GetMotionMaster()->MoveChase(who, 30.0f);
378 break;
379 default:
381 break;
382 }
383
384 }
@ NPC_NECRO
Definition: hyjal.h:67
@ NPC_BANSH
Definition: hyjal.h:68
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:208
uint32 GetEntry() const
Definition: Object.h:112
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10234
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:313

References Unit::Attack(), ScriptedAI::AttackStart(), Object::GetEntry(), Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MoveChase(), NPC_BANSH, and NPC_NECRO.

◆ DoAction()

void npc_hyjal_ground_trash::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

489 {
490 me->setActive(true);
491 switch (action)
492 {
493 case DATA_WINTERCHILL:
494 case DATA_ANETHERON:
497 break;
498 case DATA_KAZROGAL:
499 case DATA_AZGALOR:
502 break;
503 case DATA_ARCHIMONDE:
505 break;
506 }
507 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ NIGHT_ELF_BASE_CHARGE_1
Definition: hyjal.h:173
@ NIGHT_ELF_BASE_CHARGE_3
Definition: hyjal.h:175
@ HORDE_BASE_CHARGE_3
Definition: hyjal.h:168
@ HORDE_BASE_CHARGE_1
Definition: hyjal.h:166
@ ALLIANCE_BASE_CHARGE_1
Definition: hyjal.h:158
@ ALLIANCE_BASE_CHARGE_3
Definition: hyjal.h:160
@ DATA_KAZROGAL
Definition: hyjal.h:33
@ DATA_AZGALOR
Definition: hyjal.h:34
@ DATA_WINTERCHILL
Definition: hyjal.h:31
@ DATA_ANETHERON
Definition: hyjal.h:32
@ DATA_ARCHIMONDE
Definition: hyjal.h:35
@ DATA_ALLIANCE_RETREAT
Definition: hyjal.h:37
@ DATA_HORDE_RETREAT
Definition: hyjal.h:38
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:849

References ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3, DATA_ALLIANCE_RETREAT, DATA_ANETHERON, DATA_ARCHIMONDE, DATA_AZGALOR, DATA_HORDE_RETREAT, DATA_KAZROGAL, DATA_WINTERCHILL, Unit::GetMotionMaster(), HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_3, ScriptedAI::me, MotionMaster::MovePath(), NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_3, WorldObject::setActive(), and urand().

◆ GetNearbyFriendlyTrashCreature()

Creature * npc_hyjal_ground_trash::GetNearbyFriendlyTrashCreature ( float  radius)
inline
543 {
544 //need accurate timer
545 Creature* creatureToReturn = nullptr;
546 std::list<Creature*> creatureList;
547 GetCreatureListWithEntryInGrid(creatureList, me, NPC_ABOMI, radius);
548 GetCreatureListWithEntryInGrid(creatureList, me, NPC_BANSH, radius);
549 GetCreatureListWithEntryInGrid(creatureList, me, NPC_STALK, radius);
550 GetCreatureListWithEntryInGrid(creatureList, me, NPC_NECRO, radius);
551 GetCreatureListWithEntryInGrid(creatureList, me, NPC_CRYPT, radius);
552 GetCreatureListWithEntryInGrid(creatureList, me, NPC_GHOUL, radius);
554 Acore::Containers::RandomResize(creatureList, 1);
555 if (creatureList.size() > 0)
556 {
557 creatureToReturn = creatureList.front();
558 }
559 creatureList.clear();
560 return creatureToReturn;
561 }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:827
@ NPC_GHOUL
Definition: chapter1.cpp:395
@ NPC_SKELETON_INVADER
Definition: hyjal.h:76
@ NPC_STALK
Definition: hyjal.h:72
@ NPC_ABOMI
Definition: hyjal.h:66
@ NPC_CRYPT
Definition: hyjal.h:65
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:79
Definition: Creature.h:46

References GetCreatureListWithEntryInGrid(), ScriptedAI::me, NPC_ABOMI, NPC_BANSH, NPC_CRYPT, NPC_GHOUL, NPC_NECRO, NPC_SKELETON_INVADER, NPC_STALK, and Acore::Containers::RandomResize().

Referenced by JustEngagedWith().

◆ JustEngagedWith()

void npc_hyjal_ground_trash::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

387 {
388 switch (me->GetEntry())
389 {
390 case NPC_GHOUL:
391 {
392 scheduler.Schedule(3s, 7s, [this](TaskContext context)
393 {
395 context.Repeat(15s, 30s);
396 }).Schedule(1200ms, [this](TaskContext context)
397 {
398 if (me->GetHealthPct() <= 7)
400 else
401 context.Repeat();
402 });
403 break;
404 }
405 case NPC_CRYPT:
406 {
407 scheduler.Schedule(0s, 2400ms, [this](TaskContext context)
408 {
410 context.Repeat(2400ms, 8s);
411 });
412 break;
413 }
414 case NPC_ABOMI:
415 {
416 scheduler.Schedule(13s, 17s, [this](TaskContext context)
417 {
419 context.Repeat(16s, 25s);
420 });
421 break;
422 }
423 case NPC_NECRO:
424 {
425 scheduler.Schedule(0s, 2400ms, [this](TaskContext context)
426 {
428 context.Repeat(2400ms, 4800ms);
429 }).Schedule(5s, 10s, [this](TaskContext context)
430 {
431 // TODO: Should target corpse, and skeletons should spawn at the target
432 switch (urand(1, 3))
433 {
434 case 1:
436 break;
437 case 2:
439 break;
440 case 3:
442 break;
443 }
444 context.Repeat(10s, 20s);
445 }).Schedule(15s, 20s, [this](TaskContext context)
446 {
448 {
450 }
451 context.Repeat(15s, 20s);
452 });
453 break;
454 }
455 case NPC_BANSH:
456 {
457 scheduler.Schedule(10s, 15s, [this](TaskContext context)
458 {
459 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
461 context.Repeat(18s, 24s);
462 }).Schedule(5s, 15s, [this](TaskContext context)
463 {
465 context.Repeat(18s, 24s);
466 }).Schedule(0s, 1s, [this](TaskContext context)
467 {
469 context.Repeat(1800ms, 2200ms);
470 });
471
472 break;
473 }
474 case NPC_STALK:
475 {
476 scheduler.Schedule(3s, 6s, [this](TaskContext context)
477 {
478 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, Powers(POWER_MANA), 30.f, true)))
479 DoCast(target, SPELL_MANA_BURN);
480 context.Repeat(6s, 9s);
481 });
482 break;
483 }
484 }
485
486 }
const float UNHOLY_FRENZY_RANGE
Definition: hyjal.cpp:93
@ SPELL_CRYPT_SCARABS
Definition: hyjal.cpp:51
@ SPELL_CANNIBALIZE
Definition: hyjal.cpp:48
@ SPELL_RAISE_DEAD_3
Definition: hyjal.cpp:59
@ SPELL_BANSHEE_WAIL
Definition: hyjal.cpp:66
@ SPELL_UNHOLY_FRENZY
Definition: hyjal.cpp:60
@ SPELL_BANSHEE_CURSE
Definition: hyjal.cpp:64
@ SPELL_RAISE_DEAD_2
Definition: hyjal.cpp:58
@ SPELL_RAISE_DEAD_1
Definition: hyjal.cpp:57
@ SPELL_SHADOW_BOLT
Definition: hyjal.cpp:61
@ SPELL_FRENZY
Definition: hyjal.cpp:47
@ SPELL_ANTI_MAGIC_SHELL
Definition: hyjal.cpp:65
@ SPELL_KNOCKDOWN
Definition: hyjal.cpp:54
@ SPELL_MANA_BURN
Definition: hyjal.cpp:75
Powers
Definition: SharedDefines.h:268
@ POWER_MANA
Definition: SharedDefines.h:269
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:229
Definition: TaskScheduler.h:415
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:485
Definition: UnitAI.h:135
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
Definition: Unit.h:630
float GetHealthPct() const
Definition: Unit.h:877
Creature * GetNearbyFriendlyTrashCreature(float radius)
Definition: hyjal.cpp:542

References UnitAI::DoCast(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), Object::GetEntry(), Unit::GetHealthPct(), GetNearbyFriendlyTrashCreature(), ScriptedAI::me, NPC_ABOMI, NPC_BANSH, NPC_CRYPT, NPC_GHOUL, NPC_NECRO, NPC_STALK, POWER_MANA, TaskContext::Repeat(), TaskScheduler::Schedule(), CreatureAI::scheduler, UnitAI::SelectTarget(), SPELL_ANTI_MAGIC_SHELL, SPELL_BANSHEE_CURSE, SPELL_BANSHEE_WAIL, SPELL_CANNIBALIZE, SPELL_CRYPT_SCARABS, SPELL_FRENZY, SPELL_KNOCKDOWN, SPELL_MANA_BURN, SPELL_RAISE_DEAD_1, SPELL_RAISE_DEAD_2, SPELL_RAISE_DEAD_3, SPELL_SHADOW_BOLT, SPELL_UNHOLY_FRENZY, UNHOLY_FRENZY_RANGE, and urand().

◆ PathEndReached()

void npc_hyjal_ground_trash::PathEndReached ( uint32  pathId)
inlineoverridevirtual

Reimplemented from CreatureAI.

510 {
511 // Delay is required because we are calling the movement generator from inside the pathing hook.
512 // If we issue another call here, it will be flushed before it is executed.
513 switch (pathId)
514 {
519 {
521 }, 1s);
522 break;
527 {
529 }, 1s);
530 break;
535 {
536 me->GetMotionMaster()->MoveRandom(5.f);
537 }, 1s);
538 break;
539 }
540 }
@ ALLIANCE_BASE_PATROL_3
Definition: hyjal.h:163
@ NIGHT_ELF_BASE_CHARGE_2
Definition: hyjal.h:174
@ HORDE_BASE_PATROL_1
Definition: hyjal.h:169
@ HORDE_BASE_CHARGE_2
Definition: hyjal.h:167
@ ALLIANCE_BASE_CHARGE_2
Definition: hyjal.h:159
@ ALLIANCE_BASE_PATROL_1
Definition: hyjal.h:161
@ HORDE_BASE_PATROL_3
Definition: hyjal.h:171
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: EventProcessor.h:107
EventProcessor m_Events
Definition: Unit.h:1792

References EventProcessor::AddEventAtOffset(), ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_2, ALLIANCE_BASE_CHARGE_3, ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3, Unit::GetMotionMaster(), HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_2, HORDE_BASE_CHARGE_3, HORDE_BASE_PATROL_1, HORDE_BASE_PATROL_3, Unit::m_Events, ScriptedAI::me, NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_2, NIGHT_ELF_BASE_CHARGE_3, and urand().

◆ Reset()

void npc_hyjal_ground_trash::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

363 {
365 }
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:45

References TaskScheduler::CancelAll(), and CreatureAI::scheduler.

◆ UpdateAI()

void npc_hyjal_ground_trash::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

564 {
565 if (!UpdateVictim())
566 return;
567
569 scheduler.Update(diff);
570 }
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:269

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