-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Metatable:Tile
A tile is a map square in the server. It holds information such as tile type, house association, ground type, items and creatures.
A Position object can be used to grab a specific tile in the server.
local tile = Tile(player:getPosition())
getBottomCreature()
getBottomVisibleCreature(creature)
getCreatureCount()
getCreatures()
getDownItemCount()
getFieldItem()
getGround()
getHouse()
getItemById(itemId, subType = -1)
getItemByTopOrder(topOrder)
getItemByType(itemType)
getItemCount()
getItemCountById(itemId, subType = -1)
getItems()
getPosition()
getThing(index)
getThingCount()
getThingIndex(thing)
getTopCreature()
getTopDownItem()
getTopItemCount()
getTopTopItem()
getTopVisibleCreature(creature)
getTopVisibleThing(creature)
hasFlag(flag)
hasProperty(property, item)
isCreature()
isItem()
isTile()
queryAdd(thing, flags)
remove()
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getBottomCreature()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- creature - No description
Example:
local tile = Tile(...)
tile:getBottomVisibleCreature(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getCreatureCount()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getCreatures()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getDownItemCount()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getFieldItem()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getGround()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getHouse()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- subType - (optional, default: -1)
Example:
local tile = Tile(...)
tile:getItemById(2400, -1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- topOrder - No description
Example:
local tile = Tile(...)
tile:getItemByTopOrder(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemType - No description
Example:
local tile = Tile(...)
tile:getItemByType(ITEM_TYPE_TELEPORT)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getItemCount()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- subType - (optional, default: -1)
Example:
local tile = Tile(...)
tile:getItemCountById(2400, -1)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getItems()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getPosition()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- index - No description
Example:
local tile = Tile(...)
tile:getThing(some_id)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getThingCount()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- thing - No description
Example:
local tile = Tile(...)
tile:getThingIndex(userdata_or_id)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getTopCreature()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getTopDownItem()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getTopItemCount()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local tile = Tile(...)
tile:getTopTopItem()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- creature - No description
Example:
local tile = Tile(...)
tile:getTopVisibleCreature(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- creature - No description
Example:
local tile = Tile(...)
tile:getTopVisibleThing(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- flag - No description
Example:
local tile = Tile(...)
tile:hasFlag(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- property - No description
- item - (optional)
Example:
local tile = Tile(...)
tile:hasProperty(unknown, nil)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: false
Example:
local tile = Tile(...)
tile:isCreature()
[To the top] Added in version: 1.1
Description: N/A
Parameters: None
Returns: false
Example:
local tile = Tile(...)
tile:isItem()
[To the top] Added in version: 1.1
Description: N/A
Parameters: None
Returns: true
Example:
local tile = Tile(...)
tile:isTile()
[To the top] Added in version: 1.1
Description: N/A
Parameters:Returns: N/A
- thing - No description
- flags - (optional)
Example:
local tile = Tile(...)
tile:queryAdd(userdata_or_id, nil)
[To the top] Added in version: 1.0
Description: Remove a tile, ground, items and creatures in that tile. (Except players, which are being teleported to temple position)
Parameters: None
Returns: nil if tile doesn't exist, otherwise true.
Example:
local tile = Tile(...)
tile:remove()
[To the top] Added in version: 1.4 #2952