TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FlameLeviathanPursuedTargetSelector Class Reference

Public Member Functions

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

Private Types

enum  Area { AREA_FORMATION_GROUNDS = 4652 }
 

Private Attributes

Unit const_me
 

Member Enumeration Documentation

Enumerator
AREA_FORMATION_GROUNDS 
1617  {
1618  AREA_FORMATION_GROUNDS = 4652,
1619  };
Definition: boss_flame_leviathan.cpp:1618

Constructor & Destructor Documentation

FlameLeviathanPursuedTargetSelector::FlameLeviathanPursuedTargetSelector ( Unit unit)
inlineexplicit
1622 : _me(unit) { };
Unit const * _me
Definition: boss_flame_leviathan.cpp:1654

Member Function Documentation

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

No players, only vehicles. Pursue is never cast on players.

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

1625  {
1627  Creature* creatureTarget = target->ToCreature();
1628  if (!creatureTarget)
1629  return true;
1630 
1632  if (creatureTarget->GetEntry() != NPC_SALVAGED_DEMOLISHER && creatureTarget->GetEntry() != NPC_SALVAGED_SIEGE_ENGINE)
1633  return true;
1634 
1636  Vehicle* vehicle = creatureTarget->GetVehicleKit();
1637  if (!vehicle)
1638  return true;
1639 
1641  if (target->GetAreaId() != AREA_FORMATION_GROUNDS)
1642  return true;
1643 
1645  bool playerFound = false;
1646  for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end() && !playerFound; ++itr)
1647  if (itr->second.Passenger.Guid.IsPlayer())
1648  playerFound = true;
1649 
1650  return !playerFound;
1651  }
Definition: Vehicle.h:32
Definition: Creature.h:467
Definition: ulduar.h:55
uint32 GetAreaId() const
Definition: Object.cpp:1530
Definition: boss_flame_leviathan.cpp:1618
Creature * ToCreature()
Definition: Object.h:194
Definition: ulduar.h:56
uint32 GetEntry() const
Definition: Object.h:107
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition: Vehicle.h:68
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

Member Data Documentation

Unit const* FlameLeviathanPursuedTargetSelector::_me
private

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