Mostly cleanup...

Removed canbeharmful check on reveal spell
BallOfSummoning required to be in pack
Cleaned up ban duration gump
This commit is contained in:
mark 2007-08-14 03:13:21 +00:00
parent 521e728edd
commit 4718a4b911
12 changed files with 30 additions and 40 deletions

View file

@ -225,27 +225,34 @@ namespace Server.Gumps
default: return;
}
if ( shouldSet )
{
string comment = ( c != null && c.Text.Trim().Length > 0 ) ? c.Text.Trim(): "No Comment";
if ( shouldSet ) {
string comment = null;
if ( c != null ) {
comment = c.Text.Trim();
if ( comment.Length == 0 )
comment = null;
}
for ( int i = 0; i < m_List.Count; ++i )
{
Account a = (Account)m_List[i];
a.SetBanTags( from, DateTime.Now, duration );
a.Comments.Add( new AccountComment( from.RawName, String.Format( "Ban of {0} duration: {1}", (( duration == TimeSpan.MaxValue )? "infinite" : duration.ToString()), comment ) ) );
if ( comment != null )
a.Comments.Add( new AccountComment( from.RawName, String.Format( "Duration: {0}, Comment: {1}", (( duration == TimeSpan.MaxValue )? "Infinite" : duration.ToString()), comment ) ) );
}
if ( duration == TimeSpan.MaxValue )
from.SendMessage( "Duration is infinite." );
from.SendMessage( "Ban Duration: Infinite" );
else
from.SendMessage( "Duration is {0}.", duration );
from.SendMessage( "Ban Duration: {0}", duration );
}
else
{
from.SendMessage( "Values improperly formatted." );
from.SendMessage( "Time values were improperly formatted." );
from.SendGump( new BanDurationGump( m_List ) );
}
}

View file

@ -127,7 +127,7 @@ namespace Server.Gumps
{
Mobile m = states[i].Mobile;
if ( m != null && (m == owner ||!m.Hidden || owner.AccessLevel >= m.AccessLevel || (m is PlayerMobile && ((PlayerMobile)m).VisibilityList.Contains( owner ) ) ) )
if ( m != null && (m == owner ||!m.Hidden || owner.AccessLevel > m.AccessLevel || (m is PlayerMobile && ((PlayerMobile)m).VisibilityList.Contains( owner ) ) ) )
{
if ( filter != null && ( m.Name == null || m.Name.ToLower().IndexOf( filter ) < 0 ) )
continue;
@ -281,7 +281,7 @@ namespace Server.Gumps
from.SendMessage( "That player is no longer online." );
from.SendGump( new WhoGump( from, m_Mobiles, m_Page ) );
}
else if ( m == from || !m.Hidden || from.AccessLevel >= m.AccessLevel || (m is PlayerMobile && ((PlayerMobile)m).VisibilityList.Contains( from )))
else if ( m == from || !m.Hidden || from.AccessLevel > m.AccessLevel || (m is PlayerMobile && ((PlayerMobile)m).VisibilityList.Contains( from )))
{
from.SendGump( new ClientGump( from, m.NetState ) );
}

View file

@ -21,9 +21,8 @@ namespace Server.Items
protected override Packet GetWorldPacketFor( NetState state ) {
Mobile mob = state.Mobile;
if ( mob != null && mob.AccessLevel >= AccessLevel.GameMaster ) {
if ( mob != null && mob.AccessLevel >= AccessLevel.GameMaster )
return new GMItemPacket( this );
}
return base.GetWorldPacketFor( state );
}

View file

@ -146,20 +146,6 @@ namespace Server.Items
m_NoBones = true;
BeginDecay( m_BoneDecayTime );
/*DecayedCorpse c = new DecayedCorpse( Name );
c.MoveToWorld( Location, Map );
ArrayList list = Items;
for ( int i = list.Count - 1; i >= 0; --i )
{
if ( i < list.Count )
c.AddItem( (Item)list[i] );
}
Delete();*/
}
private static TimeSpan m_DefaultDecayTime = TimeSpan.FromMinutes( 7.0 );

View file

@ -27,8 +27,6 @@ namespace Server.Items
Amount = amount;
}
public bool Dye( Mobile from, DyeTub sender )
{
if ( Deleted )

View file

@ -66,6 +66,7 @@ namespace Server.Items
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString() ) );
}
public bool Scissor( Mobile from, Scissors scissors )
{
if ( Deleted || !from.CanSee( this ) ) return false;

View file

@ -19,7 +19,7 @@ namespace Server.Items
{
get
{
return String.Format( Amount == 1 ? "{0} piece of leather" : "{0} pieces of leather", Amount );
return String.Format( Amount == 1 ? "{0} piece of {1} leather" : "{0} pieces of {1} leather", Amount, CraftResources.GetName( m_Resource ).ToLower() );
}
}

View file

@ -4,7 +4,7 @@ using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute( 0x13E4, 0x13E3 )]
[FlipableAttribute( 0x13E3, 0x13E4 )]
public class SmithHammer : BaseTool
{
public override CraftSystem CraftSystem{ get{ return DefBlacksmithy.CraftSystem; } }

View file

@ -109,7 +109,7 @@ namespace Server.Items
{
base.GetContextMenuEntries( from, list );
if ( from.Alive && from.InRange( this.GetWorldLocation(), 2 ) )
if ( from.Alive && this.RootParent == from )
{
if ( Pet == null )
{
@ -144,7 +144,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( this.GetWorldLocation(), 2 ) )
if ( this.RootParent == from ) // TODO: Previous implementation allowed use on ground, without house protection checks. What is the correct behavior?
{
if ( Pet == null )
{
@ -157,7 +157,7 @@ namespace Server.Items
}
else
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042001 ); // That must be in your pack for you to use it.
}
}
@ -165,7 +165,7 @@ namespace Server.Items
{
BaseCreature pet = this.Pet;
if ( Deleted || pet != null )
if ( Deleted || pet != null || this.RootParent != from )
return;
from.SendLocalizedMessage( 1054114 ); // Target your pet that you wish to link to this Crystal Ball of Pet Summoning.
@ -186,9 +186,9 @@ namespace Server.Items
if ( m_Ball.Deleted || m_Ball.Pet != null )
return;
if ( !from.InRange( m_Ball.GetWorldLocation(), 2 ) )
if ( m_Ball.RootParent != from )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042001 ); // That must be in your pack for you to use it.
}
else if ( targeted is BaseCreature )
{
@ -224,7 +224,7 @@ namespace Server.Items
{
BaseCreature pet = this.Pet;
if ( Deleted || pet == null )
if ( Deleted || pet == null || this.RootParent != from )
return;
if ( Charges == 0 )
@ -277,7 +277,7 @@ namespace Server.Items
public void UnlinkPet( Mobile from )
{
if ( !Deleted && Pet != null )
if ( !Deleted && Pet != null && this.RootParent == from )
{
Pet = null;

View file

@ -171,7 +171,6 @@ namespace Server.Items
base.Hue = 0x481;
base.Weight = 1.0;
m_Skill = skill;
m_Value = value;
if ( m_Value > 105.0 )

View file

@ -94,7 +94,7 @@ namespace Server.Misc
if ( m_Backups.Length == 0 )
return;
string root = Path.Combine( Core.BaseDirectory, "Backups\\Automatic" );
string root = Path.Combine( Core.BaseDirectory, "Backups/Automatic" );
if ( !Directory.Exists( root ) )
Directory.CreateDirectory( root );

View file

@ -53,7 +53,7 @@ namespace Server.Spells.Sixth
if ( m is Mobiles.ShadowKnight && (m.X != p.X || m.Y != p.Y) )
continue;
if ( m.Hidden && (m.AccessLevel == AccessLevel.Player || Caster.AccessLevel > m.AccessLevel) && Caster.CanBeHarmful( m, false, true ) && CheckDifficulty( Caster, m ) )
if ( m.Hidden && (m.AccessLevel == AccessLevel.Player || Caster.AccessLevel > m.AccessLevel) && CheckDifficulty( Caster, m ) )
targets.Add( m );
}