AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI Struct Reference
Inheritance diagram for npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 npc_infra_green_bomber_genericAI (Creature *creature)
 
UnitGetSummoner ()
 
void IsSummonedBy (Unit *summoner) override
 
void DamageTaken (Unit *who, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void SpreadFire (bool init)
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
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 ================== 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 *)
 
- 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 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)
 
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
 

Private Attributes

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
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_infra_green_bomber_genericAI()

npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::npc_infra_green_bomber_genericAI ( Creature creature)
inline
1283 : NullCreatureAI(creature)
1284 {
1285 events.Reset();
1286 }
events
Definition: boss_sartura.cpp:43
Definition: PassiveAI.h:53
virtual void Reset()
Definition: UnitAI.h:195

References UnitAI::Reset().

Member Function Documentation

◆ DamageTaken()

void npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::DamageTaken ( Unit who,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from UnitAI.

1311 {
1312 if (who != me)
1313 if (me->HealthBelowPct(80) && urand(0, 1))
1314 SpreadFire(true);
1315 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
Creature *const me
Definition: CreatureAI.h:72
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:1443
void SpreadFire(bool init)
Definition: zone_icecrown.cpp:1317

References Unit::HealthBelowPct(), CreatureAI::me, SpreadFire(), and urand().

◆ GetSummoner()

Unit * npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::GetSummoner ( )
inline
1289 {
1290 if (TempSummon* tempSummon = me->ToTempSummon())
1291 return tempSummon->GetSummonerUnit();
1292 return nullptr;
1293 }
Definition: TemporarySummon.h:40
TempSummon * ToTempSummon()
Definition: Unit.h:2396

References CreatureAI::me, and Unit::ToTempSummon().

Referenced by SpreadFire(), and UpdateAI().

◆ IsSummonedBy()

void npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::IsSummonedBy ( Unit summoner)
inlineoverridevirtual

Reimplemented from CreatureAI.

1296 {
1297 if (!summoner)
1298 return;
1299
1300 summoner->CastSpell(summoner, SPELL_WAITING_FOR_A_BOMBER, true);
1301 summoner->CastSpell(summoner, SPELL_FLIGHT_ORDERS, true);
1302 events.ScheduleEvent(EVENT_START_FLIGHT, 0);
1303 events.ScheduleEvent(EVENT_TAKE_PASSENGER, 3000);
1304 me->SetCanFly(true);
1306 me->SetSpeed(MOVE_FLIGHT, 0.1f);
1307 me->SetFaction(summoner->GetFaction());
1308 }
@ MOVEMENTFLAG_FLYING
Definition: Unit.h:577
@ MOVE_FLIGHT
Definition: Unit.h:384
@ SPELL_FLIGHT_ORDERS
Definition: zone_icecrown.cpp:1063
@ EVENT_START_FLIGHT
Definition: zone_icecrown.cpp:1066
@ SPELL_WAITING_FOR_A_BOMBER
Definition: zone_icecrown.cpp:1062
@ EVENT_TAKE_PASSENGER
Definition: zone_icecrown.cpp:1065
bool SetCanFly(bool enable, bool packetOnly=false) override
Definition: Creature.cpp:3149
void SetFaction(uint32 faction)
Definition: Unit.cpp:10017
uint32 GetFaction() const
Definition: Unit.h:1494
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:2268
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
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14301

References Unit::AddUnitMovementFlag(), Unit::CastSpell(), EVENT_START_FLIGHT, EVENT_TAKE_PASSENGER, Unit::GetFaction(), CreatureAI::me, MOVE_FLIGHT, MOVEMENTFLAG_FLYING, Creature::SetCanFly(), Unit::SetFaction(), Unit::SetSpeed(), SPELL_FLIGHT_ORDERS, and SPELL_WAITING_FOR_A_BOMBER.

◆ SpreadFire()

void npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::SpreadFire ( bool  init)
inline
1318 {
1319 Vehicle* kit = me->GetVehicleKit();
1320 if (!kit)
1321 return;
1322
1323 if (Unit* passenger = kit->GetPassenger(SEAT_ENGINEERING))
1324 if (init && !passenger->HasAura(SPELL_BURNING))
1325 {
1326 me->TextEmote("Your Vehicle is burning!", GetSummoner(), true);
1327 passenger->AddAura(SPELL_BURNING, passenger);
1328 }
1329
1330 for (uint8 seat = 3; seat <= 5; ++seat)
1331 if (Unit* banner = kit->GetPassenger(seat))
1332 if (!banner->HasAura(SPELL_COSMETIC_FIRE))
1333 {
1334 banner->AddAura(SPELL_COSMETIC_FIRE, banner);
1335 break;
1336 }
1337 }
std::uint8_t uint8
Definition: Define.h:110
@ SEAT_ENGINEERING
Definition: zone_icecrown.cpp:1073
@ SPELL_BURNING
Definition: zone_icecrown.cpp:1058
@ SPELL_COSMETIC_FIRE
Definition: zone_icecrown.cpp:1059
Definition: Unit.h:1290
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:21177
Vehicle * GetVehicleKit() const
Definition: Unit.h:2349
Definition: Vehicle.h:30
Unit * GetPassenger(int8 seatId) const
Definition: Vehicle.cpp:226
Unit * GetSummoner()
Definition: zone_icecrown.cpp:1288

References Vehicle::GetPassenger(), GetSummoner(), Unit::GetVehicleKit(), CreatureAI::me, SEAT_ENGINEERING, SPELL_BURNING, SPELL_COSMETIC_FIRE, and Unit::TextEmote().

Referenced by DamageTaken().

◆ UpdateAI()

void npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from NullCreatureAI.

1340 {
1341 events.Update(diff);
1342 uint32 eventId = events.ExecuteEvent();
1343 switch (eventId)
1344 {
1346 if (Unit* owner = GetSummoner())
1347 if (Vehicle* kit = me->GetVehicleKit())
1348 if (Unit* turret = kit->GetPassenger(SEAT_TURRET))
1349 {
1350 me->SetSpeed(MOVE_FLIGHT, 1.2f);
1351 owner->RemoveAurasDueToSpell(SPELL_WAITING_FOR_A_BOMBER);
1352 turret->HandleSpellClick(owner, 0);
1353 return;
1354 }
1356 break;
1357 case EVENT_START_FLIGHT:
1358 {
1359 WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry());
1360 if (!path || path->empty())
1361 {
1363 return;
1364 }
1365
1366 Movement::PointsArray pathPoints;
1367 pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1368
1369 uint32 wpCounter = 1;
1370 WPPath::const_iterator itr;
1371 while ((itr = path->find(wpCounter++)) != path->end())
1372 {
1373 WayPoint* wp = itr->second;
1374 pathPoints.push_back(G3D::Vector3(wp->x, wp->y, wp->z));
1375 }
1376
1377 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
1379 events.ScheduleEvent(EVENT_SYNCHRONIZE_SHIELDS, 5000);
1380 break;
1381 }
1383 {
1384 // Check if path is finished
1386 {
1388 return;
1389 }
1390
1391 // Check fire count
1392 uint8 fireCount = 0;
1393 if (Vehicle* kit = me->GetVehicleKit())
1394 for (uint8 seat = 3; seat <= 5; ++seat)
1395 if (Unit* banner = kit->GetPassenger(seat))
1396 if (banner->HasAura(SPELL_COSMETIC_FIRE))
1397 fireCount++;
1398
1399 if (fireCount)
1400 Unit::DealDamage(me, me, 3000 * fireCount, nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FIRE);
1401 else // Heal
1402 me->ModifyHealth(2000);
1403
1405 break;
1406 }
1408 if (Vehicle* kit = me->GetVehicleKit())
1409 {
1410 // Xinef: check if we have player on any of the stations
1411 bool playerPresent = false;
1413 for (uint8 i = SEAT_BOMBER; i <= SEAT_ENGINEERING; ++i)
1414 if (Unit* station = kit->GetPassenger(i))
1415 {
1416 if (Vehicle* stationKit = station->GetVehicleKit())
1417 if (stationKit->GetPassenger(0))
1418 playerPresent = true;
1419
1420 if (stackAmount)
1421 station->SetAuraStack(SPELL_INFRA_GREEN_SHIELD, station, stackAmount);
1422 else
1423 station->RemoveAurasDueToSpell(SPELL_INFRA_GREEN_SHIELD);
1424 }
1425 if (!playerPresent)
1427 }
1428 events.ScheduleEvent(EVENT_SYNCHRONIZE_SHIELDS, 1000);
1429 break;
1430 case EVENT_SPREAD_FIRE:
1431 break;
1432 }
1433 }
std::uint32_t uint32
Definition: Define.h:108
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2032
std::unordered_map< uint32, WayPoint * > WPPath
Definition: SmartScriptMgr.h:1796
@ DIRECT_DAMAGE
Definition: Unit.h:435
@ ESCORT_MOTION_TYPE
Definition: MotionMaster.h:55
@ SEAT_TURRET
Definition: zone_icecrown.cpp:1072
@ EVENT_SPREAD_FIRE
Definition: zone_icecrown.cpp:1069
@ SEAT_BOMBER
Definition: zone_icecrown.cpp:1071
@ EVENT_CHECK_PATH_REGEN_HEALTH_BURN_DAMAGE
Definition: zone_icecrown.cpp:1067
@ EVENT_SYNCHRONIZE_SHIELDS
Definition: zone_icecrown.cpp:1068
@ SPELL_INFRA_GREEN_SHIELD
Definition: zone_icecrown.cpp:1056
@ SPELL_SCHOOL_MASK_FIRE
Definition: SharedDefines.h:271
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Definition: SmartScriptMgr.h:33
float z
Definition: SmartScriptMgr.h:47
float y
Definition: SmartScriptMgr.h:46
float x
Definition: SmartScriptMgr.h:45
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2092
uint32 GetEntry() const
Definition: Object.h:109
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:13981
MotionMaster * GetMotionMaster()
Definition: Unit.h:2258
uint32 GetAuraCount(uint32 spellId) const
Definition: Unit.cpp:5582
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false, Spell const *spell=nullptr)
Definition: Unit.cpp:814
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:817
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:409

References Unit::DealDamage(), Creature::DespawnOrUnsummon(), DIRECT_DAMAGE, ESCORT_MOTION_TYPE, EVENT_CHECK_PATH_REGEN_HEALTH_BURN_DAMAGE, EVENT_SPREAD_FIRE, EVENT_START_FLIGHT, EVENT_SYNCHRONIZE_SHIELDS, EVENT_TAKE_PASSENGER, Unit::GetAuraCount(), MotionMaster::GetCurrentMovementGeneratorType(), Object::GetEntry(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GetSummoner(), Unit::GetVehicleKit(), CreatureAI::me, Unit::ModifyHealth(), MOVE_FLIGHT, MotionMaster::MoveSplinePath(), SEAT_BOMBER, SEAT_ENGINEERING, SEAT_TURRET, Unit::SetSpeed(), SPELL_COSMETIC_FIRE, SPELL_INFRA_GREEN_SHIELD, SPELL_SCHOOL_MASK_FIRE, SPELL_WAITING_FOR_A_BOMBER, sSmartWaypointMgr, WayPoint::x, WayPoint::y, and WayPoint::z.

Member Data Documentation

◆ events

EventMap npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI::events
private