Jump to content
  • 0

How to put countdown?


Myth

Question


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

//Made by AnnieRuru
//http://roscripts.go-forum.net/
//An open site where you can share and download some helpful RO Scripts.
//===================================================================
-    script    custom_bg#control    -1,{
OnInit:
    set .startingscore, 20; // score at start
    set .eventlasting, 120; // event last 120 seconds or the system abort itself
    end;
onstart:
    if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end;
    set .red, waitingroom2bg( "guild_vs2", 8,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead", .rednpcname$ );
    copyarray .team1aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
    set .blue, waitingroom2bg( "guild_vs2", 91,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead", .bluenpcname$ );
    copyarray .team2aid[.@i], $@arenamembers[.@i], $@arenamembersnum;
    delwaitingroom .rednpcname$;
    delwaitingroom .bluenpcname$;
    bg_warp .red, "guild_vs2", 8,50;
    bg_warp .blue, "guild_vs2", 91,50;
    set .score[1], .startingscore;
    set .score[2], .startingscore;
    bg_updatescore "guild_vs2", .score[1], .score[2];
    sleep .eventlasting * 1000;
    if ( .score[1] == .score[2] )
        announce "Deathmatch Ground : Draw !", 0;
    else if ( .score[1] > .score[2] ) {
        announce "Deathmatch Ground : Red Team Wins !", 0;
        callsub L_reward, 1, 0;
        callsub L_reward, 2, 2;
    }
    else if ( .score[1] < .score[2] ) {
        announce "Deathmatch Ground : Blue Team Wins !", 0;
        callsub L_reward, 2, 0;
        callsub L_reward, 1, 2;
    }
    OnTimer50000:
        announce "Deathmatch Ground is now open for another match @ prontera 156 170 !",0;
    bg_warp .red, "prontera", 156,191;
    bg_warp .blue, "prontera", 156,191;
    bg_destroy .red;
    bg_destroy .blue;
    donpcevent .rednpcname$ +"::OnInit";
    donpcevent .bluenpcname$ +"::OnInit";
    end;

L_reward:
    set .@size, getarraysize( getd(".team"+ getarg(0) +"aid") );
    for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 )
        if ( isloggedin( getd(".team"+ getarg(0) +"aid["+ .@i +"]" ) ) )
            getitem .rewarditem[ getarg(1) ], .rewarditem[ getarg(1) +1 ], getd(".team"+ getarg(0) +"aid["+ .@i +"]" );
    return;
OnredDead: callsub L_dead, 1;
OnblueDead: callsub L_dead, 2;
L_dead:
    set .score[ getarg(0) ], .score[ getarg(0) ] -1;
    bg_updatescore "guild_vs2", .score[1], .score[2];
    if ( .score[ getarg(0) ] == 0 )
        awake strnpcinfo(0);
    sleep2 1500;
    percentheal 100,100;
    end;
OnredQuit: callsub L_quit, 1, .red;
OnblueQuit: callsub L_quit, 2, .blue;
L_quit:
    percentheal 100, 100;
    if ( bg_get_data( getarg(1), 0) ) end;
    set .score[ getarg(0) ], 0;
    awake strnpcinfo(0);
    end;
}
//RED TEAM
prontera,152,157,5    script    Deatchmatch Grounds    733,{
    end;
OnInit:
    waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::onstart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
    set getvariableofnpc( .rednpcname$, "custom_bg#control" ), strnpcinfo(0);
    end;
}

prontera,36,95,5    script    ...    111,{input @broadcast$;atcommand ""+@broadcast$+"";} //DO NOT TOUCH

//BLUE TEAM
prontera,159,157,5    script    Deathmatch Grounds#1    734,{
    end;
OnInit:
    waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::onstart", getvariableofnpc( .minplayer2start, "custom_bg#control" );
    set getvariableofnpc( .bluenpcname$, "custom_bg#control" ), strnpcinfo(0);
    end;
}
guild_vs2    mapflag    battleground    2
guild_vs2    mapflag    nosave    SavePoint
guild_vs2    mapflag    nowarp
guild_vs2    mapflag    nowarpto
guild_vs2    mapflag    noteleport
guild_vs2    mapflag    nomemo
guild_vs2    mapflag    nopenalty
guild_vs2    mapflag    nobranch
guild_vs2    mapflag    noicewall
 

 

 

how to put a countdown timer when all the players are all in the map? and dont move until the npc announce Buffs ON maybe 5seconds interval before the NPC count in 3, 2, 1, Go 

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

pcblockmove + mapannounce

    bg_updatescore "guild_vs2", .score[1], .score[2];// <- block the move after this line
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

so it will be 

 

 

bg_updatescore "guild_vs2", .score[1], .score[2];// <- block the move after this line
pcblockmove getcharid(3),1;

 

 

how about the announce?

 

announce buff on 

pcblockmove getcharid(3),0;

 

i dont know how to make it

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


bg_updatescore "guild_vs2", .score[1], .score[2];// <- block the move after this line

for ( .@i = 0; .@i < .minplayer2start; .@i++ ){

pcblockmove .team1aid[.@i],1;

pcblockmove .team2aid[.@i],1;

}

sleep 3000;

for ( .@i = 5; .@i >= 0; .@i-- ){

sleep 1000;

mapannounce "guild_vs2", "Start in "+ .@i +" seconds..",0;

}

for ( .@i = 0; .@i < .minplayer2start; .@i++ ){

if ( isloggedin( .team1aid[.@i] ) )

pcblockmove .team1aid[.@i],0;

if ( isloggedin( .team2aid[.@i] ) )

pcblockmove .team2aid[.@i],0;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

thanks, ill try it then ill give you feedback

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

but i want buffs ready then character can now move then announce 5 4 3 2 1 GO there is an interval before npc will announce 5 4 3 2 1

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


bg_updatescore "guild_vs2", .score[1], .score[2];// <- block the move after this line

for ( .@i = 0; .@i < .minplayer2start; .@i++ ){

pcblockmove .team1aid[.@i],1;

pcblockmove .team2aid[.@i],1;

}

sleep 3000;

mapannounce "guild_vs2", "buff ready",0;

for ( .@i = 5; .@i >= 0; .@i-- ){

sleep 1000;

mapannounce "guild_vs2", "Start in "+ .@i +" seconds..",0;

}

for ( .@i = 0; .@i < .minplayer2start; .@i++ ){

if ( isloggedin( .team1aid[.@i] ) )

pcblockmove .team1aid[.@i],0;

if ( isloggedin( .team2aid[.@i] ) )

pcblockmove .team2aid[.@i],0;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

still not moving when the map announce buffs ready. what i mean to say when the map announce buffs ready. players can move then after 5 secs map announce again in 5 4 3 2 1 GO

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

Posted · Hidden by Capuche, August 9, 2013 - Useless
Hidden by Capuche, August 9, 2013 - Useless

bump

Link to comment

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

bg_updatescore "guild_vs2", .score[1], .score[2];// <- block the move after this line
for ( .@i = 0; .@i < .minplayer2start; .@i++ ){// block the players
	pcblockmove .team1aid[.@i],1;
	pcblockmove .team2aid[.@i],1;
}
sleep 5000;// add a delay of 5 secs
for ( .@i = 0; .@i < .minplayer2start; .@i++ ){// unblock players
	if ( isloggedin( .team1aid[.@i] ) )
		pcblockmove .team1aid[.@i],0;
	if ( isloggedin( .team2aid[.@i] ) )
		pcblockmove .team2aid[.@i],0;
}
sleep 5000;// add a delay of 5 secs
mapannounce "guild_vs2", "buff ready",0;
for ( .@i = 5; .@i >= 0; .@i-- ){// mapannounce the count 5 4 3
	sleep 1000;
	mapannounce "guild_vs2", "Start in "+ .@i +" seconds..",0;
}

like this?

I gave you all you need now. Rearrange it as your content

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

working ^_^

 

how can i add GO in the end of countdown 3 2 1?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

Posted · Hidden by Capuche, August 9, 2013 - Useless
Hidden by Capuche, August 9, 2013 - Useless

bump

Link to comment

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  254
  • Reputation:   72
  • Joined:  07/10/13
  • Last Seen:  

You mean announcing "Go!" instead of "Start in 0 seconds..."?

for ( .@i = 5; .@i >= 0; .@i-- ){// mapannounce the count 5 4 3

sleep 1000;

mapannounce "guild_vs2", .@i == 0 ? "Go!" : "Start in "+ .@i +" seconds..",0;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  59
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   5
  • Joined:  05/30/12
  • Last Seen:  

You mean announcing "Go!" instead of "Start in 0 seconds..."?

for ( .@i = 5; .@i >= 0; .@i-- ){// mapannounce the count 5 4 3
	sleep 1000;
	mapannounce "guild_vs2", .@i == 0 ? "Go!" : "Start in "+ .@i +" seconds..",0;
}

no im saying after the npc count another  map announce and say Go!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Then add a mapannounce saying Go after the loop.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...