ServUO Version
Publish 57
Ultima Expansion
Time Of Legends
If I add a Bow (or any weapon or armor) using [add Bow, its a regular bow (or whatever I added). Looking in TreasureChestMod.cs, I see the filling of the chest using the Loot.RandomArmorOrShieldOrWeapon() method. If however I create a class and in that class create an item as shown here

C#:
Item newItem = Loot.RandomArmorOrShieldOrWeapon();

and drop that item on the ground, its always just a plain item. Just what am I missing here. I'm generating the item the same way the code does to fill a treasure chest but getting different results. I can only imagine I'm missing some super simple flag someplace but I just cant figure it out.

Any suggestions?
 
Solution
OP
Tempus
Jeezie, it was right there in front of me! Ya know, I looked at that line so many times and it never dawned on me that AddLoot would do anything more than add loot. Guess I should have wondered where the DropItem was. Thank you so much.
how are you moving this newItem to the world? or to the Item you are creating, you can't just use this as a flag, that is not its intend, it is randomly generating and returning a item, which you then have to move to world/container etc etc
 
You were almost there ;)
the else is imporant in thise case, since it calls AddLoot on the new generated Item.
Inside the AddLoot method it will go into the RunicReforging part to add random stats, based on the min and max runic reforging value from the
TreasureMapChest method.

So if you want your Item to have random stats? Throw it into the RunicReforging.GenereateRandomItem method

1643236243412.png
 
Jeezie, it was right there in front of me! Ya know, I looked at that line so many times and it never dawned on me that AddLoot would do anything more than add loot. Guess I should have wondered where the DropItem was. Thank you so much.
 
Solution
Guys? is it possible to somehow att lootpacks to treasurechestmod?

I'm always getting " CS0426: Line 26: The type name 'newbie' does not exist in the type 'LootPack'"
 
Back