///////////////////////////////////////////////////////////////////////////////////
// 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.
Question
solid2005
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.