Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -1,82 +1,85 @@
using System.Collections.Generic;
using Server.Items;
using Server.ContextMenus;
using Server.Items;
namespace Server.Mobiles
{
public class TinkerGuildmaster : BaseGuildmaster
{
public override NpcGuild NpcGuild => NpcGuild.TinkersGuild;
public class TinkerGuildmaster : BaseGuildmaster
{
[Constructible]
public TinkerGuildmaster() : base("tinker")
{
SetSkill(SkillName.Lockpicking, 65.0, 88.0);
SetSkill(SkillName.Tinkering, 90.0, 100.0);
SetSkill(SkillName.RemoveTrap, 85.0, 100.0);
}
[Constructible]
public TinkerGuildmaster() : base( "tinker" )
{
SetSkill( SkillName.Lockpicking, 65.0, 88.0 );
SetSkill( SkillName.Tinkering, 90.0, 100.0 );
SetSkill( SkillName.RemoveTrap, 85.0, 100.0 );
}
public TinkerGuildmaster(Serial serial) : base(serial)
{
}
public TinkerGuildmaster( Serial serial ) : base( serial )
{
}
public override NpcGuild NpcGuild => NpcGuild.TinkersGuild;
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 ); // version
}
writer.Write(0); // version
}
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 void AddCustomContextEntries( Mobile from, List<ContextMenuEntry> list )
{
if ( Core.ML && from.Alive )
{
RechargeEntry entry = new RechargeEntry( from, this );
public override void AddCustomContextEntries(Mobile from, List<ContextMenuEntry> list)
{
if (Core.ML && from.Alive)
{
RechargeEntry entry = new RechargeEntry(from, this);
if ( WeaponEngravingTool.Find( from ) == null )
entry.Enabled = false;
if (WeaponEngravingTool.Find(from) == null)
entry.Enabled = false;
list.Add( entry );
}
list.Add(entry);
}
base.AddCustomContextEntries( from, list );
}
base.AddCustomContextEntries(from, list);
}
private class RechargeEntry : ContextMenuEntry
{
private Mobile m_From;
private Mobile m_Vendor;
private class RechargeEntry : ContextMenuEntry
{
private Mobile m_From;
private Mobile m_Vendor;
public RechargeEntry( Mobile from, Mobile vendor ) : base( 6271, 6 )
{
m_From = from;
m_Vendor = vendor;
}
public RechargeEntry(Mobile from, Mobile vendor) : base(6271, 6)
{
m_From = from;
m_Vendor = vendor;
}
public override void OnClick()
{
if ( !Core.ML || m_Vendor == null || m_Vendor.Deleted )
return;
public override void OnClick()
{
if (!Core.ML || m_Vendor == null || m_Vendor.Deleted)
return;
WeaponEngravingTool tool = WeaponEngravingTool.Find( m_From );
WeaponEngravingTool tool = WeaponEngravingTool.Find(m_From);
if ( tool != null && tool.UsesRemaining <= 0 )
{
if ( Banker.GetBalance( m_From ) >= 100000 )
m_From.SendGump( new WeaponEngravingTool.ConfirmGump( tool, m_Vendor ) );
else
m_Vendor.Say( 1076167 ); // You need a 100,000 gold and a blue diamond to recharge the weapon engraver.
}
else
m_Vendor.Say( 1076164 ); // I can only help with this if you are carrying an engraving tool that needs repair.
}
}
}
}
if (tool != null && tool.UsesRemaining <= 0)
{
if (Banker.GetBalance(m_From) >= 100000)
m_From.SendGump(new WeaponEngravingTool.ConfirmGump(tool, m_Vendor));
else
m_Vendor.Say(1076167); // You need a 100,000 gold and a blue diamond to recharge the weapon engraver.
}
else
{
m_Vendor.Say(
1076164); // I can only help with this if you are carrying an engraving tool that needs repair.
}
}
}
}
}