Ok, I've written a component that does the following with random treasures:
1. Duplicate random treasures get deleted so only 1 is retained. This is probably a bug for most CREs - you can tell by looking at it with NearInfinity (multiple slots will have the same item reference).
2. "Poor" creatures (those with rndtre01.itm) have no chance for getting scrolls. They didn't have much before, but it's unrealistic a "poor" person would be casually carrying around a scroll worth 100 gold, given the average treasure spawned for this item row is a coin or two.
3. If the creature has an Intelligence less than 10 or is an ogre (not ogre mage), ghoul, gnoll, basilisk or troll, they have no chance for carrying scrolls or other such magical items. Instead, they'll get a random gem, necklace, ring (nonmagical) or sometimes a minor potion, depending on their item level (rndtre02-05). This is handled by 3 new rows in rndtreas.2da.
I think that might do it, unless people think otherwise. You might wonder why I didn't include orcs, hobgoblins and such with the races in #3. Well, it's because there aren't any in the default game that I saw with INT over 9, so they won't be getting any scrolls either.
There might be some argument for keeping #1 separate (I can't think of a good one, but maybe someone else can). So I could code it something like:
1) Remove duplicate random treasures
2) Only intelligent creatures get scrolls
3) Both of the above
Would be easier not to split it like this, but it's not a big problem either.
Edit: Regarding medium/low INT creatures carrying scrolls, there aren't as many in this category as you may think. I'd agree in theory for medium INT CREs, but magical scrolls really should be quite rare. This is also based on
PnP, where it really is quite difficult (impossible for many creatures) to roll a scroll on the treasure tables. And you'd have to do some checking for class, alignment... perhaps thieves may have stolen such, but not your average commoner. As for low intelligence CREs, they probably can't even read, and thus wouldn't be able to distinguish a magical scroll from a worthless piece of scrap paper with doodling on it
.
Edited by Miloch, 15 September 2009 - 12:48 AM.