function KartType4 takes unit u returns boolean
return GetUnitTypeId(u) == 'h003'
endfunction
function Tanks takes unit u returns boolean
if ( ( GetUnitTypeId(u) == 'h002' ) ) then
return true
endif
if ( ( GetUnitTypeId(u) == 'h004' ) ) then
return true
endif
return false
endfunction
function KartType3 takes unit u returns boolean
return Tanks(u)
endfunction
function Bikes takes unit u returns boolean
if ( ( GetUnitTypeId(u) == 'h000' ) ) then
return true
endif
if ( ( GetUnitTypeId(u) == 'h005' ) ) then
return true
endif
if ( ( GetUnitTypeId(u) == 'h006' ) ) then
return true
endif
if ( ( GetUnitTypeId(u) == 'h007' ) ) then
return true
endif
return false
endfunction
function KartType2 takes unit u returns boolean
return Bikes(u)
endfunction
function KartType1 takes unit u returns boolean
return GetUnitTypeId(u) == 'h001'
endfunction
function ResetAnim takes unit u returns nothing
// This resets the driving animations after casting!
if ( KartType1(u) ) then
call SetUnitAnimationByIndex( u, 0)
elseif ( KartType2(u) ) then
call SetUnitAnimationByIndex( u, 3)
elseif ( KartType3(u) ) then
call SetUnitAnimationByIndex( u, 2)
elseif ( KartType4(u) ) then
call SetUnitAnimationByIndex( u, 4)
endif
endfunction
//===============================================================
Name | Type | is_array | initial_value |
AbilityArray | abilcode | Yes | |
AbilityInteger | integer | Yes | |
BooleanDeathMatchOn | boolean | No | |
Car | unit | Yes | |
Deaths | integer | Yes | |
DialogButtonDeathMatch | button | Yes | |
DialogButtonGameType | button | Yes | |
DialogButtonTimeAttack | button | Yes | |
DialogDeathMatch | dialog | No | |
DialogGameType | dialog | No | |
DialogTimeAttack | dialog | No | |
Forward | boolean | Yes | |
GameTime | integer | No | |
GameTimeMultiplied | integer | No | |
GameTimer | timer | No | |
GameTimerWindow | timerdialog | No | |
ItemRegion | rect | Yes | |
ItemType | itemcode | No | |
KartAccelSpeed | real | Yes | |
KartCurrentSpeed | real | Yes | |
KartTopSpeed | real | Yes | |
KillLimit | integer | No | |
Left | boolean | Yes | |
Multiboard | multiboard | No | |
PathTester | unit | No | |
pathunit | unit | No | |
PlayerColor | string | Yes | |
playergroup | force | No | |
Reverse | boolean | Yes | |
Right | boolean | Yes | |
Score | integer | Yes | |
StartRegion | rect | Yes | |
TempInteger | integer | No | |
TempPlayer | player | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempReal | real | No | |
TempReal2 | real | No | |
TempRect | rect | No | |
TempUnit | unit | No | |
TempUnit2 | unit | No | |
TempUnitGroup | group | No | |
TempUnitGroup2 | group | No | |
VictoryGroup | force | No |
function reviveConditions takes nothing returns boolean
return IsUnitType(GetDyingUnit(), UNIT_TYPE_MECHANICAL) == true
endfunction
function IsPlayerPlaying takes player p returns boolean
return GetPlayerSlotState(p) != PLAYER_SLOT_STATE_LEFT
endfunction
function reviveActions takes nothing returns nothing
local timerdialog w
local integer r = 5
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer s = GetUnitTypeId(u)
local integer i = GetConvertedPlayerId(p)
local location l = GetRectCenter(udg_StartRegion[GetRandomInt(1, 8)])
local location l2
call TimerStart(t, I2R(r), false, null)
call CreateTimerDialogBJ(t,GetPlayerName(p))
set w = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplayBJ( false, w )
call TimerDialogDisplayForPlayerBJ(true,w,p)
call PolledWait(r)
if (IsPlayerPlaying(p)) then
set udg_Car[i] = CreateUnitAtLoc(p,s,l,270.00)
call SelectUnitForPlayerSingle( udg_Car[i], p )
set l2 = GetUnitLoc(udg_Car[i])
call PanCameraToTimedLocForPlayer(p,l2,0.00)
endif
call DestroyTimerDialog(w)
call RemoveLocation(l)
call RemoveLocation(l2)
set u = null
endfunction
//===========================================================================
function InitTrig_revive takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition(t, Condition( function reviveConditions ) )
call TriggerAddAction( t, function reviveActions )
endfunction
function Trig_Untitled_Trigger_001_Func001C takes nothing returns boolean
if ( not ( GetPlayerSlotState(GetOwningPlayer(GetTriggerUnit())) != PLAYER_SLOT_STATE_LEFT ) ) then
return false
endif
return true
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
if ( Trig_Untitled_Trigger_001_Func001C() ) then
else
endif
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
function Trig_replace_item_Conditions takes nothing returns boolean
return GetItemTypeId(GetManipulatedItem()) == 'I000'
endfunction
function Trig_replace_item_Actions takes nothing returns nothing
local location TempPoint = GetItemLoc(GetManipulatedItem())
local integer ItemType = GetItemTypeId(GetManipulatedItem())
call TriggerSleepAction( 5.00 )
call CreateItemLoc( ItemType, TempPoint )
call RemoveLocation(TempPoint)
set TempPoint = null
endfunction
//===========================================================================
function InitTrig_replace_item takes nothing returns nothing
set gg_trg_replace_item = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_replace_item, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_replace_item, Condition( function Trig_replace_item_Conditions ) )
call TriggerAddAction( gg_trg_replace_item, function Trig_replace_item_Actions )
endfunction
function ClusterRocketsConditions takes nothing returns boolean
return GetSpellAbilityId() == 'A009'
endfunction
function DummyActions takes unit u, real x, real y returns nothing
local unit u2 = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'h008', x, y, 0)
call UnitAddAbility( u2, 'A00C' )
call UnitApplyTimedLife( u2, 'BTLF', 2.00 )
call IssueTargetOrder( u2, "thunderbolt", u )
set u2 = null
endfunction
function GroupConditions takes nothing returns boolean
local unit f = GetFilterUnit()
local player p = GetOwningPlayer(GetTriggerUnit())
return ( IsUnitEnemy(f, p) == true ) and ( IsUnitType(f, UNIT_TYPE_MECHANICAL) == true ) and ( UnitHasBuffBJ(f, 'Binv') == false )
endfunction
function GetTargets takes unit u, real r returns nothing
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real xx
local real yy
local real angle
local real face = GetUnitFacing(u)
local real absmod
local group g = CreateGroup()
local unit u2
call GroupEnumUnitsInRange(g, x, y, r, Filter(function GroupConditions))
loop
set u2 = FirstOfGroup(g)
exitwhen u2 == null
call GroupRemoveUnit(g,u2)
set xx = GetUnitX(u2)
set yy = GetUnitY(u2)
set angle = Atan2(y-yy,x-xx) * bj_RADTODEG
set absmod = ModuloReal(RAbsBJ(angle-face), 360)
if absmod > 65 and absmod < 255 then
call DummyActions(u2, x, y)
endif
endloop
call DestroyGroup(g)
set g = null
endfunction
function ClusterRocketsActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real r = 10000.00
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local player p = GetOwningPlayer(u)
local integer i = GetConvertedPlayerId(GetOwningPlayer(u))
call UnitRemoveAbility( u, 'A009' )
set udg_AbilityInteger[i] = ( udg_AbilityInteger[i] - 1 )
call GetTargets(u, r)
call ResetAnim(u)
set u = null
endfunction
//===========================================================================
function InitTrig_cluster_rockets_2 takes nothing returns nothing
set gg_trg_cluster_rockets_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_cluster_rockets_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_cluster_rockets_2, Condition( function ClusterRocketsConditions ) )
call TriggerAddAction( gg_trg_cluster_rockets_2, function ClusterRocketsActions )
endfunction
function StormBoltConditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00E'
endfunction
function TargetConditions takes nothing returns boolean
local unit f = GetFilterUnit()
return (IsUnitType(f, UNIT_TYPE_MECHANICAL) == true) and (GetTriggerUnit() != f) and ( UnitHasBuffBJ(f, 'Binv') == false )
endfunction
function FindTarget takes unit u, real r returns unit
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real xx
local real yy
local real angle
local real face = GetUnitFacing(u)
local real absmod
local group g = CreateGroup()
local unit u
local unit t = null
local real dis = 999999.00
call GroupEnumUnitsInRange(g, x, y, r, Condition(function TargetConditions))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
set xx = GetUnitX(u)
set yy = GetUnitY(u)
set angle = Atan2(y-yy,x-xx) * bj_RADTODEG
set absmod = ModuloReal(RAbsBJ(angle-face), 360)
if absmod > 45 and absmod < 235 then
if dis > SquareRoot((xx-x)*(xx-x)+(yy-y)*(yy-y)) then
set dis = SquareRoot((xx-x)*(xx-x)+(yy-y)*(yy-y))
set t = u
endif
endif
endloop
call DestroyGroup(g)
set g = null
return t
endfunction
function StormBoltActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real r = 20000.00
local unit t = FindTarget(u,r)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit u2 = CreateUnit(GetOwningPlayer(u), 'h008', x, y, 0)
local integer i = GetConvertedPlayerId(GetOwningPlayer(u))
set udg_AbilityInteger[i] = ( udg_AbilityInteger[i] - 1 )
call UnitApplyTimedLife(u2, 'BTLF', 2.00)
call UnitAddAbility(u2, 'A00A')
call UnitRemoveAbility( u, 'A00E' )
if t != null then
call IssueTargetOrder(u2, "thunderbolt", t)
endif
set u = null
set u2 = null
set t = null
endfunction
//===========================================================================
function InitTrig_storm_bolt takes nothing returns nothing
set gg_trg_storm_bolt = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_storm_bolt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_storm_bolt, Condition( function StormBoltConditions ) )
call TriggerAddAction( gg_trg_storm_bolt, function StormBoltActions )
endfunction
function IsCar takes nothing returns boolean
return ( GetFilterUnit() == udg_Car[GetConvertedPlayerId(GetEnumPlayer())] )
endfunction
function IsPositionPathable takes real x, real y returns boolean
local boolean flag
local real x2
local real y2
local real d
call SetUnitPosition (udg_pathunit, x, y)
set x2 = GetUnitX(udg_pathunit)
set y2 = GetUnitY(udg_pathunit)
set d = SquareRoot((x2-x)*(x2-x)+(y2-y)*(y2-y))
set flag = (d <= 65)
return flag
endfunction
function Function2 takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetConvertedPlayerId(GetEnumPlayer())
local real a = GetUnitFacing(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real x2 = x + 100 * Cos(a * bj_DEGTORAD)
local real y2 = y + 100 * Sin(a * bj_DEGTORAD)
local boolean pathable
if (udg_Forward[i] == true) then
set x = x + 35 * Cos(a * bj_DEGTORAD)
set y = y + 35 * Sin(a * bj_DEGTORAD)
set pathable = IsPositionPathable(x2 , y2)
if ( (IsUnitType(u, UNIT_TYPE_STUNNED) == false) and (pathable == true) and ( UnitHasBuffBJ(u, 'BPSE') == false ) ) then
call SetUnitX(u, x)
call SetUnitY(u, y)
endif
endif
set u = null
endfunction
function Function1 takes nothing returns nothing
local group TempUnitGroup = GetUnitsOfPlayerMatching(GetEnumPlayer(), Condition(function IsCar))
call ForGroup( TempUnitGroup, function Function2 )
call DestroyGroup(TempUnitGroup)
endfunction
function TriggerActions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Function1 )
endfunction
//===========================================================================
function InitTrig_move_forward takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterTimerEvent( t, 0.03, true )
call TriggerAddAction( t, function TriggerActions )
endfunction
function Car takes nothing returns boolean
return (GetFilterUnit() == udg_Car[GetConvertedPlayerId(GetEnumPlayer())])
endfunction
function CheckPathing takes real x, real y returns boolean
local boolean flag
local real x2
local real y2
local real d
call SetUnitPosition(udg_pathunit, x, y)
set x2 = GetUnitX(udg_pathunit)
set y2 = GetUnitY(udg_pathunit)
set d = SquareRoot((x2 - x) * (x2 - x) + (y2 - y) * (y2 -y))
set flag = (d <= 65)
return flag
endfunction
function Slide takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetConvertedPlayerId(GetEnumPlayer())
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real a = (GetUnitFacing(u) - 180)
local real x2 = x + 100 * Cos(a * bj_DEGTORAD)
local real y2 = y + 100 * Sin(a * bj_DEGTORAD)
local boolean pathable
if (udg_Reverse[i] == true) then
set x = x + 10 * Cos(a * bj_DEGTORAD)
set y = y + 10 * Sin(a * bj_DEGTORAD)
set pathable = CheckPathing(x2,y2)
if ( (IsUnitType(u, UNIT_TYPE_STUNNED) == false) and (pathable == true) and ( UnitHasBuffBJ(u, 'BPSE') == false ) ) then
call SetUnitX(u,x)
call SetUnitY(u,y)
endif
endif
set u = null
endfunction
function GetUnits takes nothing returns nothing
local group g = GetUnitsOfPlayerMatching(GetEnumPlayer(), Condition(function Car))
call ForGroup(g, function Slide)
call DestroyGroup(g)
endfunction
function ReverseActions takes nothing returns nothing
call ForForce(GetPlayersAll(), function GetUnits)
endfunction
//===========================================================================
function InitTrig_reverse takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterTimerEvent( t, 0.02, true )
call TriggerAddAction( t, function ReverseActions )
endfunction