Hi,
there is an error but the syntax check fail to find it.
[Jass=]
function FireSpread takes nothing returns nothing
local real x
local real x1
local real y
local real y1
local real n
local real d
local unit fire
local integer chance
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
set n = GetRandomReal(0, 360)
set d = GetRandomReal(1000., 2000.)
set x1 = x + d * Cos(n * bj_DEGTORAD)
set y1 = y + d * Sin(n * bj_DEGTORAD)
if IsTerrainPathable( x1, y1, PATHING_TYPE_FLOATABILITY) then
set chance = GetUnitUserData(GetTriggerUnit())
if GetRandomInt(1, chance )== 1 and chance < 5 then
set fire = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n00S', x1, y1, bj_UNIT_FACING)
call SetUnitUserData( fire, chance + 1)
if udg_Rain == false and ugd_Wind == false then
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 60.) )
call SetUnitAbilityLevel( fire, 'A0H7', 2 )
else
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 40.) )
if udg_Rain then
call SetUnitAbilityLevel( fire, 'A0H7', 1 )
else
call SetUnitAbilityLevel( fire, 'A0H7', 3 )
endif
endif
else
set fire = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n00R', x1, y1, bj_UNIT_FACING)
if udg_Rain == false and ugd_Wind == false then
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 60.) )
call SetUnitAbilityLevel( fire, 'A0H7', 2 )
else
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 40.) )
if udg_Rain then
call SetUnitAbilityLevel( fire, 'A0H7', 1 )
else
call SetUnitAbilityLevel( fire, 'A0H7', 3 )
endif
endif
endif
endif
set fire =null
endfunction
//===========================================================================
function InitTrig_ForestFire_Spread_JASS takes nothing returns nothing
set gg_trg_ForestFire_Spread_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_ForestFire_Spread_JASS, function FireSpread )
endfunction
[/code]
the trigger is run from a unit die trigger.
i am not sure but maybe the polar offset part i tried to do bug...?
i cannot find anything wich would cause it not to compile...
there is an error but the syntax check fail to find it.
[Jass=]
function FireSpread takes nothing returns nothing
local real x
local real x1
local real y
local real y1
local real n
local real d
local unit fire
local integer chance
set x = GetUnitX(GetTriggerUnit())
set y = GetUnitY(GetTriggerUnit())
set n = GetRandomReal(0, 360)
set d = GetRandomReal(1000., 2000.)
set x1 = x + d * Cos(n * bj_DEGTORAD)
set y1 = y + d * Sin(n * bj_DEGTORAD)
if IsTerrainPathable( x1, y1, PATHING_TYPE_FLOATABILITY) then
set chance = GetUnitUserData(GetTriggerUnit())
if GetRandomInt(1, chance )== 1 and chance < 5 then
set fire = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n00S', x1, y1, bj_UNIT_FACING)
call SetUnitUserData( fire, chance + 1)
if udg_Rain == false and ugd_Wind == false then
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 60.) )
call SetUnitAbilityLevel( fire, 'A0H7', 2 )
else
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 40.) )
if udg_Rain then
call SetUnitAbilityLevel( fire, 'A0H7', 1 )
else
call SetUnitAbilityLevel( fire, 'A0H7', 3 )
endif
endif
else
set fire = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n00R', x1, y1, bj_UNIT_FACING)
if udg_Rain == false and ugd_Wind == false then
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 60.) )
call SetUnitAbilityLevel( fire, 'A0H7', 2 )
else
call SetUnitState(fire, UNIT_STATE_LIFE, GetRandomReal(20., 40.) )
if udg_Rain then
call SetUnitAbilityLevel( fire, 'A0H7', 1 )
else
call SetUnitAbilityLevel( fire, 'A0H7', 3 )
endif
endif
endif
endif
set fire =null
endfunction
//===========================================================================
function InitTrig_ForestFire_Spread_JASS takes nothing returns nothing
set gg_trg_ForestFire_Spread_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_ForestFire_Spread_JASS, function FireSpread )
endfunction
[/code]
the trigger is run from a unit die trigger.
i am not sure but maybe the polar offset part i tried to do bug...?
i cannot find anything wich would cause it not to compile...