| 04-28-2007, 04:35 AM | #1 |
I keep getting an "expecting function call" error for this call: Code:
Dark Ritual
Events
Conditions
Actions
Advanced - For Stack_castingunit[Stack_numberSpells] Increase mana maximum by 150
Unit - Set mana of Stack_castingunit[Stack_numberSpells] to ((Max mana of Stack_castingunit[Stack_numberSpells]) + 150.00)
Custom script: call Trig_Dark_Ritual_Undo_Actions()Code:
function Trig_Dark_Ritual_Undo_Actions takes nothing returns nothing
local unit u = udg_Stack_castingunit[udg_Stack_numberSpells]
call PolledWait( 30.00 )
call ChangeMana( u, false, 150 )
call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, u) - 150.00 ) )
endfunction
//===========================================================================
function InitTrig_Dark_Ritual_Undo takes nothing returns nothing
set gg_trg_Dark_Ritual_Undo = CreateTrigger( )
call TriggerAddAction( gg_trg_Dark_Ritual_Undo, function Trig_Dark_Ritual_Undo_Actions )
endfunction
Code:
local unit u = udg_Stack_castingunit[udg_Stack_numberSpells] |
| 04-28-2007, 03:22 PM | #2 |
"Expected code"? Do you have WEU's advanced triggers installed in the map? Also, use http://www.wc3campaigns.net/misc.php?do=bbcode#jass and http://www.wc3campaigns.net/misc.php?do=bbcode#trigger tags next time |
| 04-30-2007, 01:25 AM | #3 |
Function A can call Function B, but only if B is above A in the map script. If your "Dark Ritual Undo" trigger is below "Dark Ritual" in the list of triggers, you will get an error. |
| 04-30-2007, 11:28 AM | #4 |
Considering it's already a part of another trigger it might be easier to do call TriggerExecute(gg_trg_Dark_Ritual_Undo) |
