Hi again,
I need to prevent some players to drop loot on death on some circumstances.
To make an example, let's say I want that anyone who dies in the Britain area does not lose any item.
Solutions I've already think of:
1. Use areas enterscript and leavescript to set all items as newbie and then back when entering/leaving the area. Why this is bad: too much risk that all the items will stay newbie if (when) something goes wrong.
2. On chrdeath.ecl move all items from corpse back to ghost; that's Zulu's solution. Why this is bad: consumes a lot of script cycles, screws up the backpack, since the items do not retain their original x,y position and z order inside the backpack.
Any ideas?
No loot on death?
Re: No loot on death?
I take it you still want people to be able to die.
I'd probably go the adding a check in the death script. Depending on what pol your using, you can put items back exactly where they were in the backpack.
In the containers oninsert (iirc) script add an xy prop to the gump position of the items placement. Can even do the same thing to dress the player again.
If your worried about speed (should be fine though) you could combine the entered and left area scripts to add and remove a prop from the player so the death script doesn't check players xyz for a particular location each time.
I'd probably go the adding a check in the death script. Depending on what pol your using, you can put items back exactly where they were in the backpack.
In the containers oninsert (iirc) script add an xy prop to the gump position of the items placement. Can even do the same thing to dress the player again.
If your worried about speed (should be fine though) you could combine the entered and left area scripts to add and remove a prop from the player so the death script doesn't check players xyz for a particular location each time.
Re: No loot on death?
Thank you for your reply!
I've just tried this solution. It kinda works (sometimes the MoveObjectToContainer() semms to ignore the x,y i give it), but it is still not optimal because it does not match the order.
Let's say by example I have a robe in the background of my backpack and some items placed over it.
After this script running, the robe will probably pop up in foreground, hiding all the smaller items behind it.
That's a step forward, but still not exactly what I am looking for
I've just tried this solution. It kinda works (sometimes the MoveObjectToContainer() semms to ignore the x,y i give it), but it is still not optimal because it does not match the order.
Let's say by example I have a robe in the background of my backpack and some items placed over it.
After this script running, the robe will probably pop up in foreground, hiding all the smaller items behind it.
That's a step forward, but still not exactly what I am looking for
Re: No loot on death?
lol fair enough, very specific 
Wouldn't players keep their main pack organised anyway? We're just talking about having the players backpacks oninsert script saving the xy. Personally I'd just say bad luck to anyone scruffy enough not to have their top layer nicely layed out
I can't think of anything else atm. Short of not allowing people to die, or completely re writing backpack storage
Wouldn't players keep their main pack organised anyway? We're just talking about having the players backpacks oninsert script saving the xy. Personally I'd just say bad luck to anyone scruffy enough not to have their top layer nicely layed out
I can't think of anything else atm. Short of not allowing people to die, or completely re writing backpack storage
Re: No loot on death?
Our players usually have maniacally orderer backpacks... to be honest, mine too 
Re: No loot on death?
To follow up, I am now using the new insurance feature in conjunction with the CanDie() hook.
When the CanDie() is called, I insure all the items I do not want to drop and the trick is done
When the CanDie() is called, I insure all the items I do not want to drop and the trick is done