Question on wiki

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
Not working

C#:
void Hooks_OnItemAdded(InventoryModEvent e)
        {
            if (e.Inventory.name == "BoxLoot(Clone)")
            {
                Server.GetServer().Broadcast("add");
                Util.GetUtil().SetInstanceField(typeof(IInventoryItem), e.Item.RInventoryItem.condition, "condition", 20);
            }
        }
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Util.GetUtil().SetInstanceField(typeof(e.Item.RInventoryItem), e.Item.RInventoryItem.condition, "condition", 20);
 
Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Util.GetUtil().SetInstanceField(typeof(IInventoryItem), e.Item.RInventoryItem.condition, "condition", 20);

Guess it can be only that then.

It throws error if it fails.
 

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
Util.GetUtil().SetInstanceField(typeof(IInventoryItem), e.Item.RInventoryItem.condition, "condition", 20);

Guess it can be only that then.

It throws error if it fails.
If you specify

Util.GetUtil().SetInstanceField(typeof(IInventoryItem), e.Item.RInventoryItem.condition, "condition", 20);

It does not change the condition of the subject