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

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
720 : npc_escortAI(creature), _instance(creature->GetInstanceScript())
721 {
722 SetDespawnAtEnd(false);
723 SetDespawnAtFar(false);
725 }
@ DONE
Definition: InstanceScript.h:60
@ DATA_SISTER_SVALNA
Definition: icecrown_citadel.h:101
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:1192
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
InstanceScript * _instance
Definition: icecrown_citadel.cpp:976
bool _isEventDone
Definition: icecrown_citadel.cpp:980

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.

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

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.

869 {
870 if (HealthBelowPct(10))
871 {
873 {
877 else
879 }
880
881 damage = 0;
884 }
885 }
@ SPELL_ICEBOUND_ARMOR
Definition: icecrown_citadel.cpp:117
@ EVENT_HEALTH_CHECK
Definition: icecrown_citadel.cpp:217
@ SAY_CROK_WEAKENING_SVALNA
Definition: icecrown_citadel.cpp:95
@ SAY_CROK_WEAKENING_GAUNTLET
Definition: icecrown_citadel.cpp:94
@ NPC_SISTER_SVALNA
Definition: icecrown_citadel.h:310
Talk
Definition: hyjal.cpp:82
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:112
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:1168
Unit * GetVictim() const
Definition: Unit.h:789
bool _didUnderTenPercentText
Definition: icecrown_citadel.cpp:981
EventMap _events
Definition: icecrown_citadel.cpp:974

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.

740 {
741 if (action == ACTION_START_GAUNTLET)
742 {
743 if (_isEventDone || me->isActiveObject() || !me->IsAlive())
744 return;
745
746 me->setActive(true);
748 me->SetImmuneToAll(true);
749 // Load Grid with Sister Svalna
750 me->GetMap()->LoadGrid(4356.71f, 2484.33f);
752 svalna->AI()->DoAction(ACTION_START_GAUNTLET);
753 for (uint32 i = 0; i < 4; ++i)
755 crusader->AI()->DoAction(ACTION_START_GAUNTLET);
756
761 }
762 else if (action == ACTION_RESET_EVENT)
763 {
765 me->setActive(false);
766 _aliveTrash.clear();
767 _currentWPid = 0;
768 _handledWP4 = false;
769
770 me->CombatStop();
772 }
773 }
std::uint32_t uint32
Definition: Define.h:107
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ ACTION_RESET_EVENT
Definition: icecrown_citadel.cpp:268
@ ACTION_START_GAUNTLET
Definition: icecrown_citadel.cpp:265
@ EVENT_CROK_INTRO_3
Definition: icecrown_citadel.cpp:218
@ EVENT_ARNATH_INTRO_2
Definition: icecrown_citadel.cpp:222
@ EVENT_START_PATHING
Definition: icecrown_citadel.cpp:219
@ SAY_CROK_INTRO_1
Definition: icecrown_citadel.cpp:79
@ DATA_CAPTAIN_ARNATH
Definition: icecrown_citadel.h:128
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
Definition: Creature.h:46
Map * GetMap() const
Definition: Object.h:531
bool isActiveObject() const
Definition: Object.h:574
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10398
bool IsAlive() const
Definition: Unit.h:1204
ThreatMgr & GetThreatMgr()
Definition: Unit.h:839
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
void LoadGrid(float x, float y)
Definition: Map.cpp:492
uint32 _currentWPid
Definition: icecrown_citadel.cpp:977
bool _handledWP4
Definition: icecrown_citadel.cpp:979
GuidSet _aliveTrash
Definition: icecrown_citadel.cpp:975

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.

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

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.

776 {
777 if (type == ACTION_VRYKUL_DEATH)
778 {
779 _aliveTrash.erase(guid);
780 if (_aliveTrash.empty())
781 {
782 SetEscortPaused(false);
783 if (_currentWPid == 4 && !_handledWP4)
784 {
785 _handledWP4 = true;
788 svalna->AI()->DoAction(ACTION_RESURRECT_CAPTAINS);
789 }
790 }
791 }
792 }
@ ACTION_RESURRECT_CAPTAINS
Definition: icecrown_citadel.cpp:266
@ SAY_CROK_FINAL_WP
Definition: icecrown_citadel.cpp:85
@ ACTION_VRYKUL_DEATH
Definition: icecrown_citadel.h:537
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.

890 {
892
893 //Position pos = me->GetHomePosition();
894 if (!me->isActiveObject()/* && me->GetExactDist(&pos) < 5.0f*/) // during event
895 return;
896
897 if (_wipeCheckTimer <= diff)
898 {
899 _wipeCheckTimer = 3000;
900
901 Player* player = nullptr;
904 Cell::VisitWorldObjects(me, searcher, 140.0f);
905 // wipe
906 if (!player || me->GetExactDist(4357.0f, 2606.0f, 350.0f) > 125.0f)
907 {
908 //Talk(SAY_CROK_DEATH);
911 Cell::VisitGridObjects(me, worker, 333.0f);
912 return;
913 }
914 }
915 else
916 _wipeCheckTimer -= diff;
917
918 UpdateVictim();
919
920 _events.Update(diff);
921
923 return;
924
925 switch (_events.ExecuteEvent())
926 {
929 arnath->AI()->Talk(SAY_ARNATH_INTRO_2);
930 break;
933 break;
936 me->SetImmuneToAll(false);
937 Start(true, true);
938 break;
942 break;
944 if (HealthBelowPct(20))
947 break;
949 if (HealthAbovePct(25))
950 {
953 }
954 else
955 {
958 }
959 break;
960 default:
961 break;
962 }
963
965 }
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ SPELL_SCOURGE_STRIKE
Definition: icecrown_citadel.cpp:118
@ SPELL_DEATH_STRIKE
Definition: icecrown_citadel.cpp:119
@ SAY_CROK_INTRO_3
Definition: icecrown_citadel.cpp:81
@ SAY_ARNATH_INTRO_2
Definition: icecrown_citadel.cpp:80
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:269
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:178
Definition: Player.h:1064
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition: Unit.cpp:10908
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:878
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:193
Definition: GridNotifiers.h:489
Definition: GridNotifiers.h:510
Definition: GridNotifiers.h:1354
Definition: icecrown_citadel.cpp:318

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.

887{}

◆ WaypointReached()

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

Implements npc_escortAI.

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

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.

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

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