Кто шарит, внесите пожалуйста правку - нужно чтобы высота юнита не обнулялась на старте этой функции(т.е. если его исх. высота(не default), равна, скажем, 200, а высота параболы - 150, то он подлетит параболой до 350 и опустится снова к 200)
(Ну и если найдете что - можете попробовать улучшить, хз)
Кроме этого, у меня вопрос: можно ли вместо MoveUnit(приватной функции) вызывать свою, не приватную? Я пробовал прописать там свою и мне выдавало ошибку.
library Flyout
private function MoveUnit takes unit u, real spd, real dir returns nothing
if IsTerrainPathable(GetUnitX(u),GetUnitY(u)+spd*Sin(dir),PATHING_TYPE_FLYABILITY)==false
SetUnitY(u,GetUnitY(u)+spd*Sin(dir))
endif
if IsTerrainPathable(GetUnitX(u)+spd*Cos(dir),GetUnitY(u),PATHING_TYPE_FLYABILITY)==false
SetUnitX(u,GetUnitX(u)+spd*Cos(dir))
endif
set u = null
endfunction

private function Parabola takes real h, real d, real x returns real
return (4 * h / d) * (d - x) * (x / d)
endfunction
private struct MUE_Struct
private static timer t = CreateTimer()
private static integer m[]
private static integer MUI = -1
unit c
real dist
integer check
real r
real r2 = 0
real fly
real rmax
real sr
real a
private method StopAction takes integer j returns nothing
set m[j] = m[MUI]
set MUI = MUI - 1
if MUI <= -1 then
call PauseTimer(t)
set MUI = -1
endif
endmethod

private static method Loop takes nothing returns nothing 
local thistype this 
local integer i = 0 
loop 
exitwhen i > MUI 
set this = m[i] 
if r<rmax then 
set r = r + 0.01 
MoveUnit(c,dist,a) 
if check == 1 then 
SetUnitFlyHeight(c,Parabola(fly,sr,r2),0) 
set r2 = r2+dist 
endif 
else 
if check == 1 then 
UnitAddAbility(c,'Arav')
UnitRemoveAbility(c,'Arav')
endif 
set c = null 
call StopAction(i) 
call destroy() 
endif 
set i = i + 1 
endloop 
endmethod

public static method MUE_Start takes unit NewC, real NewDist,real NewRmax, real NewA,integer NewCheck,real NewFly returns nothing
local thistype this = thistype.create()
set MUI = MUI + 1
set m[MUI] = this
set c = NewC
set r = 0
set rmax = NewRmax
set dist = NewDist
set sr = NewDist
set dist = (dist/(rmax*100))
set check = NewCheck
set fly = NewFly
set r2= 0
set a = NewA
if MUI == 0 then
call TimerStart(t, 0.01, true, function thistype.Loop)
endif
set NewC = null
endmethod
endstruct

function Flyout takes unit c,real distance,real timeformoving,real angle,integer checkingfly,real flyheight,integer checksolid returns nothing
if checksolid == 0 then
if GetUnitAbilityLevel(c,'A01W') == 0 then
call MUE_Struct.MUE_Start(c,distance,timeformoving,angle*bj_DEGTORAD,checkingfly,flyheight)
endif
else
if GetUnitAbilityLevel(c,'A01W') != 2 then
call MUE_Struct.MUE_Start(c,distance,timeformoving,angle*bj_DEGTORAD,checkingfly,flyheight)
endif
endif
c = null
endfunction
endlibrary

Принятый ответ

надо передавать верный flyheight при вызове Flyout
можно ли вместо MoveUnit(приватной функции) вызывать свою, не приватную?
можно
`
ОЖИДАНИЕ РЕКЛАМЫ...