AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
FlameLeviathanPursuedTargetSelector Class Reference

Public Member Functions

 FlameLeviathanPursuedTargetSelector ()
 
bool operator() (WorldObject *target) const
 

Private Types

enum  Area { AREA_FORMATION_GROUNDS = 4652 }
 

Detailed Description

Member Enumeration Documentation

◆ Area

Enumerator
AREA_FORMATION_GROUNDS 
1579 {
1581 };
@ AREA_FORMATION_GROUNDS
Definition: boss_flame_leviathan.cpp:1580

Constructor & Destructor Documentation

◆ FlameLeviathanPursuedTargetSelector()

FlameLeviathanPursuedTargetSelector::FlameLeviathanPursuedTargetSelector ( )
inlineexplicit
1584{};

Member Function Documentation

◆ operator()()

bool FlameLeviathanPursuedTargetSelector::operator() ( WorldObject target) const
inline

No players, only vehicles (todo: check if blizzlike)

NPC entries must match

NPC must be a valid vehicle installation

Entity needs to be in appropriate area

Vehicle must be in use by player

1587 {
1589 Creature* creatureTarget = target->ToCreature();
1590 if (!creatureTarget)
1591 return true;
1592
1594 if (creatureTarget->GetEntry() != NPC_SALVAGED_DEMOLISHER && creatureTarget->GetEntry() != NPC_SALVAGED_SIEGE_ENGINE)
1595 return true;
1596
1598 Vehicle* vehicle = creatureTarget->GetVehicleKit();
1599 if (!vehicle)
1600 return true;
1601
1603 if (target->GetAreaId() != AREA_FORMATION_GROUNDS)
1604 return true;
1605
1607 bool playerFound = false;
1608 for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end() && !playerFound; ++itr)
1609 if (itr->second.Passenger.Guid.IsPlayer())
1610 playerFound = true;
1611
1612 return !playerFound;
1613 }
@ NPC_SALVAGED_SIEGE_ENGINE
Definition: ulduar.h:152
@ NPC_SALVAGED_DEMOLISHER
Definition: ulduar.h:155
Definition: Creature.h:43
uint32 GetEntry() const
Definition: Object.h:115
Creature * ToCreature()
Definition: Object.h:205
uint32 GetAreaId() const
Definition: Object.cpp:3165
Vehicle * GetVehicleKit() const
Definition: Unit.h:1785
Definition: Vehicle.h:28
SeatMap Seats
Definition: Vehicle.h:56

References WorldObject::GetAreaId(), Object::GetEntry(), Unit::GetVehicleKit(), NPC_SALVAGED_DEMOLISHER, NPC_SALVAGED_SIEGE_ENGINE, Vehicle::Seats, and Object::ToCreature().