- Joined
- Oct 24, 2012
- Messages
- 6,545
umm can anyone tell me y this isnt firing it was working b4 but im not sure y it stopped working i dont think i edited anything on it in a while thx
here is the trigger tht starts the random events number 3 is the trigger in question
this one moves the units on the map
this one is supposed to kill the units but it doesnt work anymore ?
here is the trigger tht starts the random events number 3 is the trigger in question
JASS:
function Trig_Timer_Expires_Actions takes nothing returns nothing
local integer r
local integer LoopR = 1
local real x
local real y
local integer L = 0
set r = GetRandomInt(3, 3)
set udg_Income_Boolean_Player[0] = false
set udg_Income_Boolean_Player[1] = false
call PolledWait( 0.05 )
call PauseTimer( udg_Random_Events_Timer )
call TimerDialogDisplayBJ( false, udg_Random_Events_Timer_Window )
call PauseAllUnitsBJ( true )
if ( r == 1 ) then
//checkers
set x = GetRectCenterX(gg_rct_Checkers_B4)
set y = GetRectCenterY(gg_rct_Checkers_B4)
elseif ( r == 2 ) then
// checkers
set x = GetRectCenterX(gg_rct_Checkers_B4)
set y = GetRectCenterY(gg_rct_Checkers_B4)
elseif ( r == 3 ) then
// plus sign random
set x = GetRectCenterX(gg_rct_Plus_Sign_Center)
set y = GetRectCenterY(gg_rct_Plus_Sign_Center)
set udg_Random_Plus_Sign_Counter = 0
call SetUnitX( Selected_Hero_Player[0], x )
call SetUnitY( Selected_Hero_Player[0], y )
call SetUnitX( Selected_Hero_Player[1], x )
call SetUnitY( Selected_Hero_Player[1], y )
call PauseUnitBJ( false, Selected_Hero_Player[0] )
call PauseUnitBJ( false, Selected_Hero_Player[1] )
loop
exitwhen LoopR > 24
call PauseUnit( LightningUnit[LoopR], false )
set LoopR = LoopR + 1
endloop
call PolledWait( 0.50 )
call EnableTrigger( trg_Plus_Sign_Random[1] )
call EnableTrigger( trg_Plus_Sign_Random_Kill[1] )
call EnableTrigger( trg_Plus_Sign_Random_Kill[2] )
call EnableTrigger( trg_Plus_Sign_Random_Kill[3] )
elseif ( r == 4 ) then
set x = GetRectCenterX(gg_rct_Life_or_Death_Random)
set y = GetRectCenterY(gg_rct_Life_or_Death_Random)
call SetUnitState( Life_or_Death_Units[9], UNIT_STATE_LIFE, 100.00 )
call SetUnitState( Life_or_Death_Units[10], UNIT_STATE_LIFE, 100.00 )
loop
exitwhen LoopR > 10
call PauseUnit( Life_or_Death_Units[LoopR], false )
set LoopR = LoopR + 1
endloop
call EnableTrigger( trg_Life_or_Death_Changing )
call EnableTrigger( trg_Life_or_Death_Checking )
elseif ( r == 5 ) then
set x = GetRectCenterX(gg_rct_Portal_Jumping_Spawn_Point)
set y = GetRectCenterY(gg_rct_Portal_Jumping_Spawn_Point)
call PauseUnit( gg_unit_h00C_0110, false )
call TriggerExecute( trg_Portal_Jumping )
endif
loop
exitwhen L > 5
call PanCameraToTimedForPlayer( Player(L), x, y, 0.00 )
set L = L + 1
endloop
call SetCameraFieldForPlayer( Player(0), CAMERA_FIELD_ZOFFSET, 1500.00, 0 )
call SetCameraFieldForPlayer( Player(1), CAMERA_FIELD_ZOFFSET, 1500.00, 0 )
endfunction
//===========================================================================
function InitTrig_Timer_Expires takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerExpireEventBJ( t, udg_Random_Events_Timer )
call TriggerAddAction( t, function Trig_Timer_Expires_Actions )
set t = null
endfunction
JASS:
globals
integer Random_Plus_Sign_Counter = 0 // used in Plus Sign Random (1,2,3) Triggers
boolean array Lightning_Boolean
trigger array trg_Plus_Sign_Random
trigger array trg_Plus_Sign_Random_Kill
endglobals
function Trig_Plus_Sign_Random_1_Actions takes nothing returns nothing
local rect randomloc1 = (gg_rct_Random_1_for_cross_random)
local rect randomloc2 = (gg_rct_Random_2_for_cross_random)
local real cross_center_y = GetRandomReal(GetRectMinY(randomloc1), GetRectMaxY(randomloc1)) // use for center
local real cross_center_x = GetRandomReal(GetRectMinX(randomloc2), GetRectMaxX(randomloc2)) // use for center
local real array cross1_rx
local real array cross1_ry
local lightning array LightningEffect
set cross1_rx[0] = GetRandomReal(GetRectMinX(randomloc1), GetRectMaxX(randomloc1)) //used for gg_rct_Random_1a_for_cross_random
set cross1_ry[0] = GetRandomReal(GetRectMinY(randomloc2), GetRectMaxY(randomloc2)) //used for gg_rct_Random_1a_for_cross_random
call MoveRectTo( gg_rct_Random_1a_for_cross_random, cross1_rx[0], cross_center_y )
call MoveRectTo( gg_rct_Random_1a_for_cross_random, cross_center_x, cross1_ry[0] )
//
// offset units facing 0 degrees
//
set cross1_rx[1] = cross1_rx[0] + 987.50 // east x value
set cross1_rx[2] = cross1_rx[0] + 493.75 // east x value
//
// offset units facing 180 degrees
//
set cross1_rx[3] = cross1_rx[0] - 987.50 // west x value
set cross1_rx[4] = cross1_rx[0] - 493.75 // west x value
//
// offset units facing 90 degrees
//
set cross1_ry[1] = cross1_ry[0] + 987.50 // north y value
set cross1_ry[2] = cross1_ry[0] + 493.75 // north y value
//
// offset units facing 270 degrees
//
set cross1_ry[3] = cross1_ry[0] - 987.50 // south y value
set cross1_ry[4] = cross1_ry[0] - 493.75 // south y value
//
// units at center
//
// Making Units move to the random point selected w offseting specified above
//
// unit offset moving units = 180 degrees
//
call SetUnitPosition( LightningUnit[1], cross1_rx[3], cross_center_y )
call IssuePointOrder( LightningUnit[1], "patrol", cross1_rx[4], cross_center_y )
//
call SetUnitPosition( LightningUnit[2], cross1_rx[4], cross_center_y )
call IssuePointOrder( LightningUnit[2], "patrol", cross1_rx[0], cross_center_y )
//
// unit offset moving units = 0 degrees
//
call SetUnitPosition( LightningUnit[3], cross1_rx[1], cross_center_y )
call IssuePointOrder( LightningUnit[3], "patrol", cross1_rx[2], cross_center_y )
//
call SetUnitPosition( LightningUnit[4], cross1_rx[2], cross_center_y )
call IssuePointOrder( LightningUnit[4], "patrol", cross1_rx[0], cross_center_y )
//
// unit offset moving units = 270 degrees
//
call SetUnitPosition( LightningUnit[5], cross_center_x, cross1_ry[3] )
call IssuePointOrder( LightningUnit[5], "patrol", cross_center_x, cross1_ry[4] )
//
call SetUnitPosition( LightningUnit[6], cross_center_x, cross1_ry[4] )
call IssuePointOrder( LightningUnit[6], "patrol", cross_center_x, cross1_ry[0] )
//
// unit offset moving units = 90 degrees
//
call SetUnitPosition( LightningUnit[7], cross_center_x, cross1_ry[1] )
call IssuePointOrder( LightningUnit[7], "patrol", cross_center_x, cross1_ry[2] )
//
call SetUnitPosition( LightningUnit[8], cross_center_x, cross1_ry[2] )
call IssuePointOrder( LightningUnit[8], "patrol", cross_center_x, cross1_ry[0] )
//
// starting lightning effects
//
set LightningEffect[0] = AddLightning( "CLPB", true, cross1_rx[1], cross_center_y, cross1_rx[3], cross_center_y )
set LightningEffect[1] = AddLightning( "CLPB", true, cross_center_x, cross1_ry[1], cross_center_x, cross1_ry[3] )
call PolledWait( 3.00 )
set Lightning_Boolean[1] = true
call DestroyLightning( LightningEffect[0] )
call DestroyLightning( LightningEffect[1] )
set LightningEffect[0] = AddLightning("AFOD", true, cross1_rx[1], cross_center_y, cross1_rx[3], cross_center_y )
set LightningEffect[1] = AddLightning("AFOD", true, cross_center_x, cross1_ry[1], cross_center_x, cross1_ry[3] )
call PolledWait( 2.50 )
set Lightning_Boolean[1] = false
call DestroyLightning( LightningEffect[0] )
call DestroyLightning( LightningEffect[1] )
set Random_Plus_Sign_Counter = Random_Plus_Sign_Counter + 1
if ( Random_Plus_Sign_Counter == 5 ) then
call EnableTrigger( trg_Plus_Sign_Random[2] )
elseif ( Random_Plus_Sign_Counter == 10 ) then
call EnableTrigger( trg_Plus_Sign_Random[3] )
endif
endfunction
//===========================================================================
function InitTrig_Plus_Sign_Random_1 takes nothing returns nothing
set trg_Plus_Sign_Random[1] = CreateTrigger()
call DisableTrigger( trg_Plus_Sign_Random[1] )
call TriggerRegisterTimerEvent( trg_Plus_Sign_Random[1], 6.00, true )
call TriggerAddAction( trg_Plus_Sign_Random[1], function Trig_Plus_Sign_Random_1_Actions )
endfunction
JASS:
function Trig_Plus_Sign_Random_Kill_Trigger_1_Actions takes nothing returns nothing
local real x
local real y
local integer Loop1 = 1
local integer triggerplayer
call DisplayTextToForce( GetPlayersAll(), " fires" )
if ( (GetTriggerPlayer() == Player(0)) or (GetTriggerPlayer() == Player(1)) ) and (Lightning_Boolean[1] == true) then
set triggerplayer = GetPlayerId( GetTriggerPlayer())
if ( triggerplayer == 0 ) then
call DisplayTextToForce( GetPlayersAll(), "Player 2 Has Won The Minigame" )
elseif ( triggerplayer == 1 ) then
call DisplayTextToForce( GetPlayersAll(), "Player 1 Has Won The Minigame" )
endif
call DisableTrigger( trg_Plus_Sign_Random_Kill_Trigger[1] )
call DisableTrigger( trg_Plus_Sign_Random_Kill_Trigger[2] )
call DisableTrigger( trg_Plus_Sign_Random_Kill_Trigger[3] )
call DisableTrigger( trg_Plus_Sign_Random[1] )
call DisableTrigger( trg_Plus_Sign_Random[2] )
call DisableTrigger( trg_Plus_Sign_Random[3] )
call PolledWait( 7.00 )
loop
exitwhen Loop1 > 24
call SetUnitPosition( LightningUnit[Loop1], LightningUnit_X[Loop1], LightningUnit_Y[Loop1] )
set Loop1 = Loop1 + 1
endloop
set Lightning_Boolean[1] = false
set Lightning_Boolean[2] = false
set Lightning_Boolean[3] = false
call ResumeTimer( udg_Random_Events_Timer )
call TimerDialogDisplay( udg_Random_Events_Timer_Window, true )
endif
endfunction
//===========================================================================
function InitTrig_Plus_Sign_Random_Kill_Trigger_1 takes nothing returns nothing
set trg_Plus_Sign_Random_Kill_Trigger[1] = CreateTrigger( )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[1], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[2], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[3], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[4], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[5], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[6], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[7], 125.00, null )
call TriggerRegisterUnitInRange( trg_Plus_Sign_Random_Kill_Trigger[1], LightningUnit[8], 125.00, null )
call TriggerAddAction( trg_Plus_Sign_Random_Kill_Trigger[1], function Trig_Plus_Sign_Random_Kill_Trigger_1_Actions )
endfunction
Last edited: