|
楼主 |
发表于 2010-6-22 20:41:27
|
显示全部楼层
//======================================
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function U2I takes unit u returns integer
return u
return 0
endfunction
function Tm2I takes timer t returns integer
return t
return 0
endfunction
function I2H takes integer i returns handle
return i
return null
endfunction
//============================环绕函数============================
function HR takes nothing returns nothing
local timer tm = GetExpiredTimer()
local unit u = I2U(GetStoredInteger(udg_gc,I2S(Tm2I(tm)),"u"))
local real x = GetStoredReal(udg_gc,I2S(Tm2I(tm)),"x")
local real y = GetStoredReal(udg_gc,I2S(Tm2I(tm)),"y")
local integer N =GetStoredInteger(udg_gc,I2S(Tm2I(tm)),"N")
local real r = GetStoredReal(udg_gc,I2S(Tm2I(tm)),"r")
local real h = GetStoredReal(udg_gc,I2S(Tm2I(tm)),"h")
local real x2 = GetUnitX(u)
local real y2 = GetUnitY(u)
local integer n = GetStoredInteger(udg_gc,I2S(Tm2I(tm)),"n")
call SetUnitX(u,r*(Cos(n*10)))
call SetUnitY(u,r*(Sin(n*10)))
call SetUnitFlyHeight(u,h,0.00)
set n = n+1
call FlushStoredInteger(udg_gc,I2S(Tm2I(tm)),"n")
call StoreInteger(udg_gc,I2S(Tm2I(tm)),"n",n)
if n > N then
call DestroyTimer(tm)
call PauseUnit(u,false)
call FlushStoredMission(udg_gc,I2S(Tm2I(tm)))
endif
set tm = null
endfunction
//============================环绕启动函数==================================
function HRcontral takes location loc,unit u,integer N,real h,real r returns nothing
local timer tm = CreateTimer()
local integer n = 1
local real x = GetLocationX(loc)
local real y = GetLocationY(loc)
set N = N*36
call PauseUnit(u,true)
call StoreInteger(udg_gc,I2S(Tm2I(tm)),"N",N)
call StoreInteger(udg_gc,I2S(Tm2I(tm)),"n",n)
call StoreReal(udg_gc,I2S(Tm2I(tm)),"x",x)
call StoreReal(udg_gc,I2S(Tm2I(tm)),"y",y)
call StoreReal(udg_gc,I2S(Tm2I(tm)),"r",r)
call StoreReal(udg_gc,I2S(Tm2I(tm)),"h",h)
call StoreInteger(udg_gc,I2S(Tm2I(tm)),"u",U2I(u))
call TimerStart(tm,0.02,true,function HR)
set tm = null
endfunction
//==================================
----------- 帖子于 20:41 更新 --------- 之前内容发布于 20:40 ------------
各位JASS大神帮帮忙呀 我在线等 我学JASS的时间不长 处理不了啦 |
|