RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Adding to Lootpack.cs

Darky12

Sorceror
Adding to Lootpack.cs

Trying to add some more loot to the loot definitions.

Loot.cs

Code:
        public static Type[] MiscLoot1{ get{ return m_MiscLoot1; } }

        private static Type[] m_MiscLoot1 = new Type[]
        {

            typeof ( lootrewarddeed )

        };

LootPack.cs

Code:
		public static readonly LootPack AosPoor = new LootPack( new LootPackEntry[]
			{
				new LootPackEntry(  true, Gold,			100.00, "1d10+10" ),
				new LootPackEntry( false, AosMagicItemsPoor,	  0.02, 1, 5, 0, 90 ),
				new LootPackEntry( false, Instruments,	  0.02, 1 ),
                [COLOR="Red"]new LootPackEntry( false, MiscLoot1, .50, 1 )[/COLOR]
			} );


Errror in console.

Errors:
+ Misc/LootPack.cs:
CS0103: Line 320: The name 'MiscLoot1' does not exist in the current context

What would be the Right Context?
 

Sythen

Sorceror
Just Curious...

I'm interested in adding stuff to the lootpack.cs, how did you solve your issue so I can troubleshoot the problems as they hit me in the future? :confused:

Thanks for the help. :D
 

Darky12

Sorceror
Well, i added my loot template

Code:
        public static readonly LootPackItem[] MiscLoot1 = new LootPackItem[]
        {
            new LootPackItem( typeof( lootrewarddeed ), 1 )

        };

Right under

Code:
		public static readonly LootPackItem[] Instruments = new LootPackItem[]
			{
				new LootPackItem( typeof( BaseInstrument ), 1 )
			};

and then i Added my new Loot pack i just made "MiscLoot1" to the correct loot definitions.

heres what my looks like

Code:
		public static readonly LootPack AosPoor = new LootPack( new LootPackEntry[]
			{
				new LootPackEntry(  true, Gold,			100.00, "1d10+10" ),
				new LootPackEntry( false, AosMagicItemsPoor,	  0.02, 1, 5, 0, 90 ),
				new LootPackEntry( false, Instruments,	  0.02, 1 ),
                                new LootPackEntry( false, MiscLoot1, 0.04, 1 )


I added new LootPackEntry( false, MiscLoot1, 0.04, 1 ) to the Loot definition. So depending on what Expansion you have enable you would add it to those sets of definitions.

I'll also try and explain what the false, 0.04, 1 means.

new LootPackEntry( false, MiscLoot1, 0.04, 1 )

"false" This piece tells the mobile if you want the item(s) to generate on death or when the mobile spawns. so false would mean generate item on Death and true would mean Generate Item on spawn.

"0.04" This is a Percentage on how often the Item will drop. so .04 is .04% or .4% (not really sure).

"1" is How many of that item you want to drop.

Hope this helps you out bro. I may be incorrect on some of this information so maybe someone can correct me if i am.
 
Top