Name | Type | is_array | initial_value |
IsUnitPreplaced | boolean | Yes | |
RoX_Jass_Caster | unit | No | |
RoX_Jass_Dummy_ID | unitcode | No | h001 |
RoX_Jass_Fx_Array | effect | Yes | |
RoX_Jass_Target | unit | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No |
function RoX_Jass takes unit caster, real targetx, real targety, real radius, string fx, integer shardcount, real startheight, real fallspeed, trigger impacttrig returns nothing
local group shard_group=CreateGroup()
local unit temp
local group temp_group=CreateGroup()
local integer i=0
local real dist=0
loop
exitwhen i > shardcount -1
call GroupAddUnit(shard_group,CreateUnit(GetOwningPlayer(caster),udg_RoX_Jass_Dummy_ID,targetx + GetRandomReal(0.0,radius) * Cos(GetRandomReal(0,360) * bj_DEGTORAD),targety + GetRandomReal(0.0,radius) * Sin(GetRandomReal(0,360) * bj_DEGTORAD),0.0))
set i=i+1
endloop
call BlzGroupAddGroupFast(shard_group,temp_group)
loop
set temp=FirstOfGroup(temp_group)
exitwhen temp==null
call SetUnitFlyHeight(temp,startheight,0.0)
set udg_RoX_Jass_Fx_Array[GetUnitUserData(temp)]=AddSpecialEffectTarget(fx,temp,"chest")
call GroupRemoveUnit(temp_group,temp)
endloop
call BlzGroupAddGroupFast(shard_group,temp_group)
loop
set temp=FirstOfGroup(temp_group)
exitwhen temp==null
call SetUnitFlyHeight(temp,0.0,fallspeed)
call GroupRemoveUnit(temp_group,temp)
endloop
call TriggerSleepAction(startheight/fallspeed)
loop
set temp=FirstOfGroup(shard_group)
exitwhen temp==null
call DestroyEffect(udg_RoX_Jass_Fx_Array[GetUnitUserData(temp)])
call UnitApplyTimedLife(temp,'BTLF',1.0)
call GroupRemoveUnit(shard_group,temp)
endloop
set udg_RoX_Jass_Caster=caster
call GroupEnumUnitsInRange(temp_group, targetx,targety, radius, null)
loop
set temp=FirstOfGroup(temp_group)
exitwhen temp==null
set udg_RoX_Jass_Target=temp
call ConditionalTriggerExecute(impacttrig)
call GroupRemoveUnit(temp_group,temp)
endloop
call DestroyGroup(temp_group)
call DestroyGroup(shard_group)
set temp_group=null
set shard_group=null
endfunction
function RoX_Jass_Loop takes unit caster, real targetx, real targety, real radius, string fx, integer shardcount, real startheight, real fallspeed, trigger impacttrig, integer count, real delay returns nothing
local integer i=0
loop
exitwhen i > count - 1
call RoX_Jass(caster,targetx,targety,radius,fx,shardcount,startheight,fallspeed,impacttrig)
call TriggerSleepAction(delay)
set i=i+1
endloop
endfunction