- Joined
- Dec 10, 2008
- Messages
- 850
Ok, so after learning how to write JASS to work with me, I'm struck with a problem. See, I have this spell that is supposed to create 15 waves of 5 units. It set to use a loop within a loop. The only problem is (dont shoot me for it) I cant get TriggerSleepAction to work effectivly for me, instead it skips it and only loops once. Any help with this?
Help is much welcomed (feel free to help with any other kinks in it too!)
And of course +rep to helpers
JASS:
function Trig_Artillery_Actions takes nothing returns nothing
local location ArtilleryPoint = GetSpellTargetLoc()
local unit ArtilleryCaster = GetSpellAbilityUnit ()
local rect ArtilleryRegion = RectFromCenterSizeBJ(ArtilleryPoint, 1000.00, 1000.00)
local group ArtilleryGroup = GetUnitsInRectAll(ArtilleryRegion)
local integer ArtilleryLoop1 = 1
local integer ArtilleryLoop2 = 1
local location ArtilleryLocU
local unit ArtilleryUnit
local unit ArtilleryUnit2
call GroupRemoveUnit( ArtilleryGroup, ArtilleryCaster )
loop
exitwhen ArtilleryLoop1 > 15
loop
exitwhen ArtilleryLoop2 == 30
set ArtilleryLocU = GetRandomLocInRect(ArtilleryRegion)
call CreateUnitAtLoc(GetTriggerPlayer(), 'h00B', ArtilleryLocU, bj_UNIT_FACING )
set ArtilleryUnit = GetLastCreatedUnit()
call CreateUnitAtLoc(GetOwningPlayer(ArtilleryCaster), 'h00F', ArtilleryLocU, bj_UNIT_FACING )
set ArtilleryUnit2 = GetLastCreatedUnit()
call SetUnitTimeScale( ArtilleryUnit, 25.00 )
call SetUnitScalePercent( ArtilleryUnit, 500.00, 500.00, 1000.00 )
call SetUnitAnimation( ArtilleryUnit, "birth" )
call SetUnitAnimation( ArtilleryUnit2, "birth" )
call UnitApplyTimedLife( ArtilleryUnit, 'BTLF', 0.50 )
call UnitApplyTimedLife(ArtilleryUnit2,'BTLF',0.50)
call UnitDamagePointLoc( ArtilleryCaster, 0, 500, ArtilleryLocU, 5.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call RemoveLocation (ArtilleryLocU)
set ArtilleryLoop2 = ArtilleryLoop2 + 1
endloop
set ArtilleryLoop1 = ArtilleryLoop1 + 1
call TriggerSleepAction (.27)
endloop
call UnitDamagePointLoc( ArtilleryCaster, 0, 1000.00, GetRectCenter(ArtilleryRegion), 300.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call RemoveRect (ArtilleryRegion)
call RemoveLocation (ArtilleryPoint)
call DestroyGroup (ArtilleryGroup)
endfunction
And of course +rep to helpers