Quote Originally Posted by Ghallo
Think about it in terms of server maint. If you generate the loot on mob spawn, you have to keep track of what the loot is for the life of the mob. This means a new table in the database. If you generate the loot on when the player loots the mob ... you don't need to track anything. Both results, over time, would show the same level of randomness - but generating drops on loot is more efficient.
Its not as simple as that.

Generating loot when corpse is looted:
- high priority operations
- several random calls
- loot table lookups
- additional table entry operations for logging purposes
ie - slower as loot needs to be calculated

Generating loot on spawn (or instance creation) or earlier:
- a "loot" cache can be generated during low server load times
- new spawns simply grab the 1st available loot entry (can be done at corpse loot time as well)
- already have a log of all loot so no additional processing necessary
- no loot table lookups
ie - very fast and low server load

Imagine a loot cache for instances, lets say the loot for 100 Kara instances are generated and added to a table with a RAID_ID. When a raid enters an instance for the first time and they are not saved they are assigned the 1st available RAID_ID.

Killing anything results in the loot simply looked up from the loot cache for that RAID_ID. During system maintenance new instances are generated and added to the cache.

The "random" function is pretty expensive as well and I am sure they pre-gen a cache of random numbers anyway. Every call to get a random number will simply be a cache lookup instead of running a complicated random number formula.

EDIT:
Thinking about it, adding new items is probably an expensive operation as well. If the loot is cached all the items can be generated beforehand and flagged as "non-existant" items until someone recieves an item as loot.

Also, a loot cache can explain differences in boss loot easily. When the boss is killed the first time an entry is grabbed from the loot cache for the boss and that entry is flagged as used. It simply means the loot is not linked to the RAID_ID until such time as looting occurs.

*crash*

Kill boss again and a new cache entry is grabbed as the previous one is already flagged as used.