Skip to content
MMOMinion edited this page Sep 28, 2013 · 25 revisions

EntityList

  • The EntityList is a lua metatable.

Accessing the EntityList

  • The EntityList can be called with several filters, seperated by comma, which can be combined to get the object(s) 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("EntityIndex: ".. tostring(i).. " EntityTableWithAllData : "..tostring(e))  
      local i,e = next(el)  
   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.
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 type "number"
chartype=number
Returns Entities with the enum chartype "number"
exclude=number
Returns Entities without the one with the entityID "number"
aggro
Returns Entities which are having aggro towards the player.
attackable
Returns Entities which you can attack.
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.
Clone this wiki locally