AzerothCore 3.3.5a
OpenSource WoW Emulator
No Matches
npc_vics_flying_machine::npc_vics_flying_machineAI Struct Reference
Inheritance diagram for npc_vics_flying_machine::npc_vics_flying_machineAI:
VehicleAI CreatureAI UnitAI

Public Member Functions

 npc_vics_flying_machineAI (Creature *creature)
void PassengerBoarded (Unit *passenger, int8, bool apply) override
 == Fields =======================================
void MovementInform (uint32 type, uint32) override
void SpellHit (Unit *, SpellInfo const *spell) override
- Public Member Functions inherited from VehicleAI
 VehicleAI (Creature *creature)
void UpdateAI (uint32 diff) override
void MoveInLineOfSight (Unit *) override
void AttackStart (Unit *) override
void OnCharmed (bool apply) 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

uint8 pointId

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason {
- Static Public Member Functions inherited from VehicleAI
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
CreatureBoundary const * _boundary
bool _negateBoundary
- Protected Attributes inherited from UnitAI
Unit *const me

Detailed Description

Constructor & Destructor Documentation

◆ npc_vics_flying_machineAI()

npc_vics_flying_machine::npc_vics_flying_machineAI::npc_vics_flying_machineAI ( Creature creature)
1356 : VehicleAI(creature)
1357 {
1358 pointId = 0;
1359 }
Definition: CombatAI.h:99
uint8 pointId
Definition: zone_sholazar_basin.cpp:1361

References pointId.

Member Function Documentation

◆ MovementInform()

void npc_vics_flying_machine::npc_vics_flying_machineAI::MovementInform ( uint32  type,

Reimplemented from CreatureAI.

1382 {
1383 if (type != ESCORT_MOTION_TYPE)
1384 return;
1386 if (Vehicle* veh = me->GetVehicleKit())
1387 if (Unit* pilot = veh->GetPassenger(0))
1388 switch (pointId)
1389 {
1390 case 5:
1391 pilot->ToCreature()->AI()->Talk(VIC_SAY_0);
1392 break;
1393 case 11:
1394 pilot->ToCreature()->AI()->Talk(VIC_SAY_1);
1395 break;
1396 case 12:
1397 pilot->ToCreature()->AI()->Talk(VIC_SAY_2);
1398 break;
1399 case 14:
1400 pilot->ToCreature()->AI()->Talk(VIC_SAY_3);
1401 break;
1402 case 15:
1403 pilot->ToCreature()->ToCreature()->AI()->Talk(VIC_SAY_4);
1404 break;
1405 case 17:
1406 pilot->ToCreature()->AI()->Talk(VIC_SAY_5);
1407 break;
1408 case 21:
1409 pilot->ToCreature()->AI()->Talk(VIC_SAY_6);
1410 break;
1411 case 25:
1415 break;
1416 }
1417 pointId++;
1418 }
Definition: Unit.h:494
Definition: MotionMaster.h:55
Definition: zone_sholazar_basin.cpp:1335
Definition: zone_sholazar_basin.cpp:1341
Definition: zone_sholazar_basin.cpp:1340
Definition: zone_sholazar_basin.cpp:1339
Definition: zone_sholazar_basin.cpp:1343
Definition: zone_sholazar_basin.cpp:1336
Definition: zone_sholazar_basin.cpp:1338
Definition: zone_sholazar_basin.cpp:1337
Definition: zone_sholazar_basin.cpp:1334
Definition: boss_fathomlord_karathress.cpp:23
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:178
Creature *const me
Definition: CreatureAI.h:72
Definition: Unit.h:1302
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1499
Vehicle * GetVehicleKit() const
Definition: Unit.h:2365
Definition: Vehicle.h:30

References AURA_ENGINE, UnitAI::DoCast(), ESCORT_MOTION_TYPE, Unit::GetVehicleKit(), CreatureAI::me, PLANE_EMOTE, pointId, Unit::SetUnitFlag2(), UNIT_FLAG2_FORCE_MOVEMENT, VIC_SAY_0, VIC_SAY_1, VIC_SAY_2, VIC_SAY_3, VIC_SAY_4, VIC_SAY_5, and VIC_SAY_6.

◆ PassengerBoarded()

void npc_vics_flying_machine::npc_vics_flying_machineAI::PassengerBoarded ( Unit ,
int8  ,

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

Reimplemented from CreatureAI.

1364 {
1365 if (apply && passenger->GetTypeId() == TYPEID_PLAYER)
1366 {
1367 Movement::PointsArray pathPoints;
1368 pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1370 WaypointPath const* i_path = sWaypointMgr->GetPath(NPC_PLANE);
1371 for (uint8 i = 0; i < i_path->size(); ++i)
1372 {
1373 WaypointData const* node = i_path->at(i);
1374 pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z));
1375 }
1377 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
1378 }
1379 }
std::uint8_t uint8
Definition: Define.h:110
Definition: ObjectGuid.h:38
std::vector< WaypointData * > WaypointPath
Definition: WaypointMgr.h:46
#define sWaypointMgr
Definition: WaypointMgr.h:77
Definition: zone_sholazar_basin.cpp:1331
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2274
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:435
Definition: WaypointMgr.h:36
float z
Definition: WaypointMgr.h:38
float x
Definition: WaypointMgr.h:38
float y
Definition: WaypointMgr.h:38

References Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Object::GetTypeId(), CreatureAI::me, MotionMaster::MoveSplinePath(), NPC_PLANE, sWaypointMgr, TYPEID_PLAYER, WaypointData::x, WaypointData::y, and WaypointData::z.

◆ SpellHit()

void npc_vics_flying_machine::npc_vics_flying_machineAI::SpellHit ( Unit ,
SpellInfo const *  spell 

Reimplemented from CreatureAI.

1421 {
1422 if (spell->Id == SPELL_LAND)
1423 {
1424 Unit* passenger = me->GetVehicleKit()->GetPassenger(1); // player should be on seat 1
1425 if (passenger && passenger->GetTypeId() == TYPEID_PLAYER)
1426 passenger->CastSpell(passenger, SPELL_CREDIT, true);
1429 }
1430 }
Definition: zone_sholazar_basin.cpp:1346
Definition: zone_sholazar_basin.cpp:1345
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2108
TypeID GetTypeId() const
Definition: Object.h:121
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
Unit * GetPassenger(int8 seatId) const
Definition: Vehicle.cpp:226

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), Vehicle::GetPassenger(), Object::GetTypeId(), Unit::GetVehicleKit(), SpellInfo::Id, CreatureAI::me, SPELL_CREDIT, SPELL_LAND, and TYPEID_PLAYER.

Member Data Documentation

◆ pointId

uint8 npc_vics_flying_machine::npc_vics_flying_machineAI::pointId