Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -4,92 +4,95 @@ using Server.Engines.BulkOrders;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Weaver : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos => m_SBInfos;
|
||||
public class Weaver : BaseVendor
|
||||
{
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
|
||||
public override NpcGuild NpcGuild => NpcGuild.TailorsGuild;
|
||||
[Constructible]
|
||||
public Weaver() : base("the weaver")
|
||||
{
|
||||
SetSkill(SkillName.Tailoring, 65.0, 88.0);
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Weaver() : base( "the weaver" )
|
||||
{
|
||||
SetSkill( SkillName.Tailoring, 65.0, 88.0 );
|
||||
}
|
||||
public Weaver(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add( new SBWeaver() );
|
||||
}
|
||||
protected override List<SBInfo> SBInfos => m_SBInfos;
|
||||
|
||||
public override VendorShoeType ShoeType => VendorShoeType.Sandals;
|
||||
public override NpcGuild NpcGuild => NpcGuild.TailorsGuild;
|
||||
|
||||
#region Bulk Orders
|
||||
public override Item CreateBulkOrder( Mobile from, bool fromContextMenu )
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
public override VendorShoeType ShoeType => VendorShoeType.Sandals;
|
||||
|
||||
if ( pm != null && pm.NextTailorBulkOrder == TimeSpan.Zero && (fromContextMenu || 0.2 > Utility.RandomDouble()) )
|
||||
{
|
||||
double theirSkill = pm.Skills[SkillName.Tailoring].Base;
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
m_SBInfos.Add(new SBWeaver());
|
||||
}
|
||||
|
||||
if ( theirSkill >= 70.1 )
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours( 6.0 );
|
||||
else if ( theirSkill >= 50.1 )
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours( 2.0 );
|
||||
else
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours( 1.0 );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
if ( theirSkill >= 70.1 && ((theirSkill - 40.0) / 300.0) > Utility.RandomDouble() )
|
||||
return new LargeTailorBOD();
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
return SmallTailorBOD.CreateRandomFor( from );
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
return null;
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override bool IsValidBulkOrder( Item item )
|
||||
{
|
||||
return ( item is SmallTailorBOD || item is LargeTailorBOD );
|
||||
}
|
||||
#region Bulk Orders
|
||||
|
||||
public override bool SupportsBulkOrders( Mobile from )
|
||||
{
|
||||
return ( from is PlayerMobile && from.Skills[SkillName.Tailoring].Base > 0 );
|
||||
}
|
||||
public override Item CreateBulkOrder(Mobile from, bool fromContextMenu)
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
public override TimeSpan GetNextBulkOrder( Mobile from )
|
||||
{
|
||||
if ( from is PlayerMobile )
|
||||
return ((PlayerMobile)from).NextTailorBulkOrder;
|
||||
if (pm != null && pm.NextTailorBulkOrder == TimeSpan.Zero && (fromContextMenu || 0.2 > Utility.RandomDouble()))
|
||||
{
|
||||
double theirSkill = pm.Skills[SkillName.Tailoring].Base;
|
||||
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
if (theirSkill >= 70.1)
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(6.0);
|
||||
else if (theirSkill >= 50.1)
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(2.0);
|
||||
else
|
||||
pm.NextTailorBulkOrder = TimeSpan.FromHours(1.0);
|
||||
|
||||
public override void OnSuccessfulBulkOrderReceive( Mobile from )
|
||||
{
|
||||
if ( Core.SE && from is PlayerMobile )
|
||||
((PlayerMobile)from).NextTailorBulkOrder = TimeSpan.Zero;
|
||||
}
|
||||
#endregion
|
||||
if (theirSkill >= 70.1 && (theirSkill - 40.0) / 300.0 > Utility.RandomDouble())
|
||||
return new LargeTailorBOD();
|
||||
|
||||
public Weaver( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
return SmallTailorBOD.CreateRandomFor(from);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
return null;
|
||||
}
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
public override bool IsValidBulkOrder(Item item)
|
||||
{
|
||||
return item is SmallTailorBOD || item is LargeTailorBOD;
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override bool SupportsBulkOrders(Mobile from)
|
||||
{
|
||||
return from is PlayerMobile && from.Skills[SkillName.Tailoring].Base > 0;
|
||||
}
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override TimeSpan GetNextBulkOrder(Mobile from)
|
||||
{
|
||||
if (from is PlayerMobile)
|
||||
return ((PlayerMobile)from).NextTailorBulkOrder;
|
||||
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
public override void OnSuccessfulBulkOrderReceive(Mobile from)
|
||||
{
|
||||
if (Core.SE && from is PlayerMobile)
|
||||
((PlayerMobile)from).NextTailorBulkOrder = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue