set udg_Height = GetLocationZ(GetUnitLoc(GetTriggerUnit()))
function compareCoords takes unit unitOne, unit unitTwo returns boolean
local unitOnex = GetLocationX(unitOne)
local unitOney = GetLocationY(unitOne)
local unitOnez = GetLocationZ(GetUnitLoc(GetTriggerUnit(unitOne)))
local unitTwox = GetLocationX(unitTwo)
local unitTwoy = GetLocationY(unitTwo)
local unitTwoz = GetLocationZ(GetUnitLoc(GetTriggerUnit(unitTwo)))
if unitOnex==unitTwox && unitOney==unitTwoy && unitOnez==unitTwoz then
return true
else
return false
endif
endfunction
function compareCoords takes unit unitOne, unit unitTwo returns boolean
local location unitOneLoc = GetUnitLoc(UnitOne)
local location unitTwoLoc = GetUnitLoc(UnitTwo)
local unitOnex = GetLocationX(unitOneLoc)
local unitOney = GetLocationY(unitOneLoc)
local unitOnez = GetLocationZ(unitOneLoc)
local unitTwox = GetLocationX(unitTwoLoc)
local unitTwoy = GetLocationY(unitTwoLoc)
local unitTwoz = GetLocationZ(unitTwoLoc)
call RemoveLocation(unitOneLoc)
call RemoveLocation(unitOneLoc)
set unitOneLoc = null
set unitTwoLoc = null
if unitOnex==unitTwox and unitOney==unitTwoy and unitOnez==unitTwoz then
set unitOnex = null
set unitOney = null
set unitOnez = null
set unitTwox = null
set unitTwoy = null
set unitTwoz = null
return true
else
set unitOnex = null
set unitOney = null
set unitOnez = null
set unitTwox = null
set unitTwoy = null
set unitTwoz = null
return false
endif
endfunction
local z = GetFlyingHeight(Unit) + GetLocationZ(GetUnitLoc(Unit))
Apprentice said:What you propose is possible. I shall get back to you on this matter, fellow magister.
function compareCoords takes unit uA, unit uB, integer cArea returns boolean
local uA<u> = uA
local uB<u> = uB
local location uA[l] = GetUnitLoc(uA<u>)
local location uB[l] = GetUnitLoc(uB<u>)
local uA[x] = GetLocationX(uA[l])
local uB[x] = GetLocationX(uB[l])
local uA[y] = GetLocationY(uA[l])
local uB[y] = GetLocationY(uB[l])
local uA[z] = GetLocationZ(uA[l]) + GetFlyingHeight(uA<u>)
local uB[z] = GetLocationZ(uB[l]) + GetFlyingHeight(uB<u>)
call RemoveLocation(uA[l])
call RemoveLocation(uB[l])
if uA[x] >= uB[x] - cArea and uA[x] <= uB[x] + cArea then
if uA[y] >= uB[y] - cArea and uA[y] <= uB[y] + cArea then
if uA[z] >= uB[z] - cArea and uA[z] <= uB[z] + cArea then
set uA = null
set uB = null
return true
else
set uA = null
set uB = null
return false
endif
else
set uA = null
set uB = null
return false
endif
else
set uA = null
set uB = null
return false
endif
endfunction</u></u></u></u></u></u>