* Fixes stacking, consumption instead of deletion, and a few other minor issues. Server-side only. * Fixes stacking of ore. * Fixes cooking consumption.
This commit is contained in:
parent
f6d5689dee
commit
0d9fe76b2b
4 changed files with 163 additions and 91 deletions
|
|
@ -71,45 +71,40 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if ( m_Item.Deleted ) return;
|
if ( m_Item.Deleted ) return;
|
||||||
|
|
||||||
|
Item targetItem = targeted as Item;
|
||||||
|
if ( targetItem == null || targetItem.Deleted ) return;
|
||||||
|
|
||||||
|
m_Item.Consume();
|
||||||
|
|
||||||
if ( targeted is Eggs )
|
if ( targeted is Eggs )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
targetItem.Consume();
|
||||||
|
|
||||||
((Eggs)targeted).Consume();
|
|
||||||
|
|
||||||
from.AddToBackpack( new UnbakedQuiche() );
|
from.AddToBackpack( new UnbakedQuiche() );
|
||||||
from.AddToBackpack( new Eggshells() );
|
from.AddToBackpack( new Eggshells() );
|
||||||
}
|
}
|
||||||
else if ( targeted is CheeseWheel )
|
else if ( targeted is CheeseWheel )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
targetItem.Consume();
|
||||||
|
|
||||||
((CheeseWheel)targeted).Consume();
|
|
||||||
|
|
||||||
from.AddToBackpack( new CheesePizza() );
|
from.AddToBackpack( new CheesePizza() );
|
||||||
}
|
}
|
||||||
else if ( targeted is Sausage )
|
else if ( targeted is Sausage )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
targetItem.Consume();
|
||||||
|
|
||||||
((Sausage)targeted).Consume();
|
|
||||||
|
|
||||||
from.AddToBackpack( new SausagePizza() );
|
from.AddToBackpack( new SausagePizza() );
|
||||||
}
|
}
|
||||||
else if ( targeted is Apple )
|
else if ( targeted is Apple )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
targetItem.Consume();
|
||||||
|
|
||||||
((Apple)targeted).Consume();
|
|
||||||
|
|
||||||
from.AddToBackpack( new UnbakedApplePie() );
|
from.AddToBackpack( new UnbakedApplePie() );
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( targeted is Peach )
|
else if ( targeted is Peach )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
targetItem.Consume();
|
||||||
|
|
||||||
((Peach)targeted).Consume();
|
|
||||||
|
|
||||||
from.AddToBackpack( new UnbakedPeachCobbler() );
|
from.AddToBackpack( new UnbakedPeachCobbler() );
|
||||||
}
|
}
|
||||||
|
|
@ -174,9 +169,10 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if ( m_Item.Deleted ) return;
|
if ( m_Item.Deleted ) return;
|
||||||
|
|
||||||
|
m_Item.Consume();
|
||||||
|
|
||||||
if ( targeted is BowlFlour )
|
if ( targeted is BowlFlour )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
|
||||||
((BowlFlour)targeted).Delete();
|
((BowlFlour)targeted).Delete();
|
||||||
|
|
||||||
from.AddToBackpack( new CakeMix() );
|
from.AddToBackpack( new CakeMix() );
|
||||||
|
|
@ -184,7 +180,6 @@ namespace Server.Items
|
||||||
else if ( targeted is Campfire )
|
else if ( targeted is Campfire )
|
||||||
{
|
{
|
||||||
from.PlaySound( 0x225 );
|
from.PlaySound( 0x225 );
|
||||||
m_Item.Delete();
|
|
||||||
InternalTimer t = new InternalTimer( from, (Campfire)targeted );
|
InternalTimer t = new InternalTimer( from, (Campfire)targeted );
|
||||||
t.Start();
|
t.Start();
|
||||||
}
|
}
|
||||||
|
|
@ -273,9 +268,10 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if ( m_Item.Deleted ) return;
|
if ( m_Item.Deleted ) return;
|
||||||
|
|
||||||
|
m_Item.Consume();
|
||||||
|
|
||||||
if ( targeted is Dough )
|
if ( targeted is Dough )
|
||||||
{
|
{
|
||||||
m_Item.Delete();
|
|
||||||
((Dough)targeted).Consume();
|
((Dough)targeted).Consume();
|
||||||
|
|
||||||
from.AddToBackpack( new SweetDough() );
|
from.AddToBackpack( new SweetDough() );
|
||||||
|
|
@ -283,7 +279,6 @@ namespace Server.Items
|
||||||
|
|
||||||
if (targeted is BowlFlour)
|
if (targeted is BowlFlour)
|
||||||
{
|
{
|
||||||
m_Item.Consume();
|
|
||||||
((BowlFlour)targeted).Delete();
|
((BowlFlour)targeted).Delete();
|
||||||
|
|
||||||
from.AddToBackpack( new CookieMix() );
|
from.AddToBackpack( new CookieMix() );
|
||||||
|
|
@ -420,12 +415,7 @@ namespace Server.Items
|
||||||
get{ return m_Quantity; }
|
get{ return m_Quantity; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if ( value < 0 )
|
m_Quantity = Math.Min(20, Math.Max(0, value));
|
||||||
value = 0;
|
|
||||||
else if ( value > 20 )
|
|
||||||
value = 20;
|
|
||||||
|
|
||||||
m_Quantity = value;
|
|
||||||
|
|
||||||
if ( m_Quantity == 0 )
|
if ( m_Quantity == 0 )
|
||||||
Delete();
|
Delete();
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ namespace Server.Items
|
||||||
public BaseOre( Serial serial ) : base( serial )
|
public BaseOre( Serial serial ) : base( serial )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
public override bool CanStackWith(Item dropped)
|
||||||
|
{
|
||||||
|
return dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.Hue == Hue && dropped.Name == Name && (dropped.Amount + Amount) <= 60000 && dropped != this;
|
||||||
|
}
|
||||||
|
|
||||||
public override void AddNameProperty( ObjectPropertyList list )
|
public override void AddNameProperty( ObjectPropertyList list )
|
||||||
{
|
{
|
||||||
|
|
@ -698,4 +702,4 @@ namespace Server.Items
|
||||||
return new ValoriteIngot();
|
return new ValoriteIngot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1525,6 +1525,11 @@ namespace Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool CanStackWith( Item dropped )
|
||||||
|
{
|
||||||
|
return dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && dropped.Hue == Hue && dropped.Name == Name && (dropped.Amount + Amount) <= 60000 && dropped != this;
|
||||||
|
}
|
||||||
|
|
||||||
public bool StackWith( Mobile from, Item dropped )
|
public bool StackWith( Mobile from, Item dropped )
|
||||||
{
|
{
|
||||||
return StackWith( from, dropped, true );
|
return StackWith( from, dropped, true );
|
||||||
|
|
@ -1532,7 +1537,7 @@ namespace Server
|
||||||
|
|
||||||
public virtual bool StackWith( Mobile from, Item dropped, bool playSound )
|
public virtual bool StackWith( Mobile from, Item dropped, bool playSound )
|
||||||
{
|
{
|
||||||
if ( dropped.Stackable && Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && dropped.Hue == Hue && dropped.Name == Name && (dropped.Amount + Amount) <= 60000 && dropped != this && !dropped.Nontransferable && !Nontransferable )
|
if ( CanStackWith( dropped ) )
|
||||||
{
|
{
|
||||||
if ( m_LootType != dropped.m_LootType )
|
if ( m_LootType != dropped.m_LootType )
|
||||||
m_LootType = LootType.Regular;
|
m_LootType = LootType.Regular;
|
||||||
|
|
@ -1558,10 +1563,19 @@ namespace Server
|
||||||
|
|
||||||
public virtual bool OnDragDrop( Mobile from, Item dropped )
|
public virtual bool OnDragDrop( Mobile from, Item dropped )
|
||||||
{
|
{
|
||||||
|
bool success = false;
|
||||||
if ( Parent is Container )
|
if ( Parent is Container )
|
||||||
return ((Container)Parent).OnStackAttempt( from, this, dropped );
|
success = ((Container)Parent).OnStackAttempt( from, this, dropped );
|
||||||
|
else
|
||||||
|
success = StackWith( from, dropped );
|
||||||
|
|
||||||
return StackWith( from, dropped );
|
if ( success && Spawner != null )
|
||||||
|
{
|
||||||
|
Spawner.Remove( this );
|
||||||
|
Spawner = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rectangle2D GetGraphicBounds()
|
public Rectangle2D GetGraphicBounds()
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,9 @@ namespace Server.Items
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual Rectangle2D Bounds{ get{ return ContainerData.Bounds; } }
|
public virtual Rectangle2D Bounds{ get{ return ContainerData.Bounds; } }
|
||||||
|
[CommandProperty( AccessLevel.GameMaster )]
|
||||||
public virtual int DefaultGumpID{ get{ return ContainerData.GumpID; } }
|
public virtual int DefaultGumpID{ get{ return ContainerData.GumpID; } }
|
||||||
|
[CommandProperty( AccessLevel.GameMaster )]
|
||||||
public virtual int DefaultDropSound{ get{ return ContainerData.DropSound; } }
|
public virtual int DefaultDropSound{ get{ return ContainerData.DropSound; } }
|
||||||
|
|
||||||
public virtual int DefaultMaxItems{ get{ return m_GlobalMaxItems; } }
|
public virtual int DefaultMaxItems{ get{ return m_GlobalMaxItems; } }
|
||||||
|
|
@ -190,7 +192,7 @@ namespace Server.Items
|
||||||
|
|
||||||
public virtual bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
|
public virtual bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
|
||||||
{
|
{
|
||||||
if ( m.AccessLevel < AccessLevel.GameMaster )
|
if ( m != null && m.AccessLevel < AccessLevel.GameMaster )
|
||||||
{
|
{
|
||||||
if ( IsDecoContainer )
|
if ( IsDecoContainer )
|
||||||
{
|
{
|
||||||
|
|
@ -209,17 +211,13 @@ namespace Server.Items
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if ( MaxWeight != 0 && (this.TotalWeight + plusWeight + item.TotalWeight + item.PileWeight) > MaxWeight )
|
||||||
{
|
{
|
||||||
int maxWeight = this.MaxWeight;
|
if ( message )
|
||||||
|
SendFullWeightMessage( m, item );
|
||||||
|
|
||||||
if ( maxWeight != 0 && (this.TotalWeight + plusWeight + item.TotalWeight + item.PileWeight) > maxWeight )
|
return false;
|
||||||
{
|
|
||||||
if ( message )
|
|
||||||
SendFullWeightMessage( m, item );
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -356,7 +354,7 @@ namespace Server.Items
|
||||||
if ( callback != null )
|
if ( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -456,7 +454,7 @@ namespace Server.Items
|
||||||
if ( callback != null )
|
if ( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -556,7 +554,7 @@ namespace Server.Items
|
||||||
if ( callback != null )
|
if ( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -621,7 +619,7 @@ namespace Server.Items
|
||||||
if ( callback != null )
|
if ( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -682,7 +680,7 @@ namespace Server.Items
|
||||||
if ( callback != null )
|
if ( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -736,7 +734,7 @@ namespace Server.Items
|
||||||
if( callback != null )
|
if( callback != null )
|
||||||
callback( item, theirAmount );
|
callback( item, theirAmount );
|
||||||
|
|
||||||
item.Delete();
|
item.Consume( theirAmount );
|
||||||
need -= theirAmount;
|
need -= theirAmount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1164,7 +1162,7 @@ namespace Server.Items
|
||||||
|
|
||||||
public List<T> FindItemsByType<T>( Predicate<T> predicate ) where T : Item
|
public List<T> FindItemsByType<T>( Predicate<T> predicate ) where T : Item
|
||||||
{
|
{
|
||||||
return FindItemsByType<T>( true, predicate );
|
return FindItemsByType<T>( true, predicate );
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<T> FindItemsByType<T>( bool recurse, Predicate<T> predicate ) where T : Item
|
public List<T> FindItemsByType<T>( bool recurse, Predicate<T> predicate ) where T : Item
|
||||||
|
|
@ -1466,10 +1464,7 @@ namespace Server.Items
|
||||||
|
|
||||||
public virtual bool OnStackAttempt( Mobile from, Item stack, Item dropped )
|
public virtual bool OnStackAttempt( Mobile from, Item stack, Item dropped )
|
||||||
{
|
{
|
||||||
if ( !CheckHold( from, dropped, true, false ) )
|
return CheckHold( from, dropped, true, false ) && stack.StackWith( from, dropped );
|
||||||
return false;
|
|
||||||
|
|
||||||
return stack.StackWith( from, dropped );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||||
|
|
@ -1488,22 +1483,94 @@ namespace Server.Items
|
||||||
|
|
||||||
public virtual bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
|
public virtual bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
|
||||||
{
|
{
|
||||||
if ( !CheckHold( from, dropped, sendFullMessage, true ) )
|
return TryDropItem( from, dropped, sendFullMessage, false );
|
||||||
return false;
|
}
|
||||||
|
|
||||||
|
public virtual bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage, bool playSound )
|
||||||
|
{
|
||||||
List<Item> list = this.Items;
|
List<Item> list = this.Items;
|
||||||
|
|
||||||
for ( int i = 0; i < list.Count; ++i )
|
for ( int i = 0; i < list.Count; ++i )
|
||||||
{
|
{
|
||||||
Item item = list[i];
|
Item item = list[i];
|
||||||
|
|
||||||
if ( !(item is Container) && item.StackWith( from, dropped, false ) )
|
if ( !(item is Container) && CheckHold( from, dropped, false, false ) && item.StackWith( from, dropped, playSound ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DropItem( dropped );
|
if ( CheckHold( from, dropped, sendFullMessage, true ) )
|
||||||
|
{
|
||||||
|
DropItem( dropped );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual bool TryDropItems( Mobile from, bool sendFullMessage, params Item[] droppedItems )
|
||||||
|
{
|
||||||
|
List<Item> dropItems = new List<Item>();
|
||||||
|
List<ItemStackEntry> stackItems = new List<ItemStackEntry>();
|
||||||
|
|
||||||
|
int extraItems = 0;
|
||||||
|
int extraWeight = 0;
|
||||||
|
|
||||||
|
// from.SendMessage( String.Format( "There are {0} items in this container.", this.Items.Count ) );
|
||||||
|
// from.SendMessage( String.Format( "There are {0} items being dropped into this container.", droppedItems.Length ) );
|
||||||
|
|
||||||
|
for ( int i = 0; i < droppedItems.Length; i++ )
|
||||||
|
{
|
||||||
|
Item dropped = droppedItems[i];
|
||||||
|
|
||||||
|
List<Item> list = this.Items;
|
||||||
|
|
||||||
|
bool stacked = false;
|
||||||
|
|
||||||
|
for ( int j = 0; j < list.Count; ++j )
|
||||||
|
{
|
||||||
|
Item item = list[j];
|
||||||
|
|
||||||
|
if ( !(item is Container) && CheckHold( from, dropped, false, false, 0, extraWeight ) && item.CanStackWith( dropped ) )
|
||||||
|
{
|
||||||
|
stackItems.Add( new ItemStackEntry( item, dropped ) );
|
||||||
|
extraWeight += (int)Math.Ceiling( item.Weight * (item.Amount + dropped.Amount) ) - item.PileWeight; //extra weight delta, do not need TotalWeight as we do not have hybrid stackable container types
|
||||||
|
stacked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !stacked && CheckHold( from, dropped, false, true, extraItems, extraWeight ) )
|
||||||
|
{
|
||||||
|
dropItems.Add( dropped );
|
||||||
|
extraItems++;
|
||||||
|
extraWeight += dropped.TotalWeight + dropped.PileWeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( dropItems.Count + stackItems.Count == droppedItems.Length ) //All good
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < dropItems.Count; i++ )
|
||||||
|
DropItem( dropItems[i] );
|
||||||
|
|
||||||
|
for ( int i = 0; i < stackItems.Count; i++ )
|
||||||
|
stackItems[i].m_StackItem.StackWith( from, stackItems[i].m_DropItem, false );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private struct ItemStackEntry
|
||||||
|
{
|
||||||
|
public Item m_StackItem;
|
||||||
|
public Item m_DropItem;
|
||||||
|
|
||||||
|
public ItemStackEntry( Item stack, Item drop )
|
||||||
|
{
|
||||||
|
m_StackItem = stack;
|
||||||
|
m_DropItem = drop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Destroy()
|
public virtual void Destroy()
|
||||||
|
|
@ -1582,13 +1649,13 @@ namespace Server.Items
|
||||||
|
|
||||||
public virtual bool CheckContentDisplay( Mobile from )
|
public virtual bool CheckContentDisplay( Mobile from )
|
||||||
{
|
{
|
||||||
if ( !DisplaysContent )
|
if ( DisplaysContent )
|
||||||
return false;
|
{
|
||||||
|
object root = this.RootParent;
|
||||||
|
|
||||||
object root = this.RootParent;
|
if ( root == null || root is Item || root == from || from.AccessLevel > AccessLevel.Player )
|
||||||
|
return true;
|
||||||
if ( root == null || root is Item || root == from || from.AccessLevel > AccessLevel.Player )
|
}
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -1598,8 +1665,8 @@ namespace Server.Items
|
||||||
base.OnSingleClick( from );
|
base.OnSingleClick( from );
|
||||||
|
|
||||||
if ( CheckContentDisplay( from ) )
|
if ( CheckContentDisplay( from ) )
|
||||||
LabelTo(from, "({0} items, {1} stones)", TotalItems, TotalWeight);
|
LabelTo( from, "({0} item{2}, {1} stones)", TotalItems, TotalWeight, TotalItems != 1 ? "s" : String.Empty );
|
||||||
//LabelTo(from, 1050044, String.Format("{0}\t{1}", TotalItems, TotalWeight)); // ~1_COUNT~ items, ~2_WEIGHT~ stones
|
//LabelTo( from, 1050044, String.Format( "{0}\t{1}", TotalItems.ToString(), TotalWeight.ToString() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Mobile> m_Openers;
|
private List<Mobile> m_Openers;
|
||||||
|
|
@ -1625,25 +1692,22 @@ namespace Server.Items
|
||||||
|
|
||||||
NetState ns = to.NetState;
|
NetState ns = to.NetState;
|
||||||
|
|
||||||
if ( ns == null )
|
if ( ns != null )
|
||||||
return;
|
|
||||||
|
|
||||||
if ( ns.HighSeas )
|
|
||||||
to.Send( new ContainerDisplayHS( this ) );
|
|
||||||
else
|
|
||||||
to.Send( new ContainerDisplay( this ) );
|
|
||||||
|
|
||||||
if ( ns.ContainerGridLines )
|
|
||||||
to.Send( new ContainerContent6017( to, this ) );
|
|
||||||
else
|
|
||||||
to.Send( new ContainerContent( to, this ) );
|
|
||||||
|
|
||||||
if ( ObjectPropertyList.Enabled )
|
|
||||||
{
|
{
|
||||||
List<Item> items = this.Items;
|
if ( ns.HighSeas )
|
||||||
|
to.Send( new ContainerDisplayHS( this ) );
|
||||||
|
else
|
||||||
|
to.Send( new ContainerDisplay( this ) );
|
||||||
|
|
||||||
for ( int i = 0; i < items.Count; ++i )
|
SendContentTo( ns );
|
||||||
to.Send( items[i].OPLPacket );
|
|
||||||
|
if ( ObjectPropertyList.Enabled )
|
||||||
|
{
|
||||||
|
List<Item> items = this.Items;
|
||||||
|
|
||||||
|
for ( int i = 0; i < items.Count; ++i )
|
||||||
|
to.Send( items[i].OPLPacket );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1663,9 +1727,7 @@ namespace Server.Items
|
||||||
Mobile mob = m_Openers[i];
|
Mobile mob = m_Openers[i];
|
||||||
|
|
||||||
if ( mob == opener )
|
if ( mob == opener )
|
||||||
{
|
|
||||||
contains = true;
|
contains = true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int range = GetUpdateRange( mob );
|
int range = GetUpdateRange( mob );
|
||||||
|
|
@ -1679,26 +1741,30 @@ namespace Server.Items
|
||||||
if ( !contains )
|
if ( !contains )
|
||||||
{
|
{
|
||||||
if ( m_Openers == null )
|
if ( m_Openers == null )
|
||||||
{
|
|
||||||
m_Openers = new List<Mobile>();
|
m_Openers = new List<Mobile>();
|
||||||
}
|
|
||||||
|
|
||||||
m_Openers.Add( opener );
|
m_Openers.Add( opener );
|
||||||
}
|
}
|
||||||
else if ( m_Openers != null && m_Openers.Count == 0 )
|
else if ( m_Openers != null && m_Openers.Count == 0 )
|
||||||
{
|
|
||||||
m_Openers = null;
|
m_Openers = null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void SendContentTo( NetState state )
|
||||||
|
{
|
||||||
|
if ( state != null && state.ContainerGridLines )
|
||||||
|
state.Send( new ContainerContent6017( state.Mobile, this ) );
|
||||||
|
else
|
||||||
|
state.Send( new ContainerContent( state.Mobile, this ) );
|
||||||
|
}
|
||||||
|
|
||||||
public override void GetProperties( ObjectPropertyList list )
|
public override void GetProperties( ObjectPropertyList list )
|
||||||
{
|
{
|
||||||
base.GetProperties( list );
|
base.GetProperties( list );
|
||||||
|
|
||||||
if( DisplaysContent )//CheckContentDisplay( from ) )
|
if ( DisplaysContent )//CheckContentDisplay( from ) )
|
||||||
{
|
{
|
||||||
if( Core.ML )
|
if ( Core.ML )
|
||||||
{
|
{
|
||||||
if( ParentsContain<BankBox>() ) //Root Parent is the Mobile. Parent could be another containter.
|
if( ParentsContain<BankBox>() ) //Root Parent is the Mobile. Parent could be another containter.
|
||||||
list.Add( 1073841, "{0}\t{1}\t{2}", TotalItems, MaxItems, TotalWeight ); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~ stones
|
list.Add( 1073841, "{0}\t{1}\t{2}", TotalItems, MaxItems, TotalWeight ); // Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~ stones
|
||||||
|
|
@ -1708,9 +1774,7 @@ namespace Server.Items
|
||||||
//TODO: Where do the other clilocs come into play? 1073839 & 1073840?
|
//TODO: Where do the other clilocs come into play? 1073839 & 1073840?
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
list.Add( 1050044, "{0}\t{1}", TotalItems, TotalWeight ); // ~1_COUNT~ items, ~2_WEIGHT~ stones
|
list.Add( 1050044, "{0}\t{1}", TotalItems, TotalWeight ); // ~1_COUNT~ items, ~2_WEIGHT~ stones
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1839,4 +1903,4 @@ namespace Server.Items
|
||||||
m_DropSound = dropSound;
|
m_DropSound = dropSound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue