Spell help

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:
JASS:
function Trig_DS_Actions takes nothing returns nothing

''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() == 'A000'     //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, 'A000' *(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
 
Reaction score
456
Doesn't give me any errors. Try disabling that trigger, then save again and see if it still gives you the error.
 
Reaction score
456
This code compiles just fine for me. Are you sure that there's no other functions/anything before the condition function? And do you have any other triggers in your map than this?
 

manofsteel

New Member
Reaction score
36
There's no functions before the condition function.
The other triggers are in GUI so I don't really think they do any harm.

edit> I will try it in another map and see if it works.

edit2> It still gives me the error, could anyone put the trigger in a map and upload it here?
 

phyrex1an

Staff Member and irregular helper
Reaction score
446
Do you have another trigger with the same name? Paste the few lines before the highlighted line in the error message please.

I don't really think it makes an difference but here is the trigger in another map:
 

Attachments

  • remove.w3m
    16.6 KB · Views: 101
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top