K
kingofdeth
Guest
I am trying to make an ability where the ground goes down and makes fire. It is called Trench of Fire. I am using JASS. I don't have the terrain deformation yet but i have a dummy caster that has permanent immolation. This is what i got. If i tryed this it should create a bunch of units of id number H009 in a line. But it won't let me enable it because something is wrong. Pleez help.
any help is apreciated, thank you.
Code:
function Trig_Trench_of_Fire_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00T' ) ) then
return false
endif
return true
endfunction
function Trig_Trench_of_Fire_Actions takes nothing returns nothing
local integer a = 1
local real c = 300
local real x = GetLocationX(PolarProjectionBJ(GetSpellTargetLoc(), c, 90.00))
local real y = GetLocationY(PolarProjectionBJ(GetSpellTargetLoc(), 0, 0)
local unit array q
loop
exitwhen a>7
call TriggerSleepAction( 0.20 )
call CreateNUnitsAtLoc( 1, 'h009', GetOwningPlayer(GetSpellAbilityUnit()), Location(x, y), bj_UNIT_FACING )
set c = c - 100
set x = GetLocationX(PolarProjectionBJ(GetSpellTargetLoc(), c, 90.00))
call SetUnitAnimation( GetLastCreatedUnit(), "birth" )
set q[a] = GetLastCreatedUnit()
set a = a + 1
endloop
call TriggerSleepAction( 0.20 )
set a = 1
loop
exitwhen a>7
call RemoveUnit( q[a] )
set a = a + 1
endloop
endfunction
//===========================================================================
function InitTrig_Trench_of_Fire takes nothing returns nothing
set gg_trg_Trench_of_Fire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Trench_of_Fire, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Trench_of_Fire, Condition( function Trig_Trench_of_Fire_Conditions ) )
call TriggerAddAction( gg_trg_Trench_of_Fire, function Trig_Trench_of_Fire_Actions )
endfunction


