The player has a cloak with an associated item 1 of an aimed concentration script spell.
This script spell only operates on dead people.
The script transfers all of their items to a chest in a duplicated CTest room.
Upon doing so it runs this script:
Scriptname PilferSort extends ObjectReference GlobalVariable Property PilferGlobal autoEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)int skip = 0float Weight = akBaseItem.GetWeight()int Value = http://forums.bethsoft.com/topic/1381988-slight-problem-with-pilfer/akBaseItem.GetGoldValue()if (Weight==0.0 && Value> 0) self.RemoveItem(akBaseItem, aiItemCount, true, Game.GetPlayer()) skip = 1 endIffloat PilferVal = (Value/Weight)if (PilferVal >= (PilferGlobal.GetValue() as float) && skip==0) self.RemoveItem(akBaseItem, aiItemCount, true, Game.GetPlayer())elseif (PilferVal < (PilferGlobal.GetValue() as float) && skip==0) self.RemoveItem(akBaseItem, aiItemCount, true, akSourceContainer)endIfendEvent
Which works marvelously to sort the items into going either to the player or back to the enemy.
Here's the issue. I can't think of a way to "flag" the enemy as having been searched before, so while the items given to the player are correct, if you search the body afterwards and keep searching over and over, different items will be in their inventory as the items cycle between the chest and the body. Kind of a problem. I would use faction ranks, but unfortunately you can't manipulate the faction ranks of dead NPCs (for some stupid reason). Does anyone have an idea?
