Ok it seems when a person is casting the spell and then with a different hero casts this same spell it crashes the game.
Any ideals why it only happens when its casted the 2nd time? Or do you see any thing wrong with the code?
Any ideals why it only happens when its casted the 2nd time? Or do you see any thing wrong with the code?
JASS:
local unit u = GetTriggerUnit()
local unit z
local unit q
local location l = GetSpellTargetLoc()
local location l2
local player p = GetOwningPlayer(u)
local integer i = GetUnitAbilityLevel(u,'A00O')
local integer j = 14
local integer h = 0
local integer size = 10
set z = CreateUnitAtLoc(p,'u009',l,270)
call SetUnitAbilityLevel(z,'A00L',i)
call SetUnitLifeBJ( z, 1.00 )
call SetUnitScalePercent( z, size, size, size )
call TriggerSleepAction(.5)
loop
exitwhen j == 0
loop
exitwhen h > 360
set l = GetUnitLoc(z)
set l2 = PolarProjectionBJ(l,500,h)
set q = CreateUnitAtLoc(p,'h00F',l2,0)
call IssueTargetOrder(q,"deathcoil",z)
call UnitApplyTimedLife(q,'BTLF', 10)
call RemoveLocation(l2)
set h = h+45
endloop
call RemoveLocation(l)
call TriggerSleepAction(1)
if(j!=0) then
set size = size+10
call SetUnitScalePercent( z, size, size, size )
endif
set h = 0
set j = j-1
endloop
call TriggerSleepAction(2)
set l = GetUnitLoc(z)
set q = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),'n00G',l,270)
call RemoveUnit( z )
call RemoveLocation(l)
call RemoveLocation(l2)
set l2 = null
set l = null
set u = null
set z = null
set q = null
set p = null