This commit is contained in:
parent
8ff1a903a0
commit
14873aaa3e
78 changed files with 360 additions and 231 deletions
|
|
@ -23,7 +23,7 @@ namespace Server.Items
|
|||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Leather; } }
|
||||
public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }
|
||||
|
||||
|
||||
public override ArmorMeditationAllowance DefMedAllowance{ get{ return ArmorMeditationAllowance.None; } }
|
||||
|
||||
[Constructable]
|
||||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
writer.Write( (int) 1 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
|
|
@ -46,9 +46,9 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Weight == 1 )
|
||||
if( version == 0 && ( Weight == 1 || Weight == 5 ) )
|
||||
{
|
||||
Weight = 5;
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -753,8 +753,8 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Hue != 0x8A4 )
|
||||
Hue = 0x8A4;
|
||||
/*if ( Hue != 0x8A4 )
|
||||
Hue = 0x8A4;*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -813,8 +813,8 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Hue != 0 && (Hue < 2101 || Hue > 2130) )
|
||||
Hue = GetRandomHue();
|
||||
/*if ( Hue != 0 && (Hue < 2101 || Hue > 2130) )
|
||||
Hue = GetRandomHue();*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -15,7 +16,7 @@ namespace Server.Items
|
|||
[Constructable]
|
||||
public NameChangeDeed() : base( 0x14F0 )
|
||||
{
|
||||
base.Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public NameChangeDeed( Serial serial ) : base( serial )
|
||||
|
|
@ -38,9 +39,91 @@ namespace Server.Items
|
|||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -685,7 +685,10 @@ namespace Server.Items
|
|||
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503019 ); // You successfully decode a treasure map!
|
||||
Decoder = from;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
if ( Core.AOS )
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
DisplayTo( from );
|
||||
}
|
||||
|
||||
|
|
@ -887,10 +890,9 @@ namespace Server.Items
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (m_Decoder != null && LootType == LootType.Regular)
|
||||
{
|
||||
|
||||
if ( Core.AOS && m_Decoder != null && LootType == LootType.Regular)
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,16 @@ namespace Server.Items
|
|||
{
|
||||
EtherealMount.StopMounting( from );
|
||||
|
||||
Item one = from.FindItemOnLayer( Layer.OneHanded );
|
||||
Item two = from.FindItemOnLayer( Layer.TwoHanded );
|
||||
if ( Core.AOS ) {
|
||||
Item one = from.FindItemOnLayer( Layer.OneHanded );
|
||||
Item two = from.FindItemOnLayer( Layer.TwoHanded );
|
||||
|
||||
if ( one != null )
|
||||
from.AddToBackpack( one );
|
||||
if ( one != null )
|
||||
from.AddToBackpack( one );
|
||||
|
||||
if ( two != null )
|
||||
from.AddToBackpack( two );
|
||||
if ( two != null )
|
||||
from.AddToBackpack( two );
|
||||
}
|
||||
|
||||
from.Target = new BolaTarget( this );
|
||||
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
|
||||
|
|
@ -143,14 +145,16 @@ namespace Server.Items
|
|||
{
|
||||
EtherealMount.StopMounting( from );
|
||||
|
||||
Item one = from.FindItemOnLayer( Layer.OneHanded );
|
||||
Item two = from.FindItemOnLayer( Layer.TwoHanded );
|
||||
if ( Core.AOS ) {
|
||||
Item one = from.FindItemOnLayer( Layer.OneHanded );
|
||||
Item two = from.FindItemOnLayer( Layer.TwoHanded );
|
||||
|
||||
if ( one != null )
|
||||
from.AddToBackpack( one );
|
||||
if ( one != null )
|
||||
from.AddToBackpack( one );
|
||||
|
||||
if ( two != null )
|
||||
from.AddToBackpack( two );
|
||||
if ( two != null )
|
||||
from.AddToBackpack( two );
|
||||
}
|
||||
|
||||
from.DoHarmful( to );
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Hue == 0 )
|
||||
Hue = 0x8AC;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ namespace Server.Items
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( version < 1 )
|
||||
Stackable = Core.ML;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,13 +134,11 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
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
|
||||
return false;
|
||||
|
|
@ -182,13 +180,11 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
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
|
||||
return false;
|
||||
|
|
@ -231,13 +227,11 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
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
|
||||
return false;
|
||||
|
|
@ -280,13 +274,11 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
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
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -145,40 +145,33 @@ namespace Server.Items
|
|||
|
||||
if( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability
|
||||
{
|
||||
if( Core.AOS && ArmorAttributes.SelfRepair > Utility.Random( 10 ) )
|
||||
{
|
||||
HitPoints += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
int wear = Utility.Random( 2 );
|
||||
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;
|
||||
wear = 0;
|
||||
MaxHitPoints -= wear;
|
||||
|
||||
if( Parent is Mobile )
|
||||
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
|
||||
}
|
||||
else
|
||||
{
|
||||
wear -= HitPoints;
|
||||
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();
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ namespace Server.Items
|
|||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
|
||||
if ( m_Quality == BookQuality.Exceptional )
|
||||
list.Add( 1063341 ); // exceptional
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@ using Server;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
[FlipableAttribute( 0x2bd9, 0x2bda )]
|
||||
public class GreenStocking : BaseContainer
|
||||
{
|
||||
public override int DefaultGumpID{ get{ return 0x103; } }
|
||||
public override int DefaultDropSound{ get{ return 0x42; } }
|
||||
|
||||
[Constructable]
|
||||
public GreenStocking() : base ( 0x2bd9 )
|
||||
public GreenStocking() : base ( Utility.Random( 0x2BD9, 2 ) )
|
||||
{
|
||||
GumpID = 0x103;
|
||||
}
|
||||
|
||||
public GreenStocking( Serial serial ) : base( serial )
|
||||
|
|
@ -29,13 +32,16 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
[Furniture]
|
||||
[FlipableAttribute( 0x2bdb, 0x2bdc )]
|
||||
public class RedStocking : BaseContainer
|
||||
{
|
||||
public override int DefaultGumpID{ get{ return 0x103; } }
|
||||
public override int DefaultDropSound{ get{ return 0x42; } }
|
||||
|
||||
[Constructable]
|
||||
public RedStocking() : base ( 0x2bdb )
|
||||
public RedStocking() : base ( Utility.Random( 0x2BDB, 2 ) )
|
||||
{
|
||||
GumpID = 0x103;
|
||||
}
|
||||
|
||||
public RedStocking( Serial serial ) : base( serial )
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Server;
|
|||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
|
|
@ -80,7 +81,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( HarvestSystem == null )
|
||||
if ( HarvestSystem == null || Deleted )
|
||||
return;
|
||||
|
||||
Point3D loc = GetWorldLocation();
|
||||
|
|
@ -90,8 +91,13 @@ namespace Server.Items
|
|||
from.LocalOverheadMessage( Server.Network.MessageType.Regular, 0x3E9, 1019045 ); // I can't reach that
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !( HarvestSystem is Mining ) )
|
||||
else if ( !this.IsAccessibleTo( from ) )
|
||||
{
|
||||
this.PublicOverheadMessage( MessageType.Regular, 0x3E9, 1061637 ); // You are not allowed to access this.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !(this.HarvestSystem is Mining) )
|
||||
from.SendLocalizedMessage( 1010018 ); // What do you want to use this item on?
|
||||
|
||||
HarvestSystem.BeginHarvesting( from, this );
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Items
|
|||
|
||||
if ( Core.AOS )
|
||||
return damage;
|
||||
|
||||
|
||||
int absorb = defender.MeleeDamageAbsorb;
|
||||
|
||||
if ( absorb > 0 )
|
||||
|
|
|
|||
|
|
@ -1243,6 +1243,10 @@ namespace Server.Items
|
|||
if ( Core.AOS )
|
||||
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();
|
||||
|
||||
Item armorItem;
|
||||
|
|
@ -1265,10 +1269,6 @@ namespace Server.Items
|
|||
if ( armor != null )
|
||||
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;
|
||||
|
||||
if ( virtualArmor > 0 )
|
||||
|
|
@ -2345,7 +2345,13 @@ namespace Server.Items
|
|||
if ( Core.AOS )
|
||||
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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue