I can make it grab a total stack size of a certain item, but that'll create too many instances of same item and/or too much of the said item in the chest. (For example, instead of random number, I get 999 item gold coins (worth 100 each) and that's waaaaay too much loot
Random Loot, stacks
Débuté par
JerrodAmolyan
, nov. 16 2013 10:25
#1
Posté 16 novembre 2013 - 10:25
Just a quickie, how will I get my random loot script to spawn a random number of stacked things (like gold coins) and determine something like... spawn 10 - 100 normal nwn gold pieces ?
I can make it grab a total stack size of a certain item, but that'll create too many instances of same item and/or too much of the said item in the chest. (For example, instead of random number, I get 999 item gold coins (worth 100 each) and that's waaaaay too much loot
I can make it grab a total stack size of a certain item, but that'll create too many instances of same item and/or too much of the said item in the chest. (For example, instead of random number, I get 999 item gold coins (worth 100 each) and that's waaaaay too much loot
#2
Posté 16 novembre 2013 - 06:32
So you're saying you want to give a creature a random amount of gold between, say, 10-100 gold pieces?
#3
Posté 16 novembre 2013 - 08:41
Creature or a container (chests mainly, but creatures would be great too) I'm using a system that picks stuff based on a dice roll, from source chests that I stuff in an unaccessible area.
But the basic's the same. I can create instances that have a certain amount of things in a stack, but I'd rather have a script get stacked items like gold, to a certain amount (anything between 1 and 100 for example).
But the basic's the same. I can create instances that have a certain amount of things in a stack, but I'd rather have a script get stacked items like gold, to a certain amount (anything between 1 and 100 for example).
Modifié par JerrodAmolyan, 16 novembre 2013 - 08:42 .
#4
Posté 16 novembre 2013 - 10:03
If you put this script in an OnOpened event for a container, it spawns 50-100 gold each time you open it. If you want to fire the script from something besides the object, obviously you'd need to replace OBJECT_SELF with GetObjectByTag or something. Is this roughly what you wanted?
void main()
{
int nRand = Random(51) + 50;
CreateItemOnObject("nw_it_gold001", OBJECT_SELF, nRand);
}





Retour en haut






