Also looking for a way to send PC weapons to inventory ondisarm. Possible?
server: nwnx2 / Windows
In the Module Event (OnUnacquire Item) you would basically check to see if the item was a weapon (ranged or melee) that was Unacquired & if it was a PC that dropped it, also check to see if the PC is in combat, and if so, return it to the owner by copying the object onto the PC and destroying the original dropped (be sure to copy variables over)...
I use this to prevent duping as well, by destroying all objects dropped if it's not a weapon and for weapons, if in combat, if the PC drops it, the original is destroyed and the copy is put in the player's inventory. Of course I give the PC gold for lost items, sometimes they do it by accident, so the lost is at least somewhat returned to them..
However, many PCs may complain, so you could simply just copy what is dropped & put it back into the PC's inventory (Destroying the original), and then, if the copy is dropped, you could warn the PC that their inventory is full... You will need to set a variable on the copy & ensure that when it's dropped you check that variable, and set the script to tell the PC that their inventory is full. (Obviously you will need to remove the variable after a short delay to ensure the message doesn't fire off falsely later when the PC drops it say (2 minutes later)) When you check the variable on the copy, you wouldn't want to destroy it or copy it back into the PC's inventory, or you would enter this infinite loop, probably locking down the server / game / module..
I noticed quite a few servers have some wild infinite loops running around, they don't realize it because the DMs or Server Admins are never on..
'>
Modifié par _Guile, 15 mai 2012 - 05:26 .