Name | Type | is_array | initial_value |
arrival | location | No | |
Begin | location | No | |
Boolean | boolean | No | |
buff | buffcode | No | |
cache | gamecache | No | |
da | weathereffect | No | |
DebugDialog | dialog | No | |
DebugOn | button | No | |
DiplomatButton | button | Yes | |
diplomatic | dialog | No | |
freetechs | integer | Yes | |
gain | player | No | |
gamecache | gamecache | No | |
HSSensor | fogmodifier | Yes | |
hypertest | rect | No | |
ionturret | unit | Yes | |
itemused | itemcode | No | |
number | integer | No | |
pl | player | No | |
planetR | unitcode | No | |
playerTech | player | No | |
Quests | quest | Yes | |
Real | integer | No | |
Realnum | real | No | |
Shielding | rect | Yes | |
Shieldleft | boolean | No | |
Shieldleftnb | integer | No | |
ShieldNumber | integer | No | |
Sound | sound | No | |
unit | unit | No | |
unitgroup | group | No | |
Warp | rect | Yes | |
warpnumber | integer | No |
function CheckForPlayerNumber takes integer num returns boolean
if ( num < 13 ) then
if ( num > 0 ) then
return true
else
endif
else
endif
return false
endfunction
function Trig_War_Copy_Actions takes nothing returns nothing
local integer num = S2I(SubStringBJ(GetEventPlayerChatString(), 6, 7))
if ( CheckForPlayerNumber(num) ) then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), ConvertedPlayer( num ), bj_ALLIANCE_UNALLIED )
else
endif
endfunction
//===========================================================================
function InitTrig_War_Copy takes nothing returns nothing
set gg_trg_War_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(0), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(1), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(2), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(3), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(4), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(5), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(6), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(7), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(8), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(9), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(10), "-war ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_War_Copy, Player(11), "-war ", false )
call TriggerAddAction( gg_trg_War_Copy, function Trig_War_Copy_Actions )
endfunction
function CheckForPlayerNumber2 takes integer num returns boolean
if ( num < 13 ) then
if ( num > 0 ) then
return true
else
endif
else
endif
return false
endfunction
function Trig_Peace_Copy_Actions takes nothing returns nothing
local integer num = S2I(SubStringBJ(GetEventPlayerChatString(), 8, 9))
if ( CheckForPlayerNumber2(num) ) then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), ConvertedPlayer( num ), bj_ALLIANCE_ALLIED_VISION )
else
endif
endfunction
//===========================================================================
function InitTrig_Peace_Copy takes nothing returns nothing
set gg_trg_Peace_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(0), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(1), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(2), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(3), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(4), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(5), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(6), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(7), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(8), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(9), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(10), "-Peace ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Peace_Copy, Player(11), "-Peace ", false )
call TriggerAddAction( gg_trg_Peace_Copy, function Trig_Peace_Copy_Actions )
endfunction
function CheckForPlayerNumber3 takes integer num returns boolean
if ( num < 13 ) then
if ( num > 0 ) then
return true
else
endif
else
endif
return false
endfunction
function Trig_Ally_Actions takes nothing returns nothing
local integer num = S2I(SubStringBJ(GetEventPlayerChatString(), 7, 8))
if ( CheckForPlayerNumber3(num) ) then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), ConvertedPlayer( num ), bj_ALLIANCE_ALLIED_UNITS )
else
endif
endfunction
//===========================================================================
function InitTrig_Ally takes nothing returns nothing
set gg_trg_Ally = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(0), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(1), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(2), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(3), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(4), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(5), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(6), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(7), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(8), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(10), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(9), "-ally ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(11), "-ally ", false )
call TriggerAddAction( gg_trg_Ally, function Trig_Ally_Actions )
endfunction
function CheckForPlayerNumber4 takes integer num returns boolean
if ( num < 13 ) then
if ( num > 0 ) then
return true
else
endif
else
endif
return false
endfunction
function Trig_Cease_Fire_Copy_Actions takes nothing returns nothing
local integer num = S2I(SubStringBJ(GetEventPlayerChatString(), 13, 14))
if ( CheckForPlayerNumber4(num) ) then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), ConvertedPlayer( num ), bj_ALLIANCE_NEUTRAL )
else
endif
endfunction
//===========================================================================
function InitTrig_Cease_Fire_Copy takes nothing returns nothing
set gg_trg_Cease_Fire_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(0), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(1), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(2), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(3), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(4), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(5), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(6), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(7), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(8), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(9), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(10), "-Cease Fire ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Cease_Fire_Copy, Player(11), "-Cease Fire ", false )
call TriggerAddAction( gg_trg_Cease_Fire_Copy, function Trig_Cease_Fire_Copy_Actions )
endfunction
function Trig_Laser_or_Ion_Copy_Func001C takes nothing returns boolean
if ( ( GetResearched() == 'R01J' ) ) then
return true
endif
if ( ( GetResearched() == 'R022' ) ) then
return true
endif
return false
endfunction
function Trig_Laser_or_Ion_Copy_Conditions takes nothing returns boolean
if ( not Trig_Laser_or_Ion_Copy_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Laser_or_Ion_Copy_Func002C takes nothing returns boolean
if ( not ( GetPlayerTechCountSimple('R01J', GetOwningPlayer(GetResearchingUnit())) >= 2 ) ) then
return false
endif
return true
endfunction
function Trig_Laser_or_Ion_Copy_Func003C takes nothing returns boolean
if ( not ( GetPlayerTechCountSimple('R022', GetOwningPlayer(GetResearchingUnit())) >= 2 ) ) then
return false
endif
return true
endfunction
function Trig_Laser_or_Ion_Copy_Actions takes nothing returns nothing
if ( GetPlayerTechCountSimple('R01J', GetOwningPlayer(GetResearchingUnit())) == 1 ) then
call SetPlayerUnitAvailableBJ( 'I014', true, GetOwningPlayer(GetResearchingUnit()) )
else
endif
if ( Trig_Laser_or_Ion_Copy_Func002C() ) then
call SetPlayerTechMaxAllowedSwap( 'R022', 1, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerUnitAvailableBJ( 'I012', true, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerUnitAvailableBJ( 'I019', true, GetOwningPlayer(GetResearchingUnit()) )
else
endif
if ( Trig_Laser_or_Ion_Copy_Func003C() ) then
call SetPlayerTechMaxAllowedSwap( 'R01J', 1, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerUnitAvailableBJ( 'I015', true, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerUnitAvailableBJ( 'I00I', true, GetOwningPlayer(GetResearchingUnit()) )
else
endif
endfunction
//===========================================================================
function InitTrig_Laser_or_Ion_Copy takes nothing returns nothing
set gg_trg_Laser_or_Ion_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Laser_or_Ion_Copy, EVENT_PLAYER_UNIT_RESEARCH_FINISH )
call TriggerAddCondition( gg_trg_Laser_or_Ion_Copy, Condition( function Trig_Laser_or_Ion_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Laser_or_Ion_Copy, function Trig_Laser_or_Ion_Copy_Actions )
endfunction
function Trig_no_support_for_planet_Copy_2_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A011' ) ) then
return false
endif
return true
endfunction
function Trig_no_support_for_planet_Copy_2_Func002C takes nothing returns boolean
if ( not ( GetPlayerRace(GetOwningPlayer(GetSpellAbilityUnit())) != RACE_NIGHTELF ) ) then
return false
endif
return true
endfunction
function Trig_no_support_for_planet_Copy_2_Actions takes nothing returns nothing
call BJDebugMsg("Hello World")
call CreateNUnitsAtLoc( 1, 'h03V', GetOwningPlayer(GetSpellAbilityUnit()), GetUnitLoc(GetSpellTargetUnit()), bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_no_support_for_planet_Copy_2 takes nothing returns nothing
set gg_trg_no_support_for_planet_Copy_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_no_support_for_planet_Copy_2, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_no_support_for_planet_Copy_2, Condition( function Trig_no_support_for_planet_Copy_2_Conditions ) )
call TriggerAddAction( gg_trg_no_support_for_planet_Copy_2, function Trig_no_support_for_planet_Copy_2_Actions )
endfunction
function Trig_Inhibitor_Field_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02F' ) ) then
return false
endif
return true
endfunction
function Trig_Inhibitor_Field_Actions takes nothing returns nothing
local weathereffect da
call AddWeatherEffectSaveLast( RectFromCenterSizeBJ(GetUnitLoc(GetSpellAbilityUnit()), 1697.00, 1697.00), 'MEds' )
set da = GetLastCreatedWeatherEffect()
call EnableWeatherEffect( da, true )
call TriggerSleepAction( 5.00 )
call RemoveWeatherEffectBJ( da )
set da = null
endfunction
//===========================================================================
function InitTrig_Inhibitor_Field takes nothing returns nothing
set gg_trg_Inhibitor_Field = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Inhibitor_Field, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Inhibitor_Field, Condition( function Trig_Inhibitor_Field_Conditions ) )
call TriggerAddAction( gg_trg_Inhibitor_Field, function Trig_Inhibitor_Field_Actions )
endfunction
function Trig_Inhibitor_Field_Conditions2 takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02H' ) ) then
return false
endif
return true
endfunction
function Trig_Inhibitor_Field_Actions2 takes nothing returns nothing
local weathereffect da
call AddWeatherEffectSaveLast( RectFromCenterSizeBJ(GetUnitLoc(GetSpellAbilityUnit()), 990.00, 990.00), 'MEds' )
set da = GetLastCreatedWeatherEffect()
call EnableWeatherEffect( da, true )
call TriggerSleepAction( 5.00 )
call RemoveWeatherEffectBJ( da )
set da = null
endfunction
//===========================================================================
function InitTrig_Inhibitor_Field_Copy takes nothing returns nothing
set gg_trg_Inhibitor_Field_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Inhibitor_Field_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Inhibitor_Field_Copy, Condition( function Trig_Inhibitor_Field_Conditions2 ) )
call TriggerAddAction( gg_trg_Inhibitor_Field_Copy, function Trig_Inhibitor_Field_Actions2 )
endfunction
****************
*Implimintation*
****************
Simply copy the code in the custom script section and use as u want, remember to create the gamecache "hash" variable.
Configure the constants at the custom script
function InitTrig_Load_Game_Cache takes nothing returns nothing
call FlushGameCache(InitGameCache("localvars.w3v"))
set udg_hash = InitGameCache("localvars.w3v")
endfunction
function Trig_Portal_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A020' ) ) then
return false
endif
return true
endfunction
function Trig_Portal_Copy_Actions takes nothing returns nothing
call SetUnitFacingToFaceLocTimed( GetSpellAbilityUnit(), GetSpellTargetLoc(), 0 )
call TriggerSleepAction( 0.10 )
set udg_Begin = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 256, GetUnitFacing(GetSpellAbilityUnit()))
set udg_arrival = PolarProjectionBJ(GetSpellTargetLoc(), 256, ( 0.00 - GetUnitFacing(GetSpellAbilityUnit()) ))
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
// Portal
call CreateDestructableLoc( 'OTsp', udg_Begin, GetUnitFacing(GetSpellAbilityUnit()), 0.30, 0 )
call SetDestructableInvulnerableBJ( GetLastCreatedDestructable(), true )
call SetDestructableAnimationBJ( GetLastCreatedDestructable(), "birth" )
call CreateDestructableLoc( 'B002', udg_arrival, GetUnitFacing(GetSpellAbilityUnit()), 0.30, 0 )
call SetDestructableInvulnerableBJ( GetLastCreatedDestructable(), true )
call SetDestructableAnimationBJ( GetLastCreatedDestructable(), "birth" )
set udg_Warp[udg_warpnumber] = Rect(( GetLocationX(udg_Begin) - 125.00 ), ( GetLocationY(udg_Begin) - 125.00 ), ( GetLocationX(udg_Begin) + 125.00 ), ( GetLocationY(udg_Begin) + 125.00 ))
set udg_Warp[( udg_warpnumber + 1 )] = Rect(( GetLocationX(udg_arrival) - 125.00 ), ( GetLocationY(udg_arrival) - 125.00 ), ( GetLocationX(udg_arrival) + 125.00 ), ( GetLocationY(udg_arrival) + 125.00 ))
call TriggerSleepAction( 0.50 )
set udg_warpnumber = ( udg_warpnumber + 2 )
endfunction
//===========================================================================
function InitTrig_Portal_Copy takes nothing returns nothing
set gg_trg_Portal_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Portal_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Portal_Copy, Condition( function Trig_Portal_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Portal_Copy, function Trig_Portal_Copy_Actions )
endfunction
function Trig_da_Actions takes nothing returns nothing
call SetUnitPositionLoc( GetTriggerUnit(), udg_Begin )
endfunction
//===========================================================================
function InitTrig_da takes nothing returns nothing
set gg_trg_da = CreateTrigger( )
call TriggerAddAction( gg_trg_da, function Trig_da_Actions )
endfunction
function Trig_Teleport_Copy_Func002Func001Func001001002 takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Teleport_Copy_Func002Func001Func001A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), GetRectCenter(udg_Warp[( GetForLoopIndexA() + 1 )]) )
call IssuePointOrderLocBJ( GetEnumUnit(), "move", OffsetLocation(GetRectCenter(udg_Warp[( GetForLoopIndexA() + 1 )]), 100.00, 100.00) )
endfunction
function Trig_Teleport_Copy_Func002Func001C takes nothing returns boolean
if ( not ( ModuloInteger(GetForLoopIndexA(), 2) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teleport_Copy_Actions takes nothing returns nothing
set bj_forLoopAIndex = 0
set bj_forLoopAIndexEnd = ( udg_warpnumber - 1 )
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Teleport_Copy_Func002Func001C() ) then
call ForGroupBJ( GetUnitsInRectMatching(udg_Warp[GetForLoopIndexA()], Condition(function Trig_Teleport_Copy_Func002Func001Func001001002)), function Trig_Teleport_Copy_Func002Func001Func001A )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Teleport_Copy takes nothing returns nothing
set gg_trg_Teleport_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Teleport_Copy, 0.25 )
call TriggerAddAction( gg_trg_Teleport_Copy, function Trig_Teleport_Copy_Actions )
endfunction
function Trig_portal_creation_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A020' ) ) then
return false
endif
return true
endfunction
function da takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function move_Unit_to_Arrival takes region arrival returns nothing
local region stroumpf = arrival
call SetUnitPositionLoc( GetEnumUnit(), stroumpf )
set stroumpf = null
endfunction
function Portal_Check takes region departure, region arrival returns nothing
call ForGroupBJ( GetUnitsInRectMatching(departure, Condition(function da), function move_Unit_to_Arrival(arrival) )
endfunction
function Trig_portal_creation_Actions takes nothing returns nothing
call SetUnitFacingToFaceLocTimed( GetSpellAbilityUnit(), GetSpellTargetLoc(), 0 )
call TriggerSleepAction( 0.10 )
local region departure = PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 256, GetUnitFacing(GetSpellAbilityUnit()))
local region arrival = PolarProjectionBJ(GetSpellTargetLoc(), 256, ( 0.00 - GetUnitFacing(GetSpellAbilityUnit()) ))
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
// Portal
call CreateDestructableLoc( 'OTsp', udg_Begin, GetUnitFacing(GetSpellAbilityUnit()), 0.30, 0 )
call SetDestructableInvulnerableBJ( GetLastCreatedDestructable(), true )
call SetDestructableAnimationBJ( GetLastCreatedDestructable(), "birth" )
call CreateDestructableLoc( 'B002', udg_arrival, GetUnitFacing(GetSpellAbilityUnit()), 0.30, 0 )
call SetDestructableInvulnerableBJ( GetLastCreatedDestructable(), true )
call SetDestructableAnimationBJ( GetLastCreatedDestructable(), "birth" )
local trigger portal = CreateTrigger()
call TriggerRegisterTimerEventPeriodic( portal, 0.25 )
call TriggerAddAction( portal, function Trig_Teleport_Co)
endfunction
//===========================================================================
function InitTrig_portal_creation takes nothing returns nothing
set gg_trg_portal_creation = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_portal_creation, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_portal_creation, Condition( function Trig_portal_creation_Conditions ) )
call TriggerAddAction( gg_trg_portal_creation, function Trig_portal_creation_Actions )
endfunction