chore: Fixes variable types for possible performance issues (#2172)
This commit is contained in:
parent
6d43f2549c
commit
da517f56c4
82 changed files with 332 additions and 343 deletions
|
|
@ -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} <s:{SourceContext}>{NewLine}{Exception}"
|
||||
))
|
||||
|
|
|
|||
|
|
@ -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<string> strings, string value)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public partial class DaemonBloodChest : MetalChest
|
|||
return;
|
||||
}
|
||||
|
||||
Item vial = new QuestDaemonBlood();
|
||||
var vial = new QuestDaemonBlood();
|
||||
|
||||
if (player.PlaceInBackpack(vial))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<Item>(Items);
|
||||
|
||||
foreach (var subItem in subItems)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -912,7 +912,7 @@ public partial class Corpse : Container, ICarvable
|
|||
var obj = qs.FindObjective<GetDaemonBoneObjective>();
|
||||
if (obj?.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
|
||||
{
|
||||
Item bone = new QuestDaemonBone();
|
||||
var bone = new QuestDaemonBone();
|
||||
|
||||
if (player.PlaceInBackpack(bone))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ namespace Server.Items;
|
|||
public partial class FlameSpurtTrap : BaseTrap
|
||||
{
|
||||
[SerializableField(0)]
|
||||
private Item _spurt;
|
||||
private Static _spurt;
|
||||
|
||||
private TimerExecutionToken _timerToken;
|
||||
|
||||
[Constructible]
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"properties": [
|
||||
{
|
||||
"name": "Spurt",
|
||||
"type": "Server.Item",
|
||||
"type": "Server.Items.Static",
|
||||
"rule": "SerializableInterfaceMigrationRule"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"properties": [
|
||||
{
|
||||
"name": "Queen",
|
||||
"type": "Server.Mobiles.BaseCreature",
|
||||
"type": "Server.Mobiles.Silvani",
|
||||
"rule": "SerializableInterfaceMigrationRule"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<Item>(Backpack.Items);
|
||||
foreach (var item in list)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Server.Mobiles
|
|||
|
||||
VirtualArmor = 16;
|
||||
|
||||
Container bag = new Bag();
|
||||
var bag = new Bag();
|
||||
|
||||
var count = Utility.RandomMinMax(10, 20);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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<byte> buffer = stackalloc byte[OutgoingMessagePackets.GetMaxMessageLength(text)].InitializePacket();
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1163,7 +1163,7 @@ namespace Server.Mobiles
|
|||
}
|
||||
|
||||
private static bool ProcessSinglePurchase(
|
||||
BuyItemResponse buy, IBuyItemInfo bii, List<BuyItemResponse> validBuy,
|
||||
BuyItemResponse buy, GenericBuyInfo bii, List<BuyItemResponse> 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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<Item>
|
|||
|
||||
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<AnimateMaabusCorpseObjective>();
|
||||
var objective = quest.FindObjective<AnimateMaabusCorpseObjective>();
|
||||
|
||||
if (objective?.Completed == false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@ public class EnergyFieldSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
|||
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),
|
||||
|
|
|
|||
|
|
@ -57,8 +57,7 @@ public class ParalyzeFieldSpell : MagerySpell, ITargetingSpell<IPoint3D>
|
|||
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),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ namespace Server.Saves
|
|||
_ => date
|
||||
};
|
||||
|
||||
private static IEnumerable<string> PathsByTimestampName(string path, bool files = false)
|
||||
private static SortedDictionary<DateTime, string>.ValueCollection PathsByTimestampName(string path, bool files = false)
|
||||
{
|
||||
var allItems = files ? Directory.EnumerateFiles(path) : Directory.GetDirectories(path);
|
||||
var items = new SortedDictionary<DateTime, string>(new DescendingComparer<DateTime>());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue