Jump to content
  • 0

Requesting 3v3 Event (Semi BG Type [Blue Team vs Red Team])


Aya

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

I am requesting for an NPC that will get 6 different players. Allowing those 6 Different players to Register first. Once the NPC has a 6 players registered, it will randomly group it by 2 Teams, 3 players = 1 team (Red Team and Blue Team). So it will be a 3 vs 3 randomly.

Their goal is simple, eliminate the opponent team. The Winners will receive an Item (custom Item: ID = 30000).

Thank you! :)

If this is possible. Thank you =)

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Their goal is simple, eliminate the opponent team.
explain what is 'eliminate the opponent team'

I've already made battleground script with winning conditions of

1. kill enemy team players earn 1 point, accumulate 30 points to win

2. kill enemy team players earn 1 point, after 30 mins the team with most points win

3. capture a location flag, the more flags the team capture, accumulate more resources, when resources hit 100 points, the team wins

4. kill enemy team emperium to gain 1 point, the 1st team earns 2 points win the match

or if you suggest other ideas than this one ... or else I'm lazy to write

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Their goal is simple, eliminate the opponent team.
explain what is 'eliminate the opponent team'

Hi Annie! What I mean by that is to just, eliminate them all. It's like a Party vs. Party event but, in terms of 2 Teams that are generated randomly =)

I've already made battleground script with winning conditions of

1. kill enemy team players earn 1 point, accumulate 30 points to win

2. kill enemy team players earn 1 point, after 30 mins the team with most points win

3. capture a location flag, the more flags the team capture, accumulate more resources, when resources hit 100 points, the team wins

4. kill enemy team emperium to gain 1 point, the 1st team earns 2 points win the match

or if you suggest other ideas than this one ... or else I'm lazy to write

Can I have and test this script? =) Sounds interesting.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

1 & 2 is bugged currently, it was made during eathena board time

but I guess I can made simple fix like from this one to make it compatible with rathena

maybe something like this

3 is here

4 is here

yes, but still you have to explain how a team gain points to win ....

otherwise it doesn't interest me

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Thank you Annie.

yes, but still you have to explain how a team gain points to win ....

otherwise it doesn't interest me

It's like a pure PvP. The Team will win if there's no other remaining player in the other Team. For example, Blue Team has still 2 remaining players and Red Team has only 1, when the only remaining player of the Red Team died, Blue Team wins.

So if you want to win in this event, you just have to kill all the members of the Opponent Team.

You can also add a Point System in this event, Annie.

The Point system goes like this:

In order to win, the Team must be able to obtain a total of 3 Points.

Here's an example:

Blue Team = 3

Red Team = 3

Score: Red = 0

Blue = 0

One member of Red Team died, so

Blue Team = 3

Red Team = 2

Score: Red = 0

Blue = 1

Something like that. 1 Point will be added in the Score if a single player of the Opponent team died / disconnected.

1 & 2 is bugged currently, it was made during eathena board time

but I guess I can made simple fix like from this one to make it compatible with rathena

maybe something like this

yes, but still you have to explain how a team gain points to win ....

otherwise it doesn't interest me

Hi Annie! I tried this script and it works perfectly. But the problem is, when the Player died and be respawned it the starting point, it has 1 HP and Sp. I want it to be full. How can I do that?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

source modification

http://rathena.org/board/topic/72571-battleground-system-without-waitingroom/

global function - shuffling algorithm

function    script    rand__    {
   .@range = getarg(0);
   .@count = getarg(2, 0);
   .@count = ( .@count == 0 || .@count > .@range )? .@range : ( .@count > 128 )? 128 : .@count;
   while ( .@i < .@count ) {
       .@r = .@save = rand( .@i, .@range -1 ) ;
       if ( getd(".@tmp1_"+ .@i ) == 0 ) {
           .@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r;
           setd ".@tmp2_"+ .@i, .@r;
           setd ".@tmp2_"+ .@save , .@i;
           setd ".@tmp1_"+ .@save , 1;
           set getelementofarray( getarg(1), .@i ), .@r;
           if ( .@save < .@count )
               set getelementofarray( getarg(1), .@save ), .@i;
       }
       .@i++;
   }
   return .@count;
}

script

prontera,149,167,5    script    bg_pvp_register    100,{
   if ( .start == 0 ) {
       if ( getgmlevel() >= 80 ) {
           mes "start ?";
           next;
           select "yeah";
           .start = 1;
           announce strcharinfo(0) +" has hosted a "+ .min2start +"vs"+ .min2start +" battleground", 0;
           close;
       }
       mes "no event now";
       close;
   }
   else if ( .start == 2 ) {
       mes "a match is currently running now";
       if ( getgmlevel() >= 80 ) {
           mes "abort ?";
           next;
           select "yeah";
           .start = 0;
           awake strnpcinfo(0);
       }
       close;
   }
   else if ( getgmlevel() >= 80 ) {
       if ( select( "register", "abort" ) == 2 ) {
           .start = .register_num = 0;
           deletearray .register_aid;
           close;
       }
   }
   for ( .@i = 0; .@i < .register_num; .@i++ ) {
       if ( .register_aid[.@i] == getcharid(3) ) {
           dispbottom "you already register";
           close;
       }
   }
   .register_aid[ .register_num ] = getcharid(3);
   .register_num++;
   announce strcharinfo(0) +" has register for battleground", 0;
   if ( .register_num < .min2start *2 ) close;
   announce "event started", 0;
   .start = 2;
   callfunc "rand__", .min2start *2, $@rand;
   for ( .@i = 0; .@i < .register_num; .@i++ )
       setbgid ( .@i % 2 )? .red : .blue, .register_aid[ $@rand[.@i] ];
   bg_warp .red, "guild_vs3", 13,50;
   bg_warp .blue, "guild_vs3", 86,50;
   bg_updatescore "guild_vs3", 0,0;
   sleep .eventlasting * 1000;
   if ( .start == 2 ) {
       if ( .score[1] == .score[2] )
           mapannounce "guild_vs3", "Draw !", 0;
       else if ( .score[1] > .score[2] ) {
           mapannounce "guild_vs3", "red side wins !", 0;
           callsub L_reward, .red;
       }
       else if ( .score[1] < .score[2] ) {
           mapannounce "guild_vs3", "blue side wins !", 0;
           callsub L_reward, .blue;
       }
   }
   bg_warp .red, "prontera", 155,182;
   bg_warp .blue, "prontera", 158,182;
   bg_kickall .red;
   bg_kickall .blue;
   .start = .score[1] = .score[2] = .register_num = 0;
   deletearray .register_aid;
   end;
L_reward:
   getbgusers getarg(0);
   for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )
       getitem 30000, 1, $@arenamembers[.@i]; // item reward
   return;
Onredout: callsub L_out, 2;
Onblueout: callsub L_out, 1;
L_out:
   announce strcharinfo(0) +" is out from the match !", 1;
   bg_leave;
   warp "SavePoint", 0,0;
   .score[ getarg(0) ]++;
   bg_updatescore "guild_vs3", .score[1], .score[2];
   if ( .score[ getarg(0) ] == .min2start )
       awake strnpcinfo(0);
   end;
OnInit:
   .red = 1; // red team bg ID
   .blue = 2; // blue team bg ID
   .eventlasting = 30 * 60; // how long would the event last or it auto-reset. 30 *60 = 30 mins
   .min2start = 3; // how many players require to start ? if 3vs3, set to 3
   createbgid .red, "guild_vs3", 13,50, strnpcinfo(0)+"::Onredout", strnpcinfo(0)+"::Onredout";
   createbgid .blue, "guild_vs3", 13,50, strnpcinfo(0)+"::Onblueout", strnpcinfo(0)+"::Onblueout";
   end;
}

guild_vs3    mapflag    battleground    2
guild_vs3    mapflag    nosave    SavePoint
guild_vs3    mapflag    nowarp
guild_vs3    mapflag    nowarpto
guild_vs3    mapflag    noteleport
guild_vs3    mapflag    nomemo
guild_vs3    mapflag    nopenalty
guild_vs3    mapflag    nobranch
guild_vs3    mapflag    noicewall

seriously, 1 of the easiest battleground script ever made

break my own record = 40 mins to complete a battleground script XD

EDIT:

weird, I thought you want the user to get kick out if they got killed ?

there's

*areapercentheal "<mapname>",<x1>,<y1>,<x2>,<y2>,<hp>,<sp>;

Not exactly limited to battleground use, this will restore HP/SP in a defined area at a percentage.

Example:

areapercentheal "bat_a01",52,208,61,217,100,100;

end;

to auto-heal players inside battleground map Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

Thank you Annie! :*

EDIT:

weird, I thought you want the user to get kick out if they got killed ?

there's

*areapercentheal "<mapname>",<x1>,<y1>,<x2>,<y2>,<hp>,<sp>;

Not exactly limited to battleground use, this will restore HP/SP in a defined area at a percentage.

Example:

areapercentheal "bat_a01",52,208,61,217,100,100;

end;

to auto-heal players inside battleground map

I was using this script Annie, http://rathena.org/b...und#entry145720.

It works fine for me, the only problem was, when I died in guild_vs3, its not restoring the HP and SP to full.

This is what I am using,

- script custom_bg#control -1,{

OnInit:

set .minplayer2start, 3; // minimum player to start

setarray .rewarditem,

30000, 10, // reward to the winning team

30000, 3; // reward to the losing team

set .startingscore, 15; // score at start

set .eventlasting, 100; // event last 100 seconds

end;

OnStart:

if ( getwaitingroomstate( 0, "red side" ) < .minplayer2start || getwaitingroomstate( 0, "blue side" ) < .minplayer2start ) end;

set .red, waitingroom2bg( "guild_vs3", 13,50, strnpcinfo(0)+"::OnredQuit", strnpcinfo(0)+"::OnredDead", "red side" );

copyarray .team1aid[.@i], $@arenamembers[.@i], $@arenamembersnum;

set .blue, waitingroom2bg( "guild_vs3", 86,50, strnpcinfo(0)+"::OnblueQuit", strnpcinfo(0)+"::OnblueDead", "blue side" );

copyarray .team2aid[.@i], $@arenamembers[.@i], $@arenamembersnum;

delwaitingroom "red side";

delwaitingroom "blue side";

bg_warp .red, "guild_vs3", 13,50;

bg_warp .blue, "guild_vs3", 86,50;

set .score[1], .startingscore;

set .score[2], .startingscore;

bg_updatescore "guild_vs3", .score[1], .score[2];

sleep .eventlasting * 1000;

if ( .score[1] == .score[2] )

mapannounce "guild_vs3", "Draw !", 0;

else if ( .score[1] > .score[2] ) {

mapannounce "guild_vs3", "red side wins !", 0;

callsub L_reward, 1, 0;

callsub L_reward, 2, 2;

}

else if ( .score[1] < .score[2] ) {

mapannounce "guild_vs3", "blue side wins !", 0;

callsub L_reward, 2, 0;

callsub L_reward, 1, 2;

}

bg_warp .red, "revencia", 164,37;

bg_warp .blue, "revencia", 164,37;

bg_destroy .red;

bg_destroy .blue;

donpcevent "red side::OnInit";

donpcevent "blue side::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_vs3", .score[1], .score[2];

if ( .score[ getarg(0) ] == 0 )

//awake strnpcinfo(0);

areapercentheal "guild_vs3",13,50,86,50,100,100;

end;

OnredQuit: callsub L_quit, 1, .red;

OnblueQuit: callsub L_quit, 2, .blue;

L_quit:

if ( bg_get_data( getarg(1), 0) ) end;

set .score[ getarg(0) ], 0;

awake strnpcinfo(0);

percentheal 100, 100;

end;

}

revencia,143,30,5 script red side 733,{

end;

OnInit:

waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );

end;

}

revencia,143,27,5 script blue side 734,{

end;

OnInit:

waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" );

end;

}

guild_vs3 mapflag battleground 2

guild_vs3 mapflag nosave SavePoint

guild_vs3 mapflag nowarp

guild_vs3 mapflag nowarpto

guild_vs3 mapflag noteleport

guild_vs3 mapflag nomemo

guild_vs3 mapflag nopenalty

Still, when the player revives, it is not Full HP and SP..

PS: Now trying what I've requested =)

Edited by Aya
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Thanna has convinced me that I should use waitingroom to trigger the event after all

my setbgid script command will halt the script if the player logout too x.x

prontera,149,167,5    script    bg_pvp_register    100,{
   if ( getgmlevel() < 80 ) end;
   else if ( .start == 0 ) {
       mes "start ?";
       next;
       select "yeah";
       .start = 1;
       announce strcharinfo(0) +" has hosted a "+ .min2start +"vs"+ .min2start +" battleground", 0;
       waitingroom "BG PVP", .min2start *2 +1, strnpcinfo(0)+"::onstart", .min2start *2;
   }
   else if ( .start == 1 ) {
       mes "abort ?";
       next;
       select "yeah";
       .start = 0;
       delwaitingroom strnpcinfo(0);
   }
   else {
       mes "a match is currently running now";
       mes "abort ?";
       next;
       select "yeah";
       .start = 0;
       awake strnpcinfo(0);
   }
   close;
Onstart:
   getmapxy .@map$, .@x, .@y, 1;
   warpwaitingpc .@map$, .@x, .@y;
   announce "event started", 0;
   .start = 2;
   callfunc "rand__", .min2start *2, $@rand;
   for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ )
       setbgid ( .@i % 2 )? .red : .blue, $@warpwaitingpc[ $@rand[.@i] ];
   delwaitingroom strnpcinfo(0);
   bg_warp .red, "guild_vs3", 13,50;
   bg_warp .blue, "guild_vs3", 86,50;
   bg_updatescore "guild_vs3", 0,0;
   sleep .eventlasting * 1000;
   if ( .start == 2 ) {
       if ( .score[1] == .score[2] )
           mapannounce "guild_vs3", "Draw !", 0;
       else if ( .score[1] > .score[2] ) {
           mapannounce "guild_vs3", " Red side wins !", 0;
           callsub L_reward, .red;
       }
       else if ( .score[1] < .score[2] ) {
           mapannounce "guild_vs3", " Blue side wins !", 0;
           callsub L_reward, .blue;
       }
   }
   bg_warp .red, "prontera", 155,182;
   bg_warp .blue, "prontera", 158,182;
   bg_kickall .red;
   bg_kickall .blue;
   .start = .score[1] = .score[2] = .register_num = 0;
   deletearray .register_aid;
   end;
L_reward:
   getbgusers getarg(0);
   for ( .@i = 0; .@i < $@arenamembersnum; .@i++ )
       getitem 501, 1, $@arenamembers[.@i]; // item reward
   return;
Onredout: callsub L_out, 2;
Onblueout: callsub L_out, 1;
L_out:
   announce strcharinfo(0) +" is out from the match !", 1;
   bg_leave;
   warp "SavePoint", 0,0;
   .score[ getarg(0) ]++;
   bg_updatescore "guild_vs3", .score[1], .score[2];
   if ( .score[ getarg(0) ] == .min2start )
       awake strnpcinfo(0);
   end;
OnInit:
   .red = 1; // red team bg ID
   .blue = 2; // blue team bg ID
   .eventlasting = 30; // how long would the event last or it auto-reset. 30 *60 = 30 mins
   .min2start = 1; // how many players require to start ? if 3vs3, set to 3
   createbgid .red, "guild_vs3", 13,50, strnpcinfo(0)+"::Onredout", strnpcinfo(0)+"::Onredout";
   createbgid .blue, "guild_vs3", 86,50, strnpcinfo(0)+"::Onblueout", strnpcinfo(0)+"::Onblueout";
   end;
}

guild_vs3    mapflag    battleground    2
guild_vs3    mapflag    nosave    SavePoint
guild_vs3    mapflag    nowarp
guild_vs3    mapflag    nowarpto
guild_vs3    mapflag    noteleport
guild_vs3    mapflag    nomemo
guild_vs3    mapflag    nopenalty
guild_vs3    mapflag    nobranch
guild_vs3    mapflag    noicewall

something like this

though I think your request was already solved here lol

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  125
  • Reputation:   2
  • Joined:  08/27/12
  • Last Seen:  

/no1 /no1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  01/03/13
  • Last Seen:  

I would love to use this script, But it seems to not work with my server.

Npc loads but when you click it doesnt do nothing.

Iam guessing script error or maybe is because i use a eAthena server?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

bg_pvp_random_0.3.txt

for this particular topic, Aya requested the team generated randomly

Hi Annie! What I mean by that is to just, eliminate them all. It's like a Party vs. Party event but, in terms of 2 Teams that are generated randomly =)
and this one require source modification and shuffling algorithm

source modification

http://rathena.org/board/topic/72571-battleground-system-without-waitingroom/

shuffling algorithm

function	script	rand__	{
.@range = getarg(0);
.@count = getarg(2, 0);
if ( !.@count || .@count > .@range )
	.@count = .@range;
else if ( .@count > 128 )
	.@count = 128;
while ( .@i < .@count ) {
	.@r = .@save = rand( .@i, .@range -1 ) ;
	if ( !getd( ".@tmp1_"+ .@i ) ) {
		.@r = ( getd(".@tmp1_"+ .@r ) )? getd( ".@tmp2_"+ .@r ) : .@r;
		setd ".@tmp2_"+ .@i, .@r;
		setd ".@tmp2_"+ .@save , .@i;
		setd ".@tmp1_"+ .@save , 1;
		set getelementofarray( getarg(1), .@i ), .@r;
		if ( .@save < .@count )
			set getelementofarray( getarg(1), .@save ), .@i;
	}
	.@i++;
}
return .@count;
}

there are a few other battleground script that doesn't need source modification,

you can try search around

Edited by AnnieRuru
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...