40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name Random Divine Book Generator
|
|
//:: FileName asg_racanebk
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Used to create a single random arcane book.
|
|
used:
|
|
|
|
ExecuteScript("asg_rdivinebk",oContianer);
|
|
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Donny Wilbanks
|
|
//:: Created On: 4/27/03
|
|
//:://////////////////////////////////////////////
|
|
|
|
void main()
|
|
{
|
|
object oPC = OBJECT_SELF;
|
|
object oArcaneBooks = GetObjectByTag("ASG_DVCHEST");
|
|
int iCount = 0;
|
|
int iRandom;
|
|
int iK;
|
|
object oBook = GetFirstItemInInventory(oArcaneBooks);
|
|
while (GetIsObjectValid(oBook))
|
|
{
|
|
iCount++;
|
|
oBook = GetNextItemInInventory(oArcaneBooks);
|
|
}
|
|
iRandom = Random(iCount);
|
|
oBook = GetFirstItemInInventory(oArcaneBooks);
|
|
for (iK=0;iK<=iRandom;iK++)
|
|
{
|
|
oBook = GetNextItemInInventory(oArcaneBooks);
|
|
}
|
|
object oNewBook = CopyObject(oBook,GetLocation(oPC),oPC);
|
|
SetIdentified(oNewBook,TRUE);
|
|
}
|