Jump to content
  • 0

PvP Player gets drops by killing others in a specific map


Question

Posted

Hi people~

I'm looking for a script that after a player A kill another player B on a specific map, A have a chance on getting a item or cash. 

Anyone knows a command to do that?

Thanks ~

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
-	script	asdahjhla	-1,{
OnPCKillEvent:
	if ( inarray(.map$, strcharinfo(3)) != -1 ) {
		if ( rand(100) <= .chance ) {
			getitem 501, 10;
			#CASHPOINTS += 1; // I forgot to add this
			dispbottom "You earned 1 Cash Point. Total : "+ #CASHPOINTS;
		}
	}
	end;

OnInit:
	.chance = 50; // chance to get something
	setarray .map$, "prontera", "payon"; // map list
}

 

Edited by Mabuhay
  • Upvote 1
  • 0
Posted
9 hours ago, Mabuhay said:

-	script	asdahjhla	-1,{
OnPCKillEvent:
	if ( inarray(.map$, strcharinfo(3)) != -1 ) {
		if ( rand(100) <= .chance ) {
			getitem 501, 10;
			#CASHPOINTS += 1; // I forgot to add this
			dispbottom "You earned 1 Cash Point. Total : "+ #CASHPOINTS;
		}
	}
	end;

OnInit:
	.chance = 50; // chance to get something
	setarray .map$, "prontera", "payon"; // map list
}

 

This can be exploited if you do a suicide mission (paladin casting grand cross for instance)

@Mizore 

Change 

if ( rand(100) <= .chance ) {

to

if ( rand(100) <= .chance && killedrid != getcharid(3) ) {

 

  • Upvote 1
  • 0
Posted
55 minutes ago, Patskie said:

This can be exploited if you do a suicide mission (paladin casting grand cross for instance)

@Mizore 

Change 


if ( rand(100) <= .chance ) {

to


if ( rand(100) <= .chance && killedrid != getcharid(3) ) {

 

Yeah that's great. Thank you guys.

I have another question. I wanna add to this script a chance to drop a costume at 0.1% of chance.  My question is: Can I use the variable value .chance = 0.1;?

Thanks again

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