Jump to content
  • 0

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


BavariaN

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

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
Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  51
  • Reputation:   0
  • Joined:  05/23/14
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Exchange PlayerName with

"+rid2name(killedrid)+"

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

No restrictions but here's the general idea.

-- Code moved to final post --
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

 

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!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

 

 

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  08/09/14
  • Last Seen:  

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?

Link to comment
Share on other sites


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

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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

Link to comment
Share on other sites


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


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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

 

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  41
  • Reputation:   1
  • Joined:  10/17/13
  • Last Seen:  

 

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