Will take a core item.

From just doing a quick search this seems like a promising place to start.

Looking in Items.cs in the Server file

Code:
private static TimeSpan m_DDT = TimeSpan.FromHours(1.0);

        public static TimeSpan DefaultDecayTime { get { return m_DDT; } set { m_DDT = value; } }

        [CommandProperty(AccessLevel.Decorator)]
        public virtual TimeSpan DecayTime { get { return m_DDT; } }

        [CommandProperty(AccessLevel.Decorator)]
        public virtual bool Decays
        {
            get
            {
                // TODO: Make item decay an option on the spawner
                return (Movable && Visible /* && Spawner == null*/);
            }
        }
 
I think setting the decay this way should solve it
Code:
[CommandProperty(AccessLevel.Decorator)]
public virtual bool Decays
{
	get
	{
		return false;
	}
}
 
I think setting the decay this way should solve it
Code:
[CommandProperty(AccessLevel.Decorator)]
public virtual bool Decays
{
	get
	{
		return false;
	}
}
thnx so i just put that instead of the calc that is in the file...ill try it tonight, my server is a lan shard i only play with my kids so i dont worry about item counts.....
 
Some notes about this idea.

1. If you change Item.cs, it will affect every item in the world. (see below for exceptions)
2. If you change Item.cs, you will need to recompile your server before continuing. (run the .BAT file)
3. If you change Item.cs, you might NOT actually affect EVERY item in the world, if that item overrides the same method.

Meaning, in Item.cs, it is "public virtual bool Decays { get { return Visible && Movable; } }" You can change that to "... { get { return false; } }"

However, let's say there is an item someone created, and they wanted to make sure it would decay even if it was invisible.

It might say this:

Code:
public override bool Decays { get { return Movable; } }

This would override your setting in item.cs. You could do a Search through the code for the words "public override bool Decays" and see if any scripts override it, and change each one manually.
 
is there any way to prevent item decay in houses? i mean not locked/secured items placed on house floor.
answer to my previous question, just in case anybody needs this in future, edit houseregion.cs

public override bool OnDecay(Item item)
{
if ((House.IsLockedDown(item) || House.IsSecure(item)) || House.IsInside(item))
// if ((House.IsLockedDown(item) || House.IsSecure(item)) && House.IsInside(item))
return false;
else
return base.OnDecay(item);
}
 
Last edited:
Back