want to make sure at least one item drops,each if statement is one item
object oContainer = OBJECT_SELF;
int numberOfItems = 1;
if(!GetLocalBoolean(oContainer, 159)){
SetLocalBoolean(oContainer,159,TRUE);
if(Random(100) < 10){
GetCustomItemLightColor(oContainer);
}
if(Random(100) < 10){
GetCustomItemCustom(oContainer);
}
if(Random(100) < 10){
PlaceTreasureJedi(oContainer, numberOfItems);
}
if(Random(100) < 25){
GetCustomItemDisposable(oContainer);
}
if(Random(100) < 25){
PlaceTreasure(oContainer, numberOfItems, 0);
}
if(Random(100) < 25){
PlaceTreasureDroid(oContainer, numberOfItems, 0);
}
if(Random(100) < 50){
GetCustomItemTraps(oContainer);
}
if(Random(100) < 50){
GetCustomItemGrenade(oContainer);
}
}
Something like this maybe? Note the new while block has a closing }
object oContainer = OBJECT_SELF;
int numberOfItems = 1;
int nMinimum = 1;
if(!GetLocalBoolean(oContainer, 159)){
SetLocalBoolean(oContainer,159,TRUE);
while (nMinimum>0) {
if(Random(100) < 10){
GetCustomItemLightColor(oContainer);
nMinimum--;
}
if(Random(100) < 10){
GetCustomItemCustom(oContainer);
nMinimum--;
}
if(Random(100) < 10){
PlaceTreasureJedi(oContainer, numberOfItems);
nMinimum -= numberOfItems;
}
if(Random(100) < 25){
GetCustomItemDisposable(oContainer);
nMinimum--;
}
if(Random(100) < 25){
PlaceTreasure(oContainer, numberOfItems, 0);
nMinimum -= numberOfItems;
}
if(Random(100) < 25){
PlaceTreasureDroid(oContainer, numberOfItems, 0);
nMinimum -= numberOfItems;
}
if(Random(100) < 50){
GetCustomItemTraps(oContainer);
nMinimum--;
}
if(Random(100) < 50){
GetCustomItemGrenade(oContainer);
nMinimum--;
}
}
}
I assumed the functions like PlaceTreasure are guaranteed to place numberOfItems...
yea they are garenteed but the if(random ect is the conditional before the function is called,i wanta keep the loot random but make sure 1 is dropped,i tried something similar to this last night and the game seems to only want one item,donno :shrug:
ok tried that with minimum set to 5 and it had loot in every chest but most of them had 1 item :shrug:
got it working,changed my functions to have a number of items parameter,thnx for ur help