a few more fixes.

This commit is contained in:
xavier 2011-07-31 23:51:08 +00:00
parent 1f788d60d9
commit 53d92a9e4e
3 changed files with 45 additions and 19 deletions

View file

@ -1,57 +0,0 @@
using System;
using Server.Gumps;
namespace Server.Items
{
public class ResGate : Item
{
public override string DefaultName
{
get { return "a resurrection gate"; }
}
[Constructable]
public ResGate() : base( 0xF6C )
{
Movable = false;
Hue = 0x2D1;
Light = LightType.Circle300;
}
public ResGate( Serial serial ) : base( serial )
{
}
public override bool OnMoveOver( Mobile m )
{
if ( !m.Alive && m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
{
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
m.CloseGump( typeof( ResurrectGump ) );
m.SendGump( new ResurrectGump( m ) );
}
else
{
m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
}
return false;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -17,6 +17,9 @@
[CommandProperty( AccessLevel.GameMaster )]
public virtual int currItemID { get { return ( IsEmpty ) ? voidItem_ID : fullItem_ID; } }
[CommandProperty( AccessLevel.GameMaster )]
public virtual bool CanFill { get { return ( !IsFull && !IsLockedDown() ); } }
[CommandProperty( AccessLevel.GameMaster )]
public int Quantity
{
@ -26,7 +29,7 @@
}
set
{
if( value != m_Quantity )
if( value != m_Quantity && CanFill )
{
UpdateContainer( value );
@ -43,6 +46,20 @@
m_Quantity = ( filled ) ? MaxQuantity : 0;
}
public virtual bool IsLockedDown()
{
Multis.BaseHouse house = Multis.BaseHouse.FindHouseAt( this );
if( house == null || !house.IsLockedDown( this ) )
{
if( Parent == null )
{
return true;
}
}
return false;
}
public override void OnDoubleClick( Mobile from )
{
if( IsEmpty )