This commit is contained in:
mark 2009-06-29 12:29:09 +00:00
parent 2204d5fb86
commit 03fc95bfb7
105 changed files with 9135 additions and 161 deletions

View file

@ -1,6 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.ContextMenus;
namespace Server.Mobiles
{
@ -33,5 +36,50 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
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;
list.Add( entry );
}
base.AddCustomContextEntries( from, list );
}
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 override void OnClick()
{
if ( !Core.ML || m_Vendor == null || m_Vendor.Deleted )
return;
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.
}
}
}
}