This commit is contained in:
mark 2007-12-17 20:41:34 +00:00
parent 7ad00dceac
commit 0b4c3b15d9
41 changed files with 976 additions and 144 deletions

View file

@ -7,6 +7,7 @@ using Server.Accounting;
using Server.Commands; using Server.Commands;
using Server.Engines.Help; using Server.Engines.Help;
using Server.Network; using Server.Network;
using Server.Regions;
namespace Server.Misc namespace Server.Misc
{ {
@ -192,11 +193,16 @@ namespace Server.Misc
state.Send( new DeleteResult( DeleteResultType.CharTooYoung ) ); state.Send( new DeleteResult( DeleteResultType.CharTooYoung ) );
state.Send( new CharacterListUpdate( acct ) ); state.Send( new CharacterListUpdate( acct ) );
} }
else if ( m.AccessLevel == AccessLevel.Player && Region.Find( m.LogoutLocation, m.LogoutMap ).GetRegion( typeof( Jail ) ) != null ) //Don't need to check current location, if netstate is null, they're logged out
{
state.Send( new DeleteResult( DeleteResultType.BadRequest ) );
state.Send( new CharacterListUpdate( acct ) );
}
else else
{ {
Console.WriteLine( "Client: {0}: Deleting character {1} (0x{2:X})", state, index, m.Serial.Value ); Console.WriteLine( "Client: {0}: Deleting character {1} (0x{2:X})", state, index, m.Serial.Value );
acct.Comments.Add( new AccountComment( "System", String.Format( "Character #{0} {1} deleted by {2}", index+1, m, state ) ) ); acct.Comments.Add( new AccountComment( "System", String.Format( "Character #{0} {1} deleted by {2}", index + 1, m, state ) ) );
m.Delete(); m.Delete();
state.Send( new CharacterListUpdate( acct ) ); state.Send( new CharacterListUpdate( acct ) );

View file

@ -143,7 +143,7 @@ namespace Server.Commands
from.SendMessage( "Property ({0}) not found.", propName ); from.SendMessage( "Property ({0}) not found.", propName );
else if ( from.AccessLevel < attr.WriteLevel ) else if ( from.AccessLevel < attr.WriteLevel )
from.SendMessage( "Setting this property ({0}) requires at least {1} access level.", propName, Mobile.GetAccessLevelName( attr.WriteLevel ) ); from.SendMessage( "Setting this property ({0}) requires at least {1} access level.", propName, Mobile.GetAccessLevelName( attr.WriteLevel ) );
else if ( !thisProp.CanWrite ) else if ( !thisProp.CanWrite || attr.ReadOnly )
from.SendMessage( "Property ({0}) is read only.", propName ); from.SendMessage( "Property ({0}) is read only.", propName );
else else
realProps[i] = thisProp; realProps[i] = thisProp;

View file

@ -135,7 +135,7 @@ namespace Server.Commands
failReason = String.Format( "Property '{0}' is write only.", propertyName ); failReason = String.Format( "Property '{0}' is write only.", propertyName );
return null; return null;
} }
else if ( (access & PropertyAccess.Write) != 0 && !p.CanWrite && isFinal ) else if ( (access & PropertyAccess.Write) != 0 && (!p.CanWrite || attr.ReadOnly) && isFinal )
{ {
failReason = String.Format( "Property '{0}' is read only.", propertyName ); failReason = String.Format( "Property '{0}' is read only.", propertyName );
return null; return null;
@ -718,7 +718,7 @@ namespace Server
if ( ( access & PropertyAccess.Read ) != 0 && from.AccessLevel < security.ReadLevel ) if ( ( access & PropertyAccess.Read ) != 0 && from.AccessLevel < security.ReadLevel )
throw new ReadAccessException( this, from.AccessLevel, security.ReadLevel ); throw new ReadAccessException( this, from.AccessLevel, security.ReadLevel );
if ( ( access & PropertyAccess.Write ) != 0 && from.AccessLevel < security.WriteLevel ) if ( ( access & PropertyAccess.Write ) != 0 && (from.AccessLevel < security.WriteLevel || security.ReadOnly) )
throw new WriteAccessException( this, from.AccessLevel, security.ReadLevel ); throw new WriteAccessException( this, from.AccessLevel, security.ReadLevel );
} }

View file

@ -278,19 +278,6 @@ namespace Server.Engines.Doom
{ {
Point3D loc = GetWorldLocation(); Point3D loc = GetWorldLocation();
/*
Sector sec = map.GetSector( loc );
ArrayList regions = sec.Regions;
for ( int i = 0; playerCount == 0 && i < regions.Count; ++i )
{
Region reg = (Region)regions[i];
if ( reg != null && reg != m_Region && reg.Contains( loc ) )
playerCount = reg.GetPlayerCount();
}
*/
Region reg = Region.Find( loc, map ).GetRegion( "Doom Gauntlet" ); Region reg = Region.Find( loc, map ).GetRegion( "Doom Gauntlet" );
if ( reg != null ) if ( reg != null )
@ -575,11 +562,11 @@ namespace Server.Engines.Doom
dealer.Female = false; dealer.Female = false;
dealer.Hue = 0x8835; dealer.Hue = 0x8835;
ArrayList items = new ArrayList( dealer.Items ); List<Item> items = new List<Item>( dealer.Items );
for ( int i = 0; i < items.Count; ++i ) for ( int i = 0; i < items.Count; ++i )
{ {
Item item = (Item)items[i]; Item item = items[i];
if ( item.Layer != Layer.ShopBuy && item.Layer != Layer.ShopResale && item.Layer != Layer.ShopSell ) if ( item.Layer != Layer.ShopBuy && item.Layer != Layer.ShopResale && item.Layer != Layer.ShopSell )
item.Delete(); item.Delete();

View file

@ -0,0 +1,31 @@
using System;
namespace Server.Engines.Harvest
{
public class BonusHarvestResource
{
private Type m_Type;
private double m_ReqSkill, m_Chance;
private TextDefinition m_SuccessMessage;
public Type Type { get { return m_Type; } set { m_Type = value; } }
public double ReqSkill { get { return m_ReqSkill; } set { m_ReqSkill = value; } }
public double Chance { get { return m_Chance; } set { m_Chance = value; } }
public TextDefinition SuccessMessage { get { return m_SuccessMessage; } }
public void SendSuccessTo( Mobile m )
{
TextDefinition.SendMessageTo( m, m_SuccessMessage );
}
public BonusHarvestResource( double reqSkill, double chance, TextDefinition message, Type type )
{
m_ReqSkill = reqSkill;
m_Chance = chance;
m_Type = type;
m_SuccessMessage = message;
}
}
}

View file

@ -9,6 +9,13 @@ namespace Server.Engines.Harvest
private DateTime m_NextRespawn; private DateTime m_NextRespawn;
private HarvestVein m_Vein, m_DefaultVein; private HarvestVein m_Vein, m_DefaultVein;
HarvestDefinition m_Definition;
public HarvestDefinition Definition
{
get { return m_Definition; }
}
public int Current public int Current
{ {
get get
@ -46,23 +53,31 @@ namespace Server.Engines.Harvest
return; return;
m_Current = m_Maximum; m_Current = m_Maximum;
m_Vein = m_DefaultVein;
if ( m_Definition.RandomizeVeins )
{
m_Vein = m_Definition.GetVeinFrom( Utility.RandomDouble() );
}
else
{
m_Vein = m_DefaultVein;
}
} }
public void Consume( HarvestDefinition def, int amount, Mobile from ) public void Consume( int amount, Mobile from )
{ {
CheckRespawn(); CheckRespawn();
if ( m_Current == m_Maximum ) if ( m_Current == m_Maximum )
{ {
double min = def.MinRespawn.TotalMinutes; double min = m_Definition.MinRespawn.TotalMinutes;
double max = def.MaxRespawn.TotalMinutes; double max = m_Definition.MaxRespawn.TotalMinutes;
double rnd = Utility.RandomDouble(); double rnd = Utility.RandomDouble();
m_Current = m_Maximum - amount; m_Current = m_Maximum - amount;
double minutes = min + (rnd * (max - min)); double minutes = min + (rnd * (max - min));
if( def.RaceBonus && from.Race == Race.Elf ) //def.RaceBonus = Core.ML if ( m_Definition.RaceBonus && from.Race == Race.Elf ) //def.RaceBonus = Core.ML
minutes *= .75; //25% off the time. minutes *= .75; //25% off the time.
m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes( minutes ); m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes( minutes );
@ -82,6 +97,8 @@ namespace Server.Engines.Harvest
m_Current = m_Maximum; m_Current = m_Maximum;
m_DefaultVein = defaultVein; m_DefaultVein = defaultVein;
m_Vein = m_DefaultVein; m_Vein = m_DefaultVein;
m_Definition = def;
} }
} }
} }

View file

@ -22,7 +22,9 @@ namespace Server.Engines.Harvest
private object m_NoResourcesMessage, m_OutOfRangeMessage, m_TimedOutOfRangeMessage, m_DoubleHarvestMessage, m_FailMessage, m_PackFullMessage, m_ToolBrokeMessage; private object m_NoResourcesMessage, m_OutOfRangeMessage, m_TimedOutOfRangeMessage, m_DoubleHarvestMessage, m_FailMessage, m_PackFullMessage, m_ToolBrokeMessage;
private HarvestResource[] m_Resources; private HarvestResource[] m_Resources;
private HarvestVein[] m_Veins; private HarvestVein[] m_Veins;
private BonusHarvestResource[] m_BonusResources;
private bool m_RaceBonus; private bool m_RaceBonus;
private bool m_RandomizeVeins;
public int BankWidth{ get{ return m_BankWidth; } set{ m_BankWidth = value; } } public int BankWidth{ get{ return m_BankWidth; } set{ m_BankWidth = value; } }
public int BankHeight{ get{ return m_BankHeight; } set{ m_BankHeight = value; } } public int BankHeight{ get{ return m_BankHeight; } set{ m_BankHeight = value; } }
@ -51,7 +53,9 @@ namespace Server.Engines.Harvest
public object ToolBrokeMessage{ get{ return m_ToolBrokeMessage; } set{ m_ToolBrokeMessage = value; } } public object ToolBrokeMessage{ get{ return m_ToolBrokeMessage; } set{ m_ToolBrokeMessage = value; } }
public HarvestResource[] Resources{ get{ return m_Resources; } set{ m_Resources = value; } } public HarvestResource[] Resources{ get{ return m_Resources; } set{ m_Resources = value; } }
public HarvestVein[] Veins{ get{ return m_Veins; } set{ m_Veins = value; } } public HarvestVein[] Veins{ get{ return m_Veins; } set{ m_Veins = value; } }
public BonusHarvestResource[] BonusResources{ get { return m_BonusResources; } set { m_BonusResources = value; } }
public bool RaceBonus { get { return m_RaceBonus; } set { m_RaceBonus = value; } } public bool RaceBonus { get { return m_RaceBonus; } set { m_RaceBonus = value; } }
public bool RandomizeVeins { get { return m_RandomizeVeins; } set { m_RandomizeVeins = value; } }
private Dictionary<Map, Dictionary<Point2D, HarvestBank>> m_BanksByMap; private Dictionary<Map, Dictionary<Point2D, HarvestBank>> m_BanksByMap;
@ -94,8 +98,27 @@ namespace Server.Engines.Harvest
if ( m_Veins.Length == 1 ) if ( m_Veins.Length == 1 )
return m_Veins[0]; return m_Veins[0];
Random random = new Random( (x*17)+(y*11)+(map.MapID * 3) ); double randomValue;
double randomValue = random.NextDouble() * 100;
if ( m_RandomizeVeins )
{
randomValue = Utility.RandomDouble();
}
else
{
Random random = new Random( ( x * 17 ) + ( y * 11 ) + ( map.MapID * 3 ) );
randomValue = random.NextDouble();
}
return GetVeinFrom( randomValue );
}
public HarvestVein GetVeinFrom( double randomValue )
{
if ( m_Veins.Length == 1 )
return m_Veins[0];
randomValue *= 100;
for ( int i = 0; i < m_Veins.Length; ++i ) for ( int i = 0; i < m_Veins.Length; ++i )
{ {
@ -108,6 +131,24 @@ namespace Server.Engines.Harvest
return null; return null;
} }
public BonusHarvestResource GetBonusResource()
{
if ( m_BonusResources == null )
return null;
double randomValue = Utility.RandomDouble() * 100;
for ( int i = 0; i < m_BonusResources.Length; ++i )
{
if ( randomValue <= m_BonusResources[i].Chance )
return m_BonusResources[i];
randomValue -= m_BonusResources[i].Chance;
}
return null;
}
public HarvestDefinition() public HarvestDefinition()
{ {
m_BanksByMap = new Dictionary<Map, Dictionary<Point2D, HarvestBank>>(); m_BanksByMap = new Dictionary<Map, Dictionary<Point2D, HarvestBank>>();

View file

@ -186,7 +186,7 @@ namespace Server.Engines.Harvest
item.Amount = amount; item.Amount = amount;
} }
bank.Consume( def, item.Amount, from ); bank.Consume( item.Amount, from );
if ( Give( from, item, def.PlaceAtFeetIfFull ) ) if ( Give( from, item, def.PlaceAtFeetIfFull ) )
{ {
@ -198,6 +198,22 @@ namespace Server.Engines.Harvest
item.Delete(); item.Delete();
} }
BonusHarvestResource bonus = def.GetBonusResource();
if ( bonus != null && bonus.Type != null && skillBase >= bonus.ReqSkill )
{
Item bonusItem = Construct( bonus.Type, from );
if ( Give( from, bonusItem, true ) ) //Bonuses always allow placing at feet, even if pack is full irregrdless of def
{
bonus.SendSuccessTo( from );
}
else
{
item.Delete();
}
}
if ( tool is IUsesRemaining ) if ( tool is IUsesRemaining )
{ {
IUsesRemaining toolWithUses = (IUsesRemaining)tool; IUsesRemaining toolWithUses = (IUsesRemaining)tool;
@ -266,14 +282,14 @@ namespace Server.Engines.Harvest
if ( map == null ) if ( map == null )
return false; return false;
ArrayList atFeet = new ArrayList(); List<Item> atFeet = new List<Item>();
foreach ( Item obj in m.GetItemsInRange( 0 ) ) foreach ( Item obj in m.GetItemsInRange( 0 ) )
atFeet.Add( obj ); atFeet.Add( obj );
for ( int i = 0; i < atFeet.Count; ++i ) for ( int i = 0; i < atFeet.Count; ++i )
{ {
Item check = (Item)atFeet[i]; Item check = atFeet[i];
if ( check.StackWith( m, item, false ) ) if ( check.StackWith( m, item, false ) )
return true; return true;

View file

@ -481,17 +481,23 @@ namespace Server.Engines.Harvest
Point3D loc; Point3D loc;
if ( GetHarvestDetails( from, tool, toHarvest, out tileID, out map, out loc ) ) if ( GetHarvestDetails( from, tool, toHarvest, out tileID, out map, out loc ) )
Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), new TimerStateCallback( Splash_Callback ), new object[]{ loc, map } ); Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ),
delegate
{
if( Core.ML )
from.RevealingAction();
Effects.SendLocationEffect( loc, map, 0x352D, 16, 4 );
Effects.PlaySound( loc, map, 0x364 );
} );
} }
private void Splash_Callback( object state ) public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{ {
object[] args = (object[])state; base.OnHarvestFinished( from, tool, def, vein, bank, resource, harvested );
Point3D loc = (Point3D)args[0];
Map map = (Map)args[1];
Effects.SendLocationEffect( loc, map, 0x352D, 16, 4 ); if ( Core.ML )
Effects.PlaySound( loc, map, 0x364 ); from.RevealingAction();
} }
public override object GetLock( Mobile from, Item tool, HarvestDefinition def, object toHarvest ) public override object GetLock( Mobile from, Item tool, HarvestDefinition def, object toHarvest )

View file

@ -62,7 +62,7 @@ namespace Server.Engines.Harvest
// The chopping effect // The chopping effect
lumber.EffectActions = new int[]{ 13 }; lumber.EffectActions = new int[]{ 13 };
lumber.EffectSounds = new int[]{ 0x13E }; lumber.EffectSounds = new int[]{ 0x13E };
lumber.EffectCounts = new int[]{ 1, 2, 2, 2, 3 }; lumber.EffectCounts = (Core.AOS ? new int[]{ 1 } : new int[]{ 1, 2, 2, 2, 3 });
lumber.EffectDelay = TimeSpan.FromSeconds( 1.6 ); lumber.EffectDelay = TimeSpan.FromSeconds( 1.6 );
lumber.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 ); lumber.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );
@ -72,20 +72,59 @@ namespace Server.Engines.Harvest
lumber.PackFullMessage = 500497; // You can't place any wood into your backpack! lumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
lumber.ToolBrokeMessage = 500499; // You broke your axe. lumber.ToolBrokeMessage = 500499; // You broke your axe.
res = new HarvestResource[] if ( Core.ML )
{
res = new HarvestResource[]
{
new HarvestResource( 00.0, 00.0, 100.0, 1072540, typeof( Log ) ),
new HarvestResource( 65.0, 25.0, 105.0, 1072541, typeof( OakLog ) ),
new HarvestResource( 80.0, 40.0, 120.0, 1072542, typeof( AshLog ) ),
new HarvestResource( 95.0, 55.0, 135.0, 1072543, typeof( YewLog ) ),
new HarvestResource( 100.0, 60.0, 140.0, 1072544, typeof( HeartwoodLog ) ),
new HarvestResource( 100.0, 60.0, 140.0, 1072545, typeof( BloodwoodLog ) ),
new HarvestResource( 100.0, 60.0, 140.0, 1072546, typeof( FrostwoodLog ) ),
};
veins = new HarvestVein[]
{
new HarvestVein( 58.4, 0.0, res[0], null ), // Ordinary Logs
new HarvestVein( 30.0, 0.5, res[1], res[0] ), // Oak
new HarvestVein( 10.0, 0.5, res[2], res[0] ), // Ash
new HarvestVein( 01.0, 0.5, res[3], res[0] ), // Yew
new HarvestVein( 00.3, 0.5, res[4], res[0] ), // Heartwood
new HarvestVein( 00.2, 0.5, res[5], res[0] ), // Bloodwood
new HarvestVein( 00.1, 0.5, res[6], res[0] ), // Frostwood
};
lumber.BonusResoucres = new BonusHarvestResource[]
{
new BonusHarvestResource( 0, 83.9, null, null ), //Nothing
new BonusHarvestResource( 100, 10.0, 1072548, typeof( BarkFragment ) ),
new BonusHarvestResource( 100, 03.0, 1072550, typeof( LuminescentFungi ) ),
new BonusHarvestResource( 100, 02.0, 1072547, typeof( SwitchItem ) ),
new BonusHarvestResource( 100, 01.0, 1072549, typeof( ParasiticPlant ) ),
new BonusHarvestResource( 100, 00.1, 1072551, typeof( BrilliantAmber ) )
};
}
else
{
res = new HarvestResource[]
{ {
new HarvestResource( 00.0, 00.0, 100.0, 500498, typeof( Log ) ) new HarvestResource( 00.0, 00.0, 100.0, 500498, typeof( Log ) )
}; };
veins = new HarvestVein[] veins = new HarvestVein[]
{ {
new HarvestVein( 100.0, 0.0, res[0], null ) new HarvestVein( 100.0, 0.0, res[0], null )
}; };
}
lumber.Resources = res; lumber.Resources = res;
lumber.Veins = veins; lumber.Veins = veins;
lumber.RaceBonus = Core.ML; lumber.RaceBonus = Core.ML;
lumber.RandomizeVeins = Core.ML;
m_Definition = lumber; m_Definition = lumber;
Definitions.Add( lumber ); Definitions.Add( lumber );
@ -125,6 +164,14 @@ namespace Server.Engines.Harvest
from.SendLocalizedMessage( 500489 ); // You can't use an axe on that. from.SendLocalizedMessage( 500489 ); // You can't use an axe on that.
} }
public override void OnHarvestStarted( Mobile from, Item tool, HarvestDefinition def, object toHarvest )
{
base.OnHarvestStarted( from, tool, def, toHarvest );
if( Core.ML )
from.RevealingAction();
}
public static void Initialize() public static void Initialize()
{ {
Array.Sort( m_TreeTiles ); Array.Sort( m_TreeTiles );

View file

@ -110,7 +110,22 @@ namespace Server.Engines.Harvest
oreAndStone.Resources = res; oreAndStone.Resources = res;
oreAndStone.Veins = veins; oreAndStone.Veins = veins;
if ( Core.ML )
{
oreAndStone.BonusResoucres = new BonusHarvestResource[]
{
new BonusHarvestResource( 0, 99.8998, null, null ), //Nothing //Note: Rounded the below to .0167 instead of 1/6th of a %. Close enough
new BonusHarvestResource( 100, .0167, 1072562, typeof( BlueDiamond ) ),
new BonusHarvestResource( 100, .0167, 1072567, typeof( DarkSapphire ) ),
new BonusHarvestResource( 100, .0167, 1072570, typeof( EcruCitrine ) ),
new BonusHarvestResource( 100, .0167, 1072564, typeof( FireRuby ) ),
new BonusHarvestResource( 100, .0167, 1072566, typeof( PerfectEmerald ) ),
new BonusHarvestResource( 100, .0167, 1072568, typeof( Turquoise ) )
};
}
oreAndStone.RaceBonus = Core.ML; oreAndStone.RaceBonus = Core.ML;
oreAndStone.RandomizeVeins = Core.ML;
Definitions.Add( oreAndStone ); Definitions.Add( oreAndStone );
#endregion #endregion
@ -330,6 +345,14 @@ namespace Server.Engines.Harvest
return true; return true;
} }
public override void OnHarvestStarted( Mobile from, Item tool, HarvestDefinition def, object toHarvest )
{
base.OnHarvestStarted( from, tool, def, toHarvest );
if ( Core.ML )
from.RevealingAction();
}
public override void OnBadHarvestTarget( Mobile from, Item tool, object toHarvest ) public override void OnBadHarvestTarget( Mobile from, Item tool, object toHarvest )
{ {
if ( toHarvest is LandTarget ) if ( toHarvest is LandTarget )

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
namespace Server.Engines.VeteranRewards namespace Server.Engines.VeteranRewards
{ {
@ -7,22 +8,22 @@ namespace Server.Engines.VeteranRewards
{ {
private int m_Name; private int m_Name;
private string m_NameString; private string m_NameString;
private ArrayList m_Entries; private List<RewardEntry> m_Entries;
public int Name{ get{ return m_Name; } } public int Name{ get{ return m_Name; } }
public string NameString{ get{ return m_NameString; } } public string NameString{ get{ return m_NameString; } }
public ArrayList Entries{ get{ return m_Entries; } } public List<RewardEntry> Entries { get { return m_Entries; } }
public RewardCategory( int name ) public RewardCategory( int name )
{ {
m_Name = name; m_Name = name;
m_Entries = new ArrayList(); m_Entries = new List<RewardEntry>();
} }
public RewardCategory( string name ) public RewardCategory( string name )
{ {
m_NameString = name; m_NameString = name;
m_Entries = new ArrayList(); m_Entries = new List<RewardEntry>();
} }
} }
} }

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Network; using Server.Network;
@ -90,11 +91,11 @@ namespace Server.Engines.VeteranRewards
{ {
AddPage( 2 + index ); AddPage( 2 + index );
ArrayList entries = category.Entries; List<RewardEntry> entries = category.Entries;
for ( int i = 0; i < entries.Count; ++i ) for ( int i = 0; i < entries.Count; ++i )
{ {
RewardEntry entry = (RewardEntry)entries[i]; RewardEntry entry = entries[i];
if ( !RewardSystem.HasAccess( m_From, entry ) ) if ( !RewardSystem.HasAccess( m_From, entry ) )
break; break;
@ -146,7 +147,7 @@ namespace Server.Engines.VeteranRewards
if ( index >= 0 && index < category.Entries.Count ) if ( index >= 0 && index < category.Entries.Count )
{ {
RewardEntry entry = (RewardEntry)category.Entries[index]; RewardEntry entry = category.Entries[index];
if ( !RewardSystem.HasAccess( m_From, entry ) ) if ( !RewardSystem.HasAccess( m_From, entry ) )
return; return;

View file

@ -66,10 +66,7 @@ namespace Server.Gumps
if ( from.Backpack != null ) if ( from.Backpack != null )
totalGold += from.Backpack.GetAmount( typeof( Gold ) ); totalGold += from.Backpack.GetAmount( typeof( Gold ) );
BankBox bank = from.FindBankNoCreate(); totalGold += Banker.GetBalance( from );
if ( bank != null )
totalGold += bank.GetAmount( typeof( Gold ) );
if ( totalGold < m_VI.Price ) if ( totalGold < m_VI.Price )
{ {
@ -86,8 +83,8 @@ namespace Server.Gumps
if ( from.Backpack != null ) if ( from.Backpack != null )
leftPrice -= from.Backpack.ConsumeUpTo( typeof( Gold ), leftPrice ); leftPrice -= from.Backpack.ConsumeUpTo( typeof( Gold ), leftPrice );
if ( leftPrice > 0 && bank != null ) if ( leftPrice > 0 )
bank.ConsumeUpTo( typeof( Gold ), leftPrice ); Banker.Withdraw( from, leftPrice );
m_Vendor.HoldGold += m_VI.Price; m_Vendor.HoldGold += m_VI.Price;

View file

@ -208,7 +208,7 @@ namespace Server.Gumps
CPA cpa = GetCPA( prop ); CPA cpa = GetCPA( prop );
if ( prop.CanWrite && cpa != null && m_Mobile.AccessLevel >= cpa.WriteLevel ) if ( prop.CanWrite && cpa != null && m_Mobile.AccessLevel >= cpa.WriteLevel && !cpa.ReadOnly )
AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3, GumpButtonType.Reply, 0 ); AddButton( x + SetOffsetX, y + SetOffsetY, SetButtonID1, SetButtonID2, i + 3, GumpButtonType.Reply, 0 );
} }
} }
@ -282,7 +282,7 @@ namespace Server.Gumps
CPA attr = GetCPA( prop ); CPA attr = GetCPA( prop );
if ( !prop.CanWrite || attr == null || from.AccessLevel < attr.WriteLevel ) if ( !prop.CanWrite || attr == null || from.AccessLevel < attr.WriteLevel || attr.ReadOnly )
return; return;
Type type = prop.PropertyType; Type type = prop.PropertyType;

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Network; using Server.Network;
@ -89,7 +90,7 @@ namespace Server.Gumps
AddHtmlLocalized( 158, 22, 100, 18, 1011299, false, false ); // Rename book AddHtmlLocalized( 158, 22, 100, 18, 1011299, false, false ); // Rename book
// List of entries // List of entries
ArrayList entries = m_Book.Entries; List<RunebookEntry> entries = m_Book.Entries;
for ( int i = 0; i < 16; ++i ) for ( int i = 0; i < 16; ++i )
{ {
@ -98,8 +99,8 @@ namespace Server.Gumps
if ( i < entries.Count ) if ( i < entries.Count )
{ {
desc = GetName( ((RunebookEntry)entries[i]).Description ); desc = GetName( entries[i].Description );
hue = GetMapHue( ((RunebookEntry)entries[i]).Map ); hue = GetMapHue( entries[i].Map );
} }
else else
{ {

View file

@ -127,7 +127,7 @@ namespace Server.Gumps
{ {
Mobile m = states[i].Mobile; 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 ) ) if ( filter != null && ( m.Name == null || m.Name.ToLower().IndexOf( filter ) < 0 ) )
continue; continue;

View file

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Network; using Server.Network;
using Server.Engines.Craft; using Server.Engines.Craft;
@ -17,7 +18,7 @@ namespace Server.Items
private bool m_Protected; private bool m_Protected;
private bool m_Editable; private bool m_Editable;
private ArrayList m_Pins = new ArrayList(); private List<Point2D> m_Pins = new List<Point2D>();
private const int MaxUserPins = 50; private const int MaxUserPins = 50;
@ -49,7 +50,7 @@ namespace Server.Items
set { m_Height = value; } set { m_Height = value; }
} }
public ArrayList Pins public List<Point2D> Pins
{ {
get { return m_Pins; } get { return m_Pins; }
} }
@ -105,7 +106,7 @@ namespace Server.Items
from.Send( new MapDisplay( this ) ); from.Send( new MapDisplay( this ) );
for ( int i = 0; i < m_Pins.Count; ++i ) 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 ) ) ); from.Send( new MapSetEditable( this, ValidateEdit( from ) ) );
} }
@ -265,7 +266,7 @@ namespace Server.Items
writer.Write( m_Pins.Count ); writer.Write( m_Pins.Count );
for ( int i = 0; i < m_Pins.Count; ++i ) 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 ) public override void Deserialize( GenericReader reader )

View file

@ -568,7 +568,7 @@ namespace Server.Items
return false; return false;
if ( item != this ) if ( item != this )
return CanLoot( from ); return CanLoot( from, item );
return true; return true;
} }
@ -578,7 +578,7 @@ namespace Server.Items
if ( !base.CheckLift( from, item, ref reject ) ) if ( !base.CheckLift( from, item, ref reject ) )
return false; return false;
return CanLoot( from ); return CanLoot( from,item );
} }
public override void OnItemUsed( Mobile from, Item item ) public override void OnItemUsed( Mobile from, Item item )
@ -664,7 +664,7 @@ namespace Server.Items
m_RestoreTable = null; m_RestoreTable = null;
} }
public bool CanLoot( Mobile from ) public bool CanLoot( Mobile from, Item item )
{ {
if ( !IsCriminalAction( from ) ) if ( !IsCriminalAction( from ) )
return true; return true;
@ -677,9 +677,9 @@ namespace Server.Items
return true; 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 ) if ( m_Owner == null || !m_Owner.Player )
from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature! from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature!
@ -786,7 +786,7 @@ namespace Server.Items
#endregion #endregion
if ( !CheckLoot( from ) ) if ( !CheckLoot( from, null ) )
return; return;
#region Quests #region Quests

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Multis; using Server.Multis;
@ -72,11 +73,11 @@ namespace Server.Items
public abstract class BasePlayerBB : Item, ISecurable public abstract class BasePlayerBB : Item, ISecurable
{ {
private PlayerBBMessage m_Greeting; private PlayerBBMessage m_Greeting;
private ArrayList m_Messages; private List<PlayerBBMessage> m_Messages;
private string m_Title; private string m_Title;
private SecureLevel m_Level; private SecureLevel m_Level;
public ArrayList Messages public List<PlayerBBMessage> Messages
{ {
get{ return m_Messages; } get{ return m_Messages; }
} }
@ -103,7 +104,7 @@ namespace Server.Items
public BasePlayerBB( int itemID ) : base( itemID ) public BasePlayerBB( int itemID ) : base( itemID )
{ {
m_Messages = new ArrayList(); m_Messages = new List<PlayerBBMessage>();
m_Level = SecureLevel.Anyone; m_Level = SecureLevel.Anyone;
} }
@ -140,7 +141,7 @@ namespace Server.Items
writer.WriteEncodedInt( m_Messages.Count ); writer.WriteEncodedInt( m_Messages.Count );
for ( int i = 0; i < m_Messages.Count; ++i ) 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 ) public override void Deserialize( GenericReader reader )
@ -168,7 +169,7 @@ namespace Server.Items
int count = reader.ReadEncodedInt(); int count = reader.ReadEncodedInt();
m_Messages = new ArrayList( count ); m_Messages = new List<PlayerBBMessage>( count );
for ( int i = 0; i < count; ++i ) for ( int i = 0; i < count; ++i )
m_Messages.Add( new PlayerBBMessage( reader ) ); m_Messages.Add( new PlayerBBMessage( reader ) );

View file

@ -2,6 +2,7 @@ using System;
using Server; using Server;
using Server.Network; using Server.Network;
using System.Collections; using System.Collections;
using System.Collections.Generic;
namespace Server.Items namespace Server.Items
{ {
@ -106,16 +107,16 @@ namespace Server.Items
if ( NeighborRange >= 0 ) if ( NeighborRange >= 0 )
{ {
ArrayList list = new ArrayList(); List<WarningItem> list = new List<WarningItem>();
foreach ( Item item in GetItemsInRange( NeighborRange ) ) foreach ( Item item in GetItemsInRange( NeighborRange ) )
{ {
if ( item != this && item is WarningItem ) if ( item != this && item is WarningItem )
list.Add( item ); list.Add( (WarningItem)item );
} }
for ( int i = 0; i < list.Count; i++ ) for ( int i = 0; i < list.Count; i++ )
( (WarningItem) list[i] ).Broadcast( triggerer ); list[i].Broadcast( triggerer );
} }
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InternalCallback ) ); Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InternalCallback ) );

View file

@ -1,4 +1,5 @@
using System; using System;
using Server.Network;
namespace Server.Items namespace Server.Items
{ {
@ -41,6 +42,7 @@ namespace Server.Items
{ {
from.FixedEffect( 0x375A, 10, 15 ); from.FixedEffect( 0x375A, 10, 15 );
from.PlaySound( 0x1E7 ); from.PlaySound( 0x1E7 );
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501774 ); // You swallow the fish whole!
Delete(); Delete();
} }
} }

View file

@ -1003,4 +1003,46 @@ namespace Server.Items
int version = reader.ReadInt(); 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();
}
}
} }

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Server; using Server;
using Server.Network; using Server.Network;
using Server.Mobiles; using Server.Mobiles;

View file

@ -5,11 +5,20 @@ namespace Server.Items
[FlipableAttribute( 0x1BD7, 0x1BDA )] [FlipableAttribute( 0x1BD7, 0x1BDA )]
public class Board : Item, ICommodity 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 string ICommodity.Description
{ {
get 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] [Constructable]
public Board( int amount ) public Board( int amount )
: base( 0x1BD7 ) : this( CraftResource.RegularWood, amount )
{ {
Stackable = true;
Amount = amount;
} }
public Board( Serial serial ) 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 ) public override void Serialize( GenericWriter writer )
{ {
base.Serialize( writer ); base.Serialize( writer );
writer.Write( (int) 1 ); writer.Write( (int) 2 );
writer.Write( (int)m_Resource );
} }
public override void Deserialize( GenericReader reader ) public override void Deserialize( GenericReader reader )
@ -47,8 +88,225 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
switch ( version )
{
case 2:
{
m_Resource = (CraftResource)reader.ReadInt();
break;
}
}
if ( version == 0 && Weight == 0.1 ) if ( version == 0 && Weight == 0.1 )
Weight = -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();
} }
} }
} }

View file

@ -6,11 +6,20 @@ namespace Server.Items
[FlipableAttribute( 0x1bdd, 0x1be0 )] [FlipableAttribute( 0x1bdd, 0x1be0 )]
public class Log : Item, ICommodity 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 string ICommodity.Description
{ {
get 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] [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; Stackable = true;
Weight = 2.0; Weight = 2.0;
Amount = amount; 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 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 ) public override void Serialize( GenericWriter writer )
{ {
base.Serialize( 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 ) public override void Deserialize( GenericReader reader )

View file

@ -14,7 +14,7 @@ namespace Server.Items
{ {
public static readonly TimeSpan UseDelay = TimeSpan.FromSeconds( 7.0 ); public static readonly TimeSpan UseDelay = TimeSpan.FromSeconds( 7.0 );
private ArrayList m_Entries; private List<RunebookEntry> m_Entries;
private string m_Description; private string m_Description;
private int m_CurCharges, m_MaxCharges; private int m_CurCharges, m_MaxCharges;
private int m_DefaultIndex; private int m_DefaultIndex;
@ -95,7 +95,7 @@ namespace Server.Items
Layer = (Core.AOS ? Layer.Invalid : Layer.OneHanded); Layer = (Core.AOS ? Layer.Invalid : Layer.OneHanded);
m_Entries = new ArrayList(); m_Entries = new List<RunebookEntry>();
m_MaxCharges = maxCharges; m_MaxCharges = maxCharges;
@ -109,7 +109,7 @@ namespace Server.Items
{ {
} }
public ArrayList Entries public List<RunebookEntry> Entries
{ {
get get
{ {
@ -122,7 +122,7 @@ namespace Server.Items
get get
{ {
if ( m_DefaultIndex >= 0 && m_DefaultIndex < m_Entries.Count ) if ( m_DefaultIndex >= 0 && m_DefaultIndex < m_Entries.Count )
return (RunebookEntry)m_Entries[m_DefaultIndex]; return m_Entries[m_DefaultIndex];
return null; return null;
} }
@ -163,7 +163,7 @@ namespace Server.Items
writer.Write( m_Entries.Count ); writer.Write( m_Entries.Count );
for ( int i = 0; i < m_Entries.Count; ++i ) 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_Description );
writer.Write( m_CurCharges ); writer.Write( m_CurCharges );
@ -198,7 +198,7 @@ namespace Server.Items
{ {
int count = reader.ReadInt(); int count = reader.ReadInt();
m_Entries = new ArrayList( count ); m_Entries = new List<RunebookEntry>( count );
for ( int i = 0; i < count; ++i ) for ( int i = 0; i < count; ++i )
m_Entries.Add( new RunebookEntry( reader ) ); m_Entries.Add( new RunebookEntry( reader ) );
@ -294,29 +294,6 @@ namespace Server.Items
NextUse = DateTime.Now + UseDelay; 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 ) public override void OnAfterDuped( Item newItem )
{ {
Runebook book = newItem as Runebook; Runebook book = newItem as Runebook;
@ -324,11 +301,11 @@ namespace Server.Items
if ( book == null ) if ( book == null )
return; 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++ ) 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 ) ); book.m_Entries.Add( new RunebookEntry( entry.Location, entry.Map, entry.Description, entry.House ) );
} }

View file

@ -227,6 +227,9 @@ namespace Server.Items
if ( darts.PoisonCharges <= 0 ) if ( darts.PoisonCharges <= 0 )
darts.Poison = null; darts.Poison = null;
m_UsesRemaining += need;
darts.UsesRemaining -= need;
} }
else else
{ {

View file

@ -126,6 +126,9 @@ namespace Server.Misc
NetState state = e.State; NetState state = e.State;
ClientVersion version = e.Version; ClientVersion version = e.Version;
if ( state.Mobile.AccessLevel > AccessLevel.Player )
return;
if( Required != null && version < Required && ( m_OldClientResponse == OldClientResponse.Kick ||( m_OldClientResponse == OldClientResponse.LenientKick && (DateTime.Now - state.Mobile.CreationTime) > m_AgeLeniency && state.Mobile is PlayerMobile && ((PlayerMobile)state.Mobile).GameTime > m_GameTimeLeniency ))) if( Required != null && version < Required && ( m_OldClientResponse == OldClientResponse.Kick ||( m_OldClientResponse == OldClientResponse.LenientKick && (DateTime.Now - state.Mobile.CreationTime) > m_AgeLeniency && state.Mobile is PlayerMobile && ((PlayerMobile)state.Mobile).GameTime > m_GameTimeLeniency )))
{ {
kickMessage = String.Format( "This server requires your client version be at least {0}.", Required ); kickMessage = String.Format( "This server requires your client version be at least {0}.", Required );

View file

@ -26,7 +26,15 @@ namespace Server.Items
BlackScales, BlackScales,
GreenScales, GreenScales,
WhiteScales, WhiteScales,
BlueScales BlueScales,
RegularWood = 301,
OakWood,
AshWood,
YewWood,
Heartwood,
Bloodwood,
Frostwood
} }
public enum CraftResourceType public enum CraftResourceType
@ -34,7 +42,8 @@ namespace Server.Items
None, None,
Metal, Metal,
Leather, Leather,
Scales Scales,
Wood
} }
public class CraftAttributeInfo public class CraftAttributeInfo
@ -95,6 +104,7 @@ namespace Server.Items
public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite; public static readonly CraftAttributeInfo DullCopper, ShadowIron, Copper, Bronze, Golden, Agapite, Verite, Valorite;
public static readonly CraftAttributeInfo Spined, Horned, Barbed; public static readonly CraftAttributeInfo Spined, Horned, Barbed;
public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales; public static readonly CraftAttributeInfo RedScales, YellowScales, BlackScales, GreenScales, WhiteScales, BlueScales;
public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood;
static CraftAttributeInfo() static CraftAttributeInfo()
{ {
@ -271,6 +281,20 @@ namespace Server.Items
blue.ArmorPoisonResist = -3; blue.ArmorPoisonResist = -3;
blue.ArmorEnergyResist = 10; blue.ArmorEnergyResist = 10;
//public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood;
CraftAttributeInfo oak = OakWood = new CraftAttributeInfo();
CraftAttributeInfo ash = AshWood = new CraftAttributeInfo();
CraftAttributeInfo yew = YewWood = new CraftAttributeInfo();
CraftAttributeInfo heart = Heartwood = new CraftAttributeInfo();
CraftAttributeInfo blood = Bloodwood = new CraftAttributeInfo();
CraftAttributeInfo frost = Frostwood = new CraftAttributeInfo();
} }
} }
@ -335,7 +359,7 @@ namespace Server.Items
new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), new CraftResourceInfo( 0x283, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ),
new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), new CraftResourceInfo( 0x227, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ),
new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ) new CraftResourceInfo( 0x1C1, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) )
}; };
private static CraftResourceInfo[] m_AOSLeatherInfo = new CraftResourceInfo[] private static CraftResourceInfo[] m_AOSLeatherInfo = new CraftResourceInfo[]
{ {
@ -343,14 +367,25 @@ namespace Server.Items
new CraftResourceInfo( 0x8AC, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ), new CraftResourceInfo( 0x8AC, 1049354, "Spined", CraftAttributeInfo.Spined, CraftResource.SpinedLeather, typeof( SpinedLeather ), typeof( SpinedHides ) ),
new CraftResourceInfo( 0x845, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ), new CraftResourceInfo( 0x845, 1049355, "Horned", CraftAttributeInfo.Horned, CraftResource.HornedLeather, typeof( HornedLeather ), typeof( HornedHides ) ),
new CraftResourceInfo( 0x851, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ), new CraftResourceInfo( 0x851, 1049356, "Barbed", CraftAttributeInfo.Barbed, CraftResource.BarbedLeather, typeof( BarbedLeather ), typeof( BarbedHides ) ),
}; };
private static CraftResourceInfo[] m_WoodInfo = new CraftResourceInfo[]
{
new CraftResourceInfo( 0x000, 1011542, "Normal", CraftAttributeInfo.Blank, CraftResource.RegularWood, typeof( Log ), typeof( Board ) ),
new CraftResourceInfo( 0x7DA, 1072533, "Oak", CraftAttributeInfo.OakWood, CraftResource.OakWood, typeof( OakLog ), typeof( OakBoard ) ),
new CraftResourceInfo( 0x4A7, 1072534, "Ash", CraftAttributeInfo.AshWood, CraftResource.AshWood, typeof( AshLog ), typeof( AshBoard ) ),
new CraftResourceInfo( 0x4A8, 1072535, "Yew", CraftAttributeInfo.YewWood, CraftResource.YewWood, typeof( YewLog ), typeof( YewBoard ) ),
new CraftResourceInfo( 0x4A9, 1072536, "Heartwood", CraftAttributeInfo.Heartwood, CraftResource.Heartwood, typeof( HeartwoodLog ), typeof( HeartwoodBoard ) ),
new CraftResourceInfo( 0x4AA, 1072538, "Bloodwood", CraftAttributeInfo.Bloodwood, CraftResource.Bloodwood, typeof( BloodwoodLog ), typeof( BloodwoodBoard ) ),
new CraftResourceInfo( 0x47F, 1072539, "Frostwood", CraftAttributeInfo.Frostwood, CraftResource.Frostwood, typeof( FrostwoodLog ), typeof( FrostwoodBoard ) )
};
/// <summary> /// <summary>
/// Returns true if '<paramref name="resource"/>' is None, Iron, or RegularLeather. False if otherwise. /// Returns true if '<paramref name="resource"/>' is None, Iron, RegularLeather or RegularWood. False if otherwise.
/// </summary> /// </summary>
public static bool IsStandard( CraftResource resource ) public static bool IsStandard( CraftResource resource )
{ {
return ( resource == CraftResource.None || resource == CraftResource.Iron || resource == CraftResource.RegularLeather ); return ( resource == CraftResource.None || resource == CraftResource.Iron || resource == CraftResource.RegularLeather || resource == CraftResource.RegularWood );
} }
private static Hashtable m_TypeTable; private static Hashtable m_TypeTable;
@ -394,6 +429,7 @@ namespace Server.Items
case CraftResourceType.Metal: list = m_MetalInfo; break; case CraftResourceType.Metal: list = m_MetalInfo; break;
case CraftResourceType.Leather: list = Core.AOS ? m_AOSLeatherInfo : m_LeatherInfo; break; case CraftResourceType.Leather: list = Core.AOS ? m_AOSLeatherInfo : m_LeatherInfo; break;
case CraftResourceType.Scales: list = m_ScaleInfo; break; case CraftResourceType.Scales: list = m_ScaleInfo; break;
case CraftResourceType.Wood: list = m_WoodInfo; break;
} }
if ( list != null ) if ( list != null )
@ -421,6 +457,9 @@ namespace Server.Items
if ( resource >= CraftResource.RedScales && resource <= CraftResource.BlueScales ) if ( resource >= CraftResource.RedScales && resource <= CraftResource.BlueScales )
return CraftResourceType.Scales; return CraftResourceType.Scales;
if ( resource >= CraftResource.RegularWood && resource <= CraftResource.Frostwood )
return CraftResourceType.Wood;
return CraftResourceType.None; return CraftResourceType.None;
} }
@ -434,6 +473,7 @@ namespace Server.Items
case CraftResourceType.Metal: return CraftResource.Iron; case CraftResourceType.Metal: return CraftResource.Iron;
case CraftResourceType.Leather: return CraftResource.RegularLeather; case CraftResourceType.Leather: return CraftResource.RegularLeather;
case CraftResourceType.Scales: return CraftResource.RedScales; case CraftResourceType.Scales: return CraftResource.RedScales;
case CraftResourceType.Wood: return CraftResource.RegularWood;
} }
return CraftResource.None; return CraftResource.None;

View file

@ -120,7 +120,7 @@ namespace Server.Misc
m.SendLocalizedMessage( 1019063 ); // You have lost a little karma. m.SendLocalizedMessage( 1019063 ); // You have lost a little karma.
} }
if ( wasPositiveKarma && m.Karma < 0 && m is PlayerMobile && !((PlayerMobile)m).KarmaLocked ) if ( !Core.AOS && wasPositiveKarma && m.Karma < 0 && m is PlayerMobile && !((PlayerMobile)m).KarmaLocked )
{ {
((PlayerMobile)m).KarmaLocked = true; ((PlayerMobile)m).KarmaLocked = true;
m.SendLocalizedMessage( 1042511, "", 0x22 ); // Karma is locked. A mantra spoken at a shrine will unlock it again. m.SendLocalizedMessage( 1042511, "", 0x22 ); // Karma is locked. A mantra spoken at a shrine will unlock it again.

View file

@ -164,13 +164,22 @@ namespace Server.Mobiles
public override void Serialize( GenericWriter writer ) public override void Serialize( GenericWriter writer )
{ {
base.Serialize( writer ); base.Serialize( writer );
writer.Write( (int) 0 ); writer.Write( (int) 1 );
} }
public override void Deserialize( GenericReader reader ) public override void Deserialize( GenericReader reader )
{ {
base.Deserialize( reader ); base.Deserialize( reader );
int version = reader.ReadInt(); int version = reader.ReadInt();
if ( version == 0 && PhysicalResistance > 60 )
{
SetResistance( ResistanceType.Physical, 40, 60 );
SetResistance( ResistanceType.Fire, 70, 90 );
SetResistance( ResistanceType.Cold, 40, 60 );
SetResistance( ResistanceType.Poison, 40, 60 );
SetResistance( ResistanceType.Energy, 40, 60 );
}
} }
} }
} }

View file

@ -101,16 +101,16 @@ namespace Server.Mobiles
Add( typeof( JesterHat ), 6 ); Add( typeof( JesterHat ), 6 );
Add( typeof( FloppyHat ), 3 ); Add( typeof( FloppyHat ), 3 );
Add( typeof( WideBrimHat ), 13 ); Add( typeof( WideBrimHat ), 4 );
Add( typeof( Cap ), 5 ); Add( typeof( Cap ), 5 );
Add( typeof( SkullCap ), 3 ); Add( typeof( SkullCap ), 3 );
Add( typeof( Bandana ), 6 ); Add( typeof( Bandana ), 3 );
Add( typeof( TallStrawHat ), 4 ); Add( typeof( TallStrawHat ), 4 );
Add( typeof( StrawHat ), 4 ); Add( typeof( StrawHat ), 4 );
Add( typeof( WizardsHat ), 5 ); Add( typeof( WizardsHat ), 5 );
Add( typeof( Bonnet ), 4 ); Add( typeof( Bonnet ), 4 );
Add( typeof( FeatheredHat ), 5 ); Add( typeof( FeatheredHat ), 5 );
Add( typeof( TricorneHat ), 13 ); Add( typeof( TricorneHat ), 4 );
Add( typeof( SpoolOfThread ), 9 ); Add( typeof( SpoolOfThread ), 9 );

View file

@ -33,7 +33,7 @@ namespace Server.Multis
TreasureMapChest.Fill( chest, 2 ); TreasureMapChest.Fill( chest, 2 );
AddItem( chest, 4, 4, 0 ); AddItem( chest, 4, 4, 1 );
AddMobile( new Orc(), 15, 0, -2, 0 ); AddMobile( new Orc(), 15, 0, -2, 0 );
AddMobile( new Orc(), 15, 0, 1, 0 ); AddMobile( new Orc(), 15, 0, 1, 0 );

View file

@ -33,7 +33,7 @@ namespace Server.Multis
TreasureMapChest.Fill( chest, 2 ); TreasureMapChest.Fill( chest, 2 );
AddItem( chest, 4, 4, 0 ); AddItem( chest, 4, 4, 1 );
AddMobile( new Ratman(), 15, 0, -2, 0 ); AddMobile( new Ratman(), 15, 0, -2, 0 );
AddMobile( new Ratman(), 15, 0, 1, 0 ); AddMobile( new Ratman(), 15, 0, 1, 0 );

View file

@ -24,11 +24,11 @@ namespace Server.Spells.Necromancy
public override int Body{ get{ return Caster.Female ? 747 : 748; } } public override int Body{ get{ return Caster.Female ? 747 : 748; } }
public override int Hue{ get{ return Caster.Female ? 0 : 0x4001; } } public override int Hue{ get{ return Caster.Female ? 0 : 0x4001; } }
public override int PhysResistOffset{ get{ return +10; } } public override int PhysResistOffset{ get{ return +15; } }
public override int FireResistOffset{ get{ return -25; } } public override int FireResistOffset{ get{ return -5; } }
public override int ColdResistOffset{ get{ return -05; } } public override int ColdResistOffset{ get{ return 0; } }
public override int PoisResistOffset{ get{ return -05; } } public override int PoisResistOffset{ get{ return 0; } }
public override int NrgyResistOffset{ get{ return -05; } } public override int NrgyResistOffset{ get{ return -5; } }
public WraithFormSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info ) public WraithFormSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{ {

View file

@ -58,7 +58,7 @@ namespace Server.Spells.Third
{ {
item.OnSnoop( Caster ); item.OnSnoop( Caster );
} }
else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster ) ) else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster, null ) )
{ {
} }
else if ( Caster.Region.OnDoubleClick( Caster, item ) ) else if ( Caster.Region.OnDoubleClick( Caster, item ) )

View file

@ -101,7 +101,7 @@ namespace Server.Targets
} }
else else
{ {
bank.Consume( def, 5, from ); bank.Consume( 5, from );
Item item = new Kindling(); Item item = new Kindling();

View file

@ -179,6 +179,7 @@ namespace Server
public class CommandPropertyAttribute : Attribute public class CommandPropertyAttribute : Attribute
{ {
private AccessLevel m_ReadLevel, m_WriteLevel; private AccessLevel m_ReadLevel, m_WriteLevel;
private bool m_ReadOnly;
public AccessLevel ReadLevel public AccessLevel ReadLevel
{ {
@ -196,6 +197,20 @@ namespace Server
} }
} }
public bool ReadOnly
{
get
{
return m_ReadOnly;
}
}
public CommandPropertyAttribute( AccessLevel level, bool readOnly )
{
m_ReadLevel = level;
m_ReadOnly = readOnly;
}
public CommandPropertyAttribute( AccessLevel level ) : this( level, level ) public CommandPropertyAttribute( AccessLevel level ) : this( level, level )
{ {
} }

View file

@ -999,7 +999,19 @@ namespace Server
/// <summary> /// <summary>
/// Overridable. Determines whether the item will show <see cref="AddWeightProperty" />. /// Overridable. Determines whether the item will show <see cref="AddWeightProperty" />.
/// </summary> /// </summary>
public virtual bool DisplayWeight { get { return ( Core.Expansion >= Expansion.ML ); } } public virtual bool DisplayWeight
{
get
{
if ( !Core.ML )
return false;
if ( !Movable && !( IsLockedDown || IsSecure ) && ItemData.Weight == 255 )
return false;
return true;
}
}
/// <summary> /// <summary>
/// Overridable. Displays cliloc 1072788-1072789. /// Overridable. Displays cliloc 1072788-1072789.

View file

@ -498,6 +498,7 @@ namespace Server
/// </summary> /// </summary>
public class Mobile : IEntity, IHued, IComparable<Mobile>, ISerializable public class Mobile : IEntity, IHued, IComparable<Mobile>, ISerializable
{ {
#region CompareTo(...)
public int CompareTo( IEntity other ) public int CompareTo( IEntity other )
{ {
if( other == null ) if( other == null )
@ -518,6 +519,7 @@ namespace Server
throw new ArgumentException(); throw new ArgumentException();
} }
#endregion
private static bool m_DragEffects = true; private static bool m_DragEffects = true;
@ -3980,6 +3982,8 @@ namespace Server
} }
} }
#region Get*Sound
public virtual int GetAngerSound() public virtual int GetAngerSound()
{ {
if( m_BaseSoundID != 0 ) if( m_BaseSoundID != 0 )
@ -4028,6 +4032,8 @@ namespace Server
} }
} }
#endregion
private static char[] m_GhostChars = new char[2] { 'o', 'O' }; private static char[] m_GhostChars = new char[2] { 'o', 'O' };
public static char[] GhostChars { get { return m_GhostChars; } set { m_GhostChars = value; } } public static char[] GhostChars { get { return m_GhostChars; } set { m_GhostChars = value; } }
@ -4597,6 +4603,8 @@ namespace Server
} }
} }
#region Get*InRange
public IPooledEnumerable GetItemsInRange( int range ) public IPooledEnumerable GetItemsInRange( int range )
{ {
Map map = m_Map; Map map = m_Map;
@ -4637,6 +4645,8 @@ namespace Server
return map.GetClientsInRange( m_Location, range ); return map.GetClientsInRange( m_Location, range );
} }
#endregion
private static List<Mobile> m_Hears; private static List<Mobile> m_Hears;
private static ArrayList m_OnSpeech; private static ArrayList m_OnSpeech;
@ -6483,6 +6493,8 @@ namespace Server
} }
} }
#region Gumps/Menus
public bool SendHuePicker( HuePicker p ) { public bool SendHuePicker( HuePicker p ) {
return SendHuePicker( p, false ); return SendHuePicker( p, false );
} }
@ -6604,6 +6616,8 @@ namespace Server
} }
} }
#endregion
/// <summary> /// <summary>
/// Overridable. Event invoked before the Mobile says something. /// Overridable. Event invoked before the Mobile says something.
/// <seealso cref="DoSpeech" /> /// <seealso cref="DoSpeech" />
@ -6788,6 +6802,8 @@ namespace Server
{ {
} }
#region Beneficial Checks/Actions
public virtual bool CanBeBeneficial( Mobile target ) public virtual bool CanBeBeneficial( Mobile target )
{ {
return CanBeBeneficial( target, true, false ); return CanBeBeneficial( target, true, false );
@ -6870,6 +6886,10 @@ namespace Server
return false; return false;
} }
#endregion
#region Harmful Checks/Actions
public virtual bool CanBeHarmful( Mobile target ) public virtual bool CanBeHarmful( Mobile target )
{ {
return CanBeHarmful( target, true ); return CanBeHarmful( target, true );
@ -6908,11 +6928,6 @@ namespace Server
return true; return true;
} }
public virtual int Luck
{
get { return 0; }
}
public virtual bool IsHarmfulCriminal( Mobile target ) public virtual bool IsHarmfulCriminal( Mobile target )
{ {
if( this == target ) if( this == target )
@ -6970,6 +6985,8 @@ namespace Server
return false; return false;
} }
#endregion
#region Stats #region Stats
/// <summary> /// <summary>
@ -7542,6 +7559,11 @@ namespace Server
#endregion #endregion
public virtual int Luck
{
get { return 0; }
}
public virtual int HuedItemID public virtual int HuedItemID
{ {
get get
@ -8236,6 +8258,8 @@ namespace Server
{ {
} }
#region Poison/Curing
public Timer PoisonTimer public Timer PoisonTimer
{ {
get { return m_PoisonTimer; } get { return m_PoisonTimer; }
@ -8435,6 +8459,8 @@ namespace Server
return false; return false;
} }
#endregion
private ISpawner m_Spawner; private ISpawner m_Spawner;
public ISpawner Spawner { get { return m_Spawner; } set { m_Spawner = value; } } public ISpawner Spawner { get { return m_Spawner; } set { m_Spawner = value; } }
@ -8571,6 +8597,7 @@ namespace Server
} }
} }
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
public Point3D LogoutLocation public Point3D LogoutLocation
{ {
get get
@ -8583,6 +8610,7 @@ namespace Server
} }
} }
[CommandProperty( AccessLevel.Counselor, AccessLevel.GameMaster )]
public Map LogoutMap public Map LogoutMap
{ {
get get
@ -8958,6 +8986,7 @@ namespace Server
{ {
} }
#region Hair
private HairInfo m_Hair; private HairInfo m_Hair;
private FacialHairInfo m_FacialHair; private FacialHairInfo m_FacialHair;
@ -9053,6 +9082,8 @@ namespace Server
} }
} }
#endregion
public bool HasFreeHand() public bool HasFreeHand()
{ {
return FindItemOnLayer( Layer.TwoHanded ) == null; return FindItemOnLayer( Layer.TwoHanded ) == null;
@ -9602,6 +9633,8 @@ namespace Server
Core.Set(); Core.Set();
} }
#region GetDirectionTo[..]
public Direction GetDirectionTo( int x, int y ) public Direction GetDirectionTo( int x, int y )
{ {
int dx = m_Location.m_X - x; int dx = m_Location.m_X - x;
@ -9649,6 +9682,8 @@ namespace Server
return GetDirectionTo( p.X, p.Y ); return GetDirectionTo( p.X, p.Y );
} }
#endregion
public virtual void ProcessDelta() public virtual void ProcessDelta()
{ {
Mobile m = this; Mobile m = this;
@ -10400,6 +10435,7 @@ namespace Server
#endregion #endregion
#region InRange
public bool InRange( Point2D p, int range ) public bool InRange( Point2D p, int range )
{ {
return (p.m_X >= (m_Location.m_X - range)) return (p.m_X >= (m_Location.m_X - range))
@ -10423,6 +10459,7 @@ namespace Server
&& (p.Y >= (m_Location.m_Y - range)) && (p.Y >= (m_Location.m_Y - range))
&& (p.Y <= (m_Location.m_Y + range)); && (p.Y <= (m_Location.m_Y + range));
} }
#endregion
public void InitStats( int str, int dex, int intel ) public void InitStats( int str, int dex, int intel )
{ {
@ -10446,6 +10483,8 @@ namespace Server
public static bool DisableDismountInWarmode { get { return m_DisableDismountInWarmode; } set { m_DisableDismountInWarmode = value; } } public static bool DisableDismountInWarmode { get { return m_DisableDismountInWarmode; } set { m_DisableDismountInWarmode = value; } }
#region OnDoubleClick[..]
/// <summary> /// <summary>
/// Overridable. Event invoked when the Mobile is double clicked. By default, this method can either dismount or open the paperdoll. /// Overridable. Event invoked when the Mobile is double clicked. By default, this method can either dismount or open the paperdoll.
/// <seealso cref="CanPaperdollBeOpenedBy" /> /// <seealso cref="CanPaperdollBeOpenedBy" />
@ -10494,6 +10533,8 @@ namespace Server
DisplayPaperdollTo( from ); DisplayPaperdollTo( from );
} }
#endregion
/// <summary> /// <summary>
/// Overridable. Event invoked when the Mobile requests to open his own paperdoll via the 'Open Paperdoll' macro. /// Overridable. Event invoked when the Mobile requests to open his own paperdoll via the 'Open Paperdoll' macro.
/// </summary> /// </summary>