Fargariel

Initiate
I wanted to add PlayerConstructed props to Bolt.cs

Code:
        [CommandProperty(AccessLevel.GameMaster)]
        public bool PlayerConstructed
        {
            get
            {
                return this.m_PlayerConstructed;
            }
            set
            {
                this.m_PlayerConstructed = value;
                InvalidateProperties();
            }
        }

i have added StackWith too

Code:
        public override bool StackWith(Mobile from, Item dropped, bool playSound)
        {
            if (dropped is Bolt && ((Bolt)dropped).PlayerConstructed == this.PlayerConstructed)
                return base.StackWith(from, dropped, playSound);
            else
                return false;
        }

crafted items have PlayerConstructed = True, bought False - in craftitem.cs

Code:
                    if (item is Bolt)
                    {
                        ((Bolt)item).PlayerConstructed = true;
                    }

Now when i move few items from PlayerConstructed pile, i have two piles with different values (new one is True, old one is False).

Any idea?
 
check out
C#:
public virtual void OnAfterDuped
and its overrides, any props you want copied when spliting stacks needs to be in there. also need to change (override)
C#:
public virtual bool WillStack(Mobile from, Item dropped)
to stop stacking two stacks with diff props.


ie you can look at GorgonLens.cs to see it in practice for a stackable item with a new prop
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back