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

Public Member Functions

 npc_halion_controllerAI (Creature *creature)
 
void Reset () override
 
void SetData (uint32 id, uint32 value) override
 
void DoAction (int32 action) 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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast. More...
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list. More...
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim. More...
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished. More...
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Member Functions

void UpdateCorporeality ()
 

Private Attributes

EventMap _events
 
InstanceScript_instance
 
uint8 _corporeality
 
uint32 _materialDamage
 
uint32 _twilightDamage
 

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

◆ npc_halion_controllerAI()

npc_halion_controller::npc_halion_controllerAI::npc_halion_controllerAI ( Creature creature)
inline
588 : NullCreatureAI(creature), _instance(creature->GetInstanceScript())
589 {
590 }
Definition: PassiveAI.h:53
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
InstanceScript * _instance
Definition: boss_halion.cpp:737

Member Function Documentation

◆ DoAction()

void npc_halion_controller::npc_halion_controllerAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

609 {
610 if (action == ACTION_INTRO_HALION)
612 else if (action == ACTION_CHECK_CORPOREALITY)
613 {
614 _materialDamage = 1;
615 _twilightDamage = 1;
616 _corporeality = 5;
618 }
619 else if (action == ACTION_RESET_ENCOUNTER)
620 {
621 _events.Reset();
622 _materialDamage = 1;
623 _twilightDamage = 1;
624 _corporeality = 5;
625 }
626 }
@ ACTION_RESET_ENCOUNTER
Definition: boss_halion.cpp:156
@ ACTION_CHECK_CORPOREALITY
Definition: boss_halion.cpp:155
@ EVENT_START_INTRO
Definition: boss_halion.cpp:145
@ EVENT_CHECK_CORPOREALITY
Definition: boss_halion.cpp:140
@ ACTION_INTRO_HALION
Definition: ruby_sanctum.h:47
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void Reset()
Definition: EventMap.cpp:21
uint32 _twilightDamage
Definition: boss_halion.cpp:740
uint8 _corporeality
Definition: boss_halion.cpp:738
EventMap _events
Definition: boss_halion.cpp:736
uint32 _materialDamage
Definition: boss_halion.cpp:739

References _corporeality, _events, _materialDamage, _twilightDamage, ACTION_CHECK_CORPOREALITY, ACTION_INTRO_HALION, ACTION_RESET_ENCOUNTER, EVENT_CHECK_CORPOREALITY, EVENT_START_INTRO, EventMap::Reset(), and EventMap::ScheduleEvent().

Referenced by UpdateCorporeality().

◆ Reset()

void npc_halion_controller::npc_halion_controllerAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

593 {
594 _events.Reset();
595 }

References _events, and EventMap::Reset().

◆ SetData()

void npc_halion_controller::npc_halion_controllerAI::SetData ( uint32  id,
uint32  value 
)
inlineoverridevirtual

Reimplemented from UnitAI.

598 {
600 return;
601
603 _materialDamage += value;
604 else
605 _twilightDamage += value;
606 }
@ DATA_MATERIAL_DAMAGE_TAKEN
Definition: boss_halion.cpp:159
uint32 GetNextEventTime(uint32 eventId) const
Definition: EventMap.cpp:230

References _events, _materialDamage, _twilightDamage, DATA_MATERIAL_DAMAGE_TAKEN, EVENT_CHECK_CORPOREALITY, and EventMap::GetNextEventTime().

◆ UpdateAI()

void npc_halion_controller::npc_halion_controllerAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from NullCreatureAI.

629 {
630 _events.Update(diff);
631 switch (_events.ExecuteEvent())
632 {
633 // Intro
637 break;
642 break;
647 break;
653 break;
656 {
657 halion->SetVisible(true);
658 halion->SetReactState(REACT_AGGRESSIVE);
659 halion->AI()->Talk(SAY_INTRO);
660 }
661 break;
663 me->CastSpell((Unit*)nullptr, SPELL_TWILIGHT_MENDING, true);
664 break;
668 break;
669 }
670 }
@ SPELL_COSMETIC_FIRE_PILLAR
Definition: boss_halion.cpp:105
@ SPELL_TWILIGHT_MENDING
Definition: boss_halion.cpp:116
@ SPELL_FIERY_EXPLOSION
Definition: boss_halion.cpp:106
@ SAY_INTRO
Definition: boss_halion.cpp:37
@ EVENT_TWILIGHT_MENDING
Definition: boss_halion.cpp:141
@ EVENT_INTRO_PROGRESS_1
Definition: boss_halion.cpp:146
@ EVENT_INTRO_PROGRESS_2
Definition: boss_halion.cpp:147
@ EVENT_INTRO_PROGRESS_3
Definition: boss_halion.cpp:148
@ EVENT_INTRO_PROGRESS_4
Definition: boss_halion.cpp:149
@ NPC_HALION
Definition: ruby_sanctum.h:66
@ DATA_HALION_INTRO_DONE
Definition: ruby_sanctum.h:35
@ DATA_HALION_INTRO1
Definition: ruby_sanctum.h:33
@ DATA_HALION_INTRO2
Definition: ruby_sanctum.h:34
@ DONE
Definition: InstanceScript.h:60
@ NOT_STARTED
Definition: InstanceScript.h:57
@ REACT_AGGRESSIVE
Definition: Unit.h:550
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
Creature *const me
Definition: CreatureAI.h:72
Definition: Creature.h:43
Definition: Unit.h:630
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:373
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
void UpdateCorporeality()
Definition: boss_halion.cpp:673

References _events, _instance, Unit::CastSpell(), DATA_HALION_INTRO1, DATA_HALION_INTRO2, DATA_HALION_INTRO_DONE, DONE, EVENT_CHECK_CORPOREALITY, EVENT_INTRO_PROGRESS_1, EVENT_INTRO_PROGRESS_2, EVENT_INTRO_PROGRESS_3, EVENT_INTRO_PROGRESS_4, EVENT_START_INTRO, EVENT_TWILIGHT_MENDING, EventMap::ExecuteEvent(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), CreatureAI::me, NOT_STARTED, NPC_HALION, REACT_AGGRESSIVE, SAY_INTRO, EventMap::ScheduleEvent(), InstanceScript::SetBossState(), SPELL_COSMETIC_FIRE_PILLAR, SPELL_FIERY_EXPLOSION, SPELL_TWILIGHT_MENDING, EventMap::Update(), and UpdateCorporeality().

◆ UpdateCorporeality()

void npc_halion_controller::npc_halion_controllerAI::UpdateCorporeality ( )
inlineprivate
674 {
676 {
678 return;
679 }
680
681 uint8 oldValue = _corporeality;
682 float damageRatio = float(_materialDamage) / float(_twilightDamage);
683
684 if (_twilightDamage == 1 || _materialDamage == 1)
686
687 _twilightDamage = 1;
688 _materialDamage = 1;
689
691 if (damageRatio < 0.98f)
692 action = CORPOREALITY_INCREASE;
693 else if (1.02f < damageRatio)
694 action = CORPOREALITY_DECREASE;
695 else
696 return;
697
698 switch (action)
699 {
701 {
703 return;
705 break;
706 }
708 {
709 if (_corporeality == 0)
710 return;
712 break;
713 }
714 default:
715 break;
716 }
717
720
722 {
723 twilightHalion->RemoveAurasDueToSpell(_corporealityReference[MAX_CORPOREALITY_STATE - 1 - oldValue]);
724 twilightHalion->CastSpell(twilightHalion, _corporealityReference[MAX_CORPOREALITY_STATE - 1 - _corporeality], true);
725 twilightHalion->AI()->Talk(oldValue < _corporeality ? EMOTE_CORPOREALITY_TOT : EMOTE_CORPOREALITY_TIT);
726 }
727
729 {
730 halion->RemoveAurasDueToSpell(_corporealityReference[oldValue]);
731 halion->CastSpell(halion, _corporealityReference[_corporeality], true);
732 halion->AI()->Talk(oldValue > _corporeality ? EMOTE_CORPOREALITY_POT : EMOTE_CORPOREALITY_PIP);
733 }
734 }
std::uint8_t uint8
Definition: Define.h:109
uint32 const _corporealityReference[MAX_CORPOREALITY_STATE]
Definition: boss_halion.cpp:176
@ EMOTE_CORPOREALITY_TOT
Definition: boss_halion.cpp:51
@ EMOTE_CORPOREALITY_PIP
Definition: boss_halion.cpp:45
@ EMOTE_CORPOREALITY_POT
Definition: boss_halion.cpp:44
@ EMOTE_CORPOREALITY_TIT
Definition: boss_halion.cpp:50
CorporealityEvent
Definition: boss_halion.cpp:168
@ MAX_CORPOREALITY_STATE
Definition: boss_halion.cpp:173
@ CORPOREALITY_DECREASE
Definition: boss_halion.cpp:172
@ CORPOREALITY_INCREASE
Definition: boss_halion.cpp:171
@ CORPOREALITY_NONE
Definition: boss_halion.cpp:169
@ NPC_TWILIGHT_HALION
Definition: ruby_sanctum.h:67
@ WORLDSTATE_CORPOREALITY_MATERIAL
Definition: ruby_sanctum.h:100
@ WORLDSTATE_CORPOREALITY_TWILIGHT
Definition: ruby_sanctum.h:101
virtual bool IsEncounterInProgress() const
Definition: InstanceScript.cpp:125
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition: InstanceScript.cpp:603
void DoAction(int32 action) override
Definition: boss_halion.cpp:608

References _corporeality, _corporealityReference, _events, _instance, _materialDamage, _twilightDamage, ACTION_RESET_ENCOUNTER, CORPOREALITY_DECREASE, CORPOREALITY_INCREASE, CORPOREALITY_NONE, DoAction(), InstanceScript::DoUpdateWorldState(), EMOTE_CORPOREALITY_PIP, EMOTE_CORPOREALITY_POT, EMOTE_CORPOREALITY_TIT, EMOTE_CORPOREALITY_TOT, EVENT_TWILIGHT_MENDING, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), InstanceScript::IsEncounterInProgress(), MAX_CORPOREALITY_STATE, CreatureAI::me, NPC_HALION, NPC_TWILIGHT_HALION, EventMap::ScheduleEvent(), WORLDSTATE_CORPOREALITY_MATERIAL, and WORLDSTATE_CORPOREALITY_TWILIGHT.

Referenced by UpdateAI().

Member Data Documentation

◆ _corporeality

uint8 npc_halion_controller::npc_halion_controllerAI::_corporeality
private

Referenced by DoAction(), and UpdateCorporeality().

◆ _events

EventMap npc_halion_controller::npc_halion_controllerAI::_events
private

◆ _instance

InstanceScript* npc_halion_controller::npc_halion_controllerAI::_instance
private

Referenced by UpdateAI(), and UpdateCorporeality().

◆ _materialDamage

uint32 npc_halion_controller::npc_halion_controllerAI::_materialDamage
private

◆ _twilightDamage

uint32 npc_halion_controller::npc_halion_controllerAI::_twilightDamage
private