fix: Optimizes items to use default weights. (Part 4) (#2243)
This commit is contained in:
parent
40ba85d7b8
commit
fa0b67ec29
109 changed files with 250 additions and 391 deletions
|
|
@ -20,13 +20,14 @@ public partial class Log : Item, ICommodity, IAxe
|
|||
public Log(CraftResource resource, int amount) : base(0x1BDD)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 2.0;
|
||||
Amount = amount;
|
||||
|
||||
_resource = resource;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
|
||||
[SerializableProperty(0)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ public partial class BlankScroll : Item, ICommodity
|
|||
public BlankScroll(int amount = 1) : base(0xEF3)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => Core.ML;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ public partial class Bottle : Item, ICommodity
|
|||
public Bottle(int amount = 1) : base(0xF0E)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => Core.ML;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ public partial class PotionKeg : Item
|
|||
private PotionEffect _type;
|
||||
|
||||
[Constructible]
|
||||
public PotionKeg() : base(0x1940) => UpdateWeight();
|
||||
public PotionKeg() : base(0x1940)
|
||||
{
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 20 + Math.Clamp(_held, 0, 100) * 0.8;
|
||||
|
||||
[SerializableProperty(1)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
|
|
@ -28,7 +32,6 @@ public partial class PotionKeg : Item
|
|||
if (_held != value)
|
||||
{
|
||||
_held = value;
|
||||
UpdateWeight();
|
||||
InvalidateProperties();
|
||||
this.MarkDirty();
|
||||
}
|
||||
|
|
@ -48,13 +51,6 @@ public partial class PotionKeg : Item
|
|||
}
|
||||
}
|
||||
|
||||
public virtual void UpdateWeight()
|
||||
{
|
||||
var held = Math.Max(0, Math.Min(_held, 100));
|
||||
|
||||
Weight = 20 + held * 80 / 100;
|
||||
}
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
_type = (PotionEffect)reader.ReadInt();
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@ public partial class RecallRune : Item
|
|||
[Constructible]
|
||||
public RecallRune() : base(0x1F14)
|
||||
{
|
||||
Weight = 1.0;
|
||||
CalculateHue();
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
[SerializableProperty(0)]
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public BaseHouse House
|
||||
|
|
|
|||
|
|
@ -50,9 +50,10 @@ public abstract partial class BasePotion : Item, ICraftable, ICommodity
|
|||
_potionEffect = effect;
|
||||
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override int LabelNumber => 1041314 + (int)_potionEffect;
|
||||
|
||||
public virtual bool RequireFreeHand => true;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ public partial class Runebook : Item, ISecurable, ICraftable
|
|||
[Constructible]
|
||||
public Runebook(int maxCharges) : base(Core.AOS ? 0x22C5 : 0xEFA)
|
||||
{
|
||||
Weight = Core.SE ? 1.0 : 3.0;
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x461;
|
||||
|
||||
|
|
@ -72,6 +71,8 @@ public partial class Runebook : Item, ISecurable, ICraftable
|
|||
_level = SecureLevel.CoOwners;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => Core.SE ? 1.0 : 3.0;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextUse { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,13 @@ public partial class SpellScroll : Item, ICommodity
|
|||
public SpellScroll(int spellID, int itemID, int amount = 1) : base(itemID)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
|
||||
_spellID = spellID;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => Core.ML;
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ public partial class Spellbook : Item, ICraftable, ISlayer, IAosItem
|
|||
_attributes = new AosAttributes(this);
|
||||
_skillBonuses = new AosSkillBonuses(this);
|
||||
|
||||
Weight = 3.0;
|
||||
Layer = Layer.OneHanded;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
|
|
@ -124,6 +123,8 @@ public partial class Spellbook : Item, ICraftable, ISlayer, IAosItem
|
|||
Content = content;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 3.0;
|
||||
|
||||
public override bool DisplayWeight => false;
|
||||
|
||||
public virtual SpellbookType SpellbookType => SpellbookType.Regular;
|
||||
|
|
|
|||
|
|
@ -10,11 +10,9 @@ namespace Server.Items;
|
|||
public partial class FireHorn : Item
|
||||
{
|
||||
[Constructible]
|
||||
public FireHorn() : base(0xFC7)
|
||||
{
|
||||
Hue = 0x466;
|
||||
Weight = 1.0;
|
||||
}
|
||||
public FireHorn() : base(0xFC7) => Hue = 0x466;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override int LabelNumber => 1060456; // fire horn
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,10 @@ public partial class EggBomb : Item
|
|||
{
|
||||
// Item ID should be 0x2809 - Temporary solution for clients 7.0.0.0 and up
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override int LabelNumber => 1030249;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -26,11 +26,9 @@ public partial class Fukiya : Item, INinjaWeapon
|
|||
private int _poisonCharges;
|
||||
|
||||
[Constructible]
|
||||
public Fukiya() : base(0x27AA)
|
||||
{
|
||||
Weight = 4.0;
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
public Fukiya() : base(0x27AA) => Layer = Layer.OneHanded;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public virtual int WrongAmmoMessage => 1063329; // You can only load fukiya darts
|
||||
public virtual int NoFreeHandMessage => 1063327; // You must have a free hand to use a fukiya.
|
||||
|
|
|
|||
|
|
@ -23,15 +23,9 @@ public partial class FukiyaDarts : Item, ICraftable, INinjaAmmo
|
|||
private int _poisonCharges;
|
||||
|
||||
[Constructible]
|
||||
public FukiyaDarts(int amount = 1) : base(0x2806)
|
||||
{
|
||||
Weight = 1.0;
|
||||
_usesRemaining = amount;
|
||||
}
|
||||
public FukiyaDarts(int amount = 1) : base(0x2806) => _usesRemaining = amount;
|
||||
|
||||
public FukiyaDarts(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public int OnCraft(
|
||||
int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
|
||||
|
|
|
|||
|
|
@ -26,11 +26,9 @@ public partial class LeatherNinjaBelt : BaseWaist, INinjaWeapon
|
|||
private int _poisonCharges;
|
||||
|
||||
[Constructible]
|
||||
public LeatherNinjaBelt() : base(0x2790)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Layer = Layer.Waist;
|
||||
}
|
||||
public LeatherNinjaBelt() : base(0x2790) => Layer = Layer.Waist;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override CraftResource DefaultResource => CraftResource.RegularLeather;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,9 @@ public partial class Shuriken : Item, ICraftable, INinjaAmmo
|
|||
private int _poisonCharges;
|
||||
|
||||
[Constructible]
|
||||
public Shuriken(int amount = 1) : base(0x27AC)
|
||||
{
|
||||
Weight = 1.0;
|
||||
_usesRemaining = amount;
|
||||
}
|
||||
public Shuriken(int amount = 1) : base(0x27AC) => _usesRemaining = amount;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public int OnCraft(
|
||||
int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
|
||||
|
|
|
|||
|
|
@ -7,11 +7,9 @@ namespace Server.Items;
|
|||
public partial class SmokeBomb : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SmokeBomb() : base(0x2808)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
public SmokeBomb() : base(0x2808) => Stackable = Core.ML;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,11 +7,9 @@ namespace Server.Items;
|
|||
public partial class Sand : Item, ICommodity
|
||||
{
|
||||
[Constructible]
|
||||
public Sand(int amount = 1) : base(0x11EA)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
public Sand(int amount = 1) : base(0x11EA) => Stackable = Core.ML;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public override int LabelNumber => 1044626; // sand
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
|
|
|
|||
|
|
@ -25,11 +25,9 @@ namespace Server.Items
|
|||
private bool _redyable;
|
||||
|
||||
[Constructible]
|
||||
public DyeTub() : base(0xFAB)
|
||||
{
|
||||
Weight = 10.0;
|
||||
_redyable = true;
|
||||
}
|
||||
public DyeTub() : base(0xFAB) => _redyable = true;
|
||||
|
||||
public override double DefaultWeight => 10.0;
|
||||
|
||||
public virtual CustomHuePicker CustomHuePicker => null;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class Axle : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class AxleGears : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class ClockFrame : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class ClockParts : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class Gears : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class Hinge : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class SextantParts : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public partial class Springs : Item
|
|||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,18 +8,12 @@ namespace Server.Items;
|
|||
public partial class Blowpipe : BaseTool
|
||||
{
|
||||
[Constructible]
|
||||
public Blowpipe() : base(0xE8A)
|
||||
{
|
||||
Weight = 4.0;
|
||||
Hue = 0x3B9;
|
||||
}
|
||||
public Blowpipe() : base(0xE8A) => Hue = 0x3B9;
|
||||
|
||||
[Constructible]
|
||||
public Blowpipe(int uses) : base(uses, 0xE8A)
|
||||
{
|
||||
Weight = 4.0;
|
||||
Hue = 0x3B9;
|
||||
}
|
||||
public Blowpipe(int uses) : base(uses, 0xE8A) => Hue = 0x3B9;
|
||||
|
||||
public override double DefaultWeight => 4.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefGlassblowing.CraftSystem;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,18 +7,12 @@ namespace Server.Items;
|
|||
public partial class RunicDovetailSaw : BaseRunicTool
|
||||
{
|
||||
[Constructible]
|
||||
public RunicDovetailSaw(CraftResource resource) : base(resource, 0x1028)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicDovetailSaw(CraftResource resource) : base(resource, 0x1028) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
[Constructible]
|
||||
public RunicDovetailSaw(CraftResource resource, int uses) : base(resource, uses, 0x1028)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicDovetailSaw(CraftResource resource, int uses) : base(resource, uses, 0x1028) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefCarpentry.CraftSystem;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,18 +7,12 @@ namespace Server.Items;
|
|||
public partial class RunicFletcherTool : BaseRunicTool
|
||||
{
|
||||
[Constructible]
|
||||
public RunicFletcherTool(CraftResource resource) : base(resource, 0x1022)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicFletcherTool(CraftResource resource) : base(resource, 0x1022) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
[Constructible]
|
||||
public RunicFletcherTool(CraftResource resource, int uses) : base(resource, uses, 0x1022)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicFletcherTool(CraftResource resource, int uses) : base(resource, uses, 0x1022) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefBowFletching.CraftSystem;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ public partial class RunicHammer : BaseRunicTool
|
|||
[Constructible]
|
||||
public RunicHammer(CraftResource resource) : base(resource, 0x13E3)
|
||||
{
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
|
@ -18,11 +17,12 @@ public partial class RunicHammer : BaseRunicTool
|
|||
[Constructible]
|
||||
public RunicHammer(CraftResource resource, int uses) : base(resource, uses, 0x13E3)
|
||||
{
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 8.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefBlacksmithy.CraftSystem;
|
||||
|
||||
public override int LabelNumber
|
||||
|
|
|
|||
|
|
@ -7,18 +7,12 @@ namespace Server.Items;
|
|||
public partial class RunicSewingKit : BaseRunicTool
|
||||
{
|
||||
[Constructible]
|
||||
public RunicSewingKit(CraftResource resource) : base(resource, 0xF9D)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicSewingKit(CraftResource resource) : base(resource, 0xF9D) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
[Constructible]
|
||||
public RunicSewingKit(CraftResource resource, int uses) : base(resource, uses, 0xF9D)
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
public RunicSewingKit(CraftResource resource, int uses) : base(resource, uses, 0xF9D) => Hue = CraftResources.GetHue(resource);
|
||||
|
||||
public override double DefaultWeight => 2.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefTailoring.CraftSystem;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,18 +8,12 @@ namespace Server.Items;
|
|||
public partial class SmithHammer : BaseTool
|
||||
{
|
||||
[Constructible]
|
||||
public SmithHammer() : base(0x13E3)
|
||||
{
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
public SmithHammer() : base(0x13E3) => Layer = Layer.OneHanded;
|
||||
|
||||
[Constructible]
|
||||
public SmithHammer(int uses) : base(uses, 0x13E3)
|
||||
{
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
public SmithHammer(int uses) : base(uses, 0x13E3) => Layer = Layer.OneHanded;
|
||||
|
||||
public override double DefaultWeight => 8.0;
|
||||
|
||||
public override CraftSystem CraftSystem => DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue