finish serpentine tower event and quest

This commit is contained in:
ErikasKontenis
2020-03-20 00:17:07 +02:00
parent d9686f1d07
commit 0a680a4c0b
84 changed files with 4845 additions and 28 deletions

View File

@@ -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