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!
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 149 Online
    • 273 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 86 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 80 Online
    • 190 Peak
  • Insane UO
    Endless Journey
    • Players
    • 76 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 42 Online
    • 85 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 21 Online
    • 48 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 20 Online
    • 30 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 19 Online
    • 172 Peak
  • Heritage
    New Legacy
    • Players
    • 16 Online
    • 41 Peak
  • Arth
    Custom (Modern)
    • Players
    • 15 Online
    • 34 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back