Midget

Initiate
Hey yall,

I was hoping for a little advice.
I'm trying to create some poisoned grapes for a quest,
I'm getting no errors on the script but it doesnt seem to be applying the poison.

PoisonedGrapes:
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Engines.Craft;
 
namespace Server.Items
{
    public class GrapePoison : Grapes
    {
        private Poison m_Poison;
        
        [Constructable]
        public GrapePoison() : base()
        {
            Name = "Grapes";
            Stackable = false;
            Weight = 1.0;
            FillFactor = 0;
            m_Poison = Poison.Deadly;
        }
        public GrapePoison(Serial serial)
            : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            
            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            
            int version = reader.ReadInt();
        }
    }
}
 
You do not need to add "private Poison m_Poison;" as GrapePoison already inherits Poison from Grapes.cs, which inherits it from Food.cs. Even if you were to add it, you did not define it or serialize/deserialize it.

You simply need to set Poison as follows:


Code:
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Engines.Craft;

namespace Server.Items
{
    public class GrapePoison : Grapes
    {
      
        [Constructable]
        public GrapePoison() : base()
        {
            Name = "grapes";
            Stackable = false;
            Weight = 1.0;
            FillFactor = 0;
            Poison = Poison.Deadly;
        }
        public GrapePoison(Serial serial)
            : base(serial)
        {
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
           
            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
           
            int version = reader.ReadInt();
        }
    }
}
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back