Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Arrow : Item, ICommodity
{
[Constructible]
public Arrow() : this(1)
{
}
[Constructible]
public Arrow(int amount) : base(0xF3F)
public Arrow(int amount = 1) : base(0xF3F)
{
Stackable = true;
Amount = amount;
@ -37,4 +32,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Bolt : Item, ICommodity
{
[Constructible]
public Bolt() : this(1)
{
}
[Constructible]
public Bolt(int amount) : base(0x1BFB)
public Bolt(int amount = 1) : base(0x1BFB)
{
Stackable = true;
Amount = amount;
@ -37,4 +32,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Feather : Item, ICommodity
{
[Constructible]
public Feather() : this(1)
{
}
[Constructible]
public Feather(int amount) : base(0x1BD1)
public Feather(int amount = 1) : base(0x1BD1)
{
Stackable = true;
Amount = amount;
@ -36,4 +31,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Shaft : Item, ICommodity
{
[Constructible]
public Shaft() : this(1)
{
}
[Constructible]
public Shaft(int amount) : base(0x1BD4)
public Shaft(int amount = 1) : base(0x1BD4)
{
Stackable = true;
Amount = amount;
@ -37,4 +32,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -4,11 +4,7 @@ namespace Server.Items
{
private CraftResource m_Resource;
public BaseIngot(CraftResource resource) : this(resource, 1)
{
}
public BaseIngot(CraftResource resource, int amount) : base(0x1BF2)
public BaseIngot(CraftResource resource, int amount = 1) : base(0x1BF2)
{
Stackable = true;
Amount = amount;
@ -142,12 +138,7 @@ namespace Server.Items
public class IronIngot : BaseIngot
{
[Constructible]
public IronIngot() : this(1)
{
}
[Constructible]
public IronIngot(int amount) : base(CraftResource.Iron, amount)
public IronIngot(int amount = 1) : base(CraftResource.Iron, amount)
{
}
@ -174,12 +165,7 @@ namespace Server.Items
public class DullCopperIngot : BaseIngot
{
[Constructible]
public DullCopperIngot() : this(1)
{
}
[Constructible]
public DullCopperIngot(int amount) : base(CraftResource.DullCopper, amount)
public DullCopperIngot(int amount = 1) : base(CraftResource.DullCopper, amount)
{
}
@ -206,12 +192,7 @@ namespace Server.Items
public class ShadowIronIngot : BaseIngot
{
[Constructible]
public ShadowIronIngot() : this(1)
{
}
[Constructible]
public ShadowIronIngot(int amount) : base(CraftResource.ShadowIron, amount)
public ShadowIronIngot(int amount = 1) : base(CraftResource.ShadowIron, amount)
{
}
@ -238,12 +219,7 @@ namespace Server.Items
public class CopperIngot : BaseIngot
{
[Constructible]
public CopperIngot() : this(1)
{
}
[Constructible]
public CopperIngot(int amount) : base(CraftResource.Copper, amount)
public CopperIngot(int amount = 1) : base(CraftResource.Copper, amount)
{
}
@ -270,12 +246,7 @@ namespace Server.Items
public class BronzeIngot : BaseIngot
{
[Constructible]
public BronzeIngot() : this(1)
{
}
[Constructible]
public BronzeIngot(int amount) : base(CraftResource.Bronze, amount)
public BronzeIngot(int amount = 1) : base(CraftResource.Bronze, amount)
{
}
@ -302,12 +273,7 @@ namespace Server.Items
public class GoldIngot : BaseIngot
{
[Constructible]
public GoldIngot() : this(1)
{
}
[Constructible]
public GoldIngot(int amount) : base(CraftResource.Gold, amount)
public GoldIngot(int amount = 1) : base(CraftResource.Gold, amount)
{
}
@ -334,12 +300,7 @@ namespace Server.Items
public class AgapiteIngot : BaseIngot
{
[Constructible]
public AgapiteIngot() : this(1)
{
}
[Constructible]
public AgapiteIngot(int amount) : base(CraftResource.Agapite, amount)
public AgapiteIngot(int amount = 1) : base(CraftResource.Agapite, amount)
{
}
@ -366,12 +327,7 @@ namespace Server.Items
public class VeriteIngot : BaseIngot
{
[Constructible]
public VeriteIngot() : this(1)
{
}
[Constructible]
public VeriteIngot(int amount) : base(CraftResource.Verite, amount)
public VeriteIngot(int amount = 1) : base(CraftResource.Verite, amount)
{
}
@ -398,12 +354,7 @@ namespace Server.Items
public class ValoriteIngot : BaseIngot
{
[Constructible]
public ValoriteIngot() : this(1)
{
}
[Constructible]
public ValoriteIngot(int amount) : base(CraftResource.Valorite, amount)
public ValoriteIngot(int amount = 1) : base(CraftResource.Valorite, amount)
{
}
@ -425,4 +376,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -8,11 +8,7 @@ namespace Server.Items
{
private CraftResource m_Resource;
public BaseOre(CraftResource resource) : this(resource, 1)
{
}
public BaseOre(CraftResource resource, int amount) : base(RandomSize())
public BaseOre(CraftResource resource, int amount = 1) : base(RandomSize())
{
Stackable = true;
Amount = amount;
@ -423,16 +419,11 @@ namespace Server.Items
public class IronOre : BaseOre
{
[Constructible]
public IronOre() : this(1)
public IronOre(int amount = 1) : base(CraftResource.Iron, amount)
{
}
[Constructible]
public IronOre(int amount) : base(CraftResource.Iron, amount)
{
}
public IronOre(bool fixedSize) : this(1)
public IronOre(bool fixedSize) : this()
{
if (fixedSize)
ItemID = 0x19B8;
@ -465,12 +456,7 @@ namespace Server.Items
public class DullCopperOre : BaseOre
{
[Constructible]
public DullCopperOre() : this(1)
{
}
[Constructible]
public DullCopperOre(int amount) : base(CraftResource.DullCopper, amount)
public DullCopperOre(int amount = 1) : base(CraftResource.DullCopper, amount)
{
}
@ -501,12 +487,7 @@ namespace Server.Items
public class ShadowIronOre : BaseOre
{
[Constructible]
public ShadowIronOre() : this(1)
{
}
[Constructible]
public ShadowIronOre(int amount) : base(CraftResource.ShadowIron, amount)
public ShadowIronOre(int amount = 1) : base(CraftResource.ShadowIron, amount)
{
}
@ -537,12 +518,7 @@ namespace Server.Items
public class CopperOre : BaseOre
{
[Constructible]
public CopperOre() : this(1)
{
}
[Constructible]
public CopperOre(int amount) : base(CraftResource.Copper, amount)
public CopperOre(int amount = 1) : base(CraftResource.Copper, amount)
{
}
@ -573,12 +549,7 @@ namespace Server.Items
public class BronzeOre : BaseOre
{
[Constructible]
public BronzeOre() : this(1)
{
}
[Constructible]
public BronzeOre(int amount) : base(CraftResource.Bronze, amount)
public BronzeOre(int amount = 1) : base(CraftResource.Bronze, amount)
{
}
@ -609,12 +580,7 @@ namespace Server.Items
public class GoldOre : BaseOre
{
[Constructible]
public GoldOre() : this(1)
{
}
[Constructible]
public GoldOre(int amount) : base(CraftResource.Gold, amount)
public GoldOre(int amount = 1) : base(CraftResource.Gold, amount)
{
}
@ -645,12 +611,7 @@ namespace Server.Items
public class AgapiteOre : BaseOre
{
[Constructible]
public AgapiteOre() : this(1)
{
}
[Constructible]
public AgapiteOre(int amount) : base(CraftResource.Agapite, amount)
public AgapiteOre(int amount = 1) : base(CraftResource.Agapite, amount)
{
}
@ -681,12 +642,7 @@ namespace Server.Items
public class VeriteOre : BaseOre
{
[Constructible]
public VeriteOre() : this(1)
{
}
[Constructible]
public VeriteOre(int amount) : base(CraftResource.Verite, amount)
public VeriteOre(int amount = 1) : base(CraftResource.Verite, amount)
{
}
@ -717,12 +673,7 @@ namespace Server.Items
public class ValoriteOre : BaseOre
{
[Constructible]
public ValoriteOre() : this(1)
{
}
[Constructible]
public ValoriteOre(int amount) : base(CraftResource.Valorite, amount)
public ValoriteOre(int amount = 1) : base(CraftResource.Valorite, amount)
{
}
@ -749,4 +700,4 @@ namespace Server.Items
return new ValoriteIngot();
}
}
}
}

View file

@ -4,11 +4,7 @@ namespace Server.Items
{
private CraftResource m_Resource;
public BaseScales(CraftResource resource) : this(resource, 1)
{
}
public BaseScales(CraftResource resource, int amount) : base(0x26B4)
public BaseScales(CraftResource resource, int amount = 1) : base(0x26B4)
{
Stackable = true;
Amount = amount;
@ -68,12 +64,7 @@ namespace Server.Items
public class RedScales : BaseScales
{
[Constructible]
public RedScales() : this(1)
{
}
[Constructible]
public RedScales(int amount) : base(CraftResource.RedScales, amount)
public RedScales(int amount = 1) : base(CraftResource.RedScales, amount)
{
}
@ -99,12 +90,7 @@ namespace Server.Items
public class YellowScales : BaseScales
{
[Constructible]
public YellowScales() : this(1)
{
}
[Constructible]
public YellowScales(int amount) : base(CraftResource.YellowScales, amount)
public YellowScales(int amount = 1) : base(CraftResource.YellowScales, amount)
{
}
@ -130,12 +116,7 @@ namespace Server.Items
public class BlackScales : BaseScales
{
[Constructible]
public BlackScales() : this(1)
{
}
[Constructible]
public BlackScales(int amount) : base(CraftResource.BlackScales, amount)
public BlackScales(int amount = 1) : base(CraftResource.BlackScales, amount)
{
}
@ -161,12 +142,7 @@ namespace Server.Items
public class GreenScales : BaseScales
{
[Constructible]
public GreenScales() : this(1)
{
}
[Constructible]
public GreenScales(int amount) : base(CraftResource.GreenScales, amount)
public GreenScales(int amount = 1) : base(CraftResource.GreenScales, amount)
{
}
@ -192,12 +168,7 @@ namespace Server.Items
public class WhiteScales : BaseScales
{
[Constructible]
public WhiteScales() : this(1)
{
}
[Constructible]
public WhiteScales(int amount) : base(CraftResource.WhiteScales, amount)
public WhiteScales(int amount = 1) : base(CraftResource.WhiteScales, amount)
{
}
@ -223,12 +194,7 @@ namespace Server.Items
public class BlueScales : BaseScales
{
[Constructible]
public BlueScales() : this(1)
{
}
[Constructible]
public BlueScales(int amount) : base(CraftResource.BlueScales, amount)
public BlueScales(int amount = 1) : base(CraftResource.BlueScales, amount)
{
}
@ -252,4 +218,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Fish : Item, ICarvable
{
[Constructible]
public Fish() : this(1)
{
}
[Constructible]
public Fish(int amount) : base(Utility.Random(0x09CC, 4))
public Fish(int amount = 1) : base(Utility.Random(0x09CC, 4))
{
Stackable = true;
Weight = 1.0;
@ -39,4 +34,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,13 +3,7 @@ namespace Server.Items
public class Blight : Item
{
[Constructible]
public Blight()
: this(1)
{
}
[Constructible]
public Blight(int amount)
public Blight(int amount = 1)
: base(0x3183)
{
Stackable = true;
@ -39,13 +33,7 @@ namespace Server.Items
public class LuminescentFungi : Item
{
[Constructible]
public LuminescentFungi()
: this(1)
{
}
[Constructible]
public LuminescentFungi(int amount)
public LuminescentFungi(int amount = 1)
: base(0x3191)
{
Stackable = true;
@ -76,13 +64,7 @@ namespace Server.Items
public class CapturedEssence : Item
{
[Constructible]
public CapturedEssence()
: this(1)
{
}
[Constructible]
public CapturedEssence(int amount)
public CapturedEssence(int amount = 1)
: base(0x318E)
{
Stackable = true;
@ -112,12 +94,6 @@ namespace Server.Items
public class EyeOfTheTravesty : Item
{
[Constructible]
public EyeOfTheTravesty()
: this(1)
{
}
[Constructible]
public EyeOfTheTravesty(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -125,7 +101,7 @@ namespace Server.Items
}
[Constructible]
public EyeOfTheTravesty(int amount)
public EyeOfTheTravesty(int amount = 1)
: base(0x318D)
{
Stackable = true;
@ -155,12 +131,6 @@ namespace Server.Items
public class Corruption : Item
{
[Constructible]
public Corruption()
: this(1)
{
}
[Constructible]
public Corruption(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -168,7 +138,7 @@ namespace Server.Items
}
[Constructible]
public Corruption(int amount)
public Corruption(int amount = 1)
: base(0x3184)
{
Stackable = true;
@ -198,12 +168,6 @@ namespace Server.Items
public class DreadHornMane : Item
{
[Constructible]
public DreadHornMane()
: this(1)
{
}
[Constructible]
public DreadHornMane(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -211,7 +175,7 @@ namespace Server.Items
}
[Constructible]
public DreadHornMane(int amount)
public DreadHornMane(int amount = 1)
: base(0x318A)
{
Stackable = true;
@ -241,12 +205,6 @@ namespace Server.Items
public class ParasiticPlant : Item
{
[Constructible]
public ParasiticPlant()
: this(1)
{
}
[Constructible]
public ParasiticPlant(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -254,7 +212,7 @@ namespace Server.Items
}
[Constructible]
public ParasiticPlant(int amount)
public ParasiticPlant(int amount = 1)
: base(0x3190)
{
Stackable = true;
@ -284,12 +242,6 @@ namespace Server.Items
public class Muculent : Item
{
[Constructible]
public Muculent()
: this(1)
{
}
[Constructible]
public Muculent(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -297,7 +249,7 @@ namespace Server.Items
}
[Constructible]
public Muculent(int amount)
public Muculent(int amount = 1)
: base(0x3188)
{
Stackable = true;
@ -327,12 +279,6 @@ namespace Server.Items
public class DiseasedBark : Item
{
[Constructible]
public DiseasedBark()
: this(1)
{
}
[Constructible]
public DiseasedBark(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -340,7 +286,7 @@ namespace Server.Items
}
[Constructible]
public DiseasedBark(int amount)
public DiseasedBark(int amount = 1)
: base(0x318B)
{
Stackable = true;
@ -370,12 +316,6 @@ namespace Server.Items
public class BarkFragment : Item
{
[Constructible]
public BarkFragment()
: this(1)
{
}
[Constructible]
public BarkFragment(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -383,7 +323,7 @@ namespace Server.Items
}
[Constructible]
public BarkFragment(int amount)
public BarkFragment(int amount = 1)
: base(0x318F)
{
Stackable = true;
@ -413,12 +353,6 @@ namespace Server.Items
public class GrizzledBones : Item
{
[Constructible]
public GrizzledBones()
: this(1)
{
}
[Constructible]
public GrizzledBones(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -426,7 +360,7 @@ namespace Server.Items
}
[Constructible]
public GrizzledBones(int amount)
public GrizzledBones(int amount = 1)
: base(0x318C)
{
Stackable = true;
@ -459,12 +393,6 @@ namespace Server.Items
public class LardOfParoxysmus : Item
{
[Constructible]
public LardOfParoxysmus()
: this(1)
{
}
[Constructible]
public LardOfParoxysmus(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -472,7 +400,7 @@ namespace Server.Items
}
[Constructible]
public LardOfParoxysmus(int amount)
public LardOfParoxysmus(int amount = 1)
: base(0x3189)
{
Stackable = true;
@ -501,12 +429,6 @@ namespace Server.Items
public class PerfectEmerald : Item
{
[Constructible]
public PerfectEmerald()
: this(1)
{
}
[Constructible]
public PerfectEmerald(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -514,7 +436,7 @@ namespace Server.Items
}
[Constructible]
public PerfectEmerald(int amount)
public PerfectEmerald(int amount = 1)
: base(0x3194)
{
Stackable = true;
@ -543,12 +465,6 @@ namespace Server.Items
public class DarkSapphire : Item
{
[Constructible]
public DarkSapphire()
: this(1)
{
}
[Constructible]
public DarkSapphire(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -556,7 +472,7 @@ namespace Server.Items
}
[Constructible]
public DarkSapphire(int amount)
public DarkSapphire(int amount = 1)
: base(0x3192)
{
Stackable = true;
@ -586,12 +502,6 @@ namespace Server.Items
public class Turquoise : Item
{
[Constructible]
public Turquoise()
: this(1)
{
}
[Constructible]
public Turquoise(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -599,7 +509,7 @@ namespace Server.Items
}
[Constructible]
public Turquoise(int amount)
public Turquoise(int amount = 1)
: base(0x3193)
{
Stackable = true;
@ -629,12 +539,6 @@ namespace Server.Items
public class EcruCitrine : Item
{
[Constructible]
public EcruCitrine()
: this(1)
{
}
[Constructible]
public EcruCitrine(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -642,7 +546,7 @@ namespace Server.Items
}
[Constructible]
public EcruCitrine(int amount)
public EcruCitrine(int amount = 1)
: base(0x3195)
{
Stackable = true;
@ -672,12 +576,6 @@ namespace Server.Items
public class WhitePearl : Item
{
[Constructible]
public WhitePearl()
: this(1)
{
}
[Constructible]
public WhitePearl(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -685,7 +583,7 @@ namespace Server.Items
}
[Constructible]
public WhitePearl(int amount)
public WhitePearl(int amount = 1)
: base(0x3196)
{
Stackable = true;
@ -715,12 +613,6 @@ namespace Server.Items
public class FireRuby : Item
{
[Constructible]
public FireRuby()
: this(1)
{
}
[Constructible]
public FireRuby(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -728,7 +620,7 @@ namespace Server.Items
}
[Constructible]
public FireRuby(int amount)
public FireRuby(int amount = 1)
: base(0x3197)
{
Stackable = true;
@ -758,12 +650,6 @@ namespace Server.Items
public class BlueDiamond : Item
{
[Constructible]
public BlueDiamond()
: this(1)
{
}
[Constructible]
public BlueDiamond(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -771,7 +657,7 @@ namespace Server.Items
}
[Constructible]
public BlueDiamond(int amount)
public BlueDiamond(int amount = 1)
: base(0x3198)
{
Stackable = true;
@ -801,12 +687,6 @@ namespace Server.Items
public class BrilliantAmber : Item
{
[Constructible]
public BrilliantAmber()
: this(1)
{
}
[Constructible]
public BrilliantAmber(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -814,7 +694,7 @@ namespace Server.Items
}
[Constructible]
public BrilliantAmber(int amount)
public BrilliantAmber(int amount = 1)
: base(0x3199)
{
Stackable = true;
@ -843,12 +723,6 @@ namespace Server.Items
public class Scourge : Item
{
[Constructible]
public Scourge()
: this(1)
{
}
[Constructible]
public Scourge(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -856,7 +730,7 @@ namespace Server.Items
}
[Constructible]
public Scourge(int amount)
public Scourge(int amount = 1)
: base(0x3185)
{
Stackable = true;
@ -887,12 +761,6 @@ namespace Server.Items
public class Putrefication : Item
{
[Constructible]
public Putrefication()
: this(1)
{
}
[Constructible]
public Putrefication(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -900,7 +768,7 @@ namespace Server.Items
}
[Constructible]
public Putrefication(int amount)
public Putrefication(int amount = 1)
: base(0x3186)
{
Stackable = true;
@ -931,12 +799,6 @@ namespace Server.Items
public class Taint : Item
{
[Constructible]
public Taint()
: this(1)
{
}
[Constructible]
public Taint(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -944,7 +806,7 @@ namespace Server.Items
}
[Constructible]
public Taint(int amount)
public Taint(int amount = 1)
: base(0x3187)
{
Stackable = true;
@ -1003,12 +865,6 @@ namespace Server.Items
public class SwitchItem : Item
{
[Constructible]
public SwitchItem()
: this(1)
{
}
[Constructible]
public SwitchItem(int amountFrom, int amountTo)
: this(Utility.RandomMinMax(amountFrom, amountTo))
@ -1016,7 +872,7 @@ namespace Server.Items
}
[Constructible]
public SwitchItem(int amount)
public SwitchItem(int amount = 1)
: base(0x2F5F)
{
Stackable = true;
@ -1042,4 +898,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class BagOfAllReagents : Bag
{
[Constructible]
public BagOfAllReagents() : this(50)
{
}
[Constructible]
public BagOfAllReagents(int amount)
public BagOfAllReagents(int amount = 50)
{
DropItem(new BlackPearl(amount));
DropItem(new Bloodmoss(amount));
@ -43,4 +38,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class BagOfNecroReagents : Bag
{
[Constructible]
public BagOfNecroReagents() : this(50)
{
}
[Constructible]
public BagOfNecroReagents(int amount)
public BagOfNecroReagents(int amount = 50)
{
DropItem(new BatWing(amount));
DropItem(new GraveDust(amount));
@ -35,4 +30,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class BagOfReagents : Bag
{
[Constructible]
public BagOfReagents() : this(50)
{
}
[Constructible]
public BagOfReagents(int amount)
public BagOfReagents(int amount = 50)
{
DropItem(new BlackPearl(amount));
DropItem(new Bloodmoss(amount));
@ -38,4 +33,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -2,11 +2,7 @@ namespace Server.Items
{
public abstract class BaseReagent : Item
{
public BaseReagent(int itemID) : this(itemID, 1)
{
}
public BaseReagent(int itemID, int amount) : base(itemID)
public BaseReagent(int itemID, int amount = 1) : base(itemID)
{
Stackable = true;
Amount = amount;

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class BatWing : BaseReagent, ICommodity
{
[Constructible]
public BatWing() : this(1)
{
}
[Constructible]
public BatWing(int amount) : base(0xF78, amount)
public BatWing(int amount = 1) : base(0xF78, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class BlackPearl : BaseReagent, ICommodity
{
[Constructible]
public BlackPearl() : this(1)
{
}
[Constructible]
public BlackPearl(int amount) : base(0xF7A, amount)
public BlackPearl(int amount = 1) : base(0xF7A, amount)
{
}
@ -33,4 +28,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Bloodmoss : BaseReagent, ICommodity
{
[Constructible]
public Bloodmoss() : this(1)
{
}
[Constructible]
public Bloodmoss(int amount) : base(0xF7B, amount)
public Bloodmoss(int amount = 1) : base(0xF7B, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class DaemonBlood : BaseReagent, ICommodity
{
[Constructible]
public DaemonBlood() : this(1)
{
}
[Constructible]
public DaemonBlood(int amount) : base(0xF7D, amount)
public DaemonBlood(int amount = 1) : base(0xF7D, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -4,12 +4,7 @@ namespace Server.Items
public class DaemonBone : BaseReagent
{
[Constructible]
public DaemonBone() : this(1)
{
}
[Constructible]
public DaemonBone(int amount) : base(0xF80, amount)
public DaemonBone(int amount = 1) : base(0xF80, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class DeadWood : BaseReagent, ICommodity
{
[Constructible]
public DeadWood() : this(1)
{
}
[Constructible]
public DeadWood(int amount) : base(0xF90, amount)
public DeadWood(int amount = 1) : base(0xF90, amount)
{
}
@ -33,4 +28,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,13 +3,7 @@
public class DragonsBlood : BaseReagent, ICommodity
{
[Constructible]
public DragonsBlood()
: this(1)
{
}
[Constructible]
public DragonsBlood(int amount)
public DragonsBlood(int amount = 1)
: base(0x4077, amount)
{
}
@ -36,4 +30,4 @@
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Garlic : BaseReagent, ICommodity
{
[Constructible]
public Garlic() : this(1)
{
}
[Constructible]
public Garlic(int amount) : base(0xF84, amount)
public Garlic(int amount = 1) : base(0xF84, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Ginseng : BaseReagent, ICommodity
{
[Constructible]
public Ginseng() : this(1)
{
}
[Constructible]
public Ginseng(int amount) : base(0xF85, amount)
public Ginseng(int amount = 1) : base(0xF85, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class GraveDust : BaseReagent, ICommodity
{
[Constructible]
public GraveDust() : this(1)
{
}
[Constructible]
public GraveDust(int amount) : base(0xF8F, amount)
public GraveDust(int amount = 1) : base(0xF8F, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class MandrakeRoot : BaseReagent, ICommodity
{
[Constructible]
public MandrakeRoot() : this(1)
{
}
[Constructible]
public MandrakeRoot(int amount) : base(0xF86, amount)
public MandrakeRoot(int amount = 1) : base(0xF86, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Nightshade : BaseReagent, ICommodity
{
[Constructible]
public Nightshade() : this(1)
{
}
[Constructible]
public Nightshade(int amount) : base(0xF88, amount)
public Nightshade(int amount = 1) : base(0xF88, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class NoxCrystal : BaseReagent, ICommodity
{
[Constructible]
public NoxCrystal() : this(1)
{
}
[Constructible]
public NoxCrystal(int amount) : base(0xF8E, amount)
public NoxCrystal(int amount = 1) : base(0xF8E, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class PigIron : BaseReagent, ICommodity
{
[Constructible]
public PigIron() : this(1)
{
}
[Constructible]
public PigIron(int amount) : base(0xF8A, amount)
public PigIron(int amount = 1) : base(0xF8A, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class SpidersSilk : BaseReagent, ICommodity
{
[Constructible]
public SpidersSilk() : this(1)
{
}
[Constructible]
public SpidersSilk(int amount) : base(0xF8D, amount)
public SpidersSilk(int amount = 1) : base(0xF8D, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class SulfurousAsh : BaseReagent, ICommodity
{
[Constructible]
public SulfurousAsh() : this(1)
{
}
[Constructible]
public SulfurousAsh(int amount) : base(0xF8C, amount)
public SulfurousAsh(int amount = 1) : base(0xF8C, amount)
{
}
@ -34,4 +29,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -6,12 +6,7 @@ namespace Server.Items
public class BoltOfCloth : Item, IScissorable, IDyable, ICommodity
{
[Constructible]
public BoltOfCloth() : this(1)
{
}
[Constructible]
public BoltOfCloth(int amount) : base(0xF95)
public BoltOfCloth(int amount = 1) : base(0xF95)
{
Stackable = true;
Weight = 5.0;
@ -65,4 +60,4 @@ namespace Server.Items
new MessageLocalized(Serial, ItemID, MessageType.Label, 0x3B2, 3, number, "", (Amount * 50).ToString()));
}
}
}
}

View file

@ -3,12 +3,7 @@ namespace Server.Items
public class Bone : Item, ICommodity
{
[Constructible]
public Bone() : this(1)
{
}
[Constructible]
public Bone(int amount) : base(0xf7e)
public Bone(int amount = 1) : base(0xf7e)
{
Stackable = true;
Amount = amount;
@ -37,4 +32,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -6,12 +6,7 @@ namespace Server.Items
public class Cloth : Item, IScissorable, IDyable, ICommodity
{
[Constructible]
public Cloth() : this(1)
{
}
[Constructible]
public Cloth(int amount) : base(0x1766)
public Cloth(int amount = 1) : base(0x1766)
{
Stackable = true;
Amount = amount;
@ -65,4 +60,4 @@ namespace Server.Items
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()));
}
}
}
}

View file

@ -5,12 +5,7 @@ namespace Server.Items
public class Cotton : Item, IDyable
{
[Constructible]
public Cotton() : this(1)
{
}
[Constructible]
public Cotton(int amount) : base(0xDF9)
public Cotton(int amount = 1) : base(0xDF9)
{
Stackable = true;
Weight = 4.0;
@ -109,4 +104,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -5,12 +5,7 @@ namespace Server.Items
public class Flax : Item
{
[Constructible]
public Flax() : this(1)
{
}
[Constructible]
public Flax(int amount) : base(0x1A9C)
public Flax(int amount = 1) : base(0x1A9C)
{
Stackable = true;
Weight = 1.0;
@ -99,4 +94,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -4,11 +4,7 @@ namespace Server.Items
{
private CraftResource m_Resource;
public BaseHides(CraftResource resource) : this(resource, 1)
{
}
public BaseHides(CraftResource resource, int amount) : base(0x1079)
public BaseHides(CraftResource resource, int amount = 1) : base(0x1079)
{
Stackable = true;
Weight = 5.0;
@ -107,12 +103,7 @@ namespace Server.Items
public class Hides : BaseHides, IScissorable
{
[Constructible]
public Hides() : this(1)
{
}
[Constructible]
public Hides(int amount) : base(CraftResource.RegularLeather, amount)
public Hides(int amount = 1) : base(CraftResource.RegularLeather, amount)
{
}
@ -154,12 +145,7 @@ namespace Server.Items
public class SpinedHides : BaseHides, IScissorable
{
[Constructible]
public SpinedHides() : this(1)
{
}
[Constructible]
public SpinedHides(int amount) : base(CraftResource.SpinedLeather, amount)
public SpinedHides(int amount = 1) : base(CraftResource.SpinedLeather, amount)
{
}
@ -201,12 +187,7 @@ namespace Server.Items
public class HornedHides : BaseHides, IScissorable
{
[Constructible]
public HornedHides() : this(1)
{
}
[Constructible]
public HornedHides(int amount) : base(CraftResource.HornedLeather, amount)
public HornedHides(int amount = 1) : base(CraftResource.HornedLeather, amount)
{
}
@ -248,12 +229,7 @@ namespace Server.Items
public class BarbedHides : BaseHides, IScissorable
{
[Constructible]
public BarbedHides() : this(1)
{
}
[Constructible]
public BarbedHides(int amount) : base(CraftResource.BarbedLeather, amount)
public BarbedHides(int amount = 1) : base(CraftResource.BarbedLeather, amount)
{
}
@ -290,4 +266,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -4,11 +4,7 @@ namespace Server.Items
{
private CraftResource m_Resource;
public BaseLeather(CraftResource resource) : this(resource, 1)
{
}
public BaseLeather(CraftResource resource, int amount) : base(0x1081)
public BaseLeather(CraftResource resource, int amount = 1) : base(0x1081)
{
Stackable = true;
Weight = 1.0;
@ -107,12 +103,7 @@ namespace Server.Items
public class Leather : BaseLeather
{
[Constructible]
public Leather() : this(1)
{
}
[Constructible]
public Leather(int amount) : base(CraftResource.RegularLeather, amount)
public Leather(int amount = 1) : base(CraftResource.RegularLeather, amount)
{
}
@ -139,12 +130,7 @@ namespace Server.Items
public class SpinedLeather : BaseLeather
{
[Constructible]
public SpinedLeather() : this(1)
{
}
[Constructible]
public SpinedLeather(int amount) : base(CraftResource.SpinedLeather, amount)
public SpinedLeather(int amount = 1) : base(CraftResource.SpinedLeather, amount)
{
}
@ -171,12 +157,7 @@ namespace Server.Items
public class HornedLeather : BaseLeather
{
[Constructible]
public HornedLeather() : this(1)
{
}
[Constructible]
public HornedLeather(int amount) : base(CraftResource.HornedLeather, amount)
public HornedLeather(int amount = 1) : base(CraftResource.HornedLeather, amount)
{
}
@ -203,12 +184,7 @@ namespace Server.Items
public class BarbedLeather : BaseLeather
{
[Constructible]
public BarbedLeather() : this(1)
{
}
[Constructible]
public BarbedLeather(int amount) : base(CraftResource.BarbedLeather, amount)
public BarbedLeather(int amount = 1) : base(CraftResource.BarbedLeather, amount)
{
}
@ -230,4 +206,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}

View file

@ -6,12 +6,7 @@ namespace Server.Items
public class UncutCloth : Item, IScissorable, IDyable, ICommodity
{
[Constructible]
public UncutCloth() : this(1)
{
}
[Constructible]
public UncutCloth(int amount) : base(0x1767)
public UncutCloth(int amount = 1) : base(0x1767)
{
Stackable = true;
Amount = amount;
@ -65,4 +60,4 @@ namespace Server.Items
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()));
}
}
}
}

View file

@ -5,12 +5,7 @@ namespace Server.Items
public class Wool : Item, IDyable
{
[Constructible]
public Wool() : this(1)
{
}
[Constructible]
public Wool(int amount) : base(0xDF8)
public Wool(int amount = 1) : base(0xDF8)
{
Stackable = true;
Weight = 4.0;
@ -113,12 +108,7 @@ namespace Server.Items
public class TaintedWool : Wool
{
[Constructible]
public TaintedWool() : this(1)
{
}
[Constructible]
public TaintedWool(int amount) : base(0x101F)
public TaintedWool(int amount = 1) : base(0x101F)
{
Stackable = true;
Weight = 4.0;
@ -145,11 +135,11 @@ namespace Server.Items
public override void OnSpun(ISpinningWheel wheel, Mobile from, int hue)
{
Item item = new DarkYarn(1);
Item item = new DarkYarn();
item.Hue = hue;
from.AddToBackpack(item);
from.SendLocalizedMessage(1010574); // You put a ball of yarn in your backpack.
}
}
}
}

View file

@ -4,11 +4,7 @@ namespace Server.Items
{
public abstract class BaseClothMaterial : Item, IDyable
{
public BaseClothMaterial(int itemID) : this(itemID, 1)
{
}
public BaseClothMaterial(int itemID, int amount) : base(itemID)
public BaseClothMaterial(int itemID, int amount = 1) : base(itemID)
{
Stackable = true;
Weight = 1.0;
@ -110,12 +106,7 @@ namespace Server.Items
public class DarkYarn : BaseClothMaterial
{
[Constructible]
public DarkYarn() : this(1)
{
}
[Constructible]
public DarkYarn(int amount) : base(0xE1D, amount)
public DarkYarn(int amount = 1) : base(0xE1D, amount)
{
}
@ -141,12 +132,7 @@ namespace Server.Items
public class LightYarn : BaseClothMaterial
{
[Constructible]
public LightYarn() : this(1)
{
}
[Constructible]
public LightYarn(int amount) : base(0xE1E, amount)
public LightYarn(int amount = 1) : base(0xE1E, amount)
{
}
@ -172,12 +158,7 @@ namespace Server.Items
public class LightYarnUnraveled : BaseClothMaterial
{
[Constructible]
public LightYarnUnraveled() : this(1)
{
}
[Constructible]
public LightYarnUnraveled(int amount) : base(0xE1F, amount)
public LightYarnUnraveled(int amount = 1) : base(0xE1F, amount)
{
}
@ -203,12 +184,7 @@ namespace Server.Items
public class SpoolOfThread : BaseClothMaterial
{
[Constructible]
public SpoolOfThread() : this(1)
{
}
[Constructible]
public SpoolOfThread(int amount) : base(0xFA0, amount)
public SpoolOfThread(int amount = 1) : base(0xFA0, amount)
{
}
@ -230,4 +206,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}