I just completed a JASS frost nova spell and I am trying to add another aspect. Basically if the level of his passive is greater then 0 he has a chance when frost novaing to have a dummy unit frost nova one of the units damaged by the initial frost nova. But I am getting a syntax error in an odd place and I don't no what to do to fix it...
This is the individual line that gets the error:
This is the actual code:
EDIT: JassCraft says line 14 is missing endfunction....
This is the individual line that gets the error:
JASS:
function action takes nothing returns nothing
This is the actual code:
JASS:
scope FrostNova initializer Init
function check takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function FMNova takes unit FMu, player FMp, real x, real y returns nothing
call CreateUnit(FMp, 'h000', x, y, 360.000)
call UnitApplyTimedLife(GetLastCreatedUnit(), 'BOsf', 3.00)
call UnitAddAbility(GetLastCreatedUnit(), 'A002')
call SetUnitAbilityLevelSwapped( 'A002', GetLastCreatedUnit(), 1 )
call IssueTargetOrder( GetLastCreatedUnit(), "frostnova", FMu )
function action takes nothing returns nothing
local unit FMu
local player FMp
local location loc = GetSpellTargetLoc()
local unit u = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local group g = CreateGroup()
local real x = GetLocationX(loc)
local real y = GetLocationY(loc)
local real r = 200
local real d = 30 * GetUnitAbilityLevel(u,'A000')
local player p = GetOwningPlayer(u)
local boolean FMN = false
call GroupEnumUnitsInRange(g,x,y,r,null)
loop
set t = FirstOfGroup(g)
exitwhen t == null
call GroupRemoveUnit(g, t)
if IsUnitEnemy(t,p) then
call UnitDamageTarget( u, t, d, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
endif
endloop
call GroupClear(g)
set r = 100
call GroupEnumUnitsInRange(g,x,y,r,null)
loop
set t = FirstOfGroup(g)
exitwhen t == null
if GetUnitAbilityLevel(u,'A001')>0 then //marker
if GetRandomInt(1, 100)<=15+5*GetUnitAbilityLevel(u,'A001') then
if FMN == false then
call FMNova (GroupPickRandomUnit(g), p, x, y)
set FMN = true
endif
endif
endif //marker
call GroupRemoveUnit(g, t)
if IsUnitEnemy(t,p) then
call UnitDamageTarget( u, t, d, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null)
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
private function Init takes nothing returns nothing
local trigger tr = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(tr, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(tr, Condition(function check))
call TriggerAddAction(tr, function action)
endfunction
endscope
EDIT: JassCraft says line 14 is missing endfunction....