The easiest way to implement looting would be to override the "loot" script slot for NPCs and containers. I've not done it yet since I want it done probably with GUIs and stuff (and of course with the ability for the player to dump his items onto the container in turn.
I've had precious little time as of late but I have been working on a few things when I can... It's quite possible for the RPG to enter beta sometime within the next two released.
In any case... The papyrus example in the tutorial was for a (one time) harvestable plant. The example would work better if its inventory respawned after a set period of time. but in hindsight, I suppose I could've simply dropped a few item entities to achieve it, but this has other ramifications too, such as the model for the harvested papyrus being completely different.
Not to mention using the trigger makes it much easier to add other conditions before you'll be able to pickup or harvest the item.
a basic looting script for pretty much anything... I'll eventually get around to a proper looting GUI and an r_transfer command.
Do note this won't get equipped items.
Code: Select all
r_script_signal "loot" [
r_loop_inv item self [
r_additem actor (r_get_base item) (r_get_quantity item)
r_remove self (r_get_base item) (r_get_quantity item)
]
]