Skip to content
MINIONBOTS edited this page Sep 1, 2016 · 25 revisions

EntityList

  • The EntityList is a lua metatable.
  • The EntityList returns a lua table, where the index of each entry represents the EntityID and the value at this index is an objects of type ENTITY.
  • At the Index of this table you can find the AGGROLIST and the PARTYMEMBERLIST as well as functions to call.

Accessing the EntityList

  • The EntityList can be called with several filters, seperated by comma, which can be combined to get the entity(-ies) wanted. Make sure you use a combination of filters which can logically combined, meaning, using "nearest,lowesthealth" wont work, since each of it excludes the usage of the other.
  • Example:
local el = EntityList("nearest,onmesh,gatherable,maxdistance=20")
if ( el ) then
   local i,e = next(el)
   while (i~=nil and e~=nil) do
      -- the 'd' command is a global command for printing out information into the console
      d("EntityID: ".. tostring(i).. " Entity : "..tostring(e))  
      i,e = next(el,i)  
   end  
end

EntityList Filters

maxdistance=number
Returns Entities within a distance of "number".
mindistance=number
Returns Entities beyond a distance of "number".
nearest
Returns the closest Entity.
targetingme
Returns Entities which are targeting the player.
targeting=number
Returns Entities which target the entity with the ID "number".
los
Returns Entities within line of sight to the player.
alive
Returns Entities with health > 0.
dead
Returns Entities with health == 0.
aggressive
Returns aggressive Entities
friendly
Returns friendly Entities
incombat
Returns Entities which are incombat
notincombat
Returns Entities which are not in combat
onmesh
Returns Entities which are on the navigation mesh.
gatherable
Returns Entities which you can gather or harvest.
minlevel=number
Returns Entities with a level higher than "number".
maxlevel=number
Returns Entities with a level lower than "number".
lowesthealth
Returns the Entity with the lowest health.
shortestpath
Returns the Entity with the shortest path (navigation path, not direct distance!).
type=number
Returns Entities with the enum ENTITYTYPE "number"
chartype=number
Returns Entities with the enum CHARACTERTYPE"number"
contentid=number
Returns Entities which have the given contentID, this can be used to search for specific NPCs/Enemies/Targets. Has been changed to also accept a list of content id's separated by a semicolon.
exclude_contentid=number
Returns Entities which do not have the given contentID, this can be used to exclude specific NPCs/Enemies/Targets. Also accept a list of content id's separated by a semicolon.
exclude=number
Returns Entities without the one with the entityID "number". Has been changed to also accept a list of entity id's separated by a semicolon.
aggro
Returns Entities which are having aggro towards the player.
attackable
Returns Entities which you can attack.
ownerid=number
Returns the Entity which has an owner with the ID "number". This can be used to get for ex. the Pet from the Player
fateid=number
Returns Entities which belong to the fate with the ID "number".
distanceto=number
Calculates every distance-filter towards the entityID passed as "number" instead of the player.
clustered=number
Returns the enemy who has the most enemies around him up to a distance of "number", use this to get the best AOE target.
myparty
Returns Entities which belong to your party. Works only when they are close enough and on the same map!.

EntityList Functions

  • The EntityList has Functions that can be used, in this example we are accessing a specific Entity by doing a lookup in the EntityList by EntityID.
local entity = EntityList:Get(EntityID)
if ( entity ) then   
   d("EntityID: ".. tostring(entity.id).. " EntityName : "..tostring(entity.name))  
end
:Get(number)
Returns Entity from the EntityList which has the EntityID "number". If that Entity does not exist, an empty table will be returned.
Clone this wiki locally