- Reaction score
- 534
I've been working on spell triggers recently, and I've created cool spells.
But now I've got a crashing spell, and JassCraft just doesn't know that one
Here is the trigger!
I bolded the lines where I think it happens, because of the wait (It doesn't crash right away, it crashes 1 second after I cast the spell).
P.S. Testing in Single Player with 1 computer.
But now I've got a crashing spell, and JassCraft just doesn't know that one
Here is the trigger!
Code:
function Trig_Hell_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A05M'
endfunction
function Trig_Hell_Strike_Actions takes nothing returns nothing
local unit cast = GetTriggerUnit()
local unit u
local player p = GetOwningPlayer(cast)
local location l = GetSpellTargetLoc()
local location ll
local real debug1 = GetLocationX(l)
local real debug2 = GetLocationY(l)
local integer i = GetRandomInt(8, 11)
local integer ii = 0
loop
exitwhen ii == i
set ll = PolarProjectionBJ(l, GetRandomReal(50.00, 800.00), GetRandomReal(0.00, 360.00))
set u = CreateUnit(p, 'h003', debug1, debug2, 270.00)
call UnitAddAbility(u, 'A05N')
call SetUnitAbilityLevel(u, 'A05N', 1)
call UnitApplyTimedLife(u, 'BTLF', 10.00)
call IssuePointOrderLoc(u, "flamestrike", ll)
set ii = ii + 1
endloop
set i = GetRandomInt(5, 8)
set ii = 0
call PolledWait(1.00)
[B]loop
exitwhen ii == i
set ll = PolarProjectionBJ(l, GetRandomReal(50.00, 800.00), GetRandomReal(0.00, 360.00))
set u = CreateUnit(p, 'h003', debug1, debug2, 270.00)
call UnitAddAbility(u, 'A05O')
call SetUnitAbilityLevel(u, 'A05O', 1)
call UnitApplyTimedLife(u, 'BTLF', 10.00)
call IssuePointOrderLoc(u, "inferno", ll)
call PolledWait(GetRandomReal(0.75, 1.75))
set ii = ii + 1
endloop
call RemoveLocation(l)
call RemoveLocation(ll)
set cast = null
set u = null
set p = null
set l = null
set ll = null
endfunction
[/B]
//===========================================================================
function InitTrig_Hell_Strike takes nothing returns nothing
set gg_trg_Hell_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hell_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Hell_Strike, Condition( function Trig_Hell_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Hell_Strike, function Trig_Hell_Strike_Actions )
endfunction
I bolded the lines where I think it happens, because of the wait (It doesn't crash right away, it crashes 1 second after I cast the spell).
P.S. Testing in Single Player with 1 computer.