diff --git a/Projects/Logger/LogFactory.cs b/Projects/Logger/LogFactory.cs index bed3ea20e..d6bc9a41c 100644 --- a/Projects/Logger/LogFactory.cs +++ b/Projects/Logger/LogFactory.cs @@ -15,12 +15,13 @@ using System; using Serilog; +using Serilog.Core; namespace Server.Logging; public static class LogFactory { - private static readonly Serilog.ILogger serilogLogger = new LoggerConfiguration() + private static readonly Logger serilogLogger = new LoggerConfiguration() .WriteTo.Async(a => a.Console( outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {NewLine}{Exception}" )) diff --git a/Projects/Server.Tests/Helpers/GumpUtilities.cs b/Projects/Server.Tests/Helpers/GumpUtilities.cs index 94ebedca2..f5a910db8 100644 --- a/Projects/Server.Tests/Helpers/GumpUtilities.cs +++ b/Projects/Server.Tests/Helpers/GumpUtilities.cs @@ -8,7 +8,7 @@ public static class GumpUtilities { public static Packet Compile(this Gump g, NetState ns = null) { - IGumpWriter disp = new DisplayGumpPacked(g); + var disp = new DisplayGumpPacked(g); if (!g.Draggable) { @@ -46,7 +46,7 @@ public static class GumpUtilities disp.Flush(); - return (Packet)disp; + return disp; } public static int Intern(this List strings, string value) diff --git a/Projects/UOContent/Commands/Handlers.cs b/Projects/UOContent/Commands/Handlers.cs index de1e831e2..d1c56d339 100644 --- a/Projects/UOContent/Commands/Handlers.cs +++ b/Projects/UOContent/Commands/Handlers.cs @@ -239,7 +239,7 @@ namespace Server.Commands for (var i = 0; i < pets.Count; ++i) { - Mobile pet = pets[i]; + var pet = pets[i]; if (pet is IMount mount) { diff --git a/Projects/UOContent/Engines/Doom/GenGauntlet.cs b/Projects/UOContent/Engines/Doom/GenGauntlet.cs index c770afa85..5c4c4edf2 100644 --- a/Projects/UOContent/Engines/Doom/GenGauntlet.cs +++ b/Projects/UOContent/Engines/Doom/GenGauntlet.cs @@ -163,8 +163,8 @@ namespace Server.Engines.Doom public static BaseDoor CreateDoorSet(int xDoor, int yDoor, bool doorEastToWest, int hue) { - BaseDoor hiDoor = new MetalDoor(doorEastToWest ? DoorFacing.NorthCCW : DoorFacing.WestCW); - BaseDoor loDoor = new MetalDoor(doorEastToWest ? DoorFacing.SouthCW : DoorFacing.EastCCW); + var hiDoor = new MetalDoor(doorEastToWest ? DoorFacing.NorthCCW : DoorFacing.WestCW); + var loDoor = new MetalDoor(doorEastToWest ? DoorFacing.SouthCW : DoorFacing.EastCCW); hiDoor.MoveToWorld(new Point3D(xDoor, yDoor, -1), Map.Malas); loDoor.MoveToWorld( diff --git a/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs b/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs index 8af67df58..05d5dc6dc 100644 --- a/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs +++ b/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs @@ -321,8 +321,8 @@ public partial class LeverPuzzleController : Item { for (var i = 0; i < 4; i++) { - Item l; - if ((l = GetLever(i)) != null) + var l = GetLever(i); + if (l != null) { l.ItemID = 0x108E; Effects.PlaySound(l.Location, Map, 0x3E8); @@ -361,43 +361,41 @@ public partial class LeverPuzzleController : Item { PuzzleStatus(1050004); // The circle is the key... } + else if (TheirKey == MyKey) + { + GenKey(); + Successful = GetOccupant(0); + if (Successful != null) + { + SendLocationEffect(lp_Center, 0x1153, 0, 60, 1); + PlaySounds(lp_Center, cs1); + + Effects.SendBoltEffect(Successful); + Successful.MoveToWorld(lr_Enter, Map.Malas); + + m_Timer = new LampRoomTimer(this); + m_Timer.Start(); + Enabled = false; + } + } else { - Mobile player; - if (TheirKey == MyKey) + for (var i = 0; i < 16; i++) /* Count matching SET bits, ie correct codes */ { - GenKey(); - if ((Successful = player = GetOccupant(0)) != null) + if (((MyKey >> i) & 1) == 1 && ((TheirKey >> i) & 1) == 1) { - SendLocationEffect(lp_Center, 0x1153, 0, 60, 1); - PlaySounds(lp_Center, cs1); - - Effects.SendBoltEffect(player); - player.MoveToWorld(lr_Enter, Map.Malas); - - m_Timer = new LampRoomTimer(this); - m_Timer.Start(); - Enabled = false; + correct++; } } - else + + PuzzleStatus(Statue_Msg[correct], correct > 0 ? correct.ToString() : null); + + for (var i = 0; i < 5; i++) { - for (var i = 0; i < 16; i++) /* Count matching SET bits, ie correct codes */ + var player = GetOccupant(i); + if (player != null) { - if (((MyKey >> i) & 1) == 1 && ((TheirKey >> i) & 1) == 1) - { - correct++; - } - } - - PuzzleStatus(Statue_Msg[correct], correct > 0 ? correct.ToString() : null); - - for (var i = 0; i < 5; i++) - { - if ((player = GetOccupant(i)) != null) - { - new RockTimer(player).Start(); - } + new RockTimer(player).Start(); } } } diff --git a/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs b/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs index 7c8362c5e..a3af7e72c 100644 --- a/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs +++ b/Projects/UOContent/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs @@ -10,7 +10,7 @@ public partial class LampRoomBox : Item { [SerializableField(0)] private LeverPuzzleController _controller; - private Mobile _wanderer; + private WandererOfTheVoid _wanderer; public LampRoomBox(LeverPuzzleController controller) : base(0xe80) { diff --git a/Projects/UOContent/Engines/ML Quests/Definitions/Heartwood.cs b/Projects/UOContent/Engines/ML Quests/Definitions/Heartwood.cs index 2ac1e889f..4bf21fdf0 100644 --- a/Projects/UOContent/Engines/ML Quests/Definitions/Heartwood.cs +++ b/Projects/UOContent/Engines/ML Quests/Definitions/Heartwood.cs @@ -2158,9 +2158,10 @@ public partial class Landy : BaseCreature AddItem(new ShortPants(Utility.RandomYellowHue())); AddItem(new Tunic(Utility.RandomYellowHue())); - Item gloves = new LeafGloves(); - gloves.Hue = Utility.RandomYellowHue(); - AddItem(gloves); + AddItem(new LeafGloves + { + Hue = Utility.RandomYellowHue() + }); } public override bool IsInvulnerable => true; @@ -2720,11 +2721,10 @@ public partial class Tholef : BaseCreature AddItem(new ShortPants(0x28C)); AddItem(new Shirt(0x28C)); - Item item; - - item = new LeafArms(); - item.Hue = 0x28C; - AddItem(item); + AddItem(new LeafArms + { + Hue = 0x28C + }); } public override bool IsInvulnerable => true; @@ -2807,11 +2807,10 @@ public partial class Waelian : BaseCreature AddItem(new LongPants(0x340)); AddItem(new GemmedCirclet()); - Item item; - - item = new LeafChest(); - item.Hue = 0x344; - AddItem(item); + AddItem(new LeafChest + { + Hue = 0x344 + }); } public override bool IsInvulnerable => true; @@ -3057,11 +3056,10 @@ public partial class Lohn : BaseCreature AddItem(new SmithHammer()); AddItem(new GemmedCirclet()); - Item item; - - item = new LeafChest(); - item.Hue = 0x359; - AddItem(item); + AddItem(new LeafChest + { + Hue = 0x359 + }); } public override bool IsInvulnerable => true; @@ -3405,11 +3403,10 @@ public partial class ElderVicaie : BaseCreature AddItem(new ElvenBoots()); AddItem(new Tunic(0x732)); - Item item; - - item = new LeafLegs(); - item.Hue = 0x3B2; - AddItem(item); + AddItem(new LeafLegs + { + Hue = 0x3B2 + }); } public override bool IsInvulnerable => true; @@ -3573,11 +3570,10 @@ public partial class Bolaevin : BaseCreature AddItem(new LeafChest()); AddItem(new LeafArms()); - Item item; - - item = new LeafLegs(); - item.Hue = 0x1BB; - AddItem(item); + AddItem(new LeafLegs + { + Hue = 0x1BB + }); } public override bool IsInvulnerable => true; diff --git a/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenSkillTraining.cs b/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenSkillTraining.cs index fd0401b94..67781a6d5 100644 --- a/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenSkillTraining.cs +++ b/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenSkillTraining.cs @@ -1274,11 +1274,10 @@ public partial class Mithneral : BaseCreature AddItem(new Backpack()); AddItem(new Sandals()); - Item item; - - item = new GustarShroud(); - item.Hue = 0x51C; - AddItem(item); + AddItem(new GustarShroud + { + Hue = 0x51C + }); } public override bool IsInvulnerable => true; @@ -1876,10 +1875,9 @@ public partial class GeorgeHephaestus : Blacksmith AddItem(new Bascinet()); AddItem(new FullApron(0x8AB)); - Item item; - - item = new SmithHammer(); - item.Hue = 0x8AB; - AddItem(item); + AddItem(new SmithHammer + { + Hue = 0x8AB + }); } } diff --git a/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenTraining.cs b/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenTraining.cs index 67cf71bb1..324898047 100644 --- a/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenTraining.cs +++ b/Projects/UOContent/Engines/ML Quests/Definitions/NewHavenTraining.cs @@ -472,11 +472,10 @@ public partial class Gervis : BaseCreature AddItem(new Doublet(0x652)); AddItem(new SmithHammer()); - Item item; - - item = new LeatherGloves(); - item.Hue = 0x3B2; - AddItem(item); + AddItem(new LeatherGloves + { + Hue = 0x3B2 + }); } public override bool IsInvulnerable => true; @@ -750,11 +749,10 @@ public partial class Hargrove : BaseCreature AddItem(new Bandana(0x20)); AddItem(new BattleAxe()); - Item item; - - item = new PlateGloves(); - item.Hue = 0x21E; - AddItem(item); + AddItem(new PlateGloves + { + Hue = 0x21E + }); } public override bool IsInvulnerable => true; diff --git a/Projects/UOContent/Engines/ML Quests/Definitions/Sanctuary.cs b/Projects/UOContent/Engines/ML Quests/Definitions/Sanctuary.cs index 1e03fc986..605fca1c6 100644 --- a/Projects/UOContent/Engines/ML Quests/Definitions/Sanctuary.cs +++ b/Projects/UOContent/Engines/ML Quests/Definitions/Sanctuary.cs @@ -784,11 +784,10 @@ public partial class Beotham : BaseCreature AddItem(new ShortPants(0x522)); AddItem(new FancyShirt(0x515)); - Item item; - - item = new LeafGloves(); - item.Hue = 0x901; - AddItem(item); + AddItem(new LeafGloves + { + Hue = 0x901 + }); } public override bool IsInvulnerable => true; @@ -1014,11 +1013,10 @@ public partial class LorekeeperRollarn : BaseCreature AddItem(new Circlet()); AddItem(new LeafChest()); - Item item; - - item = new LeafLegs(); - item.Hue = 0x71A; - AddItem(item); + AddItem(new LeafLegs + { + Hue = 0x71A + }); } public override bool IsInvulnerable => true; diff --git a/Projects/UOContent/Engines/ML Quests/Definitions/Spellweaving.cs b/Projects/UOContent/Engines/ML Quests/Definitions/Spellweaving.cs index fabd58935..96c9431ea 100644 --- a/Projects/UOContent/Engines/ML Quests/Definitions/Spellweaving.cs +++ b/Projects/UOContent/Engines/ML Quests/Definitions/Spellweaving.cs @@ -599,9 +599,10 @@ public partial class Synaeva : BaseCreature SetSkill(SkillName.Meditation, 60.0, 80.0); SetSkill(SkillName.Focus, 60.0, 80.0); - Item item = new RavenHelm(); - item.Hue = Utility.RandomGreenHue(); - AddItem(item); + AddItem(new RavenHelm + { + Hue = Utility.RandomGreenHue() + }); AddItem(new FemaleLeafChest()); AddItem(new LeafArms()); diff --git a/Projects/UOContent/Engines/Plants/MiscItems/GreenThorns.cs b/Projects/UOContent/Engines/Plants/MiscItems/GreenThorns.cs index e3db73227..846f8d1dd 100644 --- a/Projects/UOContent/Engines/Plants/MiscItems/GreenThorns.cs +++ b/Projects/UOContent/Engines/Plants/MiscItems/GreenThorns.cs @@ -509,7 +509,7 @@ public class FurrowsGreenThornsEffect : GreenThornsEffect // * A magical bunny leaps out of its hole, disturbed by the thorn's effect! * dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114428); - BaseCreature spawn = new VorpalBunny(); + var spawn = new VorpalBunny(); if (!SpawnCreature(spawn)) { spawn.Delete(); @@ -564,7 +564,7 @@ public class SwampGreenThornsEffect : GreenThornsEffect dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114429); Effects.PlaySound(Location, Map, 0x2B0); - BaseCreature spawn = new WhippingVine(); + var spawn = new WhippingVine(); if (!SpawnCreature(spawn)) { spawn.Delete(); @@ -618,7 +618,7 @@ public class SnowGreenThornsEffect : GreenThornsEffect // * Slithering ice serpents rise to the surface to investigate the disturbance! * dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1114430); - BaseCreature spawn = new GiantIceWorm(); + var spawn = new GiantIceWorm(); if (!SpawnCreature(spawn)) { spawn.Delete(); @@ -626,7 +626,7 @@ public class SnowGreenThornsEffect : GreenThornsEffect for (var i = 0; i < 3; i++) { - BaseCreature snake = new IceSnake(); + var snake = new IceSnake(); if (!SpawnCreature(snake)) { snake.Delete(); diff --git a/Projects/UOContent/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs b/Projects/UOContent/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs index fff90c899..095dc75f1 100644 --- a/Projects/UOContent/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs +++ b/Projects/UOContent/Engines/Quests/Ambitious Solen Queen/AmbitiousQueenQuest.cs @@ -70,7 +70,7 @@ namespace Server.Engines.Quests.Ambitious { if (bagOfSending) { - Item reward = new BagOfSending(); + var reward = new BagOfSending(); if (player.PlaceInBackpack(reward)) { @@ -85,7 +85,7 @@ namespace Server.Engines.Quests.Ambitious if (powderOfTranslocation) { - Item reward = new PowderOfTranslocation(Utility.RandomMinMax(10, 12)); + var reward = new PowderOfTranslocation(Utility.RandomMinMax(10, 12)); if (player.PlaceInBackpack(reward)) { @@ -100,7 +100,7 @@ namespace Server.Engines.Quests.Ambitious if (gold) { - Item reward = new Gold(Utility.RandomMinMax(250, 350)); + var reward = new Gold(Utility.RandomMinMax(250, 350)); if (player.PlaceInBackpack(reward)) { diff --git a/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScrollBox.cs b/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScrollBox.cs index 4cd34c687..8451bc1b5 100644 --- a/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScrollBox.cs +++ b/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScrollBox.cs @@ -33,7 +33,7 @@ public partial class KronusScrollBox : MetalBox if (obj?.Completed == false || DarkTidesQuest.HasLostCallingScroll(from)) { - Item scroll = new KronusScroll(); + var scroll = new KronusScroll(); if (pm.PlaceInBackpack(scroll)) { diff --git a/Projects/UOContent/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs b/Projects/UOContent/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs index d5086fbd2..76eb59361 100644 --- a/Projects/UOContent/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs +++ b/Projects/UOContent/Engines/Quests/Dark Tides/Mobiles/Mardoth.cs @@ -64,13 +64,15 @@ public partial class Mardoth : BaseQuester HairItemID = 0x203C; HairHue = 0x482; - Item gloves = new BoneGloves(); - gloves.Hue = 0x66D; - AddItem(gloves); + AddItem(new BoneGloves + { + Hue = 0x66D + }); - Item gorget = new PlateGorget(); - gorget.Hue = 0x1; - AddItem(gorget); + AddItem(new PlateGorget + { + Hue = 0x1 + }); } public override int GetAutoTalkRange(PlayerMobile m) => 3; diff --git a/Projects/UOContent/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs b/Projects/UOContent/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs index 31d895834..b6df0126e 100644 --- a/Projects/UOContent/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs +++ b/Projects/UOContent/Engines/Quests/Emino's Undertaking/Items/EminosKatanaChest.cs @@ -49,7 +49,7 @@ public partial class EminosKatanaChest : WoodenChest { if (EminosUndertakingQuest.HasLostEminosKatana(from)) { - Item katana = new EminosKatana(); + var katana = new EminosKatana(); if (!player.PlaceInBackpack(katana)) { @@ -64,7 +64,7 @@ public partial class EminosKatanaChest : WoodenChest if (obj?.Completed == false) { - Item katana = new EminosKatana(); + var katana = new EminosKatana(); if (player.PlaceInBackpack(katana)) { diff --git a/Projects/UOContent/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs b/Projects/UOContent/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs index 2e4826d87..bb4e5d464 100644 --- a/Projects/UOContent/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs +++ b/Projects/UOContent/Engines/Quests/Emino's Undertaking/Mobiles/Emino.cs @@ -58,7 +58,7 @@ public partial class Emino : BaseQuester if (EminosUndertakingQuest.HasLostNoteForZoel(player)) { - Item note = new NoteForZoel(); + var note = new NoteForZoel(); if (player.PlaceInBackpack(note)) { diff --git a/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HaochisKatanaGenerator.cs b/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HaochisKatanaGenerator.cs index 991c8ff3a..5ac52c164 100644 --- a/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HaochisKatanaGenerator.cs +++ b/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HaochisKatanaGenerator.cs @@ -31,7 +31,7 @@ public partial class HaochisKatanaGenerator : Item if (HaochisTrialsQuest.HasLostHaochisKatana(player)) { - Item katana = new HaochisKatana(); + var katana = new HaochisKatana(); if (!player.PlaceInBackpack(katana)) { @@ -46,7 +46,7 @@ public partial class HaochisKatanaGenerator : Item if (obj?.Completed == false) { - Item katana = new HaochisKatana(); + var katana = new HaochisKatana(); if (player.PlaceInBackpack(katana)) { diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs index 256cdcb80..a9abd82de 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Items/DaemonBloodChest.cs @@ -34,7 +34,7 @@ public partial class DaemonBloodChest : MetalChest return; } - Item vial = new QuestDaemonBlood(); + var vial = new QuestDaemonBlood(); if (player.PlaceInBackpack(vial)) { diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs index 108687c8b..8831e9a9a 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Mobiles/Dryad.cs @@ -78,7 +78,7 @@ public partial class Dryad : BaseQuester { FocusTo(player); - Item fertileDirt = new QuestFertileDirt(); + var fertileDirt = new QuestFertileDirt(); if (!player.PlaceInBackpack(fertileDirt)) { @@ -111,7 +111,7 @@ public partial class Dryad : BaseQuester FocusTo(from); - Item fertileDirt = new QuestFertileDirt(); + var fertileDirt = new QuestFertileDirt(); if (!player.PlaceInBackpack(fertileDirt)) { diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs index e69e4c14a..53be36108 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs @@ -328,7 +328,7 @@ namespace Server.Engines.Quests.Haven 1049330 ); // You have been ambushed! Fight for your honor!!! - BaseCreature creature = new HordeMinion(); + var creature = new HordeMinion(); creature.MoveToWorld(new Point3D(x, y, z), Map.Trammel); creature.Combatant = player; } diff --git a/Projects/UOContent/Engines/Quests/Witch Apprentice/Objectives.cs b/Projects/UOContent/Engines/Quests/Witch Apprentice/Objectives.cs index 723a129f0..2fb4395bb 100644 --- a/Projects/UOContent/Engines/Quests/Witch Apprentice/Objectives.cs +++ b/Projects/UOContent/Engines/Quests/Witch Apprentice/Objectives.cs @@ -52,7 +52,7 @@ namespace Server.Engines.Quests.Hag Effects.SendLocationEffect(m_CorpseLocation, map, 0x3728, 10); Effects.PlaySound(m_CorpseLocation, map, 0x1FE); - Mobile imp = new Zeefzorpul(); + var imp = new Zeefzorpul(); imp.MoveToWorld(m_CorpseLocation, map); // * You see a strange imp stealing a scrap of paper from the bloodied corpse * @@ -216,7 +216,7 @@ namespace Server.Engines.Quests.Hag Effects.SendLocationEffect(ImpLocation, map, 0x3728, 10); Effects.PlaySound(ImpLocation, map, 0x1FE); - Mobile imp = new Zeefzorpul(); + var imp = new Zeefzorpul(); imp.MoveToWorld(ImpLocation, map); imp.Direction = imp.GetDirectionTo(from); diff --git a/Projects/UOContent/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs b/Projects/UOContent/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs index 353016c07..0b105e7b6 100644 --- a/Projects/UOContent/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs +++ b/Projects/UOContent/Engines/Treasures of Tokuno/TreasuresOfTokuno.cs @@ -279,10 +279,10 @@ namespace Server.Mobiles AddItem(new Backpack()); AddItem(new Kamishimo(0x483)); - Item item = new LightPlateJingasa(); - item.Hue = 0x711; - - AddItem(item); + AddItem(new LightPlateJingasa + { + Hue = 0x711 + }); } public override bool CanBeDamaged() => false; diff --git a/Projects/UOContent/Gumps/VendorRentalGumps.cs b/Projects/UOContent/Gumps/VendorRentalGumps.cs index 589cdb60c..8b519b5f7 100644 --- a/Projects/UOContent/Gumps/VendorRentalGumps.cs +++ b/Projects/UOContent/Gumps/VendorRentalGumps.cs @@ -460,7 +460,7 @@ namespace Server.Gumps goldToGive = 0; } - PlayerVendor vendor = new RentedVendor( + var vendor = new RentedVendor( from, house, m_Contract.Duration, @@ -472,13 +472,11 @@ namespace Server.Gumps m_Contract.Delete(); - from.SendLocalizedMessage( - 1062377 - ); // You have accepted the offer and now own a vendor in this house. Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu. - m_Landlord.SendLocalizedMessage( - 1062376, - from.Name - ); // ~1_NAME~ has accepted your vendor rental offer. Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu. + // You have accepted the offer and now own a vendor in this house. Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu. + from.SendLocalizedMessage(1062377); + + // ~1_NAME~ has accepted your vendor rental offer. Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu. + m_Landlord.SendLocalizedMessage(1062376, from.Name); } protected override void Cancel(Mobile from) diff --git a/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs b/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs index 0fd6f4217..c5927a129 100644 --- a/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs +++ b/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs @@ -266,9 +266,11 @@ public partial class MistletoeDeed : Item if (itemID > 0) { - Item addon = new MistletoeAddon(Hue); + var addon = new MistletoeAddon(Hue) + { + ItemID = itemID + }; - addon.ItemID = itemID; addon.MoveToWorld(loc, from.Map); house.Addons.Add(addon); diff --git a/Projects/UOContent/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs b/Projects/UOContent/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs index 7976ad583..af6ffc439 100644 --- a/Projects/UOContent/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs +++ b/Projects/UOContent/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs @@ -76,7 +76,7 @@ namespace Server.Engines.Events if (CheckMobile(m_From)) { - Mobile twin = new NaughtyTwin(m_From); + var twin = new NaughtyTwin(m_From); if (twin.Deleted) { diff --git a/Projects/UOContent/Items/Containers/Strongbox.cs b/Projects/UOContent/Items/Containers/Strongbox.cs index 08d6778a0..6e937ff9c 100644 --- a/Projects/UOContent/Items/Containers/Strongbox.cs +++ b/Projects/UOContent/Items/Containers/Strongbox.cs @@ -101,7 +101,7 @@ public partial class StrongBox : BaseContainer, IChoppable public Container ConvertToStandardContainer() { - Container metalBox = new MetalBox(); + var metalBox = new MetalBox(); var subItems = new List(Items); foreach (var subItem in subItems) diff --git a/Projects/UOContent/Items/Deeds/BarkeepContract.cs b/Projects/UOContent/Items/Deeds/BarkeepContract.cs index 2ac3b0499..3db975f11 100644 --- a/Projects/UOContent/Items/Deeds/BarkeepContract.cs +++ b/Projects/UOContent/Items/Deeds/BarkeepContract.cs @@ -26,9 +26,11 @@ public partial class BarkeepContract : Item { from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish. - Mobile v = new PlayerBarkeeper(from, BaseHouse.FindHouseAt(from)); + var v = new PlayerBarkeeper(from, BaseHouse.FindHouseAt(from)) + { + Direction = from.Direction & Direction.Mask + }; - v.Direction = from.Direction & Direction.Mask; v.MoveToWorld(from.Location, from.Map); Delete(); @@ -68,9 +70,11 @@ public partial class BarkeepContract : Item } else { - Mobile v = new PlayerBarkeeper(from, house); + var v = new PlayerBarkeeper(from, house) + { + Direction = from.Direction & Direction.Mask + }; - v.Direction = from.Direction & Direction.Mask; v.MoveToWorld(from.Location, from.Map); Delete(); diff --git a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs index 4c093f8f0..4c2f1ff26 100644 --- a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs +++ b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs @@ -912,7 +912,7 @@ public partial class Corpse : Container, ICarvable var obj = qs.FindObjective(); if (obj?.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player))) { - Item bone = new QuestDaemonBone(); + var bone = new QuestDaemonBone(); if (player.PlaceInBackpack(bone)) { diff --git a/Projects/UOContent/Items/Misc/PlayerVendorDeed.cs b/Projects/UOContent/Items/Misc/PlayerVendorDeed.cs index ff115b1b8..cf864bce6 100644 --- a/Projects/UOContent/Items/Misc/PlayerVendorDeed.cs +++ b/Projects/UOContent/Items/Misc/PlayerVendorDeed.cs @@ -22,9 +22,11 @@ public partial class ContractOfEmployment : Item { from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish. - Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from)); + var v = new PlayerVendor(from, BaseHouse.FindHouseAt(from)) + { + Direction = from.Direction & Direction.Mask + }; - v.Direction = from.Direction & Direction.Mask; v.MoveToWorld(from.Location, from.Map); v.SayTo(from, 503246); // Ah! it feels good to be working again. @@ -69,9 +71,11 @@ public partial class ContractOfEmployment : Item } else { - Mobile v = new PlayerVendor(from, house); + var v = new PlayerVendor(from, house) + { + Direction = from.Direction & Direction.Mask + }; - v.Direction = from.Direction & Direction.Mask; v.MoveToWorld(from.Location, from.Map); v.SayTo(from, 503246); // Ah! it feels good to be working again. diff --git a/Projects/UOContent/Items/Misc/PublicMoongate.cs b/Projects/UOContent/Items/Misc/PublicMoongate.cs index 8355d71e8..8d1f193e2 100644 --- a/Projects/UOContent/Items/Misc/PublicMoongate.cs +++ b/Projects/UOContent/Items/Misc/PublicMoongate.cs @@ -147,7 +147,7 @@ public partial class PublicMoongate : Item foreach (var entry in list.Entries) { - Item item = new PublicMoongate(); + var item = new PublicMoongate(); item.MoveToWorld(entry.Location, list.Map); diff --git a/Projects/UOContent/Items/Resources/Tailor/Cotton.cs b/Projects/UOContent/Items/Resources/Tailor/Cotton.cs index 01b4712db..ea6d9da29 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Cotton.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Cotton.cs @@ -41,10 +41,10 @@ public partial class Cotton : Item, IDyable public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { - Item item = new SpoolOfThread(6); - item.Hue = hue; - - from.AddToBackpack(item); + from.AddToBackpack(new SpoolOfThread(6) + { + Hue = hue + }); from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. } @@ -89,4 +89,4 @@ public partial class Cotton : Item, IDyable } } } -} \ No newline at end of file +} diff --git a/Projects/UOContent/Items/Resources/Tailor/Flax.cs b/Projects/UOContent/Items/Resources/Tailor/Flax.cs index 77f684f23..464778b14 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Flax.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Flax.cs @@ -42,10 +42,10 @@ public partial class Flax : Item public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { - Item item = new SpoolOfThread(6); - item.Hue = hue; - - from.AddToBackpack(item); + from.AddToBackpack(new SpoolOfThread(6) + { + Hue = hue + }); from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. } diff --git a/Projects/UOContent/Items/Resources/Tailor/Wool.cs b/Projects/UOContent/Items/Resources/Tailor/Wool.cs index 0dcec170d..5320cbd8d 100644 --- a/Projects/UOContent/Items/Resources/Tailor/Wool.cs +++ b/Projects/UOContent/Items/Resources/Tailor/Wool.cs @@ -41,10 +41,10 @@ public partial class Wool : Item, IDyable public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { - Item item = new DarkYarn(3); - item.Hue = hue; - - from.AddToBackpack(item); + from.AddToBackpack(new DarkYarn(3) + { + Hue = hue + }); from.SendLocalizedMessage(1010576); // You put the balls of yarn in your backpack. } @@ -105,10 +105,10 @@ public partial class TaintedWool : Wool public override void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { - Item item = new DarkYarn(); - item.Hue = hue; - - from.AddToBackpack(item); + from.AddToBackpack(new DarkYarn + { + Hue = hue + }); from.SendLocalizedMessage(1010574); // You put a ball of yarn in your backpack. } -} \ No newline at end of file +} diff --git a/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs b/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs index 9d8e2766d..abce822ec 100644 --- a/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs +++ b/Projects/UOContent/Items/Resources/Tailor/YarnsAndThreads.cs @@ -75,8 +75,10 @@ public abstract partial class BaseClothMaterial : Item, IDyable } else { - Item create = new BoltOfCloth(); - create.Hue = m_Material.Hue; + var create = new BoltOfCloth + { + Hue = m_Material.Hue + }; m_Material.Consume(); loom.Phase = 0; @@ -126,4 +128,4 @@ public partial class SpoolOfThread : BaseClothMaterial public SpoolOfThread(int amount = 1) : base(0xFA0, amount) { } -} \ No newline at end of file +} diff --git a/Projects/UOContent/Items/Skill Items/Harvest Tools/ProspectorsTool.cs b/Projects/UOContent/Items/Skill Items/Harvest Tools/ProspectorsTool.cs index 7ab9e912d..c2372223b 100644 --- a/Projects/UOContent/Items/Skill Items/Harvest Tools/ProspectorsTool.cs +++ b/Projects/UOContent/Items/Skill Items/Harvest Tools/ProspectorsTool.cs @@ -61,7 +61,7 @@ public partial class ProspectorsTool : BaseBashing, IUsesRemaining return; } - HarvestSystem system = Mining.System; + var system = Mining.System; if (!system.GetHarvestDetails(from, this, toProspect, out var tileID, out var map, out var loc, out var isLand)) { diff --git a/Projects/UOContent/Items/Special/Holiday/Wreath.cs b/Projects/UOContent/Items/Special/Holiday/Wreath.cs index a715fd1dc..0d0333017 100644 --- a/Projects/UOContent/Items/Special/Holiday/Wreath.cs +++ b/Projects/UOContent/Items/Special/Holiday/Wreath.cs @@ -257,11 +257,12 @@ public partial class WreathDeed : Item if (itemID > 0) { - Item addon = new WreathAddon(Hue); + var addon = new WreathAddon(Hue) + { + ItemID = itemID + }; - addon.ItemID = itemID; addon.MoveToWorld(loc, from.Map); - house.Addons.Add(addon); Delete(); } diff --git a/Projects/UOContent/Items/Talismans/BaseTalisman.cs b/Projects/UOContent/Items/Talismans/BaseTalisman.cs index 9c659f525..67cd8b9a5 100644 --- a/Projects/UOContent/Items/Talismans/BaseTalisman.cs +++ b/Projects/UOContent/Items/Talismans/BaseTalisman.cs @@ -260,8 +260,7 @@ public partial class BaseTalisman : Item, IAosItem [SerializableFieldSaveFlag(14)] public bool ShouldSerializeSlayer() => _slayer != TalismanSlayerName.None; - private Mobile _creature; - + private BaseCreature _creature; private TimerExecutionToken _timerToken; diff --git a/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs b/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs index 31bff1636..61e30046c 100644 --- a/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs +++ b/Projects/UOContent/Items/Traps/FlameSpurtTrap.cs @@ -8,7 +8,8 @@ namespace Server.Items; public partial class FlameSpurtTrap : BaseTrap { [SerializableField(0)] - private Item _spurt; + private Static _spurt; + private TimerExecutionToken _timerToken; [Constructible] diff --git a/Projects/UOContent/Items/Weapons/BaseWeapon.cs b/Projects/UOContent/Items/Weapons/BaseWeapon.cs index 23af56d5f..85489edf3 100644 --- a/Projects/UOContent/Items/Weapons/BaseWeapon.cs +++ b/Projects/UOContent/Items/Weapons/BaseWeapon.cs @@ -3662,7 +3662,7 @@ public abstract partial class BaseWeapon attacker.DoHarmful(defender); - MagerySpell sp = new DispelSpell(attacker); + var sp = new DispelSpell(attacker); if (sp.CheckResisted(defender)) { diff --git a/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json b/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json index 1e92a8ec5..70c2b17fd 100644 --- a/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json +++ b/Projects/UOContent/Migrations/Server.Items.FlameSpurtTrap.v0.json @@ -4,7 +4,7 @@ "properties": [ { "name": "Spurt", - "type": "Server.Item", + "type": "Server.Items.Static", "rule": "SerializableInterfaceMigrationRule" } ] diff --git a/Projects/UOContent/Migrations/Server.Mobiles.LordOaks.v0.json b/Projects/UOContent/Migrations/Server.Mobiles.LordOaks.v0.json index 435aa4121..d210e74a1 100644 --- a/Projects/UOContent/Migrations/Server.Mobiles.LordOaks.v0.json +++ b/Projects/UOContent/Migrations/Server.Mobiles.LordOaks.v0.json @@ -4,7 +4,7 @@ "properties": [ { "name": "Queen", - "type": "Server.Mobiles.BaseCreature", + "type": "Server.Mobiles.Silvani", "rule": "SerializableInterfaceMigrationRule" }, { diff --git a/Projects/UOContent/Mobiles/AI/BaseAI.cs b/Projects/UOContent/Mobiles/AI/BaseAI.cs index 555c65a46..d7cce9923 100644 --- a/Projects/UOContent/Mobiles/AI/BaseAI.cs +++ b/Projects/UOContent/Mobiles/AI/BaseAI.cs @@ -1899,8 +1899,7 @@ public abstract class BaseAI } else { - Container c = fromState.AddTrade(toState); - c.DropItem(new TransferItem(m_Mobile)); + fromState.AddTrade(toState).DropItem(new TransferItem(m_Mobile)); } } } diff --git a/Projects/UOContent/Mobiles/Animals/Misc/PackHorse.cs b/Projects/UOContent/Mobiles/Animals/Misc/PackHorse.cs index ab111f166..ca2d4e3dd 100644 --- a/Projects/UOContent/Mobiles/Animals/Misc/PackHorse.cs +++ b/Projects/UOContent/Mobiles/Animals/Misc/PackHorse.cs @@ -155,7 +155,7 @@ namespace Server.Mobiles if (pack != null) { - Container newPack = new Backpack(); + var newPack = new Backpack(); for (var i = pack.Items.Count - 1; i >= 0; --i) { diff --git a/Projects/UOContent/Mobiles/BaseCreature.cs b/Projects/UOContent/Mobiles/BaseCreature.cs index 6dde04f62..ed37b7be1 100644 --- a/Projects/UOContent/Mobiles/BaseCreature.cs +++ b/Projects/UOContent/Mobiles/BaseCreature.cs @@ -4941,7 +4941,7 @@ namespace Server.Mobiles { if (Backpack?.Items.Count > 0) { - Backpack b = new CreatureBackpack(Name); + var b = new CreatureBackpack(Name); var list = new List(Backpack.Items); foreach (var item in list) diff --git a/Projects/UOContent/Mobiles/Guards/ArcherGuard.cs b/Projects/UOContent/Mobiles/Guards/ArcherGuard.cs index 91797cc47..6ef01d1ce 100644 --- a/Projects/UOContent/Mobiles/Guards/ArcherGuard.cs +++ b/Projects/UOContent/Mobiles/Guards/ArcherGuard.cs @@ -44,15 +44,15 @@ public partial class ArcherGuard : BaseGuard AddItem(bow); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; - pack.Movable = false; - - var arrows = new Arrow(250); - - arrows.LootType = LootType.Newbied; - - pack.DropItem(arrows); + pack.DropItem(new Arrow(250) + { + LootType = LootType.Newbied + }); pack.DropItem(new Gold(10, 25)); AddItem(pack); diff --git a/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs b/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs index f8f725f7b..35cf273af 100644 --- a/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/EarthElemental.cs @@ -40,9 +40,10 @@ namespace Server.Mobiles PackItem(new FertileDirt(Utility.RandomMinMax(1, 4))); PackItem(new MandrakeRoot()); - Item ore = new IronOre(5); - ore.ItemID = 0x19B7; - PackItem(ore); + PackItem(new IronOre(5) + { + ItemID = 0x19B7 + }); } public override string CorpseName => "an earth elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs b/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs index 60005a74c..3884a6c03 100644 --- a/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Elemental/Melee/SnowElemental.cs @@ -39,9 +39,10 @@ namespace Server.Mobiles VirtualArmor = 50; PackItem(new BlackPearl(3)); - Item ore = new IronOre(3); - ore.ItemID = 0x19B8; - PackItem(ore); + PackItem(new IronOre(3) + { + ItemID = 0x19B8 + }); } public override string CorpseName => "a snow elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Humanoid/Melee/OrcBrute.cs b/Projects/UOContent/Mobiles/Monsters/Humanoid/Melee/OrcBrute.cs index 45541153c..317df7658 100644 --- a/Projects/UOContent/Mobiles/Monsters/Humanoid/Melee/OrcBrute.cs +++ b/Projects/UOContent/Mobiles/Monsters/Humanoid/Melee/OrcBrute.cs @@ -38,9 +38,10 @@ namespace Server.Mobiles VirtualArmor = 50; - Item ore = new ShadowIronOre(25); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new ShadowIronOre(25) + { + ItemID = 0x19B9 + }); PackItem(new IronIngot(10)); if (Utility.RandomDouble() < 0.05) diff --git a/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaLord.cs b/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaLord.cs index 6685790ba..eb276888a 100644 --- a/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaLord.cs +++ b/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaLord.cs @@ -40,7 +40,7 @@ namespace Server.Mobiles VirtualArmor = 28; - Container pack = new Backpack(); + var pack = new Backpack(); pack.DropItem(new Arrow(Utility.RandomMinMax(25, 35))); pack.DropItem(new Arrow(Utility.RandomMinMax(25, 35))); diff --git a/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaMage.cs b/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaMage.cs index abf2c39dc..a0d486535 100644 --- a/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaMage.cs +++ b/Projects/UOContent/Mobiles/Monsters/LBR/Jukas/JukaMage.cs @@ -45,7 +45,7 @@ namespace Server.Mobiles VirtualArmor = 16; - Container bag = new Bag(); + var bag = new Bag(); var count = Utility.RandomMinMax(10, 20); diff --git a/Projects/UOContent/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs b/Projects/UOContent/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs index 3af690d48..d4b8eaf82 100644 --- a/Projects/UOContent/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs +++ b/Projects/UOContent/Mobiles/Monsters/LBR/Meers/MeerCaptain.cs @@ -42,7 +42,7 @@ namespace Server.Mobiles VirtualArmor = 28; - Container pack = new Backpack(); + var pack = new Backpack(); pack.DropItem(new Bolt(Utility.RandomMinMax(10, 20))); pack.DropItem(new Bolt(Utility.RandomMinMax(10, 20))); @@ -59,7 +59,7 @@ namespace Server.Mobiles } ); - Container bag = new Bag(); + var bag = new Bag(); var count = Utility.RandomMinMax(10, 20); diff --git a/Projects/UOContent/Mobiles/Monsters/ML/Prism of Light/Protector.cs b/Projects/UOContent/Mobiles/Monsters/ML/Prism of Light/Protector.cs index e0e11287f..4fbe38291 100644 --- a/Projects/UOContent/Mobiles/Monsters/ML/Prism of Light/Protector.cs +++ b/Projects/UOContent/Mobiles/Monsters/ML/Prism of Light/Protector.cs @@ -42,17 +42,17 @@ namespace Server.Mobiles Fame = 10000; Karma = -10000; - Item boots = new ThighBoots(); - boots.Movable = false; - boots.Hue = Utility.Random(2); - - var shroud = new Item(0x204E); - shroud.Layer = Layer.OuterTorso; - shroud.Movable = false; - shroud.Hue = Utility.Random(2); - - AddItem(boots); - AddItem(shroud); + AddItem(new ThighBoots + { + Movable = false, + Hue = Utility.Random(2) + }); + AddItem(new Item(0x204E) + { + Layer = Layer.OuterTorso, + Movable = false, + Hue = Utility.Random(2) + }); } public override string CorpseName => "a human corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs b/Projects/UOContent/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs index cb469a55a..8c7984360 100644 --- a/Projects/UOContent/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs +++ b/Projects/UOContent/Mobiles/Monsters/Misc/Melee/PlagueBeast.cs @@ -124,9 +124,11 @@ namespace Server.Mobiles { if (Map != null && caster != this && Utility.RandomDouble() < 0.25) { - BaseCreature spawn = new PlagueSpawn(this); + var spawn = new PlagueSpawn(this) + { + Team = Team + }; - spawn.Team = Team; spawn.MoveToWorld(Location, Map); spawn.Combatant = caster; @@ -140,9 +142,11 @@ namespace Server.Mobiles { if (Map != null && attacker != this && Utility.RandomDouble() < 0.25) { - BaseCreature spawn = new PlagueSpawn(this); + var spawn = new PlagueSpawn(this) + { + Team = Team + }; - spawn.Team = Team; spawn.MoveToWorld(Location, Map); spawn.Combatant = attacker; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs index bdf45058f..60db2e920 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/AgapiteElemental.cs @@ -37,9 +37,10 @@ namespace Server.Mobiles VirtualArmor = 32; - Item ore = new AgapiteOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new AgapiteOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs index e90e95bb7..ecd9df804 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/BronzeElemental.cs @@ -38,9 +38,10 @@ namespace Server.Mobiles VirtualArmor = 29; - Item ore = new BronzeOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new BronzeOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/CopperElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/CopperElemental.cs index 0adc81b6e..d2388302f 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/CopperElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/CopperElemental.cs @@ -37,9 +37,10 @@ namespace Server.Mobiles VirtualArmor = 26; - Item ore = new CopperOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new CopperOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs index e8f94d462..c2fd84e75 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/DullCopperElemental.cs @@ -37,9 +37,10 @@ namespace Server.Mobiles VirtualArmor = 20; - Item ore = new DullCopperOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new DullCopperOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs index 35903c3fe..845a1f1ca 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/GoldenElemental.cs @@ -37,9 +37,10 @@ namespace Server.Mobiles VirtualArmor = 60; - Item ore = new GoldOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new GoldOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs index edfeffeb8..e68c6f4f5 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ShadowIronElemental.cs @@ -37,9 +37,10 @@ namespace Server.Mobiles VirtualArmor = 23; - Item ore = new ShadowIronOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new ShadowIronOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs index 64c099969..2480d3a9c 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/ValoriteElemental.cs @@ -40,9 +40,10 @@ namespace Server.Mobiles VirtualArmor = 38; - Item ore = new ValoriteOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new ValoriteOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs index 306c07d06..9b1a1e547 100644 --- a/Projects/UOContent/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Ore Elementals/VeriteElemental.cs @@ -38,9 +38,10 @@ namespace Server.Mobiles VirtualArmor = 35; - Item ore = new VeriteOre(oreAmount); - ore.ItemID = 0x19B9; - PackItem(ore); + PackItem(new VeriteOre(oreAmount) + { + ItemID = 0x19B9 + }); } public override string CorpseName => "an ore elemental corpse"; diff --git a/Projects/UOContent/Mobiles/PlayerMobile.cs b/Projects/UOContent/Mobiles/PlayerMobile.cs index 54c9fe4b0..fe2e6a05b 100644 --- a/Projects/UOContent/Mobiles/PlayerMobile.cs +++ b/Projects/UOContent/Mobiles/PlayerMobile.cs @@ -2360,7 +2360,7 @@ namespace Server.Mobiles if (Alive && !wasAlive) { - Item deathRobe = new DeathRobe(); + var deathRobe = new DeathRobe(); if (!EquipItem(deathRobe)) { @@ -2721,7 +2721,7 @@ namespace Server.Mobiles } } - private static void SendToStaffMessage(Mobile from, string text) + private static void SendToStaffMessage(PlayerMobile from, string text) { Span buffer = stackalloc byte[OutgoingMessagePackets.GetMaxMessageLength(text)].InitializePacket(); diff --git a/Projects/UOContent/Mobiles/Special/Harrower.cs b/Projects/UOContent/Mobiles/Special/Harrower.cs index 9b69aa3c7..4b2e31c01 100644 --- a/Projects/UOContent/Mobiles/Special/Harrower.cs +++ b/Projects/UOContent/Mobiles/Special/Harrower.cs @@ -343,7 +343,7 @@ public partial class Harrower : BaseCreature for (var i = 0; i < _tentacles.Count; ++i) { - Mobile m = _tentacles[i]; + var m = _tentacles[i]; if (!m.Deleted) { diff --git a/Projects/UOContent/Mobiles/Special/LordOaks.cs b/Projects/UOContent/Mobiles/Special/LordOaks.cs index 0387d6353..f8fb6d444 100644 --- a/Projects/UOContent/Mobiles/Special/LordOaks.cs +++ b/Projects/UOContent/Mobiles/Special/LordOaks.cs @@ -9,7 +9,7 @@ namespace Server.Mobiles; public partial class LordOaks : BaseChampion { [SerializableField(0)] - private BaseCreature _queen; + private Silvani _queen; [SerializableField(1)] private bool _spawnedQueen; diff --git a/Projects/UOContent/Mobiles/Townfolk/Actor.cs b/Projects/UOContent/Mobiles/Townfolk/Actor.cs index c13b8b087..375ec8116 100644 --- a/Projects/UOContent/Mobiles/Townfolk/Actor.cs +++ b/Projects/UOContent/Mobiles/Townfolk/Actor.cs @@ -35,12 +35,12 @@ public partial class Actor : BaseCreature Utility.AssignRandomHair(this); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; pack.DropItem(new Gold(250, 300)); - - pack.Movable = false; - AddItem(pack); } diff --git a/Projects/UOContent/Mobiles/Townfolk/Artist.cs b/Projects/UOContent/Mobiles/Townfolk/Artist.cs index 9e39817e5..271026e63 100644 --- a/Projects/UOContent/Mobiles/Townfolk/Artist.cs +++ b/Projects/UOContent/Mobiles/Townfolk/Artist.cs @@ -35,12 +35,12 @@ public partial class Artist : BaseCreature Utility.AssignRandomHair(this); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; pack.DropItem(new Gold(250, 300)); - - pack.Movable = false; - AddItem(pack); } diff --git a/Projects/UOContent/Mobiles/Townfolk/BaseEscortable.cs b/Projects/UOContent/Mobiles/Townfolk/BaseEscortable.cs index 04c6e9311..5c0187da0 100644 --- a/Projects/UOContent/Mobiles/Townfolk/BaseEscortable.cs +++ b/Projects/UOContent/Mobiles/Townfolk/BaseEscortable.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using ModernUO.Serialization; using Server.Buffers; @@ -849,7 +848,7 @@ public class EscortDestinationInfo public static void Initialize() { - ICollection list = Map.Felucca.Regions.Values; + var list = Map.Felucca.Regions.Values; if (list.Count == 0) { diff --git a/Projects/UOContent/Mobiles/Townfolk/Gypsy.cs b/Projects/UOContent/Mobiles/Townfolk/Gypsy.cs index ab08cf4a9..a645b8d83 100644 --- a/Projects/UOContent/Mobiles/Townfolk/Gypsy.cs +++ b/Projects/UOContent/Mobiles/Townfolk/Gypsy.cs @@ -42,12 +42,12 @@ public partial class Gypsy : BaseCreature Utility.AssignRandomHair(this); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; pack.DropItem(new Gold(250, 300)); - - pack.Movable = false; - AddItem(pack); } diff --git a/Projects/UOContent/Mobiles/Townfolk/HarborMaster.cs b/Projects/UOContent/Mobiles/Townfolk/HarborMaster.cs index 25c35513e..84e1f1d3a 100644 --- a/Projects/UOContent/Mobiles/Townfolk/HarborMaster.cs +++ b/Projects/UOContent/Mobiles/Townfolk/HarborMaster.cs @@ -37,12 +37,12 @@ public partial class HarborMaster : BaseCreature Utility.AssignRandomHair(this); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; pack.DropItem(new Gold(250, 300)); - - pack.Movable = false; - AddItem(pack); } diff --git a/Projects/UOContent/Mobiles/Townfolk/Sculptor.cs b/Projects/UOContent/Mobiles/Townfolk/Sculptor.cs index 00f23353c..c669822b7 100644 --- a/Projects/UOContent/Mobiles/Townfolk/Sculptor.cs +++ b/Projects/UOContent/Mobiles/Townfolk/Sculptor.cs @@ -34,12 +34,12 @@ public partial class Sculptor : BaseCreature Utility.AssignRandomHair(this); - Container pack = new Backpack(); + var pack = new Backpack + { + Movable = false + }; pack.DropItem(new Gold(250, 300)); - - pack.Movable = false; - AddItem(pack); } diff --git a/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs b/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs index 94b3eaf2a..a1496d07c 100644 --- a/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs +++ b/Projects/UOContent/Mobiles/Vendors/BaseVendor.cs @@ -1163,7 +1163,7 @@ namespace Server.Mobiles } private static bool ProcessSinglePurchase( - BuyItemResponse buy, IBuyItemInfo bii, List validBuy, + BuyItemResponse buy, GenericBuyInfo bii, List validBuy, ref int controlSlots, ref bool fullPurchase, ref int totalCost ) { @@ -1211,7 +1211,7 @@ namespace Server.Mobiles return true; } - private static void ProcessValidPurchase(int amount, IBuyItemInfo bii, Mobile buyer, Container cont) + private static void ProcessValidPurchase(int amount, GenericBuyInfo bii, Mobile buyer, Container cont) { if (amount > bii.Amount) { diff --git a/Projects/UOContent/Mobiles/Vendors/NPC/Blacksmith.cs b/Projects/UOContent/Mobiles/Vendors/NPC/Blacksmith.cs index 033bd30e0..5d9b39cbd 100644 --- a/Projects/UOContent/Mobiles/Vendors/NPC/Blacksmith.cs +++ b/Projects/UOContent/Mobiles/Vendors/NPC/Blacksmith.cs @@ -32,19 +32,19 @@ namespace Server.Mobiles public override void InitSBInfo() { /*m_SBInfos.Add( new SBSmithTools() ); - + m_SBInfos.Add( new SBMetalShields() ); m_SBInfos.Add( new SBWoodenShields() ); - + m_SBInfos.Add( new SBPlateArmor() ); - + m_SBInfos.Add( new SBHelmetArmor() ); m_SBInfos.Add( new SBChainmailArmor() ); m_SBInfos.Add( new SBRingmailArmor() ); m_SBInfos.Add( new SBAxeWeapon() ); m_SBInfos.Add( new SBPoleArmWeapon() ); m_SBInfos.Add( new SBRangedWeapon() ); - + m_SBInfos.Add( new SBKnifeWeapon() ); m_SBInfos.Add( new SBMaceWeapon() ); m_SBInfos.Add( new SBSpearForkWeapon() ); @@ -62,17 +62,11 @@ namespace Server.Mobiles { base.InitOutfit(); - Item item = Utility.RandomBool() ? null : new RingmailChest(); + Item item = Utility.RandomBool() ? new FullApron() : new RingmailChest(); - if (item != null && !EquipItem(item)) + if (!EquipItem(item)) { item.Delete(); - item = null; - } - - if (item == null) - { - AddItem(new FullApron()); } AddItem(new Bascinet()); diff --git a/Projects/UOContent/Mobiles/Vendors/NPC/Guildmasters/BlacksmithGuildmaster.cs b/Projects/UOContent/Mobiles/Vendors/NPC/Guildmasters/BlacksmithGuildmaster.cs index cfc6baf8c..2bc52b4c7 100644 --- a/Projects/UOContent/Mobiles/Vendors/NPC/Guildmasters/BlacksmithGuildmaster.cs +++ b/Projects/UOContent/Mobiles/Vendors/NPC/Guildmasters/BlacksmithGuildmaster.cs @@ -32,17 +32,11 @@ namespace Server.Mobiles { base.InitOutfit(); - Item item = Utility.RandomBool() ? null : new RingmailChest(); + Item item = Utility.RandomBool() ? new FullApron() : new RingmailChest(); - if (item != null && !EquipItem(item)) + if (!EquipItem(item)) { item.Delete(); - item = null; - } - - if (item == null) - { - AddItem(new FullApron()); } AddItem(new Bascinet()); diff --git a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs index d95bcf972..9cf360aff 100644 --- a/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs +++ b/Projects/UOContent/Mobiles/Vendors/PlayerVendor.cs @@ -227,9 +227,10 @@ public partial class PlayerVendor : Mobile public virtual void InitOutfit() { - Item item = new FancyShirt(Utility.RandomNeutralHue()); - item.Layer = Layer.InnerTorso; - AddItem(item); + AddItem(new FancyShirt(Utility.RandomNeutralHue()) + { + Layer = Layer.InnerTorso + }); AddItem(new LongPants(Utility.RandomNeutralHue())); AddItem(new BodySash(Utility.RandomNeutralHue())); AddItem(new Boots(Utility.RandomNeutralHue())); diff --git a/Projects/UOContent/Multis/Houses/BaseHouse.cs b/Projects/UOContent/Multis/Houses/BaseHouse.cs index 095f95569..d49062d01 100644 --- a/Projects/UOContent/Multis/Houses/BaseHouse.cs +++ b/Projects/UOContent/Multis/Houses/BaseHouse.cs @@ -2334,9 +2334,7 @@ namespace Server.Multis } else { - Container c = fromState.AddTrade(toState); - - c.DropItem(new TransferItem(this)); + fromState.AddTrade(toState).DropItem(new TransferItem(this)); } } } @@ -3357,9 +3355,7 @@ namespace Server.Multis { for (var i = 0; i < Doors.Count; ++i) { - Item item = Doors[i]; - - item?.Delete(); + Doors[i]?.Delete(); } Doors.Clear(); diff --git a/Projects/UOContent/Multis/Houses/MovingCrate.cs b/Projects/UOContent/Multis/Houses/MovingCrate.cs index 7388323fd..a52ad7aec 100644 --- a/Projects/UOContent/Multis/Houses/MovingCrate.cs +++ b/Projects/UOContent/Multis/Houses/MovingCrate.cs @@ -72,19 +72,18 @@ namespace Server.Multis { if (item is PackingBox packingBox) { - Container box = packingBox; - var subItems = box.Items; + var subItems = packingBox.Items; if (subItems.Count < MaxItemsPerSubcontainer) { - box.DropItem(dropped); + packingBox.DropItem(dropped); return; } } } // 3. Drop the item into a new container - Container subContainer = new PackingBox(); + var subContainer = new PackingBox(); subContainer.DropItem(dropped); var location = GetFreeLocation(); diff --git a/Projects/UOContent/Spells/Necromancy/AnimateDeadSpell.cs b/Projects/UOContent/Spells/Necromancy/AnimateDeadSpell.cs index 8ebc42ab8..b2359dbf4 100644 --- a/Projects/UOContent/Spells/Necromancy/AnimateDeadSpell.cs +++ b/Projects/UOContent/Spells/Necromancy/AnimateDeadSpell.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using ModernUO.CodeGeneratedEvents; -using Server.Engines.Quests; using Server.Engines.Quests.Necro; using Server.Items; using Server.Mobiles; @@ -115,13 +114,9 @@ public class AnimateDeadSpell : NecromancerSpell, ITargetingSpell if (comp?.Addon is MaabusCoffin addon) { - var pm = Caster as PlayerMobile; - - var qs = pm?.Quest; - - if (qs is DarkTidesQuest) + if (Caster is PlayerMobile { Quest : DarkTidesQuest quest }) { - QuestObjective objective = qs.FindObjective(); + var objective = quest.FindObjective(); if (objective?.Completed == false) { diff --git a/Projects/UOContent/Spells/Seventh/EnergyField.cs b/Projects/UOContent/Spells/Seventh/EnergyField.cs index b48bee267..a6fc1b116 100644 --- a/Projects/UOContent/Spells/Seventh/EnergyField.cs +++ b/Projects/UOContent/Spells/Seventh/EnergyField.cs @@ -57,8 +57,7 @@ public class EnergyFieldSpell : MagerySpell, ITargetingSpell continue; } - Item item = new EnergyField(targetLoc, Caster.Map, duration, itemID, Caster); - item.ProcessDelta(); + new EnergyField(targetLoc, Caster.Map, duration, itemID, Caster).ProcessDelta(); Effects.SendLocationParticles( EffectItem.Create(targetLoc, Caster.Map, EffectItem.DefaultDuration), diff --git a/Projects/UOContent/Spells/Sixth/ParalyzeField.cs b/Projects/UOContent/Spells/Sixth/ParalyzeField.cs index 14fd088d8..830f16dfe 100644 --- a/Projects/UOContent/Spells/Sixth/ParalyzeField.cs +++ b/Projects/UOContent/Spells/Sixth/ParalyzeField.cs @@ -57,8 +57,7 @@ public class ParalyzeFieldSpell : MagerySpell, ITargetingSpell continue; } - Item item = new ParalyzeField(Caster, itemID, targetLoc, Caster.Map, duration); - item.ProcessDelta(); + new ParalyzeField(Caster, itemID, targetLoc, Caster.Map, duration).ProcessDelta(); Effects.SendLocationParticles( EffectItem.Create(targetLoc, Caster.Map, EffectItem.DefaultDuration), diff --git a/Projects/UOContent/Targets/BladedItemTarget.cs b/Projects/UOContent/Targets/BladedItemTarget.cs index acb2e0101..c1d7b4c87 100644 --- a/Projects/UOContent/Targets/BladedItemTarget.cs +++ b/Projects/UOContent/Targets/BladedItemTarget.cs @@ -71,47 +71,43 @@ namespace Server.Targets } } - HarvestSystem system = Lumberjacking.System; + var system = Lumberjacking.System; var def = system.GetDefinition(); - if (!system.GetHarvestDetails(from, m_Item, targeted, out var tileID, out var map, out var loc, out var isLand)) + if (!system.GetHarvestDetails(from, m_Item, targeted, out var tileID, out var map, out var loc, out var isLand) + || !def.Validate(tileID, isLand)) { from.SendLocalizedMessage(500494); // You can't use a bladed item on that! + return; } - else if (!def.Validate(tileID, isLand)) + + var bank = def.GetBank(map, loc.X, loc.Y); + + if (bank == null) { - from.SendLocalizedMessage(500494); // You can't use a bladed item on that! + return; + } + + if (bank.Current < 5) + { + from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. } else { - var bank = def.GetBank(map, loc.X, loc.Y); + bank.Consume(5, from); - if (bank == null) - { - return; - } + var item = new Kindling(); - if (bank.Current < 5) + if (from.PlaceInBackpack(item)) { - from.SendLocalizedMessage(500493); // There's not enough wood here to harvest. + from.SendLocalizedMessage(500491); // You put some kindling into your backpack. + from.SendLocalizedMessage(500492); // An axe would probably get you more wood. } else { - bank.Consume(5, from); + from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! - Item item = new Kindling(); - - if (from.PlaceInBackpack(item)) - { - from.SendLocalizedMessage(500491); // You put some kindling into your backpack. - from.SendLocalizedMessage(500492); // An axe would probably get you more wood. - } - else - { - from.SendLocalizedMessage(500490); // You can't place any kindling into your backpack! - - item.Delete(); - } + item.Delete(); } } } diff --git a/Projects/UOContent/World Saves/AutoArchive.cs b/Projects/UOContent/World Saves/AutoArchive.cs index 43579cfe9..1c25d34cf 100755 --- a/Projects/UOContent/World Saves/AutoArchive.cs +++ b/Projects/UOContent/World Saves/AutoArchive.cs @@ -383,7 +383,7 @@ namespace Server.Saves _ => date }; - private static IEnumerable PathsByTimestampName(string path, bool files = false) + private static SortedDictionary.ValueCollection PathsByTimestampName(string path, bool files = false) { var allItems = files ? Directory.EnumerateFiles(path) : Directory.GetDirectories(path); var items = new SortedDictionary(new DescendingComparer());