AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_krick::boss_krickAI Struct Reference
Inheritance diagram for boss_krick::boss_krickAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 boss_krickAI (Creature *creature)
 
void DoAction (int32 a) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed. More...
 
- 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

InstanceScriptpInstance
 
EventMap events
 

Additional Inherited Members

- 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 NullCreatureAI
static int32 Permissible (Creature const *creature)
 
- 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_krickAI()

boss_krick::boss_krickAI::boss_krickAI ( Creature creature)
inline
288 : NullCreatureAI(creature)
289 {
290 pInstance = creature->GetInstanceScript();
291 }
Definition: PassiveAI.h:53
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * pInstance
Definition: boss_krickandick.cpp:293

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DoAction()

void boss_krick::boss_krickAI::DoAction ( int32  a)
inlineoverridevirtual

Reimplemented from UnitAI.

297 {
298 if (a == 1)
299 {
300 me->setActive(true);
301 events.RescheduleEvent(20, 0);
302 }
303 }
events
Definition: boss_sartura.cpp:43
Creature *const me
Definition: CreatureAI.h:73
void setActive(bool isActiveObject)
Definition: Object.cpp:1085

References CreatureAI::me, and WorldObject::setActive().

◆ UpdateAI()

void boss_krick::boss_krickAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from NullCreatureAI.

306 {
307 events.Update(diff);
308 switch (events.ExecuteEvent())
309 {
310 case 0:
311 break;
312 case 20:
313 if (pInstance)
314 {
316
318 {
319 c->GetMotionMaster()->Clear();
320 c->UpdatePosition(SBSLeaderStartPos, true);
321 c->StopMovingOnCurrentPos();
322 c->AI()->Reset();
323 }
324 }
325
326 events.RescheduleEvent(1, 3s);
327 break;
328 case 1:
330 if (pInstance)
331 {
333 {
334 float angle = me->GetAngle(c);
335 me->SetFacingTo(angle);
336 float x = me->GetPositionX() + cos(angle) * 7.0f;
337 float y = me->GetPositionY() + std::sin(angle) * 7.0f;
338 c->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
339 }
340
341 for (uint8 i = 0; i < 2; ++i)
343 c->DespawnOrUnsummon();
344 }
345
346 events.RescheduleEvent(2, 7s);
347 break;
348 case 2:
349 if (pInstance)
350 {
352 {
353 c->setActive(true);
354 c->UpdatePosition(SBSTyrannusStartPos, true);
355 c->SetHomePosition(SBSTyrannusStartPos);
356 }
358 c->AI()->Talk(c->GetEntry() == NPC_JAINA_PART1 ? SAY_JAINA_KRICK_1 : SAY_SYLVANAS_KRICK_1);
359 }
360
361 events.RescheduleEvent(3, 6500ms);
362 break;
363 case 3:
365
366 events.RescheduleEvent(4, 17s);
367 break;
368 case 4:
369 if (pInstance)
370 {
372 c->GetMotionMaster()->MovePath(PATH_BEGIN_VALUE + 10, false);
374 c->AI()->Talk(c->GetEntry() == NPC_JAINA_PART1 ? SAY_JAINA_KRICK_2 : SAY_SYLVANAS_KRICK_2);
375 }
376
377 events.RescheduleEvent(5, 6500ms);
378 break;
379 case 5:
381
382 events.RescheduleEvent(6, 6500ms);
383 break;
384 case 6:
385 if (pInstance)
387 {
388 c->SetFacingToObject(me);
389 c->AI()->Talk(SAY_TYRANNUS_KRICK_1);
390 }
391
392 events.RescheduleEvent(7, 4s);
393 break;
394 case 7:
395 me->CastSpell(me, 69413, true);
397 me->SetCanFly(true);
398 me->SetDisableGravity(true);
400 me->GetMotionMaster()->MoveTakeoff(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 9.0f, 0.5f * 7.0f);
401
402 events.RescheduleEvent(8, 2s);
403 break;
404 case 8:
406
407 events.RescheduleEvent(9, 1500);
408 break;
409 case 9:
410 if (pInstance)
412 c->CastSpell(c, 69753, false);
413
416 me->SetImmuneToAll(true);
420
422
424 me->GetMotionMaster()->MoveFall(0, true);
425
426 events.RescheduleEvent(10, 5s);
427 break;
428 case 10:
429 if (pInstance)
431 c->AI()->Talk(SAY_TYRANNUS_KRICK_2);
432
433 events.RescheduleEvent(11, 9000);
434 break;
435 case 11:
436 if (pInstance)
437 {
439 c->GetMotionMaster()->MovePoint(1, 809.39f, 74.69f, 541.54f);
441 {
442 c->AI()->Talk(c->GetEntry() == NPC_JAINA_PART1 ? SAY_JAINA_KRICK_3 : SAY_SYLVANAS_KRICK_3);
443 c->GetMotionMaster()->MovePath(PATH_BEGIN_VALUE + 11, false);
444 }
445 }
446 me->setActive(false);
447 me->KillSelf();
448
449 break;
450 }
451 }
std::uint8_t uint8
Definition: Define.h:109
@ REACT_PASSIVE
Definition: Unit.h:548
@ UNIT_FLAG2_FEIGN_DEATH
Definition: UnitDefines.h:268
@ UNIT_STATE_DIED
Definition: UnitDefines.h:149
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition: UnitDefines.h:258
@ NPC_JAINA_PART1
Definition: forge_of_souls.h:42
#define PATH_BEGIN_VALUE
Definition: forge_of_souls.h:65
const Position SBSTyrannusStartPos
Definition: pit_of_saron.h:240
@ SAY_JAINA_KRICK_2
Definition: pit_of_saron.h:250
@ SAY_OUTRO_KRICK_4
Definition: pit_of_saron.h:254
@ SAY_OUTRO_KRICK_1
Definition: pit_of_saron.h:246
@ SAY_JAINA_KRICK_3
Definition: pit_of_saron.h:256
@ SAY_TYRANNUS_KRICK_2
Definition: pit_of_saron.h:255
@ SAY_SYLVANAS_KRICK_1
Definition: pit_of_saron.h:248
@ SAY_OUTRO_KRICK_3
Definition: pit_of_saron.h:252
@ SAY_OUTRO_KRICK_2
Definition: pit_of_saron.h:249
@ SAY_JAINA_KRICK_1
Definition: pit_of_saron.h:247
@ SAY_SYLVANAS_KRICK_2
Definition: pit_of_saron.h:251
@ SAY_SYLVANAS_KRICK_3
Definition: pit_of_saron.h:257
@ SAY_TYRANNUS_KRICK_1
Definition: pit_of_saron.h:253
const Position SBSLeaderStartPos
Definition: pit_of_saron.h:241
@ SPELL_KRICK_KILL_CREDIT
Definition: pit_of_saron.h:133
@ INSTANCE_PROGRESS_FINISHED_KRICK_SCENE
Definition: pit_of_saron.h:58
@ DATA_GUARD_1_GUID
Definition: pit_of_saron.h:40
@ DATA_LEADER_FIRST_GUID
Definition: pit_of_saron.h:42
@ DATA_TYRANNUS_EVENT_GUID
Definition: pit_of_saron.h:37
@ DATA_INSTANCE_PROGRESS
Definition: trial_of_the_champion.h:33
Talk
Definition: hyjal.cpp:82
@ UNIT_DYNFLAG_DEAD
Definition: SharedDefines.h:3126
Definition: Creature.h:46
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3192
bool SetCanFly(bool enable, bool packetOnly=false) override
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition: Creature.cpp:3277
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:97
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:120
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
float GetAngle(const Position *pos) const
Definition: Position.cpp:77
void SetFacingTo(float ori)
Definition: Unit.cpp:20483
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:689
void AddUnitState(uint32 f)
Definition: Unit.h:672
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16660
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
void SendMeleeAttackStop(Unit *victim=nullptr)
Send to the client SMSG_ATTACKSTOP but doesn't clear UNIT_STATE_MELEE_ATTACKING on server side or int...
Definition: Unit.cpp:3061
void RemoveAllAuras()
Definition: Unit.cpp:5290
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:999
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void MoveTakeoff(uint32 id, Position const &pos, float speed=0.0f)
Use to move the unit from the ground to the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:523
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
The unit will fall. Used when in the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:624

References Unit::AddUnitState(), Unit::CastSpell(), DATA_GUARD_1_GUID, DATA_INSTANCE_PROGRESS, DATA_LEADER_FIRST_GUID, DATA_TYRANNUS_EVENT_GUID, Position::GetAngle(), Map::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVictim(), InstanceScript::instance, INSTANCE_PROGRESS_FINISHED_KRICK_SCENE, Unit::KillSelf(), CreatureAI::me, MotionMaster::MoveFall(), MotionMaster::MoveTakeoff(), NPC_JAINA_PART1, PATH_BEGIN_VALUE, pInstance, REACT_PASSIVE, Unit::RemoveAllAuras(), SAY_JAINA_KRICK_1, SAY_JAINA_KRICK_2, SAY_JAINA_KRICK_3, SAY_OUTRO_KRICK_1, SAY_OUTRO_KRICK_2, SAY_OUTRO_KRICK_3, SAY_OUTRO_KRICK_4, SAY_SYLVANAS_KRICK_1, SAY_SYLVANAS_KRICK_2, SAY_SYLVANAS_KRICK_3, SAY_TYRANNUS_KRICK_1, SAY_TYRANNUS_KRICK_2, SBSLeaderStartPos, SBSTyrannusStartPos, Unit::SendMeleeAttackStop(), Unit::SendMovementFlagUpdate(), WorldObject::setActive(), Creature::SetCanFly(), ZoneScript::SetData(), Creature::SetDisableGravity(), Object::SetDynamicFlag(), Unit::SetFacingTo(), Unit::SetImmuneToAll(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), SPELL_KRICK_KILL_CREDIT, UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT, and UNIT_STATE_DIED.

Member Data Documentation

◆ events

EventMap boss_krick::boss_krickAI::events

◆ pInstance

InstanceScript* boss_krick::boss_krickAI::pInstance

Referenced by boss_krickAI(), and UpdateAI().