This commit is contained in:
parent
7ad00dceac
commit
0b4c3b15d9
41 changed files with 976 additions and 144 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Engines.Craft;
|
||||
|
|
@ -17,7 +18,7 @@ namespace Server.Items
|
|||
private bool m_Protected;
|
||||
private bool m_Editable;
|
||||
|
||||
private ArrayList m_Pins = new ArrayList();
|
||||
private List<Point2D> m_Pins = new List<Point2D>();
|
||||
|
||||
private const int MaxUserPins = 50;
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ namespace Server.Items
|
|||
set { m_Height = value; }
|
||||
}
|
||||
|
||||
public ArrayList Pins
|
||||
public List<Point2D> Pins
|
||||
{
|
||||
get { return m_Pins; }
|
||||
}
|
||||
|
|
@ -105,7 +106,7 @@ namespace Server.Items
|
|||
from.Send( new MapDisplay( this ) );
|
||||
|
||||
for ( int i = 0; i < m_Pins.Count; ++i )
|
||||
from.Send( new MapAddPin( this, (Point2D) m_Pins[i] ) );
|
||||
from.Send( new MapAddPin( this, m_Pins[i] ) );
|
||||
|
||||
from.Send( new MapSetEditable( this, ValidateEdit( from ) ) );
|
||||
}
|
||||
|
|
@ -265,7 +266,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( m_Pins.Count );
|
||||
for ( int i = 0; i < m_Pins.Count; ++i )
|
||||
writer.Write( (Point2D) m_Pins[i] );
|
||||
writer.Write( m_Pins[i] );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ namespace Server.Items
|
|||
return false;
|
||||
|
||||
if ( item != this )
|
||||
return CanLoot( from );
|
||||
return CanLoot( from, item );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -578,7 +578,7 @@ namespace Server.Items
|
|||
if ( !base.CheckLift( from, item, ref reject ) )
|
||||
return false;
|
||||
|
||||
return CanLoot( from );
|
||||
return CanLoot( from,item );
|
||||
}
|
||||
|
||||
public override void OnItemUsed( Mobile from, Item item )
|
||||
|
|
@ -664,7 +664,7 @@ namespace Server.Items
|
|||
m_RestoreTable = null;
|
||||
}
|
||||
|
||||
public bool CanLoot( Mobile from )
|
||||
public bool CanLoot( Mobile from, Item item )
|
||||
{
|
||||
if ( !IsCriminalAction( from ) )
|
||||
return true;
|
||||
|
|
@ -677,9 +677,9 @@ namespace Server.Items
|
|||
return true;
|
||||
}
|
||||
|
||||
public bool CheckLoot( Mobile from )
|
||||
public bool CheckLoot( Mobile from, Item item )
|
||||
{
|
||||
if ( !CanLoot( from ) )
|
||||
if ( !CanLoot( from, item ) )
|
||||
{
|
||||
if ( m_Owner == null || !m_Owner.Player )
|
||||
from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature!
|
||||
|
|
@ -786,7 +786,7 @@ namespace Server.Items
|
|||
|
||||
#endregion
|
||||
|
||||
if ( !CheckLoot( from ) )
|
||||
if ( !CheckLoot( from, null ) )
|
||||
return;
|
||||
|
||||
#region Quests
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
|
|
@ -72,11 +73,11 @@ namespace Server.Items
|
|||
public abstract class BasePlayerBB : Item, ISecurable
|
||||
{
|
||||
private PlayerBBMessage m_Greeting;
|
||||
private ArrayList m_Messages;
|
||||
private List<PlayerBBMessage> m_Messages;
|
||||
private string m_Title;
|
||||
private SecureLevel m_Level;
|
||||
|
||||
public ArrayList Messages
|
||||
public List<PlayerBBMessage> Messages
|
||||
{
|
||||
get{ return m_Messages; }
|
||||
}
|
||||
|
|
@ -103,7 +104,7 @@ namespace Server.Items
|
|||
|
||||
public BasePlayerBB( int itemID ) : base( itemID )
|
||||
{
|
||||
m_Messages = new ArrayList();
|
||||
m_Messages = new List<PlayerBBMessage>();
|
||||
m_Level = SecureLevel.Anyone;
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +141,7 @@ namespace Server.Items
|
|||
writer.WriteEncodedInt( m_Messages.Count );
|
||||
|
||||
for ( int i = 0; i < m_Messages.Count; ++i )
|
||||
((PlayerBBMessage)m_Messages[i]).Serialize( writer );
|
||||
m_Messages[i].Serialize( writer );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -168,7 +169,7 @@ namespace Server.Items
|
|||
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
m_Messages = new ArrayList( count );
|
||||
m_Messages = new List<PlayerBBMessage>( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
m_Messages.Add( new PlayerBBMessage( reader ) );
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using Server;
|
||||
using Server.Network;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -106,16 +107,16 @@ namespace Server.Items
|
|||
|
||||
if ( NeighborRange >= 0 )
|
||||
{
|
||||
ArrayList list = new ArrayList();
|
||||
List<WarningItem> list = new List<WarningItem>();
|
||||
|
||||
foreach ( Item item in GetItemsInRange( NeighborRange ) )
|
||||
{
|
||||
if ( item != this && item is WarningItem )
|
||||
list.Add( item );
|
||||
list.Add( (WarningItem)item );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < list.Count; i++ )
|
||||
( (WarningItem) list[i] ).Broadcast( triggerer );
|
||||
list[i].Broadcast( triggerer );
|
||||
}
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InternalCallback ) );
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -41,6 +42,7 @@ namespace Server.Items
|
|||
{
|
||||
from.FixedEffect( 0x375A, 10, 15 );
|
||||
from.PlaySound( 0x1E7 );
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501774 ); // You swallow the fish whole!
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1003,4 +1003,46 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SwitchItem : Item
|
||||
{
|
||||
[Constructable]
|
||||
public SwitchItem()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SwitchItem( int amountFrom, int amountTo )
|
||||
: this( Utility.RandomMinMax( amountFrom, amountTo ) )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SwitchItem( int amount )
|
||||
: base( 0x2F5F )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public SwitchItem( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,20 @@ namespace Server.Items
|
|||
[FlipableAttribute( 0x1BD7, 0x1BDA )]
|
||||
public class Board : Item, ICommodity
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set { m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
string ICommodity.Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return String.Format( Amount == 1 ? "{0} board" : "{0} boards", Amount );
|
||||
return String.Format( Amount == 1 ? "{0} {1} board" : "{0} {1} boards", Amount, CraftResources.IsStandard( m_Resource ) ? String.Empty : CraftResources.GetName( m_Resource ).ToLower() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -21,10 +30,8 @@ namespace Server.Items
|
|||
|
||||
[Constructable]
|
||||
public Board( int amount )
|
||||
: base( 0x1BD7 )
|
||||
: this( CraftResource.RegularWood, amount )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Board( Serial serial )
|
||||
|
|
@ -32,13 +39,47 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Board( CraftResource resource ) : this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Board( CraftResource resource, int amount )
|
||||
: base( 0x1BD7 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 2.0;
|
||||
Amount = amount;
|
||||
|
||||
m_Resource = resource;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !CraftResources.IsStandard( m_Resource ) )
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber( m_Resource );
|
||||
|
||||
if ( num > 0 )
|
||||
list.Add( num );
|
||||
else
|
||||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 );
|
||||
writer.Write( (int) 2 );
|
||||
|
||||
writer.Write( (int)m_Resource );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -47,8 +88,225 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version == 0 && Weight == 0.1 )
|
||||
Weight = -1;
|
||||
|
||||
if ( version <= 1 )
|
||||
m_Resource = CraftResource.RegularWood;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class HeartwoodBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public HeartwoodBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeartwoodBoard( int amount )
|
||||
: base( CraftResource.Heartwood )
|
||||
{
|
||||
}
|
||||
|
||||
public HeartwoodBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodwoodBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public BloodwoodBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodwoodBoard( int amount )
|
||||
: base( CraftResource.Bloodwood )
|
||||
{
|
||||
}
|
||||
|
||||
public BloodwoodBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class FrostwoodBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public FrostwoodBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FrostwoodBoard( int amount )
|
||||
: base( CraftResource.Frostwood )
|
||||
{
|
||||
}
|
||||
|
||||
public FrostwoodBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class OakBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public OakBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public OakBoard( int amount )
|
||||
: base( CraftResource.OakWood )
|
||||
{
|
||||
}
|
||||
|
||||
public OakBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class AshBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public AshBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AshBoard( int amount )
|
||||
: base( CraftResource.AshWood )
|
||||
{
|
||||
}
|
||||
|
||||
public AshBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class YewBoard : Board
|
||||
{
|
||||
[Constructable]
|
||||
public YewBoard()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YewBoard( int amount )
|
||||
: base( CraftResource.YewWood )
|
||||
{
|
||||
}
|
||||
|
||||
public YewBoard( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,11 +6,20 @@ namespace Server.Items
|
|||
[FlipableAttribute( 0x1bdd, 0x1be0 )]
|
||||
public class Log : Item, ICommodity
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set { m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
string ICommodity.Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return String.Format( Amount == 1 ? "{0} log" : "{0} logs", Amount );
|
||||
return String.Format( Amount == 1 ? "{0} {1} log" : "{0} {1} logs", Amount, CraftResources.IsStandard( m_Resource ) ? String.Empty : CraftResources.GetName( m_Resource ).ToLower() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -20,24 +29,267 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
[Constructable]
|
||||
public Log( int amount ) : base( 0x1BDD )
|
||||
public Log( int amount ) : this( CraftResource.RegularWood )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Log( CraftResource resource )
|
||||
: this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Log( CraftResource resource, int amount )
|
||||
: base( 0x1BDD )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 2.0;
|
||||
Amount = amount;
|
||||
|
||||
m_Resource = resource;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !CraftResources.IsStandard( m_Resource ) )
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber( m_Resource );
|
||||
|
||||
if ( num > 0 )
|
||||
list.Add( num );
|
||||
else
|
||||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
|
||||
public Log( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int)m_Resource );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version == 0 )
|
||||
m_Resource = CraftResource.RegularWood;
|
||||
}
|
||||
}
|
||||
|
||||
public class HeartwoodLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public HeartwoodLog() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HeartwoodLog( int amount ) : base( CraftResource.Heartwood )
|
||||
{
|
||||
}
|
||||
|
||||
public HeartwoodLog( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
writer.Write( (int)0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BloodwoodLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public BloodwoodLog()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodwoodLog( int amount )
|
||||
: base( CraftResource.Bloodwood )
|
||||
{
|
||||
}
|
||||
|
||||
public BloodwoodLog( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class FrostwoodLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public FrostwoodLog()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FrostwoodLog( int amount )
|
||||
: base( CraftResource.Frostwood )
|
||||
{
|
||||
}
|
||||
|
||||
public FrostwoodLog( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class OakLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public OakLog()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public OakLog( int amount )
|
||||
: base( CraftResource.OakWood )
|
||||
{
|
||||
}
|
||||
|
||||
public OakLog( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class AshLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public AshLog()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AshLog( int amount )
|
||||
: base( CraftResource.AshWood )
|
||||
{
|
||||
}
|
||||
|
||||
public AshLog( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class YewLog : Log
|
||||
{
|
||||
[Constructable]
|
||||
public YewLog()
|
||||
: this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public YewLog( int amount )
|
||||
: base( CraftResource.YewWood )
|
||||
{
|
||||
}
|
||||
|
||||
public YewLog( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Items
|
|||
{
|
||||
public static readonly TimeSpan UseDelay = TimeSpan.FromSeconds( 7.0 );
|
||||
|
||||
private ArrayList m_Entries;
|
||||
private List<RunebookEntry> m_Entries;
|
||||
private string m_Description;
|
||||
private int m_CurCharges, m_MaxCharges;
|
||||
private int m_DefaultIndex;
|
||||
|
|
@ -95,7 +95,7 @@ namespace Server.Items
|
|||
|
||||
Layer = (Core.AOS ? Layer.Invalid : Layer.OneHanded);
|
||||
|
||||
m_Entries = new ArrayList();
|
||||
m_Entries = new List<RunebookEntry>();
|
||||
|
||||
m_MaxCharges = maxCharges;
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public ArrayList Entries
|
||||
public List<RunebookEntry> Entries
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -122,7 +122,7 @@ namespace Server.Items
|
|||
get
|
||||
{
|
||||
if ( m_DefaultIndex >= 0 && m_DefaultIndex < m_Entries.Count )
|
||||
return (RunebookEntry)m_Entries[m_DefaultIndex];
|
||||
return m_Entries[m_DefaultIndex];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ namespace Server.Items
|
|||
writer.Write( m_Entries.Count );
|
||||
|
||||
for ( int i = 0; i < m_Entries.Count; ++i )
|
||||
((RunebookEntry)m_Entries[i]).Serialize( writer );
|
||||
m_Entries[i].Serialize( writer );
|
||||
|
||||
writer.Write( m_Description );
|
||||
writer.Write( m_CurCharges );
|
||||
|
|
@ -198,7 +198,7 @@ namespace Server.Items
|
|||
{
|
||||
int count = reader.ReadInt();
|
||||
|
||||
m_Entries = new ArrayList( count );
|
||||
m_Entries = new List<RunebookEntry>( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
m_Entries.Add( new RunebookEntry( reader ) );
|
||||
|
|
@ -294,29 +294,6 @@ namespace Server.Items
|
|||
NextUse = DateTime.Now + UseDelay;
|
||||
}
|
||||
|
||||
/*
|
||||
public override Item Dupe( int amount )
|
||||
{
|
||||
Runebook book = new Runebook();
|
||||
|
||||
book.m_Level = m_Level;
|
||||
book.m_CurCharges = m_CurCharges;
|
||||
book.m_MaxCharges = m_MaxCharges;
|
||||
book.m_DefaultIndex = m_DefaultIndex;
|
||||
book.m_Description = m_Description;
|
||||
book.m_Level = m_Level;
|
||||
book.LootType = this.LootType;
|
||||
|
||||
for( int i = 0; i < m_Entries.Count; i++ )
|
||||
{
|
||||
RunebookEntry entry = m_Entries[i] as RunebookEntry;
|
||||
|
||||
book.m_Entries.Add( new RunebookEntry( entry.Location, entry.Map, entry.Description, entry.House ) );
|
||||
}
|
||||
|
||||
return base.Dupe( book, amount );
|
||||
}*/
|
||||
|
||||
public override void OnAfterDuped( Item newItem )
|
||||
{
|
||||
Runebook book = newItem as Runebook;
|
||||
|
|
@ -324,11 +301,11 @@ namespace Server.Items
|
|||
if ( book == null )
|
||||
return;
|
||||
|
||||
book.m_Entries = new ArrayList(); //Currently, when duping, it just copies over the ref over the already made blank ArrayList
|
||||
book.m_Entries = new List<RunebookEntry>(); //Currently, when duping, it just copies over the ref over the already made blank ArrayList
|
||||
|
||||
for ( int i = 0; i < m_Entries.Count; i++ )
|
||||
{
|
||||
RunebookEntry entry = m_Entries[i] as RunebookEntry;
|
||||
RunebookEntry entry = m_Entries[i];
|
||||
|
||||
book.m_Entries.Add( new RunebookEntry( entry.Location, entry.Map, entry.Description, entry.House ) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,6 +227,9 @@ namespace Server.Items
|
|||
|
||||
if ( darts.PoisonCharges <= 0 )
|
||||
darts.Poison = null;
|
||||
|
||||
m_UsesRemaining += need;
|
||||
darts.UsesRemaining -= need;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue