[Runuo] Creating a random loot table based on lootpack.cs

Finaltwist

Squire
Sep 7, 2019
438
123
43
Greetings!

I'm creating a random loot table for a new system i am adding, and would like to generate AOS items (armor, quivers, weapons, etc) based on a value i can change to determine number of attributes and intensity.

Currently, i'm trying to use the lootpack methods to create these items but im not going about it the right way
C#:
                                            switch ( Utility.Random( 15 ) ) //
                                            {
                                                case 0: rngitem = LootPack.LootPackItem( typeof( BaseWeapon ), 54 ); break;
                                                case 1: rngitem = LootPack.LootPackItem( typeof( BaseRanged ), 13 ); break;
                                                case 2: rngitem = LootPack.LootPackItem( typeof( BaseArmor ), 77 ); break;
i think the items need to be constructed or built - not sure how i would go about doing this. at the end of the script, if rngitem != null, its put in the player's pack.
the idea here is I don't just want to create a new basearmor/weapon etc, i would like intensity/attributes to depend on some value i can change. is this doable?
Post automatically merged:

my current attempt has morphed into (with further research)
C#:
                                        switch ( Utility.Random( 15 ) ) //
                                        {
                                                case 0: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); break
                                                case 1: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); break
                                                case 2: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); break
                                                case 3: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); break
                                                case 4: rngitem = Loot.RandomInstrument(); break;
                                                case 5: rngitem = Loot.RandomQuiver; break;
                                                case 6: rngitem = Loot.RandomWand(); break;
                                                case 7: rngitem = Loot.RandomJewelry(); break;
    
                                        }
                                            
                                        if (rngitem != null)
                                            LootPack.Mutate ( from, from.Luck, rngItem)
 
Last edited:

Finaltwist

Squire
Sep 7, 2019
438
123
43
which changed to
C#:
                                        switch ( Utility.Random( 17 ) ) //
                                        {
                                                case 0: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 1: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 2: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 3: rngitem = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 4: rngitem = Loot.RandomInstrument(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 5: rngitem = Loot.RandomQuiver; LootPack.Mutate ( from, 400, rngitem); break;
                                                case 6: rngitem = Loot.RandomWand(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 7: rngitem = Loot.RandomJewelry(); LootPack.Mutate ( from, 400, rngitem); break;
                                                case 8: rngitem = new Gold( (double)reward  );
                                        }
the 400 is a luck value which i can change to 800 or 1200 to (hopefully) change how an item is mutated. higher number hopefully means more attributes/intensities...