Jump to content
  • 0

PvP Points System


DevKira

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

Hello, I just need a little help about my script. I just get this script here also in rAthena. (credits)

 

NOTE: I WANT TO ENABLE THIS PVP POINTS TO WOE/PVP MAPS.

->  Enabled WoE Castles

-> Enabled PvP Maps

-    shop    custom_seller2    -1,501:500
1@ghvy,120,94,3    script    PvP Points Dealer    100,{
    mes "[PvP Points Dealer]";
    mes "I will sell you items for PvP points.";
    mes "Each time you kill a player on "+.map$+" you'll get 1 PvP point to spend here!";
    next;
    mes "[PvP Points Dealer]";
    mes "You currently have [^0000ff"+pvp_points+"^000000] PvP 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(pvp_points >= .Price[.@i]*@bought_quantity[.@d]) {
                        set pvp_points, pvp_points - .Price[.@i]*@bought_quantity[.@d];
                        getitem @bought_nameid[.@d],@bought_quantity[.@d];
                    } else dispbottom "You don't have enough PvP 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 ) {
        pvp_points++;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
    }
    end;
    
    
OnInit:
    set .map$, "pvpwait","ra_koe";
    set .saved_l, 3; //Length of saved ids can be up to 127.
    set .rstrk_l, 2; //Level of restriction.
    setarray .customs[0],  12103, 607, 678; // Enter the ID of customs here...
    setarray .Price[0],    20   , 40 , 300; // Price for each custom here...
    npcshopitem "custom_seller2", 0  ,   0; // 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;
}

 

Edited by Emistry
codebox
Link to comment
Share on other sites

21 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  136
  • Reputation:   48
  • Joined:  06/18/12
  • Last Seen:  

Spoiler

OnInit:
    set .map$, "pvpwait","ra_koe","prontera";

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

41 minutes ago, Gerzzie said:
  Hide contents

OnInit:
    set .map$, "pvpwait","ra_koe","prontera";

 

I already tried that, but its not working.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  


OnPCKillEvent:
getmapxy,
if map != pvp maps end

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

1 hour ago, Chun3 said:


OnPCKillEvent:
getmapxy,
if map != pvp maps end

 

How? I didn't get this,.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

OnPCKillEvent:
  getmapxy @map$,@x,@y,0;
            if ( @map$ == "woemap01" || @map$ == "pvpmap01" ) {
 copyarray( @killed$[1], @killed$[0], .saved_l-1 );
    @killed$ = ""+killedrid;
    if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
        pvp_points++;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
    }
}
    end;

 

Edited by Chun3
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

i'll try this now wait;

Hi,  @Chun3

it's not working.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  



-    shop    custom_seller2    -1,501:500
1@ghvy,120,94,3    script    PvP Points Dealer    100,{
    mes "[PvP Points Dealer]";
    mes "I will sell you items for PvP points.";
    next;
    mes "[PvP Points Dealer]";
    mes "You currently have [^0000ff"+pvp_points+"^000000] PvP 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(pvp_points >= .Price[.@i]*@bought_quantity[.@d]) {
                        set pvp_points, pvp_points - .Price[.@i]*@bought_quantity[.@d];
                        getitem @bought_nameid[.@d],@bought_quantity[.@d];
                    } else dispbottom "You don't have enough PvP 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:
getmapxy @map$,@x,@y,0;
 if ( (@map$ != "woemap01") || (@map$ != "pvpmap01") ) end;  //Put here the maps you WISH to work the points.
    copyarray( @killed$[1], @killed$[0], .saved_l-1 );
    @killed$ = ""+killedrid;
    if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
        pvp_points++;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
    }
    end;
    
    
OnInit:
    set .saved_l, 3; //Length of saved ids can be up to 127.
    set .rstrk_l, 2; //Level of restriction.
    setarray .customs[0],  12103, 607, 678; // Enter the ID of customs here...
    setarray .Price[0],    20   , 40 , 300; // Price for each custom here...
    npcshopitem "custom_seller2", 0  ,   0; // 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

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

5 minutes ago, Chun3 said:


-    shop    custom_seller2    -1,501:500
1@ghvy,120,94,3    script    PvP Points Dealer    100,{
    mes "[PvP Points Dealer]";
    mes "I will sell you items for PvP points.";
    next;
    mes "[PvP Points Dealer]";
    mes "You currently have [^0000ff"+pvp_points+"^000000] PvP 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(pvp_points >= .Price[.@i]*@bought_quantity[.@d]) {
                        set pvp_points, pvp_points - .Price[.@i]*@bought_quantity[.@d];
                        getitem @bought_nameid[.@d],@bought_quantity[.@d];
                    } else dispbottom "You don't have enough PvP 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:
getmapxy @map$,@x,@y,0;
 if ( (@map$ != "woemap01") || (@map$ != "pvpmap01") ) end;  //Put here the maps you WISH to work the points.
    copyarray( @killed$[1], @killed$[0], .saved_l-1 );
    @killed$ = ""+killedrid;
    if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) {
        pvp_points++;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
    }
    end;
    
    
OnInit:
    set .saved_l, 3; //Length of saved ids can be up to 127.
    set .rstrk_l, 2; //Level of restriction.
    setarray .customs[0],  12103, 607, 678; // Enter the ID of customs here...
    setarray .Price[0],    20   , 40 , 300; // Price for each custom here...
    npcshopitem "custom_seller2", 0  ,   0; // 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;
}

 

It's still not working bro. ? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

Dude, are u changing

if ( (@map$ != "woemap01") || (@map$ != "pvpmap01") ) end;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

yes.

 

I will change this map to

 

Map Names:

prtg_cas01

prtg_cas02

prtg_cas03

prtg_cas04

prtg_cas05

ra_koe

pvpwait

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

its working normal here

are u putting the <tabs> on the header?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

Yes, i'm putting tabs on the header. ? 

Can you put my map so i can just copy and paste.

 

here's the map i want

 

prtg_cas01

pvpwait

ra_koe

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

-	shop	custom_seller2	-1,501:500
prontera,120,94,3	script	ehuq	100,{
    mes "[PvP Points Dealer]";
    mes "I will sell you items for PvP points.";
    next;
    mes "[PvP Points Dealer]";
    mes "You currently have [^0000ff"+pvp_points+"^000000] PvP 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(pvp_points >= .Price[.@i]*@bought_quantity[.@d]) {
                        set pvp_points, pvp_points - .Price[.@i]*@bought_quantity[.@d];
                        getitem @bought_nameid[.@d],@bought_quantity[.@d];
                    } else dispbottom "You don't have enough PvP 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:
getmapxy @map$,@x,@y,0;
 if ( (@map$ != "prontera") || (@map$ != "pvpwait") || (@map$ != "ra_koe") ) {end;}   //Put here the maps you WISH to work the points.
       set pvp_points,  pvp_points+1;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
    end;
    
    
OnInit:
    setarray .customs[0],  12103, 607, 678; // Enter the ID of customs here...
    setarray .Price[0],    20   , 40 , 300; // Price for each custom here...
    npcshopitem "custom_seller2", 0  ,   0; // 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;
}

image.png.690be2ccbf6faab7d97f1d1f8e07a896.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

I will try again. Thank you.

Thanks for the time and effort. I really really appreciate it dude. Wait let me try it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

That map u have, ra_koe, can u send a pic?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

ok wait

still not working

image.thumb.png.31097eace2734853780f4cdd0deb6b4c.png

image.thumb.png.48274879a24d950c6716d41a38456584.pnghmmmm

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

Sorry, a logic problem.
 

OnPCKillEvent:
getmapxy @map$,@x,@y,0;
 if ( (@map$ == "prtg_cas01") || (@map$ == "pvpwait") || (@map$ == "ra_koe") ) {  
       set pvp_points,  pvp_points+1;
        dispbottom "You've gained 1 PvP Point. Total = "+pvp_points+" PvP Points.";
}
    end;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

still not workingimage.png.adab4ff62e4357ba248fb8011d0db331.png.. 

 

 

CAN YOU DO TEAMVIEWER? ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   2
  • Joined:  10/04/19
  • Last Seen:  

Thanks, @Chun3!!! Commend this man!!!

100% Helpful ❤️ 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

if you're asking to make this script to work for ALL pvp and gvg maps

then change this

OnPCKillEvent:
    if( strcharinfo(3) != .map$ ) end;

into this

OnPCKillEvent:
	.@map$ = strcharinfo(3);
	if (!getmapflag(.@map$, mf_pvp) && !getmapflag(.@map$, mf_gvg)) end;

 

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   9
  • Joined:  08/22/19
  • Last Seen:  

send id by pm

Solved.

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