Jump to content
  • 0

Requesting for PVP PK points and PVP NPC SHOP script .TY


Question

Posted (edited)

Hello guys .. 

Please help me .. 

I need a Script which will create a PK points in my server and a PK points NPC ..

- For every Kill to the players = 1PK Point
- NPC shop that use PK points

- only in specific map like "guild_vs3"

Thanks in advance! 

More power rAthena.. 

Please Help! 

Edited by BavariaN

14 answers to this question

Recommended Posts

Posted

Hmm...

-	shop	custom_seller2	-1,501:500
prontera.gat,95,99,5	script	PK Points Dealer	100,{
	mes "[PK Points Dealer]";
	mes "I will sell you items for PK points.";
	mes "Each time you kill a player on "+.map$+" you'll get 1 PK point 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$, "guild_vs3";
	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;
}
  • Upvote 2
  • 0
Posted
On 11/7/2014 at 12:44 PM, Emistry said:

-	script	pvp_point	-1,{
	OnPCKilLEvent:
		if ( killedrid == @last_killedrid )
			@last_killedrid_count++;
		else 
			@last_killedrid_count = 0;
		
		@last_killedrid = killedrid;
		
		if ( getcharid(3) != killedrid && strcharinfo(3) == "guild_vs3" && @last_killedrid_count < 3 ) {
			PVP_POINT++;
			dispbottom " +1 PVP Point.";
		}
		end;
}

i write the script based on 1st post, didnt check the rest of the post.

 

 

anyway i was just try to show him how the shop can be done easily using the pointshop instead of still using dynamic npc shop script for it.

btw , how to change value of PK point kill. i will per Killed get 2 PK point ? thanks u

  • 0
Posted
On 11/6/2014 at 4:09 PM, Skorm said:

Hmm...


-	shop	custom_seller2	-1,501:500
prontera.gat,95,99,5	script	PK Points Dealer	100,{
	mes "[PK Points Dealer]";
	mes "I will sell you items for PK points.";
	mes "Each time you kill a player on "+.map$+" you'll get 1 PK point 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$, "guild_vs3";
	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;
}

can we set this script in a specific map

Posted

 

No restrictions but here's the general idea.

 

 

Thank you so much for this script bro .. But i want something ..

- for every killing players it will shows the points i gained on the main chat .

- and also show the the total points i have on the NPC

Thank you so much bro more power ! Skorm!

Posted

 

Thank you so much for this script bro .. But i want something ..

- for every killing players it will shows the points i gained on the main chat .

- and also show the the total points i have on the NPC

Thank you so much bro more power ! Skorm!

 

 

I've modified my above post at your request.

 

http://rathena.org/board/topic/95948-requesting-for-pvp-pk-points-and-pvp-npc-shop-script-ty/?p=260180

Posted

 

 

Thank you so much for this script bro .. But i want something ..

- for every killing players it will shows the points i gained on the main chat .

- and also show the the total points i have on the NPC

Thank you so much bro more power ! Skorm!

 

 

I've modified my above post at your request.

 

http://rathena.org/board/topic/95948-requesting-for-pvp-pk-points-and-pvp-npc-shop-script-ty/?p=260180

 

I hope it has restriction to stop PK points feeding .

Anyways Thank you very much bro ! ^_^ .. Its now working according to my preference ..

More power !

Please help ! 

How to put a restriction for example ..

If the Player kill twice the same players, for the third kill or succeeding kills in same players it will not give a Point .. Thanks ..

Posted

How to put a restriction for example ..

If the Player kill twice the same players, for the third kill or succeeding kills in same players it will not give a Point .. Thanks ..

please UP !! 

is this the script that we wishing bro Skorm?

Posted

something like this ?



-	script	pvp_point	-1,{
	OnPCKilLEvent:
		if ( getcharid(3) != killedrid && strcharinfo(3) == "guild_vs3" ) {
			PVP_POINT++;
			dispbottom " +1 PVP Point.";
		}
		end;
}

// npc shop.
prontera,155,181,5	pointshop	PVP Point Shop	757,PVP_POINT,909:-1,607:-1
  • Upvote 1
Posted

something like this ?

 

I don't see how that actually has like a player based restriction xD.

 

 

is this the script that we wishing bro Skorm?

 

Test it? Yes this is what you wanted... You can extend the number of players who were killed for the script to remember and also how lean or strict the condition is...

Posted

-	script	pvp_point	-1,{
	OnPCKilLEvent:
		if ( killedrid == @last_killedrid )
			@last_killedrid_count++;
		else 
			@last_killedrid_count = 0;
		
		@last_killedrid = killedrid;
		
		if ( getcharid(3) != killedrid && strcharinfo(3) == "guild_vs3" && @last_killedrid_count < 3 ) {
			PVP_POINT++;
			dispbottom " +1 PVP Point.";
		}
		end;
}

i write the script based on 1st post, didnt check the rest of the post.

 

 

anyway i was just try to show him how the shop can be done easily using the pointshop instead of still using dynamic npc shop script for it.

Posted

 

i write the script based on 1st post, didnt check the rest of the post.

 

 

anyway i was just try to show him how the shop can be done easily using the pointshop instead of still using dynamic npc shop script for it.

 

 

Right the original shop is pretty old but still that's not a very good way to add a restriction to it... Instead do what I did. Create an array with the ids and count them then you can control how many times a player is killed and it adds an extra layer of protection because the player can't farm on 2 different characters.

Posted

 

Hmm...

-	shop	custom_seller2	-1,501:500
prontera.gat,95,99,5	script	PK Points Dealer	100,{
	mes "[PK Points Dealer]";
	mes "I will sell you items for PK points.";
	mes "Each time you kill a player on "+.map$+" you'll get 1 PK point 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$, "guild_vs3";
	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;
}

Please help me to change 

"You've gained 1 point! Your total is ["+pk_points+"] PK point(s)."

Into this:

 

"You've gained 1Point after killing [PlayerName] Your total is ["+pk_points+"] PK point(s).

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...