actor:getMapRageActor()
local nX = actor:getX()--X坐标
local nY = actor:getY()--Y坐标
local nRange = 2--范围
local obj_tbl = actor:getMapRageActor(nX, nY, nRange)--取2格范围对像
for i = 1, #obj_tbl do--循环列表内的对像
local objActor = obj_tbl[i]
if objActor ~= nil then
local sName = objActor:getCharName()
print("对像名称:"..sName)
end
end