Jump to content
  • 0

Player item drop when it killed


solid2005

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  145
  • Reputation:   15
  • Joined:  01/06/12
  • Last Seen:  

///////////////////////////////////////////////////////////////////////////////////
// Custom script for Item drops on player's death
// --------------------------------------------------------------------------------
// Created by Brian ([email protected])
// for original use on eAthena Stable 12623
///////////////////////////////////////////////////////////////////////////////////
- script DeathHandle -1,{
OnPCDieEvent:

//Set this variable to pass on to the next script
set $plrdead$, strcharinfo(0);
//Get map info
getmapxy(@mapname$,@mapx,@mapy,0);

//Remove all cards and unequip everything
//Ideally, we wouldn't do this, however there's no good way to drop
//an item that has cards compounded onto it. A bit inconvienant, but
//it works.
for (set @i,0; @i < 10; set @i,@i+1) {
	successremovecards @i;
}
nude;
//Figure out how many items to take
getinventorylist;
//Change "/3" to reflect the amount of items to drop
//1 = 100%, 2 = 50%, 3 = 33%, 4= 25%, etc.
set $@drops,(@inventorylist_count*(100/100));
//Let's not make it easy for players to dup.
if(@inventorylist_count==0) goto ENDPOS;
//This is the loop that goes through the inventory dropping items
for(set $@iterations,0; $@iterations < $@drops; set $@iterations,$@iterations+1) {
	//Update inventory variables
	getinventorylist;

	//Randomly choose an item in the inventory array
	set $@randselect, rand(0,@inventorylist_count);

	//Drop the item, on the ground, at the location you died.
	makeitem @inventorylist_id[$@randselect],@inventorylist_amount[$@randselect],@mapname$,@mapx,@mapy;

	//Take the item out of your inventory.
	delitem @inventorylist_id[$@randselect],@inventorylist_amount[$@randselect];
}

ENDPOS:
end;
}

is there have new idea for this script to not abuse resu kill? to avoid dupe.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


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

erm...maybe try these way ?

Make a Delay for Item Dropping ?

Make Announce upon someone killed another one ?

Limiting how many time he can kill ? ( cant spam kill for only 1 ppl )

etc

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  145
  • Reputation:   15
  • Joined:  01/06/12
  • Last Seen:  

hmm i will try to add sleep.

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