Jump to content
  • 0

Hi need help with Party v Party Script


mishy

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  10/31/12
  • Last Seen:  

Here is the script, Help me to put minimum of 3 members per party before you can join the event. So it is like 3v3(Minimum) and more.

http://pastebin.com/8MKNx6Lv

Thank you and Godbless. (:

Edited by mishy
Link to comment
Share on other sites

5 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:  

input .No,1,$@partymembercount;

change into

input .No,3,$@partymembercount;

I think no need change the rest, if the party leader bring with 2 members only,

the script automatically register with 3vs3 also

so the party leader itself became aware to bring enough members

PS: that is emistry's script ? lol... I'm getting more and more surprise xD

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  10/31/12
  • Last Seen:  

Thank you AnnieRuru now it is working :) Yes I think this is from Emistry.

I just want to ask another question because the script is not checking if my members are online.

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:  

prontera,163,174,4    script    PartyvParty    746,{
   mes "I am Party Match Manager.";
   mes "Party Leader may create a PVP Match here.";
   next;
   switch( select( ( .Created )?"Join Game[ ^FF0000"+.No+"vs"+.No+"^000000 ]":"Create Game",
   ( ( getgmlevel() >= .GMLevel || getcharid(0) == getpartyleader( getcharid(1),2 ) ) && .Created )?"^FF0000Remove Game^000000":"" )){

       Case 1:
       switch( .Created ){
           Case 0:
           getpartymember getcharid(1),1;
           if( getcharid(0) != getpartyleader( getcharid(1),2 ) || !getcharid(1) ){
               mes "Sorry, but only a ^FF0000Party Leader^000000 can register a game here.";
           } else {
               getpartymember getcharid(1), 2;
               for ( .@i = 0; .@i < $@partymembercount; .@i++ )
                   if ( isloggedin( $@partymemberaid[.@i] , $@partymembercid[.@i] ) )
                       .@party_online++;
               if ( .@party_online < .min2start ) {
                   mes "Your party must have "+ .min2start +" players online to register";
                   close;
               }
               mes "How many Players for each Party Team ?";
               mes "Min = "+ .min2start +"    Max = "+$@partymembercount;
               mes "Because you only have "+$@partymembercount+" member right now.";
               next;
               input .No, .min2start ,$@partymembercount;
               announce "[ "+.No+"vs"+.No+" Party Match ] created by "+strcharinfo(0)+", you may register to join.",0;
               set .Team[0],getcharid(1);
               set .Created,1;
           }
           close;
           Case 1:
           if( !.Team[1] && getcharid(1) == .Team[0] ){
               mes "Please wait for ^FF0000Team 2^000000 to Register.";
           }else{
               if( getcharid(0) != getpartyleader( getcharid(1),2 ) || !getcharid(1) ){
                   mes "Sorry, but only a ^FF0000Party Leader^000000 can register a game here.";
                   close;
               }
               getpartymember getcharid(1),1;
               if( $@partymembercount < .No ){
                   mes "You didnt have enough of "+.No+" Member for the Game.";
                   mes "You only have "+$@partymembercount+" Member.";
               }else{
                   getpartymember getcharid(1), 2;
                   for ( .@i = 0; .@i < $@partymembercount; .@i++ )
                       if ( isloggedin( $@partymemberaid[.@i] , $@partymembercid[.@i] ) )
                           .@party_online++;
                   if ( .@party_online < .No ) {
                       mes "You didnt have enough of "+ .No +" Member for the Game.";
                       mes "You only have "+ .@party_online +" Members online.";
                       close;
                   }
                   mes "Confirm Registration ?";
                   if( select("Yes:No") == 1 ){
                       set .Team[1],getcharid(1);
                       set .Created,2;
                       setarray .Members[0],.No,.No;
                       for( set .@party,0; .@party < 2; set .@party,.@party + 1 ){
                           getpartymember .Team[.@party],1;
                           for( set .@i,0; .@i < .No; set .@i,.@i + 1 )
                           warpchar .Map$,0,0,$@partymembercid[.@i];
                       }
                       end;
                   }
               }
           }
           close;
           Case 2:
           mes "^FF0000The Game is in Progress.^000000";
           mes "[ A "+.No+" vs "+.No+" Game ]";
           mes "Team ^FF0000"+getpartyname( .Team[0] )+"^000000 vs Team ^FF0000"+getpartyname( .Team[1] )+"^000000 .";
           close;
       }
       close;
       Case 2:
       mes "Done, Match will be terminated right away.";
       mapannounce .Map$,"Match has been Cancelled by a GM.",0;
       close2;
OnReset:
       deletearray .Team[0],getarraysize( .Team );
       deletearray .Members[0],getarraysize( .Members );
       if( .Winner ){
           getpartymember .Winner,2;
           for( set .@i,0; .@i < .No; set .@i,.@i + 1 ){
               getitem 7227,5,$@partymemberaid[.@i];
               getitem 14003,1,$@partymemberaid[.@i];
           }
           set .Winner,0;
       }
       sleep2 2000;
       set .Created,0;
       mapwarp .Map$,"prontera",155,181;
       end;
   }
   close;

OnPCDieEvent:
OnPCLogoutEvent:
   if( strcharinfo(3) == .Map$ && .Created ){
       for( set .@i,0; .@i < 2; set .@i,.@i + 1 )    
       if( getcharid(1) == .Team[.@i] )
       set .Members[.@i],.Members[.@i] - 1;

       if( .Members[0] < 1 ) set .Winner,.Team[1];
       else if( .Members[1] < 1 ) set .Winner,.Team[0];

       if( .Winner ){
           mapannounce .Map$,"Team "+getpartyname( .Winner )+" Win the "+.No+"vs"+.No+" Game.",0;
           donpcevent strnpcinfo(0)+"::OnReset";
       }else{
           warp "prontera",156,180;
       }
   }
   end;

OnInit:
   set .GMLevel,80;
   set .Map$,"pvp_n_2-3";
   set .min2start, 2;
   end;
}

after some debugging I have to say ... I can't recommend this script, because

1. the registration doesn't counter check the player is online or not

if 1 side totally log off when the game start, the other side will get stuck in the map with nothing to do except logout

2. this script doesn't check for all the party members in the team MUST be online

if the 1st party member is log off, the team become imbalance

even worst if the party had use transfer party leader to bottom position, and top position is offline

3. I can always dual client and ask it to get free items if register 1vs1 match

I prefer some kind of gambling system,

gamble 1 item from each team and the winning team gets gambled items from both side

http://www.eathena.ws/board/index.php?showtopic=180637 <-- something like this, but careful his script always bug

so ... nope emistry still have rooms for improvements ....

well I can't say much because I never made party vs party script myself also hehehe

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  10/31/12
  • Last Seen:  

Thank you AnnieRuru, I would really love to try it when I got home. :D I will let you know what happened after the implementation of this script to my server. About Emistry I love him for he is great. Thanks Annie.

Edited by mishy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   0
  • Joined:  06/17/12
  • Last Seen:  

tried your edited script AnnieRuru, but stucked when creating game and script error script: jump_zero: not label !

is there a fix? because tried other Party vs Party script but this one by Emistry is much better if the following bugs will be fixed

Thank you

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...