- Joined
- Jul 16, 2009
- Messages
- 42
can someone help me check for leak int his script and convert it to JASS. +rep and credit in my map
JASS:
function Trig_abilityFreezingField_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00A' ) ) then
return false
endif
return true
endfunction
function Trig_abilityFreezingField_Actions takes nothing returns nothing
set udg_casterFreezingFeild = GetSpellAbilityUnit()
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 300.00, ( 0.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 10.00, 1000000000.00 )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 290.00, ( 60.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 88.00, 1000000000.00 )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 260.00, ( 120.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 160.00, 1000000000.00 )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 212.00, ( 180.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 222.00, 1000000000.00 )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 150.00, ( 240.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 270.00, 1000000000.00 )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(udg_casterFreezingFeild), PolarProjectionBJ(GetUnitLoc(udg_casterFreezingFeild), 77.00, ( 300.00 + ( 180.00 * I2R(GetForLoopIndexA()) ) )), bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), R2I(AngleBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit()))) )
call SetUnitLifeBJ( GetLastCreatedUnit(), DistanceBetweenPoints(GetUnitLoc(udg_casterFreezingFeild), GetUnitLoc(GetLastCreatedUnit())) )
call UnitAddAbilityBJ( udg_abilityFreezingFeildLvl[GetUnitAbilityLevelSwapped('A00A', udg_casterFreezingFeild)], GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 300.00, 1000000000.00 )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_abilityFreezingField takes nothing returns nothing
set gg_trg_abilityFreezingField = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_abilityFreezingField, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_abilityFreezingField, Condition( function Trig_abilityFreezingField_Conditions ) )
call TriggerAddAction( gg_trg_abilityFreezingField, function Trig_abilityFreezingField_Actions )
endfunction
Last edited: