I want to import both these spells but they use the same function.
Here it is.
Storm Spiral
Flesh Eating Plant
Deleting one of them will cause so many damn errors. I want them both in my map, but is it possible?
Here it is.
Storm Spiral
JASS:
function GetNearestUnit takes real locx, real locy, real radius, boolexpr unitfilter returns unit
local unit p
local unit p2
local real discurrent = 0.
local real dist = 0.
call GroupEnumUnitsInArea(Enumer,locx,locy,radius,unitfilter)
set bj_lastCreatedUnit = null
set discurrent = radius
loop
set p = FirstOfGroup(Enumer)
exitwhen p == null
call GroupRemoveUnit(Enumer,p)
set dist = DistanceXY( locx, locy, GetUnitX(p), GetUnitY(p) )
if dist < discurrent then
set discurrent = dist
set bj_lastCreatedUnit = p
endif
set p = null
endloop
call GroupRefresh( Enumer )
return bj_lastCreatedUnit
endfunction
Flesh Eating Plant
JASS:
function GetNearestUnit takes location attach , location loc , location loc2, real radius , unit attachunit returns unit
local unit ret = null
local real x1 = GetLocationX(loc)
local real x2 = 0.00
local real x3 = GetLocationX(loc2)
local real y1 = GetLocationY(loc)
local real y2 = 0.00
local real y3 = GetLocationY(loc2)
local unit a = null
local unit b = null
local real MinD = radius
local real D = 0.00
local real r = 0.00
call GroupEnumUnitsInRangeOfLoc(g, loc, radius, filter)
loop
set a = FirstOfGroup(g)
exitwhen a==null
call GroupRemoveUnit(g,a)
set r = SquareRoot((GetLocationX(attach)-GetUnitX(a))*(GetLocationX(attach)-GetUnitX(a))+(GetLocationY(attach)-GetUnitY(a))*(GetLocationY(attach)-GetUnitY(a)))
set x2 = GetUnitX(a)
set y2 = GetUnitY(a)
set D = SquareRoot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
if r >= (TendrilLength * TendrilDefaultPosition) and (D < MinD) and (SquareRoot((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)) < TendrilLength ) and not(IsUnitInGroup(a,PulledUnits)) and GrapCondition(a,attachunit) == true then
set MinD = D
set b = a
endif
endloop
call GroupClear(g)
set a = null
return b
endfunction
Deleting one of them will cause so many damn errors. I want them both in my map, but is it possible?