function Trig_Chain_Storm_Bolt_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A004' ) ) then
return false
endif
return true
endfunction function Trig_Chain_Storm_Bolt_Func012003001 takes nothing returns boolean
return ( udg_StormBoltUnit[2] == null )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003001 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[1] )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003002002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003002002002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func012003002002001003002002001(), Trig_Chain_Storm_Bolt_Func012003002002001003002002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func012003002002001003002001(), Trig_Chain_Storm_Bolt_Func012003002002001003002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func012003002002001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func012003002002001003001(), Trig_Chain_Storm_Bolt_Func012003002002001003002() )
endfunction
function Trig_Chain_Storm_Bolt_Func021003001 takes nothing returns boolean
return ( udg_StormBoltUnit[3] == null )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003001001 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[1] )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003001002 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[2] )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003001 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func021003002002001003001001(), Trig_Chain_Storm_Bolt_Func021003002002001003001002() )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003002002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003002002002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func021003002002001003002002001(), Trig_Chain_Storm_Bolt_Func021003002002001003002002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func021003002002001003002001(), Trig_Chain_Storm_Bolt_Func021003002002001003002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func021003002002001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func021003002002001003001(), Trig_Chain_Storm_Bolt_Func021003002002001003002() )
endfunction
function Trig_Chain_Storm_Bolt_Func030003001 takes nothing returns boolean
return ( udg_StormBoltUnit[4] == null )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003001001 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[1] )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003001002001 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[2] )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003001002002 takes nothing returns boolean
return ( GetFilterUnit() != udg_StormBoltUnit[3] )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003001002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func030003002002001003001002001(), Trig_Chain_Storm_Bolt_Func030003002002001003001002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003001 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func030003002002001003001001(), Trig_Chain_Storm_Bolt_Func030003002002001003001002() )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003002002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003002002002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func030003002002001003002002001(), Trig_Chain_Storm_Bolt_Func030003002002001003002002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func030003002002001003002001(), Trig_Chain_Storm_Bolt_Func030003002002001003002002() )
endfunction
function Trig_Chain_Storm_Bolt_Func030003002002001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Chain_Storm_Bolt_Func030003002002001003001(), Trig_Chain_Storm_Bolt_Func030003002002001003002() )
endfunction
function Trig_Chain_Storm_Bolt_Actions takes nothing returns nothing
// ïåðâàÿ öåëü
set udg_StormBoltUnit[1] = GetSpellTargetUnit()
set udg_TempPoint = GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), udg_TempPoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A000', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", udg_StormBoltUnit[1] )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint)
// âòîðàÿ öåëü
call PolledWait( ( DistanceBetweenPoints(GetUnitLoc(GetTriggerUnit()), GetUnitLoc(udg_StormBoltUnit[1])) / 1000.00 ) )
set udg_TempPoint = GetUnitLoc(udg_StormBoltUnit[1])
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Chain_Storm_Bolt_Func012003001() ) then
set udg_StormBoltUnit[2] = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(( 100.00 * I2R(GetForLoopIndexA()) ), udg_TempPoint, Condition(function Trig_Chain_Storm_Bolt_Func012003002002001003)))
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), udg_TempPoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A001', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", udg_StormBoltUnit[2] )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint)
// òðåòüÿ öåëü
call PolledWait( ( DistanceBetweenPoints(GetUnitLoc(udg_StormBoltUnit[1]), GetUnitLoc(udg_StormBoltUnit[2])) / 1000.00 ) )
set udg_TempPoint = GetUnitLoc(udg_StormBoltUnit[2])
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Chain_Storm_Bolt_Func021003001() ) then
set udg_StormBoltUnit[3] = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(( 100.00 * I2R(GetForLoopIndexA()) ), udg_TempPoint, Condition(function Trig_Chain_Storm_Bolt_Func021003002002001003)))
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), udg_TempPoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A002', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", udg_StormBoltUnit[3] )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint)
// ÷åòâåðòàÿ öåëü
call PolledWait( ( DistanceBetweenPoints(GetUnitLoc(udg_StormBoltUnit[2]), GetUnitLoc(udg_StormBoltUnit[3])) / 1000.00 ) )
set udg_TempPoint = GetUnitLoc(udg_StormBoltUnit[3])
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Chain_Storm_Bolt_Func030003001() ) then
set udg_StormBoltUnit[4] = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(( 100.00 * I2R(GetForLoopIndexA()) ), udg_TempPoint, Condition(function Trig_Chain_Storm_Bolt_Func030003002002001003)))
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), udg_TempPoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A003', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", udg_StormBoltUnit[4] )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint)
// ---
set udg_StormBoltUnit[1] = null
set udg_StormBoltUnit[2] = null
set udg_StormBoltUnit[3] = null
set udg_StormBoltUnit[4] = null
endfunction
//===========================================================================
function InitTrig_Chain_Storm_Bolt takes nothing returns nothing
set gg_trg_Chain_Storm_Bolt = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chain_Storm_Bolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chain_Storm_Bolt, Condition( function Trig_Chain_Storm_Bolt_Conditions ) )
call TriggerAddAction( gg_trg_Chain_Storm_Bolt, function Trig_Chain_Storm_Bolt_Actions )
endfunction