|
在疑难区给别人写的演示...擦汗..但是之前从来没有写过闪电这种变量的....
而且自己的J学的很还很烂
所以发上来请高手看看.
进而有哪些没有排泄?
或者有哪些错误.
还想问问.这么多的local 和 set 是不是很没有效率....多次运行的话.是不是很耗资源...
[jass]
function Trig_sd_____________________uActions takes nothing returns nothing
local string array sg
local unit d
local integer N
local real ss
local location d1
local lightning array sd
local location array d2
local location array d3
local integer zs
set sg[0] = "CLPB"
set sg[1] = "CLSB"
set sg[2] = "DRAB"
set sg[3] = "DRAM"
set sg[4] = "AFOD"
set sg[5] = "FORK"
set sg[6] = "HWPB"
set sg[7] = "HWSB"
set sg[8] = "CHIM"
set sg[9] = "LEAS"
set sg[10] = "MBUR"
set sg[11] = "MFPB"
set sg[12] = "SPLK"
set d1 = GetUnitLoc(gg_unit_Hmkg_0000)
set N = GetRandomInt(0, 12)
set ss = I2R(GetRandomInt(100, 800))
set zs = 1
loop
exitwhen zs > 36
set d2[zs] = PolarProjectionBJ(d1, ss, ( 10.00 * I2R(zs) ))
set d3[zs] = PolarProjectionBJ(d1, ss, ( 10.00 * ( I2R(zs) + 1 ) ))
call AddLightningLoc( sg[N], d2[zs], d3[zs] )
set sd[zs] = bj_lastCreatedLightning
set zs = zs + 1
endloop
call TriggerSleepAction(2)
set zs = 1
loop
exitwhen zs > 36
call DestroyLightning( sd[zs] )
call RemoveLocation( d2[zs] )
call RemoveLocation( d3[zs] )
set sd[zs] =null
set d2[zs] = null
set d3 [zs] = null
set zs = zs + 1
endloop
call RemoveLocation( d1)
set d =null
set d1 = null
endfunction
//===========================================================================
function InitTrig_sd_____________________u takes nothing returns nothing
set gg_trg_sd_____________________u = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic( gg_trg_sd_____________________u, Player(0) )
call TriggerAddAction(gg_trg_sd_____________________u, function Trig_sd_____________________uActions)
endfunction
[/jass] |
|