Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -30,7 +30,6 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
private Timer m_Timer;
|
||||
private DateTime m_Created;
|
||||
|
||||
private ArrayList m_Entries;
|
||||
|
||||
|
|
@ -41,7 +40,7 @@ namespace Server.Items
|
|||
|
||||
m_Entries = new ArrayList();
|
||||
|
||||
m_Created = DateTime.UtcNow;
|
||||
Created = DateTime.UtcNow;
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), OnTick );
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +49,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime Created => m_Created;
|
||||
public DateTime Created { get; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CampfireStatus Status
|
||||
|
|
@ -178,14 +177,13 @@ namespace Server.Items
|
|||
|
||||
public class CampfireEntry
|
||||
{
|
||||
private PlayerMobile m_Player;
|
||||
private Campfire m_Fire;
|
||||
private DateTime m_Start;
|
||||
private bool m_Safe;
|
||||
|
||||
public PlayerMobile Player => m_Player;
|
||||
public Campfire Fire => m_Fire;
|
||||
public DateTime Start => m_Start;
|
||||
public PlayerMobile Player { get; }
|
||||
|
||||
public Campfire Fire { get; }
|
||||
|
||||
public DateTime Start { get; }
|
||||
|
||||
public bool Valid => !Fire.Deleted && Fire.Status != CampfireStatus.Off && Player.Map == Fire.Map && Player.InRange( Fire, Campfire.SecureRange );
|
||||
|
||||
|
|
@ -197,9 +195,9 @@ namespace Server.Items
|
|||
|
||||
public CampfireEntry( PlayerMobile player, Campfire fire )
|
||||
{
|
||||
m_Player = player;
|
||||
m_Fire = fire;
|
||||
m_Start = DateTime.UtcNow;
|
||||
Player = player;
|
||||
Fire = fire;
|
||||
Start = DateTime.UtcNow;
|
||||
m_Safe = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,21 +65,19 @@ namespace Server.Items
|
|||
{
|
||||
public TrophyInfo( Type type, int id, int deedNum, int addonNum )
|
||||
{
|
||||
m_CreatureType = type;
|
||||
m_NorthID = id;
|
||||
m_DeedNumber = deedNum;
|
||||
m_AddonNumber = addonNum;
|
||||
CreatureType = type;
|
||||
NorthID = id;
|
||||
DeedNumber = deedNum;
|
||||
AddonNumber = addonNum;
|
||||
}
|
||||
|
||||
private Type m_CreatureType;
|
||||
private int m_NorthID;
|
||||
private int m_DeedNumber;
|
||||
private int m_AddonNumber;
|
||||
public Type CreatureType { get; }
|
||||
|
||||
public Type CreatureType => m_CreatureType;
|
||||
public int NorthID => m_NorthID;
|
||||
public int DeedNumber => m_DeedNumber;
|
||||
public int AddonNumber => m_AddonNumber;
|
||||
public int NorthID { get; }
|
||||
|
||||
public int DeedNumber { get; }
|
||||
|
||||
public int AddonNumber { get; }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -170,28 +168,19 @@ namespace Server.Items
|
|||
{
|
||||
public override bool ForceShowProperties => ObjectPropertyList.Enabled;
|
||||
|
||||
private int m_WestID;
|
||||
private int m_NorthID;
|
||||
private int m_DeedNumber;
|
||||
private int m_AddonNumber;
|
||||
|
||||
private Mobile m_Hunter;
|
||||
private int m_AnimalWeight;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int WestID{ get => m_WestID;
|
||||
set => m_WestID = value;
|
||||
}
|
||||
public int WestID { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int NorthID{ get => m_NorthID;
|
||||
set => m_NorthID = value;
|
||||
}
|
||||
public int NorthID { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int DeedNumber{ get => m_DeedNumber;
|
||||
set => m_DeedNumber = value;
|
||||
}
|
||||
public int DeedNumber { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int AddonNumber{ get => m_AddonNumber;
|
||||
|
|
@ -214,9 +203,9 @@ namespace Server.Items
|
|||
|
||||
public TrophyAddon( Mobile from, int itemID, int westID, int northID, int deedNumber, int addonNumber, Mobile hunter, int animalWeight ) : base( itemID )
|
||||
{
|
||||
m_WestID = westID;
|
||||
m_NorthID = northID;
|
||||
m_DeedNumber = deedNumber;
|
||||
WestID = westID;
|
||||
NorthID = northID;
|
||||
DeedNumber = deedNumber;
|
||||
m_AddonNumber = addonNumber;
|
||||
|
||||
m_Hunter = hunter;
|
||||
|
|
@ -249,7 +238,7 @@ namespace Server.Items
|
|||
if ( !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
|
||||
if ( ItemID == m_NorthID )
|
||||
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
|
||||
}
|
||||
|
|
@ -263,9 +252,9 @@ namespace Server.Items
|
|||
writer.Write( (Mobile) m_Hunter );
|
||||
writer.Write( (int) m_AnimalWeight );
|
||||
|
||||
writer.Write( (int) m_WestID );
|
||||
writer.Write( (int) m_NorthID );
|
||||
writer.Write( (int) m_DeedNumber );
|
||||
writer.Write( (int) WestID );
|
||||
writer.Write( (int) NorthID );
|
||||
writer.Write( (int) DeedNumber );
|
||||
writer.Write( (int) m_AddonNumber );
|
||||
}
|
||||
|
||||
|
|
@ -285,9 +274,9 @@ namespace Server.Items
|
|||
}
|
||||
case 0:
|
||||
{
|
||||
m_WestID = reader.ReadInt();
|
||||
m_NorthID = reader.ReadInt();
|
||||
m_DeedNumber = reader.ReadInt();
|
||||
WestID = reader.ReadInt();
|
||||
NorthID = reader.ReadInt();
|
||||
DeedNumber = reader.ReadInt();
|
||||
m_AddonNumber = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
|
|
@ -319,7 +308,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
public Item Deed => new TrophyDeed( m_WestID, m_NorthID, m_DeedNumber, m_AddonNumber, m_Hunter, m_AnimalWeight );
|
||||
public Item Deed => new TrophyDeed( WestID, NorthID, DeedNumber, m_AddonNumber, m_Hunter, m_AnimalWeight );
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
|
|
@ -343,32 +332,23 @@ namespace Server.Items
|
|||
[Flippable( 0x14F0, 0x14EF )]
|
||||
public class TrophyDeed : Item
|
||||
{
|
||||
private int m_WestID;
|
||||
private int m_NorthID;
|
||||
private int m_DeedNumber;
|
||||
private int m_AddonNumber;
|
||||
|
||||
private Mobile m_Hunter;
|
||||
private int m_AnimalWeight;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int WestID{ get => m_WestID;
|
||||
set => m_WestID = value;
|
||||
}
|
||||
public int WestID { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int NorthID{ get => m_NorthID;
|
||||
set => m_NorthID = value;
|
||||
}
|
||||
public int NorthID { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int DeedNumber{ get => m_DeedNumber;
|
||||
set{ m_DeedNumber = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int AddonNumber{ get => m_AddonNumber;
|
||||
set => m_AddonNumber = value;
|
||||
}
|
||||
public int AddonNumber { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Hunter{ get => m_Hunter;
|
||||
|
|
@ -387,10 +367,10 @@ namespace Server.Items
|
|||
|
||||
public TrophyDeed( int westID, int northID, int deedNumber, int addonNumber, Mobile hunter, int animalWeight ) : base( 0x14F0 )
|
||||
{
|
||||
m_WestID = westID;
|
||||
m_NorthID = northID;
|
||||
WestID = westID;
|
||||
NorthID = northID;
|
||||
m_DeedNumber = deedNumber;
|
||||
m_AddonNumber = addonNumber;
|
||||
AddonNumber = addonNumber;
|
||||
m_Hunter = hunter;
|
||||
m_AnimalWeight = animalWeight;
|
||||
}
|
||||
|
|
@ -425,10 +405,10 @@ namespace Server.Items
|
|||
writer.Write( (Mobile) m_Hunter );
|
||||
writer.Write( (int) m_AnimalWeight );
|
||||
|
||||
writer.Write( (int) m_WestID );
|
||||
writer.Write( (int) m_NorthID );
|
||||
writer.Write( (int) WestID );
|
||||
writer.Write( (int) NorthID );
|
||||
writer.Write( (int) m_DeedNumber );
|
||||
writer.Write( (int) m_AddonNumber );
|
||||
writer.Write( (int) AddonNumber );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -447,10 +427,10 @@ namespace Server.Items
|
|||
}
|
||||
case 0:
|
||||
{
|
||||
m_WestID = reader.ReadInt();
|
||||
m_NorthID = reader.ReadInt();
|
||||
WestID = reader.ReadInt();
|
||||
NorthID = reader.ReadInt();
|
||||
m_DeedNumber = reader.ReadInt();
|
||||
m_AddonNumber = reader.ReadInt();
|
||||
AddonNumber = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -484,15 +464,15 @@ namespace Server.Items
|
|||
int itemID = 0;
|
||||
|
||||
if ( northWall )
|
||||
itemID = m_NorthID;
|
||||
itemID = NorthID;
|
||||
else if ( westWall )
|
||||
itemID = m_WestID;
|
||||
itemID = WestID;
|
||||
else
|
||||
from.SendLocalizedMessage( 1042626 ); // The trophy must be placed next to a wall.
|
||||
|
||||
if ( itemID > 0 )
|
||||
{
|
||||
house.Addons.Add( new TrophyAddon( from, itemID, m_WestID, m_NorthID, m_DeedNumber, m_AddonNumber, m_Hunter, m_AnimalWeight ) );
|
||||
house.Addons.Add( new TrophyAddon( from, itemID, WestID, NorthID, m_DeedNumber, AddonNumber, m_Hunter, m_AnimalWeight ) );
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,15 +14,10 @@ namespace Server.Items
|
|||
|
||||
public override int LabelNumber => 1041080; // a message in a bottle
|
||||
|
||||
private Map m_TargetMap;
|
||||
private int m_Level;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
{
|
||||
get => m_TargetMap;
|
||||
set => m_TargetMap = value;
|
||||
}
|
||||
public Map TargetMap { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Level
|
||||
|
|
@ -44,7 +39,7 @@ namespace Server.Items
|
|||
public MessageInABottle( Map map, int level ) : base( 0x099F )
|
||||
{
|
||||
Weight = 1.0;
|
||||
m_TargetMap = map;
|
||||
TargetMap = map;
|
||||
m_Level = level;
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +55,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) m_Level );
|
||||
|
||||
writer.Write( m_TargetMap );
|
||||
writer.Write( TargetMap );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -79,12 +74,12 @@ namespace Server.Items
|
|||
}
|
||||
case 1:
|
||||
{
|
||||
m_TargetMap = reader.ReadMap();
|
||||
TargetMap = reader.ReadMap();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_TargetMap = Map.Trammel;
|
||||
TargetMap = Map.Trammel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -92,15 +87,15 @@ namespace Server.Items
|
|||
if ( version < 2 )
|
||||
m_Level = GetRandomLevel();
|
||||
|
||||
if ( version < 3 && m_TargetMap == Map.Tokuno )
|
||||
m_TargetMap = Map.Trammel;
|
||||
if ( version < 3 && TargetMap == Map.Tokuno )
|
||||
TargetMap = Map.Trammel;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
ReplaceWith( new SOS( m_TargetMap, m_Level ) );
|
||||
ReplaceWith( new SOS( TargetMap, m_Level ) );
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 501891 ); // You extract the message from the bottle.
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
private int m_Level;
|
||||
private Map m_TargetMap;
|
||||
private Point3D m_TargetLocation;
|
||||
private int m_MessageIndex;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsAncient => ( m_Level >= 4 );
|
||||
|
|
@ -38,25 +35,13 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
{
|
||||
get => m_TargetMap;
|
||||
set => m_TargetMap = value;
|
||||
}
|
||||
public Map TargetMap { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D TargetLocation
|
||||
{
|
||||
get => m_TargetLocation;
|
||||
set => m_TargetLocation = value;
|
||||
}
|
||||
public Point3D TargetLocation { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageIndex
|
||||
{
|
||||
get => m_MessageIndex;
|
||||
set => m_MessageIndex = value;
|
||||
}
|
||||
public int MessageIndex { get; set; }
|
||||
|
||||
public void UpdateHue()
|
||||
{
|
||||
|
|
@ -82,9 +67,9 @@ namespace Server.Items
|
|||
Weight = 1.0;
|
||||
|
||||
m_Level = level;
|
||||
m_MessageIndex = Utility.Random( MessageEntry.Entries.Length );
|
||||
m_TargetMap = map;
|
||||
m_TargetLocation = FindLocation( m_TargetMap );
|
||||
MessageIndex = Utility.Random( MessageEntry.Entries.Length );
|
||||
TargetMap = map;
|
||||
TargetLocation = FindLocation( TargetMap );
|
||||
|
||||
UpdateHue();
|
||||
}
|
||||
|
|
@ -101,9 +86,9 @@ namespace Server.Items
|
|||
|
||||
writer.Write( m_Level );
|
||||
|
||||
writer.Write( m_TargetMap );
|
||||
writer.Write( m_TargetLocation );
|
||||
writer.Write( m_MessageIndex );
|
||||
writer.Write( TargetMap );
|
||||
writer.Write( TargetLocation );
|
||||
writer.Write( MessageIndex );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -123,21 +108,21 @@ namespace Server.Items
|
|||
}
|
||||
case 1:
|
||||
{
|
||||
m_TargetMap = reader.ReadMap();
|
||||
m_TargetLocation = reader.ReadPoint3D();
|
||||
m_MessageIndex = reader.ReadInt();
|
||||
TargetMap = reader.ReadMap();
|
||||
TargetLocation = reader.ReadPoint3D();
|
||||
MessageIndex = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_TargetMap = Map;
|
||||
TargetMap = Map;
|
||||
|
||||
if ( m_TargetMap == null || m_TargetMap == Map.Internal )
|
||||
m_TargetMap = Map.Trammel;
|
||||
if ( TargetMap == null || TargetMap == Map.Internal )
|
||||
TargetMap = Map.Trammel;
|
||||
|
||||
m_TargetLocation = FindLocation( m_TargetMap );
|
||||
m_MessageIndex = Utility.Random( MessageEntry.Entries.Length );
|
||||
TargetLocation = FindLocation( TargetMap );
|
||||
MessageIndex = Utility.Random( MessageEntry.Entries.Length );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -149,8 +134,8 @@ namespace Server.Items
|
|||
if ( version < 3 )
|
||||
UpdateHue();
|
||||
|
||||
if ( version < 4 && m_TargetMap == Map.Tokuno )
|
||||
m_TargetMap = Map.Trammel;
|
||||
if ( version < 4 && TargetMap == Map.Tokuno )
|
||||
TargetMap = Map.Trammel;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
@ -159,13 +144,13 @@ namespace Server.Items
|
|||
{
|
||||
MessageEntry entry;
|
||||
|
||||
if ( m_MessageIndex >= 0 && m_MessageIndex < MessageEntry.Entries.Length )
|
||||
entry = MessageEntry.Entries[m_MessageIndex];
|
||||
if ( MessageIndex >= 0 && MessageIndex < MessageEntry.Entries.Length )
|
||||
entry = MessageEntry.Entries[MessageIndex];
|
||||
else
|
||||
entry = MessageEntry.Entries[m_MessageIndex = Utility.Random( MessageEntry.Entries.Length )];
|
||||
entry = MessageEntry.Entries[MessageIndex = Utility.Random( MessageEntry.Entries.Length )];
|
||||
|
||||
//from.CloseGump( typeof( MessageGump ) );
|
||||
from.SendGump( new MessageGump( entry, m_TargetMap, m_TargetLocation ) );
|
||||
from.SendGump( new MessageGump( entry, TargetMap, TargetLocation ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -297,36 +282,34 @@ namespace Server.Items
|
|||
|
||||
private class MessageEntry
|
||||
{
|
||||
private int m_Width, m_Height;
|
||||
private string m_Message;
|
||||
public int Width { get; }
|
||||
|
||||
public int Width => m_Width;
|
||||
public int Height => m_Height;
|
||||
public string Message => m_Message;
|
||||
public int Height { get; }
|
||||
|
||||
public string Message { get; }
|
||||
|
||||
public MessageEntry( int width, int height, string message )
|
||||
{
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Message = message;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
private static MessageEntry[] m_Entries = {
|
||||
new MessageEntry( 280, 180, "...Ar! {0} and a fair wind! No chance... storms, though--ar! Is that a sea serp...<br><br>uh oh." ),
|
||||
new MessageEntry( 280, 215, "...been inside this whale for three days now. I've run out of food I can pick out of his teeth. I took a sextant reading through the blowhole: {0}. I'll never see my treasure again..." ),
|
||||
new MessageEntry( 280, 285, "...grand adventure! Captain Quacklebush had me swab down the decks daily...<br> ...pirates came, I was in the rigging practicing with my sextant. {0} if I am not mistaken...<br> ....scuttled the ship, and our precious cargo went with her and the screaming pirates, down to the bottom of the sea..." ),
|
||||
new MessageEntry( 280, 180, "Help! Ship going dow...n heavy storms...precious cargo...st reach dest...current coordinates {0}...ve any survivors... ease!" ),
|
||||
new MessageEntry( 280, 215, "...know that the wreck is near {0} but have not found it. Could the message passed down in my family for generations be wrong? No... I swear on the soul of my grandfather, I will find..." ),
|
||||
new MessageEntry( 280, 195, "...never expected an iceberg...silly woman on bow crushed instantly...send help to {0}...ey'll never forget the tragedy of the sinking of the Miniscule..." ),
|
||||
new MessageEntry( 280, 265, "...nobody knew I was a girl. They just assumed I was another sailor...then we met the undine. {0}. It was demanded sacrifice...I was youngset, they figured...<br> ...grabbed the captain's treasure, screamed, 'It'll go down with me!'<br> ...they took me up on it." ),
|
||||
new MessageEntry( 280, 230, "...so I threw the treasure overboard, before the curse could get me too. But I was too late. Now I am doomed to wander these seas, a ghost forever. Join me: seek ye at {0} if thou wishest my company..." ),
|
||||
new MessageEntry( 280, 285, "...then the ship exploded. A dragon swooped by. The slime swallowed Bertie whole--he screamed, it was amazing. The sky glowed orange. A sextant reading put us at {0}. Norma was chattering about sailing over the edge of the world. I looked at my hands and saw through them..." ),
|
||||
new MessageEntry( 280, 285, "...trapped on a deserted island, with a magic fountain supplying wood, fresh water springs, gorgeous scenery, and my lovely young wife. I know the ship with all our life's earnings sank at {0} but I don't know what our coordinates are... someone has GOT to rescue me before Sunday's finals game or I'll go mad..." ),
|
||||
new MessageEntry( 280, 160, "WANTED: divers exp...d in shipwre...overy. Must have own vess...pply at {0}<br>...good benefits, flexible hours..." ),
|
||||
new MessageEntry( 280, 250, "...was a cad and a boor, no matter what momma s...rew him overboard! Oh, Anna, 'twas so exciting!<br> Unfort...y he grabbe...est, and all his riches went with him!<br> ...sked the captain, and he says we're at {0}<br>...so maybe..." )
|
||||
};
|
||||
|
||||
public static MessageEntry[] Entries => m_Entries;
|
||||
public static MessageEntry[] Entries { get; } =
|
||||
{
|
||||
new MessageEntry( 280, 180, "...Ar! {0} and a fair wind! No chance... storms, though--ar! Is that a sea serp...<br><br>uh oh." ),
|
||||
new MessageEntry( 280, 215, "...been inside this whale for three days now. I've run out of food I can pick out of his teeth. I took a sextant reading through the blowhole: {0}. I'll never see my treasure again..." ),
|
||||
new MessageEntry( 280, 285, "...grand adventure! Captain Quacklebush had me swab down the decks daily...<br> ...pirates came, I was in the rigging practicing with my sextant. {0} if I am not mistaken...<br> ....scuttled the ship, and our precious cargo went with her and the screaming pirates, down to the bottom of the sea..." ),
|
||||
new MessageEntry( 280, 180, "Help! Ship going dow...n heavy storms...precious cargo...st reach dest...current coordinates {0}...ve any survivors... ease!" ),
|
||||
new MessageEntry( 280, 215, "...know that the wreck is near {0} but have not found it. Could the message passed down in my family for generations be wrong? No... I swear on the soul of my grandfather, I will find..." ),
|
||||
new MessageEntry( 280, 195, "...never expected an iceberg...silly woman on bow crushed instantly...send help to {0}...ey'll never forget the tragedy of the sinking of the Miniscule..." ),
|
||||
new MessageEntry( 280, 265, "...nobody knew I was a girl. They just assumed I was another sailor...then we met the undine. {0}. It was demanded sacrifice...I was youngset, they figured...<br> ...grabbed the captain's treasure, screamed, 'It'll go down with me!'<br> ...they took me up on it." ),
|
||||
new MessageEntry( 280, 230, "...so I threw the treasure overboard, before the curse could get me too. But I was too late. Now I am doomed to wander these seas, a ghost forever. Join me: seek ye at {0} if thou wishest my company..." ),
|
||||
new MessageEntry( 280, 285, "...then the ship exploded. A dragon swooped by. The slime swallowed Bertie whole--he screamed, it was amazing. The sky glowed orange. A sextant reading put us at {0}. Norma was chattering about sailing over the edge of the world. I looked at my hands and saw through them..." ),
|
||||
new MessageEntry( 280, 285, "...trapped on a deserted island, with a magic fountain supplying wood, fresh water springs, gorgeous scenery, and my lovely young wife. I know the ship with all our life's earnings sank at {0} but I don't know what our coordinates are... someone has GOT to rescue me before Sunday's finals game or I'll go mad..." ),
|
||||
new MessageEntry( 280, 160, "WANTED: divers exp...d in shipwre...overy. Must have own vess...pply at {0}<br>...good benefits, flexible hours..." ),
|
||||
new MessageEntry( 280, 250, "...was a cad and a boor, no matter what momma s...rew him overboard! Oh, Anna, 'twas so exciting!<br> Unfort...y he grabbe...est, and all his riches went with him!<br> ...sked the captain, and he says we're at {0}<br>...so maybe..." )
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,8 @@ namespace Server.Items
|
|||
{
|
||||
public override int LabelNumber => 1041079; // a special fishing net
|
||||
|
||||
private bool m_InUse;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool InUse
|
||||
{
|
||||
get => m_InUse;
|
||||
set => m_InUse = value;
|
||||
}
|
||||
public bool InUse { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public SpecialFishingNet() : base( 0x0DCA )
|
||||
|
|
@ -70,7 +64,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_InUse );
|
||||
writer.Write( InUse );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -83,9 +77,9 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_InUse = reader.ReadBool();
|
||||
InUse = reader.ReadBool();
|
||||
|
||||
if ( m_InUse )
|
||||
if ( InUse )
|
||||
Delete();
|
||||
|
||||
break;
|
||||
|
|
@ -97,7 +91,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_InUse )
|
||||
if ( InUse )
|
||||
{
|
||||
from.SendLocalizedMessage( 1010483 ); // Someone is already using that net!
|
||||
}
|
||||
|
|
@ -116,7 +110,7 @@ namespace Server.Items
|
|||
|
||||
public void OnTarget( Mobile from, object obj )
|
||||
{
|
||||
if ( Deleted || m_InUse )
|
||||
if ( Deleted || InUse )
|
||||
return;
|
||||
|
||||
if ( !(obj is IPoint3D p3D) )
|
||||
|
|
@ -147,7 +141,7 @@ namespace Server.Items
|
|||
from.AddToBackpack( new SpecialFishingNet() );
|
||||
}
|
||||
|
||||
m_InUse = true;
|
||||
InUse = true;
|
||||
Movable = false;
|
||||
MoveToWorld( p, map );
|
||||
|
||||
|
|
|
|||
|
|
@ -10,43 +10,27 @@ namespace Server.Items
|
|||
[DispellableFieldAttribute]
|
||||
public class Moongate : Item
|
||||
{
|
||||
private Point3D m_Target;
|
||||
private Map m_TargetMap;
|
||||
private bool m_bDispellable;
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D Target { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Point3D Target
|
||||
{
|
||||
get => m_Target;
|
||||
set => m_Target = value;
|
||||
}
|
||||
public Map TargetMap { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
{
|
||||
get => m_TargetMap;
|
||||
set => m_TargetMap = value;
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Dispellable
|
||||
{
|
||||
get => m_bDispellable;
|
||||
set => m_bDispellable = value;
|
||||
}
|
||||
public bool Dispellable { get; set; }
|
||||
|
||||
public virtual bool ShowFeluccaWarning => false;
|
||||
|
||||
[Constructible]
|
||||
public Moongate() : this( Point3D.Zero, null )
|
||||
{
|
||||
m_bDispellable = true;
|
||||
Dispellable = true;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Moongate(bool bDispellable) : this( Point3D.Zero, null )
|
||||
{
|
||||
m_bDispellable = bDispellable;
|
||||
Dispellable = bDispellable;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
|
|
@ -55,8 +39,8 @@ namespace Server.Items
|
|||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
m_Target = target;
|
||||
m_TargetMap = targetMap;
|
||||
Target = target;
|
||||
TargetMap = targetMap;
|
||||
}
|
||||
|
||||
public Moongate( Serial serial ) : base( serial )
|
||||
|
|
@ -104,11 +88,11 @@ namespace Server.Items
|
|||
{
|
||||
m.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil.
|
||||
}
|
||||
else if ( m_TargetMap == Map.Felucca && m is PlayerMobile mobile && mobile.Young )
|
||||
else if ( TargetMap == Map.Felucca && m is PlayerMobile mobile && mobile.Young )
|
||||
{
|
||||
mobile.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young.
|
||||
}
|
||||
else if ( (m.Kills >= 5 && m_TargetMap != Map.Felucca) || ( m_TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0 ) || ( m_TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0 ) || ( m_TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0 ) )
|
||||
else if ( (m.Kills >= 5 && TargetMap != Map.Felucca) || ( TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0 ) || ( TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0 ) || ( TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0 ) )
|
||||
{
|
||||
m.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there.
|
||||
}
|
||||
|
|
@ -116,11 +100,11 @@ namespace Server.Items
|
|||
{
|
||||
m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
|
||||
}
|
||||
else if ( m_TargetMap != null && m_TargetMap != Map.Internal )
|
||||
else if ( TargetMap != null && TargetMap != Map.Internal )
|
||||
{
|
||||
BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
|
||||
BaseCreature.TeleportPets( m, Target, TargetMap );
|
||||
|
||||
m.MoveToWorld( m_Target, m_TargetMap );
|
||||
m.MoveToWorld( Target, TargetMap );
|
||||
|
||||
if ( m.AccessLevel == AccessLevel.Player || !m.Hidden )
|
||||
m.PlaySound( 0x1FE );
|
||||
|
|
@ -139,11 +123,11 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_Target );
|
||||
writer.Write( m_TargetMap );
|
||||
writer.Write( Target );
|
||||
writer.Write( TargetMap );
|
||||
|
||||
// Version 1
|
||||
writer.Write( m_bDispellable );
|
||||
writer.Write( Dispellable );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -152,11 +136,11 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Target = reader.ReadPoint3D();
|
||||
m_TargetMap = reader.ReadMap();
|
||||
Target = reader.ReadPoint3D();
|
||||
TargetMap = reader.ReadMap();
|
||||
|
||||
if ( version >= 1 )
|
||||
m_bDispellable = reader.ReadBool();
|
||||
Dispellable = reader.ReadBool();
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse( Mobile from, bool message )
|
||||
|
|
@ -177,7 +161,7 @@ namespace Server.Items
|
|||
|
||||
public virtual void BeginConfirmation( Mobile from )
|
||||
{
|
||||
if ( IsInTown( from.Location, from.Map ) && !IsInTown( m_Target, m_TargetMap ) || (from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning) )
|
||||
if ( IsInTown( from.Location, from.Map ) && !IsInTown( Target, TargetMap ) || (from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning) )
|
||||
{
|
||||
if ( from.AccessLevel == AccessLevel.Player || !from.Hidden )
|
||||
from.Send( new PlaySound( 0x20E, from.Location ) );
|
||||
|
|
@ -203,7 +187,7 @@ namespace Server.Items
|
|||
if ( !ValidateUse( from, false ) || !from.InRange( this, range ) )
|
||||
return;
|
||||
|
||||
if ( m_TargetMap != null )
|
||||
if ( TargetMap != null )
|
||||
BeginConfirmation( from );
|
||||
else
|
||||
from.SendMessage( "This moongate does not seem to go anywhere." );
|
||||
|
|
@ -241,65 +225,26 @@ namespace Server.Items
|
|||
|
||||
public class ConfirmationMoongate : Moongate
|
||||
{
|
||||
private int m_GumpWidth;
|
||||
private int m_GumpHeight;
|
||||
|
||||
private int m_TitleColor;
|
||||
private int m_MessageColor;
|
||||
|
||||
private int m_TitleNumber;
|
||||
private int m_MessageNumber;
|
||||
|
||||
private string m_MessageString;
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int GumpWidth { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int GumpWidth
|
||||
{
|
||||
get => m_GumpWidth;
|
||||
set => m_GumpWidth = value;
|
||||
}
|
||||
public int GumpHeight { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int GumpHeight
|
||||
{
|
||||
get => m_GumpHeight;
|
||||
set => m_GumpHeight = value;
|
||||
}
|
||||
public int TitleColor { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int TitleColor
|
||||
{
|
||||
get => m_TitleColor;
|
||||
set => m_TitleColor = value;
|
||||
}
|
||||
public int MessageColor { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageColor
|
||||
{
|
||||
get => m_MessageColor;
|
||||
set => m_MessageColor = value;
|
||||
}
|
||||
public int TitleNumber { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int TitleNumber
|
||||
{
|
||||
get => m_TitleNumber;
|
||||
set => m_TitleNumber = value;
|
||||
}
|
||||
public int MessageNumber { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MessageNumber
|
||||
{
|
||||
get => m_MessageNumber;
|
||||
set => m_MessageNumber = value;
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string MessageString
|
||||
{
|
||||
get => m_MessageString;
|
||||
set => m_MessageString = value;
|
||||
}
|
||||
public string MessageString { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public ConfirmationMoongate() : this( Point3D.Zero, null )
|
||||
|
|
@ -323,10 +268,10 @@ namespace Server.Items
|
|||
|
||||
public override void BeginConfirmation( Mobile from )
|
||||
{
|
||||
if ( m_GumpWidth > 0 && m_GumpHeight > 0 && m_TitleNumber > 0 && (m_MessageNumber > 0 || m_MessageString != null) )
|
||||
if ( GumpWidth > 0 && GumpHeight > 0 && TitleNumber > 0 && (MessageNumber > 0 || MessageString != null) )
|
||||
{
|
||||
from.CloseGump( typeof( WarningGump ) );
|
||||
from.SendGump( new WarningGump( m_TitleNumber, m_TitleColor, m_MessageString == null ? (object)m_MessageNumber : (object)m_MessageString, m_MessageColor, m_GumpWidth, m_GumpHeight, Warning_Callback, from ) );
|
||||
from.SendGump( new WarningGump( TitleNumber, TitleColor, MessageString == null ? (object)MessageNumber : (object)MessageString, MessageColor, GumpWidth, GumpHeight, Warning_Callback, from ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -340,16 +285,16 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.WriteEncodedInt( m_GumpWidth );
|
||||
writer.WriteEncodedInt( m_GumpHeight );
|
||||
writer.WriteEncodedInt( GumpWidth );
|
||||
writer.WriteEncodedInt( GumpHeight );
|
||||
|
||||
writer.WriteEncodedInt( m_TitleColor );
|
||||
writer.WriteEncodedInt( m_MessageColor );
|
||||
writer.WriteEncodedInt( TitleColor );
|
||||
writer.WriteEncodedInt( MessageColor );
|
||||
|
||||
writer.WriteEncodedInt( m_TitleNumber );
|
||||
writer.WriteEncodedInt( m_MessageNumber );
|
||||
writer.WriteEncodedInt( TitleNumber );
|
||||
writer.WriteEncodedInt( MessageNumber );
|
||||
|
||||
writer.Write( m_MessageString );
|
||||
writer.Write( MessageString );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -362,16 +307,16 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
m_GumpWidth = reader.ReadEncodedInt();
|
||||
m_GumpHeight = reader.ReadEncodedInt();
|
||||
GumpWidth = reader.ReadEncodedInt();
|
||||
GumpHeight = reader.ReadEncodedInt();
|
||||
|
||||
m_TitleColor = reader.ReadEncodedInt();
|
||||
m_MessageColor = reader.ReadEncodedInt();
|
||||
TitleColor = reader.ReadEncodedInt();
|
||||
MessageColor = reader.ReadEncodedInt();
|
||||
|
||||
m_TitleNumber = reader.ReadEncodedInt();
|
||||
m_MessageNumber = reader.ReadEncodedInt();
|
||||
TitleNumber = reader.ReadEncodedInt();
|
||||
MessageNumber = reader.ReadEncodedInt();
|
||||
|
||||
m_MessageString = reader.ReadString();
|
||||
MessageString = reader.ReadString();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ namespace Server.Items
|
|||
{
|
||||
private string m_Description;
|
||||
private bool m_Marked;
|
||||
private Point3D m_Target;
|
||||
private Map m_TargetMap;
|
||||
private BaseHouse m_House;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (string) m_Description );
|
||||
writer.Write( (bool) m_Marked );
|
||||
writer.Write( (Point3D) m_Target );
|
||||
writer.Write( (Point3D) Target );
|
||||
writer.Write( (Map) m_TargetMap );
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +51,7 @@ namespace Server.Items
|
|||
{
|
||||
m_Description = reader.ReadString();
|
||||
m_Marked = reader.ReadBool();
|
||||
m_Target = reader.ReadPoint3D();
|
||||
Target = reader.ReadPoint3D();
|
||||
m_TargetMap = reader.ReadMap();
|
||||
|
||||
CalculateHue();
|
||||
|
|
@ -102,11 +101,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Point3D Target
|
||||
{
|
||||
get => m_Target;
|
||||
set => m_Target = value;
|
||||
}
|
||||
public Point3D Target { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
|
||||
public Map TargetMap
|
||||
|
|
@ -150,7 +145,7 @@ namespace Server.Items
|
|||
|
||||
if ( m_House == null )
|
||||
{
|
||||
m_Target = m.Location;
|
||||
Target = m.Location;
|
||||
m_TargetMap = m.Map;
|
||||
}
|
||||
else
|
||||
|
|
@ -176,19 +171,19 @@ namespace Server.Items
|
|||
if ( map != null && !map.CanFit( x, y, z, 16, false, false ) )
|
||||
z = map.GetAverageZ( x, y );
|
||||
|
||||
m_Target = new Point3D( x, y, z );
|
||||
Target = new Point3D( x, y, z );
|
||||
m_TargetMap = map;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_House = null;
|
||||
m_Target = m.Location;
|
||||
Target = m.Location;
|
||||
m_TargetMap = m.Map;
|
||||
}
|
||||
|
||||
if ( !setDesc )
|
||||
m_Description = BaseRegion.GetRuneNameFor( Region.Find( m_Target, m_TargetMap ) );
|
||||
m_Description = BaseRegion.GetRuneNameFor( Region.Find( Target, m_TargetMap ) );
|
||||
|
||||
CalculateHue();
|
||||
InvalidateProperties();
|
||||
|
|
|
|||
|
|
@ -138,18 +138,16 @@ namespace Server.Items
|
|||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private BaseConflagrationPotion m_Potion;
|
||||
|
||||
public BaseConflagrationPotion Potion => m_Potion;
|
||||
public BaseConflagrationPotion Potion { get; }
|
||||
|
||||
public ThrowTarget( BaseConflagrationPotion potion ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Potion = potion;
|
||||
Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
|
||||
if ( Potion.Deleted || Potion.Map == Map.Internal )
|
||||
return;
|
||||
|
||||
if ( !(targeted is IPoint3D p) || from.Map == null )
|
||||
|
|
@ -169,20 +167,19 @@ namespace Server.Items
|
|||
else
|
||||
to = new Entity( Serial.Zero, new Point3D( p ), from.Map );
|
||||
|
||||
Effects.SendMovingEffect( from, to, 0xF0D, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), new TimerStateCallback( m_Potion.Explode_Callback ), new object[] { from, new Point3D( p ), from.Map } );
|
||||
Effects.SendMovingEffect( from, to, 0xF0D, 7, 0, false, false, Potion.Hue, 0 );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), new TimerStateCallback( Potion.Explode_Callback ), new object[] { from, new Point3D( p ), from.Map } );
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalItem : Item
|
||||
{
|
||||
private Mobile m_From;
|
||||
private int m_MinDamage;
|
||||
private int m_MaxDamage;
|
||||
private DateTime m_End;
|
||||
private Timer m_Timer;
|
||||
|
||||
public Mobile From => m_From;
|
||||
public Mobile From { get; private set; }
|
||||
|
||||
public override bool BlocksFit => true;
|
||||
|
||||
|
|
@ -193,7 +190,7 @@ namespace Server.Items
|
|||
|
||||
MoveToWorld( loc, map );
|
||||
|
||||
m_From = from;
|
||||
From = from;
|
||||
m_End = DateTime.UtcNow + TimeSpan.FromSeconds( 10 );
|
||||
|
||||
SetDamage( min, max );
|
||||
|
|
@ -224,14 +221,14 @@ namespace Server.Items
|
|||
m_MinDamage = min;
|
||||
m_MaxDamage = max;
|
||||
|
||||
if ( m_From == null )
|
||||
if ( From == null )
|
||||
return;
|
||||
|
||||
int alchemySkill = m_From.Skills.Alchemy.Fixed;
|
||||
int alchemySkill = From.Skills.Alchemy.Fixed;
|
||||
int alchemyBonus = alchemySkill / 125 + alchemySkill / 250 ;
|
||||
|
||||
m_MinDamage = Scale( m_From, m_MinDamage + alchemyBonus );
|
||||
m_MaxDamage = Scale( m_From, m_MaxDamage + alchemyBonus );
|
||||
m_MinDamage = Scale( From, m_MinDamage + alchemyBonus );
|
||||
m_MaxDamage = Scale( From, m_MaxDamage + alchemyBonus );
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
@ -240,7 +237,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (Mobile) m_From );
|
||||
writer.Write( (Mobile) From );
|
||||
writer.Write( (DateTime) m_End );
|
||||
writer.Write( (int) m_MinDamage );
|
||||
writer.Write( (int) m_MaxDamage );
|
||||
|
|
@ -252,7 +249,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_From = reader.ReadMobile();
|
||||
From = reader.ReadMobile();
|
||||
m_End = reader.ReadDateTime();
|
||||
m_MinDamage = reader.ReadInt();
|
||||
m_MaxDamage = reader.ReadInt();
|
||||
|
|
@ -263,11 +260,11 @@ namespace Server.Items
|
|||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( Visible && m_From != null && (!Core.AOS || m != m_From) && SpellHelper.ValidIndirectTarget( m_From, m ) && m_From.CanBeHarmful( m, false ) )
|
||||
if ( Visible && From != null && (!Core.AOS || m != From) && SpellHelper.ValidIndirectTarget( From, m ) && From.CanBeHarmful( m, false ) )
|
||||
{
|
||||
m_From.DoHarmful( m );
|
||||
From.DoHarmful( m );
|
||||
|
||||
AOS.Damage( m, m_From, GetDamage(), 0, 100, 0, 0, 0 );
|
||||
AOS.Damage( m, From, GetDamage(), 0, 100, 0, 0, 0 );
|
||||
m.PlaySound( 0x208 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,18 +158,16 @@ namespace Server.Items
|
|||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private BaseConfusionBlastPotion m_Potion;
|
||||
|
||||
public BaseConfusionBlastPotion Potion => m_Potion;
|
||||
public BaseConfusionBlastPotion Potion { get; }
|
||||
|
||||
public ThrowTarget( BaseConfusionBlastPotion potion ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Potion = potion;
|
||||
Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
|
||||
if ( Potion.Deleted || Potion.Map == Map.Internal )
|
||||
return;
|
||||
|
||||
if ( !(targeted is IPoint3D p) || from.Map == null )
|
||||
|
|
@ -189,8 +187,8 @@ namespace Server.Items
|
|||
else
|
||||
to = new Entity( Serial.Zero, new Point3D( p ), from.Map );
|
||||
|
||||
Effects.SendMovingEffect( from, to, 0xF0D, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Explode_Callback ), new object[] { from, new Point3D( p ), from.Map } );
|
||||
Effects.SendMovingEffect( from, to, 0xF0D, 7, 0, false, false, Potion.Hue, 0 );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( Potion.Explode_Callback ), new object[] { from, new Point3D( p ), from.Map } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,17 +4,14 @@ namespace Server.Items
|
|||
{
|
||||
public class CureLevelInfo
|
||||
{
|
||||
private Poison m_Poison;
|
||||
private double m_Chance;
|
||||
public Poison Poison { get; }
|
||||
|
||||
public Poison Poison => m_Poison;
|
||||
|
||||
public double Chance => m_Chance;
|
||||
public double Chance { get; }
|
||||
|
||||
public CureLevelInfo( Poison poison, double chance )
|
||||
{
|
||||
m_Poison = poison;
|
||||
m_Chance = chance;
|
||||
Poison = poison;
|
||||
Chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,7 @@ namespace Server.Items
|
|||
|
||||
private Timer m_Timer;
|
||||
|
||||
public List<Mobile> Users => m_Users;
|
||||
|
||||
private List<Mobile> m_Users;
|
||||
public List<Mobile> Users { get; private set; }
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
|
|
@ -80,11 +78,11 @@ namespace Server.Items
|
|||
|
||||
from.RevealingAction();
|
||||
|
||||
if ( m_Users == null )
|
||||
m_Users = new List<Mobile>();
|
||||
if ( Users == null )
|
||||
Users = new List<Mobile>();
|
||||
|
||||
if ( !m_Users.Contains( from ) )
|
||||
m_Users.Add( from );
|
||||
if ( !Users.Contains( from ) )
|
||||
Users.Add( from );
|
||||
|
||||
from.Target = new ThrowTarget( this );
|
||||
|
||||
|
|
@ -164,18 +162,16 @@ namespace Server.Items
|
|||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private BaseExplosionPotion m_Potion;
|
||||
|
||||
public BaseExplosionPotion Potion => m_Potion;
|
||||
public BaseExplosionPotion Potion { get; }
|
||||
|
||||
public ThrowTarget( BaseExplosionPotion potion ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Potion = potion;
|
||||
Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
|
||||
if ( Potion.Deleted || Potion.Map == Map.Internal )
|
||||
return;
|
||||
|
||||
if ( !(targeted is IPoint3D p) )
|
||||
|
|
@ -200,15 +196,15 @@ namespace Server.Items
|
|||
to = m;
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
Effects.SendMovingEffect( from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue, 0 );
|
||||
|
||||
if ( m_Potion.Amount > 1 )
|
||||
if ( Potion.Amount > 1 )
|
||||
{
|
||||
Mobile.LiftItemDupe( m_Potion, 1 );
|
||||
Mobile.LiftItemDupe( Potion, 1 );
|
||||
}
|
||||
|
||||
m_Potion.Internalize();
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
|
||||
Potion.Internalize();
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( Potion.Reposition_OnTick ), new object[]{ from, p, map } );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -219,9 +215,9 @@ namespace Server.Items
|
|||
|
||||
Consume();
|
||||
|
||||
for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
|
||||
for ( int i = 0; Users != null && i < Users.Count; ++i )
|
||||
{
|
||||
Mobile m = m_Users[i];
|
||||
Mobile m = Users[i];
|
||||
|
||||
if ( m.Target is ThrowTarget targ && targ.Potion == this )
|
||||
Target.Cancel( m );
|
||||
|
|
|
|||
|
|
@ -22,23 +22,12 @@ namespace Server.Items
|
|||
set{ m_Quality = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
private List<RunebookEntry> m_Entries;
|
||||
private string m_Description;
|
||||
private int m_CurCharges, m_MaxCharges;
|
||||
private int m_DefaultIndex;
|
||||
private SecureLevel m_Level;
|
||||
private Mobile m_Crafter;
|
||||
|
||||
private DateTime m_NextUse;
|
||||
|
||||
private List<Mobile> m_Openers = new List<Mobile>();
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime NextUse
|
||||
{
|
||||
get => m_NextUse;
|
||||
set => m_NextUse = value;
|
||||
}
|
||||
public DateTime NextUse { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Crafter
|
||||
|
|
@ -48,11 +37,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get => m_Level;
|
||||
set => m_Level = value;
|
||||
}
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string Description
|
||||
|
|
@ -66,24 +51,12 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int CurCharges
|
||||
{
|
||||
get => m_CurCharges;
|
||||
set => m_CurCharges = value;
|
||||
}
|
||||
public int CurCharges { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int MaxCharges
|
||||
{
|
||||
get => m_MaxCharges;
|
||||
set => m_MaxCharges = value;
|
||||
}
|
||||
public int MaxCharges { get; set; }
|
||||
|
||||
public List<Mobile> Openers
|
||||
{
|
||||
get => m_Openers;
|
||||
set => m_Openers = value;
|
||||
}
|
||||
public List<Mobile> Openers { get; set; } = new List<Mobile>();
|
||||
|
||||
public override int LabelNumber => 1041267; // runebook
|
||||
|
||||
|
|
@ -96,13 +69,13 @@ namespace Server.Items
|
|||
|
||||
Layer = (Core.AOS ? Layer.Invalid : Layer.OneHanded);
|
||||
|
||||
m_Entries = new List<RunebookEntry>();
|
||||
Entries = new List<RunebookEntry>();
|
||||
|
||||
m_MaxCharges = maxCharges;
|
||||
MaxCharges = maxCharges;
|
||||
|
||||
m_DefaultIndex = -1;
|
||||
|
||||
m_Level = SecureLevel.CoOwners;
|
||||
Level = SecureLevel.CoOwners;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
|
|
@ -110,14 +83,14 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public List<RunebookEntry> Entries => m_Entries;
|
||||
public List<RunebookEntry> Entries { get; private set; }
|
||||
|
||||
public RunebookEntry Default
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_DefaultIndex >= 0 && m_DefaultIndex < m_Entries.Count )
|
||||
return m_Entries[m_DefaultIndex];
|
||||
if ( m_DefaultIndex >= 0 && m_DefaultIndex < Entries.Count )
|
||||
return Entries[m_DefaultIndex];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -126,7 +99,7 @@ namespace Server.Items
|
|||
if ( value == null )
|
||||
m_DefaultIndex = -1;
|
||||
else
|
||||
m_DefaultIndex = m_Entries.IndexOf( value );
|
||||
m_DefaultIndex = Entries.IndexOf( value );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -155,16 +128,16 @@ namespace Server.Items
|
|||
|
||||
writer.Write( m_Crafter );
|
||||
|
||||
writer.Write( (int) m_Level );
|
||||
writer.Write( (int) Level );
|
||||
|
||||
writer.Write( m_Entries.Count );
|
||||
writer.Write( Entries.Count );
|
||||
|
||||
for ( int i = 0; i < m_Entries.Count; ++i )
|
||||
m_Entries[i].Serialize( writer );
|
||||
for ( int i = 0; i < Entries.Count; ++i )
|
||||
Entries[i].Serialize( writer );
|
||||
|
||||
writer.Write( m_Description );
|
||||
writer.Write( m_CurCharges );
|
||||
writer.Write( m_MaxCharges );
|
||||
writer.Write( CurCharges );
|
||||
writer.Write( MaxCharges );
|
||||
writer.Write( m_DefaultIndex );
|
||||
}
|
||||
|
||||
|
|
@ -193,21 +166,21 @@ namespace Server.Items
|
|||
}
|
||||
case 1:
|
||||
{
|
||||
m_Level = (SecureLevel)reader.ReadInt();
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
m_Entries = new List<RunebookEntry>( count );
|
||||
Entries = new List<RunebookEntry>( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
m_Entries.Add( new RunebookEntry( reader ) );
|
||||
Entries.Add( new RunebookEntry( reader ) );
|
||||
|
||||
m_Description = reader.ReadString();
|
||||
m_CurCharges = reader.ReadInt();
|
||||
m_MaxCharges = reader.ReadInt();
|
||||
CurCharges = reader.ReadInt();
|
||||
MaxCharges = reader.ReadInt();
|
||||
m_DefaultIndex = reader.ReadInt();
|
||||
|
||||
break;
|
||||
|
|
@ -222,7 +195,7 @@ namespace Server.Items
|
|||
else if ( m_DefaultIndex == index )
|
||||
m_DefaultIndex = -1;
|
||||
|
||||
m_Entries.RemoveAt( index );
|
||||
Entries.RemoveAt( index );
|
||||
|
||||
RecallRune rune = new RecallRune();
|
||||
|
||||
|
|
@ -279,11 +252,11 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
foreach ( Mobile m in m_Openers )
|
||||
foreach ( Mobile m in Openers )
|
||||
if ( IsOpen( m ) )
|
||||
m.CloseGump( typeof( RunebookGump ) );
|
||||
|
||||
m_Openers.Clear();
|
||||
Openers.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -309,7 +282,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if ( DateTime.UtcNow < m_NextUse )
|
||||
if ( DateTime.UtcNow < NextUse )
|
||||
{
|
||||
from.SendLocalizedMessage( 502406 ); // This book needs time to recharge.
|
||||
return;
|
||||
|
|
@ -318,14 +291,14 @@ namespace Server.Items
|
|||
from.CloseGump( typeof( RunebookGump ) );
|
||||
from.SendGump( new RunebookGump( from, this ) );
|
||||
|
||||
m_Openers.Add( from );
|
||||
Openers.Add( from );
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTravel()
|
||||
{
|
||||
if ( !Core.SA )
|
||||
m_NextUse = DateTime.UtcNow + UseDelay;
|
||||
NextUse = DateTime.UtcNow + UseDelay;
|
||||
}
|
||||
|
||||
public override void OnAfterDuped( Item newItem )
|
||||
|
|
@ -333,13 +306,13 @@ namespace Server.Items
|
|||
if ( !(newItem is Runebook book) )
|
||||
return;
|
||||
|
||||
book.m_Entries = new List<RunebookEntry>();
|
||||
book.Entries = new List<RunebookEntry>();
|
||||
|
||||
for ( int i = 0; i < m_Entries.Count; i++ )
|
||||
for ( int i = 0; i < Entries.Count; i++ )
|
||||
{
|
||||
RunebookEntry entry = m_Entries[i];
|
||||
RunebookEntry entry = Entries[i];
|
||||
|
||||
book.m_Entries.Add( new RunebookEntry( entry.Location, entry.Map, entry.Description, entry.House ) );
|
||||
book.Entries.Add( new RunebookEntry( entry.Location, entry.Map, entry.Description, entry.House ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +326,7 @@ namespace Server.Items
|
|||
if ( house != null && house.IsAosRules && (house.Public ? house.IsBanned( m ) : !house.HasAccess( m )) )
|
||||
return false;
|
||||
|
||||
return ( house != null && house.HasSecureAccess( m, m_Level ) );
|
||||
return ( house != null && house.HasSecureAccess( m, Level ) );
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
|
|
@ -368,11 +341,11 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 1005571 ); // You cannot place objects in the book while viewing the contents.
|
||||
}
|
||||
else if ( m_Entries.Count < 16 )
|
||||
else if ( Entries.Count < 16 )
|
||||
{
|
||||
if ( rune.Marked && rune.TargetMap != null )
|
||||
{
|
||||
m_Entries.Add( new RunebookEntry( rune.Target, rune.TargetMap, rune.Description, rune.House ) );
|
||||
Entries.Add( new RunebookEntry( rune.Target, rune.TargetMap, rune.Description, rune.House ) );
|
||||
|
||||
rune.Delete();
|
||||
|
||||
|
|
@ -397,20 +370,20 @@ namespace Server.Items
|
|||
}
|
||||
else if ( dropped is RecallScroll )
|
||||
{
|
||||
if ( m_CurCharges < m_MaxCharges )
|
||||
if ( CurCharges < MaxCharges )
|
||||
{
|
||||
from.Send( new PlaySound( 0x249, GetWorldLocation() ) );
|
||||
|
||||
int amount = dropped.Amount;
|
||||
|
||||
if ( amount > (m_MaxCharges - m_CurCharges) )
|
||||
if ( amount > (MaxCharges - CurCharges) )
|
||||
{
|
||||
dropped.Consume( m_MaxCharges - m_CurCharges );
|
||||
m_CurCharges = m_MaxCharges;
|
||||
dropped.Consume( MaxCharges - CurCharges );
|
||||
CurCharges = MaxCharges;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CurCharges += amount;
|
||||
CurCharges += amount;
|
||||
dropped.Delete();
|
||||
|
||||
return true;
|
||||
|
|
@ -448,25 +421,20 @@ namespace Server.Items
|
|||
|
||||
public class RunebookEntry
|
||||
{
|
||||
private Point3D m_Location;
|
||||
private Map m_Map;
|
||||
private string m_Description;
|
||||
private BaseHouse m_House;
|
||||
public Point3D Location { get; }
|
||||
|
||||
public Point3D Location => m_Location;
|
||||
public Map Map { get; }
|
||||
|
||||
public Map Map => m_Map;
|
||||
public string Description { get; }
|
||||
|
||||
public string Description => m_Description;
|
||||
|
||||
public BaseHouse House => m_House;
|
||||
public BaseHouse House { get; }
|
||||
|
||||
public RunebookEntry( Point3D loc, Map map, string desc, BaseHouse house )
|
||||
{
|
||||
m_Location = loc;
|
||||
m_Map = map;
|
||||
m_Description = desc;
|
||||
m_House = house;
|
||||
Location = loc;
|
||||
Map = map;
|
||||
Description = desc;
|
||||
House = house;
|
||||
}
|
||||
|
||||
public RunebookEntry( GenericReader reader )
|
||||
|
|
@ -477,14 +445,14 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_House = reader.ReadItem() as BaseHouse;
|
||||
House = reader.ReadItem() as BaseHouse;
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Location = reader.ReadPoint3D();
|
||||
m_Map = reader.ReadMap();
|
||||
m_Description = reader.ReadString();
|
||||
Location = reader.ReadPoint3D();
|
||||
Map = reader.ReadMap();
|
||||
Description = reader.ReadString();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -493,20 +461,20 @@ namespace Server.Items
|
|||
|
||||
public void Serialize( GenericWriter writer )
|
||||
{
|
||||
if ( m_House != null && !m_House.Deleted )
|
||||
if ( House != null && !House.Deleted )
|
||||
{
|
||||
writer.Write( (byte) 1 ); // version
|
||||
|
||||
writer.Write( m_House );
|
||||
writer.Write( House );
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write( (byte) 0 ); // version
|
||||
}
|
||||
|
||||
writer.Write( m_Location );
|
||||
writer.Write( m_Map );
|
||||
writer.Write( m_Description );
|
||||
writer.Write( Location );
|
||||
writer.Write( Map );
|
||||
writer.Write( Description );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ namespace Server.Items
|
|||
{
|
||||
public class SpellScroll : Item, ICommodity
|
||||
{
|
||||
private int m_SpellID;
|
||||
|
||||
public int SpellID => m_SpellID;
|
||||
public int SpellID { get; private set; }
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => (Core.ML);
|
||||
|
|
@ -29,7 +27,7 @@ namespace Server.Items
|
|||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
|
||||
m_SpellID = spellID;
|
||||
SpellID = spellID;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
@ -38,7 +36,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_SpellID );
|
||||
writer.Write( (int) SpellID );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -51,7 +49,7 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
m_SpellID = reader.ReadInt();
|
||||
SpellID = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -77,7 +75,7 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
Spell spell = SpellRegistry.NewSpell( m_SpellID, from, this );
|
||||
Spell spell = SpellRegistry.NewSpell( SpellID, from, this );
|
||||
|
||||
if ( spell != null )
|
||||
spell.Cast();
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ namespace Server.Items
|
|||
public virtual int BookCount => 64;
|
||||
|
||||
private ulong m_Content;
|
||||
private int m_Count;
|
||||
|
||||
public override bool AllowSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
|
||||
{
|
||||
|
|
@ -369,7 +368,7 @@ namespace Server.Items
|
|||
if ( val >= 0 && val < BookCount )
|
||||
{
|
||||
m_Content |= (ulong)1 << val;
|
||||
++m_Count;
|
||||
++SpellCount;
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
|
|
@ -393,11 +392,11 @@ namespace Server.Items
|
|||
{
|
||||
m_Content = value;
|
||||
|
||||
m_Count = 0;
|
||||
SpellCount = 0;
|
||||
|
||||
while ( value > 0 )
|
||||
{
|
||||
m_Count += (int)(value & 0x1);
|
||||
SpellCount += (int)(value & 0x1);
|
||||
value >>= 1;
|
||||
}
|
||||
|
||||
|
|
@ -407,7 +406,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int SpellCount => m_Count;
|
||||
public int SpellCount { get; private set; }
|
||||
|
||||
[Constructible]
|
||||
public Spellbook() : this( (ulong)0 )
|
||||
|
|
@ -532,16 +531,16 @@ namespace Server.Items
|
|||
to.Send( new NewSpellbookContent( this, ItemID, BookOffset + 1, m_Content ) );
|
||||
} else {
|
||||
if (ns.ContainerGridLines) {
|
||||
to.Send(new SpellbookContent6017(m_Count, BookOffset + 1, m_Content, this));
|
||||
to.Send(new SpellbookContent6017(SpellCount, BookOffset + 1, m_Content, this));
|
||||
} else {
|
||||
to.Send(new SpellbookContent(m_Count, BookOffset + 1, m_Content, this));
|
||||
to.Send(new SpellbookContent(SpellCount, BookOffset + 1, m_Content, this));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( ns.ContainerGridLines ) {
|
||||
to.Send( new SpellbookContent6017( m_Count, BookOffset + 1, m_Content, this ) );
|
||||
to.Send( new SpellbookContent6017( SpellCount, BookOffset + 1, m_Content, this ) );
|
||||
} else {
|
||||
to.Send( new SpellbookContent( m_Count, BookOffset + 1, m_Content, this ) );
|
||||
to.Send( new SpellbookContent( SpellCount, BookOffset + 1, m_Content, this ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -660,7 +659,7 @@ namespace Server.Items
|
|||
if ( Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0 )
|
||||
list.Add( 1075210, prop.ToString() ); // Increased Karma Loss ~1val~%
|
||||
|
||||
list.Add( 1042886, m_Count.ToString() ); // ~1_NUMBERS_OF_SPELLS~ Spells
|
||||
list.Add( 1042886, SpellCount.ToString() ); // ~1_NUMBERS_OF_SPELLS~ Spells
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
|
|
@ -670,7 +669,7 @@ namespace Server.Items
|
|||
if ( m_Crafter != null )
|
||||
LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
LabelTo( from, 1042886, m_Count.ToString() );
|
||||
LabelTo( from, 1042886, SpellCount.ToString() );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
|
|
@ -721,7 +720,7 @@ namespace Server.Items
|
|||
m_AosSkillBonuses.Serialize( writer );
|
||||
|
||||
writer.Write( m_Content );
|
||||
writer.Write( m_Count );
|
||||
writer.Write( SpellCount );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -765,7 +764,7 @@ namespace Server.Items
|
|||
case 0:
|
||||
{
|
||||
m_Content = reader.ReadULong();
|
||||
m_Count = reader.ReadInt();
|
||||
SpellCount = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,40 +157,36 @@ namespace Server.Items
|
|||
|
||||
public class BandageContext
|
||||
{
|
||||
private Mobile m_Healer;
|
||||
private Mobile m_Patient;
|
||||
private int m_Slips;
|
||||
private Timer m_Timer;
|
||||
public Mobile Healer { get; }
|
||||
|
||||
public Mobile Healer => m_Healer;
|
||||
public Mobile Patient => m_Patient;
|
||||
public int Slips{ get => m_Slips;
|
||||
set => m_Slips = value;
|
||||
}
|
||||
public Timer Timer => m_Timer;
|
||||
public Mobile Patient { get; }
|
||||
|
||||
public int Slips { get; set; }
|
||||
|
||||
public Timer Timer { get; private set; }
|
||||
|
||||
public void Slip()
|
||||
{
|
||||
m_Healer.SendLocalizedMessage( 500961 ); // Your fingers slip!
|
||||
++m_Slips;
|
||||
Healer.SendLocalizedMessage( 500961 ); // Your fingers slip!
|
||||
++Slips;
|
||||
}
|
||||
|
||||
public BandageContext( Mobile healer, Mobile patient, TimeSpan delay )
|
||||
{
|
||||
m_Healer = healer;
|
||||
m_Patient = patient;
|
||||
Healer = healer;
|
||||
Patient = patient;
|
||||
|
||||
m_Timer = new InternalTimer( this, delay );
|
||||
m_Timer.Start();
|
||||
Timer = new InternalTimer( this, delay );
|
||||
Timer.Start();
|
||||
}
|
||||
|
||||
public void StopHeal()
|
||||
{
|
||||
m_Table.Remove( m_Healer );
|
||||
m_Table.Remove( Healer );
|
||||
|
||||
m_Timer?.Stop();
|
||||
Timer?.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
Timer = null;
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, BandageContext> m_Table = new Dictionary<Mobile, BandageContext>();
|
||||
|
|
@ -223,38 +219,38 @@ namespace Server.Items
|
|||
bool playSound = true;
|
||||
bool checkSkills = false;
|
||||
|
||||
SkillName primarySkill = GetPrimarySkill( m_Patient );
|
||||
SkillName secondarySkill = GetSecondarySkill( m_Patient );
|
||||
SkillName primarySkill = GetPrimarySkill( Patient );
|
||||
SkillName secondarySkill = GetSecondarySkill( Patient );
|
||||
|
||||
BaseCreature petPatient = m_Patient as BaseCreature;
|
||||
BaseCreature petPatient = Patient as BaseCreature;
|
||||
|
||||
if ( !m_Healer.Alive )
|
||||
if ( !Healer.Alive )
|
||||
{
|
||||
healerNumber = 500962; // You were unable to finish your work before you died.
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( !m_Healer.InRange( m_Patient, Bandage.Range ) )
|
||||
else if ( !Healer.InRange( Patient, Bandage.Range ) )
|
||||
{
|
||||
healerNumber = 500963; // You did not stay close enough to heal your target.
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( !m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet) )
|
||||
else if ( !Patient.Alive || (petPatient != null && petPatient.IsDeadPet) )
|
||||
{
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);
|
||||
double healing = Healer.Skills[primarySkill].Value;
|
||||
double anatomy = Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 68.0) / 50.0) - (Slips * 0.02);
|
||||
|
||||
if (( (checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble() )
|
||||
|| ( Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == m_Healer) ) //TODO: Dbl check doesn't check for faction of the horse here?
|
||||
|| ( Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == Healer) ) //TODO: Dbl check doesn't check for faction of the horse here?
|
||||
{
|
||||
if ( m_Patient.Map == null || !m_Patient.Map.CanFit( m_Patient.Location, 16, false, false ) )
|
||||
if ( Patient.Map == null || !Patient.Map.CanFit( Patient.Location, 16, false, false ) )
|
||||
{
|
||||
healerNumber = 501042; // Target can not be resurrected at that location.
|
||||
patientNumber = 502391; // Thou can not be resurrected there!
|
||||
}
|
||||
else if ( m_Patient.Region != null && m_Patient.Region.IsPartOf( "Khaldun" ) )
|
||||
else if ( Patient.Region != null && Patient.Region.IsPartOf( "Khaldun" ) )
|
||||
{
|
||||
healerNumber = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
|
||||
patientNumber = -1;
|
||||
|
|
@ -264,14 +260,14 @@ namespace Server.Items
|
|||
healerNumber = 500965; // You are able to resurrect your patient.
|
||||
patientNumber = -1;
|
||||
|
||||
m_Patient.PlaySound( 0x214 );
|
||||
m_Patient.FixedEffect( 0x376A, 10, 16 );
|
||||
Patient.PlaySound( 0x214 );
|
||||
Patient.FixedEffect( 0x376A, 10, 16 );
|
||||
|
||||
if ( petPatient != null && petPatient.IsDeadPet )
|
||||
{
|
||||
Mobile master = petPatient.ControlMaster;
|
||||
|
||||
if ( master != null && m_Healer == master )
|
||||
if ( master != null && Healer == master )
|
||||
{
|
||||
petPatient.ResurrectPet();
|
||||
|
||||
|
|
@ -285,7 +281,7 @@ namespace Server.Items
|
|||
healerNumber = 503255; // You are able to resurrect the creature.
|
||||
|
||||
master.CloseGump( typeof( PetResurrectGump ) );
|
||||
master.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
|
||||
master.SendGump( new PetResurrectGump( Healer, petPatient ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -302,7 +298,7 @@ namespace Server.Items
|
|||
healerNumber = 503255; // You are able to resurrect the creature.
|
||||
|
||||
friend.CloseGump( typeof( PetResurrectGump ) );
|
||||
friend.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
|
||||
friend.SendGump( new PetResurrectGump( Healer, petPatient ) );
|
||||
|
||||
found = true;
|
||||
break;
|
||||
|
|
@ -315,8 +311,8 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
m_Patient.CloseGump( typeof( ResurrectGump ) );
|
||||
m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer ) );
|
||||
Patient.CloseGump( typeof( ResurrectGump ) );
|
||||
Patient.SendGump( new ResurrectGump( Patient, Healer ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -330,19 +326,19 @@ namespace Server.Items
|
|||
patientNumber = -1;
|
||||
}
|
||||
}
|
||||
else if ( m_Patient.Poisoned )
|
||||
else if ( Patient.Poisoned )
|
||||
{
|
||||
m_Healer.SendLocalizedMessage( 500969 ); // You finish applying the bandages.
|
||||
Healer.SendLocalizedMessage( 500969 ); // You finish applying the bandages.
|
||||
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);
|
||||
double healing = Healer.Skills[primarySkill].Value;
|
||||
double anatomy = Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing - 30.0) / 50.0) - (Patient.Poison.Level * 0.1) - (Slips * 0.02);
|
||||
|
||||
if ( (checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble() )
|
||||
{
|
||||
if ( m_Patient.CurePoison( m_Healer ) )
|
||||
if ( Patient.CurePoison( Healer ) )
|
||||
{
|
||||
healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
|
||||
healerNumber = (Healer == Patient) ? -1 : 1010058; // You have cured the target of all poisons.
|
||||
patientNumber = 1010059; // You have been cured of all poisons.
|
||||
}
|
||||
else
|
||||
|
|
@ -357,20 +353,20 @@ namespace Server.Items
|
|||
patientNumber = -1;
|
||||
}
|
||||
}
|
||||
else if ( BleedAttack.IsBleeding( m_Patient ) )
|
||||
else if ( BleedAttack.IsBleeding( Patient ) )
|
||||
{
|
||||
healerNumber = 1060088; // You bind the wound and stop the bleeding
|
||||
patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!
|
||||
|
||||
BleedAttack.EndBleed( m_Patient, false );
|
||||
BleedAttack.EndBleed( Patient, false );
|
||||
}
|
||||
else if ( MortalStrike.IsWounded( m_Patient ) )
|
||||
else if ( MortalStrike.IsWounded( Patient ) )
|
||||
{
|
||||
healerNumber = ( m_Healer == m_Patient ? 1005000 : 1010398 );
|
||||
healerNumber = ( Healer == Patient ? 1005000 : 1010398 );
|
||||
patientNumber = -1;
|
||||
playSound = false;
|
||||
}
|
||||
else if ( m_Patient.Hits == m_Patient.HitsMax )
|
||||
else if ( Patient.Hits == Patient.HitsMax )
|
||||
{
|
||||
healerNumber = 500967; // You heal what little damage your patient had.
|
||||
patientNumber = -1;
|
||||
|
|
@ -380,9 +376,9 @@ namespace Server.Items
|
|||
checkSkills = true;
|
||||
patientNumber = -1;
|
||||
|
||||
double healing = m_Healer.Skills[primarySkill].Value;
|
||||
double anatomy = m_Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);
|
||||
double healing = Healer.Skills[primarySkill].Value;
|
||||
double anatomy = Healer.Skills[secondarySkill].Value;
|
||||
double chance = ((healing + 10.0) / 100.0) - (Slips * 0.02);
|
||||
|
||||
if ( chance > Utility.RandomDouble() )
|
||||
{
|
||||
|
|
@ -403,13 +399,13 @@ namespace Server.Items
|
|||
|
||||
double toHeal = min + (Utility.RandomDouble() * (max - min));
|
||||
|
||||
if ( m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal )
|
||||
toHeal += m_Patient.HitsMax / 100;
|
||||
if ( Patient.Body.IsMonster || Patient.Body.IsAnimal )
|
||||
toHeal += Patient.HitsMax / 100;
|
||||
|
||||
if ( Core.AOS )
|
||||
toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm
|
||||
toHeal -= toHeal * Slips * 0.35; // TODO: Verify algorithm
|
||||
else
|
||||
toHeal -= m_Slips * 4;
|
||||
toHeal -= Slips * 4;
|
||||
|
||||
if ( toHeal < 1 )
|
||||
{
|
||||
|
|
@ -417,7 +413,7 @@ namespace Server.Items
|
|||
healerNumber = 500968; // You apply the bandages, but they barely help.
|
||||
}
|
||||
|
||||
m_Patient.Heal( (int) toHeal, m_Healer, false );
|
||||
Patient.Heal( (int) toHeal, Healer, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -427,18 +423,18 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
if ( healerNumber != -1 )
|
||||
m_Healer.SendLocalizedMessage( healerNumber );
|
||||
Healer.SendLocalizedMessage( healerNumber );
|
||||
|
||||
if ( patientNumber != -1 )
|
||||
m_Patient.SendLocalizedMessage( patientNumber );
|
||||
Patient.SendLocalizedMessage( patientNumber );
|
||||
|
||||
if ( playSound )
|
||||
m_Patient.PlaySound( 0x57 );
|
||||
Patient.PlaySound( 0x57 );
|
||||
|
||||
if ( checkSkills )
|
||||
{
|
||||
m_Healer.CheckSkill( secondarySkill, 0.0, 120.0 );
|
||||
m_Healer.CheckSkill( primarySkill, 0.0, 120.0 );
|
||||
Healer.CheckSkill( secondarySkill, 0.0, 120.0 );
|
||||
Healer.CheckSkill( primarySkill, 0.0, 120.0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,23 +9,21 @@ namespace Server.Items
|
|||
{
|
||||
private class RepairSkillInfo
|
||||
{
|
||||
private CraftSystem m_System;
|
||||
private Type[] m_NearbyTypes;
|
||||
private TextDefinition m_NotNearbyMessage, m_Name;
|
||||
public TextDefinition NotNearbyMessage { get; }
|
||||
|
||||
public TextDefinition NotNearbyMessage => m_NotNearbyMessage;
|
||||
public TextDefinition Name => m_Name;
|
||||
public TextDefinition Name { get; }
|
||||
|
||||
|
||||
public CraftSystem System => m_System;
|
||||
public Type[] NearbyTypes => m_NearbyTypes;
|
||||
public CraftSystem System { get; }
|
||||
|
||||
public Type[] NearbyTypes { get; }
|
||||
|
||||
public RepairSkillInfo( CraftSystem system, Type[] nearbyTypes, TextDefinition notNearbyMessage, TextDefinition name )
|
||||
{
|
||||
m_System = system;
|
||||
m_NearbyTypes = nearbyTypes;
|
||||
m_NotNearbyMessage = notNearbyMessage;
|
||||
m_Name = name;
|
||||
System = system;
|
||||
NearbyTypes = nearbyTypes;
|
||||
NotNearbyMessage = notNearbyMessage;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public RepairSkillInfo( CraftSystem system, Type nearbyType, TextDefinition notNearbyMessage, TextDefinition name )
|
||||
|
|
@ -33,23 +31,23 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public static RepairSkillInfo[] Table => m_Table;
|
||||
private static RepairSkillInfo[] m_Table = {
|
||||
new RepairSkillInfo( DefBlacksmithy.CraftSystem, typeof( Blacksmith ), 1047013, 1023015 ),
|
||||
new RepairSkillInfo( DefTailoring.CraftSystem, typeof( Tailor ), 1061132, 1022981 ),
|
||||
new RepairSkillInfo( DefTinkering.CraftSystem, typeof( Tinker ), 1061166, 1022983 ),
|
||||
new RepairSkillInfo( DefCarpentry.CraftSystem, typeof( Carpenter ), 1061135, 1060774 ),
|
||||
new RepairSkillInfo( DefBowFletching.CraftSystem, typeof( Bowyer ), 1061134, 1023005 )
|
||||
};
|
||||
public static RepairSkillInfo[] Table { get; } =
|
||||
{
|
||||
new RepairSkillInfo( DefBlacksmithy.CraftSystem, typeof( Blacksmith ), 1047013, 1023015 ),
|
||||
new RepairSkillInfo( DefTailoring.CraftSystem, typeof( Tailor ), 1061132, 1022981 ),
|
||||
new RepairSkillInfo( DefTinkering.CraftSystem, typeof( Tinker ), 1061166, 1022983 ),
|
||||
new RepairSkillInfo( DefCarpentry.CraftSystem, typeof( Carpenter ), 1061135, 1060774 ),
|
||||
new RepairSkillInfo( DefBowFletching.CraftSystem, typeof( Bowyer ), 1061134, 1023005 )
|
||||
};
|
||||
|
||||
public static RepairSkillInfo GetInfo( RepairSkillType type )
|
||||
{
|
||||
int v = (int)type;
|
||||
|
||||
if ( v < 0 || v >= m_Table.Length )
|
||||
if ( v < 0 || v >= Table.Length )
|
||||
v = 0;
|
||||
|
||||
return m_Table[v];
|
||||
return Table[v];
|
||||
}
|
||||
}
|
||||
public enum RepairSkillType
|
||||
|
|
|
|||
|
|
@ -18,25 +18,16 @@ namespace Server.Items
|
|||
|
||||
public abstract class BaseInstrument : Item, ICraftable, ISlayer
|
||||
{
|
||||
private int m_WellSound, m_BadlySound;
|
||||
private SlayerName m_Slayer, m_Slayer2;
|
||||
private InstrumentQuality m_Quality;
|
||||
private Mobile m_Crafter;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int SuccessSound
|
||||
{
|
||||
get => m_WellSound;
|
||||
set => m_WellSound = value;
|
||||
}
|
||||
public int SuccessSound { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int FailureSound
|
||||
{
|
||||
get => m_BadlySound;
|
||||
set => m_BadlySound = value;
|
||||
}
|
||||
public int FailureSound { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SlayerName Slayer
|
||||
|
|
@ -323,8 +314,8 @@ namespace Server.Items
|
|||
|
||||
public BaseInstrument( int itemID, int wellSound, int badlySound ) : base( itemID )
|
||||
{
|
||||
m_WellSound = wellSound;
|
||||
m_BadlySound = badlySound;
|
||||
SuccessSound = wellSound;
|
||||
FailureSound = badlySound;
|
||||
UsesRemaining = Utility.RandomMinMax( InitMinUses, InitMaxUses );
|
||||
}
|
||||
|
||||
|
|
@ -440,8 +431,8 @@ namespace Server.Items
|
|||
|
||||
writer.WriteEncodedInt( (int)UsesRemaining );
|
||||
|
||||
writer.WriteEncodedInt( (int) m_WellSound );
|
||||
writer.WriteEncodedInt( (int) m_BadlySound );
|
||||
writer.WriteEncodedInt( (int) SuccessSound );
|
||||
writer.WriteEncodedInt( (int) FailureSound );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -471,8 +462,8 @@ namespace Server.Items
|
|||
|
||||
UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
m_WellSound = reader.ReadEncodedInt();
|
||||
m_BadlySound = reader.ReadEncodedInt();
|
||||
SuccessSound = reader.ReadEncodedInt();
|
||||
FailureSound = reader.ReadEncodedInt();
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -485,15 +476,15 @@ namespace Server.Items
|
|||
|
||||
UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
m_WellSound = reader.ReadEncodedInt();
|
||||
m_BadlySound = reader.ReadEncodedInt();
|
||||
SuccessSound = reader.ReadEncodedInt();
|
||||
FailureSound = reader.ReadEncodedInt();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_WellSound = reader.ReadInt();
|
||||
m_BadlySound = reader.ReadInt();
|
||||
SuccessSound = reader.ReadInt();
|
||||
FailureSound = reader.ReadInt();
|
||||
UsesRemaining = Utility.RandomMinMax( InitMinUses, InitMaxUses );
|
||||
|
||||
break;
|
||||
|
|
@ -536,12 +527,12 @@ namespace Server.Items
|
|||
|
||||
public void PlayInstrumentWell( Mobile from )
|
||||
{
|
||||
from.PlaySound( m_WellSound );
|
||||
from.PlaySound( SuccessSound );
|
||||
}
|
||||
|
||||
public void PlayInstrumentBadly( Mobile from )
|
||||
{
|
||||
from.PlaySound( m_BadlySound );
|
||||
from.PlaySound( FailureSound );
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
|
|
|
|||
|
|
@ -5,58 +5,53 @@ namespace Server.Items
|
|||
{
|
||||
public class CustomHueGroup
|
||||
{
|
||||
private int m_Name;
|
||||
private string m_NameString;
|
||||
private int[] m_Hues;
|
||||
public int Name { get; }
|
||||
|
||||
public int Name => m_Name;
|
||||
public string NameString => m_NameString;
|
||||
public string NameString { get; }
|
||||
|
||||
public int[] Hues => m_Hues;
|
||||
public int[] Hues { get; }
|
||||
|
||||
public CustomHueGroup( int name, int[] hues )
|
||||
{
|
||||
m_Name = name;
|
||||
m_Hues = hues;
|
||||
Name = name;
|
||||
Hues = hues;
|
||||
}
|
||||
|
||||
public CustomHueGroup( string name, int[] hues )
|
||||
{
|
||||
m_NameString = name;
|
||||
m_Hues = hues;
|
||||
NameString = name;
|
||||
Hues = hues;
|
||||
}
|
||||
}
|
||||
|
||||
public class CustomHuePicker
|
||||
{
|
||||
private CustomHueGroup[] m_Groups;
|
||||
private bool m_DefaultSupported;
|
||||
private int m_Title;
|
||||
private string m_TitleString;
|
||||
public bool DefaultSupported { get; }
|
||||
|
||||
public bool DefaultSupported => m_DefaultSupported;
|
||||
public CustomHueGroup[] Groups => m_Groups;
|
||||
public int Title => m_Title;
|
||||
public string TitleString => m_TitleString;
|
||||
public CustomHueGroup[] Groups { get; }
|
||||
|
||||
public int Title { get; }
|
||||
|
||||
public string TitleString { get; }
|
||||
|
||||
public CustomHuePicker( CustomHueGroup[] groups, bool defaultSupported )
|
||||
{
|
||||
m_Groups = groups;
|
||||
m_DefaultSupported = defaultSupported;
|
||||
Groups = groups;
|
||||
DefaultSupported = defaultSupported;
|
||||
}
|
||||
|
||||
public CustomHuePicker( CustomHueGroup[] groups, bool defaultSupported, int title )
|
||||
{
|
||||
m_Groups = groups;
|
||||
m_DefaultSupported = defaultSupported;
|
||||
m_Title = title;
|
||||
Groups = groups;
|
||||
DefaultSupported = defaultSupported;
|
||||
Title = title;
|
||||
}
|
||||
|
||||
public CustomHuePicker( CustomHueGroup[] groups, bool defaultSupported, string title )
|
||||
{
|
||||
m_Groups = groups;
|
||||
m_DefaultSupported = defaultSupported;
|
||||
m_TitleString = title;
|
||||
Groups = groups;
|
||||
DefaultSupported = defaultSupported;
|
||||
TitleString = title;
|
||||
}
|
||||
|
||||
public static readonly CustomHuePicker SpecialDyeTub = new CustomHuePicker( new[]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ namespace Server.Items
|
|||
{
|
||||
private bool m_Redyable;
|
||||
private int m_DyedHue;
|
||||
private SecureLevel m_SecureLevel;
|
||||
|
||||
public virtual CustomHuePicker CustomHuePicker => null;
|
||||
|
||||
|
|
@ -35,7 +34,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int)m_SecureLevel );
|
||||
writer.Write( (int)Level );
|
||||
writer.Write( (bool) m_Redyable );
|
||||
writer.Write( (int) m_DyedHue );
|
||||
}
|
||||
|
|
@ -50,7 +49,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_SecureLevel = (SecureLevel)reader.ReadInt();
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
|
|
@ -85,11 +84,7 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get => m_SecureLevel;
|
||||
set => m_SecureLevel = value;
|
||||
}
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public DyeTub() : base( 0xFAB )
|
||||
|
|
|
|||
|
|
@ -8,14 +8,8 @@ namespace Server.Items
|
|||
public override int FailMessage => 501021; // That is not a piece of furniture.
|
||||
public override int LabelNumber => 1041246; // Furniture Dye Tub
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public FurnitureDyeTub()
|
||||
|
|
@ -25,7 +19,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -39,7 +33,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +43,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -62,7 +56,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,8 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1041284; // Leather Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public LeatherDyeTub()
|
||||
|
|
@ -26,7 +20,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -40,7 +34,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076218 ); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +44,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -63,7 +57,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,8 @@ namespace Server.Items
|
|||
{
|
||||
public override int LabelNumber => 1006008; // Black Dye Tub
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public RewardBlackDyeTub()
|
||||
|
|
@ -23,7 +17,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -37,7 +31,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +41,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -60,7 +54,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,8 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1049740; // Runebook Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public RunebookDyeTub()
|
||||
|
|
@ -26,7 +20,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -40,7 +34,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076220 ); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +44,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -63,7 +57,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,8 @@ namespace Server.Items
|
|||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.SpecialDyeTub;
|
||||
public override int LabelNumber => 1041285; // Special Dye Tub
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public SpecialDyeTub()
|
||||
|
|
@ -24,7 +18,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -38,7 +32,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076217 ); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +42,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -61,7 +55,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,8 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1049741; // Reward Statuette Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get => m_IsRewardItem;
|
||||
set => m_IsRewardItem = value;
|
||||
}
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public StatuetteDyeTub()
|
||||
|
|
@ -26,7 +20,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
if ( IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
|
||||
return;
|
||||
|
||||
base.OnDoubleClick( from );
|
||||
|
|
@ -40,7 +34,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Core.ML && m_IsRewardItem )
|
||||
if ( Core.ML && IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
@ -50,7 +44,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (bool) m_IsRewardItem );
|
||||
writer.Write( (bool) IsRewardItem );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -63,7 +57,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,25 +301,25 @@ namespace Server.Items
|
|||
public static void CreateTimer( Mobile m, TimeSpan delay )
|
||||
{
|
||||
if ( m != null )
|
||||
if ( !m_Timers.ContainsKey( m ) )
|
||||
m_Timers[m] = new InternalTimer( m, delay );
|
||||
if ( !Timers.ContainsKey( m ) )
|
||||
Timers[m] = new InternalTimer( m, delay );
|
||||
}
|
||||
|
||||
public static void StartTimer( Mobile m )
|
||||
{
|
||||
m_Timers.TryGetValue( m, out Timer t );
|
||||
Timers.TryGetValue( m, out Timer t );
|
||||
|
||||
t?.Start();
|
||||
}
|
||||
|
||||
public static bool IsDisguised( Mobile m )
|
||||
{
|
||||
return m_Timers.ContainsKey( m );
|
||||
return Timers.ContainsKey( m );
|
||||
}
|
||||
|
||||
public static bool StopTimer( Mobile m )
|
||||
{
|
||||
m_Timers.TryGetValue( m, out Timer t );
|
||||
Timers.TryGetValue( m, out Timer t );
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
|
|
@ -336,12 +336,12 @@ namespace Server.Items
|
|||
|
||||
public static bool RemoveTimer( Mobile m )
|
||||
{
|
||||
m_Timers.TryGetValue( m, out Timer t );
|
||||
Timers.TryGetValue( m, out Timer t );
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove( m );
|
||||
Timers.Remove( m );
|
||||
}
|
||||
|
||||
return ( t != null );
|
||||
|
|
@ -349,7 +349,7 @@ namespace Server.Items
|
|||
|
||||
public static TimeSpan TimeRemaining( Mobile m )
|
||||
{
|
||||
m_Timers.TryGetValue( m, out Timer t );
|
||||
Timers.TryGetValue( m, out Timer t );
|
||||
|
||||
if ( t != null )
|
||||
{
|
||||
|
|
@ -359,8 +359,6 @@ namespace Server.Items
|
|||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, Timer> m_Timers = new Dictionary<Mobile, Timer>();
|
||||
|
||||
public static Dictionary<Mobile, Timer> Timers => m_Timers;
|
||||
public static Dictionary<Mobile, Timer> Timers { get; } = new Dictionary<Mobile, Timer>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ namespace Server.Items
|
|||
{
|
||||
public class DisguisePersistance : Item
|
||||
{
|
||||
private static DisguisePersistance m_Instance;
|
||||
|
||||
public static DisguisePersistance Instance => m_Instance;
|
||||
public static DisguisePersistance Instance { get; private set; }
|
||||
|
||||
public override string DefaultName => "Disguise Persistance - Internal";
|
||||
|
||||
|
|
@ -15,15 +13,15 @@ namespace Server.Items
|
|||
{
|
||||
Movable = false;
|
||||
|
||||
if ( m_Instance == null || m_Instance.Deleted )
|
||||
m_Instance = this;
|
||||
if ( Instance == null || Instance.Deleted )
|
||||
Instance = this;
|
||||
else
|
||||
base.Delete();
|
||||
}
|
||||
|
||||
public DisguisePersistance( Serial serial ) : base( serial )
|
||||
{
|
||||
m_Instance = this;
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
|
|
|
|||
|
|
@ -17,13 +17,11 @@ namespace Server.Items
|
|||
[Flippable( 0x104B, 0x104C )]
|
||||
public class Clock : Item
|
||||
{
|
||||
private static DateTime m_ServerStart;
|
||||
|
||||
public static DateTime ServerStart => m_ServerStart;
|
||||
public static DateTime ServerStart { get; private set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_ServerStart = DateTime.UtcNow;
|
||||
ServerStart = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue