the trigger wont enable wen i save or try testing the map a screen come's up saying 35 error's this is his trigger he has.
//TESH.scrollpos=0
//TESH.alwaysfold=0
scope ShockArtillery
globals
private constant integer Number = 10 // This indicates the number of artillery attacks.
private constant integer ArtilleryUnit = 'h000' // This is the rawcode of the artillery unit.
private constant integer AbilityCode = 'A000' // This is the rawcode of the actual artillery ability.
private constant integer Range = 400 // This is the range of the attack area of the artillery units.
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == AbilityCode
endfunction
private function ShockArtilleryActions takes nothing returns nothing
local location targetloc = GetSpellTargetLoc()
local location UnitLoc = PolarProjectionBJ(targetloc, 4000, GetUnitFacing(GetTriggerUnit()) + 180)
local location RandomLoc
local integer count = 0
local integer AbilityLevel = GetUnitAbilityLevel(GetTriggerUnit(), AbilityCode)
local unit Artillery
loop
exitwhen count >= Number*AbilityLevel
set count = count + 1
set Artillery = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), ArtilleryUnit, UnitLoc, 0.00)
set RandomLoc = PolarProjectionBJ(targetloc, GetRandomInt(0, Range/2), GetRandomReal(0, 360))
call IssuePointOrderLoc( Artillery, "attackground", RandomLoc )
call UnitApplyTimedLife(Artillery, 'BTLF', 1.50)
call PolledWait(GetRandomReal(0.10, 0.85))
call RemoveLocation(RandomLoc)
endloop
call RemoveLocation(targetloc)
call RemoveLocation(UnitLoc)
set targetloc = null
set UnitLoc = null
set RandomLoc = null
endfunction
//===========================================================================
public function InitTrig takes nothing returns nothing
local trigger ShockArtillery = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(ShockArtillery, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ShockArtillery, Condition(function Conditions))
call TriggerAddAction( ShockArtillery, function ShockArtilleryActions )
endfunction
endscope