Fixes brace style (#248)
This commit is contained in:
parent
a236617ad9
commit
8149620b0c
1503 changed files with 28575 additions and 1717 deletions
|
|
@ -24,17 +24,27 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X, Y + 1, Z);
|
||||
}
|
||||
|
||||
if (m_Item2 != null)
|
||||
{
|
||||
m_Item2.Location = new Point3D(X, Y + 2, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
if (m_Item2 != null)
|
||||
{
|
||||
m_Item2.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -84,13 +94,17 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X, Y - 1, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -138,13 +152,17 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X, Y - 2, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -196,17 +214,27 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X + 1, Y, Z);
|
||||
}
|
||||
|
||||
if (m_Item2 != null)
|
||||
{
|
||||
m_Item2.Location = new Point3D(X + 2, Y, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
|
||||
if (m_Item2 != null)
|
||||
{
|
||||
m_Item2.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -256,13 +284,17 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X - 1, Y, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
@ -310,13 +342,17 @@ namespace Server.Items
|
|||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Location = new Point3D(X - 2, Y, Z);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
if (m_Item != null)
|
||||
{
|
||||
m_Item.Map = Map;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Parent != null || !VerifyMove(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.InRange(this, 2))
|
||||
{
|
||||
|
|
@ -31,9 +33,13 @@ namespace Server.Items
|
|||
var dir = PlayerMobile.GetDirection4(from.Location, Location);
|
||||
|
||||
if (dir == Direction.North || dir == Direction.South)
|
||||
{
|
||||
ItemID = 0xA55;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemID = 0xA56;
|
||||
}
|
||||
}
|
||||
else // unrolled
|
||||
{
|
||||
|
|
@ -44,7 +50,9 @@ namespace Server.Items
|
|||
var entry = Campfire.GetEntry(from);
|
||||
|
||||
if (entry?.Safe == true)
|
||||
from.SendGump(new LogoutGump(entry, this));
|
||||
{
|
||||
@from.SendGump(new LogoutGump(entry, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +111,9 @@ namespace Server.Items
|
|||
m_CloseTimer.Stop();
|
||||
|
||||
if (Campfire.GetEntry(pm) != m_Entry)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.ButtonID == 1 && m_Entry.Safe && m_Bedroll.Parent == null && m_Bedroll.IsAccessibleTo(pm)
|
||||
&& m_Bedroll.VerifyMove(pm) && m_Bedroll.Map == pm.Map && pm.InRange(m_Bedroll, 2))
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@ namespace Server.Items
|
|||
set
|
||||
{
|
||||
if (Status == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (value)
|
||||
{
|
||||
|
|
@ -96,16 +98,25 @@ namespace Server.Items
|
|||
var age = now - Created;
|
||||
|
||||
if (age >= TimeSpan.FromSeconds(100.0))
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else if (age >= TimeSpan.FromSeconds(90.0))
|
||||
{
|
||||
Status = CampfireStatus.Off;
|
||||
}
|
||||
else if (age >= TimeSpan.FromSeconds(60.0))
|
||||
{
|
||||
Status = CampfireStatus.Extinguishing;
|
||||
}
|
||||
|
||||
if (Status == CampfireStatus.Off || Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var entry in m_Entries.ToList())
|
||||
{
|
||||
if (!entry.Valid || entry.Player.NetState == null)
|
||||
{
|
||||
RemoveEntry(entry);
|
||||
|
|
@ -115,10 +126,12 @@ namespace Server.Items
|
|||
entry.Safe = true;
|
||||
entry.Player.SendLocalizedMessage(500621); // The camp is now secure.
|
||||
}
|
||||
}
|
||||
|
||||
var eable = GetClientsInRange(SecureRange);
|
||||
|
||||
foreach (var state in eable)
|
||||
{
|
||||
if (state.Mobile is PlayerMobile pm && GetEntry(pm) == null)
|
||||
{
|
||||
var entry = new CampfireEntry(pm, this);
|
||||
|
|
@ -128,6 +141,7 @@ namespace Server.Items
|
|||
|
||||
pm.SendLocalizedMessage(500620); // You feel it would take a few moments to secure your camp.
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
|
@ -135,10 +149,14 @@ namespace Server.Items
|
|||
private void ClearEntries()
|
||||
{
|
||||
if (m_Entries == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var entry in m_Entries.ToList())
|
||||
{
|
||||
RemoveEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!VerifyMove(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
|
|
@ -58,7 +60,9 @@ namespace Server.Items
|
|||
Consume();
|
||||
|
||||
if (!Deleted && Parent == null)
|
||||
from.PlaceInBackpack(this);
|
||||
{
|
||||
@from.PlaceInBackpack(this);
|
||||
}
|
||||
|
||||
new Campfire().MoveToWorld(fireLocation, from.Map);
|
||||
}
|
||||
|
|
@ -67,10 +71,14 @@ namespace Server.Items
|
|||
private Point3D GetFireLocation(Mobile from)
|
||||
{
|
||||
if (from.Region.IsPartOf<DungeonRegion>())
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
if (Parent == null)
|
||||
{
|
||||
return Location;
|
||||
}
|
||||
|
||||
var list = new List<Point3D>(4);
|
||||
|
||||
|
|
@ -80,7 +88,9 @@ namespace Server.Items
|
|||
AddOffsetLocation(from, 1, 0, list);
|
||||
|
||||
if (list.Count == 0)
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
return list.RandomElement();
|
||||
}
|
||||
|
|
@ -103,7 +113,9 @@ namespace Server.Items
|
|||
loc = new Point3D(x, y, map.GetAverageZ(x, y));
|
||||
|
||||
if (map.CanFit(loc, 1) && from.InLOS(loc))
|
||||
{
|
||||
list.Add(loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.YewWood)
|
||||
{
|
||||
return 1075052 + ((int)m_Resource - (int)CraftResource.OakWood);
|
||||
}
|
||||
|
||||
return m_Resource switch
|
||||
{
|
||||
|
|
@ -66,9 +68,13 @@ namespace Server.Items
|
|||
var num = CraftResources.GetLocalizationNumber(m_Resource);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(CraftResources.GetName(m_Resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -98,10 +104,14 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version == 0 && Weight == 0.1 || version <= 2 && Weight == 2)
|
||||
{
|
||||
Weight = -1;
|
||||
}
|
||||
|
||||
if (version <= 1)
|
||||
{
|
||||
m_Resource = CraftResource.RegularWood;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,9 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Kit.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var corpse = targeted as Corpse;
|
||||
|
||||
|
|
@ -114,7 +116,9 @@ namespace Server.Items
|
|||
foreach (var t in m_Table)
|
||||
{
|
||||
if (t.CreatureType != obj.GetType())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var pack = from.Backpack;
|
||||
|
||||
|
|
@ -139,7 +143,9 @@ namespace Server.Items
|
|||
from.AddToBackpack(new TrophyDeed(t, hunter, weight));
|
||||
|
||||
if (corpse != null)
|
||||
{
|
||||
corpse.VisitedByTaxidermist = true;
|
||||
}
|
||||
|
||||
m_Kit.Delete();
|
||||
return;
|
||||
|
|
@ -233,10 +239,15 @@ namespace Server.Items
|
|||
public bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
if (!map.CanFit(p.X, p.Y, p.Z, ItemData.Height))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ItemID == NorthID)
|
||||
{
|
||||
return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // North wall
|
||||
}
|
||||
|
||||
return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // West wall
|
||||
}
|
||||
|
||||
|
|
@ -249,7 +260,9 @@ namespace Server.Items
|
|||
if (m_AnimalWeight >= 20)
|
||||
{
|
||||
if (m_Hunter != null)
|
||||
{
|
||||
list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~
|
||||
}
|
||||
|
||||
list.Add(1070858, m_AnimalWeight.ToString()); // ~1_weight~ stones
|
||||
}
|
||||
|
|
@ -300,7 +313,9 @@ namespace Server.Items
|
|||
private void FixMovingCrate()
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Movable || IsLockedDown)
|
||||
{
|
||||
|
|
@ -420,7 +435,9 @@ namespace Server.Items
|
|||
if (m_AnimalWeight >= 20)
|
||||
{
|
||||
if (m_Hunter != null)
|
||||
{
|
||||
list.Add(1070857, m_Hunter.Name); // Caught by ~1_fisherman~
|
||||
}
|
||||
|
||||
list.Add(1070858, m_AnimalWeight.ToString()); // ~1_weight~ stones
|
||||
}
|
||||
|
|
@ -478,7 +495,8 @@ namespace Server.Items
|
|||
var westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map);
|
||||
|
||||
if (northWall && westWall)
|
||||
switch (from.Direction & Direction.Mask)
|
||||
{
|
||||
switch (@from.Direction & Direction.Mask)
|
||||
{
|
||||
case Direction.North:
|
||||
case Direction.South:
|
||||
|
|
@ -491,18 +509,25 @@ namespace Server.Items
|
|||
break;
|
||||
|
||||
default:
|
||||
from.SendMessage("Turn to face the wall on which to hang this trophy.");
|
||||
@from.SendMessage("Turn to face the wall on which to hang this trophy.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var itemID = 0;
|
||||
|
||||
if (northWall)
|
||||
{
|
||||
itemID = NorthID;
|
||||
}
|
||||
else if (westWall)
|
||||
{
|
||||
itemID = WestID;
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
|
||||
{
|
||||
@from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
|
||||
}
|
||||
|
||||
if (itemID > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,9 +23,13 @@ namespace Server.Items
|
|||
var loc = GetWorldLocation();
|
||||
|
||||
if (!from.InLOS(loc) || !from.InRange(loc, 2))
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
|
||||
{
|
||||
@from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
|
||||
}
|
||||
else
|
||||
Fishing.System.BeginHarvesting(from, this);
|
||||
{
|
||||
Fishing.System.BeginHarvesting(@from, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
|
|
@ -38,7 +42,9 @@ namespace Server.Items
|
|||
public override bool CheckConflictingLayer(Mobile m, Item item, Layer layer)
|
||||
{
|
||||
if (base.CheckConflictingLayer(m, item, layer))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (layer == Layer.OneHanded)
|
||||
{
|
||||
|
|
@ -63,7 +69,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version < 1 && Layer == Layer.OneHanded)
|
||||
{
|
||||
Layer = Layer.TwoHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ namespace Server.Items
|
|||
public static int GetRandomLevel()
|
||||
{
|
||||
if (Core.AOS && Utility.Random(25) < 1)
|
||||
{
|
||||
return 4; // ancient
|
||||
}
|
||||
|
||||
return Utility.RandomMinMax(1, 3);
|
||||
}
|
||||
|
|
@ -82,10 +84,14 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version < 2)
|
||||
{
|
||||
m_Level = GetRandomLevel();
|
||||
}
|
||||
|
||||
if (version < 3 && TargetMap == Map.Tokuno)
|
||||
{
|
||||
TargetMap = Map.Trammel;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (IsAncient)
|
||||
{
|
||||
return 1063450; // an ancient SOS
|
||||
}
|
||||
|
||||
return 1041081; // a waterstained SOS
|
||||
}
|
||||
|
|
@ -81,9 +83,13 @@ namespace Server.Items
|
|||
public void UpdateHue()
|
||||
{
|
||||
if (IsAncient)
|
||||
{
|
||||
Hue = 0x481;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
@ -127,7 +133,9 @@ namespace Server.Items
|
|||
TargetMap = Map;
|
||||
|
||||
if (TargetMap == null || TargetMap == Map.Internal)
|
||||
{
|
||||
TargetMap = Map.Trammel;
|
||||
}
|
||||
|
||||
TargetLocation = FindLocation(TargetMap);
|
||||
MessageIndex = Utility.Random(MessageEntry.Entries.Length);
|
||||
|
|
@ -137,13 +145,19 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version < 2)
|
||||
{
|
||||
m_Level = MessageInABottle.GetRandomLevel();
|
||||
}
|
||||
|
||||
if (version < 3)
|
||||
{
|
||||
UpdateHue();
|
||||
}
|
||||
|
||||
if (version < 4 && TargetMap == Map.Tokuno)
|
||||
{
|
||||
TargetMap = Map.Trammel;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
@ -153,9 +167,13 @@ namespace Server.Items
|
|||
MessageEntry entry;
|
||||
|
||||
if (MessageIndex >= 0 && MessageIndex < MessageEntry.Entries.Length)
|
||||
{
|
||||
entry = MessageEntry.Entries[MessageIndex];
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = MessageEntry.Entries[MessageIndex = Utility.Random(MessageEntry.Entries.Length)];
|
||||
}
|
||||
|
||||
// from.CloseGump( typeof( MessageGump ) );
|
||||
from.SendGump(new MessageGump(entry, TargetMap, TargetLocation));
|
||||
|
|
@ -169,21 +187,33 @@ namespace Server.Items
|
|||
public static Point3D FindLocation(Map map)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
Rectangle2D[] regions;
|
||||
|
||||
if (map == Map.Felucca || map == Map.Trammel)
|
||||
{
|
||||
regions = m_BritRegions;
|
||||
}
|
||||
else if (map == Map.Ilshenar)
|
||||
{
|
||||
regions = m_IlshRegions;
|
||||
}
|
||||
else if (map == Map.Malas)
|
||||
{
|
||||
regions = m_MalasRegions;
|
||||
}
|
||||
else
|
||||
{
|
||||
regions = new[] { new Rectangle2D(0, 0, map.Width, map.Height) };
|
||||
}
|
||||
|
||||
if (regions.Length == 0)
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
for (var i = 0; i < 50; ++i)
|
||||
{
|
||||
|
|
@ -192,22 +222,36 @@ namespace Server.Items
|
|||
var y = Utility.Random(reg.Y, reg.Height);
|
||||
|
||||
if (!ValidateDeepWater(map, x, y))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var valid = true;
|
||||
|
||||
for (int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5)
|
||||
{
|
||||
if (!ValidateDeepWater(map, x + offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x + offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (valid)
|
||||
{
|
||||
return new Point3D(x, y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return Point3D.Zero;
|
||||
|
|
@ -219,7 +263,9 @@ namespace Server.Items
|
|||
var water = false;
|
||||
|
||||
for (var i = 0; !water && i < m_WaterTiles.Length; i += 2)
|
||||
{
|
||||
water = tileID >= m_WaterTiles[i] && tileID <= m_WaterTiles[i + 1];
|
||||
}
|
||||
|
||||
return water;
|
||||
}
|
||||
|
|
@ -234,9 +280,13 @@ namespace Server.Items
|
|||
string fmt;
|
||||
|
||||
if (Sextant.Format(loc, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
|
||||
{
|
||||
fmt = $"{yLat}°{yMins}'{(ySouth ? "S" : "N")},{xLong}°{xMins}'{(xEast ? "E" : "W")}";
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt = "?????";
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -83,32 +83,48 @@ namespace Server.Items
|
|||
public static Point3D ReverseLookup(Map map, int xLong, int yLat, int xMins, int yMins, bool xEast, bool ySouth)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
if (!ComputeMapDetails(map, 0, 0, out var xCenter, out var yCenter, out var xWidth, out var yHeight))
|
||||
{
|
||||
return Point3D.Zero;
|
||||
}
|
||||
|
||||
var absLong = xLong + (double)xMins / 60;
|
||||
var absLat = yLat + (double)yMins / 60;
|
||||
|
||||
if (!xEast)
|
||||
{
|
||||
absLong = 360.0 - absLong;
|
||||
}
|
||||
|
||||
if (!ySouth)
|
||||
{
|
||||
absLat = 360.0 - absLat;
|
||||
}
|
||||
|
||||
var x = xCenter + (int)(absLong * xWidth / 360);
|
||||
var y = yCenter + (int)(absLat * yHeight / 360);
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
x += xWidth;
|
||||
}
|
||||
else if (x >= xWidth)
|
||||
{
|
||||
x -= xWidth;
|
||||
}
|
||||
|
||||
if (y < 0)
|
||||
{
|
||||
y += yHeight;
|
||||
}
|
||||
else if (y >= yHeight)
|
||||
{
|
||||
y -= yHeight;
|
||||
}
|
||||
|
||||
var z = map.GetAverageZ(x, y);
|
||||
|
||||
|
|
@ -121,29 +137,41 @@ namespace Server.Items
|
|||
)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
|
||||
if (!ComputeMapDetails(map, x, y, out var xCenter, out var yCenter, out var xWidth, out var yHeight))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var absLong = (double)((x - xCenter) * 360) / xWidth;
|
||||
var absLat = (double)((y - yCenter) * 360) / yHeight;
|
||||
|
||||
if (absLong > 180.0)
|
||||
{
|
||||
absLong = -180.0 + absLong % 180.0;
|
||||
}
|
||||
|
||||
if (absLat > 180.0)
|
||||
{
|
||||
absLat = -180.0 + absLat % 180.0;
|
||||
}
|
||||
|
||||
bool east = absLong >= 0, south = absLat >= 0;
|
||||
|
||||
if (absLong < 0.0)
|
||||
{
|
||||
absLong = -absLong;
|
||||
}
|
||||
|
||||
if (absLat < 0.0)
|
||||
{
|
||||
absLat = -absLat;
|
||||
}
|
||||
|
||||
xLong = (int)absLong;
|
||||
yLat = (int)absLat;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ namespace Server.Items
|
|||
var weight = ItemData.Weight;
|
||||
|
||||
if (weight >= 255)
|
||||
{
|
||||
weight = 1;
|
||||
}
|
||||
|
||||
Weight = weight;
|
||||
}
|
||||
|
|
@ -24,7 +26,9 @@ namespace Server.Items
|
|||
public bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ItemID >= 0x13A4 && ItemID <= 0x13AE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,9 +43,13 @@ namespace Server.Items
|
|||
Weight = 1.0;
|
||||
|
||||
if (Utility.RandomDouble() < 0.01)
|
||||
{
|
||||
Hue = m_Hues.RandomElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
Hue = 0x8A0;
|
||||
}
|
||||
}
|
||||
|
||||
public SpecialFishingNet(Serial serial) : base(serial)
|
||||
|
|
@ -94,7 +98,9 @@ namespace Server.Items
|
|||
InUse = reader.ReadBool();
|
||||
|
||||
if (InUse)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -123,15 +129,21 @@ namespace Server.Items
|
|||
public void OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (Deleted || InUse)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(obj is IPoint3D p3D))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var map = from.Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int x = p3D.X, y = p3D.Y, z = map.GetAverageZ(x, y); // OSI just takes the targeted Z
|
||||
|
||||
|
|
@ -150,8 +162,12 @@ namespace Server.Items
|
|||
var p = new Point3D(x, y, z);
|
||||
|
||||
if (GetType() == typeof(SpecialFishingNet))
|
||||
{
|
||||
for (var i = 1; i < Amount; ++i) // these were stackable before, doh
|
||||
from.AddToBackpack(new SpecialFishingNet());
|
||||
{
|
||||
@from.AddToBackpack(new SpecialFishingNet());
|
||||
}
|
||||
}
|
||||
|
||||
InUse = true;
|
||||
Movable = false;
|
||||
|
|
@ -191,7 +207,9 @@ namespace Server.Items
|
|||
private void DoEffect(Mobile from, Point3D p, int index)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (index == 1)
|
||||
{
|
||||
|
|
@ -201,6 +219,7 @@ namespace Server.Items
|
|||
else if (index <= 7 || index == 14)
|
||||
{
|
||||
if (RequireDeepWater)
|
||||
{
|
||||
for (var i = 0; i < 3; ++i)
|
||||
{
|
||||
int x, y;
|
||||
|
|
@ -244,16 +263,25 @@ namespace Server.Items
|
|||
|
||||
Effects.SendLocationEffect(new Point3D(p.X + x, p.Y + y, p.Z), Map, 0x352D, 16, 4);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Effects.SendLocationEffect(p, Map, 0x352D, 16, 4);
|
||||
}
|
||||
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
Effects.PlaySound(p, Map, 0x364);
|
||||
}
|
||||
|
||||
if (index == 14)
|
||||
FinishEffect(p, Map, from);
|
||||
{
|
||||
FinishEffect(p, Map, @from);
|
||||
}
|
||||
else
|
||||
{
|
||||
Z -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +290,9 @@ namespace Server.Items
|
|||
var count = Utility.RandomMinMax(1, 3);
|
||||
|
||||
if (Hue != 0x8A0)
|
||||
{
|
||||
count += Utility.RandomMinMax(1, 2);
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
@ -296,7 +326,9 @@ namespace Server.Items
|
|||
spawn.MoveToWorld(new Point3D(x, y, p.Z), map);
|
||||
|
||||
if (spawn is Kraken && Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
spawn.PackItem(new MessageInABottle(map == Map.Felucca ? Map.Felucca : Map.Trammel));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void FinishEffect(Point3D p, Map map, Mobile from)
|
||||
|
|
@ -329,14 +361,24 @@ namespace Server.Items
|
|||
var valid = ValidateDeepWater(map, x, y);
|
||||
|
||||
for (int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5)
|
||||
{
|
||||
if (!ValidateDeepWater(map, x + offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x + offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y + offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
else if (!ValidateDeepWater(map, x - offset, y - offset))
|
||||
{
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
|
@ -347,7 +389,9 @@ namespace Server.Items
|
|||
var water = false;
|
||||
|
||||
for (var i = 0; !water && i < m_WaterTiles.Length; i += 2)
|
||||
{
|
||||
water = tileID >= m_WaterTiles[i] && tileID <= m_WaterTiles[i + 1];
|
||||
}
|
||||
|
||||
return water;
|
||||
}
|
||||
|
|
@ -355,21 +399,27 @@ namespace Server.Items
|
|||
private static bool ValidateUndeepWater(Map map, object obj, ref int z)
|
||||
{
|
||||
if (!(obj is StaticTarget))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var target = (StaticTarget)obj;
|
||||
|
||||
if (BaseHouse.FindHouseAt(target.Location, map, 0) != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var itemID = target.ItemID;
|
||||
|
||||
for (var i = 0; i < m_UndeepWaterTiles.Length; i += 2)
|
||||
{
|
||||
if (itemID >= m_UndeepWaterTiles[i] && itemID <= m_UndeepWaterTiles[i + 1])
|
||||
{
|
||||
z = target.Z;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ namespace Server.Items
|
|||
Quality = (ToolQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
|
@ -100,7 +102,9 @@ namespace Server.Items
|
|||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ToolQuality.Exceptional)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
|
@ -114,7 +118,9 @@ namespace Server.Items
|
|||
// list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
if (m_Quality == ToolQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
|
@ -134,9 +140,13 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
HarvestSystem.BeginHarvesting(from, this);
|
||||
{
|
||||
HarvestSystem.BeginHarvesting(@from, this);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
{
|
||||
@from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
|
|
@ -149,13 +159,19 @@ namespace Server.Items
|
|||
public static void AddContextMenuEntries(Mobile from, Item item, List<ContextMenuEntry> list, HarvestSystem system)
|
||||
{
|
||||
if (system != Mining.System)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!item.IsChildOf(from.Backpack) && item.Parent != from)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(from is PlayerMobile pm))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var miningEntry = new ContextMenuEntry(pm.ToggleMiningStone ? 6179 : 6178);
|
||||
miningEntry.Color = 0x421F;
|
||||
|
|
@ -212,7 +228,9 @@ namespace Server.Items
|
|||
var stoneMining = mobile.StoneMining && mobile.Skills.Mining.Base >= 100.0;
|
||||
|
||||
if (mobile.ToggleMiningStone == value || value && !stoneMining)
|
||||
{
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Hue == 0x973)
|
||||
{
|
||||
Hue = 0x0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,9 +54,13 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
from.Target = new InternalTarget(this);
|
||||
{
|
||||
@from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
{
|
||||
@from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void Prospect(Mobile from, object toProspect)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ namespace Server.Items
|
|||
public virtual bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 0, new Board()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -66,9 +68,13 @@ namespace Server.Items
|
|||
var num = CraftResources.GetLocalizationNumber(m_Resource);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(CraftResources.GetName(m_Resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -97,13 +103,18 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
m_Resource = CraftResource.RegularWood;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool TryCreateBoards(Mobile from, double skill, Item item)
|
||||
{
|
||||
if (Deleted || !from.CanSee(this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (from.Skills.Carpentry.Value < skill &&
|
||||
from.Skills.Lumberjacking.Value < skill)
|
||||
{
|
||||
|
|
@ -146,7 +157,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 100, new HeartwoodBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -182,7 +195,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 100, new BloodwoodBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -218,7 +233,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 100, new FrostwoodBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -254,7 +271,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 65, new OakBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -290,7 +309,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 80, new AshBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -326,7 +347,9 @@ namespace Server.Items
|
|||
public override bool Axe(Mobile from, BaseAxe axe)
|
||||
{
|
||||
if (!TryCreateBoards(from, 95, new YewBoard()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,18 +45,26 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.Player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
CheckGate(from, 1);
|
||||
{
|
||||
CheckGate(@from, 1);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
{
|
||||
@from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (m.Player)
|
||||
{
|
||||
CheckGate(m, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -64,7 +72,9 @@ namespace Server.Items
|
|||
public virtual void CheckGate(Mobile m, int range)
|
||||
{
|
||||
if (m.Hidden && m.AccessLevel == AccessLevel.Player && Core.ML)
|
||||
{
|
||||
m.RevealingAction();
|
||||
}
|
||||
|
||||
new DelayTimer(m, this, range).Start();
|
||||
}
|
||||
|
|
@ -103,7 +113,9 @@ namespace Server.Items
|
|||
m.MoveToWorld(Target, TargetMap);
|
||||
|
||||
if (m.AccessLevel == AccessLevel.Player || !m.Hidden)
|
||||
{
|
||||
m.PlaySound(0x1FE);
|
||||
}
|
||||
|
||||
OnGateUsed(m);
|
||||
}
|
||||
|
|
@ -136,18 +148,24 @@ namespace Server.Items
|
|||
TargetMap = reader.ReadMap();
|
||||
|
||||
if (version >= 1)
|
||||
{
|
||||
Dispellable = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse(Mobile from, bool message)
|
||||
{
|
||||
if (from.Deleted || Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (from.Map != Map || !from.InRange(this, 1))
|
||||
{
|
||||
if (message)
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
{
|
||||
@from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -161,7 +179,10 @@ namespace Server.Items
|
|||
from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning)
|
||||
{
|
||||
if (from.AccessLevel == AccessLevel.Player || !from.Hidden)
|
||||
from.Send(new PlaySound(0x20E, from.Location));
|
||||
{
|
||||
@from.Send(new PlaySound(0x20E, @from.Location));
|
||||
}
|
||||
|
||||
from.CloseGump<MoongateConfirmGump>();
|
||||
from.SendGump(new MoongateConfirmGump(from, this));
|
||||
}
|
||||
|
|
@ -174,7 +195,9 @@ namespace Server.Items
|
|||
public virtual void EndConfirmation(Mobile from)
|
||||
{
|
||||
if (!ValidateUse(from, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UseGate(from);
|
||||
}
|
||||
|
|
@ -182,12 +205,18 @@ namespace Server.Items
|
|||
public virtual void DelayCallback(Mobile from, int range)
|
||||
{
|
||||
if (!ValidateUse(from, false) || !from.InRange(this, range))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (TargetMap != null)
|
||||
BeginConfirmation(from);
|
||||
{
|
||||
BeginConfirmation(@from);
|
||||
}
|
||||
else
|
||||
from.SendMessage("This moongate does not seem to go anywhere.");
|
||||
{
|
||||
@from.SendMessage("This moongate does not seem to go anywhere.");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInTown(Point3D p, Map map) =>
|
||||
|
|
@ -253,7 +282,9 @@ namespace Server.Items
|
|||
public virtual void Warning_Callback(Mobile from, bool okay)
|
||||
{
|
||||
if (okay)
|
||||
EndConfirmation(from);
|
||||
{
|
||||
EndConfirmation(@from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void BeginConfirmation(Mobile from)
|
||||
|
|
@ -351,6 +382,7 @@ namespace Server.Items
|
|||
AddAlphaRegion(10, 40, 400, 200);
|
||||
|
||||
if (from.Map != Map.Felucca && gate.TargetMap == Map.Felucca && gate.ShowFeluccaWarning)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
10,
|
||||
40,
|
||||
|
|
@ -361,7 +393,9 @@ namespace Server.Items
|
|||
false,
|
||||
true
|
||||
); // This Gate goes to Felucca... Continue to enter the gate, Cancel to stay here
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
10,
|
||||
40,
|
||||
|
|
@ -372,6 +406,7 @@ namespace Server.Items
|
|||
false,
|
||||
true
|
||||
); // Dost thou wish to step into the moongate? Continue to enter the gate, Cancel to stay here
|
||||
}
|
||||
|
||||
AddImageTiled(10, 250, 400, 20, 2624);
|
||||
AddAlphaRegion(10, 250, 400, 20);
|
||||
|
|
@ -408,7 +443,9 @@ namespace Server.Items
|
|||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
m_Gate.EndConfirmation(m_From);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_Held > 0 && (int)m_Type >= (int)PotionEffect.Conflagration)
|
||||
{
|
||||
return 1072658 + (int)m_Type - (int)PotionEffect.Conflagration;
|
||||
}
|
||||
|
||||
return m_Held > 0 ? 1041620 + (int)m_Type : 1041641;
|
||||
}
|
||||
|
|
@ -91,7 +93,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version < 1)
|
||||
{
|
||||
Timer.DelayCall(UpdateWeight);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
|
|
@ -101,29 +105,53 @@ namespace Server.Items
|
|||
int number;
|
||||
|
||||
if (m_Held <= 0)
|
||||
{
|
||||
number = 502246; // The keg is empty.
|
||||
}
|
||||
else if (m_Held < 5)
|
||||
{
|
||||
number = 502248; // The keg is nearly empty.
|
||||
}
|
||||
else if (m_Held < 20)
|
||||
{
|
||||
number = 502249; // The keg is not very full.
|
||||
}
|
||||
else if (m_Held < 30)
|
||||
{
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
}
|
||||
else if (m_Held < 40)
|
||||
{
|
||||
number = 502251; // The keg is about one third full.
|
||||
}
|
||||
else if (m_Held < 47)
|
||||
{
|
||||
number = 502252; // The keg is almost half full.
|
||||
}
|
||||
else if (m_Held < 54)
|
||||
{
|
||||
number = 502254; // The keg is approximately half full.
|
||||
}
|
||||
else if (m_Held < 70)
|
||||
{
|
||||
number = 502253; // The keg is more than half full.
|
||||
}
|
||||
else if (m_Held < 80)
|
||||
{
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
}
|
||||
else if (m_Held < 96)
|
||||
{
|
||||
number = 502256; // The keg is very full.
|
||||
}
|
||||
else if (m_Held < 100)
|
||||
{
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 502258; // The keg is completely full.
|
||||
}
|
||||
|
||||
list.Add(number);
|
||||
}
|
||||
|
|
@ -135,29 +163,53 @@ namespace Server.Items
|
|||
int number;
|
||||
|
||||
if (m_Held <= 0)
|
||||
{
|
||||
number = 502246; // The keg is empty.
|
||||
}
|
||||
else if (m_Held < 5)
|
||||
{
|
||||
number = 502248; // The keg is nearly empty.
|
||||
}
|
||||
else if (m_Held < 20)
|
||||
{
|
||||
number = 502249; // The keg is not very full.
|
||||
}
|
||||
else if (m_Held < 30)
|
||||
{
|
||||
number = 502250; // The keg is about one quarter full.
|
||||
}
|
||||
else if (m_Held < 40)
|
||||
{
|
||||
number = 502251; // The keg is about one third full.
|
||||
}
|
||||
else if (m_Held < 47)
|
||||
{
|
||||
number = 502252; // The keg is almost half full.
|
||||
}
|
||||
else if (m_Held < 54)
|
||||
{
|
||||
number = 502254; // The keg is approximately half full.
|
||||
}
|
||||
else if (m_Held < 70)
|
||||
{
|
||||
number = 502253; // The keg is more than half full.
|
||||
}
|
||||
else if (m_Held < 80)
|
||||
{
|
||||
number = 502255; // The keg is about three quarters full.
|
||||
}
|
||||
else if (m_Held < 96)
|
||||
{
|
||||
number = 502256; // The keg is very full.
|
||||
}
|
||||
else if (m_Held < 100)
|
||||
{
|
||||
number = 502257; // The liquid is almost to the top of the keg.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 502258; // The keg is completely full.
|
||||
}
|
||||
|
||||
LabelTo(from, number);
|
||||
}
|
||||
|
|
@ -182,7 +234,9 @@ namespace Server.Items
|
|||
from.PlaySound(0x240);
|
||||
|
||||
if (--Held == 0)
|
||||
from.SendLocalizedMessage(502245); // The keg is now empty.
|
||||
{
|
||||
@from.SendLocalizedMessage(502245); // The keg is now empty.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -238,7 +292,9 @@ namespace Server.Items
|
|||
pot.Consume(toHold);
|
||||
|
||||
if (!pot.Deleted)
|
||||
pot.Bounce(from);
|
||||
{
|
||||
pot.Bounce(@from);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -266,7 +322,9 @@ namespace Server.Items
|
|||
pot.Consume(toHold);
|
||||
|
||||
if (!pot.Deleted)
|
||||
pot.Bounce(from);
|
||||
{
|
||||
pot.Bounce(@from);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_House?.Deleted == true)
|
||||
{
|
||||
House = null;
|
||||
}
|
||||
|
||||
return m_House;
|
||||
}
|
||||
|
|
@ -137,17 +139,29 @@ namespace Server.Items
|
|||
private void CalculateHue()
|
||||
{
|
||||
if (!m_Marked)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
Hue = House != null ? 0x47F : 50;
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
Hue = House != null ? 0x66D : 0;
|
||||
}
|
||||
else if (m_TargetMap == Map.Ilshenar)
|
||||
{
|
||||
Hue = House != null ? 0x55F : 1102;
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
Hue = House != null ? 0x55F : 1102;
|
||||
}
|
||||
else if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
Hue = House != null ? 0x47F : 1154;
|
||||
}
|
||||
}
|
||||
|
||||
public void Mark(Mobile m)
|
||||
|
|
@ -179,7 +193,9 @@ namespace Server.Items
|
|||
var map = m_House.Map;
|
||||
|
||||
if (map?.CanFit(x, y, z, 16, false, false) == false)
|
||||
{
|
||||
z = map.GetAverageZ(x, y);
|
||||
}
|
||||
|
||||
Target = new Point3D(x, y, z);
|
||||
m_TargetMap = map;
|
||||
|
|
@ -193,7 +209,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (!setDesc)
|
||||
{
|
||||
m_Description = BaseRegion.GetRuneNameFor(Region.Find(Target, m_TargetMap));
|
||||
}
|
||||
|
||||
CalculateHue();
|
||||
InvalidateProperties();
|
||||
|
|
@ -208,18 +226,30 @@ namespace Server.Items
|
|||
string desc;
|
||||
|
||||
if ((desc = m_Description) == null || (desc = desc.Trim()).Length == 0)
|
||||
{
|
||||
desc = "an unknown location";
|
||||
}
|
||||
|
||||
if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
list.Add(House != null ? 1063260 : 1063259, RuneFormat, desc); // ~1_val~ (Tokuno Islands)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
list.Add(House != null ? 1062454 : 1060804, RuneFormat, desc); // ~1_val~ (Malas)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
list.Add(House != null ? 1062452 : 1060805, RuneFormat, desc); // ~1_val~ (Felucca)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
list.Add(House != null ? 1062453 : 1060806, RuneFormat, desc); // ~1_val~ (Trammel)[(House)]
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(House != null ? "{0} ({1})(House)" : "{0} ({1})", string.Format(RuneFormat, desc), m_TargetMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -230,36 +260,46 @@ namespace Server.Items
|
|||
var desc = m_Description?.Trim().IsNullOrDefault("an unknown location");
|
||||
|
||||
if (m_TargetMap == Map.Tokuno)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1063260 : 1063259,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Tokuno Islands)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Malas)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062454 : 1060804,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Malas)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Felucca)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062452 : 1060805,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Felucca)[(House)]
|
||||
}
|
||||
else if (m_TargetMap == Map.Trammel)
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? 1062453 : 1060806,
|
||||
string.Format(RuneFormat, desc)
|
||||
); // ~1_val~ (Trammel)[(House)]
|
||||
}
|
||||
else
|
||||
{
|
||||
LabelTo(
|
||||
from,
|
||||
@from,
|
||||
House != null ? "{0} ({1})(House)" : "{0} ({1})",
|
||||
string.Format(RuneFormat, desc),
|
||||
m_TargetMap
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Core.ML)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ namespace Server.Items
|
|||
if (pack != null)
|
||||
{
|
||||
if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var kegs = pack.FindItemsByType<PotionKeg>();
|
||||
|
||||
|
|
@ -96,10 +98,14 @@ namespace Server.Items
|
|||
// continue;
|
||||
|
||||
if (keg.Held <= 0 || keg.Held >= 100)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (keg.Type != PotionEffect)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
++keg.Held;
|
||||
|
||||
|
|
@ -120,10 +126,14 @@ namespace Server.Items
|
|||
var handTwo = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (handTwo is BaseWeapon)
|
||||
{
|
||||
handOne = handTwo;
|
||||
}
|
||||
|
||||
if (handTwo is BaseRanged ranged && ranged.Balanced)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return handOne == null || handTwo == null;
|
||||
}
|
||||
|
|
@ -131,7 +141,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!Movable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
{
|
||||
|
|
@ -144,9 +156,14 @@ namespace Server.Items
|
|||
Amount--;
|
||||
|
||||
if (from.Backpack?.Deleted != false)
|
||||
from.Backpack.DropItem(pot);
|
||||
{
|
||||
@from.Backpack.DropItem(pot);
|
||||
}
|
||||
else
|
||||
pot.MoveToWorld(from.Location, from.Map);
|
||||
{
|
||||
pot.MoveToWorld(@from.Location, @from.Map);
|
||||
}
|
||||
|
||||
pot.Drink(from);
|
||||
}
|
||||
else
|
||||
|
|
@ -191,7 +208,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void Drink(Mobile from);
|
||||
|
|
@ -203,10 +222,14 @@ namespace Server.Items
|
|||
m.PlaySound(0x2D6);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(m))
|
||||
{
|
||||
m.AddToBackpack(new Bottle());
|
||||
}
|
||||
|
||||
if (m.Body.IsHuman && !m.Mounted)
|
||||
{
|
||||
m.Animate(34, 5, 1, true, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static int EnhancePotions(Mobile m)
|
||||
|
|
@ -215,7 +238,9 @@ namespace Server.Items
|
|||
var skillBonus = m.Skills.Alchemy.Fixed / 330 * 10;
|
||||
|
||||
if (Core.ML && EP > 50 && m.AccessLevel <= AccessLevel.Player)
|
||||
{
|
||||
EP = 50;
|
||||
}
|
||||
|
||||
return EP + skillBonus;
|
||||
}
|
||||
|
|
@ -223,7 +248,9 @@ namespace Server.Items
|
|||
public static TimeSpan Scale(Mobile m, TimeSpan v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
var scalar = 1.0 + 0.01 * EnhancePotions(m);
|
||||
|
||||
|
|
@ -233,7 +260,9 @@ namespace Server.Items
|
|||
public static double Scale(Mobile m, double v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
var scalar = 1.0 + 0.01 * EnhancePotions(m);
|
||||
|
||||
|
|
@ -243,7 +272,9 @@ namespace Server.Items
|
|||
public static int Scale(Mobile m, int v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
return AOS.Scale(v, 100 + EnhancePotions(m));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,16 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
{
|
||||
m_Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
|
@ -68,26 +72,36 @@ namespace Server.Items
|
|||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (var i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
{
|
||||
Target.Cancel(@from);
|
||||
}
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x20C);
|
||||
|
||||
for (var i = -2; i <= 2; i++)
|
||||
{
|
||||
for (var j = -2; j <= 2; j++)
|
||||
{
|
||||
var p = new Point3D(loc.X + i, loc.Y + j, loc.Z);
|
||||
|
||||
if (map.CanFit(p, 12, true, false) && from.InLOS(p))
|
||||
new InternalItem(from, p, map, MinDamage, MaxDamage);
|
||||
if (map.CanFit(p, 12, true, false) && @from.InLOS(p))
|
||||
{
|
||||
new InternalItem(@from, p, map, MinDamage, MaxDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddDelay(Mobile m)
|
||||
|
|
@ -100,7 +114,9 @@ namespace Server.Items
|
|||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > DateTime.UtcNow)
|
||||
{
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -122,10 +138,14 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p) || from.Map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Add delay
|
||||
AddDelay(from);
|
||||
|
|
@ -137,9 +157,13 @@ namespace Server.Items
|
|||
IEntity to;
|
||||
|
||||
if (p is Mobile mobile)
|
||||
{
|
||||
to = mobile;
|
||||
}
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
{
|
||||
to = new Entity(Serial.Zero, new Point3D(p), @from.Map);
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.5), Potion.Explode, from, new Point3D(p), from.Map);
|
||||
|
|
@ -196,7 +220,9 @@ namespace Server.Items
|
|||
m_MaxDamage = max;
|
||||
|
||||
if (From == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var alchemySkill = From.Skills.Alchemy.Fixed;
|
||||
var alchemyBonus = alchemySkill / 125 + alchemySkill / 250;
|
||||
|
|
@ -262,7 +288,9 @@ namespace Server.Items
|
|||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow > m_End)
|
||||
{
|
||||
|
|
@ -274,17 +302,21 @@ namespace Server.Items
|
|||
var from = m_Item.From;
|
||||
|
||||
if (m_Item.Map == null || from == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var m in m_Item.GetMobilesInRange(0))
|
||||
if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != from) &&
|
||||
SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false))
|
||||
{
|
||||
if (m.Z + 16 > m_Item.Z && m_Item.Z + 12 > m.Z && (!Core.AOS || m != @from) &&
|
||||
SpellHelper.ValidIndirectTarget(@from, m) && @from.CanBeHarmful(m, false))
|
||||
{
|
||||
from.DoHarmful(m);
|
||||
@from.DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
|
||||
AOS.Damage(m, @from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x208);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,12 +42,16 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
{
|
||||
m_Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
|
@ -69,14 +73,20 @@ namespace Server.Items
|
|||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (var i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
if (m_Users[i].Target is ThrowTarget targ && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
{
|
||||
Target.Cancel(@from);
|
||||
}
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x207);
|
||||
|
|
@ -86,19 +96,25 @@ namespace Server.Items
|
|||
Timer.DelayCall(TimeSpan.FromSeconds(0.3), CircleEffect2, loc, map);
|
||||
|
||||
foreach (var mobile in map.GetMobilesInRange(loc, Radius))
|
||||
{
|
||||
if (mobile is BaseCreature mon)
|
||||
{
|
||||
if (mon.Controlled || mon.Summoned)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
mon.Pacify(from, DateTime.UtcNow + TimeSpan.FromSeconds(5.0)); // TODO check
|
||||
mon.Pacify(@from, DateTime.UtcNow + TimeSpan.FromSeconds(5.0)); // TODO check
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void BlastEffect(Point3D p, Map map)
|
||||
{
|
||||
if (map.CanFit(p, 12, true, false))
|
||||
{
|
||||
Effects.SendLocationEffect(p, map, 0x376A, 4, 9);
|
||||
}
|
||||
}
|
||||
|
||||
public void CircleEffect2(Point3D p, Map m)
|
||||
|
|
@ -116,7 +132,9 @@ namespace Server.Items
|
|||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
if (m_Delay.TryGetValue(m, out var timer) && timer.Next > DateTime.UtcNow)
|
||||
{
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -138,10 +156,14 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p) || from.Map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Add delay
|
||||
AddDelay(from);
|
||||
|
|
@ -153,9 +175,13 @@ namespace Server.Items
|
|||
IEntity to;
|
||||
|
||||
if (p is Mobile mobile)
|
||||
{
|
||||
to = mobile;
|
||||
}
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
{
|
||||
to = new Entity(Serial.Zero, new Point3D(p), @from.Map);
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, Potion.Hue);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), Potion.Explode, from, new Point3D(p), from.Map);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,9 @@ namespace Server.Items
|
|||
from.PlaySound(0x1E0);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,13 +49,19 @@ namespace Server.Items
|
|||
public virtual IEntity FindParent(Mobile from)
|
||||
{
|
||||
if (HeldBy?.Holding == this)
|
||||
{
|
||||
return HeldBy;
|
||||
}
|
||||
|
||||
if (RootParent != null)
|
||||
{
|
||||
return RootParent;
|
||||
}
|
||||
|
||||
if (Map == Map.Internal)
|
||||
return from;
|
||||
{
|
||||
return @from;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
@ -72,14 +78,18 @@ namespace Server.Items
|
|||
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
|
||||
|
||||
if (targ?.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
Users ??= new List<Mobile>();
|
||||
|
||||
if (!Users.Contains(from))
|
||||
Users.Add(from);
|
||||
{
|
||||
Users.Add(@from);
|
||||
}
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
|
||||
|
|
@ -90,26 +100,32 @@ namespace Server.Items
|
|||
var timer = 3;
|
||||
|
||||
if (Core.ML)
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
TimeSpan.FromSeconds(1.25),
|
||||
5,
|
||||
() => Detonate_OnTick(from, timer--)
|
||||
() => Detonate_OnTick(@from, timer--)
|
||||
); // 3.6 seconds explosion delay
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(0.75),
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
4,
|
||||
() => Detonate_OnTick(from, timer--)
|
||||
() => Detonate_OnTick(@from, timer--)
|
||||
); // 2.6 seconds explosion delay
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Detonate_OnTick(Mobile from, int timer)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = FindParent(from);
|
||||
|
||||
|
|
@ -139,27 +155,39 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (parent is Item item)
|
||||
{
|
||||
item.PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
else if (parent is Mobile mobile)
|
||||
{
|
||||
mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Reposition_OnTick(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (InstantExplosion)
|
||||
Explode(from, true, loc, map);
|
||||
{
|
||||
Explode(@from, true, loc, map);
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveToWorld(loc, map);
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode(Mobile from, bool direct, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
|
|
@ -168,11 +196,15 @@ namespace Server.Items
|
|||
var m = Users[i];
|
||||
|
||||
if (m.Target is ThrowTarget targ && targ.Potion == this)
|
||||
{
|
||||
Target.Cancel(m);
|
||||
}
|
||||
}
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.PlaySound(loc, map, 0x307);
|
||||
|
||||
|
|
@ -180,7 +212,9 @@ namespace Server.Items
|
|||
var alchemyBonus = 0;
|
||||
|
||||
if (direct)
|
||||
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
{
|
||||
alchemyBonus = (int)(@from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
}
|
||||
|
||||
var eable = map.GetObjectsInRange(loc, ExplosionRange, LeveledExplosion);
|
||||
var toDamage = 0;
|
||||
|
|
@ -190,7 +224,9 @@ namespace Server.Items
|
|||
{
|
||||
if (!(o is Mobile mobile) || from != null &&
|
||||
(!SpellHelper.ValidIndirectTarget(from, mobile) || !from.CanBeHarmful(mobile, false)))
|
||||
{
|
||||
return o is BaseExplosionPotion && o != this;
|
||||
}
|
||||
|
||||
++toDamage;
|
||||
return true;
|
||||
|
|
@ -216,9 +252,13 @@ namespace Server.Items
|
|||
damage += alchemyBonus;
|
||||
|
||||
if (!Core.AOS && damage > 40)
|
||||
{
|
||||
damage = 40;
|
||||
}
|
||||
else if (Core.AOS && toDamage > 2)
|
||||
{
|
||||
damage /= toDamage - 1;
|
||||
}
|
||||
|
||||
AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
|
@ -238,15 +278,21 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(targeted is IPoint3D p))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
|
|
@ -257,14 +303,21 @@ namespace Server.Items
|
|||
if (p is Mobile m)
|
||||
{
|
||||
if (!RelativeLocation) // explosion location = current mob location.
|
||||
{
|
||||
p = m.Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
to = m;
|
||||
}
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue);
|
||||
|
||||
if (Potion.Amount > 1) Mobile.LiftItemDupe(Potion, 1);
|
||||
if (Potion.Amount > 1)
|
||||
{
|
||||
Mobile.LiftItemDupe(Potion, 1);
|
||||
}
|
||||
|
||||
Potion.Internalize();
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), Potion.Reposition_OnTick, from, new Point3D(p), map);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ namespace Server.Items
|
|||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,16 +99,22 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if (m_DefaultIndex >= 0 && m_DefaultIndex < Entries.Count)
|
||||
{
|
||||
return Entries[m_DefaultIndex];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
m_DefaultIndex = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_DefaultIndex = Entries.IndexOf(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -122,12 +128,16 @@ namespace Server.Items
|
|||
var charges = 5 + quality + (int)(from.Skills.Inscribe.Value / 30);
|
||||
|
||||
if (charges > 10)
|
||||
{
|
||||
charges = 10;
|
||||
}
|
||||
|
||||
MaxCharges = Core.SE ? charges * 2 : charges;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
m_Quality = (BookQuality)(quality - 1);
|
||||
|
||||
|
|
@ -160,7 +170,9 @@ namespace Server.Items
|
|||
writer.Write(Entries.Count);
|
||||
|
||||
for (var i = 0; i < Entries.Count; ++i)
|
||||
{
|
||||
Entries[i].Serialize(writer);
|
||||
}
|
||||
|
||||
writer.Write(m_Description);
|
||||
writer.Write(CurCharges);
|
||||
|
|
@ -175,7 +187,9 @@ namespace Server.Items
|
|||
LootType = LootType.Blessed;
|
||||
|
||||
if (Core.SE && Weight == 3.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
|
|
@ -203,7 +217,9 @@ namespace Server.Items
|
|||
Entries = new List<RunebookEntry>(count);
|
||||
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
Entries.Add(new RunebookEntry(reader));
|
||||
}
|
||||
|
||||
m_Description = reader.ReadString();
|
||||
CurCharges = reader.ReadInt();
|
||||
|
|
@ -218,9 +234,13 @@ namespace Server.Items
|
|||
public void DropRune(Mobile from, RunebookEntry e, int index)
|
||||
{
|
||||
if (m_DefaultIndex > index)
|
||||
{
|
||||
m_DefaultIndex -= 1;
|
||||
}
|
||||
else if (m_DefaultIndex == index)
|
||||
{
|
||||
m_DefaultIndex = -1;
|
||||
}
|
||||
|
||||
Entries.RemoveAt(index);
|
||||
|
||||
|
|
@ -242,11 +262,17 @@ namespace Server.Items
|
|||
var ns = toCheck.NetState;
|
||||
|
||||
if (ns == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var gump in ns.Gumps)
|
||||
{
|
||||
if (gump is RunebookGump bookGump && bookGump.Book == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -256,13 +282,19 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Quality == BookQuality.Exceptional)
|
||||
{
|
||||
list.Add(1063341); // exceptional
|
||||
}
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(m_Description))
|
||||
{
|
||||
list.Add(m_Description);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragLift(Mobile from)
|
||||
|
|
@ -274,8 +306,12 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
foreach (var m in Openers)
|
||||
{
|
||||
if (IsOpen(m))
|
||||
{
|
||||
m.CloseGump<RunebookGump>();
|
||||
}
|
||||
}
|
||||
|
||||
Openers.Clear();
|
||||
|
||||
|
|
@ -285,12 +321,16 @@ namespace Server.Items
|
|||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (m_Description?.Length > 0)
|
||||
LabelTo(from, m_Description);
|
||||
{
|
||||
LabelTo(@from, m_Description);
|
||||
}
|
||||
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name);
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
@ -319,13 +359,17 @@ namespace Server.Items
|
|||
public virtual void OnTravel()
|
||||
{
|
||||
if (!Core.SA)
|
||||
{
|
||||
NextUse = DateTime.UtcNow + UseDelay;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (!(newItem is Runebook book))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
book.Entries = new List<RunebookEntry>();
|
||||
|
||||
|
|
@ -340,7 +384,9 @@ namespace Server.Items
|
|||
public bool CheckAccess(Mobile m)
|
||||
{
|
||||
if (!IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,13 +57,17 @@ namespace Server.Items
|
|||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && Movable)
|
||||
{
|
||||
list.Add(new AddToSpellbookEntry());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
|
|
@ -74,9 +78,13 @@ namespace Server.Items
|
|||
var spell = SpellRegistry.NewSpell(SpellID, from, this);
|
||||
|
||||
if (spell != null)
|
||||
{
|
||||
spell.Cast();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
{
|
||||
@from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,11 +184,17 @@ namespace Server.Items
|
|||
if (magery >= 1000)
|
||||
{
|
||||
if (magery >= 1200)
|
||||
{
|
||||
propertyCounts = m_LegendPropertyCounts;
|
||||
}
|
||||
else if (magery >= 1100)
|
||||
{
|
||||
propertyCounts = m_ElderPropertyCounts;
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyCounts = m_GrandPropertyCounts;
|
||||
}
|
||||
|
||||
minIntensity = 55;
|
||||
maxIntensity = 75;
|
||||
|
|
@ -212,7 +218,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
m_Quality = (BookQuality)(quality - 1);
|
||||
|
||||
|
|
@ -264,9 +272,13 @@ namespace Server.Items
|
|||
if (obj is Spellbook book)
|
||||
{
|
||||
if (book.BookCount == 64)
|
||||
{
|
||||
book.Content = ulong.MaxValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
book.Content = (1ul << book.BookCount) - 1;
|
||||
}
|
||||
|
||||
from.SendMessage("The spellbook has been filled.");
|
||||
|
||||
|
|
@ -288,7 +300,9 @@ namespace Server.Items
|
|||
private static void EventSink_OpenSpellbookRequest(Mobile from, int typeID)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var type = typeID switch
|
||||
{
|
||||
|
|
@ -309,7 +323,10 @@ namespace Server.Items
|
|||
|
||||
private static void EventSink_TargetedSpell(Mobile from, IEntity target, int spellId)
|
||||
{
|
||||
if (!DesignContext.Check(from)) return; // They are customizing
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var book = Find(from, spellId);
|
||||
|
||||
|
|
@ -322,20 +339,28 @@ namespace Server.Items
|
|||
var move = SpellRegistry.GetSpecialMove(spellId);
|
||||
|
||||
if (move != null)
|
||||
SpecialMove.SetCurrentMove(from, move);
|
||||
{
|
||||
SpecialMove.SetCurrentMove(@from, move);
|
||||
}
|
||||
else
|
||||
SpellRegistry.NewSpell(spellId, from, null)?.Cast();
|
||||
{
|
||||
SpellRegistry.NewSpell(spellId, @from, null)?.Cast();
|
||||
}
|
||||
}
|
||||
|
||||
private static void EventSink_CastSpellRequest(Mobile from, int spellID, Item item)
|
||||
{
|
||||
if (!DesignContext.Check(from))
|
||||
{
|
||||
return; // They are customizing
|
||||
}
|
||||
|
||||
var book = item as Spellbook;
|
||||
|
||||
if (book?.HasSpell(spellID) != true)
|
||||
book = Find(from, spellID);
|
||||
{
|
||||
book = Find(@from, spellID);
|
||||
}
|
||||
|
||||
if (book?.HasSpell(spellID) == true)
|
||||
{
|
||||
|
|
@ -350,9 +375,13 @@ namespace Server.Items
|
|||
var spell = SpellRegistry.NewSpell(spellID, from, null);
|
||||
|
||||
if (spell != null)
|
||||
{
|
||||
spell.Cast();
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
{
|
||||
@from.SendLocalizedMessage(502345); // This spell has been temporarily disabled.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -364,19 +393,39 @@ namespace Server.Items
|
|||
public static SpellbookType GetTypeForSpell(int spellID)
|
||||
{
|
||||
if (spellID >= 0 && spellID < 64)
|
||||
{
|
||||
return SpellbookType.Regular;
|
||||
}
|
||||
|
||||
if (spellID >= 100 && spellID < 117)
|
||||
{
|
||||
return SpellbookType.Necromancer;
|
||||
}
|
||||
|
||||
if (spellID >= 200 && spellID < 210)
|
||||
{
|
||||
return SpellbookType.Paladin;
|
||||
}
|
||||
|
||||
if (spellID >= 400 && spellID < 406)
|
||||
{
|
||||
return SpellbookType.Samurai;
|
||||
}
|
||||
|
||||
if (spellID >= 500 && spellID < 508)
|
||||
{
|
||||
return SpellbookType.Ninja;
|
||||
}
|
||||
|
||||
if (spellID >= 600 && spellID < 617)
|
||||
{
|
||||
return SpellbookType.Arcanist;
|
||||
}
|
||||
|
||||
if (spellID >= 677 && spellID < 693)
|
||||
{
|
||||
return SpellbookType.Mystic;
|
||||
}
|
||||
|
||||
return SpellbookType.Invalid;
|
||||
}
|
||||
|
|
@ -400,7 +449,9 @@ namespace Server.Items
|
|||
public static Spellbook Find(Mobile from, int spellID, SpellbookType type)
|
||||
{
|
||||
if (from == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (from.Deleted)
|
||||
{
|
||||
|
|
@ -411,9 +462,13 @@ namespace Server.Items
|
|||
var searchAgain = false;
|
||||
|
||||
if (!m_Table.TryGetValue(from, out var list))
|
||||
m_Table[from] = list = FindAllSpellbooks(from);
|
||||
{
|
||||
m_Table[@from] = list = FindAllSpellbooks(@from);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchAgain = true;
|
||||
}
|
||||
|
||||
var book = FindSpellbookInList(list, from, spellID, type);
|
||||
|
||||
|
|
@ -434,13 +489,17 @@ namespace Server.Items
|
|||
for (var i = list.Count - 1; i >= 0; --i)
|
||||
{
|
||||
if (i >= list.Count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var book = list[i];
|
||||
|
||||
if (!book.Deleted && (book.Parent == from || pack != null && book.Parent == pack) &&
|
||||
ValidateSpellbook(book, spellID, type))
|
||||
{
|
||||
return book;
|
||||
}
|
||||
|
||||
list.RemoveAt(i);
|
||||
}
|
||||
|
|
@ -455,13 +514,19 @@ namespace Server.Items
|
|||
var spellbook = FindEquippedSpellbook(from);
|
||||
|
||||
if (spellbook != null)
|
||||
{
|
||||
list.Add(spellbook);
|
||||
}
|
||||
|
||||
var pack = from.Backpack;
|
||||
|
||||
for (var i = 0; i < pack?.Items.Count; ++i)
|
||||
{
|
||||
if (pack.Items[i] is Spellbook sp)
|
||||
{
|
||||
list.Add(sp);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
@ -474,16 +539,24 @@ namespace Server.Items
|
|||
public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
|
||||
{
|
||||
if (!Ethic.CheckTrade(from, to, newOwner, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.AllowSecureTrade(from, to, newOwner, accepted);
|
||||
}
|
||||
|
||||
public override bool CanEquip(Mobile from)
|
||||
{
|
||||
if (!Ethic.CheckEquip(from, this)) return false;
|
||||
if (!Ethic.CheckEquip(from, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!from.CanBeginAction<BaseWeapon>()) return false;
|
||||
if (!from.CanBeginAction<BaseWeapon>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanEquip(from);
|
||||
}
|
||||
|
|
@ -496,7 +569,10 @@ namespace Server.Items
|
|||
{
|
||||
var type = GetTypeForSpell(scroll.SpellID);
|
||||
|
||||
if (type != SpellbookType) return false;
|
||||
if (type != SpellbookType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (HasSpell(scroll.SpellID))
|
||||
{
|
||||
|
|
@ -526,7 +602,9 @@ namespace Server.Items
|
|||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (!(newItem is Spellbook book))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
book.Attributes = new AosAttributes(newItem, Attributes);
|
||||
book.SkillBonuses = new AosSkillBonuses(newItem, SkillBonuses);
|
||||
|
|
@ -547,13 +625,19 @@ namespace Server.Items
|
|||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
{
|
||||
@from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
from.CheckStatTimers();
|
||||
|
|
@ -590,7 +674,9 @@ namespace Server.Items
|
|||
var ns = to.NetState;
|
||||
|
||||
if (ns == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Parent == null)
|
||||
{
|
||||
|
|
@ -600,9 +686,13 @@ namespace Server.Items
|
|||
{
|
||||
// What will happen if the client doesn't know about our parent?
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new ContainerContentUpdate6017(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new ContainerContentUpdate(this));
|
||||
}
|
||||
}
|
||||
else if (Parent is Mobile)
|
||||
{
|
||||
|
|
@ -611,9 +701,13 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (ns.HighSeas)
|
||||
{
|
||||
to.Send(new DisplaySpellbookHS(Serial));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new DisplaySpellbook(Serial));
|
||||
}
|
||||
|
||||
if (ObjectPropertyList.Enabled)
|
||||
{
|
||||
|
|
@ -624,17 +718,25 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new SpellbookContent6017(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new SpellbookContent(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ns.ContainerGridLines)
|
||||
{
|
||||
to.Send(new SpellbookContent6017(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
else
|
||||
{
|
||||
to.Send(new SpellbookContent(Serial, BookOffset + 1, m_Content));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -643,13 +745,19 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Quality == BookQuality.Exceptional)
|
||||
{
|
||||
list.Add(1063341); // exceptional
|
||||
}
|
||||
|
||||
if (m_EngravedText != null)
|
||||
{
|
||||
list.Add(1072305, m_EngravedText); // Engraved: ~1_INSCRIPTION~
|
||||
}
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
SkillBonuses.GetProperties(list);
|
||||
|
||||
|
|
@ -657,89 +765,141 @@ namespace Server.Items
|
|||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Slayer2 != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer2);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
int prop;
|
||||
|
||||
if ((prop = Attributes.WeaponDamage) != 0)
|
||||
{
|
||||
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.DefendChance) != 0)
|
||||
{
|
||||
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusDex) != 0)
|
||||
{
|
||||
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.EnhancePotions) != 0)
|
||||
{
|
||||
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastRecovery) != 0)
|
||||
{
|
||||
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastSpeed) != 0)
|
||||
{
|
||||
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.AttackChance) != 0)
|
||||
{
|
||||
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusHits) != 0)
|
||||
{
|
||||
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusInt) != 0)
|
||||
{
|
||||
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerManaCost) != 0)
|
||||
{
|
||||
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerRegCost) != 0)
|
||||
{
|
||||
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.Luck) != 0)
|
||||
{
|
||||
list.Add(1060436, prop.ToString()); // luck ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusMana) != 0)
|
||||
{
|
||||
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenMana) != 0)
|
||||
{
|
||||
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.NightSight != 0)
|
||||
{
|
||||
list.Add(1060441); // night sight
|
||||
}
|
||||
|
||||
if ((prop = Attributes.ReflectPhysical) != 0)
|
||||
{
|
||||
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenStam) != 0)
|
||||
{
|
||||
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenHits) != 0)
|
||||
{
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.SpellChanneling != 0)
|
||||
{
|
||||
list.Add(1060482); // spell channeling
|
||||
}
|
||||
|
||||
if ((prop = Attributes.SpellDamage) != 0)
|
||||
{
|
||||
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStam) != 0)
|
||||
{
|
||||
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStr) != 0)
|
||||
{
|
||||
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponSpeed) != 0)
|
||||
{
|
||||
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
|
||||
}
|
||||
|
||||
if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0)
|
||||
{
|
||||
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
|
||||
}
|
||||
|
||||
list.Add(1042886, SpellCount.ToString()); // ~1_NUMBERS_OF_SPELLS~ Spells
|
||||
}
|
||||
|
|
@ -749,7 +909,9 @@ namespace Server.Items
|
|||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
LabelTo(from, 1042886, SpellCount.ToString());
|
||||
}
|
||||
|
|
@ -759,11 +921,15 @@ namespace Server.Items
|
|||
var pack = from.Backpack;
|
||||
|
||||
if (Parent == from || pack != null && Parent == pack)
|
||||
DisplayTo(from);
|
||||
{
|
||||
DisplayTo(@from);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(
|
||||
{
|
||||
@from.SendLocalizedMessage(
|
||||
500207
|
||||
); // The spellbook must be in your backpack (and not in a container within) to open.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
@ -839,7 +1005,9 @@ namespace Server.Items
|
|||
SkillBonuses ??= new AosSkillBonuses(this);
|
||||
|
||||
if (Core.AOS && Parent is Mobile mobile)
|
||||
{
|
||||
SkillBonuses.AddTo(mobile);
|
||||
}
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
|
|
@ -852,13 +1020,19 @@ namespace Server.Items
|
|||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
m.CheckStatTimers();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
public virtual bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
|
|
@ -73,7 +75,9 @@ namespace Server.Items
|
|||
private static void EventSink_BandageTargetRequest(Mobile from, Item item, Mobile target)
|
||||
{
|
||||
if (!(item is Bandage b) || b.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!from.InRange(b.GetWorldLocation(), Range))
|
||||
{
|
||||
|
|
@ -103,14 +107,18 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Bandage.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is Mobile mobile)
|
||||
{
|
||||
if (from.InRange(m_Bandage.GetWorldLocation(), Bandage.Range))
|
||||
{
|
||||
if (!(BandageContext.BeginHeal(from, mobile) == null || DuelContext.IsFreeConsume(from)))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -120,7 +128,9 @@ namespace Server.Items
|
|||
else if (targeted is PlagueBeastInnard innard)
|
||||
{
|
||||
if (innard.OnBandage(from))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -133,7 +143,9 @@ namespace Server.Items
|
|||
if (targeted is PlagueBeastInnard innard)
|
||||
{
|
||||
if (innard.OnBandage(from))
|
||||
{
|
||||
m_Bandage.Consume();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -186,14 +198,20 @@ namespace Server.Items
|
|||
public static SkillName GetPrimarySkill(Mobile m)
|
||||
{
|
||||
if (!m.Player && (m.Body.IsMonster || m.Body.IsAnimal))
|
||||
{
|
||||
return SkillName.Veterinary;
|
||||
}
|
||||
|
||||
return SkillName.Healing;
|
||||
}
|
||||
|
||||
public static SkillName GetSecondarySkill(Mobile m)
|
||||
{
|
||||
if (!m.Player && (m.Body.IsMonster || m.Body.IsAnimal))
|
||||
{
|
||||
return SkillName.AnimalLore;
|
||||
}
|
||||
|
||||
return SkillName.Anatomy;
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +277,10 @@ namespace Server.Items
|
|||
{
|
||||
petPatient.ResurrectPet();
|
||||
|
||||
for (var i = 0; i < petPatient.Skills.Length; ++i) petPatient.Skills[i].Base -= 0.1;
|
||||
for (var i = 0; i < petPatient.Skills.Length; ++i)
|
||||
{
|
||||
petPatient.Skills[i].Base -= 0.1;
|
||||
}
|
||||
}
|
||||
else if (master?.InRange(petPatient, 3) == true)
|
||||
{
|
||||
|
|
@ -291,7 +312,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -304,9 +327,13 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (petPatient?.IsDeadPet == true)
|
||||
{
|
||||
healerNumber = 503256; // You fail to resurrect the creature.
|
||||
}
|
||||
else
|
||||
{
|
||||
healerNumber = 500966; // You are unable to resurrect your patient.
|
||||
}
|
||||
|
||||
patientNumber = -1;
|
||||
}
|
||||
|
|
@ -385,12 +412,18 @@ namespace Server.Items
|
|||
var toHeal = min + Utility.RandomDouble() * (max - min);
|
||||
|
||||
if (Patient.Body.IsMonster || Patient.Body.IsAnimal)
|
||||
{
|
||||
toHeal += Patient.HitsMax / 100.0;
|
||||
}
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
toHeal -= toHeal * Slips * 0.35; // TODO: Verify algorithm
|
||||
}
|
||||
else
|
||||
{
|
||||
toHeal -= Slips * 4;
|
||||
}
|
||||
|
||||
if (toHeal < 1)
|
||||
{
|
||||
|
|
@ -408,13 +441,19 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (healerNumber != -1)
|
||||
{
|
||||
Healer.SendLocalizedMessage(healerNumber);
|
||||
}
|
||||
|
||||
if (patientNumber != -1)
|
||||
{
|
||||
Patient.SendLocalizedMessage(patientNumber);
|
||||
}
|
||||
|
||||
if (playSound)
|
||||
{
|
||||
Patient.PlaySound(0x57);
|
||||
}
|
||||
|
||||
if (checkSkills)
|
||||
{
|
||||
|
|
@ -457,9 +496,13 @@ namespace Server.Items
|
|||
if (onSelf)
|
||||
{
|
||||
if (Core.AOS)
|
||||
{
|
||||
seconds = 5.0 + 0.5 * ((double)(120 - dex) / 10); // TODO: Verify algorithm
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 9.4 + 0.6 * ((double)(120 - dex) / 10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -470,18 +513,28 @@ namespace Server.Items
|
|||
else if (Core.AOS)
|
||||
{
|
||||
if (dex < 204)
|
||||
{
|
||||
seconds = 3.2 - Math.Sin((double)dex / 130) * 2.5 + resDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 0.7 + resDelay;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dex >= 100)
|
||||
{
|
||||
seconds = 3.0 + resDelay;
|
||||
}
|
||||
else if (dex >= 40)
|
||||
{
|
||||
seconds = 4.0 + resDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
seconds = 5.0 + resDelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +548,9 @@ namespace Server.Items
|
|||
m_Table[healer] = context;
|
||||
|
||||
if (!onSelf)
|
||||
{
|
||||
patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you.
|
||||
}
|
||||
|
||||
healer.SendLocalizedMessage(500956); // You begin applying the bandages.
|
||||
return context;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
private bool CheckUse(Mobile from)
|
||||
{
|
||||
if (!IsAccessibleTo(from))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (from.Map != Map || !from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
|
|
@ -39,7 +41,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (from.Backpack?.GetAmount(typeof(SulfurousAsh)) >= (Core.AOS ? 4 : 15))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1049617); // You do not have enough sulfurous ash.
|
||||
return false;
|
||||
|
|
@ -57,7 +61,9 @@ namespace Server.Items
|
|||
public void Use(Mobile from, IPoint3D loc)
|
||||
{
|
||||
if (!CheckUse(from))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.BeginAction<FireHorn>();
|
||||
Timer.DelayCall(Core.AOS ? TimeSpan.FromSeconds(6.0) : TimeSpan.FromSeconds(12.0), EndAction, from);
|
||||
|
|
@ -105,10 +111,14 @@ namespace Server.Items
|
|||
{
|
||||
if (from == m || !SpellHelper.ValidIndirectTarget(from, m) || !from.CanBeHarmful(m, false)
|
||||
|| Core.AOS && !from.InLOS(m))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m.Player)
|
||||
{
|
||||
playerVsPlayer = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -136,9 +146,13 @@ namespace Server.Items
|
|||
|
||||
int avgDamage;
|
||||
if (playerVsPlayer)
|
||||
{
|
||||
avgDamage = weightAvg / 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
avgDamage = weightAvg / 2;
|
||||
}
|
||||
|
||||
minDamage = avgDamage * 9 / 10;
|
||||
maxDamage = avgDamage * 10 / 9;
|
||||
|
|
@ -148,7 +162,9 @@ namespace Server.Items
|
|||
var total = prov + disc / 5 + peace / 5;
|
||||
|
||||
if (playerVsPlayer)
|
||||
{
|
||||
total /= 3;
|
||||
}
|
||||
|
||||
maxDamage = total * 2 / 30;
|
||||
minDamage = maxDamage * 7 / 10;
|
||||
|
|
@ -157,9 +173,13 @@ namespace Server.Items
|
|||
double damage = Utility.RandomMinMax(minDamage, maxDamage);
|
||||
|
||||
if (Core.AOS && targets.Count > 1)
|
||||
{
|
||||
damage = damage * 2 / targets.Count;
|
||||
}
|
||||
else if (!Core.AOS)
|
||||
{
|
||||
damage /= targets.Count;
|
||||
}
|
||||
|
||||
for (var i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
|
|
@ -217,13 +237,19 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Horn.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IPoint3D loc;
|
||||
if (targeted is Item item)
|
||||
{
|
||||
loc = item.GetWorldLocation();
|
||||
}
|
||||
else
|
||||
{
|
||||
loc = targeted as IPoint3D;
|
||||
}
|
||||
|
||||
m_Horn.Use(from, loc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ namespace Server.Items
|
|||
var r = Recipe;
|
||||
|
||||
if (r != null)
|
||||
{
|
||||
list.Add(1049644, r.TextDefinition.ToString()); // [~1_stuff~]
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -39,9 +39,13 @@ namespace Server.Items
|
|||
) : base(0x14F0)
|
||||
{
|
||||
if (normalizeLevel)
|
||||
{
|
||||
SkillLevel = (int)(level / 10) * 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
SkillLevel = level;
|
||||
}
|
||||
|
||||
m_Skill = skill;
|
||||
m_Crafter = crafter;
|
||||
|
|
@ -101,7 +105,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
// On OSI it says it's exceptional. Intentional difference.
|
||||
}
|
||||
|
|
@ -109,7 +115,9 @@ namespace Server.Items
|
|||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (Deleted || !from.CanSee(this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LabelTo(
|
||||
from,
|
||||
|
|
@ -118,7 +126,9 @@ namespace Server.Items
|
|||
); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
|
||||
|
||||
if (m_Crafter != null)
|
||||
LabelTo(from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
{
|
||||
LabelTo(@from, 1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
}
|
||||
|
||||
private static TextDefinition GetSkillTitle(double skillLevel)
|
||||
|
|
@ -126,9 +136,14 @@ namespace Server.Items
|
|||
var skill = (int)(skillLevel / 10);
|
||||
|
||||
if (skill >= 11)
|
||||
{
|
||||
return 1062008 + skill - 11;
|
||||
}
|
||||
|
||||
if (skill >= 5)
|
||||
{
|
||||
return 1061123 + skill - 5;
|
||||
}
|
||||
|
||||
return skill switch
|
||||
{
|
||||
|
|
@ -141,8 +156,12 @@ namespace Server.Items
|
|||
public static RepairSkillType GetTypeFor(CraftSystem s)
|
||||
{
|
||||
for (var i = 0; i < RepairSkillInfo.Table.Length; i++)
|
||||
{
|
||||
if (RepairSkillInfo.Table[i].System == s)
|
||||
{
|
||||
return (RepairSkillType)i;
|
||||
}
|
||||
}
|
||||
|
||||
return RepairSkillType.Smithing;
|
||||
}
|
||||
|
|
@ -150,17 +169,25 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Check(from))
|
||||
Repair.Do(from, RepairSkillInfo.GetInfo(m_Skill).System, this);
|
||||
{
|
||||
Repair.Do(@from, RepairSkillInfo.GetInfo(m_Skill).System, this);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Check(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1047012); // The contract must be in your backpack to use it.
|
||||
{
|
||||
@from.SendLocalizedMessage(1047012); // The contract must be in your backpack to use it.
|
||||
}
|
||||
else if (!VerifyRegion(from))
|
||||
TextDefinition.SendMessageTo(from, RepairSkillInfo.GetInfo(m_Skill).NotNearbyMessage);
|
||||
{
|
||||
TextDefinition.SendMessageTo(@from, RepairSkillInfo.GetInfo(m_Skill).NotNearbyMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -238,7 +265,9 @@ namespace Server.Items
|
|||
var v = (int)type;
|
||||
|
||||
if (v < 0 || v >= Table.Length)
|
||||
{
|
||||
v = 0;
|
||||
}
|
||||
|
||||
return Table[v];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 3.0)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,9 @@ namespace Server.Items
|
|||
set
|
||||
{
|
||||
if (value != m_ReplenishesCharges && value)
|
||||
{
|
||||
m_LastReplenished = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
m_ReplenishesCharges = value;
|
||||
}
|
||||
|
|
@ -121,7 +123,9 @@ namespace Server.Items
|
|||
Quality = (InstrumentQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
|
@ -151,7 +155,9 @@ namespace Server.Items
|
|||
public void CheckReplenishUses(bool invalidate = true)
|
||||
{
|
||||
if (!m_ReplenishesCharges || m_UsesRemaining >= InitMaxUses)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_LastReplenished + ChargeReplenishRate < DateTime.UtcNow)
|
||||
{
|
||||
|
|
@ -164,7 +170,9 @@ namespace Server.Items
|
|||
m_LastReplenished = DateTime.UtcNow;
|
||||
|
||||
if (invalidate)
|
||||
{
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,7 +208,9 @@ namespace Server.Items
|
|||
public static BaseInstrument GetInstrument(Mobile from)
|
||||
{
|
||||
if (m_Instruments.TryGetValue(from, out var instrument) && instrument.IsChildOf(from.Backpack))
|
||||
{
|
||||
return instrument;
|
||||
}
|
||||
|
||||
m_Instruments.Remove(from);
|
||||
return null;
|
||||
|
|
@ -255,31 +265,45 @@ namespace Server.Items
|
|||
val += targ.SkillsTotal / 10.0;
|
||||
|
||||
if (val > 700)
|
||||
{
|
||||
val = 700 + (int)((val - 700) * (3.0 / 11));
|
||||
}
|
||||
|
||||
var bc = targ as BaseCreature;
|
||||
|
||||
if (IsMageryCreature(bc))
|
||||
{
|
||||
val += 100;
|
||||
}
|
||||
|
||||
if (IsFireBreathingCreature(bc))
|
||||
{
|
||||
val += 100;
|
||||
}
|
||||
|
||||
if (IsPoisonImmune(bc))
|
||||
{
|
||||
val += 100;
|
||||
}
|
||||
|
||||
if (targ is VampireBat || targ is VampireBatFamiliar)
|
||||
{
|
||||
val += 100;
|
||||
}
|
||||
|
||||
val += GetPoisonLevel(bc) * 20;
|
||||
|
||||
val /= 10;
|
||||
|
||||
if (bc?.IsParagon == true)
|
||||
{
|
||||
val += 40.0;
|
||||
}
|
||||
|
||||
if (Core.SE && val > 160.0)
|
||||
{
|
||||
val = 160.0;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
|
@ -289,7 +313,9 @@ namespace Server.Items
|
|||
var val = GetBaseDifficulty(targ);
|
||||
|
||||
if (m_Quality == InstrumentQuality.Exceptional)
|
||||
{
|
||||
val -= 5.0; // 10%
|
||||
}
|
||||
|
||||
if (m_Slayer != SlayerName.None)
|
||||
{
|
||||
|
|
@ -298,9 +324,13 @@ namespace Server.Items
|
|||
if (entry != null)
|
||||
{
|
||||
if (entry.Slays(targ))
|
||||
{
|
||||
val -= 10.0; // 20%
|
||||
}
|
||||
else if (entry.Group.OppositionSuperSlays(targ))
|
||||
{
|
||||
val += 10.0; // -20%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -311,9 +341,13 @@ namespace Server.Items
|
|||
if (entry != null)
|
||||
{
|
||||
if (entry.Slays(targ))
|
||||
{
|
||||
val -= 10.0; // 20%
|
||||
}
|
||||
else if (entry.Group.OppositionSuperSlays(targ))
|
||||
{
|
||||
val += 10.0; // -20%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -333,32 +367,44 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (m_Quality == InstrumentQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
|
||||
if (m_ReplenishesCharges)
|
||||
{
|
||||
list.Add(1070928); // Replenish Charges
|
||||
}
|
||||
|
||||
if (m_Slayer != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Slayer2 != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer2);
|
||||
if (entry != null)
|
||||
{
|
||||
list.Add(entry.Title);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_UsesRemaining != oldUses)
|
||||
{
|
||||
Timer.DelayCall(InvalidateProperties);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
|
|
@ -368,30 +414,42 @@ namespace Server.Items
|
|||
if (DisplayLootType)
|
||||
{
|
||||
if (LootType == LootType.Blessed)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(1038021)); // blessed
|
||||
}
|
||||
else if (LootType == LootType.Cursed)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(1049643)); // cursed
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Quality == InstrumentQuality.Exceptional)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(1018305 - (int)m_Quality));
|
||||
}
|
||||
|
||||
if (m_ReplenishesCharges)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(1070928)); // Replenish Charges
|
||||
}
|
||||
|
||||
// TODO: Must this support item identification?
|
||||
if (m_Slayer != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer);
|
||||
if (entry != null)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(entry.Title));
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Slayer2 != SlayerName.None)
|
||||
{
|
||||
var entry = SlayerGroup.GetEntryByName(m_Slayer2);
|
||||
if (entry != null)
|
||||
{
|
||||
attrs.Add(new EquipInfoAttribute(entry.Title));
|
||||
}
|
||||
}
|
||||
|
||||
int number;
|
||||
|
|
@ -407,7 +465,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (attrs.Count == 0 && Crafter == null && Name != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var eqInfo = new EquipmentInfo(
|
||||
number,
|
||||
|
|
@ -427,7 +487,9 @@ namespace Server.Items
|
|||
|
||||
writer.Write(m_ReplenishesCharges);
|
||||
if (m_ReplenishesCharges)
|
||||
{
|
||||
writer.Write(m_LastReplenished);
|
||||
}
|
||||
|
||||
writer.Write(m_Crafter);
|
||||
|
||||
|
|
@ -454,7 +516,9 @@ namespace Server.Items
|
|||
m_ReplenishesCharges = reader.ReadBool();
|
||||
|
||||
if (m_ReplenishesCharges)
|
||||
{
|
||||
m_LastReplenished = reader.ReadDateTime();
|
||||
}
|
||||
|
||||
goto case 2;
|
||||
}
|
||||
|
|
@ -514,9 +578,13 @@ namespace Server.Items
|
|||
new InternalTimer(from).Start();
|
||||
|
||||
if (CheckMusicianship(from))
|
||||
PlayInstrumentWell(from);
|
||||
{
|
||||
PlayInstrumentWell(@from);
|
||||
}
|
||||
else
|
||||
PlayInstrumentBadly(from);
|
||||
{
|
||||
PlayInstrumentBadly(@from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 3.0)
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 3.0)
|
||||
{
|
||||
Weight = 35.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 3.0)
|
||||
{
|
||||
Weight = 10.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 3.0)
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 2.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 2.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (ItemID == 0x2809) // Temporary solution for clients 7.0.0.0 and up
|
||||
{
|
||||
ItemID = 0x2808;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,10 @@ namespace Server.Items
|
|||
|
||||
public void AttackAnimation(Mobile from, Mobile to)
|
||||
{
|
||||
if (from.Body.IsHuman && !from.Mounted) from.Animate(33, 2, 1, true, true, 0);
|
||||
if (from.Body.IsHuman && !from.Mounted)
|
||||
{
|
||||
@from.Animate(33, 2, 1, true, true, 0);
|
||||
}
|
||||
|
||||
from.PlaySound(0x223);
|
||||
from.MovingEffect(to, 0x2804, 5, 0, false, false);
|
||||
|
|
@ -91,7 +94,9 @@ namespace Server.Items
|
|||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
|
||||
if (m_Poison != null && m_PoisonCharges > 0)
|
||||
{
|
||||
list.Add(1062412 + m_Poison.Level, m_PoisonCharges.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ namespace Server.Items
|
|||
)
|
||||
{
|
||||
if (quality == 2)
|
||||
{
|
||||
UsesRemaining *= 2;
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
|
@ -78,7 +80,9 @@ namespace Server.Items
|
|||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
|
||||
if (m_Poison != null && m_PoisonCharges > 0)
|
||||
{
|
||||
list.Add(1062412 + m_Poison.Level, m_PoisonCharges.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,10 @@ namespace Server.Items
|
|||
|
||||
public void AttackAnimation(Mobile from, Mobile to)
|
||||
{
|
||||
if (from.Body.IsHuman) from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
|
||||
if (from.Body.IsHuman)
|
||||
{
|
||||
@from.Animate(@from.Mounted ? 26 : 9, 7, 1, true, false, 0);
|
||||
}
|
||||
|
||||
from.PlaySound(0x23A);
|
||||
from.MovingEffect(to, 0x27AC, 1, 0, false, false);
|
||||
|
|
@ -93,7 +96,9 @@ namespace Server.Items
|
|||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
|
||||
if (m_Poison != null && m_PoisonCharges > 0)
|
||||
{
|
||||
list.Add(1062412 + m_Poison.Level, m_PoisonCharges.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnEquip(Mobile from)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ namespace Server.Items
|
|||
public static void AttemptShoot(PlayerMobile from, INinjaWeapon weapon)
|
||||
{
|
||||
if (CanUseWeapon(from, weapon))
|
||||
from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, OnTarget, weapon);
|
||||
{
|
||||
@from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, OnTarget, weapon);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
|
||||
|
|
@ -66,7 +68,9 @@ namespace Server.Items
|
|||
ConsumeUse(weapon);
|
||||
|
||||
if (CombatCheck(from, target))
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), OnHit, from, target, weapon);
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), OnHit, @from, target, weapon);
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2.5), ResetUsing, from);
|
||||
}
|
||||
|
|
@ -117,26 +121,36 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
if (weapon.UsesRemaining > 0)
|
||||
{
|
||||
if (weapon.Poison == null && ammo.Poison != null
|
||||
|| weapon.Poison != null && ammo.Poison != null && weapon.Poison.Level != ammo.Poison.Level)
|
||||
{
|
||||
Unload(from, weapon);
|
||||
Unload(@from, weapon);
|
||||
need = Math.Min(MaxUses, ammo.UsesRemaining);
|
||||
}
|
||||
}
|
||||
|
||||
var poisonneeded = Math.Min(MaxUses - weapon.PoisonCharges, ammo.PoisonCharges);
|
||||
|
||||
weapon.UsesRemaining += need;
|
||||
weapon.PoisonCharges += poisonneeded;
|
||||
|
||||
if (weapon.PoisonCharges > 0) weapon.Poison = ammo.Poison;
|
||||
if (weapon.PoisonCharges > 0)
|
||||
{
|
||||
weapon.Poison = ammo.Poison;
|
||||
}
|
||||
|
||||
ammo.PoisonCharges -= poisonneeded;
|
||||
ammo.UsesRemaining -= need;
|
||||
|
||||
if (ammo.UsesRemaining < 1)
|
||||
{
|
||||
((Item)ammo).Delete();
|
||||
else if (ammo.PoisonCharges < 1) ammo.Poison = null;
|
||||
}
|
||||
else if (ammo.PoisonCharges < 1)
|
||||
{
|
||||
ammo.Poison = null;
|
||||
}
|
||||
}
|
||||
} // "else" here would mean they targeted "ammo" with 0 uses. undefined behavior.
|
||||
}
|
||||
|
|
@ -168,7 +182,10 @@ namespace Server.Items
|
|||
{
|
||||
if (!from.NinjaWepCooldown)
|
||||
{
|
||||
if (BasePotion.HasFreeHand(from)) return true;
|
||||
if (BasePotion.HasFreeHand(from))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(weapon.NoFreeHandMessage);
|
||||
}
|
||||
|
|
@ -196,40 +213,73 @@ namespace Server.Items
|
|||
var atSkillValue = attacker.Skills.Ninjitsu.Value;
|
||||
var defSkillValue = defWeapon?.GetDefendSkillValue(attacker, defender) ?? 0.0;
|
||||
|
||||
if (defSkillValue <= -20.0) defSkillValue = -19.9;
|
||||
if (defSkillValue <= -20.0)
|
||||
{
|
||||
defSkillValue = -19.9;
|
||||
}
|
||||
|
||||
double attackValue = AosAttributes.GetValue(attacker, AosAttribute.AttackChance);
|
||||
|
||||
if (DivineFurySpell.UnderEffect(attacker)) attackValue += 10;
|
||||
if (DivineFurySpell.UnderEffect(attacker))
|
||||
{
|
||||
attackValue += 10;
|
||||
}
|
||||
|
||||
if (AnimalForm.UnderTransformation(attacker, typeof(GreyWolf)) ||
|
||||
AnimalForm.UnderTransformation(attacker, typeof(BakeKitsune))) attackValue += 20;
|
||||
AnimalForm.UnderTransformation(attacker, typeof(BakeKitsune)))
|
||||
{
|
||||
attackValue += 20;
|
||||
}
|
||||
|
||||
if (HitLower.IsUnderAttackEffect(attacker)) attackValue -= 25;
|
||||
if (HitLower.IsUnderAttackEffect(attacker))
|
||||
{
|
||||
attackValue -= 25;
|
||||
}
|
||||
|
||||
if (attackValue > 45) attackValue = 45;
|
||||
if (attackValue > 45)
|
||||
{
|
||||
attackValue = 45;
|
||||
}
|
||||
|
||||
attackValue = (atSkillValue + 20.0) * (100 + attackValue);
|
||||
|
||||
double defenseValue = AosAttributes.GetValue(defender, AosAttribute.DefendChance);
|
||||
|
||||
if (DivineFurySpell.UnderEffect(defender)) defenseValue -= 20;
|
||||
if (DivineFurySpell.UnderEffect(defender))
|
||||
{
|
||||
defenseValue -= 20;
|
||||
}
|
||||
|
||||
if (HitLower.IsUnderDefenseEffect(defender)) defenseValue -= 25;
|
||||
if (HitLower.IsUnderDefenseEffect(defender))
|
||||
{
|
||||
defenseValue -= 25;
|
||||
}
|
||||
|
||||
var refBonus = 0;
|
||||
|
||||
if (Block.GetBonus(defender, ref refBonus)) defenseValue += refBonus;
|
||||
if (Block.GetBonus(defender, ref refBonus))
|
||||
{
|
||||
defenseValue += refBonus;
|
||||
}
|
||||
|
||||
if (Discordance.GetEffect(attacker, ref refBonus)) defenseValue -= refBonus;
|
||||
if (Discordance.GetEffect(attacker, ref refBonus))
|
||||
{
|
||||
defenseValue -= refBonus;
|
||||
}
|
||||
|
||||
if (defenseValue > 45) defenseValue = 45;
|
||||
if (defenseValue > 45)
|
||||
{
|
||||
defenseValue = 45;
|
||||
}
|
||||
|
||||
defenseValue = (defSkillValue + 20.0) * (100 + defenseValue);
|
||||
|
||||
var chance = attackValue / (defenseValue * 2.0);
|
||||
|
||||
if (chance < 0.02) chance = 0.02;
|
||||
if (chance < 0.02)
|
||||
{
|
||||
chance = 0.02;
|
||||
}
|
||||
|
||||
return attacker.CheckSkill(atkSkill.SkillName, chance);
|
||||
}
|
||||
|
|
@ -237,7 +287,10 @@ namespace Server.Items
|
|||
private static void OnHit(Mobile from, Mobile target, INinjaWeapon weapon)
|
||||
{
|
||||
if (!from.CanBeHarmful(target))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.DoHarmful(target);
|
||||
|
||||
AOS.Damage(target, from, weapon.WeaponDamage, 100, 0, 0, 0, 0);
|
||||
|
|
@ -245,13 +298,20 @@ namespace Server.Items
|
|||
if (weapon.Poison != null && weapon.PoisonCharges > 0)
|
||||
{
|
||||
if (EvilOmenSpell.TryEndEffect(target))
|
||||
target.ApplyPoison(from, Poison.GetPoison(weapon.Poison.Level + 1));
|
||||
{
|
||||
target.ApplyPoison(@from, Poison.GetPoison(weapon.Poison.Level + 1));
|
||||
}
|
||||
else
|
||||
target.ApplyPoison(from, weapon.Poison);
|
||||
{
|
||||
target.ApplyPoison(@from, weapon.Poison);
|
||||
}
|
||||
|
||||
weapon.PoisonCharges--;
|
||||
|
||||
if (weapon.PoisonCharges < 1) weapon.Poison = null;
|
||||
if (weapon.PoisonCharges < 1)
|
||||
{
|
||||
weapon.Poison = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -260,11 +320,17 @@ namespace Server.Items
|
|||
if (from is PlayerMobile player && WeaponIsValid(weapon, from))
|
||||
{
|
||||
if (targeted is Mobile mobile)
|
||||
{
|
||||
Shoot(player, mobile, weapon);
|
||||
}
|
||||
else if (targeted.GetType() == weapon.AmmoType)
|
||||
{
|
||||
Reload(player, weapon, (INinjaAmmo)targeted);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendLocalizedMessage(weapon.WrongAmmoMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -282,7 +348,9 @@ namespace Server.Items
|
|||
public override void OnClick()
|
||||
{
|
||||
if (WeaponIsValid(weapon, Owner.From))
|
||||
{
|
||||
Owner.From.BeginTarget(10, false, TargetFlags.Harmful, OnTarget, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -300,7 +368,10 @@ namespace Server.Items
|
|||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (WeaponIsValid(weapon, Owner.From)) Unload(Owner.From, weapon);
|
||||
if (WeaponIsValid(weapon, Owner.From))
|
||||
{
|
||||
Unload(Owner.From, weapon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ namespace Server.Items
|
|||
)
|
||||
{
|
||||
if (quality == 2)
|
||||
{
|
||||
UsesRemaining *= 2;
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
|
@ -79,7 +81,9 @@ namespace Server.Items
|
|||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
|
||||
if (m_Poison != null && m_PoisonCharges > 0)
|
||||
{
|
||||
list.Add(1062412 + m_Poison.Level, m_PoisonCharges.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Name == "sand")
|
||||
{
|
||||
Name = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,9 +142,13 @@ namespace Server.Items
|
|||
AddBackground(10, 10, 430, 430, 3000);
|
||||
|
||||
if (m_Definition.TitleString != null)
|
||||
{
|
||||
AddHtml(20, 30, 400, 25, m_Definition.TitleString);
|
||||
}
|
||||
else if (m_Definition.Title > 0)
|
||||
{
|
||||
AddHtmlLocalized(20, 30, 400, 25, m_Definition.Title);
|
||||
}
|
||||
|
||||
AddButton(20, 400, 4005, 4007, 1);
|
||||
AddHtmlLocalized(55, 400, 200, 25, 1011036); // OKAY
|
||||
|
|
@ -165,9 +169,13 @@ namespace Server.Items
|
|||
AddButton(30, 85 + i * 25, 5224, 5224, 0, GumpButtonType.Page, 1 + i);
|
||||
|
||||
if (groups[i].NameString != null)
|
||||
{
|
||||
AddHtml(55, 85 + i * 25, 200, 25, groups[i].NameString);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(55, 85 + i * 25, 200, 25, groups[i].Name);
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < groups.Length; ++i)
|
||||
|
|
@ -204,7 +212,9 @@ namespace Server.Items
|
|||
var hues = m_Definition.Groups[group].Hues;
|
||||
|
||||
if (index >= 0 && index < hues.Length)
|
||||
{
|
||||
m_Callback(m_From, m_State, hues[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +223,9 @@ namespace Server.Items
|
|||
case 2: // Default
|
||||
{
|
||||
if (m_Definition.DefaultSupported)
|
||||
{
|
||||
m_Callback(m_From, m_State, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,11 +142,17 @@ namespace Server.Items
|
|||
else if (item is IDyable dyable && m_Tub.AllowDyables)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
{
|
||||
@from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (item.Parent is Mobile)
|
||||
from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
|
||||
{
|
||||
@from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
|
||||
}
|
||||
else if (dyable.Dye(from, m_Tub))
|
||||
from.PlaySound(0x23E);
|
||||
{
|
||||
@from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else if ((FurnitureAttribute.Check(item) || item is PotionKeg) && m_Tub.AllowFurniture)
|
||||
{
|
||||
|
|
@ -165,11 +171,17 @@ namespace Server.Items
|
|||
var house = BaseHouse.FindHouseAt(item);
|
||||
|
||||
if (house == null || !house.HasLockedDownItem(item) && !house.HasSecureItem(item))
|
||||
from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
|
||||
{
|
||||
@from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
|
||||
}
|
||||
else if (!house.IsCoOwner(from))
|
||||
from.SendLocalizedMessage(501023); // You must be the owner to use this item.
|
||||
{
|
||||
@from.SendLocalizedMessage(501023); // You must be the owner to use this item.
|
||||
}
|
||||
else
|
||||
{
|
||||
okay = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -33,7 +35,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
@ -61,7 +65,9 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (LootType == LootType.Regular)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -34,7 +36,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076218); // 2nd Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,11 @@ namespace Server.Items
|
|||
{
|
||||
case 1: // Okay
|
||||
{
|
||||
if (info.Switches.Length > 0) m_Callback(m_From, m_State, info.Switches[0]);
|
||||
if (info.Switches.Length > 0)
|
||||
{
|
||||
m_Callback(m_From, m_State, info.Switches[0]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // Default
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -34,7 +36,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -34,7 +36,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076220); // 4th Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -30,7 +32,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
|
@ -34,7 +36,9 @@ namespace Server.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && IsRewardItem)
|
||||
{
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 0.0)
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
/* m_UsesRemaining = ( version == 0 ) ? 25 : reader.ReadInt(); */
|
||||
}
|
||||
|
|
@ -66,11 +68,17 @@ namespace Server.Items
|
|||
if (tub.Redyable)
|
||||
{
|
||||
if (tub.MetallicHues) /* OSI has three metallic tubs now */
|
||||
from.SendGump(new MetallicHuePicker<DyeTub>(from, SetTubHue, tub));
|
||||
{
|
||||
@from.SendGump(new MetallicHuePicker<DyeTub>(@from, SetTubHue, tub));
|
||||
}
|
||||
else if (tub.CustomHuePicker != null)
|
||||
from.SendGump(new CustomHuePickerGump<DyeTub>(from, tub.CustomHuePicker, SetTubHue, tub));
|
||||
{
|
||||
@from.SendGump(new CustomHuePickerGump<DyeTub>(@from, tub.CustomHuePicker, SetTubHue, tub));
|
||||
}
|
||||
else
|
||||
from.SendHuePicker(new InternalPicker(tub));
|
||||
{
|
||||
@from.SendHuePicker(new InternalPicker(tub));
|
||||
}
|
||||
}
|
||||
else if (tub is BlackDyeTub)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (targeted is Item && !((Item)targeted).IsStandardLoot())
|
||||
{
|
||||
|
|
@ -84,13 +86,19 @@ namespace Server.Items
|
|||
else if (targeted is Item item && !item.Movable)
|
||||
{
|
||||
if (item is IScissorable obj && (obj is PlagueBeastInnard || obj is PlagueBeastMutationCore))
|
||||
if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
|
||||
from.PlaySound(0x248);
|
||||
{
|
||||
if (CanScissor(@from, obj) && obj.Scissor(@from, m_Item))
|
||||
{
|
||||
@from.PlaySound(0x248);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (targeted is IScissorable obj)
|
||||
{
|
||||
if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
|
||||
from.PlaySound(0x248);
|
||||
{
|
||||
@from.PlaySound(0x248);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -103,7 +111,9 @@ namespace Server.Items
|
|||
if (targeted is IScissorable obj && (obj is PlagueBeastInnard || obj is PlagueBeastMutationCore))
|
||||
{
|
||||
if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
|
||||
from.PlaySound(0x248);
|
||||
{
|
||||
@from.PlaySound(0x248);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,23 +41,41 @@ namespace Server.Items
|
|||
var pm = from as PlayerMobile;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042001);
|
||||
{
|
||||
@from.SendLocalizedMessage(1042001);
|
||||
}
|
||||
else if (pm == null || pm.NpcGuild != NpcGuild.ThievesGuild)
|
||||
from.SendLocalizedMessage(501702);
|
||||
{
|
||||
@from.SendLocalizedMessage(501702);
|
||||
}
|
||||
else if (Stealing.SuspendOnMurder && pm.Kills > 0)
|
||||
from.SendLocalizedMessage(501703);
|
||||
{
|
||||
@from.SendLocalizedMessage(501703);
|
||||
}
|
||||
else if (!from.CanBeginAction<IncognitoSpell>())
|
||||
from.SendLocalizedMessage(501704);
|
||||
{
|
||||
@from.SendLocalizedMessage(501704);
|
||||
}
|
||||
else if (Sigil.ExistsOn(from))
|
||||
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil
|
||||
{
|
||||
@from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil
|
||||
}
|
||||
else if (TransformationSpellHelper.UnderTransformation(from))
|
||||
from.SendLocalizedMessage(1061634);
|
||||
{
|
||||
@from.SendLocalizedMessage(1061634);
|
||||
}
|
||||
else if (from.BodyMod == 183 || from.BodyMod == 184)
|
||||
from.SendLocalizedMessage(1040002);
|
||||
{
|
||||
@from.SendLocalizedMessage(1040002);
|
||||
}
|
||||
else if (!from.CanBeginAction<PolymorphSpell>() || from.IsBodyMod)
|
||||
from.SendLocalizedMessage(501705);
|
||||
{
|
||||
@from.SendLocalizedMessage(501705);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -65,7 +83,9 @@ namespace Server.Items
|
|||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (ValidateUse(from))
|
||||
from.SendGump(new DisguiseGump(from, this, true, false));
|
||||
{
|
||||
@from.SendGump(new DisguiseGump(@from, this, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +173,9 @@ namespace Server.Items
|
|||
var entry = entries[i];
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var x = i % 2 * 205;
|
||||
var y = i / 2 * 55;
|
||||
|
|
@ -174,9 +196,13 @@ namespace Server.Items
|
|||
if (info.ButtonID == 0)
|
||||
{
|
||||
if (m_Used)
|
||||
{
|
||||
m_From.SendLocalizedMessage(501706); // Disguises wear off after 2 hours.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(501707); // You're looking good.
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -184,7 +210,9 @@ namespace Server.Items
|
|||
var switches = info.Switches;
|
||||
|
||||
if (switches.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var switched = switches[0];
|
||||
var type = switched % 2;
|
||||
|
|
@ -199,22 +227,32 @@ namespace Server.Items
|
|||
var entry = entries[index];
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_Kit.ValidateUse(m_From))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hair && (m_From.Female || m_From.Body.IsFemale))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_From.NameMod = NameList.RandomName(m_From.Female ? "female" : "male");
|
||||
|
||||
if (m_From is PlayerMobile pm)
|
||||
{
|
||||
if (hair)
|
||||
{
|
||||
pm.SetHairMods(entry.m_ItemID, -2);
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SetHairMods(-2, entry.m_ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));
|
||||
|
|
@ -257,7 +295,9 @@ namespace Server.Items
|
|||
public static void CreateTimer(Mobile m, TimeSpan delay)
|
||||
{
|
||||
if (m != null && !IsDisguised(m))
|
||||
{
|
||||
Timers[m] = new InternalTimer(m, delay);
|
||||
}
|
||||
}
|
||||
|
||||
public static void StartTimer(Mobile m)
|
||||
|
|
@ -271,11 +311,15 @@ namespace Server.Items
|
|||
public static void StopTimer(Mobile m)
|
||||
{
|
||||
if (!Timers.TryGetValue(m, out var t))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ts = t.Next - DateTime.UtcNow;
|
||||
if (ts < TimeSpan.Zero)
|
||||
{
|
||||
ts = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
t.Delay = ts;
|
||||
t.Stop();
|
||||
|
|
@ -307,7 +351,9 @@ namespace Server.Items
|
|||
m_Player.NameMod = null;
|
||||
|
||||
if (m_Player is PlayerMobile mobile)
|
||||
{
|
||||
mobile.SetHairMods(-1, -1);
|
||||
}
|
||||
|
||||
RemoveTimer(m_Player);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,13 @@ namespace Server.Items
|
|||
Movable = false;
|
||||
|
||||
if (Instance?.Deleted != false)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public DisguisePersistance(Serial serial) : base(serial) => Instance = this;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && Weight == 0.1)
|
||||
{
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
|
|
@ -60,7 +62,9 @@ namespace Server.Items
|
|||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is ILockpickable lockpickable)
|
||||
{
|
||||
|
|
@ -119,7 +123,9 @@ namespace Server.Items
|
|||
var item = (Item)m_Item;
|
||||
|
||||
if (!m_From.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Item.LockLevel == 0 || m_Item.LockLevel == -255)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ namespace Server.Items
|
|||
GetTime(map, x, y, out _, out _, out var totalMinutes);
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
totalMinutes /= 10 + map.MapIndex * 20;
|
||||
}
|
||||
|
||||
return (MoonPhase)(totalMinutes % 8);
|
||||
}
|
||||
|
|
@ -58,7 +60,9 @@ namespace Server.Items
|
|||
totalMinutes = (int)(timeSpan.TotalSeconds / SecondsPerUOMinute);
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
totalMinutes += map.MapIndex * 320;
|
||||
}
|
||||
|
||||
// Really on OSI this must be by subserver
|
||||
totalMinutes += x / 16;
|
||||
|
|
@ -91,26 +95,44 @@ namespace Server.Items
|
|||
// 08:00 PM - 11:59 AM : Late at night
|
||||
|
||||
if (hours >= 20)
|
||||
{
|
||||
generalNumber = 1042957; // It's late at night
|
||||
}
|
||||
else if (hours >= 16)
|
||||
{
|
||||
generalNumber = 1042956; // It's early in the evening
|
||||
}
|
||||
else if (hours >= 13)
|
||||
{
|
||||
generalNumber = 1042955; // It's the afternoon
|
||||
}
|
||||
else if (hours >= 12)
|
||||
{
|
||||
generalNumber = 1042954; // It's around noon
|
||||
}
|
||||
else if (hours >= 08)
|
||||
{
|
||||
generalNumber = 1042953; // It's late in the morning
|
||||
}
|
||||
else if (hours >= 04)
|
||||
{
|
||||
generalNumber = 1042952; // It's early in the morning
|
||||
}
|
||||
else if (hours >= 01)
|
||||
{
|
||||
generalNumber = 1042951; // It's the middle of the night
|
||||
}
|
||||
else
|
||||
{
|
||||
generalNumber = 1042950; // 'Tis the witching hour. 12 Midnight.
|
||||
}
|
||||
|
||||
hours %= 12;
|
||||
|
||||
if (hours == 0)
|
||||
{
|
||||
hours = 12;
|
||||
}
|
||||
|
||||
exactTime = $"{hours}:{minutes:D2}";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ namespace Server.Items
|
|||
var qs = player.Quest;
|
||||
|
||||
if (!(qs is WitchApprenticeQuest))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = qs.FindObjective<FindIngredientObjective>();
|
||||
|
||||
|
|
|
|||
|
|
@ -116,12 +116,18 @@ namespace Server.Items
|
|||
v = 100 - v;
|
||||
|
||||
if (LootPack.CheckLuck(m_LuckChance))
|
||||
{
|
||||
v += 10;
|
||||
}
|
||||
|
||||
if (v < min)
|
||||
{
|
||||
v = min;
|
||||
}
|
||||
else if (v > max)
|
||||
{
|
||||
v = max;
|
||||
}
|
||||
|
||||
percent = v;
|
||||
}
|
||||
|
|
@ -129,7 +135,9 @@ namespace Server.Items
|
|||
var scaledBy = Math.Abs(high - low) + 1;
|
||||
|
||||
if (scaledBy != 0)
|
||||
{
|
||||
scaledBy = 10000 / scaledBy;
|
||||
}
|
||||
|
||||
percent *= 10000 + scaledBy;
|
||||
|
||||
|
|
@ -142,12 +150,18 @@ namespace Server.Items
|
|||
)
|
||||
{
|
||||
if (attr == AosAttribute.CastSpeed)
|
||||
{
|
||||
attrs[attr] += Scale(min, max, low / scale, high / scale) * scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
attrs[attr] = Scale(min, max, low / scale, high / scale) * scale;
|
||||
}
|
||||
|
||||
if (attr == AosAttribute.SpellChanneling)
|
||||
{
|
||||
attrs[AosAttribute.CastSpeed] -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyAttribute(
|
||||
|
|
@ -214,7 +228,9 @@ namespace Server.Items
|
|||
possibleSkills.Remove(sk);
|
||||
|
||||
for (var i = 0; !found && i < 5; ++i)
|
||||
{
|
||||
found = attrs.GetValues(i, out var check, out _) && check == sk;
|
||||
}
|
||||
} while (found && count > 0);
|
||||
|
||||
attrs.SetValues(index, sk, Scale(min, max, low, high));
|
||||
|
|
@ -247,11 +263,17 @@ namespace Server.Items
|
|||
var avail = 0;
|
||||
|
||||
for (var i = 0; i < count; ++i)
|
||||
{
|
||||
if (!m_Props[i])
|
||||
{
|
||||
m_Possible[avail++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (avail == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var v = m_Possible[Utility.Random(avail)];
|
||||
|
||||
|
|
@ -267,7 +289,9 @@ namespace Server.Items
|
|||
var attrs = resInfo?.AttributeInfo;
|
||||
|
||||
if (attrs == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var attributeCount = Utility.RandomMinMax(attrs.RunicMinAttributes, attrs.RunicMaxAttributes);
|
||||
var min = attrs.RunicMinIntensity;
|
||||
|
|
@ -295,14 +319,18 @@ namespace Server.Items
|
|||
m_Props.SetAll(false);
|
||||
|
||||
if (weapon is BaseRanged)
|
||||
{
|
||||
m_Props.Set(2, true); // ranged weapons cannot be ubws or mageweapon
|
||||
}
|
||||
|
||||
for (var i = 0; i < attributeCount; ++i)
|
||||
{
|
||||
var random = GetUniqueRandom(25);
|
||||
|
||||
if (random == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (random)
|
||||
{
|
||||
|
|
@ -453,6 +481,7 @@ namespace Server.Items
|
|||
};
|
||||
|
||||
if (randomizeOrder)
|
||||
{
|
||||
for (var i = 0; i < attrs.Length; i++)
|
||||
{
|
||||
var temp = attrs[i];
|
||||
|
|
@ -461,6 +490,7 @@ namespace Server.Items
|
|||
attrs[i] = attrs[rand];
|
||||
attrs[rand] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
totalDamage = AssignElementalDamage( weapon, AosElementAttribute.Cold, totalDamage );
|
||||
|
|
@ -472,7 +502,9 @@ namespace Server.Items
|
|||
* */
|
||||
|
||||
for (var i = 0; i < attrs.Length; i++)
|
||||
{
|
||||
totalDamage = AssignElementalDamage(weapon, attrs[i], totalDamage);
|
||||
}
|
||||
|
||||
// Order is Cold, Energy, Fire, Poison -> Physical left
|
||||
// Cannot be looped, AoselementAttribute is 'out of order'
|
||||
|
|
@ -483,7 +515,9 @@ namespace Server.Items
|
|||
private static int AssignElementalDamage(BaseWeapon weapon, AosElementAttribute attr, int totalDamage)
|
||||
{
|
||||
if (totalDamage <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var random = Utility.Random(totalDamage / 10 + 1) * 10;
|
||||
weapon.AosElementDamages[attr] = random;
|
||||
|
|
@ -498,7 +532,9 @@ namespace Server.Items
|
|||
var groups = SlayerGroup.Groups;
|
||||
|
||||
if (groups.Length == 0)
|
||||
{
|
||||
return SlayerName.None;
|
||||
}
|
||||
|
||||
var
|
||||
group = groups[
|
||||
|
|
@ -517,7 +553,9 @@ namespace Server.Items
|
|||
var entries = group.Entries;
|
||||
|
||||
if (entries.Length == 0)
|
||||
{
|
||||
return SlayerName.None;
|
||||
}
|
||||
|
||||
entry = entries.RandomElement();
|
||||
}
|
||||
|
|
@ -532,7 +570,9 @@ namespace Server.Items
|
|||
var attrs = resInfo?.AttributeInfo;
|
||||
|
||||
if (attrs == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var attributeCount = Utility.RandomMinMax(attrs.RunicMinAttributes, attrs.RunicMaxAttributes);
|
||||
var min = attrs.RunicMinIntensity;
|
||||
|
|
@ -564,7 +604,10 @@ namespace Server.Items
|
|||
var baseOffset = isShield ? 0 : 4;
|
||||
|
||||
if (!isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All)
|
||||
{
|
||||
m_Props.Set(3, true); // remove mage armor from possible properties
|
||||
}
|
||||
|
||||
if (armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather)
|
||||
{
|
||||
m_Props.Set(0, true); // remove lower requirements from possible properties for leather armor
|
||||
|
|
@ -572,17 +615,21 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if (armor.RequiredRace == Race.Elf)
|
||||
{
|
||||
m_Props.Set(
|
||||
7,
|
||||
true
|
||||
); // elves inherently have night sight and elf only armor doesn't get night sight as a mod
|
||||
}
|
||||
|
||||
for (var i = 0; i < attributeCount; ++i)
|
||||
{
|
||||
var random = GetUniqueRandom(baseCount);
|
||||
|
||||
if (random == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
random += baseOffset;
|
||||
|
||||
|
|
@ -597,9 +644,14 @@ namespace Server.Items
|
|||
break;
|
||||
case 2:
|
||||
if (Core.ML)
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
|
||||
}
|
||||
|
||||
break;
|
||||
case 3:
|
||||
ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
|
||||
|
|
@ -695,7 +747,9 @@ namespace Server.Items
|
|||
var random = GetUniqueRandom(19);
|
||||
|
||||
if (random == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (random)
|
||||
{
|
||||
|
|
@ -784,7 +838,9 @@ namespace Server.Items
|
|||
var random = GetUniqueRandom(24);
|
||||
|
||||
if (random == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (random)
|
||||
{
|
||||
|
|
@ -887,7 +943,9 @@ namespace Server.Items
|
|||
var random = GetUniqueRandom(16);
|
||||
|
||||
if (random == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
switch (random)
|
||||
{
|
||||
|
|
@ -899,7 +957,9 @@ namespace Server.Items
|
|||
ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
|
||||
|
||||
for (var j = 0; j < 4; ++j)
|
||||
{
|
||||
m_Props.Set(j, true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,9 @@ namespace Server.Items
|
|||
Quality = (ToolQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
{
|
||||
Crafter = @from;
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
|
@ -105,7 +107,9 @@ namespace Server.Items
|
|||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ToolQuality.Exceptional)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
|
@ -119,7 +123,9 @@ namespace Server.Items
|
|||
// list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
if (m_Quality == ToolQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
|
@ -136,7 +142,9 @@ namespace Server.Items
|
|||
var check = m.FindItemOnLayer(Layer.OneHanded);
|
||||
|
||||
if (check is BaseTool && check != tool && !(check is AncientSmithyHammer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
check = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
|
|
@ -160,9 +168,13 @@ namespace Server.Items
|
|||
|
||||
// Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
if (num > 0 && (num != 1044267 || !Core.SE))
|
||||
from.SendLocalizedMessage(num);
|
||||
{
|
||||
@from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
from.SendGump(new CraftGump(from, system, this, null));
|
||||
{
|
||||
@from.SendGump(new CraftGump(@from, system, this, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 2.0)
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 1.0)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 1.0)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 1.0)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 2.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Server.Items
|
|||
var index = CraftResources.GetIndex(Resource);
|
||||
|
||||
if (index >= 1 && index <= 6)
|
||||
{
|
||||
return 1072633 + index;
|
||||
}
|
||||
|
||||
return 1024137; // dovetail saw
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Server.Items
|
|||
var index = CraftResources.GetIndex(Resource);
|
||||
|
||||
if (index >= 1 && index <= 6)
|
||||
{
|
||||
return 1072627 + index;
|
||||
}
|
||||
|
||||
return 1044559; // Fletcher's Tools
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ namespace Server.Items
|
|||
var index = CraftResources.GetIndex(Resource);
|
||||
|
||||
if (index >= 1 && index <= 8)
|
||||
{
|
||||
return 1049019 + index;
|
||||
}
|
||||
|
||||
return 1045128; // runic smithy hammer
|
||||
}
|
||||
|
|
@ -47,16 +49,22 @@ namespace Server.Items
|
|||
var index = CraftResources.GetIndex(Resource);
|
||||
|
||||
if (index >= 1 && index <= 8)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CraftResources.IsStandard(Resource))
|
||||
{
|
||||
var num = CraftResources.GetLocalizationNumber(Resource);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
list.Add(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(CraftResources.GetName(Resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,9 +33,13 @@ namespace Server.Items
|
|||
var num = CraftResources.GetLocalizationNumber(Resource);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
v = $"#{num}";
|
||||
}
|
||||
else
|
||||
{
|
||||
v = CraftResources.GetName(Resource);
|
||||
}
|
||||
}
|
||||
|
||||
list.Add(1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
|
||||
|
|
@ -50,9 +54,13 @@ namespace Server.Items
|
|||
var num = CraftResources.GetLocalizationNumber(Resource);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
v = $"#{num}";
|
||||
}
|
||||
else
|
||||
{
|
||||
v = CraftResources.GetName(Resource);
|
||||
}
|
||||
}
|
||||
|
||||
LabelTo(from, 1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
|
||||
|
|
@ -72,7 +80,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (ItemID == 0x13E4 || ItemID == 0x13E3)
|
||||
{
|
||||
ItemID = 0xF9D;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ namespace Server.Items
|
|||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 2.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue