There are almost as many methods for making loot appear as there are scripters. :-)
Some people use a box in an inacessable spot filled with the loot which they want to appear somewhere, then a script copies some or all of the items to the creature (or to the creature's treasure chest) when the creature dies.
The standard Bioware system creates the loot on the creature as part of the OnSpawn event. This can be dangerous for balancing since some creatures may have the proficiency to equip and use the items you gave them (but never intended them to use).
The method I prefer is to run a script on death which uses a table of items and selects an item at random from the table. You can call the script multiple times for more than one item. You can make more than one script to handle different monsters and different loot.
If you're talking about loot appearing in containers, I prefer to use a script as above linked to the OnOpen event for the container, to create the loot.
If it's a single-player game, the OnOpen script needs to set a variable to prevent more loot from being created and check the variable before creating loot.
If it's a multi-player game, the script needs to set up a delayed command which will delete the variable after an amount of time has elapsed so that following players can get loot.
Modifié par Melkior_King, 21 juillet 2011 - 01:31 .