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

Public Member Functions

 npc_crok_scourgebaneAI (Creature *creature)
 
void Reset () override
 
void DoAction (int32 action) override
 
void SetGUID (ObjectGuid const &guid, int32 type) override
 
void WaypointReached (uint32 waypointId) override
 
void WaypointStart (uint32 waypointId) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateEscortAI (uint32 diff) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
bool CanAIAttack (Unit const *target) const override
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
bool IsEscortNPC (bool=true) const override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
void Start (bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
virtual void WaypointReached (uint32, uint32)
 
- 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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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=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)
 
WorldObject * GetSummoner () 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 ()
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
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 void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, 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 *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
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, int32 aura=0)
 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

EventMap _events
 
GuidSet _aliveTrash
 
InstanceScript * _instance
 
uint32 _currentWPid
 
uint32 _wipeCheckTimer
 
bool _handledWP4
 
bool _isEventDone
 
bool _didUnderTenPercentText
 

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
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
Player * GetPlayerForEscort ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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_crok_scourgebaneAI()

npc_crok_scourgebane::npc_crok_scourgebaneAI::npc_crok_scourgebaneAI ( Creature *  creature)
inline
786 : npc_escortAI(creature), _instance(creature->GetInstanceScript())
787 {
788 SetDespawnAtEnd(false);
789 SetDespawnAtFar(false);
791 }
@ DONE
Definition InstanceScript.h:61
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
@ DATA_SISTER_SVALNA
Definition icecrown_citadel.h:98
InstanceScript * _instance
Definition icecrown_citadel.cpp:1046
bool _isEventDone
Definition icecrown_citadel.cpp:1050
Definition ScriptedEscortAI.h:53
void SetDespawnAtFar(bool despawn)
Definition ScriptedEscortAI.h:109
void SetDespawnAtEnd(bool despawn)
Definition ScriptedEscortAI.h:108

References _instance, _isEventDone, DATA_SISTER_SVALNA, DONE, InstanceScript::GetBossState(), npc_escortAI::SetDespawnAtEnd(), and npc_escortAI::SetDespawnAtFar().

Member Function Documentation

◆ CanAIAttack()

bool npc_crok_scourgebane::npc_crok_scourgebaneAI::CanAIAttack ( Unit const *  target) const
inlineoverridevirtual

Reimplemented from UnitAI.

1038 {
1039 // do not see targets inside Frostwing Halls when we are not there
1040 return (me->GetPositionY() > 2660.0f) == (target->GetPositionY() > 2660.0f);
1041 }
float GetPositionY() const
Definition Position.h:122
Creature * me
Definition ScriptedCreature.h:281

References Position::GetPositionY(), and ScriptedAI::me.

◆ DamageTaken()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::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.

934 {
935 if (!_wipeCheckTimer)
936 {
937 _wipeCheckTimer = 1000;
938 Player* player = nullptr;
941 Cell::VisitObjects(me, searcher, 60.0f);
942 // wipe
943 if (!player)
944 {
945 damage *= 100;
946 if (damage >= me->GetHealth())
947 {
950 Cell::VisitObjects(me, worker, 333.0f);
951 return;
952 }
953 }
954 }
955
956 if (HealthBelowPct(10))
957 {
959 {
963 else
965 }
966
967 damage = 0;
970 }
971 }
Definition GridNotifiers.h:1380
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:48
Definition icecrown_citadel.cpp:374
uint32 GetEntry() const
Definition Object.h:123
Definition Player.h:1086
uint32 GetHealth() const
Definition Unit.h:1114
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:1372
Unit * GetVictim() const
Definition Unit.h:904
Talk
Definition hyjal.cpp:82
@ SPELL_ICEBOUND_ARMOR
Definition icecrown_citadel.cpp:121
@ EVENT_HEALTH_CHECK
Definition icecrown_citadel.cpp:261
@ SAY_CROK_WEAKENING_SVALNA
Definition icecrown_citadel.cpp:99
@ SAY_CROK_WEAKENING_GAUNTLET
Definition icecrown_citadel.cpp:98
@ NPC_SISTER_SVALNA
Definition icecrown_citadel.h:324
Definition GridNotifiers.h:512
Definition GridNotifiers.h:533
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165
bool HealthBelowPct(uint32 pct) const
Definition ScriptedCreature.h:368
bool _didUnderTenPercentText
Definition icecrown_citadel.cpp:1051
EventMap _events
Definition icecrown_citadel.cpp:1044
uint32 _wipeCheckTimer
Definition icecrown_citadel.cpp:1048

References _didUnderTenPercentText, _events, _wipeCheckTimer, Unit::CastSpell(), EVENT_HEALTH_CHECK, Object::GetEntry(), Unit::GetHealth(), Unit::GetVictim(), ScriptedAI::HealthBelowPct(), ScriptedAI::me, NPC_SISTER_SVALNA, SAY_CROK_WEAKENING_GAUNTLET, SAY_CROK_WEAKENING_SVALNA, EventMap::ScheduleEvent(), SPELL_ICEBOUND_ARMOR, and Cell::VisitObjects().

◆ DoAction()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

806 {
807 if (action == ACTION_START_GAUNTLET)
808 {
809 if (_isEventDone || me->isActiveObject() || !me->IsAlive())
810 return;
811
812 me->setActive(true);
814 me->SetImmuneToAll(true);
816 svalna->AI()->DoAction(ACTION_START_GAUNTLET);
817 for (uint32 i = 0; i < 4; ++i)
819 crusader->AI()->DoAction(ACTION_START_GAUNTLET);
820
825 }
826 else if (action == ACTION_RESET_EVENT)
827 {
829 me->setActive(false);
830 _aliveTrash.clear();
831 _currentWPid = 0;
832 _handledWP4 = false;
833
834 me->CombatStop();
836 }
837 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
Definition Creature.h:47
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:115
void ClearAllThreat()
Definition ThreatManager.cpp:584
bool IsAlive() const
Definition Unit.h:1796
ThreatManager & GetThreatMgr()
Definition Unit.h:957
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7273
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:930
bool isActiveObject() const
Definition Object.h:684
void setActive(bool isActiveObject)
Definition Object.cpp:1091
@ ACTION_RESET_EVENT
Definition icecrown_citadel.cpp:313
@ ACTION_START_GAUNTLET
Definition icecrown_citadel.cpp:310
@ EVENT_CROK_INTRO_3
Definition icecrown_citadel.cpp:262
@ EVENT_ARNATH_INTRO_2
Definition icecrown_citadel.cpp:266
@ EVENT_START_PATHING
Definition icecrown_citadel.cpp:263
@ SAY_CROK_INTRO_1
Definition icecrown_citadel.cpp:83
@ DATA_CAPTAIN_ARNATH
Definition icecrown_citadel.h:125
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
uint32 _currentWPid
Definition icecrown_citadel.cpp:1047
bool _handledWP4
Definition icecrown_citadel.cpp:1049
GuidSet _aliveTrash
Definition icecrown_citadel.cpp:1045

References _aliveTrash, _currentWPid, _events, _handledWP4, _instance, _isEventDone, ACTION_RESET_EVENT, ACTION_START_GAUNTLET, ThreatManager::ClearAllThreat(), Unit::CombatStop(), DATA_CAPTAIN_ARNATH, DATA_SISTER_SVALNA, DONE, EVENT_ARNATH_INTRO_2, EVENT_CROK_INTRO_3, EVENT_START_PATHING, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetThreatMgr(), WorldObject::isActiveObject(), Unit::IsAlive(), ScriptedAI::me, SAY_CROK_INTRO_1, EventMap::ScheduleEvent(), WorldObject::setActive(), Unit::SetImmuneToAll(), Unit::SetUnitFlag(), and UNIT_FLAG_NON_ATTACKABLE.

◆ Reset()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

794 {
797 _wipeCheckTimer = 1000;
798 _handledWP4 = false;
799
800 _events.Reset();
801 _events.ScheduleEvent(EVENT_SCOURGE_STRIKE, 7500ms, 12s + 500ms);
803 }
@ REACT_DEFENSIVE
Definition Unit.h:568
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
void Reset()
Definition EventMap.cpp:21
@ EVENT_SCOURGE_STRIKE
Definition icecrown_citadel.cpp:259
@ EVENT_DEATH_STRIKE
Definition icecrown_citadel.cpp:260

References _didUnderTenPercentText, _events, _handledWP4, _wipeCheckTimer, EVENT_DEATH_STRIKE, EVENT_SCOURGE_STRIKE, ScriptedAI::me, REACT_DEFENSIVE, EventMap::Reset(), EventMap::ScheduleEvent(), and Creature::SetReactState().

◆ SetGUID()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::SetGUID ( ObjectGuid const &  guid,
int32  type 
)
inlineoverridevirtual

Reimplemented from UnitAI.

840 {
841 if (type == ACTION_VRYKUL_DEATH)
842 {
843 _aliveTrash.erase(guid);
844 if (_aliveTrash.empty())
845 {
846 SetEscortPaused(false);
847 if (_currentWPid == 4 && !_handledWP4)
848 {
849 _handledWP4 = true;
852 svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
853 }
854 }
855 }
856 }
@ ACTION_RESURRECT_CAPTAINS
Definition icecrown_citadel.cpp:311
@ SAY_CROK_FINAL_WP
Definition icecrown_citadel.cpp:89
@ ACTION_VRYKUL_DEATH
Definition icecrown_citadel.h:566
void SetEscortPaused(bool on)
Definition ScriptedEscortAI.cpp:495

References _aliveTrash, _currentWPid, _handledWP4, _instance, ACTION_RESURRECT_CAPTAINS, ACTION_VRYKUL_DEATH, DATA_SISTER_SVALNA, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), ScriptedAI::me, SAY_CROK_FINAL_WP, and npc_escortAI::SetEscortPaused().

◆ UpdateAI()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

982 {
984
985 if (!me->isActiveObject())
986 return;
987
988 UpdateVictim();
989
990 _events.Update(diff);
991
993 return;
994
995 switch (_events.ExecuteEvent())
996 {
999 arnath->AI()->Talk(SAY_ARNATH_INTRO_2);
1000 break;
1001 case EVENT_CROK_INTRO_3:
1003 break;
1006 me->SetImmuneToAll(false);
1007 Start(true);
1008 break;
1012 break;
1013 case EVENT_DEATH_STRIKE:
1014 if (HealthBelowPct(20))
1017 break;
1018 case EVENT_HEALTH_CHECK:
1019 if (HealthAbovePct(25))
1020 {
1023 }
1024 else
1025 {
1028 }
1029 break;
1030 default:
1031 break;
1032 }
1033
1035 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
bool UpdateVictim()
Definition CreatureAI.cpp:350
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:86
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:278
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition Unit.cpp:7844
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4936
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1127
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:750
@ SPELL_SCOURGE_STRIKE
Definition icecrown_citadel.cpp:122
@ SPELL_DEATH_STRIKE
Definition icecrown_citadel.cpp:123
@ SAY_CROK_INTRO_3
Definition icecrown_citadel.cpp:85
@ SAY_ARNATH_INTRO_2
Definition icecrown_citadel.cpp:84
bool HealthAbovePct(uint32 pct) const
Definition ScriptedCreature.h:369
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition ScriptedEscortAI.cpp:428
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition ScriptedEscortAI.cpp:240

References _didUnderTenPercentText, _events, _instance, Unit::CountPctFromMaxHealth(), DATA_CAPTAIN_ARNATH, Unit::DealHeal(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EVENT_ARNATH_INTRO_2, EVENT_CROK_INTRO_3, EVENT_DEATH_STRIKE, EVENT_HEALTH_CHECK, EVENT_SCOURGE_STRIKE, EVENT_START_PATHING, EventMap::ExecuteEvent(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::HasUnitState(), ScriptedAI::HealthAbovePct(), ScriptedAI::HealthBelowPct(), WorldObject::isActiveObject(), ScriptedAI::me, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), SAY_ARNATH_INTRO_2, SAY_CROK_INTRO_3, EventMap::ScheduleEvent(), Unit::SetImmuneToAll(), SPELL_DEATH_STRIKE, SPELL_ICEBOUND_ARMOR, SPELL_SCOURGE_STRIKE, npc_escortAI::Start(), UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, EventMap::Update(), npc_escortAI::UpdateAI(), and CreatureAI::UpdateVictim().

◆ UpdateEscortAI()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::UpdateEscortAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

974 {
975 if (_wipeCheckTimer <= diff)
976 _wipeCheckTimer = 0;
977 else
978 _wipeCheckTimer -= diff;
979 }

References _wipeCheckTimer.

◆ WaypointReached() [1/2]

void npc_crok_scourgebane::npc_crok_scourgebaneAI::WaypointReached ( uint32  waypointId)
inlineoverridevirtual

Implements npc_escortAI.

860 {
861 switch (waypointId)
862 {
863 // pause pathing until trash pack is cleared
864 case 0:
866 if (!_aliveTrash.empty())
867 SetEscortPaused(true);
868 break;
869 case 1:
871 if (!_aliveTrash.empty())
872 SetEscortPaused(true);
873 break;
874 case 2:
875 if (!_aliveTrash.empty())
876 SetEscortPaused(true);
877 break;
878 case 4:
879 if (_aliveTrash.empty() && !_handledWP4)
880 {
881 _handledWP4 = true;
884 svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
885 }
886 break;
887 default:
888 break;
889 }
890 }
@ SAY_CROK_COMBAT_WP_1
Definition icecrown_citadel.cpp:88
@ SAY_CROK_COMBAT_WP_0
Definition icecrown_citadel.cpp:87

References _aliveTrash, _handledWP4, _instance, ACTION_RESURRECT_CAPTAINS, DATA_SISTER_SVALNA, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), ScriptedAI::me, SAY_CROK_COMBAT_WP_0, SAY_CROK_COMBAT_WP_1, SAY_CROK_FINAL_WP, and npc_escortAI::SetEscortPaused().

◆ WaypointReached() [2/2]

virtual void CreatureAI::WaypointReached ( uint32  ,
uint32   
)
inlinevirtual

Reimplemented from CreatureAI.

196{ }

◆ WaypointStart()

void npc_crok_scourgebane::npc_crok_scourgebaneAI::WaypointStart ( uint32  waypointId)
inlineoverridevirtual

Reimplemented from npc_escortAI.

893 {
894 _currentWPid = waypointId;
895 float minY = 0.0f;
896 switch (waypointId)
897 {
898 case 0:
899 minY = 2600.0f;
900 break;
901 case 1:
902 minY = 2550.0f;
904 svalna->AI()->DoAction(ACTION_KILL_CAPTAIN);
905 break;
906 case 2:
907 minY = 2515.0f;
909 svalna->AI()->DoAction(ACTION_KILL_CAPTAIN);
910 break;
911 case 4:
912 minY = 2475.0f;
913 break;
914 default:
915 break;
916 }
917
918 if (minY)
919 {
920 // get all nearby vrykul
921 std::list<Creature*> temp;
922 FrostwingVrykulSearcher check(me, 150.0f);
924 Cell::VisitObjects(me, searcher, 150.0f);
925
926 _aliveTrash.clear();
927 for (std::list<Creature*>::iterator itr = temp.begin(); itr != temp.end(); ++itr)
928 if ((*itr)->GetHomePosition().GetPositionY() > minY)
929 _aliveTrash.insert((*itr)->GetGUID());
930 }
931 }
Definition icecrown_citadel.cpp:341
@ ACTION_KILL_CAPTAIN
Definition icecrown_citadel.cpp:309
Definition GridNotifiers.h:496

References _aliveTrash, _currentWPid, _instance, ACTION_KILL_CAPTAIN, DATA_SISTER_SVALNA, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), ScriptedAI::me, and Cell::VisitObjects().

Member Data Documentation

◆ _aliveTrash

GuidSet npc_crok_scourgebane::npc_crok_scourgebaneAI::_aliveTrash
private

◆ _currentWPid

uint32 npc_crok_scourgebane::npc_crok_scourgebaneAI::_currentWPid
private

Referenced by DoAction(), SetGUID(), and WaypointStart().

◆ _didUnderTenPercentText

bool npc_crok_scourgebane::npc_crok_scourgebaneAI::_didUnderTenPercentText
private

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

◆ _events

EventMap npc_crok_scourgebane::npc_crok_scourgebaneAI::_events
private

Referenced by DamageTaken(), DoAction(), Reset(), and UpdateAI().

◆ _handledWP4

bool npc_crok_scourgebane::npc_crok_scourgebaneAI::_handledWP4
private

◆ _instance

InstanceScript* npc_crok_scourgebane::npc_crok_scourgebaneAI::_instance
private

◆ _isEventDone

bool npc_crok_scourgebane::npc_crok_scourgebaneAI::_isEventDone
private

Referenced by DoAction(), and npc_crok_scourgebaneAI().

◆ _wipeCheckTimer

uint32 npc_crok_scourgebane::npc_crok_scourgebaneAI::_wipeCheckTimer
private

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


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