mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-13 14:24:55 +02:00
finish serpentine tower event and quest
This commit is contained in:
@@ -72,4 +72,28 @@ function Position:moveRel(x, y, z)
|
||||
self.y = self.y + y
|
||||
self.z = self.z + z
|
||||
return self
|
||||
end
|
||||
|
||||
function Position:isInRange(from, to)
|
||||
-- No matter what corner from and to is, we want to make
|
||||
-- life easier by calculating north-west and south-east
|
||||
local zone = {
|
||||
nW = {
|
||||
x = (from.x < to.x and from.x or to.x),
|
||||
y = (from.y < to.y and from.y or to.y),
|
||||
z = (from.z < to.z and from.z or to.z)
|
||||
},
|
||||
sE = {
|
||||
x = (to.x > from.x and to.x or from.x),
|
||||
y = (to.y > from.y and to.y or from.y),
|
||||
z = (to.z > from.z and to.z or from.z)
|
||||
}
|
||||
}
|
||||
|
||||
if self.x >= zone.nW.x and self.x <= zone.sE.x
|
||||
and self.y >= zone.nW.y and self.y <= zone.sE.y
|
||||
and self.z >= zone.nW.z and self.z <= zone.sE.z then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
Reference in New Issue
Block a user