I've improved it so you can see the content..

This script implements a custom bag called `ReagentBelt`, specifically designed for reagents in an Ultima Online server. It only accepts items of the type `BaseReagent` and displays a list of all contained reagents along with their quantities when the player hovers over the bag.

Key Functions and Properties:

1. Constructors: There are two constructors. The default constructor creates a reagent bag with a maximum of 13 items. An additional constructor allows setting a custom maximum item limit.

2. OnDragDrop and OnDragDropInto: These methods prevent non-reagents from being added to the bag. If an unsuitable item is added, the player receives a message indicating that only reagents are allowed.

3. AddNameProperty: This method adds the reagent list to the bag’s tooltip. All reagent names and quantities are displayed, and if the bag is empty, it shows "This bag is empty."

4. OnItemAdded and OnItemRemoved: When an item is added or removed, `InvalidateProperties()` is called to refresh the tooltip and immediately display the latest contents.

5. Serialization and Deserialization: These methods save and load the object properties.

6. GetTotal and UpdateTotal: These set the bag’s weight to be ignored in calculations by setting the weight to zero.

rw3rw3r.png
 

Attachments

  • ReagentBelt.cs
    3 KB · Views: 3
This is a good idea. Id like to bless it and allow 1k each reg max with 100% weight reduction lol
Catch is u cannot remove rega that u add to it
 
My original plan is to make it craftable and weight reduction to increase based on better leather used.
This is a good idea. Id like to bless it and allow 1k each reg max with 100% weight reduction lol
Catch is u cannot remove rega that u add to it
or let them store unlimited, but for each type of reg they add to it will reduce the overweight reduction bonus by 10%
So then they would have to pick and choose which ones they want to have
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back