function MoveUnitToPolarProjection takes unit tomove, real dist, real angle returns nothing
call SetUnitPosition(tomove, GetUnitX(tomove) + dist * Cos(angle * bj_DEGTORAD) , GetUnitY(tomove) + dist * Sin(angle * bj_DEGTORAD))
call SetUnitFacingTimed( tomove, angle, 0 )
endfunction
function ClearTextForPlayer takes player p returns nothing
local force f=GetForceOfPlayer(p)
local integer i=0
loop
exitwhen i>20
call DisplayTimedTextToForce(f,0.05," ")
set i=i+1
endloop
call DestroyForce(f)
set f=null
endfunction
function InLast takes player p returns boolean
local boolean result=true
local integer i=0
local integer v1
local integer v2
loop
exitwhen i>11
if Player(i)==p then
set i=i+1
endif
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set v1=udg_PlayerKills[i+1]
set v2=udg_PlayerKills[GetConvertedPlayerId(p)]
if v1<=v2 then
set result=false
endif
endif
set i=i+1
endloop
return result
endfunction
function InFirst takes player p returns boolean
local boolean result=true
local integer i=0
local integer v1
local integer v2
loop
exitwhen i>11
if Player(i)==p then
set i=i+1
endif
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set v1=udg_PlayerKills[i+1]
set v2=udg_PlayerKills[GetConvertedPlayerId(p)]
if v1>=v2 then
set result=false
endif
endif
set i=i+1
endloop
return result
endfunction
function DrawBar takes player p,real t,string s, real full, real total returns nothing
local integer i=1
local string filled=""
local string empty=""
local string color
local string complete
local force f=GetForceOfPlayer(p)
if (full/total)>=0.80 then
set color="|cff00FF00"
elseif (full/total)>=0.40 and (full/total)<0.80 then
set color="|cffFF9900"
elseif (full/total)<0.40 then
set color="|cffFF0000"
endif
loop
exitwhen i>full
set filled=filled + "I"
set i=i+1
endloop
set filled=color+filled+"|r"
set i=1
loop
exitwhen i>total-full
set empty=empty + "I"
set i=i+1
endloop
set complete=s+" "+filled+empty
call DisplayTimedTextToForce( f,t, complete )
call DestroyForce(f)
set f=null
set complete=null
set filled=null
set empty=null
set color=null
endfunction
Name | Type | is_array | initial_value |
AddHeight | real | Yes | |
ArenaSize | dialog | No | |
ASButtons | button | Yes | |
Cache | gamecache | No | |
Collided | boolean | Yes | |
CollideTrigs | trigger | Yes | |
CollisionRects | rect | Yes | RectNull |
Comp_Integrity | integer | Yes | 3 |
Comp_Speed | integer | Yes | 3 |
CompJedPlanes | group | No | |
CompNames | string | Yes | |
CompPlaneSelect | unit | No | |
CompSitPlanes | group | No | |
CompTemp | unit | No | |
ComputerTempUnit | unit | No | |
CurrentVote | trigger | No | |
DeathFacing | real | No | |
Dialog | dialog | No | |
DistancePhotonTorp | real | No | |
FFAButton | button | No | |
GameEnding | timer | No | |
GameSelector | dialog | No | |
goingdown | boolean | Yes | |
goingup | boolean | Yes | |
HeightQue | real | Yes | |
HeightSet | dialog | No | |
HommingMissles | group | No | |
JedivsSithButton | button | No | |
KillAmount | dialog | No | |
KillBoard | leaderboard | No | |
KillMount | button | Yes | |
KillsBoard | multiboard | No | |
LastHeight | integer | Yes | 0 |
LBMoveDistance | real | No | |
LongButton | button | No | |
MaxHeight | integer | No | |
MHMount | button | Yes | |
Missles | group | No | |
ModeName | string | No | |
NextHeight | integer | Yes | |
PFT | location | Yes | |
Pick_Dialogue | dialog | Yes | |
PickedUnit | unit | No | |
Plane | unit | Yes | |
Planess | group | No | |
Player_Attack | integer | Yes | 3 |
Player_Color | string | Yes | |
Player_Integrity | integer | Yes | 3 |
Player_Missle | integer | Yes | 3 |
Player_PlaneType | unitcode | Yes | h000 |
Player_Ref | player | Yes | |
Player_Revive | integer | Yes | 3 |
Player_Selection | unit | Yes | |
Player_Speed | integer | Yes | 3 |
Player_Turn | integer | Yes | 3 |
PlayerCurrent | integer | No | |
PlayerKills | integer | Yes | |
PlayersLeft | integer | No | |
PlayersVoted | integer | No | |
PlayerTotal | integer | No | |
Playing | boolean | No | |
PlayingPlayers | force | No | |
PlayingPlayers2 | integer | No | |
PlayingType | integer | No | |
RandomNumber | integer | No | |
RandomTimeForAI | integer | Yes | 0 |
Rematch | dialog | No | |
RematchNumb | integer | No | 1 |
ReNoButton | button | No | |
ReYesButton | button | No | |
SpawnRegion | rect | Yes | |
Speed | integer | Yes | 3 |
StartTimer | timer | No | |
target | unit | No | |
TargetHeight | real | Yes | |
TeamKillBoard | leaderboard | No | |
TeamKills | integer | Yes | |
Teams | force | Yes | |
Temp_Cooldown | integer | Yes | |
Temp_Integrity | integer | Yes | |
Temp_Missle | integer | Yes | |
Temp_Revive | integer | Yes | |
Temp_Speed | integer | Yes | |
Temp_Turn | integer | Yes | |
TempCompUnit2 | unit | No | UnitNull |
TempLaser | unit | No | UnitNull |
TempNumb | integer | No | |
TempNumb2 | integer | No | |
TempPGroup | force | No | |
TempTarget | unit | Yes | UnitNull |
TempTurnCompUnit | unit | No | UnitNull |
ThermalDets | group | No | |
turnleft | boolean | Yes | |
turnright | boolean | Yes | |
UnitGroupsForTrigs | group | Yes | |
VicKills | integer | No | |
VoteAS | integer | Yes | |
VoteBoard | multiboard | No | |
VoteFFA | integer | No | |
VoteHeight | integer | Yes | |
VoteKills | integer | Yes | |
VoteReNo | integer | No | |
VoteReYes | integer | No | |
VoteTeam | integer | No | |
Winner | player | No |
function Trig_Select_a_plane_Actions takes nothing returns nothing
local integer speed
local integer cooldown
local integer revive
local integer turn
local integer missle
local integer integrity
local integer mana=R2I(GetUnitStateSwap(UNIT_STATE_MAX_MANA, GetTriggerUnit()))
local string msg
local force f=GetForceOfPlayer(GetTriggerPlayer())
set udg_Player_Selection[GetConvertedPlayerId(GetTriggerPlayer())]=GetTriggerUnit()
if GetUnitTypeId(GetTriggerUnit())=='h000' then
set speed=3
set cooldown=3
set revive=3
set turn=3
set missle=3
set integrity=3
set msg="The Z-95 Starfighter: Model by: Illidan(Evil)X."
endif
if GetUnitTypeId(GetTriggerUnit())=='h004' then
set speed=5
set cooldown=3
set revive=1
set turn=3
set missle=2
set integrity=2
set msg="The Naboo Starfighter: Model by: Olofmoleman."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00C' then
set speed=4
set cooldown=2
set revive=3
set turn=4
set missle=3
set integrity=3
set msg="The ARC 170 Starfighter: Model by: Illidan(Evil)X."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00D' then
set speed=5
set cooldown=3
set revive=4
set turn=2
set missle=2
set integrity=2
set msg="The Jedi Interceptor: Model by: Illidan(Evil)X."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00H' then
set speed=3
set cooldown=4
set revive=2
set turn=4
set missle=3
set integrity=3
set msg="The X-Wing Starfighter: Model by: Domokun."
endif
if GetUnitTypeId(GetTriggerUnit())=='h005' then
set speed=2
set cooldown=4
set revive=3
set turn=2
set missle=5
set integrity=5
set msg="The Droid Starfighter: Model by: Olofmoleman."
endif
if GetUnitTypeId(GetTriggerUnit())=='h006' then
set speed=4
set cooldown=3
set revive=5
set turn=3
set missle=2
set integrity=1
set msg="The Jedi Starfighter: Model by: Olofmoleman."
endif
if GetUnitTypeId(GetTriggerUnit())=='h007' then
set speed=3
set cooldown=4
set revive=1
set turn=4
set missle=3
set integrity=4
set msg="The Advanced Tie: Model by: Tim."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00E' then
set speed=5
set cooldown=2
set revive=3
set turn=5
set missle=1
set integrity=1
set msg="The A-Wing Stargighter: Model by: Illidan(Evil)X."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00F' then
set speed=2
set cooldown=3
set revive=2
set turn=5
set missle=3
set integrity=2
set msg="The V-Wing Stargighter: Model by: Illidan(Evil)X."
endif
if GetUnitTypeId(GetTriggerUnit())=='h00M' then
set speed=3
set cooldown=3
set revive=2
set turn=4
set missle=3
set integrity=2
set msg="The Imperial Shuttle: Model by: Illidan(Evil)X."
endif
call ClearTextMessagesBJ( GetForceOfPlayer(GetTriggerPlayer()) )
call DisplayTimedTextToForce(f,3,"----------------------------------------|cff1A52E6Stats|r----------------------------------------")
call DisplayTimedTextToForce(f,3,msg)
call DrawBar(GetTriggerPlayer(),3,"Plane Speed " ,speed,5)
call DrawBar(GetTriggerPlayer(),3,"Revive Time " ,revive,5)
call DrawBar(GetTriggerPlayer(),3,"Turn Rate " ,turn,5)
call DrawBar(GetTriggerPlayer(),3,"Laser Range " ,missle,5)
call DrawBar(GetTriggerPlayer(),3,"Cargo Capacity " ,mana,5)
call DrawBar(GetTriggerPlayer(),3,"Hull Integrity " ,integrity,5)
call DisplayTimedTextToForce(f,3,"------|cff1A52E6Press Escape To Choose This Starfighter|r------")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DisplayTimedTextToForce(f,0.05," ")
call DestroyForce(f)
set udg_Temp_Speed[GetConvertedPlayerId(GetTriggerPlayer())]=speed
set udg_Temp_Cooldown[GetConvertedPlayerId(GetTriggerPlayer())]=cooldown
set udg_Temp_Revive[GetConvertedPlayerId(GetTriggerPlayer())]=revive
set udg_Temp_Turn[GetConvertedPlayerId(GetTriggerPlayer())]=turn
set udg_Temp_Missle[GetConvertedPlayerId(GetTriggerPlayer())]=missle
set udg_Temp_Integrity[GetConvertedPlayerId(GetTriggerPlayer())]=integrity
set f=null
endfunction
//===========================================================================
function InitTrig_Select_a_plane takes nothing returns nothing
local integer i=0
set gg_trg_Select_a_plane = CreateTrigger( )
loop
exitwhen i>11
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Select_a_plane, Player(i), true )
set i=i+1
endloop
call TriggerAddAction( gg_trg_Select_a_plane, function Trig_Select_a_plane_Actions )
endfunction
function Add_Homming_Missle takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local gamecache g=udg_Cache
local player p=Player(GetStoredIntegerBJ("Player", I2S(H2I(t)), g))
//local player p=udg_Player_Ref[H2I(t)]
//call DisplayTextToForce(GetPlayersAll(),I2S(GetStoredIntegerBJ("Player", I2S(H2I(t)), g)))
if InFirst(p)==false and InLast(p)==false then
call AdjustPlayerStateBJ( 1, p, PLAYER_STATE_RESOURCE_GOLD )
elseif InLast(p) then
call AdjustPlayerStateBJ( 2, p, PLAYER_STATE_RESOURCE_GOLD )
endif
set p=null
set t=null
set g=null
endfunction
function Trig_Create_Homming_Timers_Actions takes nothing returns nothing
local trigger t
local gamecache g=udg_Cache
local integer i=0
loop
exitwhen i>11
set t=CreateTrigger()
//set udg_Player_Ref[H2I(t)]=Player(i)
call StoreIntegerBJ( i, "Player", I2S(H2I(t)), g )
call TriggerAddAction(t,function Add_Homming_Missle)
call TriggerRegisterTimerEventPeriodic( t,(5-udg_Player_Attack[i+1])*5+20 )
set i=i+1
endloop
set t=null
set g=null
endfunction
//===========================================================================
function InitTrig_Create_Homming_Timers takes nothing returns nothing
set gg_trg_Create_Homming_Timers = CreateTrigger( )
call TriggerAddAction( gg_trg_Create_Homming_Timers, function Trig_Create_Homming_Timers_Actions )
endfunction
function Trig_set_camera_Func003Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(ConvertedPlayer(GetForLoopIndexA())) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_set_camera_Actions takes nothing returns nothing
local location TempPoint
call CameraSetSmoothingFactorBJ( 0.20 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 12
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_set_camera_Func003Func001C() ) then
call ClearTextForPlayer(ConvertedPlayer(GetForLoopIndexA()))
set TempPoint=GetRectCenter(GetPlayableMapRect())
call CreateNUnitsAtLocFacingLocBJ( 1, udg_Player_PlaneType[GetForLoopIndexA()], ConvertedPlayer(GetForLoopIndexA()), GetPlayerStartLocationLoc(ConvertedPlayer(GetForLoopIndexA())), TempPoint )
call RemoveLocation(TempPoint)
set udg_Plane[GetForLoopIndexA()] = GetLastCreatedUnit()
call PanCameraToTimedLocWithZForPlayer( ConvertedPlayer(GetForLoopIndexA()), GetUnitLoc(udg_Plane[GetForLoopIndexA()]), GetUnitFlyHeight(udg_Plane[GetForLoopIndexA()]), 0 )
call SetCameraTargetControllerNoZForPlayer( ConvertedPlayer(GetForLoopIndexA()), udg_Plane[GetForLoopIndexA()], 0, 0, false )
call SetCameraFieldForPlayer( ConvertedPlayer(GetForLoopIndexA()), CAMERA_FIELD_TARGET_DISTANCE, 1000.00, 0 )
call CreateFogModifierRectBJ( true, ConvertedPlayer(GetForLoopIndexA()), FOG_OF_WAR_VISIBLE, GetPlayableMapRect() )
call SelectUnitForPlayerSingle( udg_Plane[GetForLoopIndexA()], ConvertedPlayer(GetForLoopIndexA()) )
call RemoveLocation(TempPoint)
set TempPoint=GetUnitLoc(udg_Plane[GetForLoopIndexA()])
set udg_LastHeight[GetForLoopIndexA()]=GetTerrainCliffLevelBJ(TempPoint)
call RemoveLocation(TempPoint)
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetSkyModel( "Environment\\Sky\\DalaranSky\\DalaranSky.mdl" )
call EnableTrigger( gg_trg_move )
call EnableTrigger( gg_trg_Camera )
call EnableTrigger( gg_trg_upanddown )
call EnableTrigger( gg_trg_upanddown )
call DestroyTrigger(gg_trg_Select_a_plane)
call DestroyTrigger(gg_trg_Choose_a_plane)
call DestroyTrigger(GetTriggeringTrigger())
set TempPoint=null
endfunction
//===========================================================================
function InitTrig_set_camera takes nothing returns nothing
set gg_trg_set_camera = CreateTrigger( )
call TriggerAddAction( gg_trg_set_camera, function Trig_set_camera_Actions )
endfunction
function Trig_Revive_Conditions takes nothing returns boolean
if (GetTriggerUnit() == udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())]) then
return true
endif
return false
endfunction
function Trig_Revive_Func006C takes nothing returns boolean
if ( not ( GetPlayerSlotState(GetTriggerPlayer()) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Revive_Actions takes nothing returns nothing
local location TempPoint
set TempPoint = GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'h003', GetTriggerPlayer(), TempPoint, bj_UNIT_FACING )
call RemoveLocation(TempPoint)
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(GetTriggerUnit()), 10000.00 )
call SetCameraTargetControllerNoZForPlayer( GetTriggerPlayer(), GetLastCreatedUnit(), 0, 0, false )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', GetLastCreatedUnit() )
if ( GetTriggerPlayer()==GetOwningPlayer(GetKillingUnit()) ) then
set udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] - 1 )
call LeaderboardSetPlayerItemValueBJ( GetOwningPlayer(GetKillingUnitBJ()), GetLastCreatedLeaderboard(), udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] )
call LeaderboardSortItemsBJ( GetLastCreatedLeaderboard(), bj_SORTTYPE_SORTBYVALUE, false )
else
set udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] = ( udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] + 1 )
call LeaderboardSetPlayerItemValueBJ( GetOwningPlayer(GetKillingUnitBJ()), GetLastCreatedLeaderboard(), udg_PlayerKills[GetConvertedPlayerId(GetOwningPlayer(GetKillingUnitBJ()))] )
call LeaderboardSortItemsBJ( GetLastCreatedLeaderboard(), bj_SORTTYPE_SORTBYVALUE, false )
endif
if ( Trig_Revive_Func006C() ) then
set TempPoint = GetPlayerStartLocationLoc(Player(GetRandomInt(0,11)))
call TriggerSleepAction( 2.00+(8-udg_Player_Revive[GetConvertedPlayerId(GetTriggerPlayer())])*1.5 )
call CreateNUnitsAtLoc( 1, udg_Player_PlaneType[GetConvertedPlayerId(GetTriggerPlayer())], GetTriggerPlayer(), TempPoint , bj_UNIT_FACING )
call RemoveLocation(TempPoint)
set udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())] = GetLastCreatedUnit()
call SetUnitManaPercentBJ( udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())], 20.00 )
set TempPoint = GetUnitLoc(udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())])
call PanCameraToTimedLocWithZForPlayer( GetTriggerPlayer(), TempPoint , GetUnitFlyHeight(udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())]), 0 )
call RemoveLocation(TempPoint)
call SetCameraTargetControllerNoZForPlayer( GetTriggerPlayer(), udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())], 0, 0, false )
call SelectUnitForPlayerSingle( udg_Plane[GetConvertedPlayerId(GetTriggerPlayer())], GetTriggerPlayer() )
call SetCameraFieldForPlayer( GetTriggerPlayer(), CAMERA_FIELD_TARGET_DISTANCE, 1000.00, 0 )
endif
set TempPoint=null
endfunction
//===========================================================================
function InitTrig_Revive takes nothing returns nothing
set gg_trg_Revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction
function Trig_Move_Func001Func003001002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetEnumUnit())) == true )
endfunction
function Trig_Move_Func001Func003A takes nothing returns nothing
if ( GetUnitFlyHeight(GetEnumUnit()) <= ( GetUnitFlyHeight(udg_PickedUnit) + 100.00 ) ) then
if ( GetUnitFlyHeight(GetEnumUnit()) >= ( GetUnitFlyHeight(udg_PickedUnit) - 10.00 ) ) then
call UnitDamageTargetBJ( udg_PickedUnit, GetEnumUnit(), 50, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call ExplodeUnitBJ( udg_PickedUnit )
endif
endif
endfunction
function Trig_Move_Func001A takes nothing returns nothing
local location TempPoint
local rect TempRect
local group TempGroup
local conditionfunc TempCondition
call MoveUnitToPolarProjection(GetEnumUnit(), 55.00+udg_Player_Missle[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]*15, GetUnitFacing(GetEnumUnit()) )
set udg_PickedUnit = GetEnumUnit()
set TempPoint= GetUnitLoc(GetEnumUnit())
set TempRect = RectFromCenterSizeBJ(TempPoint, 175.00, 175.00)
set TempCondition = Condition(function Trig_Move_Func001Func003001002)
set TempGroup = GetUnitsInRectMatching(TempRect,TempCondition )
call ForGroupBJ( TempGroup, function Trig_Move_Func001Func003A )
call RemoveRect(TempRect)
call RemoveLocation(TempPoint)
call DestroyGroup(TempGroup)
call DestroyCondition(TempCondition)
set TempGroup=null
set TempPoint = null
set TempRect = null
set TempCondition = null
endfunction
function Trig_Move_Actions takes nothing returns nothing
call ForGroupBJ( udg_Missles, function Trig_Move_Func001A )
endfunction
//===========================================================================
function InitTrig_Move takes nothing returns nothing
set gg_trg_Move = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Move, 0.05 )
call TriggerAddAction( gg_trg_Move, function Trig_Move_Actions )
endfunction
function Trig_Move_Func001Func003001002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetEnumUnit())) == true )
endfunction
function Trig_Move_Func001Func003A takes nothing returns nothing
if ( GetUnitFlyHeight(GetEnumUnit()) <= ( GetUnitFlyHeight(udg_PickedUnit) + 100.00 ) ) then
if ( GetUnitFlyHeight(GetEnumUnit()) >= ( GetUnitFlyHeight(udg_PickedUnit) - 10.00 ) ) then
call UnitDamageTargetBJ( udg_PickedUnit, GetEnumUnit(), 50, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call ExplodeUnitBJ( udg_PickedUnit )
endif
endif
endfunction
function Trig_Move_Func001A takes nothing returns nothing
local location TempPoint
local rect TempRect
local group TempGroup
local conditionfunc TempCondition
call MoveUnitToPolarProjection(GetEnumUnit(), 55.00+udg_Player_Missle[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]*15, GetUnitFacing(GetEnumUnit()) )
set udg_PickedUnit = GetEnumUnit()
set TempPoint= GetUnitLoc(GetEnumUnit())
set TempRect = RectFromCenterSizeBJ(TempPoint, 175.00, 175.00)
set TempCondition = Condition(function Trig_Move_Func001Func003001002)
set TempGroup = GetUnitsInRectMatching(TempRect,TempCondition )
call ForGroupBJ( TempGroup, function Trig_Move_Func001Func003A )
call RemoveRect(TempRect)
call RemoveLocation(TempPoint)
call DestroyGroup(TempGroup)
call DestroyCondition(TempCondition)
set TempGroup=null
set TempPoint = null
set TempRect = null
set TempCondition = null
endfunction
function Trig_Move_Actions takes nothing returns nothing
call ForGroupBJ( udg_Missles, function Trig_Move_Func001A )
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Test, 0.05 )
call TriggerAddAction( gg_trg_Test, function Trig_Move_Actions )
endfunction
function Trig_H_Create_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_H_Create_Func001C takes nothing returns boolean
if ( not ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_H_Create_Actions takes nothing returns nothing
local location l=GetUnitLoc(GetTriggerUnit())
if ( Trig_H_Create_Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h008', GetTriggerPlayer(), l, bj_UNIT_FACING )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(GetTriggerUnit()), 100000.00 )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_HommingMissles )
call AdjustPlayerStateBJ( -1, GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endif
call RemoveLocation(l)
set l=null
endfunction
//===========================================================================
function InitTrig_Photon_Create takes nothing returns nothing
set gg_trg_Photon_Create = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Photon_Create, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Photon_Create, Condition( function Trig_H_Create_Conditions ) )
call TriggerAddAction( gg_trg_Photon_Create, function Trig_H_Create_Actions )
endfunction
function Trig_Move_Missles_Func001A takes nothing returns nothing
local real dist=99999
local real dist2
local integer i=1
local location l=GetUnitLoc(GetEnumUnit())
local location l2
local unit target
local real ang
loop
exitwhen i>12
if (GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit())) !=i) and (udg_Plane[i] !=null) then
set l2=GetUnitLoc(udg_Plane[i])
set dist2=DistanceBetweenPoints(l, l2)
call RemoveLocation(l2)
if dist2<dist then
set target=udg_Plane[i]
set dist=dist2
endif
endif
set i=i+1
endloop
set l2=GetUnitLoc(target)
set ang= AngleBetweenPoints(l,l2)
if target !=null and ( IsPlayerEnemy(GetOwningPlayer(target), GetOwningPlayer(GetEnumUnit())) == true ) then
call SetUnitFlyHeightBJ( GetEnumUnit(), GetUnitFlyHeight(target), 1000.00 )
call SetUnitUserData( GetEnumUnit(), GetConvertedPlayerId(GetOwningPlayer(target)) )
call MoveUnitToPolarProjection(GetEnumUnit(), 20.00+udg_Player_Missle[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))]*5, ang )
if DistanceBetweenPoints(l2,l) <100 and ( IsPlayerEnemy(GetOwningPlayer(target), GetOwningPlayer(GetEnumUnit())) == true ) and ( GetUnitFlyHeight(GetEnumUnit()) < ( 75.00 + GetUnitFlyHeight(target) ) ) and ( GetUnitFlyHeight(GetEnumUnit()) > ( GetUnitFlyHeight(target) - 75.00 ) ) then
call UnitDamageTargetBJ( GetEnumUnit(), target, 500, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call ExplodeUnitBJ(GetEnumUnit())
endif
else
call ExplodeUnitBJ(GetEnumUnit())
endif
call RemoveLocation(l2)
call RemoveLocation(l)
set l=null
set l2=null
set target=null
endfunction
function Trig_Move_Missles_Actions takes nothing returns nothing
call ForGroupBJ( udg_HommingMissles, function Trig_Move_Missles_Func001A )
endfunction
//===========================================================================
function InitTrig_Move_Photon takes nothing returns nothing
set gg_trg_Move_Photon = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Move_Photon, 0.05 )
call TriggerAddAction( gg_trg_Move_Photon, function Trig_Move_Missles_Actions )
endfunction
function Trig_Missle_Warning_Func001A takes nothing returns nothing
local force f=GetForceOfPlayer(ConvertedPlayer(GetUnitUserData(GetEnumUnit())))
local location l=GetRectCenter(GetPlayableMapRect())
if ConvertedPlayer(GetUnitUserData(GetEnumUnit())) != GetOwningPlayer(GetEnumUnit()) then
call PingMinimapLocForForceEx( f, l, 1, bj_MINIMAPPINGSTYLE_ATTACK, 100, 100, 100 )
endif
call DestroyForce(f)
call RemoveLocation(l)
set l=null
set f=null
endfunction
function Trig_Missle_Warning_Actions takes nothing returns nothing
call ForGroupBJ( udg_HommingMissles, function Trig_Missle_Warning_Func001A )
endfunction
//===========================================================================
function InitTrig_Photon_Warning takes nothing returns nothing
set gg_trg_Photon_Warning = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Photon_Warning, 0.05 )
call TriggerAddAction( gg_trg_Photon_Warning, function Trig_Missle_Warning_Actions )
endfunction
function Trig_Missle_Short_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Missle_Short_Func001Func001C takes nothing returns boolean
if ( not ( GetConvertedPlayerId(GetTriggerPlayer()) == GetUnitUserData(GetEnumUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Missle_Short_Func001A takes nothing returns nothing
local location l=GetUnitLoc(GetEnumUnit())
if ( Trig_Missle_Short_Func001Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h009', GetTriggerPlayer(),l, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(GetEnumUnit()), 1000.00 )
call ExplodeUnitBJ( GetEnumUnit() )
endif
call RemoveLocation(l)
endfunction
function Trig_Missle_Short_Actions takes nothing returns nothing
local location l=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'h009', GetTriggerPlayer(),l, bj_UNIT_FACING )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(GetTriggerUnit()), 3000.00 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call ForGroupBJ( udg_HommingMissles, function Trig_Missle_Short_Func001A )
//call UnitDamageTargetBJ( GetTriggerUnit(), GetTriggerUnit(), 90, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitManaBJ( GetTriggerUnit(), GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit())-1 )
call RemoveLocation(l)
set l=null
endfunction
//===========================================================================
function InitTrig_Photon_Short takes nothing returns nothing
set gg_trg_Photon_Short = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Photon_Short, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Photon_Short, Condition( function Trig_Missle_Short_Conditions ) )
call TriggerAddAction( gg_trg_Photon_Short, function Trig_Missle_Short_Actions )
endfunction
function Trig_Locust_Func001002 takes nothing returns nothing
if RectContainsUnit(gg_rct_Planes, GetEnumUnit()) == false then
call UnitAddAbilityBJ( 'Aloc', GetEnumUnit() )
endif
endfunction
function Trig_Locust_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Locust_Func001002 )
endfunction
//===========================================================================
function InitTrig_Locust takes nothing returns nothing
set gg_trg_Locust = CreateTrigger( )
call TriggerAddAction( gg_trg_Locust, function Trig_Locust_Actions )
endfunction