DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: random_drops_003.htm

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);
    }
}
⌂ All Scripts ← PreviousNext → 👁 Category List

All Creatures Scripts

📄 apply_spell_effect 📄 aurak_draconian 📄 baaz_draconian 📄 boss_spawner 📄 change_light_spawn_pt_on_death 📄 clone_mob 📄 collect_loot 📄 create_unique_objectIDs 📄 creature_proc 📄 explode_ondeath 📄 explode_ondeath_002 📄 explode_ondeath_003 📄 exploding_chickens 📄 fire_death 📄 inverse_mob 📄 iron_statue 📄 lich 📄 lootable_corpse 📄 lootable_corpse_002 📄 lootable_corpse_002a 📄 lootable_corpse_oo2 📄 mob_respawn 📄 mob_respawn_002 📄 multi_creature_spawn 📄 night_time 📄 random_death_effect 📄 random_drops 📄 random_drops_002 📄 random_drops_003 📄 random_enc_onrest 📄 random_hps 📄 sivac_draconian 📄 spawn 📄 spawn_on_hearbeat 📄 summon_last_hostile 📄 summon_mob 📄 trolls 📄 trolls_002 📄 vampire_coffin 📄 werewolf