Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class EternallyCorruptTree : Item
{
[Constructible]
public EternallyCorruptTree() : base(0x20FA)
{
Hue = Utility.RandomMinMax(0x899, 0x8B0);
}
public EternallyCorruptTree() : base(0x20FA) => Hue = Utility.RandomMinMax(0x899, 0x8B0);
public EternallyCorruptTree(Serial serial) : base(serial)
{

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class MelisandesHairDye : Item
{
[Constructible]
public MelisandesHairDye() : base(0xEFF)
{
Hue = Utility.RandomMinMax(0x47E, 0x499);
}
public MelisandesHairDye() : base(0xEFF) => Hue = Utility.RandomMinMax(0x47E, 0x499);
public MelisandesHairDye(Serial serial) : base(serial)
{
@ -54,10 +51,7 @@ namespace Server.Items
{
private Item m_Item;
public ConfirmGump(Item item)
{
m_Item = item;
}
public ConfirmGump(Item item) => m_Item = item;
public override int TitleNumber => 1074395; // <div align=right>Use Permanent Hair Dye</div>

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class SamplesOfCorruptedWater : Item
{
[Constructible]
public SamplesOfCorruptedWater() : base(0xEFE)
{
LootType = LootType.Blessed;
}
public SamplesOfCorruptedWater() : base(0xEFE) => LootType = LootType.Blessed;
public SamplesOfCorruptedWater(Serial serial) : base(serial)
{

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class Blocker : Item
{
[Constructible]
public Blocker() : base(0x21A4)
{
Movable = false;
}
public Blocker() : base(0x21A4) => Movable = false;
public Blocker(Serial serial) : base(serial)
{

View file

@ -147,10 +147,7 @@ namespace Server.Items
{
private Bola m_Bola;
public BolaTarget(Bola bola) : base(8, false, TargetFlags.Harmful)
{
m_Bola = bola;
}
public BolaTarget(Bola bola) : base(8, false, TargetFlags.Harmful) => m_Bola = bola;
protected override void OnTarget(Mobile from, object obj)
{

View file

@ -56,10 +56,7 @@ namespace Server.Items
[CommandProperty(AccessLevel.GameMaster)]
public string BoardName{ get; set; }
public static bool CheckTime(DateTime time, TimeSpan range)
{
return time + range < DateTime.UtcNow;
}
public static bool CheckTime(DateTime time, TimeSpan range) => time + range < DateTime.UtcNow;
public static string FormatTS(TimeSpan ts)
{
@ -367,20 +364,11 @@ namespace Server.Items
public string[] Lines{ get; private set; }
public string GetTimeAsString()
{
return Time.ToString("MMM dd, yyyy");
}
public string GetTimeAsString() => Time.ToString("MMM dd, yyyy");
public override bool CheckTarget(Mobile from, Target targ, object targeted)
{
return false;
}
public override bool CheckTarget(Mobile from, Target targ, object targeted) => false;
public override bool IsAccessibleTo(Mobile check)
{
return false;
}
public override bool IsAccessibleTo(Mobile check) => false;
public override void Serialize(GenericWriter writer)
{
@ -528,10 +516,7 @@ namespace Server.Items
m_Stream.Write((byte)0);
}
public string SafeString(string v)
{
return v ?? string.Empty;
}
public string SafeString(string v) => v ?? string.Empty;
}
public class BBMessageContent : Packet

View file

@ -174,10 +174,7 @@ namespace Server.Items
{
private BroadcastCrystal m_Crystal;
public InternalTarget(BroadcastCrystal crystal) : base(2, false, TargetFlags.None)
{
m_Crystal = crystal;
}
public InternalTarget(BroadcastCrystal crystal) : base(2, false, TargetFlags.None) => m_Crystal = crystal;
protected override void OnTarget(Mobile from, object targeted)
{
@ -280,10 +277,7 @@ namespace Server.Items
private BroadcastCrystal m_Sender;
[Constructible]
public ReceiverCrystal() : base(0x1ED0)
{
Light = LightType.Circle150;
}
public ReceiverCrystal() : base(0x1ED0) => Light = LightType.Circle150;
public ReceiverCrystal(Serial serial) : base(serial)
{
@ -388,10 +382,7 @@ namespace Server.Items
{
private ReceiverCrystal m_Crystal;
public InternalTarget(ReceiverCrystal crystal) : base(-1, false, TargetFlags.None)
{
m_Crystal = crystal;
}
public InternalTarget(ReceiverCrystal crystal) : base(-1, false, TargetFlags.None) => m_Crystal = crystal;
protected override void OnTarget(Mobile from, object targeted)
{

View file

@ -337,12 +337,10 @@ namespace Server.Items
}
}
public override bool IsChildVisibleTo(Mobile m, Item child)
{
return !m.Player || m.AccessLevel > AccessLevel.Player || m_InstancedItems == null ||
!m_InstancedItems.TryGetValue(child, out InstancedItemInfo info) || !InstancedCorpse && !info.Perpetual
|| info.IsOwner(m);
}
public override bool IsChildVisibleTo(Mobile m, Item child) =>
!m.Player || m.AccessLevel > AccessLevel.Player || m_InstancedItems == null ||
!m_InstancedItems.TryGetValue(child, out InstancedItemInfo info) || !InstancedCorpse && !info.Perpetual
|| info.IsOwner(m);
private void AssignInstancedLoot()
{
@ -470,10 +468,7 @@ namespace Server.Items
m_DecayTimer = null;
}
public static string GetCorpseName(Mobile m)
{
return m is BaseCreature bc ? bc.CorpseNameOverride ?? bc.CorpseName : null;
}
public static string GetCorpseName(Mobile m) => m is BaseCreature bc ? bc.CorpseNameOverride ?? bc.CorpseName : null;
public static void Initialize()
{
@ -521,10 +516,7 @@ namespace Server.Items
return c;
}
protected bool GetFlag(CorpseFlag flag)
{
return (m_Flags & flag) != 0;
}
protected bool GetFlag(CorpseFlag flag) => (m_Flags & flag) != 0;
protected void SetFlag(CorpseFlag flag, bool on)
{
@ -791,15 +783,9 @@ namespace Server.Items
return NotorietyHandlers.CorpseNotoriety(from, this) == Notoriety.Innocent;
}
public override bool CheckItemUse(Mobile from, Item item)
{
return base.CheckItemUse(from, item) && (item == this || CanLoot(from, item));
}
public override bool CheckItemUse(Mobile from, Item item) => base.CheckItemUse(from, item) && (item == this || CanLoot(from, item));
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
{
return base.CheckLift(from, item, ref reject) && CanLoot(from, item);
}
public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => base.CheckLift(from, item, ref reject) && CanLoot(from, item);
public override void OnItemUsed(Mobile from, Item item)
{
@ -843,10 +829,7 @@ namespace Server.Items
list.Add(new OpenCorpseEntry());
}
public bool GetRestoreInfo(Item item, ref Point3D loc)
{
return item != null && m_RestoreTable?.TryGetValue(item, out loc) == true;
}
public bool GetRestoreInfo(Item item, ref Point3D loc) => item != null && m_RestoreTable?.TryGetValue(item, out loc) == true;
public void SetRestoreInfo(Item item, Point3D loc)
{
@ -870,10 +853,7 @@ namespace Server.Items
m_RestoreTable = null;
}
public bool CanLoot(Mobile from, Item item)
{
return !IsCriminalAction(from) || (Map.Rules & MapRules.HarmfulRestrictions) == 0;
}
public bool CanLoot(Mobile from, Item item) => !IsCriminalAction(from) || (Map.Rules & MapRules.HarmfulRestrictions) == 0;
public bool CheckLoot(Mobile from, Item item)
{
@ -1062,10 +1042,7 @@ namespace Server.Items
Open(from, Core.AOS);
}
public override bool CheckContentDisplay(Mobile from)
{
return false;
}
public override bool CheckContentDisplay(Mobile from) => false;
public override void AddNameProperty(ObjectPropertyList list)
{

View file

@ -5,10 +5,7 @@ namespace Server
[AttributeUsage(AttributeTargets.Class)]
public class CorpseNameAttribute : Attribute
{
public CorpseNameAttribute(string name)
{
Name = name;
}
public CorpseNameAttribute(string name) => Name = name;
public string Name{ get; }
}

View file

@ -41,10 +41,7 @@ namespace Server.Items
}
// Do not display (x items, y stones)
public override bool CheckContentDisplay(Mobile from)
{
return false;
}
public override bool CheckContentDisplay(Mobile from) => false;
public override void AddNameProperty(ObjectPropertyList list)
{

View file

@ -214,10 +214,7 @@ namespace Server.Items
writer.WriteEncodedInt(TriggerRange);
}
private IEntity ReadEntity(GenericReader reader)
{
return World.FindEntity(reader.ReadUInt());
}
private IEntity ReadEntity(GenericReader reader) => World.FindEntity(reader.ReadUInt());
public override void Deserialize(GenericReader reader)
{

View file

@ -10,9 +10,8 @@ namespace Server.Items
public static readonly TimeSpan DefaultDuration = TimeSpan.FromSeconds(5.0);
private EffectItem() : base(1) // nodraw
{
Movable = false;
}
=>
Movable = false;
public EffectItem(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class ExecutionersCap : Item
{
[Constructible]
public ExecutionersCap() : base(0xF83)
{
Weight = 1.0;
}
public ExecutionersCap() : base(0xF83) => Weight = 1.0;
public ExecutionersCap(Serial serial) : base(serial)
{

View file

@ -183,10 +183,8 @@ namespace Server.Items
private class ThrowTarget : Target
{
public ThrowTarget(Firebomb bomb)
: base(12, true, TargetFlags.None)
{
: base(12, true, TargetFlags.None) =>
Bomb = bomb;
}
public Firebomb Bomb{ get; }

View file

@ -14,10 +14,7 @@ namespace Server.Items
typeof(Mobile), typeof(Direction)
};
public FlippableAddonAttribute(params Direction[] directions)
{
Directions = directions;
}
public FlippableAddonAttribute(params Direction[] directions) => Directions = directions;
public Direction[] Directions{ get; }

View file

@ -55,10 +55,7 @@ namespace Server.Items
[AttributeUsage(AttributeTargets.Class)]
public class FlippableAttribute : Attribute
{
public FlippableAttribute(params int[] itemIDs)
{
ItemIDs = itemIDs;
}
public FlippableAttribute(params int[] itemIDs) => ItemIDs = itemIDs;
public int[] ItemIDs{ get; }

View file

@ -10,10 +10,8 @@ namespace Server.Items
[Constructible]
public Guillotine()
: base(4656)
{
: base(4656) =>
Movable = false;
}
public Guillotine(Serial serial)
: base(serial)

View file

@ -6,10 +6,7 @@ namespace Server.Items
public class HairDye : Item
{
[Constructible]
public HairDye() : base(0xEFF)
{
Weight = 1.0;
}
public HairDye() : base(0xEFF) => Weight = 1.0;
public HairDye(Serial serial) : base(serial)
{

View file

@ -70,10 +70,7 @@ namespace Server.Items
[CommandProperty(AccessLevel.GameMaster)]
public Item Link{ get; set; }
public static uint RandomValue()
{
return (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1;
}
public static uint RandomValue() => (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1;
public static void RemoveKeys(Mobile m, uint keyValue)
{
@ -273,10 +270,7 @@ namespace Server.Items
{
private Key m_Key;
public RenamePrompt(Key key)
{
m_Key = key;
}
public RenamePrompt(Key key) => m_Key = key;
public override void OnResponse(Mobile from, string text)
{
@ -336,10 +330,7 @@ namespace Server.Items
{
private Key m_Key;
public CopyTarget(Key key) : base(3, false, TargetFlags.None)
{
m_Key = key;
}
public CopyTarget(Key key) : base(3, false, TargetFlags.None) => m_Key = key;
protected override void OnTarget(Mobile from, object targeted)
{

View file

@ -152,10 +152,7 @@ namespace Server.Items
{
private KeyRing m_KeyRing;
public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None)
{
m_KeyRing = keyRing;
}
public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None) => m_KeyRing = keyRing;
protected override void OnTarget(Mobile from, object targeted)
{

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class LOSBlocker : Item
{
[Constructible]
public LOSBlocker() : base(0x21A2)
{
Movable = false;
}
public LOSBlocker() : base(0x21A2) => Movable = false;
public LOSBlocker(Serial serial) : base(serial)
{

View file

@ -106,10 +106,7 @@ namespace Server.Items
}
}
public Map GetTargetMap()
{
return m_Type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel;
}
public Map GetTargetMap() => m_Type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel;
public override void Serialize(GenericWriter writer)
{

View file

@ -8,10 +8,7 @@ namespace Server.Items
public class OilCloth : Item, IScissorable, IDyable
{
[Constructible]
public OilCloth() : base(0x175D)
{
Hue = 2001;
}
public OilCloth() : base(0x175D) => Hue = 2001;
public OilCloth(Serial serial) : base(serial)
{

View file

@ -72,10 +72,7 @@ namespace Server.Items
public class OrigamiButterfly : Item
{
[Constructible]
public OrigamiButterfly() : base(0x2838)
{
LootType = LootType.Blessed;
}
public OrigamiButterfly() : base(0x2838) => LootType = LootType.Blessed;
public OrigamiButterfly(Serial serial) : base(serial)
{
@ -101,10 +98,7 @@ namespace Server.Items
public class OrigamiSwan : Item
{
[Constructible]
public OrigamiSwan() : base(0x2839)
{
LootType = LootType.Blessed;
}
public OrigamiSwan() : base(0x2839) => LootType = LootType.Blessed;
public OrigamiSwan(Serial serial) : base(serial)
{
@ -130,10 +124,7 @@ namespace Server.Items
public class OrigamiFrog : Item
{
[Constructible]
public OrigamiFrog() : base(0x283A)
{
LootType = LootType.Blessed;
}
public OrigamiFrog() : base(0x283A) => LootType = LootType.Blessed;
public OrigamiFrog(Serial serial) : base(serial)
{
@ -159,10 +150,7 @@ namespace Server.Items
public class OrigamiShape : Item
{
[Constructible]
public OrigamiShape() : base(0x283B)
{
LootType = LootType.Blessed;
}
public OrigamiShape() : base(0x283B) => LootType = LootType.Blessed;
public OrigamiShape(Serial serial) : base(serial)
{
@ -188,10 +176,7 @@ namespace Server.Items
public class OrigamiSongbird : Item
{
[Constructible]
public OrigamiSongbird() : base(0x283C)
{
LootType = LootType.Blessed;
}
public OrigamiSongbird() : base(0x283C) => LootType = LootType.Blessed;
public OrigamiSongbird(Serial serial) : base(serial)
{
@ -217,10 +202,7 @@ namespace Server.Items
public class OrigamiFish : Item
{
[Constructible]
public OrigamiFish() : base(0x283D)
{
LootType = LootType.Blessed;
}
public OrigamiFish() : base(0x283D) => LootType = LootType.Blessed;
public OrigamiFish(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class AcidProofRope : Item
{
[Constructible]
public AcidProofRope() : base(0x20D)
{
Hue = 0x3D1; // TODO check
}
public AcidProofRope() : base(0x20D) => Hue = 0x3D1;
public AcidProofRope(Serial serial) : base(serial)
{

File diff suppressed because it is too large Load diff

View file

@ -6,11 +6,7 @@ namespace Server.Items
public class ContractOfEmployment : Item
{
[Constructible]
public ContractOfEmployment() : base(0x14F0)
{
Weight = 1.0;
//LootType = LootType.Blessed;
}
public ContractOfEmployment() : base(0x14F0) => Weight = 1.0;
public ContractOfEmployment(Serial serial) : base(serial)
{

View file

@ -4,92 +4,92 @@ using System.Collections.Generic;
namespace Server.Items
{
public class PoolOfAcid : Item
{
private TimeSpan m_Duration;
private int m_MinDamage;
private int m_MaxDamage;
private DateTime m_Created;
private bool m_Drying;
private Timer m_Timer;
public class PoolOfAcid : Item
{
private TimeSpan m_Duration;
private int m_MinDamage;
private int m_MaxDamage;
private DateTime m_Created;
private bool m_Drying;
private Timer m_Timer;
[Constructible]
public PoolOfAcid() : this( TimeSpan.FromSeconds( 10.0 ), 2, 5 )
{
}
[Constructible]
public PoolOfAcid() : this( TimeSpan.FromSeconds( 10.0 ), 2, 5 )
{
}
public override string DefaultName => "a pool of acid";
public override string DefaultName => "a pool of acid";
[Constructible]
public PoolOfAcid( TimeSpan duration, int minDamage, int maxDamage )
: base( 0x122A )
{
Hue = 0x3F;
Movable = false;
[Constructible]
public PoolOfAcid( TimeSpan duration, int minDamage, int maxDamage )
: base( 0x122A )
{
Hue = 0x3F;
Movable = false;
m_MinDamage = minDamage;
m_MaxDamage = maxDamage;
m_Created = DateTime.UtcNow;
m_Duration = duration;
m_MinDamage = minDamage;
m_MaxDamage = maxDamage;
m_Created = DateTime.UtcNow;
m_Duration = duration;
m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick );
}
m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick );
}
public override void OnAfterDelete()
{
m_Timer?.Stop();
}
public override void OnAfterDelete()
{
m_Timer?.Stop();
}
private void OnTick()
{
DateTime now = DateTime.UtcNow;
TimeSpan age = now - m_Created;
private void OnTick()
{
DateTime now = DateTime.UtcNow;
TimeSpan age = now - m_Created;
if ( age > m_Duration ) {
Delete();
} else {
if ( !m_Drying && age > (m_Duration - age) )
{
m_Drying = true;
ItemID = 0x122B;
}
if ( age > m_Duration ) {
Delete();
} else {
if ( !m_Drying && age > (m_Duration - age) )
{
m_Drying = true;
ItemID = 0x122B;
}
List<Mobile> toDamage = new List<Mobile>();
List<Mobile> toDamage = new List<Mobile>();
foreach( Mobile m in GetMobilesInRange( 0 ) )
{
if ( m.Alive && !m.IsDeadBondedPet && (!(m is BaseCreature bc) || bc.Controlled || bc.Summoned) )
{
toDamage.Add( m );
}
}
foreach( Mobile m in GetMobilesInRange( 0 ) )
{
if ( m.Alive && !m.IsDeadBondedPet && (!(m is BaseCreature bc) || bc.Controlled || bc.Summoned) )
{
toDamage.Add( m );
}
}
for ( int i = 0; i < toDamage.Count; i++ )
Damage( toDamage[i] );
}
}
public override bool OnMoveOver( Mobile m )
{
Damage( m );
return true;
}
for ( int i = 0; i < toDamage.Count; i++ )
Damage( toDamage[i] );
}
}
public override bool OnMoveOver( Mobile m )
{
Damage( m );
return true;
}
public void Damage ( Mobile m )
{
m.Damage( Utility.RandomMinMax( m_MinDamage, m_MaxDamage ) );
}
public void Damage ( Mobile m )
{
m.Damage( Utility.RandomMinMax( m_MinDamage, m_MaxDamage ) );
}
public PoolOfAcid( Serial serial ) : base( serial )
{
}
public PoolOfAcid( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
//Don't serialize these
}
public override void Serialize( GenericWriter writer )
{
//Don't serialize these
}
public override void Deserialize( GenericReader reader )
{
}
}
public override void Deserialize( GenericReader reader )
{
}
}
}

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class PowerCrystal : Item
{
[Constructible]
public PowerCrystal() : base(0x1F1C)
{
Weight = 1.0;
}
public PowerCrystal() : base(0x1F1C) => Weight = 1.0;
public PowerCrystal(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class LuckyDagger : Item
{
[Constructible]
public LuckyDagger() : base(0xF52)
{
Hue = 0x8A5;
}
public LuckyDagger() : base(0xF52) => Hue = 0x8A5;
public LuckyDagger(Serial serial) : base(serial)
{

View file

@ -3,154 +3,154 @@ using Server.Network;
namespace Server.Items
{
public abstract class PromotionalToken : Item
{
public abstract Item CreateItemFor( Mobile from );
public abstract class PromotionalToken : Item
{
public abstract Item CreateItemFor( Mobile from );
public abstract TextDefinition ItemName{ get; }
public abstract TextDefinition ItemReceiveMessage { get; }
public abstract TextDefinition ItemGumpName { get; }
public abstract TextDefinition ItemName{ get; }
public abstract TextDefinition ItemReceiveMessage { get; }
public abstract TextDefinition ItemGumpName { get; }
public PromotionalToken() : base( 0x2AAA )
{
LootType = LootType.Blessed;
Light = LightType.Circle300;
Weight = 5.0;
}
public PromotionalToken() : base( 0x2AAA )
{
LootType = LootType.Blessed;
Light = LightType.Circle300;
Weight = 5.0;
}
public PromotionalToken( Serial serial ) : base( serial )
{
}
public PromotionalToken( Serial serial ) : base( serial )
{
}
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
list.Add( 1070998, ItemName.ToString() ); // Use this to redeem<br>your ~1_PROMO~
}
list.Add( 1070998, ItemName.ToString() ); // Use this to redeem<br>your ~1_PROMO~
}
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
}
else
{
from.CloseGump<PromotionalTokenGump>();
from.SendGump( new PromotionalTokenGump( this ) );
}
}
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
}
else
{
from.CloseGump<PromotionalTokenGump>();
from.SendGump( new PromotionalTokenGump( this ) );
}
}
public override void OnRemoved(IEntity parent)
{
Mobile m = null;
public override void OnRemoved(IEntity parent)
{
Mobile m = null;
if ( parent is Item item )
m = item.RootParent as Mobile;
else if ( parent is Mobile mobile )
m = mobile;
if ( parent is Item item )
m = item.RootParent as Mobile;
else if ( parent is Mobile mobile )
m = mobile;
m?.CloseGump<PromotionalTokenGump>();
}
m?.CloseGump<PromotionalTokenGump>();
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 );
}
writer.Write( 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
int version = reader.ReadInt();
}
public override int LabelNumber => 1070997; // A promotional token
public override int LabelNumber => 1070997; // A promotional token
private class PromotionalTokenGump : Gump
{
private PromotionalToken m_Token;
private class PromotionalTokenGump : Gump
{
private PromotionalToken m_Token;
public PromotionalTokenGump( PromotionalToken token ) : base( 10, 10 )
{
m_Token = token;
public PromotionalTokenGump( PromotionalToken token ) : base( 10, 10 )
{
m_Token = token;
AddPage( 0 );
AddPage( 0 );
AddBackground( 0, 0, 240, 135, 0x2422 );
AddHtmlLocalized( 15, 15, 210, 75, 1070972, 0x0, true ); // Click "OKAY" to redeem the following promotional item:
TextDefinition.AddHtmlText( this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false );
AddBackground( 0, 0, 240, 135, 0x2422 );
AddHtmlLocalized( 15, 15, 210, 75, 1070972, 0x0, true ); // Click "OKAY" to redeem the following promotional item:
TextDefinition.AddHtmlText( this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false );
AddButton( 160, 95, 0xF7, 0xF8, 1); //Okay
AddButton( 90, 95, 0xF2, 0xF1, 0); //Cancel
}
AddButton( 160, 95, 0xF7, 0xF8, 1); //Okay
AddButton( 90, 95, 0xF2, 0xF1, 0); //Cancel
}
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID != 1 )
return;
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID != 1 )
return;
Mobile from = sender.Mobile;
Mobile from = sender.Mobile;
if ( !m_Token.IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
}
else
{
Item i = m_Token.CreateItemFor( from );
if ( !m_Token.IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
}
else
{
Item i = m_Token.CreateItemFor( from );
if ( i != null )
{
from.BankBox.AddItem( i );
TextDefinition.SendMessageTo( from, m_Token.ItemReceiveMessage );
m_Token.Delete();
}
}
}
}
}
if ( i != null )
{
from.BankBox.AddItem( i );
TextDefinition.SendMessageTo( from, m_Token.ItemReceiveMessage );
m_Token.Delete();
}
}
}
}
}
public class SoulstoneFragmentToken : PromotionalToken
{
public class SoulstoneFragmentToken : PromotionalToken
{
public override Item CreateItemFor( Mobile from )
{
if ( from?.Account != null )
return new SoulstoneFragment( from.Account.ToString() );
public override Item CreateItemFor( Mobile from )
{
if ( from?.Account != null )
return new SoulstoneFragment( from.Account.ToString() );
return null;
}
return null;
}
public override TextDefinition ItemGumpName => 1070999;// <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000;//soulstone fragment
public override TextDefinition ItemReceiveMessage => 1070976; // A soulstone fragment has been created in your bank box.
public override TextDefinition ItemGumpName => 1070999;// <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000;//soulstone fragment
public override TextDefinition ItemReceiveMessage => 1070976; // A soulstone fragment has been created in your bank box.
[Constructible]
public SoulstoneFragmentToken()
{
}
[Constructible]
public SoulstoneFragmentToken()
{
}
public SoulstoneFragmentToken( Serial serial ) : base( serial )
{
}
public SoulstoneFragmentToken( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( 0 );
}
writer.Write( 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
int version = reader.ReadInt();
}
}
}

View file

@ -285,10 +285,7 @@ namespace Server.Items
public class HorseShoes : Item
{
[Constructible]
public HorseShoes() : base(0xFB6)
{
Weight = 3.0;
}
public HorseShoes() : base(0xFB6) => Weight = 3.0;
public HorseShoes(Serial serial) : base(serial)
{
@ -312,10 +309,7 @@ namespace Server.Items
public class ForgedMetal : Item
{
[Constructible]
public ForgedMetal() : base(0xFB8)
{
Weight = 5.0;
}
public ForgedMetal() : base(0xFB8) => Weight = 5.0;
public ForgedMetal(Serial serial) : base(serial)
{
@ -339,10 +333,7 @@ namespace Server.Items
public class Whip : Item
{
[Constructible]
public Whip() : base(0x166E)
{
Weight = 1.0;
}
public Whip() : base(0x166E) => Weight = 1.0;
public Whip(Serial serial) : base(serial)
{
@ -366,10 +357,7 @@ namespace Server.Items
public class PaintsAndBrush : Item
{
[Constructible]
public PaintsAndBrush() : base(0xFC1)
{
Weight = 1.0;
}
public PaintsAndBrush() : base(0xFC1) => Weight = 1.0;
public PaintsAndBrush(Serial serial) : base(serial)
{
@ -393,10 +381,7 @@ namespace Server.Items
public class PenAndInk : Item
{
[Constructible]
public PenAndInk() : base(0xFBF)
{
Weight = 1.0;
}
public PenAndInk() : base(0xFBF) => Weight = 1.0;
public PenAndInk(Serial serial) : base(serial)
{
@ -420,10 +405,7 @@ namespace Server.Items
public class ChiselsNorth : Item
{
[Constructible]
public ChiselsNorth() : base(0x1026)
{
Weight = 1.0;
}
public ChiselsNorth() : base(0x1026) => Weight = 1.0;
public ChiselsNorth(Serial serial) : base(serial)
{
@ -447,10 +429,7 @@ namespace Server.Items
public class ChiselsWest : Item
{
[Constructible]
public ChiselsWest() : base(0x1027)
{
Weight = 1.0;
}
public ChiselsWest() : base(0x1027) => Weight = 1.0;
public ChiselsWest(Serial serial) : base(serial)
{
@ -474,10 +453,7 @@ namespace Server.Items
public class DirtyPan : Item
{
[Constructible]
public DirtyPan() : base(0x9E8)
{
Weight = 1.0;
}
public DirtyPan() : base(0x9E8) => Weight = 1.0;
public DirtyPan(Serial serial) : base(serial)
{
@ -501,10 +477,7 @@ namespace Server.Items
public class DirtySmallRoundPot : Item
{
[Constructible]
public DirtySmallRoundPot() : base(0x9E7)
{
Weight = 1.0;
}
public DirtySmallRoundPot() : base(0x9E7) => Weight = 1.0;
public DirtySmallRoundPot(Serial serial) : base(serial)
{
@ -528,10 +501,7 @@ namespace Server.Items
public class DirtyPot : Item
{
[Constructible]
public DirtyPot() : base(0x9E6)
{
Weight = 1.0;
}
public DirtyPot() : base(0x9E6) => Weight = 1.0;
public DirtyPot(Serial serial) : base(serial)
{
@ -555,10 +525,7 @@ namespace Server.Items
public class DirtyRoundPot : Item
{
[Constructible]
public DirtyRoundPot() : base(0x9DF)
{
Weight = 1.0;
}
public DirtyRoundPot() : base(0x9DF) => Weight = 1.0;
public DirtyRoundPot(Serial serial) : base(serial)
{
@ -582,10 +549,7 @@ namespace Server.Items
public class DirtyFrypan : Item
{
[Constructible]
public DirtyFrypan() : base(0x9DE)
{
Weight = 1.0;
}
public DirtyFrypan() : base(0x9DE) => Weight = 1.0;
public DirtyFrypan(Serial serial) : base(serial)
{
@ -609,10 +573,7 @@ namespace Server.Items
public class DirtySmallPot : Item
{
[Constructible]
public DirtySmallPot() : base(0x9DD)
{
Weight = 1.0;
}
public DirtySmallPot() : base(0x9DD) => Weight = 1.0;
public DirtySmallPot(Serial serial) : base(serial)
{
@ -636,10 +597,7 @@ namespace Server.Items
public class DirtyKettle : Item
{
[Constructible]
public DirtyKettle() : base(0x9DC)
{
Weight = 1.0;
}
public DirtyKettle() : base(0x9DC) => Weight = 1.0;
public DirtyKettle(Serial serial) : base(serial)
{

View file

@ -5,10 +5,7 @@ namespace Server.Items
public class Scales : Item
{
[Constructible]
public Scales() : base(0x1852)
{
Weight = 4.0;
}
public Scales() : base(0x1852) => Weight = 4.0;
public Scales(Serial serial) : base(serial)
{
@ -38,10 +35,7 @@ namespace Server.Items
{
private Scales m_Item;
public InternalTarget(Scales item) : base(1, false, TargetFlags.None)
{
m_Item = item;
}
public InternalTarget(Scales item) : base(1, false, TargetFlags.None) => m_Item = item;
protected override void OnTarget(Mobile from, object targeted)
{

View file

@ -2,16 +2,10 @@ namespace Server.Items
{
public class Static : Item
{
public Static() : base(0x80)
{
Movable = false;
}
public Static() : base(0x80) => Movable = false;
[Constructible]
public Static(int itemID) : base(itemID)
{
Movable = false;
}
public Static(int itemID) : base(itemID) => Movable = false;
[Constructible]
public Static(int itemID, int count) : this(Utility.Random(itemID, count))
@ -50,10 +44,7 @@ namespace Server.Items
}
[Constructible]
public LocalizedStatic(int itemID, int labelNumber) : base(itemID)
{
m_LabelNumber = labelNumber;
}
public LocalizedStatic(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber;
public LocalizedStatic(Serial serial) : base(serial)
{

View file

@ -548,10 +548,7 @@ namespace Server.Items
base.DoTeleport(m);
}
public override bool OnMoveOver(Mobile m)
{
return true;
}
public override bool OnMoveOver(Mobile m) => true;
public override void GetProperties(ObjectPropertyList list)
{
@ -761,10 +758,8 @@ namespace Server.Items
[Constructible]
public TimeoutTeleporter(Point3D pointDest, Map mapDest = null, bool creatures = false)
: base(pointDest, mapDest, creatures)
{
: base(pointDest, mapDest, creatures) =>
m_Teleporting = new Dictionary<Mobile, Timer>();
}
public TimeoutTeleporter(Serial serial)
: base(serial)
@ -1151,10 +1146,7 @@ namespace Server.Items
m_Flags = (ConditionFlag)reader.ReadInt();
}
protected bool GetFlag(ConditionFlag flag)
{
return (m_Flags & flag) != 0;
}
protected bool GetFlag(ConditionFlag flag) => (m_Flags & flag) != 0;
protected void SetFlag(ConditionFlag flag, bool value)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class DragonFlameSectBadge : Item
{
[Constructible]
public DragonFlameSectBadge() : base(0x23E)
{
LootType = LootType.Blessed;
}
public DragonFlameSectBadge() : base(0x23E) => LootType = LootType.Blessed;
public DragonFlameSectBadge(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class OrdersFromMinax : Item
{
[Constructible]
public OrdersFromMinax() : base(0x2279)
{
LootType = LootType.Blessed;
}
public OrdersFromMinax() : base(0x2279) => LootType = LootType.Blessed;
public OrdersFromMinax(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class SerpentFangSectBadge : Item
{
[Constructible]
public SerpentFangSectBadge() : base(0x23C)
{
LootType = LootType.Blessed;
}
public SerpentFangSectBadge() : base(0x23C) => LootType = LootType.Blessed;
public SerpentFangSectBadge(Serial serial) : base(serial)
{

View file

@ -3,10 +3,7 @@ namespace Server.Items
public class TigerClawSectBadge : Item
{
[Constructible]
public TigerClawSectBadge() : base(0x23D)
{
LootType = LootType.Blessed;
}
public TigerClawSectBadge() : base(0x23D) => LootType = LootType.Blessed;
public TigerClawSectBadge(Serial serial) : base(serial)
{

View file

@ -6,10 +6,7 @@ namespace Server.Items
public class TrashChest : Container
{
[Constructible]
public TrashChest() : base(0xE41)
{
Movable = false;
}
public TrashChest() : base(0xE41) => Movable = false;
public TrashChest(Serial serial) : base(serial)
{

View file

@ -157,16 +157,10 @@ namespace Server.Items
public class HintItem : WarningItem
{
[Constructible]
public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning)
{
HintNumber = hint;
}
public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning) => HintNumber = hint;
[Constructible]
public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning)
{
HintString = hint;
}
public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning) => HintString = hint;
public HintItem(Serial serial) : base(serial)
{

View file

@ -96,10 +96,7 @@ namespace Server.Items
{
private WayPoint m_Point;
public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None)
{
m_Point = pt;
}
public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None) => m_Point = pt;
protected override void OnTarget(Mobile from, object target)
{
@ -114,10 +111,7 @@ namespace Server.Items
{
private WayPoint m_Last;
public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None)
{
m_Last = last;
}
public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None) => m_Last = last;
protected override void OnTarget(Mobile from, object targeted)
{

View file

@ -50,10 +50,7 @@ namespace Server.Items
list.Add(502696); // turned off
}
public bool IsOwner(Mobile mob)
{
return BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true;
}
public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true;
public override void OnDoubleClick(Mobile from)
{