Nirran Posted August 8, 2008 Share Posted August 8, 2008 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); } } Link to comment Share on other sites More sharing options...
tk102 Posted August 9, 2008 Share Posted August 9, 2008 Something like this maybe? Note the new while block has a closing } object oContainer = OBJECT_SELF; int numberOfItems = 1; [color=palegreen]int nMinimum = 1;[/color] if(!GetLocalBoolean(oContainer, 159)){ SetLocalBoolean(oContainer,159,TRUE); [color=palegreen]while (nMinimum>0) {[/color] if(Random(100) < 10){ GetCustomItemLightColor(oContainer); [color=palegreen]nMinimum--;[/color] } if(Random(100) < 10){ GetCustomItemCustom(oContainer); [color=palegreen]nMinimum--;[/color] } if(Random(100) < 10){ PlaceTreasureJedi(oContainer, numberOfItems); [color=palegreen]nMinimum -= numberOfItems;[/color] } if(Random(100) < 25){ GetCustomItemDisposable(oContainer); [color=palegreen]nMinimum--;[/color] } if(Random(100) < 25){ PlaceTreasure(oContainer, numberOfItems, 0); [color=palegreen]nMinimum -= numberOfItems;[/color] } if(Random(100) < 25){ PlaceTreasureDroid(oContainer, numberOfItems, 0); [color=palegreen]nMinimum -= numberOfItems;[/color] } if(Random(100) < 50){ GetCustomItemTraps(oContainer); [color=palegreen]nMinimum--;[/color] } if(Random(100) < 50){ GetCustomItemGrenade(oContainer); [color=palegreen]nMinimum--;[/color] } [color=palegreen]}[/color] } I assumed the functions like PlaceTreasure are guaranteed to place numberOfItems... Link to comment Share on other sites More sharing options...
Nirran Posted August 9, 2008 Author Share Posted August 9, 2008 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: Link to comment Share on other sites More sharing options...
Nirran Posted August 9, 2008 Author Share Posted August 9, 2008 ok tried that with minimum set to 5 and it had loot in every chest but most of them had 1 item :shrug: Link to comment Share on other sites More sharing options...
Nirran Posted August 9, 2008 Author Share Posted August 9, 2008 got it working,changed my functions to have a number of items parameter,thnx for ur help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.