Author Sticky: Post Working Scripts Here
Ryneaver Posted: Wednesday, 10 July 03:48AM
1. Random Loot script - Accidently posted this as a separate topic when i wanted it to go in this topic

2. Creates Random amounts of loot from a pre created list.

3. Notes: Add to onspawn or ondeath either one works

Pretty Straight forward. add items by their Blueprint ResRef value inside the For loop. As you can see i have created some <items> of Carnage.

nItems is the number of items you want to monster to drop as you can see i wanted up to 4 to drop. if you want non dice randoms use nItems = Random (n) + 1;

Seems to work pretty well when i use it

4.
NWScript:
int nItems = d4();

string sItem = "";

void main()

{ 

    int i= 0;

    for (i =1; i <= nItems; i++)

    {

        int nRandom = Random (5)+1;

        switch (nRandom)

        {

        case 1: sItem = "bladeofcarnage"; break;

        case 2: sItem = "armorofcarnage"; break;

        case 3: sItem = "bootsofcarnage"; break;

        case 4: sItem = "gauntletsofcarnage"; break;

        case 5: sItem = "robeofcarnage"; break;

        }

        CreateItemOnObject(sItem, OBJECT_SELF, 1);

    }

}