AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_boss_gothik_minion::npc_boss_gothik_minionAI Struct Reference
Inheritance diagram for npc_boss_gothik_minion::npc_boss_gothik_minionAI:
CombatAI CreatureAI UnitAI

Public Member Functions

 npc_boss_gothik_minionAI (Creature *c)
 
bool IsOnSameSide (Unit const *who) const
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *who) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from CombatAI
 CombatAI (Creature *c)
 
void InitializeAI () override
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void JustDied (Unit *killer) override
 
void UpdateAI (uint32 diff) override
 
- 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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
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.
 
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 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
 
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 ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
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

EventMap events
 
bool livingSide
 

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 CombatAI
static int32 Permissible (Creature const *)
 
- 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 CombatAI
EventMap events
 
SpellVct spells
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_boss_gothik_minionAI()

npc_boss_gothik_minion::npc_boss_gothik_minionAI::npc_boss_gothik_minionAI ( Creature c)
inlineexplicit
530 : CombatAI(c)
531 {
533 }
#define IN_LIVE_SIDE(who)
Definition: boss_gothik.cpp:173
Definition: CombatAI.h:40
Creature *const me
Definition: CreatureAI.h:72
bool livingSide
Definition: boss_gothik.cpp:535

References IN_LIVE_SIDE, livingSide, and CreatureAI::me.

Member Function Documentation

◆ DamageTaken()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::DamageTaken ( Unit attacker,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from UnitAI.

575 {
576 if (!attacker || !IsOnSameSide(attacker))
577 {
578 damage = 0;
579 }
580
581 if (!me->IsInCombat())
582 {
583 me->CallForHelp(25.0f);
584 AttackStart(attacker);
585 }
586 }
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition: Creature.cpp:2393
bool IsInCombat() const
Definition: Unit.h:1688
bool IsOnSameSide(Unit const *who) const
Definition: boss_gothik.cpp:536

References UnitAI::AttackStart(), Creature::CallForHelp(), Unit::IsInCombat(), IsOnSameSide(), and CreatureAI::me.

◆ IsOnSameSide()

bool npc_boss_gothik_minion::npc_boss_gothik_minionAI::IsOnSameSide ( Unit const *  who) const
inline
536{ return livingSide == IN_LIVE_SIDE(who); }

References IN_LIVE_SIDE, and livingSide.

Referenced by DamageTaken().

◆ JustDied()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CombatAI.

589 {
590 switch (me->GetEntry())
591 {
594 break;
597 break;
598 case NPC_LIVING_RIDER:
600 break;
601 }
602 }
@ NPC_LIVING_RIDER
Definition: boss_gothik.cpp:79
@ NPC_LIVING_KNIGHT
Definition: boss_gothik.cpp:78
@ NPC_LIVING_TRAINEE
Definition: boss_gothik.cpp:77
@ SPELL_INFORM_LIVING_TRAINEE
Definition: boss_gothik.cpp:49
@ SPELL_INFORM_LIVING_RIDER
Definition: boss_gothik.cpp:51
@ SPELL_INFORM_LIVING_KNIGHT
Definition: boss_gothik.cpp:50
uint32 GetEntry() const
Definition: Object.h:109
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:1169

References Unit::CastSpell(), Object::GetEntry(), CreatureAI::me, NPC_LIVING_KNIGHT, NPC_LIVING_RIDER, NPC_LIVING_TRAINEE, SPELL_INFORM_LIVING_KNIGHT, SPELL_INFORM_LIVING_RIDER, and SPELL_INFORM_LIVING_TRAINEE.

◆ JustEngagedWith()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::JustEngagedWith ( Unit who)
inlineoverridevirtual

Called for reaction when initially engaged.

Parameters
whoWho 'me' Engaged combat with

Reimplemented from CombatAI.

546 {
547 switch (me->GetEntry())
548 {
550 events.ScheduleEvent(EVENT_DEATH_PLAGUE, 3s);
551 break;
552 case NPC_DEAD_TRAINEE:
553 events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 2500ms);
554 break;
556 events.ScheduleEvent(EVENT_SHADOW_MARK, 3s);
557 break;
558 case NPC_DEAD_KNIGHT:
559 events.ScheduleEvent(EVENT_WHIRLWIND, 2s);
560 break;
561 case NPC_LIVING_RIDER:
562 events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 3s);
563 break;
564 case NPC_DEAD_RIDER:
565 events.ScheduleEvent(EVENT_DRAIN_LIFE, 2000ms, 3500ms);
566 events.ScheduleEvent(EVENT_UNHOLY_FRENZY, 5s, 9s);
567 break;
568 case NPC_DEAD_HORSE:
569 events.ScheduleEvent(EVENT_STOMP, 2s, 5s);
570 break;
571 }
572 }
events
Definition: boss_sartura.cpp:43
@ NPC_DEAD_HORSE
Definition: boss_gothik.cpp:82
@ NPC_DEAD_TRAINEE
Definition: boss_gothik.cpp:80
@ NPC_DEAD_RIDER
Definition: boss_gothik.cpp:83
@ NPC_DEAD_KNIGHT
Definition: boss_gothik.cpp:81
@ EVENT_SHADOW_MARK
Definition: boss_gothik.cpp:101
@ EVENT_DRAIN_LIFE
Definition: boss_gothik.cpp:107
@ EVENT_SHADOW_BOLT_VOLLEY
Definition: boss_gothik.cpp:105
@ EVENT_UNHOLY_FRENZY
Definition: boss_gothik.cpp:108
@ EVENT_WHIRLWIND
Definition: boss_gothik.cpp:103
@ EVENT_ARCANE_EXPLOSION
Definition: boss_gothik.cpp:99
@ EVENT_STOMP
Definition: boss_gothik.cpp:110
@ EVENT_DEATH_PLAGUE
Definition: boss_gothik.cpp:97

References EVENT_ARCANE_EXPLOSION, EVENT_DEATH_PLAGUE, EVENT_DRAIN_LIFE, EVENT_SHADOW_BOLT_VOLLEY, EVENT_SHADOW_MARK, EVENT_STOMP, EVENT_UNHOLY_FRENZY, EVENT_WHIRLWIND, Object::GetEntry(), CreatureAI::me, NPC_DEAD_HORSE, NPC_DEAD_KNIGHT, NPC_DEAD_RIDER, NPC_DEAD_TRAINEE, NPC_LIVING_KNIGHT, NPC_LIVING_RIDER, and NPC_LIVING_TRAINEE.

◆ KilledUnit()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

605 {
606 if (who->GetTypeId() == TYPEID_PLAYER && me->GetInstanceScript())
607 {
609 }
610 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ DATA_IMMORTAL_FAIL
Definition: naxxramas.h:73
TypeID GetTypeId() const
Definition: Object.h:121
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References DATA_IMMORTAL_FAIL, WorldObject::GetInstanceScript(), Object::GetTypeId(), CreatureAI::me, ZoneScript::SetData(), and TYPEID_PLAYER.

◆ Reset()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::Reset ( )
inlineoverridevirtual

Reimplemented from CombatAI.

539 {
541 me->SetNoCallAssistance(false);
542 events.Reset();
543 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
void SetReactState(ReactStates st)
Definition: Creature.h:89
void SetNoCallAssistance(bool val)
Definition: Creature.h:259

References CreatureAI::me, REACT_AGGRESSIVE, Creature::SetNoCallAssistance(), and Creature::SetReactState().

◆ UpdateAI()

void npc_boss_gothik_minion::npc_boss_gothik_minionAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from CombatAI.

613 {
614 events.Update(diff);
616 return;
617
618 switch (events.ExecuteEvent())
619 {
622 events.Repeat(4s, 7s);
623 break;
625 if (Unit* victim = me->GetVictim())
626 {
627 if (victim->IsWithinDist(me, 20))
628 {
629 me->CastSpell(victim, SPELL_ARCANE_EXPLOSION, false);
630 }
631 }
632 events.Repeat(2500ms);
633 break;
635 if (Unit* victim = me->GetVictim())
636 {
637 if (!victim->HasAura(SPELL_SHADOW_MARK))
638 {
640 }
641 }
642 events.Repeat(5s, 7s);
643 break;
644 case EVENT_WHIRLWIND:
645 if (Unit* victim = me->GetVictim())
646 {
647 if (victim->IsWithinDist(me, 10))
648 {
649 me->CastSpell(victim, SPELL_WHIRLWIND, false);
650 }
651 }
652 events.Repeat(4s, 6s);
653 break;
656 events.Repeat(5s);
657 break;
658 case EVENT_DRAIN_LIFE:
659 if (Unit* victim = me->GetVictim())
660 {
661 if (victim->IsWithinDist(me, 20))
662 {
663 me->CastSpell(victim, SPELL_DRAIN_LIFE, false);
664 }
665 }
666 events.Repeat(8s, 12s);
667 break;
670 events.Repeat(15s, 17s);
671 break;
672 case EVENT_STOMP:
673 if (Unit* victim = me->GetVictim())
674 {
675 if (victim->IsWithinDist(me, 10))
676 {
677 me->CastSpell(victim, SPELL_STOMP, false);
678 }
679 }
680 events.Repeat(4s, 9s);
681 break;
682 }
684 }
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELL_STOMP
Definition: boss_gothik.cpp:72
@ SPELL_SHADOW_BOLT_VOLLEY
Definition: boss_gothik.cpp:67
@ SPELL_UNHOLY_FRENZY
Definition: boss_gothik.cpp:70
@ SPELL_DEATH_PLAGUE
Definition: boss_gothik.cpp:59
@ SPELL_ARCANE_EXPLOSION
Definition: boss_gothik.cpp:61
@ SPELL_SHADOW_MARK
Definition: boss_gothik.cpp:63
@ SPELL_WHIRLWIND
Definition: boss_gothik.cpp:65
@ SPELL_DRAIN_LIFE
Definition: boss_gothik.cpp:69
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
Definition: Unit.h:1290
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:19031
uint32 GetUnitState() const
Definition: Unit.h:1400
Unit * GetVictim() const
Definition: Unit.h:1386

References Unit::AddAura(), Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), EVENT_ARCANE_EXPLOSION, EVENT_DEATH_PLAGUE, EVENT_DRAIN_LIFE, EVENT_SHADOW_BOLT_VOLLEY, EVENT_SHADOW_MARK, EVENT_STOMP, EVENT_UNHOLY_FRENZY, EVENT_WHIRLWIND, Unit::GetUnitState(), Unit::GetVictim(), CreatureAI::me, SPELL_ARCANE_EXPLOSION, SPELL_DEATH_PLAGUE, SPELL_DRAIN_LIFE, SPELL_SHADOW_BOLT_VOLLEY, SPELL_SHADOW_MARK, SPELL_STOMP, SPELL_UNHOLY_FRENZY, SPELL_WHIRLWIND, and UNIT_STATE_CASTING.

Member Data Documentation

◆ events

EventMap npc_boss_gothik_minion::npc_boss_gothik_minionAI::events

◆ livingSide

bool npc_boss_gothik_minion::npc_boss_gothik_minionAI::livingSide