|
发表于 2009-3-11 16:29:30
|
显示全部楼层
[codes=jass]globals
real MG_Volume
real MG_Time
gamecache gc = null
endglobals
function Init takes nothing returns nothing
call FlushGameCache( InitGameCache( "gc.w3v" ) )
set gc = InitGameCache( "gc.w3v" )
endfunction
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 MG_DE takes nothing returns nothing
local timer ti = GetExpiredTimer()
local real vol = GetStoredReal( gc, I2S( H2I( ti ) ), "MG_Volume" )
call SetUnitScale( I2U( GetStoredInteger( gc, I2S( H2I(ti) ), "u" ) ), 1 / MG_Volume, 1 / MG_Volume, 1 / MG_Volume )
call FlushStoredMission( gc, I2S( H2I( ti ) ) )
call PauseTimer( ti )
call DestroyTimer( ti )
set ti = null
endfunction
function MG takes unit u returns nothing
local timer ti = CreateTimer()
call StoreReal( gc, I2S( H2I(ti) ), "MG_Volume", MG_Volume )
call StoreInteger( gc, I2S( H2I(ti) ), "u", H2I( u ) )
call SetUnitScale( u, MG_Volume, MG_Volume, MG_Volume )
call TimerStart( ti, MG_Time, false, function MG_DE )
set ti = null
endfunction[/codes]
给你,具体自己调~~ |
|