Jump to content
  • 0

PvP Player gets drops by killing others in a specific map


Mizore

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  03/15/20
  • Last Seen:  

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 ~

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  03/15/20
  • Last Seen:  

Thanks a lot.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  03/15/20
  • Last Seen:  

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

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