I wanted to script a system for stunning units by calling a function so i won't have to create dummy, give the spell to it etc. each time i need it for one of my spells.
The code is:
aStunSource is the unit casting any spell that uses this script
aStunUnit is the unit being affected by this
aStun is the id of the ability i use so i can use it stuns with different durations
When i compiled it the first time WorldEdit gave me some errors so i checked it with JassCraft and after fixing some errors it looked like what is written above and JassCraft told me it should work.
But when i put this code into WorldEdit and try to save it says gives me the error: "Reserved type or handle-type expected" on this two lines:
+Rep for the one who helps me with this, because i really got no idea whats wrong there.
The code is:
JASS:
function MyStun takes unit aStunSource, unit aStunUnit, integer aStun returns nothing
local player MyStunSource = GetOwningPlayer(aStunSource)
local unit array MyStunUnit
local integer MyStun = aStun
local location MyStunPoint = null
set MyStunUnit[1] = aStunUnit
set MyStunPoint = GetUnitLoc(MyStunUnit[1])
call CreateNUnitsAtLoc( 1, 'h003', MyStunSource, MyStunPoint, bj_UNIT_FACING )
set MyStunUnit[2] = GetLastCreatedUnit()
call UnitAddAbilityBJ( MyStun, MyStunUnit[2] )
call IssueTargetOrderBJ( MyStunUnit[2], "thunderbolt", MyStunUnit[1] )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', MyStunUnit[2] )
call RemoveLocation(MyStunPoint)
endfunction
aStunUnit is the unit being affected by this
aStun is the id of the ability i use so i can use it stuns with different durations
When i compiled it the first time WorldEdit gave me some errors so i checked it with JassCraft and after fixing some errors it looked like what is written above and JassCraft told me it should work.
But when i put this code into WorldEdit and try to save it says gives me the error: "Reserved type or handle-type expected" on this two lines:
JASS:
local integer MyStun = aStun
local location MyStunPoint = null
+Rep for the one who helps me with this, because i really got no idea whats wrong there.