Aller au contenu

Photo

Random Loot, stacks


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
JerrodAmolyan

JerrodAmolyan
  • Members
  • 89 messages
 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 :P

#2
MagicalMaster

MagicalMaster
  • Members
  • 2 002 messages
So you're saying you want to give a creature a random amount of gold between, say, 10-100 gold pieces?

#3
JerrodAmolyan

JerrodAmolyan
  • Members
  • 89 messages
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).

Modifié par JerrodAmolyan, 16 novembre 2013 - 08:42 .


#4
MagicalMaster

MagicalMaster
  • Members
  • 2 002 messages
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);
}