Jump to content
  • 0

Player item drop when it killed


Question

Posted

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

2 answers to this question

Recommended Posts

Posted

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

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