manofsteel
New Member
- Reaction score
- 36
I submitted my spell deadly survival and changed some things in it, for some reason it gives me an error on:
''Expect a code statement''
I have problably just done something wrong since I'm new to JASS,
thanks.
''Expect a code statement''
I have problably just done something wrong since I'm new to JASS,
thanks.
JASS:
function Trig_DS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A000039; //the ability that's being casted
endfunction
function Trig_dead takes nothing returns boolean
return IsUnitType (GetFilterUnit (), UNIT_TYPE_DEAD)
endfunction
function Trig_DS_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local real x = GetUnitX(c)
local real y = GetUnitY(c)
local unit pu
local group g = CreateGroup()
local real r = 20 + (R2I(GetUnitAbilityLevel(c, 039;A000039; *(5))))
call GroupEnumUnitsInRange(g, x, y, 800.00, Condition(function Trig_dead))
loop
set pu = FirstOfGroup(g)
exitwhen pu == null
call GroupRemoveUnit(g, pu)
if IsUnitEnemy(pu, GetOwningPlayer(c)) == true then
call SetUnitState (c, UNIT_STATE_LIFE, GetWidgetLife(c) + r )
call RemoveUnit( pu )
else
call SetUnitState (c, UNIT_STATE_MANA, GetUnitState(c, UNIT_STATE_MANA) + r )
call RemoveUnit( pu )
endif
endloop
call DestroyGroup(g)
set g = null
set c = null
endfunction
//===========================================================================
function InitTrig_DS takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_DS_Conditions ) )
call TriggerAddAction( t, function Trig_DS_Actions )
endfunction