No loot on death?

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

No loot on death?

Post by bodom »

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?
Toadstool
New User
Posts: 8
Joined: Mon Apr 27, 2015 10:29 pm

Re: No loot on death?

Post by Toadstool »

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.
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

Re: No loot on death?

Post by bodom »

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 :)
Toadstool
New User
Posts: 8
Joined: Mon Apr 27, 2015 10:29 pm

Re: No loot on death?

Post by Toadstool »

lol fair enough, very specific :P

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 :P

I can't think of anything else atm. Short of not allowing people to die, or completely re writing backpack storage :P
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

Re: No loot on death?

Post by bodom »

Our players usually have maniacally orderer backpacks... to be honest, mine too :D
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm

Re: No loot on death?

Post by bodom »

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 :bacondance:
Post Reply