Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script bg_pk -1,{
- OnInit:
- // both red and blue team required how many player
- $@team_count = 5;
- // map that will be used.
- .map$ = "bat_c01";
- // cloth color for red team
- .bg_cloth_red = 2;
- // cloth color for blue team
- .bg_cloth_blue = 10;
- $@bg_npc_name$ = strnpcinfo(0);
- setmapflag .map$,mf_loadevent;
- setmapflag .map$,mf_battleground;
- setmapflag .map$,mf_partylock;
- mapwarp .map$,"prontera",155,175;
- donpcevent "::OnBGEnable";
- end;
- OnRedJoin:
- .@bg_user_count = bg_get_data( .bg_red,0 );
- if( .@bg_user_count == $@team_count ){
- kickwaitingroomall "bg_red";
- end;
- }else if( .@bg_user_count && .@bg_user_count < $@team_count ){
- .@count = 1;
- }else{
- .@count = $@team_count;
- }
- if( getwaitingroomstate( 0,"bg_red" ) == .@count ){
- if( .@count == 1 && .bg_red ){
- waitingroom2bg_single( .bg_red,.map$,0,0,"bg_red" );
- mapannounce .map$,"A Player joined RED Team. Red Team has "+bg_get_data( .bg_red,0 )+" users now.",0;
- }else{
- .bg_red = waitingroom2bg( .map$,0,0,$@bg_npc_name$+"::OnQuit",$@bg_npc_name$+"::OnDead","bg_red" );
- mapannounce .map$,"Red Team joined...",0;
- bg_warp .bg_red,.map$,0,0;
- }
- }
- end;
- OnBlueJoin:
- .@bg_user_count = bg_get_data( .bg_blue,0 );
- if( .@bg_user_count == $@team_count ){
- kickwaitingroomall "bg_blue";
- end;
- }else if( .@bg_user_count && .@bg_user_count < $@team_count ){
- .@count = 1;
- }else{
- .@count = $@team_count;
- }
- if( getwaitingroomstate( 0,"bg_blue" ) == .@count ){
- if( .@count == 1 && .bg_blue ){
- waitingroom2bg_single( .bg_blue,.map$,0,0,"bg_red" );
- mapannounce .map$,"A Player joined BLUE Team. BLUE Team has "+bg_get_data( .bg_blue,0 )+" users now.",0;
- }else{
- .bg_blue = waitingroom2bg( .map$,0,0,$@bg_npc_name$+"::OnQuit",$@bg_npc_name$+"::OnDead","bg_blue" );
- mapannounce .map$,"Blue Team joined...",0;
- bg_warp .bg_blue,.map$,0,0;
- }
- }
- end;
- OnSoloJoin:
- .@bg_solo = waitingroom2bg( .map$,0,0,$@bg_npc_name$+"::OnQuit",$@bg_npc_name$+"::OnDead","bg_solo" );
- mapannounce .map$,"A Solo Player joined.",0;
- bg_warp .@bg_solo,.map$,0,0;
- end;
- OnDead:
- .@bg_id = getcharid(4);
- if( .@bg_id == .bg_red || .@bg_id == .bg_blue )
- changelook LOOK_CLOTHES_COLOR,getlook( LOOK_CLOTHES_COLOR );
- warp "SavePoint",0,0;
- OnQuit:
- .@bg_id = getcharid(4);
- bg_leave;
- if( .@bg_id == .bg_red ){
- announce "BG Red Team have an empty slot since a player just left the team.",0;
- }else if( .@bg_id == .bg_blue ){
- announce "BG Blue Team have an empty slot since a player just left the team.",0;
- }
- if( bg_get_data( .@bg_id,0 ) == 0 ){
- if( .@bg_id == .bg_red ) .bg_red = 0;
- else if( .@bg_id == .bg_blue ) .bg_blue = 0;
- bg_destroy .@bg_id;
- }
- end;
- OnPCLoadMapEvent:
- if( strcharinfo(3) == .map$ ){
- .@bg_id = getcharid(4);
- if( !.@bg_id ){
- warp "SavePoint",0,0;
- }else if( .@bg_id == .bg_red ){
- changelook LOOK_CLOTHES_COLOR,.bg_cloth_red;
- }else if( .@bg_id == .bg_blue ){
- changelook LOOK_CLOTHES_COLOR,.bg_cloth_blue;
- }else{
- changelook LOOK_CLOTHES_COLOR,getlook( LOOK_CLOTHES_COLOR );
- }
- }
- end;
- }
- prontera,151,182,5 script Red Team::bg_red 100,{
- if( getcharid(4) ){
- bg_leave;
- message strcharinfo(0),"You leaved the Group.";
- changelook LOOK_CLOTHES_COLOR,getlook( LOOK_CLOTHES_COLOR );
- }
- end;
- OnBGEnable:
- delwaitingroom;
- waitingroom "Red TEAM",( $@team_count + 1 ),$@bg_npc_name$+"::OnRedJoin",1;
- end;
- }
- prontera,160,182,5 script Blue Team::bg_blue 100,{
- if( getcharid(4) ){
- bg_leave;
- message strcharinfo(0),"You leaved the Group.";
- changelook LOOK_CLOTHES_COLOR,getlook( LOOK_CLOTHES_COLOR );
- }
- end;
- OnBGEnable:
- delwaitingroom;
- waitingroom "Blue TEAM",( $@team_count + 1 ),$@bg_npc_name$+"::OnBlueJoin",1;
- end;
- }
- prontera,155,182,5 script SOLO Team::bg_solo 100,{
- if( getcharid(4) ){
- bg_leave;
- message strcharinfo(0),"You leaved the Group.";
- changelook LOOK_CLOTHES_COLOR,getlook( LOOK_CLOTHES_COLOR );
- }
- end;
- OnBGEnable:
- delwaitingroom;
- waitingroom "SOLO TEAM",2,$@bg_npc_name$+"::OnSoloJoin",1;
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment