Initial upload
Initial upload
This commit is contained in:
21
_module/nss/gen_loot_ck.nss
Normal file
21
_module/nss/gen_loot_ck.nss
Normal file
@@ -0,0 +1,21 @@
|
||||
void main()
|
||||
{
|
||||
object oSelf = OBJECT_SELF;
|
||||
object oItem = GetFirstItemInInventory(oSelf);
|
||||
int iChance = 20; //Percenatage of the time each item has a chance of dropping
|
||||
do{
|
||||
int iDroppable = GetDroppableFlag(oItem);
|
||||
if (iDroppable == FALSE){
|
||||
int iCopy = GetLocalInt(oItem, "copied");
|
||||
if (iCopy == 0){
|
||||
string sResref = GetResRef(oItem);
|
||||
int id100 = d100(1);
|
||||
if (id100 <= iChance){
|
||||
object oItem2 = CreateItemOnObject(sResref, oSelf, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (iDroppable == TRUE){} //This is so it doesn't make addittional things that are already droppable
|
||||
SetLocalInt(oItem, "copied", 1);
|
||||
}while ((oItem = GetNextItemInInventory(oSelf)) != OBJECT_INVALID);
|
||||
}
|
||||
Reference in New Issue
Block a user