I dug into the scripts for NWN OC, dug out the script NW_O2_CONINCLUDE and dug out the following bit, which is the main point of interest:
// * nModifier is to 'raise' the level of the oAdventurer
void CreateArcaneScroll(object oTarget, object oAdventurer, int nModifier = 0)
{
int nMaxSpells = 21;
int nHD = GetHitDice(oAdventurer) + nModifier;
int nScroll = 1;
int nLevel = 1;
if (GetRange(1, nHD)) // l 1-2
{
nLevel = d2();
nScroll = Random(nMaxSpells) + 1;
}
else if (GetRange(2, nHD)) // l 1-4
{
nLevel = d4();
nScroll = Random(nMaxSpells) + 1;
}
else if (GetRange(3, nHD)) // l 2-6
{
nLevel = d6();
if (nLevel < 2) nLevel = 2;
nScroll = Random(nMaxSpells) + 1;
}
else if (GetRange(4, nHD)) // l 3-8
{
nLevel = d8();
if (nLevel < 3) nLevel = 3;
nScroll = Random(nMaxSpells) + 1;
}
else if (GetRange(5, nHD)) // l 4-9
{
nLevel = d8() + 1;
if (nLevel < 4) nLevel = 4;
nScroll = Random(nMaxSpells) + 1;
}
else if (GetRange(6, nHD)) // 5 -9
{
nLevel = d8() + 1;
if (nLevel < 5) nLevel = 5;
nScroll = Random(nMaxSpells) + 1;
}
// * Trims the level of the scroll to match the max # of scrolls in each level range
nScroll = TrimLevel(nScroll, nLevel);
string sRes = "nw_it_sparscr216";
if (nScroll < 10)
{
sRes = "NW_IT_SPARSCR" + IntToString(nLevel) + "0" + IntToString(nScroll);
}
else
{
sRes = "NW_IT_SPARSCR" + IntToString(nLevel) + IntToString(nScroll);
}
dbCreateItemOnObject(sRes, oTarget, 1);
}
Wow, I thought, this looks like it'd be a zinch to just make a small alteration to to allow it to also grant PRC scrolls and the like without too much work.
But then I looked at the blueprints for the PRC scrolls. They are a mess. There is no consistant naming scheme in them and there's roughly like a thousand of them.
The place where it breaks down hardest is how they took care in giving all blueprints in the OC an integer representing spell level before assigning a two-digit number. The PRC assigns their spells a 4-digit number and to top it off do not provide consistant naming scheme.
"Acid Splash" is prc_scr_355. "Animalistic Power" is nw_it_sparscr232(kinda odd this doesn't show up). "Arrow of Bone" is prc_scr_1331.
Maybe there is system to the madness, but I could use some help seeing some way to twist this for ease of use.