This commit is contained in:
mark 2012-11-10 20:06:36 +00:00
parent 8ff1a903a0
commit 14873aaa3e
78 changed files with 360 additions and 231 deletions

View file

@ -81,6 +81,9 @@ namespace Server.Commands
public Item Construct() public Item Construct()
{ {
if ( m_Type == null )
return null;
Item item; Item item;
try try

View file

@ -78,6 +78,9 @@ namespace Server.Commands
public Item Construct() public Item Construct()
{ {
if ( m_Type == null )
return null;
Item item; Item item;
try try

View file

@ -3,6 +3,7 @@ using System.Collections;
using Server; using Server;
using Server.Items; using Server.Items;
using System.Collections.Generic; using System.Collections.Generic;
using Server.Mobiles;
namespace Server.Engines.BulkOrders namespace Server.Engines.BulkOrders
{ {
@ -117,9 +118,19 @@ namespace Server.Engines.BulkOrders
list.Add( 1060658 + i, "#{0}\t{1}", m_Entries[i].Details.Number, m_Entries[i].Amount ); // ~1_val~: ~2_val~ list.Add( 1060658 + i, "#{0}\t{1}", m_Entries[i].Details.Number, m_Entries[i].Amount ); // ~1_val~: ~2_val~
} }
public override void OnDoubleClickNotAccessible( Mobile from )
{
OnDoubleClick( from );
}
public override void OnDoubleClickSecureTrade( Mobile from )
{
OnDoubleClick( from );
}
public override void OnDoubleClick( Mobile from ) public override void OnDoubleClick( Mobile from )
{ {
if ( IsChildOf( from.Backpack ) ) if ( IsChildOf( from.Backpack ) || InSecureTrade || RootParent is PlayerVendor )
from.SendGump( new LargeBODGump( from, this ) ); from.SendGump( new LargeBODGump( from, this ) );
else else
from.SendLocalizedMessage( 1045156 ); // You must have the deed in your backpack to use it. from.SendLocalizedMessage( 1045156 ); // You must have the deed in your backpack to use it.

View file

@ -3,6 +3,7 @@ using System.Collections;
using Server; using Server;
using Server.Items; using Server.Items;
using System.Collections.Generic; using System.Collections.Generic;
using Server.Mobiles;
namespace Server.Engines.BulkOrders namespace Server.Engines.BulkOrders
{ {
@ -96,12 +97,22 @@ namespace Server.Engines.BulkOrders
public override void OnDoubleClick( Mobile from ) public override void OnDoubleClick( Mobile from )
{ {
if ( IsChildOf( from.Backpack ) ) if ( IsChildOf( from.Backpack ) || InSecureTrade || RootParent is PlayerVendor )
from.SendGump( new SmallBODGump( from, this ) ); from.SendGump( new SmallBODGump( from, this ) );
else else
from.SendLocalizedMessage( 1045156 ); // You must have the deed in your backpack to use it. from.SendLocalizedMessage( 1045156 ); // You must have the deed in your backpack to use it.
} }
public override void OnDoubleClickNotAccessible( Mobile from )
{
OnDoubleClick( from );
}
public override void OnDoubleClickSecureTrade( Mobile from )
{
OnDoubleClick( from );
}
public void BeginCombine( Mobile from ) public void BeginCombine( Mobile from )
{ {
if ( m_AmountCur < m_AmountMax ) if ( m_AmountCur < m_AmountMax )

View file

@ -1682,6 +1682,8 @@ namespace Server.Engines.ConPVP
mob.MeleeDamageAbsorb = 0; mob.MeleeDamageAbsorb = 0;
Spells.Second.ProtectionSpell.Registry.Remove( mob ); Spells.Second.ProtectionSpell.Registry.Remove( mob );
Spells.Fourth.ArchProtectionSpell.RemoveEntry( mob );
mob.EndAction( typeof( DefensiveSpell ) ); mob.EndAction( typeof( DefensiveSpell ) );
} }

View file

@ -81,7 +81,6 @@ namespace Server.Engines.Craft
m_Recipe = new Recipe( id, system, this ); m_Recipe = new Recipe( id, system, this );
} }
private static Dictionary<Type, int> _itemIds = new Dictionary<Type, int>(); private static Dictionary<Type, int> _itemIds = new Dictionary<Type, int>();
public static int ItemIDOf( Type type ) { public static int ItemIDOf( Type type ) {
@ -396,11 +395,6 @@ namespace Server.Engines.Craft
public bool RetainsColorFrom( CraftSystem system, Type type ) public bool RetainsColorFrom( CraftSystem system, Type type )
{ {
if (DefTailoring.IsNonColorable(m_Type))
{
return false;
}
if ( system.RetainsColorFrom( this, type ) ) if ( system.RetainsColorFrom( this, type ) )
return true; return true;

View file

@ -316,6 +316,10 @@ namespace Server.Engines.Craft
{ {
number = 1044275; // The item must be in your backpack to repair it. number = 1044275; // The item must be in your backpack to repair it.
} }
else if ( !Core.AOS && weapon.PoisonCharges != 0 )
{
number = 1005012; // You cannot repair an item while a caustic substance is on it.
}
else if ( weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints ) else if ( weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints )
{ {
number = 1044281; // That item is in full repair number = 1044281; // That item is in full repair

View file

@ -48,6 +48,10 @@ namespace Server.Engines.Craft
{ {
try try
{ {
if ( Ethics.Ethic.IsImbued( item ) )
return SmeltResult.Invalid;
if ( CraftResources.GetType( resource ) != CraftResourceType.Metal ) if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
return SmeltResult.Invalid; return SmeltResult.Invalid;

View file

@ -231,7 +231,6 @@ namespace Server.Engines.Craft
if( Core.SE ) if( Core.SE )
{ {
index = AddCraft( typeof( PlateMempo ), 1011078, 1030180, 80.0, 130.0, typeof( IronIngot ), 1044036, 18, 1044037 ); index = AddCraft( typeof( PlateMempo ), 1011078, 1030180, 80.0, 130.0, typeof( IronIngot ), 1044036, 18, 1044037 );
SetNeededExpansion( index, Expansion.SE ); SetNeededExpansion( index, Expansion.SE );

View file

@ -49,24 +49,6 @@ namespace Server.Engines.Craft
return 0; return 0;
} }
public static bool IsNonColorable(Type type)
{
for (int i = 0; i < m_TailorNonColorables.Length; ++i)
{
if (m_TailorNonColorables[i] == type)
{
return true;
}
}
return false;
}
private static Type[] m_TailorNonColorables = new Type[]
{
typeof( OrcHelm )
};
private static Type[] m_TailorColorables = new Type[] private static Type[] m_TailorColorables = new Type[]
{ {
typeof( GozaMatEastDeed ), typeof( GozaMatSouthDeed ), typeof( GozaMatEastDeed ), typeof( GozaMatSouthDeed ),

View file

@ -209,7 +209,6 @@ namespace Server.Engines.Craft
AddRes( index, typeof( Ruby ), 1044234, 1, 1044253 ); AddRes( index, typeof( Ruby ), 1044234, 1, 1044253 );
SetNeededExpansion( index, Expansion.ML ); SetNeededExpansion( index, Expansion.ML );
} }
#endregion #endregion
#region Utensils #region Utensils
@ -256,7 +255,6 @@ namespace Server.Engines.Craft
index = AddCraft( typeof( FancyWindChimes ), 1044050, 1030291, 80.0, 130.0, typeof( IronIngot ), 1044036, 15, 1044037 ); index = AddCraft( typeof( FancyWindChimes ), 1044050, 1030291, 80.0, 130.0, typeof( IronIngot ), 1044036, 15, 1044037 );
SetNeededExpansion( index, Expansion.SE ); SetNeededExpansion( index, Expansion.SE );
} }
#endregion #endregion

View file

@ -2,6 +2,7 @@ using System;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Mobiles; using Server.Mobiles;
using Server.Multis;
using Server.Network; using Server.Network;
using Server.Targeting; using Server.Targeting;
using System.Collections.Generic; using System.Collections.Generic;
@ -255,6 +256,9 @@ namespace Server.Factions
{ {
m_From.SendLocalizedMessage( 1010306 ); // You currently have too many of this enhancement type to place another m_From.SendLocalizedMessage( 1010306 ); // You currently have too many of this enhancement type to place another
} }
else if ( BaseBoat.FindBoatAt( m_From.Location, m_From.Map ) != null ) {
m_From.SendMessage( "You cannot place a vendor here" );
}
else if ( m_Town.Silver >= vendorList.Definition.Price ) else if ( m_Town.Silver >= vendorList.Definition.Price )
{ {
BaseFactionVendor vendor = vendorList.Construct( m_Town, m_Faction ); BaseFactionVendor vendor = vendorList.Construct( m_Town, m_Faction );

View file

@ -2,6 +2,7 @@ using System;
using Server; using Server;
using Server.Gumps; using Server.Gumps;
using Server.Mobiles; using Server.Mobiles;
using Server.Multis;
using Server.Network; using Server.Network;
using Server.Targeting; using Server.Targeting;
using System.Collections.Generic; using System.Collections.Generic;
@ -157,6 +158,9 @@ namespace Server.Factions
{ {
m_From.SendLocalizedMessage( 1010306 ); // You currently have too many of this enhancement type to place another m_From.SendLocalizedMessage( 1010306 ); // You currently have too many of this enhancement type to place another
} }
else if ( BaseBoat.FindBoatAt( m_From.Location, m_From.Map ) != null ) {
m_From.SendMessage( "You cannot place a guard here" );
}
else if ( m_Town.Silver >= guardList.Definition.Price ) else if ( m_Town.Silver >= guardList.Definition.Price )
{ {
BaseFactionGuard guard = guardList.Construct(); BaseFactionGuard guard = guardList.Construct();

View file

@ -137,6 +137,12 @@ namespace Server.Engines.Harvest
if ( !base.CheckHarvest( from, tool ) ) if ( !base.CheckHarvest( from, tool ) )
return false; return false;
if ( tool.Parent != from )
{
from.SendLocalizedMessage( 500487 ); // The axe must be equipped for any serious wood chopping.
return false;
}
return true; return true;
} }

View file

@ -10,20 +10,20 @@ namespace Server.Engines.MyRunUO
public static bool Enabled = false; public static bool Enabled = false;
// Details required for database connection string // Details required for database connection string
public static string DatabaseDriver = "{MySQL ODBC 3.51 Driver}"; public const string DatabaseDriver = "{MySQL ODBC 3.51 Driver}";
public static string DatabaseServer = "localhost"; public const string DatabaseServer = "localhost";
public static string DatabaseName = "MyRunUO"; public const string DatabaseName = "MyRunUO";
public static string DatabaseUserID = "username"; public const string DatabaseUserID = "username";
public static string DatabasePassword = "password"; public const string DatabasePassword = "password";
// Should the database use transactions? This is recommended // Should the database use transactions? This is recommended
public static bool UseTransactions = true; public const bool UseTransactions = true;
// Use optimized table loading techniques? (LOAD DATA INFILE) // Use optimized table loading techniques? (LOAD DATA INFILE)
public static bool LoadDataInFile = true; public const bool LoadDataInFile = true;
// This must be enabled if the database server is on a remote machine. // This must be enabled if the database server is on a remote machine.
public static bool DatabaseNonLocal = ( DatabaseServer != "localhost" ); public const bool DatabaseNonLocal = ( DatabaseServer != "localhost" );
// Text encoding used // Text encoding used
public static Encoding EncodingIO = Encoding.ASCII; public static Encoding EncodingIO = Encoding.ASCII;

View file

@ -248,7 +248,7 @@ namespace Server.Engines.VeteranRewards
public static int GetRewardYearLabel( Item item, object[] args ) public static int GetRewardYearLabel( Item item, object[] args )
{ {
int level = GetRewardYear( item, args ); int level = GetRewardYear( item, args );
return 1076216 + ( ( level < 10 ) ? level : ( level < 12 ) ? (( level - 9 ) + 4240 ) : (( level - 11 ) + 37585 ) ); return 1076216 + ( ( level < 10 ) ? level : ( level < 12 ) ? (( level - 9 ) + 4240 ) : (( level - 11 ) + 37585 ) );
} }

View file

@ -35,6 +35,7 @@ namespace Server.Gumps
ai.CanReportMurder = false; ai.CanReportMurder = false;
} }
} }
if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) ) if ( ai.Attacker.Player && (DateTime.Now - ai.LastCombatTime) < TimeSpan.FromSeconds( 30.0 ) && !toGive.Contains( ai.Attacker ) )
toGive.Add( ai.Attacker ); toGive.Add( ai.Attacker );
} }

View file

@ -85,7 +85,7 @@ namespace Server.Gumps
} }
else else
{ {
m_Info.Level = level; m_Info.Level = level;
state.Mobile.SendLocalizedMessage( 1061280 ); // New access level set. state.Mobile.SendLocalizedMessage( 1061280 ); // New access level set.
} }
} }

View file

@ -38,7 +38,7 @@ namespace Server.Items
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)
@ -46,9 +46,9 @@ namespace Server.Items
base.Deserialize( reader ); base.Deserialize( reader );
int version = reader.ReadInt(); int version = reader.ReadInt();
if( version == 0 && Weight == 1 ) if( version == 0 && ( Weight == 1 || Weight == 5 ) )
{ {
Weight = 5; Weight = -1;
} }
} }
} }

View file

@ -753,8 +753,8 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
if ( Hue != 0x8A4 ) /*if ( Hue != 0x8A4 )
Hue = 0x8A4; Hue = 0x8A4;*/
} }
} }
@ -813,8 +813,8 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
if ( Hue != 0 && (Hue < 2101 || Hue > 2130) ) /*if ( Hue != 0 && (Hue < 2101 || Hue > 2130) )
Hue = GetRandomHue(); Hue = GetRandomHue();*/
} }
} }

View file

@ -1,7 +1,8 @@
using System; using System;
using Server.Gumps;
using Server.Misc;
using Server.Network; using Server.Network;
using Server.Prompts; using Server.Prompts;
using Server.Items;
namespace Server.Items namespace Server.Items
{ {
@ -15,7 +16,7 @@ namespace Server.Items
[Constructable] [Constructable]
public NameChangeDeed() : base( 0x14F0 ) public NameChangeDeed() : base( 0x14F0 )
{ {
base.Weight = 1.0; LootType = LootType.Blessed;
} }
public NameChangeDeed( Serial serial ) : base( serial ) public NameChangeDeed( Serial serial ) : base( serial )
@ -38,9 +39,91 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from ) public override void OnDoubleClick( Mobile from )
{ {
// Do namechange if ( this.RootParent == from )
{
from.CloseGump( typeof( NameChangeDeedGump ) );
from.SendGump( new NameChangeDeedGump( this ) );
}
else
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
public class NameChangeDeedGump : Gump
{
Item m_Sender;
public void AddBlackAlpha( int x, int y, int width, int height )
{
AddImageTiled( x, y, width, height, 2624 );
AddAlphaRegion( x, y, width, height );
}
public void AddTextField( int x, int y, int width, int height, int index )
{
AddBackground( x - 2, y - 2, width + 4, height + 4, 0x2486 );
AddTextEntry( x + 2, y + 2, width - 4, height - 4, 0, index, "" );
}
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
}
public void AddButtonLabeled( int x, int y, int buttonID, string text )
{
AddButton( x, y - 1, 4005, 4007, buttonID, GumpButtonType.Reply, 0 );
AddHtml( x + 35, y, 240, 20, Color( text, 0xFFFFFF ), false, false );
}
public NameChangeDeedGump( Item sender ) : base( 50, 50 )
{
m_Sender = sender;
Closable=true;
Dragable=true;
Resizable=false;
AddPage(0);
AddBlackAlpha( 10, 120, 250, 85 );
AddHtml( 10, 125, 250, 20, Color( Center( "Name Change Deed" ), 0xFFFFFF ), false, false );
AddLabel( 73, 15, 1152, "" );
AddLabel( 20, 150, 0x480, "New Name:" );
AddTextField( 100, 150, 150, 20, 0 );
AddButtonLabeled( 75, 180, 1, "Submit" );
}
public override void OnResponse( NetState sender, RelayInfo info )
{
if ( m_Sender == null || m_Sender.Deleted || info.ButtonID != 1 || m_Sender.RootParent != sender.Mobile )
return;
Mobile m = sender.Mobile;
TextRelay nameEntry = info.GetTextEntry( 0 );
string newName = ( nameEntry == null ? null : nameEntry.Text.Trim() );
if ( !NameVerification.Validate( newName, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote ) )
{
m.SendMessage( "That name is unacceptable." );
return;
}
else
{
m.RawName = newName;
m.SendMessage( "Your name has been changed!" );
m.SendMessage( String.Format( "You are now known as {0}", newName ) );
m_Sender.Delete();
}
} }
} }
} }

View file

@ -685,7 +685,10 @@ namespace Server.Items
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503019 ); // You successfully decode a treasure map! from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503019 ); // You successfully decode a treasure map!
Decoder = from; Decoder = from;
LootType = LootType.Blessed;
if ( Core.AOS )
LootType = LootType.Blessed;
DisplayTo( from ); DisplayTo( from );
} }
@ -887,10 +890,9 @@ namespace Server.Items
break; break;
} }
} }
if (m_Decoder != null && LootType == LootType.Regular)
{ if ( Core.AOS && m_Decoder != null && LootType == LootType.Regular)
LootType = LootType.Blessed; LootType = LootType.Blessed;
}
} }
} }

View file

@ -52,14 +52,16 @@ namespace Server.Items
{ {
EtherealMount.StopMounting( from ); EtherealMount.StopMounting( from );
Item one = from.FindItemOnLayer( Layer.OneHanded ); if ( Core.AOS ) {
Item two = from.FindItemOnLayer( Layer.TwoHanded ); Item one = from.FindItemOnLayer( Layer.OneHanded );
Item two = from.FindItemOnLayer( Layer.TwoHanded );
if ( one != null ) if ( one != null )
from.AddToBackpack( one ); from.AddToBackpack( one );
if ( two != null ) if ( two != null )
from.AddToBackpack( two ); from.AddToBackpack( two );
}
from.Target = new BolaTarget( this ); from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
@ -143,14 +145,16 @@ namespace Server.Items
{ {
EtherealMount.StopMounting( from ); EtherealMount.StopMounting( from );
Item one = from.FindItemOnLayer( Layer.OneHanded ); if ( Core.AOS ) {
Item two = from.FindItemOnLayer( Layer.TwoHanded ); Item one = from.FindItemOnLayer( Layer.OneHanded );
Item two = from.FindItemOnLayer( Layer.TwoHanded );
if ( one != null ) if ( one != null )
from.AddToBackpack( one ); from.AddToBackpack( one );
if ( two != null ) if ( two != null )
from.AddToBackpack( two ); from.AddToBackpack( two );
}
from.DoHarmful( to ); from.DoHarmful( to );

View file

@ -34,9 +34,6 @@ namespace Server.Items
base.Deserialize( reader ); base.Deserialize( reader );
int version = reader.ReadInt(); int version = reader.ReadInt();
if ( Hue == 0 )
Hue = 0x8AC;
} }
} }
} }

View file

@ -134,13 +134,11 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
} }
public bool Scissor( Mobile from, Scissors scissors ) public bool Scissor( Mobile from, Scissors scissors )
{ {
if ( Deleted || !from.CanSee( this ) ) return false; if ( Deleted || !from.CanSee( this ) ) return false;
if ( !IsChildOf ( from.Backpack ) ) if ( Core.AOS && !IsChildOf ( from.Backpack ) )
{ {
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
return false; return false;
@ -182,13 +180,11 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
} }
public bool Scissor( Mobile from, Scissors scissors ) public bool Scissor( Mobile from, Scissors scissors )
{ {
if ( Deleted || !from.CanSee( this ) ) return false; if ( Deleted || !from.CanSee( this ) ) return false;
if ( !IsChildOf ( from.Backpack ) ) if ( Core.AOS && !IsChildOf ( from.Backpack ) )
{ {
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
return false; return false;
@ -231,13 +227,11 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
} }
public bool Scissor( Mobile from, Scissors scissors ) public bool Scissor( Mobile from, Scissors scissors )
{ {
if ( Deleted || !from.CanSee( this ) ) return false; if ( Deleted || !from.CanSee( this ) ) return false;
if ( !IsChildOf ( from.Backpack ) ) if ( Core.AOS && !IsChildOf ( from.Backpack ) )
{ {
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
return false; return false;
@ -280,13 +274,11 @@ namespace Server.Items
int version = reader.ReadInt(); int version = reader.ReadInt();
} }
public bool Scissor( Mobile from, Scissors scissors ) public bool Scissor( Mobile from, Scissors scissors )
{ {
if ( Deleted || !from.CanSee( this ) ) return false; if ( Deleted || !from.CanSee( this ) ) return false;
if ( !IsChildOf ( from.Backpack ) ) if ( Core.AOS && !IsChildOf ( from.Backpack ) )
{ {
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
return false; return false;

View file

@ -145,40 +145,33 @@ namespace Server.Items
if( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability if( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability
{ {
if( Core.AOS && ArmorAttributes.SelfRepair > Utility.Random( 10 ) ) int wear = Utility.Random( 2 );
{
HitPoints += 2;
}
else
{
int wear = Utility.Random( 2 );
if( wear > 0 && MaxHitPoints > 0 ) if( wear > 0 && MaxHitPoints > 0 )
{
if( HitPoints >= wear )
{ {
if( HitPoints >= wear ) HitPoints -= wear;
wear = 0;
}
else
{
wear -= HitPoints;
HitPoints = 0;
}
if( wear > 0 )
{
if( MaxHitPoints > wear )
{ {
HitPoints -= wear; MaxHitPoints -= wear;
wear = 0;
if( Parent is Mobile )
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
} }
else else
{ {
wear -= HitPoints; Delete();
HitPoints = 0;
}
if( wear > 0 )
{
if( MaxHitPoints > wear )
{
MaxHitPoints -= wear;
if( Parent is Mobile )
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
}
else
{
Delete();
}
} }
} }
} }

View file

@ -3,13 +3,16 @@ using Server;
namespace Server.Items namespace Server.Items
{ {
[Furniture]
[FlipableAttribute( 0x2bd9, 0x2bda )] [FlipableAttribute( 0x2bd9, 0x2bda )]
public class GreenStocking : BaseContainer public class GreenStocking : BaseContainer
{ {
public override int DefaultGumpID{ get{ return 0x103; } }
public override int DefaultDropSound{ get{ return 0x42; } }
[Constructable] [Constructable]
public GreenStocking() : base ( 0x2bd9 ) public GreenStocking() : base ( Utility.Random( 0x2BD9, 2 ) )
{ {
GumpID = 0x103;
} }
public GreenStocking( Serial serial ) : base( serial ) public GreenStocking( Serial serial ) : base( serial )
@ -29,13 +32,16 @@ namespace Server.Items
} }
} }
[Furniture]
[FlipableAttribute( 0x2bdb, 0x2bdc )] [FlipableAttribute( 0x2bdb, 0x2bdc )]
public class RedStocking : BaseContainer public class RedStocking : BaseContainer
{ {
public override int DefaultGumpID{ get{ return 0x103; } }
public override int DefaultDropSound{ get{ return 0x42; } }
[Constructable] [Constructable]
public RedStocking() : base ( 0x2bdb ) public RedStocking() : base ( Utility.Random( 0x2BDB, 2 ) )
{ {
GumpID = 0x103;
} }
public RedStocking( Serial serial ) : base( serial ) public RedStocking( Serial serial ) : base( serial )

View file

@ -5,6 +5,7 @@ using Server;
using Server.Items; using Server.Items;
using Server.Engines.Harvest; using Server.Engines.Harvest;
using Server.ContextMenus; using Server.ContextMenus;
using Server.Network;
namespace Server.Items namespace Server.Items
{ {
@ -80,7 +81,7 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from ) public override void OnDoubleClick( Mobile from )
{ {
if ( HarvestSystem == null ) if ( HarvestSystem == null || Deleted )
return; return;
Point3D loc = GetWorldLocation(); Point3D loc = GetWorldLocation();
@ -90,8 +91,13 @@ namespace Server.Items
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that from.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that
return; return;
} }
else if ( !this.IsAccessibleTo( from ) )
{
this.PublicOverheadMessage( MessageType.Regular, 0x3E9, 1061637 ); // You are not allowed to access this.
return;
}
if ( !( HarvestSystem is Mining ) ) if ( !(this.HarvestSystem is Mining) )
from.SendLocalizedMessage( 1010018 ); // What do you want to use this item on? from.SendLocalizedMessage( 1010018 ); // What do you want to use this item on?
HarvestSystem.BeginHarvesting( from, this ); HarvestSystem.BeginHarvesting( from, this );

View file

@ -1243,6 +1243,10 @@ namespace Server.Items
if ( Core.AOS ) if ( Core.AOS )
return AbsorbDamageAOS( attacker, defender, damage ); return AbsorbDamageAOS( attacker, defender, damage );
BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;
if ( shield != null )
damage = shield.OnHit( this, damage );
double chance = Utility.RandomDouble(); double chance = Utility.RandomDouble();
Item armorItem; Item armorItem;
@ -1265,10 +1269,6 @@ namespace Server.Items
if ( armor != null ) if ( armor != null )
damage = armor.OnHit( this, damage ); damage = armor.OnHit( this, damage );
BaseShield shield = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseShield;
if ( shield != null )
damage = shield.OnHit( this, damage );
int virtualArmor = defender.VirtualArmor + defender.VirtualArmorMod; int virtualArmor = defender.VirtualArmor + defender.VirtualArmorMod;
if ( virtualArmor > 0 ) if ( virtualArmor > 0 )
@ -2345,7 +2345,13 @@ namespace Server.Items
if ( Core.AOS ) if ( Core.AOS )
return ComputeDamageAOS( attacker, defender ); return ComputeDamageAOS( attacker, defender );
return (int)ScaleDamageOld( attacker, GetBaseDamage( attacker ), true ); int damage = (int)ScaleDamageOld( attacker, GetBaseDamage( attacker ), true );
// pre-AOS, halve damage if the defender is a player or the attacker is not a player
if ( defender is PlayerMobile || !( attacker is PlayerMobile ) )
damage = (int)(damage / 2.0);
return damage;
} }
public virtual void PlayHurtAnimation( Mobile from ) public virtual void PlayHurtAnimation( Mobile from )

View file

@ -1054,7 +1054,6 @@ namespace Server.Misc
regs.LootType = LootType.Regular; regs.LootType = LootType.Regular;
EquipItem( new BoneHelm() ); EquipItem( new BoneHelm() );
if ( elf ) if ( elf )
@ -1279,7 +1278,7 @@ namespace Server.Misc
return item; return item;
} }
private static void AddSkillItems( SkillName skill, Mobile m ) private static void AddSkillItems( SkillName skill, Mobile m )
{ {
bool elf = (m.Race == Race.Elf); bool elf = (m.Race == Race.Elf);
@ -1320,14 +1319,12 @@ namespace Server.Misc
} }
else else
{ {
EquipItem( new Robe( Utility.RandomPinkHue() ) ); EquipItem( new Robe( hue ) );
} }
break; break;
} }
case SkillName.AnimalLore: case SkillName.AnimalLore:
{ {
int hue = Utility.RandomBlueHue(); int hue = Utility.RandomBlueHue();
if ( elf ) if ( elf )
@ -1483,7 +1480,7 @@ namespace Server.Misc
} }
else else
{ {
EquipItem( new FloppyHat( Utility.RandomYellowHue() ) ); EquipItem( new FloppyHat( hue ) );
} }
break; break;

View file

@ -97,7 +97,8 @@ namespace Server.Items
} }
} }
Utility.Intern( ref m_Dipper ); if ( m_Dipper != null )
m_Dipper = String.Intern( m_Dipper );
} }
} }
} }

View file

@ -61,7 +61,7 @@ namespace Server.Misc
{ {
Mobile from = e.Mobile; Mobile from = e.Mobile;
if ( !from.Alive || from.AccessLevel > AccessLevel.Player ) if ( !from.Alive || from.AccessLevel > AccessLevel.Player )
return; return;
if ( !from.Player ) if ( !from.Player )

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using Server; using Server;
using Server.Items; using Server.Items;
using Server.Targeting; using Server.Targeting;
@ -904,7 +905,7 @@ namespace Server.Mobiles
public virtual bool DoActionCombat() public virtual bool DoActionCombat()
{ {
if ( CheckHerding() ) if ( Core.AOS && CheckHerding() )
{ {
m_Mobile.DebugSay( "Praise the shepherd!" ); m_Mobile.DebugSay( "Praise the shepherd!" );
} }
@ -923,7 +924,7 @@ namespace Server.Mobiles
public virtual bool DoActionGuard() public virtual bool DoActionGuard()
{ {
if ( CheckHerding() ) if ( Core.AOS && CheckHerding() )
{ {
m_Mobile.DebugSay( "Praise the shepherd!" ); m_Mobile.DebugSay( "Praise the shepherd!" );
} }
@ -1298,7 +1299,8 @@ namespace Server.Mobiles
else else
{ {
m_Mobile.Warmode = false; m_Mobile.Warmode = false;
m_Mobile.CurrentSpeed = 0.1; if ( Core.AOS )
m_Mobile.CurrentSpeed = 0.1;
} }
} }
} }
@ -1467,7 +1469,8 @@ namespace Server.Mobiles
m_Mobile.DebugSay( "Nothing to guard from" ); m_Mobile.DebugSay( "Nothing to guard from" );
m_Mobile.Warmode = false; m_Mobile.Warmode = false;
m_Mobile.CurrentSpeed = 0.1; if ( Core.AOS )
m_Mobile.CurrentSpeed = 0.1;
WalkMobileRange( controlMaster, 1, false, 0, 1 ); WalkMobileRange( controlMaster, 1, false, 0, 1 );
} }
@ -1484,8 +1487,13 @@ namespace Server.Mobiles
{ {
m_Mobile.DebugSay( "I think he might be dead. He's not anywhere around here at least. That's cool. I'm glad he's dead." ); m_Mobile.DebugSay( "I think he might be dead. He's not anywhere around here at least. That's cool. I'm glad he's dead." );
m_Mobile.ControlTarget = m_Mobile.ControlMaster; if ( Core.AOS ) {
m_Mobile.ControlOrder = OrderType.Follow; m_Mobile.ControlTarget = m_Mobile.ControlMaster;
m_Mobile.ControlOrder = OrderType.Follow;
} else {
m_Mobile.ControlTarget = null;
m_Mobile.ControlOrder = OrderType.None;
}
if( m_Mobile.FightMode == FightMode.Closest || m_Mobile.FightMode == FightMode.Aggressor ) if( m_Mobile.FightMode == FightMode.Closest || m_Mobile.FightMode == FightMode.Aggressor )
{ {
@ -1975,6 +1983,14 @@ namespace Server.Mobiles
if( delay < 0.0 ) if( delay < 0.0 )
delay = 0.0; delay = 0.0;
if ( double.IsNaN( delay ) ) {
using( StreamWriter op = new StreamWriter( "nan_transform.txt", true ) ) {
op.WriteLine( String.Format( "NaN in TransformMoveDelay: {0}, {1}, {2}, {3}", DateTime.Now, this.GetType().ToString(), m_Mobile == null ? "null" : m_Mobile.GetType().ToString(), m_Mobile.HitsMax ) );
}
return 1.0;
}
return delay; return delay;
} }
@ -2542,7 +2558,7 @@ namespace Server.Mobiles
if( m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null ) if( m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null )
bValid = ( ((BaseCreature)m).ControlMaster.Karma < 0 ); bValid = ( ((BaseCreature)m).ControlMaster.Karma < 0 );
else else
bValid = ( m.Karma < 0 ); bValid = ( (Core.AOS || m.Player) && m.Karma < 0 );
} }
if ( !bValid ) if ( !bValid )

View file

@ -41,7 +41,7 @@ namespace Server.Mobiles
public virtual bool IsNecromancer public virtual bool IsNecromancer
{ {
get { return ( m_Mobile.Skills[ SkillName.Necromancy ].Value > 50 ); } get { return ( Core.AOS && m_Mobile.Skills[ SkillName.Necromancy ].Value > 50 ); }
} }
private const double HealChance = 0.10; // 10% chance to heal at gm magery private const double HealChance = 0.10; // 10% chance to heal at gm magery
@ -385,7 +385,7 @@ namespace Server.Mobiles
} }
case 5: // Paralyze them case 5: // Paralyze them
{ {
if (m_Mobile.Skills[ SkillName.Magery ].Value <= 50.0) if (c.Paralyzed || m_Mobile.Skills[ SkillName.Magery ].Value <= 50.0)
goto default; goto default;
m_Mobile.DebugSay( "Attempting to paralyze" ); m_Mobile.DebugSay( "Attempting to paralyze" );

View file

@ -142,7 +142,7 @@ namespace Server
typeof( FactionHenchman ), typeof( FactionMercenary ), typeof( FactionNecromancer ), typeof( FactionHenchman ), typeof( FactionMercenary ), typeof( FactionNecromancer ),
typeof( FactionSorceress ), typeof( FactionWizard ), typeof( FactionBerserker ), typeof( FactionSorceress ), typeof( FactionWizard ), typeof( FactionBerserker ),
typeof( FactionPaladin ), typeof( Leviathan ), typeof( FireBeetle ), typeof( FactionPaladin ), typeof( Leviathan ), typeof( FireBeetle ),
typeof( FanDancer ) typeof( FanDancer ), typeof( FactionDeathKnight )
} ), } ),
/* Medium */ /* Medium */
new SpeedInfo( 0.25, 0.5, new Type[] new SpeedInfo( 0.25, 0.5, new Type[]

View file

@ -187,8 +187,8 @@ namespace Server.Mobiles
if ( Core.AOS ) if ( Core.AOS )
return; return;
//if ( animal.IsBonded || animal.IsDeadPet ) if ( animal.IsBonded || animal.IsDeadPet )
// return; return;
Container pack = animal.Backpack; Container pack = animal.Backpack;

View file

@ -97,7 +97,7 @@ namespace Server.Mobiles
while ( spirtsOrVortexes.Count > 6 ) while ( spirtsOrVortexes.Count > 6 )
{ {
int index = Utility.Random( spirtsOrVortexes.Count ); int index = Utility.Random( spirtsOrVortexes.Count );
//TODO: Confim if it's the dispel with all the pretty effects or just a Deletion of it. //TODO: Confirm if it's the dispel with all the pretty effects or just a deletion of it.
Dispel( ( (Mobile) spirtsOrVortexes[index] ) ); Dispel( ( (Mobile) spirtsOrVortexes[index] ) );
spirtsOrVortexes.RemoveAt( index ); spirtsOrVortexes.RemoveAt( index );
} }

View file

@ -8,9 +8,9 @@ namespace Server.Mobiles
public class WhiteWyrm : BaseCreature public class WhiteWyrm : BaseCreature
{ {
[Constructable] [Constructable]
public WhiteWyrm () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 ) public WhiteWyrm() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{ {
Body = (Utility.Random(1,2)==1) ? 180 : 49; Body = Utility.RandomBool() ? 180 : 49;
Name = "a white wyrm"; Name = "a white wyrm";
BaseSoundID = 362; BaseSoundID = 362;
@ -80,9 +80,6 @@ namespace Server.Mobiles
{ {
base.Deserialize( reader ); base.Deserialize( reader );
int version = reader.ReadInt(); int version = reader.ReadInt();
if ( Core.AOS && Body == 49 )
Body = 180;
} }
} }
} }

View file

@ -205,7 +205,10 @@ namespace Server.Mobiles
{ {
base.InitBody(); base.InitBody();
Hue = 0x83F4; // hue is not random if ( BodyValue == 0x340 || BodyValue == 0x402 )
Hue = 0;
else
Hue = 0x83F4; // hue is not random
Container pack = this.Backpack; Container pack = this.Backpack;
@ -971,14 +974,16 @@ namespace Server.Mobiles
AddButton( 130, 120, 4005, 4007, GetButtonID( 5, 0 ), GumpButtonType.Reply, 0 ); AddButton( 130, 120, 4005, 4007, GetButtonID( 5, 0 ), GumpButtonType.Reply, 0 );
AddHtml( 170, 120, 120, 20, "Title", false, false ); AddHtml( 170, 120, 120, 20, "Title", false, false );
AddButton( 130, 200, 4005, 4007, GetButtonID( 5, 1 ), GumpButtonType.Reply, 0 ); if ( m_Barkeeper.BodyValue != 0x340 && m_Barkeeper.BodyValue != 0x402 ) {
AddHtml( 170, 200, 120, 20, "Appearance", false, false ); AddButton( 130, 200, 4005, 4007, GetButtonID( 5, 1 ), GumpButtonType.Reply, 0 );
AddHtml( 170, 200, 120, 20, "Appearance", false, false );
AddButton( 130, 280, 4005, 4007, GetButtonID( 5, 2 ), GumpButtonType.Reply, 0 ); AddButton( 130, 280, 4005, 4007, GetButtonID( 5, 2 ), GumpButtonType.Reply, 0 );
AddHtml( 170, 280, 120, 20, "Male / Female", false, false ); AddHtml( 170, 280, 120, 20, "Male / Female", false, false );
AddButton( 338, 437, 4014, 4016, 0, GumpButtonType.Page, 1 ); AddButton( 338, 437, 4014, 4016, 0, GumpButtonType.Page, 1 );
AddHtml( 290, 440, 35, 40, "Back", false, false ); AddHtml( 290, 440, 35, 40, "Back", false, false );
}
AddItem( 580, 44, 4033 ); AddItem( 580, 44, 4033 );
} }

View file

@ -44,7 +44,6 @@ namespace Server.Mobiles
Add( typeof( LeatherLegs ), 40 ); Add( typeof( LeatherLegs ), 40 );
Add( typeof( LeatherCap ), 5 ); Add( typeof( LeatherCap ), 5 );
Add( typeof( FemaleLeatherChest ), 18 ); Add( typeof( FemaleLeatherChest ), 18 );
Add( typeof( FemaleStuddedChest ), 25 ); Add( typeof( FemaleStuddedChest ), 25 );
Add( typeof( LeatherShorts ), 14 ); Add( typeof( LeatherShorts ), 14 );

View file

@ -26,7 +26,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( HeaterShield ), 231, 20, 0x1B76, 0 ) ); Add( new GenericBuyInfo( typeof( HeaterShield ), 231, 20, 0x1B76, 0 ) );
Add( new GenericBuyInfo( typeof( WoodenKiteShield ), 70, 20, 0x1B78, 0 ) ); Add( new GenericBuyInfo( typeof( WoodenKiteShield ), 70, 20, 0x1B78, 0 ) );
Add( new GenericBuyInfo( typeof( MetalShield ), 121, 20, 0x1B7B, 0 ) ); Add( new GenericBuyInfo( typeof( MetalShield ), 121, 20, 0x1B7B, 0 ) );
} }
} }

View file

@ -25,7 +25,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( PlateLegs ), 218, 20, 0x1411, 0 ) ); Add( new GenericBuyInfo( typeof( PlateLegs ), 218, 20, 0x1411, 0 ) );
Add( new GenericBuyInfo( typeof( PlateArms ), 188, 20, 0x1410, 0 ) ); Add( new GenericBuyInfo( typeof( PlateArms ), 188, 20, 0x1410, 0 ) );
Add( new GenericBuyInfo( typeof( PlateGloves ), 155, 20, 0x1414, 0 ) ); Add( new GenericBuyInfo( typeof( PlateGloves ), 155, 20, 0x1414, 0 ) );
} }
} }

View file

@ -26,7 +26,7 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( LesserHealPotion ), 15, 10, 0xF0C, 0 ) ); Add( new GenericBuyInfo( typeof( LesserHealPotion ), 15, 10, 0xF0C, 0 ) );
Add( new GenericBuyInfo( typeof( StrengthPotion ), 15, 10, 0xF09, 0 ) ); Add( new GenericBuyInfo( typeof( StrengthPotion ), 15, 10, 0xF09, 0 ) );
Add( new GenericBuyInfo( typeof( LesserPoisonPotion ), 15, 10, 0xF0A, 0 ) ); Add( new GenericBuyInfo( typeof( LesserPoisonPotion ), 15, 10, 0xF0A, 0 ) );
Add( new GenericBuyInfo( typeof( LesserCurePotion ), 15, 10, 0xF07, 0 ) ); Add( new GenericBuyInfo( typeof( LesserCurePotion ), 15, 10, 0xF07, 0 ) );
Add( new GenericBuyInfo( typeof( LesserExplosionPotion ), 21, 10, 0xF0D, 0 ) ); Add( new GenericBuyInfo( typeof( LesserExplosionPotion ), 21, 10, 0xF0D, 0 ) );
Add( new GenericBuyInfo( typeof( MortarPestle ), 8, 10, 0xE9B, 0 ) ); Add( new GenericBuyInfo( typeof( MortarPestle ), 8, 10, 0xE9B, 0 ) );
@ -43,10 +43,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( HeatingStand ), 2, 100, 0x1849, 0 ) ); Add( new GenericBuyInfo( typeof( HeatingStand ), 2, 100, 0x1849, 0 ) );
Add( new GenericBuyInfo( "1041060", typeof( HairDye ), 37, 10, 0xEFF, 0 ) ); Add( new GenericBuyInfo( "1041060", typeof( HairDye ), 37, 10, 0xEFF, 0 ) );
Add( new GenericBuyInfo( typeof( HeatingStand ), 2, 100, 0x1849, 0 ) ); // This is on OSI :-P
} }
} }

View file

@ -27,7 +27,7 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( Muffins ), 3, 20, 0x9EA, 0 ) ); Add( new GenericBuyInfo( typeof( Muffins ), 3, 20, 0x9EA, 0 ) );
Add( new GenericBuyInfo( typeof( SackFlour ), 3, 20, 0x1039, 0 ) ); Add( new GenericBuyInfo( typeof( SackFlour ), 3, 20, 0x1039, 0 ) );
Add( new GenericBuyInfo( typeof( FrenchBread ), 5, 20, 0x98C, 0 ) ); Add( new GenericBuyInfo( typeof( FrenchBread ), 5, 20, 0x98C, 0 ) );
Add( new GenericBuyInfo( typeof( Cookies ), 3, 20, 0x160b, 0 ) ); Add( new GenericBuyInfo( typeof( Cookies ), 3, 20, 0x160b, 0 ) );
Add( new GenericBuyInfo( typeof( CheesePizza ), 8, 10, 0x1040, 0 ) ); // OSI just has Pizza Add( new GenericBuyInfo( typeof( CheesePizza ), 8, 10, 0x1040, 0 ) ); // OSI just has Pizza
Add( new GenericBuyInfo( typeof( JarHoney ), 3, 20, 0x9ec, 0 ) ); Add( new GenericBuyInfo( typeof( JarHoney ), 3, 20, 0x9ec, 0 ) );
Add (new GenericBuyInfo( typeof( BowlFlour ), 7, 20, 0xA1E, 0 ) ); Add (new GenericBuyInfo( typeof( BowlFlour ), 7, 20, 0xA1E, 0 ) );

View file

@ -24,7 +24,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( Tambourine ), 21, ( 10 ), 0x0E9E, 0 ) ); Add( new GenericBuyInfo( typeof( Tambourine ), 21, ( 10 ), 0x0E9E, 0 ) );
Add( new GenericBuyInfo( typeof( LapHarp ), 21, ( 10 ), 0x0EB2, 0 ) ); Add( new GenericBuyInfo( typeof( LapHarp ), 21, ( 10 ), 0x0EB2, 0 ) );
Add( new GenericBuyInfo( typeof( Lute ), 21, ( 10 ), 0x0EB3, 0 ) ); Add( new GenericBuyInfo( typeof( Lute ), 21, ( 10 ), 0x0EB3, 0 ) );
} }
} }

View file

@ -30,15 +30,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( ButcherKnife ), 13, 20, 0x13F6, 0 ) ); Add( new GenericBuyInfo( typeof( ButcherKnife ), 13, 20, 0x13F6, 0 ) );
Add( new GenericBuyInfo( typeof( Cleaver ), 13, 20, 0xEC3, 0 ) ); Add( new GenericBuyInfo( typeof( Cleaver ), 13, 20, 0xEC3, 0 ) );
Add( new GenericBuyInfo( typeof( SkinningKnife ), 13, 20, 0xEC4, 0 ) ); Add( new GenericBuyInfo( typeof( SkinningKnife ), 13, 20, 0xEC4, 0 ) );
} }
} }

View file

@ -27,7 +27,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( Bloodmoss ), 5, 20, 0xF7B, 0 ) ); Add( new GenericBuyInfo( typeof( Bloodmoss ), 5, 20, 0xF7B, 0 ) );
Add( new GenericBuyInfo( typeof( MortarPestle ), 8, 20, 0xE9B, 0 ) ); Add( new GenericBuyInfo( typeof( MortarPestle ), 8, 20, 0xE9B, 0 ) );
Add( new GenericBuyInfo( typeof( Bottle ), 5, 20, 0xF0E, 0 ) ); Add( new GenericBuyInfo( typeof( Bottle ), 5, 20, 0xF0E, 0 ) );
} }
} }

View file

@ -20,7 +20,7 @@ namespace Server.Mobiles
{ {
public InternalBuyInfo() public InternalBuyInfo()
{ {
Add( new GenericBuyInfo( typeof( MonkRobe ), 136, 20, 0x2687, 0x21E ) ); if ( Core.AOS ) Add( new GenericBuyInfo( typeof( MonkRobe ), 136, 20, 0x2687, 0x21E ) );
} }
} }

View file

@ -20,7 +20,6 @@ namespace Server.Mobiles
{ {
public InternalBuyInfo() public InternalBuyInfo()
{ {
Add( new GenericBuyInfo( typeof( SewingKit ), 3, 20, 0xF9D, 0 ) ); Add( new GenericBuyInfo( typeof( SewingKit ), 3, 20, 0xF9D, 0 ) );
Add( new GenericBuyInfo( typeof( Scissors ), 11, 20, 0xF9F, 0 ) ); Add( new GenericBuyInfo( typeof( Scissors ), 11, 20, 0xF9F, 0 ) );
Add( new GenericBuyInfo( typeof( DyeTub ), 8, 20, 0xFAB, 0 ) ); Add( new GenericBuyInfo( typeof( DyeTub ), 8, 20, 0xFAB, 0 ) );

View file

@ -51,7 +51,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( SkinningKnife ), 15, 20, 0xEC4, 0 ) ); Add( new GenericBuyInfo( typeof( SkinningKnife ), 15, 20, 0xEC4, 0 ) );
Add( new GenericBuyInfo( "1041279", typeof( TaxidermyKit ), 100000, 20, 0x1EBA, 0 ) ); Add( new GenericBuyInfo( "1041279", typeof( TaxidermyKit ), 100000, 20, 0x1EBA, 0 ) );
} }
} }

View file

@ -20,7 +20,6 @@ namespace Server.Mobiles
{ {
public InternalBuyInfo() public InternalBuyInfo()
{ {
Add( new GenericBuyInfo( typeof( Clock ), 22, 20, 0x104B, 0 ) ); Add( new GenericBuyInfo( typeof( Clock ), 22, 20, 0x104B, 0 ) );
Add( new GenericBuyInfo( typeof( Nails ), 3, 20, 0x102E, 0 ) ); Add( new GenericBuyInfo( typeof( Nails ), 3, 20, 0x102E, 0 ) );
Add( new GenericBuyInfo( typeof( ClockParts ), 3, 20, 0x104F, 0 ) ); Add( new GenericBuyInfo( typeof( ClockParts ), 3, 20, 0x104F, 0 ) );
@ -75,7 +74,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( Tambourine ), 21, 20, 0x0E9E, 0 ) ); Add( new GenericBuyInfo( typeof( Tambourine ), 21, 20, 0x0E9E, 0 ) );
Add( new GenericBuyInfo( typeof( LapHarp ), 21, 20, 0x0EB2, 0 ) ); Add( new GenericBuyInfo( typeof( LapHarp ), 21, 20, 0x0EB2, 0 ) );
Add( new GenericBuyInfo( typeof( Lute ), 21, 20, 0x0EB3, 0 ) ); Add( new GenericBuyInfo( typeof( Lute ), 21, 20, 0x0EB3, 0 ) );
} }
} }

View file

@ -40,10 +40,6 @@ namespace Server.Mobiles
Add( new GenericBuyInfo( typeof( Tourmaline ), 75, 20, 0xF2D, 0 ) ); Add( new GenericBuyInfo( typeof( Tourmaline ), 75, 20, 0xF2D, 0 ) );
Add( new GenericBuyInfo( typeof( Amber ), 50, 20, 0xF25, 0 ) ); Add( new GenericBuyInfo( typeof( Amber ), 50, 20, 0xF25, 0 ) );
Add( new GenericBuyInfo( typeof( Diamond ), 200, 20, 0xF26, 0 ) ); Add( new GenericBuyInfo( typeof( Diamond ), 200, 20, 0xF26, 0 ) );
Add( new GenericBuyInfo( typeof( Board ), 3, 20, 0x1BD7, 0 ) );
Add( new GenericBuyInfo( typeof( IronIngot ), 6, 20, 0x1BF2, 0 ) );
} }
} }

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Collections; using System.Collections;
using Server; using Server;
using Server.Factions;
using Server.Multis; using Server.Multis;
namespace Server.Items namespace Server.Items
@ -140,6 +141,9 @@ namespace Server.Items
{ {
if ( IsOpen ) if ( IsOpen )
{ {
if ( from is BaseFactionGuard )
return false;
if ( (from.Direction & Direction.Running) != 0 || (m_Boat != null && !m_Boat.Contains( from )) ) if ( (from.Direction & Direction.Running) != 0 || (m_Boat != null && !m_Boat.Contains( from )) )
return true; return true;

View file

@ -9,6 +9,7 @@ using Server.Gumps;
using Server.Items; using Server.Items;
using Server.Mobiles; using Server.Mobiles;
using Server.Network; using Server.Network;
using Server.Spells;
using Server.Targeting; using Server.Targeting;
namespace Server.Multis namespace Server.Multis
@ -646,8 +647,12 @@ namespace Server.Multis
public void BeginCustomize( Mobile m ) public void BeginCustomize( Mobile m )
{ {
if( !m.CheckAlive() ) if( !m.CheckAlive() ) {
return; return;
} else if ( SpellHelper.CheckCombat( m, true ) ) {
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return;
}
RelocateEntities(); RelocateEntities();

View file

@ -267,7 +267,6 @@ namespace Server.Regions
if ( !m_House.IsInside( from ) || !m_House.IsActive ) if ( !m_House.IsInside( from ) || !m_House.IsActive )
return; return;
else if ( e.HasKeyword( 0x33 ) ) // remove thyself else if ( e.HasKeyword( 0x33 ) ) // remove thyself
{ {
if ( isFriend ) if ( isFriend )

View file

@ -74,7 +74,7 @@ namespace Server.SkillHandlers
{ {
bc.HitsMaxSeed = (int)Math.Max( 1, bc.HitsMaxSeed * scalar ); bc.HitsMaxSeed = (int)Math.Max( 1, bc.HitsMaxSeed * scalar );
bc.Hits = bc.Hits; bc.Hits = bc.Hits;
} }
if ( bc.StamMaxSeed > 0 ) if ( bc.StamMaxSeed > 0 )
{ {

View file

@ -65,7 +65,7 @@ namespace Server.SkillHandlers
else else
number = 500402; // You are too far away to beg from her. number = 500402; // You are too far away to beg from her.
} }
else if (!( Core.ML ) && from.Mounted ) // If we're on a mount, who would give us money? TODO: guessed it's removed since ML else if ( !Core.ML && from.Mounted ) // If we're on a mount, who would give us money? TODO: guessed it's removed since ML
{ {
number = 500404; // They seem unwilling to give you any money. number = 500404; // They seem unwilling to give you any money.
} }

View file

@ -56,7 +56,7 @@ namespace Server.SkillHandlers
} }
else if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) ) else if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
{ {
from.SendMessage( "You may not peacemake here." ); from.SendMessage( "You may not peacemake in this area." );
} }
else if ( ((Mobile)targeted).Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) ) else if ( ((Mobile)targeted).Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
{ {

View file

@ -90,7 +90,9 @@ namespace Server.Spells.Fourth
{ {
Caster.DoBeneficial( m ); Caster.DoBeneficial( m );
m.VirtualArmorMod += val; m.VirtualArmorMod += val;
new InternalTimer( m, Caster, val ).Start();
AddEntry( m, val );
new InternalTimer( m, Caster ).Start();
m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist ); m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
m.PlaySound( 0x1F7 ); m.PlaySound( 0x1F7 );
@ -103,12 +105,30 @@ namespace Server.Spells.Fourth
FinishSequence(); FinishSequence();
} }
private static Dictionary<Mobile, Int32> _Table = new Dictionary<Mobile, Int32>();
private static void AddEntry( Mobile m, Int32 v )
{
_Table[m] = v;
}
public static void RemoveEntry( Mobile m )
{
if ( _Table.ContainsKey( m ) ) {
int v = _Table[m];
_Table.Remove( m );
m.EndAction( typeof( ArchProtectionSpell ) );
m.VirtualArmorMod -= v;
if ( m.VirtualArmorMod < 0 )
m.VirtualArmorMod = 0;
}
}
private class InternalTimer : Timer private class InternalTimer : Timer
{ {
private Mobile m_Owner; private Mobile m_Owner;
private int m_Val;
public InternalTimer( Mobile target, Mobile caster, int val ) : base( TimeSpan.FromSeconds( 0 ) ) public InternalTimer( Mobile target, Mobile caster ) : base( TimeSpan.FromSeconds( 0 ) )
{ {
double time = caster.Skills[SkillName.Magery].Value * 1.2; double time = caster.Skills[SkillName.Magery].Value * 1.2;
if ( time > 144 ) if ( time > 144 )
@ -117,15 +137,11 @@ namespace Server.Spells.Fourth
Priority = TimerPriority.OneSecond; Priority = TimerPriority.OneSecond;
m_Owner = target; m_Owner = target;
m_Val = val;
} }
protected override void OnTick() protected override void OnTick()
{ {
m_Owner.EndAction( typeof( ArchProtectionSpell ) ); ArchProtectionSpell.RemoveEntry( m_Owner );
m_Owner.VirtualArmorMod -= m_Val;
if ( m_Owner.VirtualArmorMod < 0 )
m_Owner.VirtualArmorMod = 0;
} }
} }