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

Public Member Functions

 npc_strangulate_vehicleAI (Creature *creature)
 
void IsSummonedBy (WorldObject *summoner) override
 
bool IsHeroic ()
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
void PassengerBoarded (Unit *pass, int8, bool apply) override
 == Fields =======================================
 
void DoAction (int32 action) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- 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()
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
- 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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 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 JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
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)
 
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 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 InitializeAI ()
 
virtual void Reset ()
 
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:
 
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.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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.
 
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.
 
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.
 
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.
 
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
 
InstanceScript_instance
 

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

npc_strangulate_vehicle::npc_strangulate_vehicleAI::npc_strangulate_vehicleAI ( Creature creature)
inline
2933: NullCreatureAI(creature), _instance(creature->GetInstanceScript()) {}
Definition PassiveAI.h:53
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
InstanceScript * _instance
Definition boss_the_lich_king.cpp:2936

Member Function Documentation

◆ DoAction()

void npc_strangulate_vehicle::npc_strangulate_vehicleAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

2977 {
2978 if (action != ACTION_TELEPORT_BACK)
2979 return;
2980
2981 if (TempSummon* summ = me->ToTempSummon())
2982 {
2983 if (Unit* summoner = summ->GetSummonerUnit())
2984 {
2985 bool buff = _instance->GetBossState(DATA_THE_LICH_KING) == IN_PROGRESS && summoner->IsPlayer() && (!summoner->IsAlive() || summoner->ToPlayer()->IsBeingTeleported() || summoner->FindMap() != me->GetMap());
2986 if (summoner->IsPlayer() && !summoner->ToPlayer()->IsBeingTeleported() && summoner->FindMap() == me->GetMap())
2987 {
2988 if (buff)
2989 summoner->CastSpell((Unit*)nullptr, SPELL_HARVESTED_SOUL_LK_BUFF, true, nullptr, nullptr, _instance->GetGuidData(DATA_THE_LICH_KING));
2990
2992 }
2993 else if (buff)
2995
2996 summoner->RemoveAurasDueToSpell(IsHeroic() ? SPELL_HARVEST_SOULS_TELEPORT : SPELL_HARVEST_SOUL_TELEPORT);
2997 }
2998 else
3000 }
3001
3002 _events.Reset();
3003 me->RemoveAllAuras();
3004 me->DespawnOrUnsummon(500);
3005
3007 lichKing->AI()->SummonedCreatureDespawn(me);
3008 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ ACTION_TELEPORT_BACK
Definition boss_the_lich_king.cpp:343
@ SPELL_HARVESTED_SOUL_LK_BUFF
Definition boss_the_lich_king.cpp:164
@ SPELL_HARVEST_SOUL_TELEPORT
Definition boss_the_lich_king.cpp:161
@ SPELL_HARVEST_SOULS_TELEPORT
Definition boss_the_lich_king.cpp:166
@ SPELL_HARVEST_SOUL_TELEPORT_BACK
Definition boss_the_lich_king.cpp:162
Creature *const me
Definition CreatureAI.h:72
Definition Creature.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183
void Reset()
Definition EventMap.cpp:21
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:242
Definition TemporarySummon.h:40
Definition Unit.h:636
TempSummon * ToTempSummon()
Definition Unit.h:702
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:1178
void RemoveAllAuras()
Definition Unit.cpp:5351
Map * GetMap() const
Definition Object.h:536
@ DATA_THE_LICH_KING
Definition icecrown_citadel.h:98
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210
EventMap _events
Definition boss_the_lich_king.cpp:2935
bool IsHeroic()
Definition boss_the_lich_king.cpp:2968

References _events, _instance, ACTION_TELEPORT_BACK, Unit::CastSpell(), DATA_THE_LICH_KING, Creature::DespawnOrUnsummon(), InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), WorldObject::GetMap(), IN_PROGRESS, IsHeroic(), CreatureAI::me, Unit::RemoveAllAuras(), EventMap::Reset(), SPELL_HARVEST_SOUL_TELEPORT, SPELL_HARVEST_SOUL_TELEPORT_BACK, SPELL_HARVEST_SOULS_TELEPORT, SPELL_HARVESTED_SOUL_LK_BUFF, and Unit::ToTempSummon().

◆ IsHeroic()

bool npc_strangulate_vehicle::npc_strangulate_vehicleAI::IsHeroic ( )
inline
2968{ return me->GetMap()->IsHeroic(); }
bool IsHeroic() const
Definition Map.h:299

References WorldObject::GetMap(), Map::IsHeroic(), and CreatureAI::me.

Referenced by DoAction(), and UpdateAI().

◆ IsSummonedBy()

void npc_strangulate_vehicle::npc_strangulate_vehicleAI::IsSummonedBy ( WorldObject summoner)
inlineoverridevirtual

Reimplemented from CreatureAI.

2939 {
2940 if (!summoner)
2941 return;
2942
2944 {
2945 me->SetWalk(false);
2947 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
2948 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), 843.0f));
2950
2951 ObjectGuid petGUID = summoner->ToUnit()->GetPetGUID();
2952 summoner->ToUnit()->SetPetGUID(ObjectGuid::Empty);
2953 summoner->ToUnit()->StopMoving();
2954 me->CastSpell(summoner->ToUnit(), SPELL_HARVEST_SOUL_VEHICLE, true);
2955 //summoner->ClearUnitState(UNIT_STATE_ONVEHICLE);
2956 summoner->ToUnit()->SendMovementFlagUpdate(true);
2957 summoner->ToUnit()->SetPetGUID(petGUID);
2958 _events.Reset();
2962
2963 // this will let us easily access all creatures of this entry on heroic mode when its time to teleport back
2964 lichKing->AI()->JustSummoned(me);
2965 }
2966 }
@ SPELL_HARVEST_SOUL_VEHICLE
Definition boss_the_lich_king.cpp:159
@ EVENT_MOVE_TO_LICH_KING
Definition boss_the_lich_king.cpp:279
@ EVENT_TELEPORT
Definition boss_the_lich_king.cpp:278
@ EVENT_DESPAWN_SELF
Definition boss_the_lich_king.cpp:280
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3208
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition EventMap.cpp:56
void MoveSplinePath(Movement::PointsArray *path)
Definition MotionMaster.cpp:454
Definition ObjectGuid.h:118
static ObjectGuid const Empty
Definition ObjectGuid.h:120
Unit * ToUnit()
Definition Object.h:209
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
void StopMoving()
Definition Unit.cpp:16702
void SendMovementFlagUpdate(bool self=false)
Definition Unit.cpp:16756
void SetPetGUID(ObjectGuid guid)
Definition Unit.h:693
ObjectGuid GetPetGUID() const
Definition Unit.h:694
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References _events, _instance, Unit::CastSpell(), DATA_THE_LICH_KING, ObjectGuid::Empty, EVENT_DESPAWN_SELF, EVENT_MOVE_TO_LICH_KING, EVENT_TELEPORT, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Unit::GetPetGUID(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), CreatureAI::me, MotionMaster::MoveSplinePath(), EventMap::Reset(), EventMap::ScheduleEvent(), Unit::SendMovementFlagUpdate(), Unit::SetPetGUID(), Creature::SetWalk(), SPELL_HARVEST_SOUL_VEHICLE, Unit::StopMoving(), and Object::ToUnit().

◆ OnCharmed()

void npc_strangulate_vehicle::npc_strangulate_vehicleAI::OnCharmed ( bool  apply)
inlineoverridevirtual

Called when unit is charmed.

Reimplemented from CreatureAI.

2969{}

◆ PassengerBoarded()

void npc_strangulate_vehicle::npc_strangulate_vehicleAI::PassengerBoarded ( Unit ,
int8  ,
bool   
)
inlineoverridevirtual

== Fields =======================================

Reimplemented from CreatureAI.

2971 {
2972 if (!apply)
2973 pass->RemoveAurasDueToSpell(VEHICLE_SPELL_PARACHUTE);
2974 }
@ VEHICLE_SPELL_PARACHUTE
Definition VehicleDefines.h:53

References Unit::RemoveAurasDueToSpell(), and VEHICLE_SPELL_PARACHUTE.

◆ UpdateAI()

void npc_strangulate_vehicle::npc_strangulate_vehicleAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

3011 {
3012 _events.Update(diff);
3013
3014 switch (_events.ExecuteEvent())
3015 {
3016 case EVENT_TELEPORT:
3017 me->GetMotionMaster()->Clear(false);
3019 if (TempSummon* summ = me->ToTempSummon())
3020 if (Unit* summoner = summ->GetSummonerUnit())
3021 {
3022 if (summoner->IsAlive() && summoner->IsPlayer())
3023 {
3024 summoner->CastSpell((Unit*)nullptr, SPELL_HARVEST_SOUL_VISUAL, true);
3025 summoner->ExitVehicle(summoner);
3026 me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 840.87f, me->GetOrientation(), true);
3028 if (!IsHeroic())
3029 summoner->CastSpell(summoner, SPELL_HARVEST_SOUL_TELEPORT, true);
3030 else
3031 summoner->CastSpell(summoner, SPELL_HARVEST_SOULS_TELEPORT, true);
3032 }
3033 else
3034 {
3035 summoner->ExitVehicle(summoner);
3037 }
3038 }
3039 break;
3042 if (me->GetExactDist(lichKing) > 8.0f)
3043 {
3044 float dist = float(rand_norm()) * 5.0f + 8.0f;
3045 float angle = lichKing->GetAngle(me);
3047 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
3048 path.push_back(G3D::Vector3(lichKing->GetPositionX() + dist * cos(angle), lichKing->GetPositionY() + dist * std::sin(angle), 843.0f));
3050 }
3051 break;
3052 case EVENT_DESPAWN_SELF:
3054 lichKing->AI()->SummonedCreatureDespawn(me);
3056 break;
3057 default:
3058 break;
3059 }
3060 }
double rand_norm()
Definition Random.cpp:77
@ SPELL_HARVEST_SOUL_VISUAL
Definition boss_the_lich_king.cpp:160
uint32 ExecuteEvent()
Definition EventMap.cpp:114
void Update(uint32 time)
Definition EventMap.h:54
void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId=0, uint32 phase=0)
Definition EventMap.cpp:81
void MoveIdle()
Definition MotionMaster.cpp:232
void Clear(bool reset=true)
Definition MotionMaster.h:167
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:20077
void StopMovingOnCurrentPos()
Definition Unit.cpp:16741
float GetExactDist(float x, float y, float z) const
Definition Position.h:182
float GetOrientation() const
Definition Position.h:124

References _events, _instance, MotionMaster::Clear(), DATA_THE_LICH_KING, Creature::DespawnOrUnsummon(), EVENT_DESPAWN_SELF, EVENT_MOVE_TO_LICH_KING, EVENT_TELEPORT, EventMap::ExecuteEvent(), ObjectAccessor::GetCreature(), Position::GetExactDist(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), IsHeroic(), CreatureAI::me, MotionMaster::MoveIdle(), MotionMaster::MoveSplinePath(), rand_norm(), EventMap::RescheduleEvent(), SPELL_HARVEST_SOUL_TELEPORT, SPELL_HARVEST_SOUL_VISUAL, SPELL_HARVEST_SOULS_TELEPORT, Unit::StopMovingOnCurrentPos(), Unit::ToTempSummon(), EventMap::Update(), and Unit::UpdatePosition().

Member Data Documentation

◆ _events

EventMap npc_strangulate_vehicle::npc_strangulate_vehicleAI::_events

Referenced by DoAction(), IsSummonedBy(), and UpdateAI().

◆ _instance

InstanceScript* npc_strangulate_vehicle::npc_strangulate_vehicleAI::_instance

Referenced by DoAction(), IsSummonedBy(), and UpdateAI().


The documentation for this struct was generated from the following file: