I am trying to put resists on a spellbook, and can't figure out how. (I've tried looking at BaseJewel.cs and SpellBook.cs and mirroring all resist code lines but no luck)

Here are the errors I am getting associated with each line that is trying to add resists:

1589840113095.png

C#:
using System;

using Server.Engines.Craft;

namespace Server.Items

{
    public class CwepBookGladiator : Spellbook
    {
        public override bool IsArtifact { get { return true; } }

        public override int BasePhysicalResistance{ get{ return 5; } }     // <-- CAN'T GET RESISTS TO WORK

        [Constructable]
        public CwepBookGladiator()
            : base()
        {
            Hue = 2639;
            Name = "Gladiator's Handbook";
            Attributes.BonusStr = 10; 
            WeaponAttributes.ResistFireBonus = 10;     // <-- CAN'T GET RESISTS TO WORK
            Resistances.Fire = 10;     // <-- CAN'T GET RESISTS TO WORK
        }

        public CwepBookGladiator(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();
        }

    }

}
 
line 12 remove Overide, the prompt is telling you there's no "public virtual int BasePhysicalResistance" in the inherited script: Spellbook

public int BasePhysicalResistance{ get{ return 5; } } // should compile but not actually work

what might work better as a basic workaround is to use an armor script and change the itemid to that of a spellbook and then use the armor resistance properties
if you do that then you'll need to keep the above as override
 
Hmm I'll keep after it and utilize the workaround in the meantime. It would be nice to add resists in the spellbook code to prevent some glitches with the workaround but either way I appreciate the help!
 
Back