- Joined
- Jul 18, 2004
- Messages
- 11
Ok, my spell is basically a Shockwave that teleports the casting unit to the targeted point. It worked fine with GUI but after reading a couple of tutorials I thought I'd see if I could make it in JASS too. Here's what I have:
Every time I try and test the map I get a message saying that it 'Expected a code statement' in all the lines that involve changing the unit in some way. I know that you can call a function instead, but I read somewhere that this way reduces lag. Can anyone point me in the right direction?
Code:
function Trig_Flame_Burst_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Burst_Copy_Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local unit u = GetTriggerUnit()
PauseUnit takes unit u, boolean true returns nothing
SetUnitFlyHeight takes unit u, real 0, real 0 returns nothing
SetUnitPositionLoc takes u, location , GetLocationX(l), GetLocationY(l), returns nothing
SetUnitFlyHeight takes unit u, GetUnitDefaultFlyHeightu, real 0 returns nothing
PauseUnit takes unit u boolean false returns nothing
endfunction
//===========================================================================
function InitTrig_Flame_Burst_Copy takes nothing returns nothing
set gg_trg_Flame_Burst_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Burst_Copy, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Flame_Burst_Copy, Condition( function Trig_Flame_Burst_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Burst_Copy, function Trig_Flame_Burst_Copy_Actions )
endfunction