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

Public Member Functions

 boss_zuljinAI (Creature *creature)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void AttackStart (Unit *who) override
 
void DoMeleeAttackIfReady ()
 
void SpawnAdds ()
 
void DespawnAdds ()
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void EnterPhase (uint32 NextPhase)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScriptinstance
 
ObjectGuid SpiritGUID [4]
 
ObjectGuid ClawTargetGUID
 
ObjectGuid TankGUID
 
uint32 Phase
 
uint32 health_20
 
uint32 Intro_Timer
 
uint32 Berserk_Timer
 
uint32 Whirlwind_Timer
 
uint32 Grievous_Throw_Timer
 
uint32 Creeping_Paralysis_Timer
 
uint32 Overpower_Timer
 
uint32 Claw_Rage_Timer
 
uint32 Lynx_Rush_Timer
 
uint32 Claw_Counter
 
uint32 Claw_Loop_Timer
 
uint32 Flame_Whirl_Timer
 
uint32 Flame_Breath_Timer
 
uint32 Pillar_Of_Fire_Timer
 
SummonList Summons
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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

Detailed Description

Constructor & Destructor Documentation

◆ boss_zuljinAI()

boss_zuljin::boss_zuljinAI::boss_zuljinAI ( Creature creature)
inline
135 : ScriptedAI(creature), Summons(me)
136 {
137 instance = creature->GetInstanceScript();
138 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
SummonList Summons
Definition: boss_zuljin.cpp:166
InstanceScript * instance
Definition: boss_zuljin.cpp:139

References WorldObject::GetInstanceScript(), and instance.

Member Function Documentation

◆ AttackStart()

void boss_zuljin::boss_zuljinAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

235 {
236 if (Phase == 2)
238 else
240 }
Phase
Definition: boss_zuljin.cpp:84
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:208
void AttackStartNoMove(Unit *target)
Definition: ScriptedCreature.cpp:199

References ScriptedAI::AttackStart(), and ScriptedAI::AttackStartNoMove().

Referenced by EnterPhase(), and UpdateAI().

◆ DespawnAdds()

void boss_zuljin::boss_zuljinAI::DespawnAdds ( )
inline
280 {
281 for (uint8 i = 0; i < 4; ++i)
282 {
283 if (SpiritGUID[i])
284 {
285 if (Unit* temp = ObjectAccessor::GetUnit(*me, SpiritGUID[i]))
286 {
287 temp->SetVisible(false);
288 temp->setDeathState(DeathState::Dead);
289 }
290 }
291 SpiritGUID[i].Clear();
292 }
293 }
std::uint8_t uint8
Definition: Define.h:109
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
void Clear()
Definition: ObjectGuid.h:138
Definition: Unit.h:630
ObjectGuid SpiritGUID[4]
Definition: boss_zuljin.cpp:141

References ObjectGuid::Clear(), ObjectAccessor::GetUnit(), ScriptedAI::me, and SpiritGUID.

◆ DoMeleeAttackIfReady()

void boss_zuljin::boss_zuljinAI::DoMeleeAttackIfReady ( )
inline
243 {
244 if (!me->IsNonMeleeSpellCast(false))
245 {
247 {
248 if (Phase == 1 && !Overpower_Timer)
249 {
250 uint32 health = me->GetVictim()->GetHealth();
252 if (me->GetVictim() && health == me->GetVictim()->GetHealth())
253 {
255 Overpower_Timer = 5000;
256 }
257 }
260 }
261 }
262 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_OVERPOWER
Definition: boss_zuljin.cpp:50
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4081
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:665
uint32 GetHealth() const
Definition: Unit.h:869
Unit * GetVictim() const
Definition: Unit.h:789
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2549
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:766
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:643
uint32 Overpower_Timer
Definition: boss_zuljin.cpp:155

References Unit::AttackerStateUpdate(), UnitAI::DoCastVictim(), Unit::GetHealth(), Unit::GetVictim(), Unit::isAttackReady(), Unit::IsNonMeleeSpellCast(), Unit::IsWithinMeleeRange(), ScriptedAI::me, Overpower_Timer, Unit::resetAttackTimer(), and SPELL_OVERPOWER.

Referenced by UpdateAI().

◆ EnterPhase()

void boss_zuljin::boss_zuljinAI::EnterPhase ( uint32  NextPhase)
inline
306 {
307 switch (NextPhase)
308 {
309 case 0:
310 break;
311 case 1:
312 case 2:
313 case 3:
314 case 4:
319 DoCast(me, Transform[Phase].spell);
320 Talk(Transform[Phase].text);
321 if (Phase > 0)
322 {
323 if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[Phase - 1]))
324 Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
325 }
326 if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[NextPhase - 1]))
327 Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp
328 if (NextPhase == 2)
329 {
331 DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura
332 for (uint8 i = 0; i < 4; ++i)
333 {
335 if (Vortex)
336 {
337 Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true);
338 Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true);
340 Vortex->SetSpeed(MOVE_RUN, 1.0f);
341 Vortex->AI()->AttackStart(SelectTarget(SelectTargetMethod::Random, 0));
342 DoZoneInCombat(Vortex);
343 }
344 }
345 }
346 else
348 if (NextPhase == 3)
349 {
351 Summons.DespawnEntry(CREATURE_FEATHER_VORTEX);
353 }
354 break;
355 default:
356 break;
357 }
358 Phase = NextPhase;
359 }
@ UNIT_STAND_STATE_DEAD
Definition: UnitDefines.h:39
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
@ UNIT_FIELD_BYTES_1
Definition: UpdateFields.h:131
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:49
@ SPELL_CYCLONE_VISUAL
Definition: boss_zuljin.cpp:57
@ SPELL_CYCLONE_PASSIVE
Definition: boss_zuljin.cpp:58
@ SPELL_SIPHON_SOUL
Definition: boss_zuljin.cpp:73
@ SPELL_ENERGY_STORM
Definition: boss_zuljin.cpp:52
@ CREATURE_FEATHER_VORTEX
Definition: boss_zuljin.cpp:56
#define CENTER_Y
Definition: boss_zuljin.cpp:94
static TransformStruct Transform[4]
Definition: boss_zuljin.cpp:117
#define CENTER_Z
Definition: boss_zuljin.cpp:95
#define CENTER_X
Definition: boss_zuljin.cpp:93
Summons
Definition: boss_razorgore.cpp:55
Talk
Definition: hyjal.cpp:82
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
void DoResetThreatList()
Definition: ScriptedCreature.cpp:436
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition: ScriptedCreature.cpp:307
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:143
float GetOrientation() const
Definition: Position.h:120
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
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
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4891
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14383
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:19937
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:313
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void AttackStart(Unit *who) override
Definition: boss_zuljin.cpp:234

References Creature::AI(), UnitAI::AttackStart(), AttackStart(), Unit::CastSpell(), CENTER_X, CENTER_Y, CENTER_Z, MotionMaster::Clear(), CREATURE_FEATHER_VORTEX, UnitAI::DoCast(), ScriptedAI::DoResetThreatList(), ScriptedAI::DoSpawnCreature(), CreatureAI::DoZoneInCombat(), Unit::GetMotionMaster(), Position::GetOrientation(), ObjectAccessor::GetUnit(), Unit::GetVictim(), ScriptedAI::me, MOVE_RUN, MotionMaster::MoveChase(), Unit::NearTeleportTo(), Unit::RemoveAurasDueToSpell(), UnitAI::SelectTarget(), Unit::SetSpeed(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), SPELL_CYCLONE_PASSIVE, SPELL_CYCLONE_VISUAL, SPELL_ENERGY_STORM, SPELL_SIPHON_SOUL, SpiritGUID, TEMPSUMMON_CORPSE_DESPAWN, Transform, UNIT_FIELD_BYTES_1, UNIT_FLAG_NOT_SELECTABLE, UNIT_STAND_STATE_DEAD, and UNIT_VIRTUAL_ITEM_SLOT_ID.

Referenced by JustEngagedWith(), and UpdateAI().

◆ JustDied()

void boss_zuljin::boss_zuljinAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

224 {
226
228 Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE);
229
230 if (Unit* Temp = ObjectAccessor::GetUnit(*me, SpiritGUID[3]))
231 Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
232 }
@ DONE
Definition: InstanceScript.h:60
@ DATA_ZULJINEVENT
Definition: zulaman.h:34
@ YELL_DEATH
Definition: boss_zuljin.cpp:40
@ CREATURE_COLUMN_OF_FIRE
Definition: boss_zuljin.cpp:69
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References CREATURE_COLUMN_OF_FIRE, DATA_ZULJINEVENT, DONE, ObjectAccessor::GetUnit(), instance, ScriptedAI::me, ZoneScript::SetData(), SpiritGUID, UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD, and YELL_DEATH.

◆ JustEngagedWith()

void boss_zuljin::boss_zuljinAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

205 {
207
209
211 SpawnAdds();
212 EnterPhase(0);
213 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ YELL_INTRO
Definition: boss_zuljin.cpp:31
void SpawnAdds()
Definition: boss_zuljin.cpp:264
void EnterPhase(uint32 NextPhase)
Definition: boss_zuljin.cpp:305

References DATA_ZULJINEVENT, CreatureAI::DoZoneInCombat(), EnterPhase(), IN_PROGRESS, instance, ZoneScript::SetData(), SpawnAdds(), and YELL_INTRO.

◆ JustSummoned()

void boss_zuljin::boss_zuljinAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

296 {
297 Summons.Summon(summon);
298 }

◆ KilledUnit()

void boss_zuljin::boss_zuljinAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

216 {
217 if (Intro_Timer)
218 return;
219
221 }
@ YELL_KILL
Definition: boss_zuljin.cpp:39
uint32 Intro_Timer
Definition: boss_zuljin.cpp:148

References Intro_Timer, and YELL_KILL.

◆ Reset()

void boss_zuljin::boss_zuljinAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

169 {
171
172 Phase = 0;
173
175
176 Intro_Timer = 37000;
177 Berserk_Timer = 600000;
178
179 Whirlwind_Timer = 7000;
181
183 Overpower_Timer = 0;
184
185 Claw_Rage_Timer = 5000;
186 Lynx_Rush_Timer = 14000;
187 Claw_Loop_Timer = 0;
188 Claw_Counter = 0;
189
190 Flame_Whirl_Timer = 5000;
191 Flame_Breath_Timer = 6000;
193
195 TankGUID.Clear();
196
197 Summons.DespawnAll();
198
200 //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674);
201 //me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
202 }
@ NOT_STARTED
Definition: InstanceScript.h:57
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:878
uint32 Flame_Breath_Timer
Definition: boss_zuljin.cpp:163
uint32 Lynx_Rush_Timer
Definition: boss_zuljin.cpp:158
uint32 Flame_Whirl_Timer
Definition: boss_zuljin.cpp:162
uint32 health_20
Definition: boss_zuljin.cpp:146
uint32 Berserk_Timer
Definition: boss_zuljin.cpp:149
uint32 Claw_Rage_Timer
Definition: boss_zuljin.cpp:157
ObjectGuid ClawTargetGUID
Definition: boss_zuljin.cpp:142
ObjectGuid TankGUID
Definition: boss_zuljin.cpp:143
uint32 Creeping_Paralysis_Timer
Definition: boss_zuljin.cpp:154
uint32 Claw_Counter
Definition: boss_zuljin.cpp:159
uint32 Grievous_Throw_Timer
Definition: boss_zuljin.cpp:152
uint32 Pillar_Of_Fire_Timer
Definition: boss_zuljin.cpp:164
uint32 Whirlwind_Timer
Definition: boss_zuljin.cpp:151
uint32 Claw_Loop_Timer
Definition: boss_zuljin.cpp:160

References Berserk_Timer, Claw_Counter, Claw_Loop_Timer, Claw_Rage_Timer, ClawTargetGUID, ObjectGuid::Clear(), Unit::CountPctFromMaxHealth(), Creeping_Paralysis_Timer, DATA_ZULJINEVENT, Flame_Breath_Timer, Flame_Whirl_Timer, Grievous_Throw_Timer, health_20, instance, Intro_Timer, Lynx_Rush_Timer, ScriptedAI::me, NOT_STARTED, Overpower_Timer, Pillar_Of_Fire_Timer, ZoneScript::SetData(), Unit::SetUInt32Value(), TankGUID, UNIT_VIRTUAL_ITEM_SLOT_ID, and Whirlwind_Timer.

◆ SpawnAdds()

void boss_zuljin::boss_zuljinAI::SpawnAdds ( )
inline
265 {
266 for (uint8 i = 0; i < 4; ++i)
267 {
268 Creature* creature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0);
269 if (creature)
270 {
271 creature->CastSpell(creature, SPELL_SPIRIT_AURA, true);
274 SpiritGUID[i] = creature->GetGUID();
275 }
276 }
277 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:51
static SpiritInfoStruct SpiritInfo[4]
Definition: boss_zuljin.cpp:103
@ SPELL_SPIRIT_AURA
Definition: boss_zuljin.cpp:72
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684

References Unit::CastSpell(), Object::GetGUID(), ScriptedAI::me, Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), SPELL_SPIRIT_AURA, SpiritGUID, SpiritInfo, WorldObject::SummonCreature(), TEMPSUMMON_DEAD_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by JustEngagedWith().

◆ SummonedCreatureDespawn()

void boss_zuljin::boss_zuljinAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

301 {
302 Summons.Despawn(summon);
303 }

◆ UpdateAI()

void boss_zuljin::boss_zuljinAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

362 {
363 if (!TankGUID)
364 {
365 if (!UpdateVictim())
366 return;
367
368 if (me->GetHealth() < health_20 * (4 - Phase))
369 EnterPhase(Phase + 1);
370 }
371
372 if (Berserk_Timer <= diff)
373 {
374 DoCast(me, SPELL_BERSERK, true);
376 Berserk_Timer = 60000;
377 }
378 else Berserk_Timer -= diff;
379
380 switch (Phase)
381 {
382 case 0:
383 if (Intro_Timer)
384 {
385 if (Intro_Timer <= diff)
386 {
388 Intro_Timer = 0;
389 }
390 else Intro_Timer -= diff;
391 }
392
393 if (Whirlwind_Timer <= diff)
394 {
396 Whirlwind_Timer = urand(15000, 20000);
397 }
398 else Whirlwind_Timer -= diff;
399
400 if (Grievous_Throw_Timer <= diff)
401 {
402 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
403 DoCast(target, SPELL_GRIEVOUS_THROW, false);
404 Grievous_Throw_Timer = 10000;
405 }
406 else Grievous_Throw_Timer -= diff;
407 break;
408
409 case 1:
410 if (Creeping_Paralysis_Timer <= diff)
411 {
414 }
415 else Creeping_Paralysis_Timer -= diff;
416
417 if (Overpower_Timer <= diff)
418 {
419 // implemented in DoMeleeAttackIfReady()
420 Overpower_Timer = 0;
421 }
422 else Overpower_Timer -= diff;
423 break;
424
425 case 2:
426 return;
427
428 case 3:
429 if (Claw_Rage_Timer <= diff)
430 {
431 if (!TankGUID)
432 {
433 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
434 {
436 me->SetSpeed(MOVE_RUN, 5.0f);
437 AttackStart(target); // change victim
438 Claw_Rage_Timer = 0;
439 Claw_Loop_Timer = 500;
440 Claw_Counter = 0;
441 }
442 }
443 else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush
444 {
445 if (Claw_Loop_Timer <= diff)
446 {
447 Unit* target = me->GetVictim();
448 if (!target || !target->isTargetableForAttack()) target = ObjectAccessor::GetUnit(*me, TankGUID);
449 if (!target || !target->isTargetableForAttack()) target = SelectTarget(SelectTargetMethod::Random, 0);
450 if (target)
451 {
452 AttackStart(target);
453 if (me->IsWithinMeleeRange(target))
454 {
455 DoCast(target, SPELL_CLAW_RAGE_DAMAGE, true);
456 ++Claw_Counter;
457 if (Claw_Counter == 12)
458 {
459 Claw_Rage_Timer = urand(15000, 20000);
460 me->SetSpeed(MOVE_RUN, 1.2f);
462 TankGUID.Clear();
463 return;
464 }
465 else
466 Claw_Loop_Timer = 500;
467 }
468 }
469 else
470 {
471 EnterEvadeMode(); // if (target)
472 return;
473 }
474 }
475 else Claw_Loop_Timer -= diff;
476 } //if (TankGUID)
477 }
478 else Claw_Rage_Timer -= diff;
479
480 if (Lynx_Rush_Timer <= diff)
481 {
482 if (!TankGUID)
483 {
484 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
485 {
487 me->SetSpeed(MOVE_RUN, 5.0f);
488 AttackStart(target); // change victim
489 Lynx_Rush_Timer = 0;
490 Claw_Counter = 0;
491 }
492 }
493 else if (!Lynx_Rush_Timer)
494 {
495 Unit* target = me->GetVictim();
496 if (!target || !target->isTargetableForAttack())
497 {
498 target = SelectTarget(SelectTargetMethod::Random, 0);
499 AttackStart(target);
500 }
501 if (target)
502 {
503 if (me->IsWithinMeleeRange(target))
504 {
505 DoCast(target, SPELL_LYNX_RUSH_DAMAGE, true);
506 ++Claw_Counter;
507 if (Claw_Counter == 9)
508 {
509 Lynx_Rush_Timer = urand(15000, 20000);
510 me->SetSpeed(MOVE_RUN, 1.2f);
512 TankGUID.Clear();
513 }
514 else
515 AttackStart(SelectTarget(SelectTargetMethod::Random, 0));
516 }
517 }
518 else
519 {
520 EnterEvadeMode(); // if (target)
521 return;
522 }
523 } //if (TankGUID)
524 }
525 else Lynx_Rush_Timer -= diff;
526
527 break;
528 case 4:
529 if (Flame_Whirl_Timer <= diff)
530 {
532 Flame_Whirl_Timer = 12000;
533 }
534 Flame_Whirl_Timer -= diff;
535
536 if (Pillar_Of_Fire_Timer <= diff)
537 {
538 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
540 Pillar_Of_Fire_Timer = 10000;
541 }
542 else Pillar_Of_Fire_Timer -= diff;
543
544 if (Flame_Breath_Timer <= diff)
545 {
546 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
547 me->SetInFront(target);
549 Flame_Breath_Timer = 10000;
550 }
551 else Flame_Breath_Timer -= diff;
552 break;
553
554 default:
555 break;
556 }
557
558 if (!TankGUID)
560 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ YELL_AGGRO
Definition: boss_zuljin.cpp:32
@ YELL_BERSERK
Definition: boss_zuljin.cpp:38
@ SPELL_SUMMON_PILLAR
Definition: boss_zuljin.cpp:68
@ SPELL_GRIEVOUS_THROW
Definition: boss_zuljin.cpp:47
@ SPELL_CREEPING_PARALYSIS
Definition: boss_zuljin.cpp:49
@ SPELL_FLAME_BREATH
Definition: boss_zuljin.cpp:67
@ SPELL_FLAME_WHIRL
Definition: boss_zuljin.cpp:66
@ SPELL_CLAW_RAGE_DAMAGE
Definition: boss_zuljin.cpp:62
@ SPELL_LYNX_RUSH_DAMAGE
Definition: boss_zuljin.cpp:64
@ SPELL_BERSERK
Definition: boss_zuljin.cpp:80
@ SPELL_WHIRLWIND
Definition: boss_zuljin.cpp:46
bool UpdateVictim()
Definition: CreatureAI.cpp:269
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition: Unit.cpp:13811
void SetInFront(WorldObject const *target)
Definition: Unit.cpp:20477
void DoMeleeAttackIfReady()
Definition: boss_zuljin.cpp:242

References AttackStart(), Berserk_Timer, Claw_Counter, Claw_Loop_Timer, Claw_Rage_Timer, ObjectGuid::Clear(), Creeping_Paralysis_Timer, UnitAI::DoCast(), DoMeleeAttackIfReady(), CreatureAI::EnterEvadeMode(), EnterPhase(), Flame_Breath_Timer, Flame_Whirl_Timer, Object::GetGUID(), Unit::GetHealth(), ObjectAccessor::GetUnit(), Unit::GetVictim(), Grievous_Throw_Timer, health_20, Intro_Timer, Unit::isTargetableForAttack(), Unit::IsWithinMeleeRange(), Lynx_Rush_Timer, ScriptedAI::me, MOVE_RUN, Overpower_Timer, Pillar_Of_Fire_Timer, UnitAI::SelectTarget(), Unit::SetInFront(), Unit::SetSpeed(), SPELL_BERSERK, SPELL_CLAW_RAGE_DAMAGE, SPELL_CREEPING_PARALYSIS, SPELL_FLAME_BREATH, SPELL_FLAME_WHIRL, SPELL_GRIEVOUS_THROW, SPELL_LYNX_RUSH_DAMAGE, SPELL_SUMMON_PILLAR, SPELL_WHIRLWIND, TankGUID, CreatureAI::UpdateVictim(), urand(), Whirlwind_Timer, YELL_AGGRO, and YELL_BERSERK.

Member Data Documentation

◆ Berserk_Timer

uint32 boss_zuljin::boss_zuljinAI::Berserk_Timer

Referenced by Reset(), and UpdateAI().

◆ Claw_Counter

uint32 boss_zuljin::boss_zuljinAI::Claw_Counter

Referenced by Reset(), and UpdateAI().

◆ Claw_Loop_Timer

uint32 boss_zuljin::boss_zuljinAI::Claw_Loop_Timer

Referenced by Reset(), and UpdateAI().

◆ Claw_Rage_Timer

uint32 boss_zuljin::boss_zuljinAI::Claw_Rage_Timer

Referenced by Reset(), and UpdateAI().

◆ ClawTargetGUID

ObjectGuid boss_zuljin::boss_zuljinAI::ClawTargetGUID

Referenced by Reset().

◆ Creeping_Paralysis_Timer

uint32 boss_zuljin::boss_zuljinAI::Creeping_Paralysis_Timer

Referenced by Reset(), and UpdateAI().

◆ Flame_Breath_Timer

uint32 boss_zuljin::boss_zuljinAI::Flame_Breath_Timer

Referenced by Reset(), and UpdateAI().

◆ Flame_Whirl_Timer

uint32 boss_zuljin::boss_zuljinAI::Flame_Whirl_Timer

Referenced by Reset(), and UpdateAI().

◆ Grievous_Throw_Timer

uint32 boss_zuljin::boss_zuljinAI::Grievous_Throw_Timer

Referenced by Reset(), and UpdateAI().

◆ health_20

uint32 boss_zuljin::boss_zuljinAI::health_20

Referenced by Reset(), and UpdateAI().

◆ instance

InstanceScript* boss_zuljin::boss_zuljinAI::instance

◆ Intro_Timer

uint32 boss_zuljin::boss_zuljinAI::Intro_Timer

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

◆ Lynx_Rush_Timer

uint32 boss_zuljin::boss_zuljinAI::Lynx_Rush_Timer

Referenced by Reset(), and UpdateAI().

◆ Overpower_Timer

uint32 boss_zuljin::boss_zuljinAI::Overpower_Timer

◆ Phase

uint32 boss_zuljin::boss_zuljinAI::Phase

◆ Pillar_Of_Fire_Timer

uint32 boss_zuljin::boss_zuljinAI::Pillar_Of_Fire_Timer

Referenced by Reset(), and UpdateAI().

◆ SpiritGUID

ObjectGuid boss_zuljin::boss_zuljinAI::SpiritGUID[4]

◆ Summons

SummonList boss_zuljin::boss_zuljinAI::Summons

◆ TankGUID

ObjectGuid boss_zuljin::boss_zuljinAI::TankGUID

Referenced by Reset(), and UpdateAI().

◆ Whirlwind_Timer

uint32 boss_zuljin::boss_zuljinAI::Whirlwind_Timer

Referenced by Reset(), and UpdateAI().