|
发表于 2010-10-3 18:00:21
|
显示全部楼层
[jass]
function sbing takes player id,integer uid,integer bn,rect bd,rect aim returns nothing
//player ,UnitID,number of soldier,region for create,region for attack
local location bdp
local integer bnk=1
local group bdg=CreateGroup()
local unit at
set bdp=GetRectCenter(bd)
loop
exitwhen (bnk > bn)
set at=CreateUnitAtLoc(id,uid,bdp,0)
call GroupAddUnit( bdg, at )
set bnk=bnk+1
endloop
call RemoveLocation(bdp)
set bdp=GetRectCenter(aim)
loop
set at = FirstOfGroup(bdg)
exitwhen at == null
call IssuePointOrderLoc( at, "attack", bdp )
call GroupRemoveUnit( bdg, at )
endloop
//call GroupPointOrderLoc( bdg, "AImove", bdp )
call RemoveLocation(bdp)
call DestroyGroup(bdg)
set bdp=null
set bdg=null
set at=null
return
endfunction
[/jass] |
|