U
Unregistered
Guest
Hi i want to know what, thes 3 triggers does?
//===========================================================================
// Trigger: Weapon Move 1
//===========================================================================
function Trig_Weapon_Move_1_Func001A takes nothing returns nothing
call SetUnitPositionLoc( udg_PlayerShip_Control[GetConvertedPlayerId(GetEnumPlayer())], GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetEnumPlayer())]) )
endfunction
function Trig_Weapon_Move_1_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Weapon_Move_1_Func001A )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_1 takes nothing returns nothing
set gg_trg_Weapon_Move_1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Weapon_Move_1, 2.00 )
call TriggerAddAction( gg_trg_Weapon_Move_1, function Trig_Weapon_Move_1_Actions )
endfunction
//===========================================================================
// Trigger: Weapon Move 2
//===========================================================================
function Trig_Weapon_Move_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'u00P' ) ) then
return false
endif
return true
endfunction
function Trig_Weapon_Move_2_Func001A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), PolarProjectionBJ(GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))]), GetRandomReal(0.00, 128.00), GetRandomReal(0.01, 360.00)) )
call IssueTargetOrderBJ( GetEnumUnit(), "attack", udg_PlayerShip_Target[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] )
endfunction
function Trig_Weapon_Move_2_Actions takes nothing returns nothing
call ForGroupBJ( udg_PlayerShip_Cannons[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], function Trig_Weapon_Move_2_Func001A )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_2 takes nothing returns nothing
set gg_trg_Weapon_Move_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Weapon_Move_2, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Weapon_Move_2, Condition( function Trig_Weapon_Move_2_Conditions ) )
call TriggerAddAction( gg_trg_Weapon_Move_2, function Trig_Weapon_Move_2_Actions )
endfunction
//===========================================================================
// Trigger: Weapon Move 3
//===========================================================================
function Trig_Weapon_Move_3_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_ANCIENT) == true ) ) then
return false
endif
if ( not ( DistanceBetweenPoints(GetUnitLoc(GetAttacker()), GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))])) > 256.00 ) ) then
return false
endif
return true
endfunction
function Trig_Weapon_Move_3_Actions takes nothing returns nothing
call SetUnitPositionLoc( GetAttacker(), GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))]) )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_3 takes nothing returns nothing
set gg_trg_Weapon_Move_3 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Weapon_Move_3, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Weapon_Move_3, Condition( function Trig_Weapon_Move_3_Conditions ) )
call TriggerAddAction( gg_trg_Weapon_Move_3, function Trig_Weapon_Move_3_Actions )
endfunction
//===========================================================================
// Trigger: Weapon Move 1
//===========================================================================
function Trig_Weapon_Move_1_Func001A takes nothing returns nothing
call SetUnitPositionLoc( udg_PlayerShip_Control[GetConvertedPlayerId(GetEnumPlayer())], GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetEnumPlayer())]) )
endfunction
function Trig_Weapon_Move_1_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Weapon_Move_1_Func001A )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_1 takes nothing returns nothing
set gg_trg_Weapon_Move_1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Weapon_Move_1, 2.00 )
call TriggerAddAction( gg_trg_Weapon_Move_1, function Trig_Weapon_Move_1_Actions )
endfunction
//===========================================================================
// Trigger: Weapon Move 2
//===========================================================================
function Trig_Weapon_Move_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'u00P' ) ) then
return false
endif
return true
endfunction
function Trig_Weapon_Move_2_Func001A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), PolarProjectionBJ(GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))]), GetRandomReal(0.00, 128.00), GetRandomReal(0.01, 360.00)) )
call IssueTargetOrderBJ( GetEnumUnit(), "attack", udg_PlayerShip_Target[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] )
endfunction
function Trig_Weapon_Move_2_Actions takes nothing returns nothing
call ForGroupBJ( udg_PlayerShip_Cannons[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], function Trig_Weapon_Move_2_Func001A )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_2 takes nothing returns nothing
set gg_trg_Weapon_Move_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Weapon_Move_2, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Weapon_Move_2, Condition( function Trig_Weapon_Move_2_Conditions ) )
call TriggerAddAction( gg_trg_Weapon_Move_2, function Trig_Weapon_Move_2_Actions )
endfunction
//===========================================================================
// Trigger: Weapon Move 3
//===========================================================================
function Trig_Weapon_Move_3_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_ANCIENT) == true ) ) then
return false
endif
if ( not ( DistanceBetweenPoints(GetUnitLoc(GetAttacker()), GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))])) > 256.00 ) ) then
return false
endif
return true
endfunction
function Trig_Weapon_Move_3_Actions takes nothing returns nothing
call SetUnitPositionLoc( GetAttacker(), GetUnitLoc(udg_PlayerShip[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))]) )
endfunction
//===========================================================================
function InitTrig_Weapon_Move_3 takes nothing returns nothing
set gg_trg_Weapon_Move_3 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Weapon_Move_3, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Weapon_Move_3, Condition( function Trig_Weapon_Move_3_Conditions ) )
call TriggerAddAction( gg_trg_Weapon_Move_3, function Trig_Weapon_Move_3_Actions )
endfunction