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 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) More...
 
void UpdateEscortAI (uint32) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
bool CanAIAttack (Unit const *target) const override
 
- 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
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
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)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=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)
 
- 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
 

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
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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_crok_scourgebaneAI()

npc_crok_scourgebane::npc_crok_scourgebaneAI::npc_crok_scourgebaneAI ( Creature creature)
inline
721 : npc_escortAI(creature), _instance(creature->GetInstanceScript())
722 {
723 SetDespawnAtEnd(false);
724 SetDespawnAtFar(false);
726 }
@ DATA_SISTER_SVALNA
Definition: icecrown_citadel.h:95
@ DONE
Definition: InstanceScript.h:60
Definition: ScriptedEscortAI.h:53
void SetDespawnAtFar(bool despawn)
Definition: ScriptedEscortAI.h:105
void SetDespawnAtEnd(bool despawn)
Definition: ScriptedEscortAI.h:104
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
InstanceScript * _instance
Definition: icecrown_citadel.cpp:977
bool _isEventDone
Definition: icecrown_citadel.cpp:981

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.

969 {
970 // do not see targets inside Frostwing Halls when we are not there
971 return !target->IsPlayer() && (me->GetPositionY() > 2660.0f) == (target->GetPositionY() > 2660.0f) && target->GetEntry() != NPC_SINDRAGOSA;
972 }
@ NPC_SINDRAGOSA
Definition: pit_of_saron.h:72
Creature * me
Definition: ScriptedCreature.h:280
float GetPositionY() const
Definition: Position.h:117

References Object::GetEntry(), Position::GetPositionY(), Object::IsPlayer(), ScriptedAI::me, and NPC_SINDRAGOSA.

◆ 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 ScriptedAI.

870 {
871 if (HealthBelowPct(10))
872 {
874 {
878 else
880 }
881
882 damage = 0;
885 }
886 }
Talk
Definition: hyjal.cpp:82
@ SPELL_ICEBOUND_ARMOR
Definition: icecrown_citadel.cpp:118
@ EVENT_HEALTH_CHECK
Definition: icecrown_citadel.cpp:218
@ SAY_CROK_WEAKENING_SVALNA
Definition: icecrown_citadel.cpp:96
@ SAY_CROK_WEAKENING_GAUNTLET
Definition: icecrown_citadel.cpp:95
@ NPC_SISTER_SVALNA
Definition: icecrown_citadel.h:304
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:364
uint32 GetEntry() const
Definition: Object.h:115
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
Unit * GetVictim() const
Definition: Unit.h:853
bool _didUnderTenPercentText
Definition: icecrown_citadel.cpp:982
EventMap _events
Definition: icecrown_citadel.cpp:975

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

◆ DoAction()

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

Reimplemented from UnitAI.

741 {
742 if (action == ACTION_START_GAUNTLET)
743 {
744 if (_isEventDone || me->isActiveObject() || !me->IsAlive())
745 return;
746
747 me->setActive(true);
749 me->SetImmuneToAll(true);
750 // Load Grid with Sister Svalna
751 me->GetMap()->LoadGrid(4356.71f, 2484.33f);
753 svalna->AI()->DoAction(ACTION_START_GAUNTLET);
754 for (uint32 i = 0; i < 4; ++i)
756 crusader->AI()->DoAction(ACTION_START_GAUNTLET);
757
762 }
763 else if (action == ACTION_RESET_EVENT)
764 {
766 me->setActive(false);
767 _aliveTrash.clear();
768 _currentWPid = 0;
769 _handledWP4 = false;
770
771 me->CombatStop();
773 }
774 }
std::uint32_t uint32
Definition: Define.h:107
@ ACTION_RESET_EVENT
Definition: icecrown_citadel.cpp:269
@ ACTION_START_GAUNTLET
Definition: icecrown_citadel.cpp:266
@ EVENT_CROK_INTRO_3
Definition: icecrown_citadel.cpp:219
@ EVENT_ARNATH_INTRO_2
Definition: icecrown_citadel.cpp:223
@ EVENT_START_PATHING
Definition: icecrown_citadel.cpp:220
@ SAY_CROK_INTRO_1
Definition: icecrown_citadel.cpp:80
@ DATA_CAPTAIN_ARNATH
Definition: icecrown_citadel.h:122
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
Definition: Creature.h:43
Map * GetMap() const
Definition: Object.h:536
bool isActiveObject() const
Definition: Object.h:579
void setActive(bool isActiveObject)
Definition: Object.cpp:1094
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10436
bool IsAlive() const
Definition: Unit.h:1654
ThreatMgr & GetThreatMgr()
Definition: Unit.h:903
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
void LoadGrid(float x, float y)
Definition: Map.cpp:495
uint32 _currentWPid
Definition: icecrown_citadel.cpp:978
bool _handledWP4
Definition: icecrown_citadel.cpp:980
GuidSet _aliveTrash
Definition: icecrown_citadel.cpp:976

References _aliveTrash, _currentWPid, _events, _handledWP4, _instance, _isEventDone, ACTION_RESET_EVENT, ACTION_START_GAUNTLET, ThreatMgr::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(), WorldObject::GetMap(), Unit::GetThreatMgr(), WorldObject::isActiveObject(), Unit::IsAlive(), Map::LoadGrid(), 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 ScriptedAI.

729 {
732 _wipeCheckTimer = 3000;
733 _handledWP4 = false;
734
735 _events.Reset();
736 _events.ScheduleEvent(EVENT_SCOURGE_STRIKE, 7500ms, 12s + 500ms);
738 }
@ EVENT_SCOURGE_STRIKE
Definition: icecrown_citadel.cpp:216
@ EVENT_DEATH_STRIKE
Definition: icecrown_citadel.cpp:217
@ REACT_DEFENSIVE
Definition: Unit.h:549
void Reset()
Definition: EventMap.cpp:21
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
uint32 _wipeCheckTimer
Definition: icecrown_citadel.cpp:979

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  guid,
int32  type 
)
inlineoverridevirtual

Reimplemented from UnitAI.

777 {
778 if (type == ACTION_VRYKUL_DEATH)
779 {
780 _aliveTrash.erase(guid);
781 if (_aliveTrash.empty())
782 {
783 SetEscortPaused(false);
784 if (_currentWPid == 4 && !_handledWP4)
785 {
786 _handledWP4 = true;
789 svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
790 }
791 }
792 }
793 }
@ ACTION_RESURRECT_CAPTAINS
Definition: icecrown_citadel.cpp:267
@ SAY_CROK_FINAL_WP
Definition: icecrown_citadel.cpp:86
@ ACTION_VRYKUL_DEATH
Definition: icecrown_citadel.h:531
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523

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()

Reimplemented from npc_escortAI.

891 {
893
894 //Position pos = me->GetHomePosition();
895 if (!me->isActiveObject()/* && me->GetExactDist(&pos) < 5.0f*/) // during event
896 return;
897
898 if (_wipeCheckTimer <= diff)
899 {
900 _wipeCheckTimer = 3000;
901
902 Player* player = nullptr;
905 Cell::VisitWorldObjects(me, searcher, 140.0f);
906 // wipe
907 if (!player || me->GetExactDist(4357.0f, 2606.0f, 350.0f) > 125.0f)
908 {
909 //Talk(SAY_CROK_DEATH);
912 Cell::VisitGridObjects(me, worker, 333.0f);
913 return;
914 }
915 }
916 else
917 _wipeCheckTimer -= diff;
918
919 UpdateVictim();
920
921 _events.Update(diff);
922
924 return;
925
926 switch (_events.ExecuteEvent())
927 {
930 arnath->AI()->Talk(SAY_ARNATH_INTRO_2);
931 break;
934 break;
937 me->SetImmuneToAll(false);
938 Start(true, true);
939 break;
943 break;
945 if (HealthBelowPct(20))
948 break;
950 if (HealthAbovePct(25))
951 {
954 }
955 else
956 {
959 }
960 break;
961 default:
962 break;
963 }
964
966 }
@ SPELL_SCOURGE_STRIKE
Definition: icecrown_citadel.cpp:119
@ SPELL_DEATH_STRIKE
Definition: icecrown_citadel.cpp:120
@ SAY_CROK_INTRO_3
Definition: icecrown_citadel.cpp:82
@ SAY_ARNATH_INTRO_2
Definition: icecrown_citadel.cpp:81
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
bool UpdateVictim()
Definition: CreatureAI.cpp:280
bool HealthAbovePct(uint32 pct) const
Definition: ScriptedCreature.h:365
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition: ScriptedEscortAI.cpp:240
float GetExactDist(float x, float y, float z) const
Definition: Position.h:177
Definition: Player.h:1081
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition: Unit.cpp:10951
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:1042
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:178
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:192
Definition: GridNotifiers.h:489
Definition: GridNotifiers.h:510
Definition: GridNotifiers.h:1354
Definition: icecrown_citadel.cpp:319

References _didUnderTenPercentText, _events, _instance, _wipeCheckTimer, 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(), Position::GetExactDist(), 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(), CreatureAI::UpdateVictim(), Cell::VisitGridObjects(), and Cell::VisitWorldObjects().

◆ UpdateEscortAI()

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

Reimplemented from npc_escortAI.

888{}

◆ WaypointReached()

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

Implements npc_escortAI.

796 {
797 switch (waypointId)
798 {
799 // pause pathing until trash pack is cleared
800 case 0:
802 if (!_aliveTrash.empty())
803 SetEscortPaused(true);
804 break;
805 case 1:
807 if (!_aliveTrash.empty())
808 SetEscortPaused(true);
809 break;
810 case 2:
811 if (!_aliveTrash.empty())
812 SetEscortPaused(true);
813 break;
814 case 4:
815 if (_aliveTrash.empty() && !_handledWP4)
816 {
817 _handledWP4 = true;
820 svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
821 }
822 break;
823 default:
824 break;
825 }
826 }
@ SAY_CROK_COMBAT_WP_1
Definition: icecrown_citadel.cpp:85
@ SAY_CROK_COMBAT_WP_0
Definition: icecrown_citadel.cpp:84

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().

◆ WaypointStart()

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

Reimplemented from npc_escortAI.

829 {
830 _currentWPid = waypointId;
831 float minY = 0.0f;
832 switch (waypointId)
833 {
834 case 0:
835 minY = 2600.0f;
836 break;
837 case 1:
838 minY = 2550.0f;
840 svalna->AI()->DoAction(ACTION_KILL_CAPTAIN);
841 break;
842 case 2:
843 minY = 2515.0f;
845 svalna->AI()->DoAction(ACTION_KILL_CAPTAIN);
846 break;
847 case 4:
848 minY = 2475.0f;
849 break;
850 default:
851 break;
852 }
853
854 if (minY)
855 {
856 // get all nearby vrykul
857 std::list<Creature*> temp;
858 FrostwingVrykulSearcher check(me, 150.0f);
860 Cell::VisitGridObjects(me, searcher, 150.0f);
861
862 _aliveTrash.clear();
863 for (std::list<Creature*>::iterator itr = temp.begin(); itr != temp.end(); ++itr)
864 if ((*itr)->GetHomePosition().GetPositionY() > minY)
865 _aliveTrash.insert((*itr)->GetGUID());
866 }
867 }
@ ACTION_KILL_CAPTAIN
Definition: icecrown_citadel.cpp:265
Definition: GridNotifiers.h:473
Definition: icecrown_citadel.cpp:286

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

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 Reset(), and UpdateAI().