-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Metatable:Position
Stefan A. Brannfjell edited this page Jan 8, 2018
·
9 revisions
No description available at the moment.
getDistance(positionEx)
isSightClear(positionEx[, sameFloor = true])
isInRange(from, to)
sendDistanceEffect(positionEx, distanceEffect, player = nil)
sendMagicEffect(magicEffect[, player = nil])
Description: N/A
Parameters:Returns: N/A
- positionEx - No description
Example:
local position = Position(...)
position:getDistance(Position())
Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- positionEx - No description
- sameFloor - (optional, default: true)
Example:
local position = Position(...)
position:isSightClear(Position(), true)
Added in version: 1.0
Description: Checks if current position is inside the specified range from and to.
Parameters:Returns: Boolean: true/false
- from - Position object or table
- to - Position object or table
Example:
-- Sample #1:
local position = Position(...)
if position:isInRange({x=100, y=100, z=6}, {x=200, y=200, z=8}) then
-- Position is inside
end
-- Sample #2:
local zone = {
from = Position(100, 100, 6),
to = Position(200, 200, 8)
}
local playerpos = player:getPosition()
if playerpos:isInRange(zone.from, zone.to) then
-- Player is in the zone
end
Added in version: 1.3
Description: N/A
Parameters:Returns: N/A
- positionEx - Other Position object or table
- distanceEffect
- player - (optional, default: nil)
Example:
local position = Position(...)
position:sendDistanceEffect(Position(), CONST_ANI_ARROW, nil)
Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- MagicEffect
- player - (optional, default: nil)
Example:
local position = Position(...)
position:sendMagicEffect(CONST_ME_POFF, nil)
Added in version: 1.0