Jump to content
  • 0

PK points to be account bound instead of char bound


aferny

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  20
  • Reputation:   0
  • Joined:  09/28/20
  • Last Seen:  

Hi guys.

 

I have this working Pvp script. But its char bound atm. How can i make it a whole account bound. Like all characters that kill in the pvp room share the PK points? 

 

Thanks in advance!

 

Quote

-    shop    custom_seller2    1,4399:4000
firstcity,208,74,5    script    PK Points Dealer    856,{
    mes "[PK Points Dealer]";
    mes "I will sell you items for PK points.";
    mes "Each time you kill a player in the ^ff0000PVP room^000000 you'll get ^0000ff1 PK point^000000 to spend here!";
    next;
    mes "[PK Points Dealer]";
    mes "You currently have [^0000ff"+pk_points+"^000000] PK points to spend.";
    callshop "custom_seller2",1;
    npcshopattach "custom_seller2";
    end;

OnBuyItem:
    for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) {
        for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) {
            if(@bought_nameid[.@d]==.customs[.@i]) {
                if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) {
                    if(pk_points >= .Price[.@i]*@bought_quantity[.@d]) {
                        set pk_points, pk_points - .Price[.@i]*@bought_quantity[.@d];
                        getitem @bought_nameid[.@d],@bought_quantity[.@d];
                    } else dispbottom "You don't have enough PK points to purchase that item.";
                } else dispbottom "Purchasing these items will put you over the weight limit!";
            }
        }
    }
    deletearray @bought_quantity, getarraysize(@bought_quantity);
    deletearray @bought_nameid, getarraysize(@bought_nameid);
    close;

OnPCKillEvent:
    if( strcharinfo(3) != .map$ ) end;
    copyarray( @killed$[1], @killed$[0], .saved_l-1 );
    @killed$ = ""+killedrid;
    if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
        pk_points++;
        dispbottom "You've gained one point! Your total is ["+pk_points+"] PK point(s).";
    }
    end;


OnInit:
    set .map$, "1@lab";
    set .saved_l, 15; //Length of saved ids can be up to 127.
    set .rstrk_l, 2; //Level of restriction.
    setarray .customs[0],  4399, 4263, 6480, 2967 , 2892 , 2860 , 2980 , 2936 , 2899 , 12246 , 13891 , 13892 , 13893 , 13894 , 12915;// Enter the ID of customs here...
    setarray .Price[0],    4000, 3500, 1500, 1000 , 1000 , 1000 , 1000 , 1000 , 1000 , 500 , 1 , 1 , 1 , 1 , 1; // Price for each custom here...
     npcshopitem "custom_seller2", 6544 ,   1000; // Don't touch any coding beyond here..
    for( set .i,0; .customs[.i]; set .i,.i+1 )
        npcshopadditem "custom_seller2",.customs[.i],.Price[.i];
    end;
}
 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  108
  • Reputation:   12
  • Joined:  06/19/12
  • Last Seen:  

Like what @botka4aet said. Just change pk_points to #pk_points.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   24
  • Joined:  02/11/16
  • Last Seen:  

if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
        #pk_points++;
        dispbottom "You've gained one point! Your total is ["+pk_points+"] PK point(s).";
    }

 

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