D.V.D
Make a wish
- Reaction score
- 73
I made a function and the syntax expects endifs when I added If/Then/Elses. It expects endifs from the variables making it expect variable names from all functions using these variables.
JASS:
scope Kamehameha initializer Init
globals
private constant unit Caster = GetTriggerUnit()
//This is the main caster who revolves around the trigger and spell Kamehameha
private unit u0
//This is the first leading missile
private unit u1
//This is the second leading missile
private constant integer Array
//This is the array that counts in killing the laser and conditions for slide
endglobals
private function Check1 takes nothing returns boolean
if ( not ( Array == 200 ) ) then
return false
endif
return true
endfunction
private function Check2 takes nothing returns boolean
if ( not ( Array != 200 ) ) then
return false
endif
return true
endfunction
private function KSlide takes nothing returns nothing
local unit array Laser
local location s0 = GetUnitLoc(u0)
local location s1 = GetUnitLoc(u1)
local location s2 = PolarProjectionBJ(s0, 9.00, GetUnitFacing(gg_unit_H008_0015))
local location s3 = PolarProjectionBJ(s1, 9.00, GetUnitFacing(gg_unit_H008_0015))
local integer i
local integer e
local timer t = GetExpiredTimer()
if ( Check1() ) then
call SetUnitPositionLoc( u0, s2 )
call SetUnitPositionLoc( u1, s3 )
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h006039;, GetOwningPlayer(gg_unit_H008_0015), s2, s2 )
set Laser[udg_Array] = GetLastCreatedUnit()
call PauseUnit( Laser[udg_Array], true )
call SetUnitTimeScale( Laser[Array], 0.00 )
set udg_Array = Array + 1
call TimerStart(t, 0.01, true, function KSlide)
if ( Check2() ) then
set i = 1
set e = udg_Array
loop
exitwhen i > e
call KillUnit( Laser<i> )
set Laser<i> = null
set i = i + 1
endloop
else
endif
else
endif
endfunction
private function KActions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit u0
local unit u1
local unit d
local location p0 = GetUnitLoc(gg_unit_H008_0015)
local location p1 = PolarProjectionBJ(p0, 30.00, ( GetUnitFacing(gg_unit_H008_0015) - 90.00 ))
local location p2
local location p3
local location p4
local integer i = 1
local integer e
local real size
local timer t = CreateTimer()
call SetUnitAnimation( gg_unit_H008_0015, "spell slam" )
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p1, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call TriggerSleepAction( 0.10 )
call SetUnitTimeScale( gg_unit_H008_0015, 0.00 )
set i = 1
set e = 10
loop
exitwhen i > e
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p1, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call TriggerSleepAction( 0.10 )
set i = i + 1
endloop
call SetUnitTimeScale( gg_unit_H008_0015, 100 )
call SetUnitAnimation( gg_unit_H008_0015, "spell" )
set size = 90.00
set i = 1
set e = 4
loop
exitwhen i > e
set p2 = PolarProjectionBJ(p0, 30.00, ( GetUnitFacing(gg_unit_H008_0015) - size ))
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p2, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
set size = ( size - 22.50 )
call TriggerSleepAction( 0.10 )
set i = i + 1
endloop
call SetUnitTimeScale( gg_unit_H008_0015, 0.00 )
set i = 1
set e = 2
loop
exitwhen i > e
call CreateNUnitsAtLoc( 1, 039;h00D039;, GetOwningPlayer(gg_unit_H008_0015), p0, ( GetUnitFacing(gg_unit_H008_0015) + 90.00 ) )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p2, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call TriggerSleepAction( 0.10 )
set i = i + 1
endloop
call TriggerSleepAction( 0.20 )
call CreateNUnitsAtLoc( 1, 039;h00D039;, GetOwningPlayer(gg_unit_H008_0015), p0, ( GetUnitFacing(gg_unit_H008_0015) + 90.00 ) )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p2, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call TriggerSleepAction( 0.10 )
set p2 = PolarProjectionBJ(p0, 200.00, GetUnitFacing(gg_unit_H008_0015))
call CreateNUnitsAtLoc( 1, 039;h00G039;, GetOwningPlayer(gg_unit_H008_0015), p2, ( GetUnitFacing(gg_unit_H008_0015) + 90.00 ) )
set u0 = GetLastCreatedUnit()
call PauseUnit( u0, true )
call TriggerSleepAction( 0.10 )
call CreateNUnitsAtLoc( 1, 039;h007039;, GetOwningPlayer(gg_unit_H008_0015), p2, ( GetUnitFacing(gg_unit_H008_0015) + 90.00 ) )
set u1 = GetLastCreatedUnit()
call PauseUnit( u1, true )
call SetUnitTimeScale( u1, 0.00 )
set Array = 1
call TimerStart(t, 0.01, true, function KSlide)
set p2 = PolarProjectionBJ(p0, 30.00, ( GetUnitFacing(gg_unit_H008_0015) - size ))
set i = 1
set e = 10
loop
exitwhen i > e
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00F039;, GetOwningPlayer(gg_unit_H008_0015), p2, p0 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call TriggerSleepAction( 0.10 )
set i = i + 1
endloop
call CreateNUnitsAtLocFacingLocBJ( 1, 039;h00B039;, GetOwningPlayer(gg_unit_H008_0015), p3, p3 )
set d = GetLastCreatedUnit()
call PauseUnit( d, true )
call SetUnitScale( d, 100.00, 100.00, 100.00 )
call KillUnit( u0 )
call KillUnit( u1 )
call UnitApplyTimedLife( d, 039;BTLF039;, 1.00 )
call SetUnitTimeScale( gg_unit_H008_0015, 100 )
call ResetUnitAnimation( gg_unit_H008_0015 )
call RemoveLocation(p0)
call RemoveLocation(p1)
call RemoveLocation(p2)
call RemoveLocation(p3)
call RemoveLocation(p4)
set Caster = null
set u0 = null
set u1 = null
set d = null
endfunction
//===========================================================================
private function InitTrig_Kamehameha takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ( t, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_LEFT )
call TriggerAddAction( t, function KActions )
endfunction
endscope</i></i>