diff --git a/Projects/Server/Utilities/Utility.cs b/Projects/Server/Utilities/Utility.cs index f3f4e6601..525e9422e 100644 --- a/Projects/Server/Utilities/Utility.cs +++ b/Projects/Server/Utilities/Utility.cs @@ -949,14 +949,18 @@ public static class Utility [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool InUpdateRange(Point3D p1, Point3D p2) => InRange(p1, p2, 18); - // 4d6+8 would be: Utility.Dice( 4, 6, 8 ) - public static int Dice(uint amount, uint sides, int bonus) + public static int Dice(int amount, int sides, int bonus) { + if (amount <= 0 || sides <= 0) + { + return 0; + } + var total = 0; for (var i = 0; i < amount; ++i) { - total += (int)RandomSources.Source.Next(1, sides); + total += RandomSources.Source.Next(1, sides); } return total + bonus; diff --git a/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs b/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs index 018eb560a..8fb451267 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Runebook.cs @@ -119,8 +119,6 @@ public partial class Runebook : Item, ISecurable, ICraftable private void Deserialize(IGenericReader reader, int version) { - base.Deserialize(reader); - _quality = (BookQuality)reader.ReadByte(); Timer.DelayCall(crafter => _crafter = crafter?.RawName, reader.ReadEntity()); _level = (SecureLevel)reader.ReadInt(); diff --git a/Projects/UOContent/Items/Weapons/BaseWeapon.cs b/Projects/UOContent/Items/Weapons/BaseWeapon.cs index ffa2f1b4f..729ef3c37 100644 --- a/Projects/UOContent/Items/Weapons/BaseWeapon.cs +++ b/Projects/UOContent/Items/Weapons/BaseWeapon.cs @@ -2106,7 +2106,7 @@ namespace Server.Items } } - public virtual double GetAosDamage(Mobile attacker, int bonus, uint dice, uint sides) + public virtual double GetAosDamage(Mobile attacker, int bonus, int dice, int sides) { var damage = Utility.Dice(dice, sides, bonus) * 100; diff --git a/Projects/UOContent/Migrations/Server.Mobiles.Sheep.v0.json b/Projects/UOContent/Migrations/Server.Mobiles.Sheep.v0.json index 44244b28e..78c5c164c 100644 --- a/Projects/UOContent/Migrations/Server.Mobiles.Sheep.v0.json +++ b/Projects/UOContent/Migrations/Server.Mobiles.Sheep.v0.json @@ -7,7 +7,7 @@ "type": "System.DateTime", "rule": "PrimitiveTypeMigrationRule", "ruleArguments": [ - "" + "DeltaTime" ] } ] diff --git a/Projects/UOContent/Mobiles/Animals/Misc/Sheep.cs b/Projects/UOContent/Mobiles/Animals/Misc/Sheep.cs index 81abc5793..9472d57b3 100644 --- a/Projects/UOContent/Mobiles/Animals/Misc/Sheep.cs +++ b/Projects/UOContent/Mobiles/Animals/Misc/Sheep.cs @@ -43,8 +43,9 @@ namespace Server.Mobiles public override string CorpseName => "a sheep corpse"; - [CommandProperty(AccessLevel.GameMaster)] + [DeltaDateTime] [SerializableProperty(0)] + [CommandProperty(AccessLevel.GameMaster)] public DateTime NextWoolTime { get => _nextWoolTime; diff --git a/Projects/UOContent/Spells/Base/Spell.cs b/Projects/UOContent/Spells/Base/Spell.cs index a0d1eb990..f78d508b1 100644 --- a/Projects/UOContent/Spells/Base/Spell.cs +++ b/Projects/UOContent/Spells/Base/Spell.cs @@ -192,7 +192,7 @@ namespace Server.Spells (m as BaseCreature)?.OnHarmfulSpell(Caster); } - public virtual int GetNewAosDamage(int bonus, uint dice, uint sides, Mobile singleTarget) + public virtual int GetNewAosDamage(int bonus, int dice, int sides, Mobile singleTarget) { if (singleTarget != null) { @@ -208,10 +208,10 @@ namespace Server.Spells return GetNewAosDamage(bonus, dice, sides, false); } - public virtual int GetNewAosDamage(int bonus, uint dice, uint sides, bool playerVsPlayer) => + public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer) => GetNewAosDamage(bonus, dice, sides, playerVsPlayer, 1.0); - public virtual int GetNewAosDamage(int bonus, uint dice, uint sides, bool playerVsPlayer, double scalar) + public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer, double scalar) { var damage = Utility.Dice(dice, sides, bonus) * 100;