Fixes casting checks
This commit is contained in:
parent
7ea00fbf4f
commit
03dd5f1926
431 changed files with 5616 additions and 6250 deletions
|
|
@ -72,7 +72,7 @@ namespace Server.Items
|
|||
|
||||
if ( version == 0 )
|
||||
{
|
||||
Timer.DelayCall( TimeSpan.Zero, delegate()
|
||||
Timer.DelayCall( TimeSpan.Zero, delegate
|
||||
{
|
||||
for ( int i = 0; i < Components.Count; ++i )
|
||||
{
|
||||
|
|
@ -86,7 +86,7 @@ namespace Server.Items
|
|||
|
||||
if ( version <= 1 )
|
||||
{
|
||||
Timer.DelayCall( TimeSpan.Zero, delegate()
|
||||
Timer.DelayCall( TimeSpan.Zero, delegate
|
||||
{
|
||||
for ( int i = 0; i < Components.Count; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version <= 1 )
|
||||
if ( version <= 1 )
|
||||
{
|
||||
if( this.HitPoints > 255 || this.MaxHitPoints > 255 )
|
||||
if ( this.HitPoints > 255 || this.MaxHitPoints > 255 )
|
||||
this.HitPoints = this.MaxHitPoints = 255;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -613,9 +613,9 @@ namespace Server.Items
|
|||
{
|
||||
BaseArmor armor = (BaseArmor)item;
|
||||
|
||||
if( armor.RequiredRace != null && m.Race != armor.RequiredRace )
|
||||
if ( armor.RequiredRace != null && m.Race != armor.RequiredRace )
|
||||
{
|
||||
if( armor.RequiredRace == Race.Elf )
|
||||
if ( armor.RequiredRace == Race.Elf )
|
||||
m.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
|
||||
else
|
||||
m.SendMessage( "Only {0} may use this.", armor.RequiredRace.PluralName );
|
||||
|
|
@ -1167,32 +1167,32 @@ namespace Server.Items
|
|||
|
||||
public override bool CanEquip( Mobile from )
|
||||
{
|
||||
if( !Ethics.Ethic.CheckEquip( from, this ) )
|
||||
if ( !Ethics.Ethic.CheckEquip( from, this ) )
|
||||
return false;
|
||||
|
||||
if( from.AccessLevel < AccessLevel.GameMaster )
|
||||
if ( from.AccessLevel < AccessLevel.GameMaster )
|
||||
{
|
||||
if( RequiredRace != null && from.Race != RequiredRace )
|
||||
if ( RequiredRace != null && from.Race != RequiredRace )
|
||||
{
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
from.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
|
||||
else
|
||||
from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName );
|
||||
|
||||
return false;
|
||||
}
|
||||
else if( !AllowMaleWearer && !from.Female )
|
||||
else if ( !AllowMaleWearer && !from.Female )
|
||||
{
|
||||
if( AllowFemaleWearer )
|
||||
if ( AllowFemaleWearer )
|
||||
from.SendLocalizedMessage( 1010388 ); // Only females can wear this.
|
||||
else
|
||||
from.SendMessage( "You may not wear this." );
|
||||
|
||||
return false;
|
||||
}
|
||||
else if( !AllowFemaleWearer && from.Female )
|
||||
else if ( !AllowFemaleWearer && from.Female )
|
||||
{
|
||||
if( AllowMaleWearer )
|
||||
if ( AllowMaleWearer )
|
||||
from.SendLocalizedMessage( 1063343 ); // Only males can wear this.
|
||||
else
|
||||
from.SendMessage( "You may not wear this." );
|
||||
|
|
@ -1205,17 +1205,17 @@ namespace Server.Items
|
|||
int dexBonus = ComputeStatBonus( StatType.Dex ), dexReq = ComputeStatReq( StatType.Dex );
|
||||
int intBonus = ComputeStatBonus( StatType.Int ), intReq = ComputeStatReq( StatType.Int );
|
||||
|
||||
if( from.Dex < dexReq || (from.Dex + dexBonus) < 1 )
|
||||
if ( from.Dex < dexReq || (from.Dex + dexBonus) < 1 )
|
||||
{
|
||||
from.SendLocalizedMessage( 502077 ); // You do not have enough dexterity to equip this item.
|
||||
return false;
|
||||
}
|
||||
else if( from.Str < strReq || (from.Str + strBonus) < 1 )
|
||||
else if ( from.Str < strReq || (from.Str + strBonus) < 1 )
|
||||
{
|
||||
from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
|
||||
return false;
|
||||
}
|
||||
else if( from.Int < intReq || (from.Int + intBonus) < 1 )
|
||||
else if ( from.Int < intReq || (from.Int + intBonus) < 1 )
|
||||
{
|
||||
from.SendMessage( "You are not smart enough to equip that." );
|
||||
return false;
|
||||
|
|
@ -1443,7 +1443,7 @@ namespace Server.Items
|
|||
list.Add( 1041350 ); // faction item
|
||||
#endregion
|
||||
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
list.Add( 1075086 ); // Elves Only
|
||||
|
||||
m_AosSkillBonuses.GetProperties( list );
|
||||
|
|
@ -1619,12 +1619,12 @@ namespace Server.Items
|
|||
if ( context != null && context.DoNotColor )
|
||||
Hue = 0;
|
||||
|
||||
if( Quality == ArmorQuality.Exceptional )
|
||||
if ( Quality == ArmorQuality.Exceptional )
|
||||
{
|
||||
if ( !( Core.ML && this is BaseShield )) // Guessed Core.ML removed exceptional resist bonuses from crafted shields
|
||||
DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14.
|
||||
|
||||
if( Core.ML && !(this is BaseShield) )
|
||||
if ( Core.ML && !(this is BaseShield) )
|
||||
{
|
||||
int bonus = (int)(from.Skills.ArmsLore.Value / 20);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ namespace Server.Items
|
|||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Chainmail;
|
||||
|
||||
[Constructible]
|
||||
public ChainCoif() : base( 0x13BB )
|
||||
public ChainCoif () : base( 0x13BB )
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ChainCoif( Serial serial ) : base( serial )
|
||||
public ChainCoif ( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && ( Weight == 1 || Weight == 5 ) )
|
||||
if ( version == 0 && ( Weight == 1 || Weight == 5 ) )
|
||||
{
|
||||
Weight = -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if( version == 0 )
|
||||
if ( version == 0 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Server.Items
|
|||
Attributes.Luck = 100;
|
||||
Attributes.RegenHits = 3;
|
||||
|
||||
if( Utility.RandomBool() )
|
||||
if ( Utility.RandomBool() )
|
||||
Attributes.BonusHits = 30;
|
||||
else
|
||||
Attributes.AttackChance = 30;
|
||||
|
|
|
|||
|
|
@ -184,29 +184,29 @@ namespace Server.Items
|
|||
if ( !Ethics.Ethic.CheckEquip( from, this ) )
|
||||
return false;
|
||||
|
||||
if( from.AccessLevel < AccessLevel.GameMaster )
|
||||
if ( from.AccessLevel < AccessLevel.GameMaster )
|
||||
{
|
||||
if( RequiredRace != null && from.Race != RequiredRace )
|
||||
if ( RequiredRace != null && from.Race != RequiredRace )
|
||||
{
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
from.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
|
||||
else
|
||||
from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName );
|
||||
|
||||
return false;
|
||||
}
|
||||
else if( !AllowMaleWearer && !from.Female )
|
||||
else if ( !AllowMaleWearer && !from.Female )
|
||||
{
|
||||
if( AllowFemaleWearer )
|
||||
if ( AllowFemaleWearer )
|
||||
from.SendLocalizedMessage( 1010388 ); // Only females can wear this.
|
||||
else
|
||||
from.SendMessage( "You may not wear this." );
|
||||
|
||||
return false;
|
||||
}
|
||||
else if( !AllowFemaleWearer && from.Female )
|
||||
else if ( !AllowFemaleWearer && from.Female )
|
||||
{
|
||||
if( AllowMaleWearer )
|
||||
if ( AllowMaleWearer )
|
||||
from.SendLocalizedMessage( 1063343 ); // Only males can wear this.
|
||||
else
|
||||
from.SendMessage( "You may not wear this." );
|
||||
|
|
@ -218,7 +218,7 @@ namespace Server.Items
|
|||
int strBonus = ComputeStatBonus( StatType.Str );
|
||||
int strReq = ComputeStatReq( StatType.Str );
|
||||
|
||||
if( from.Str < strReq || (from.Str + strBonus) < 1 )
|
||||
if ( from.Str < strReq || (from.Str + strBonus) < 1 )
|
||||
{
|
||||
from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
|
||||
return false;
|
||||
|
|
@ -296,9 +296,9 @@ namespace Server.Items
|
|||
{
|
||||
BaseClothing clothing = (BaseClothing)item;
|
||||
|
||||
if( clothing.RequiredRace != null && m.Race != clothing.RequiredRace )
|
||||
if ( clothing.RequiredRace != null && m.Race != clothing.RequiredRace )
|
||||
{
|
||||
if( clothing.RequiredRace == Race.Elf )
|
||||
if ( clothing.RequiredRace == Race.Elf )
|
||||
m.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
|
||||
else
|
||||
m.SendMessage( "Only {0} may use this.", clothing.RequiredRace.PluralName );
|
||||
|
|
@ -568,7 +568,7 @@ namespace Server.Items
|
|||
if ( m_Quality == ClothingQuality.Exceptional )
|
||||
list.Add( 1060636 ); // exceptional
|
||||
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
list.Add( 1075086 ); // Elves Only
|
||||
|
||||
if ( m_AosSkillBonuses != null )
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace Server.Items
|
|||
{
|
||||
base.AddEquipInfoAttributes( from, attrs );
|
||||
|
||||
if( m_IsShipwreckedItem )
|
||||
if ( m_IsShipwreckedItem )
|
||||
attrs.Add( new EquipInfoAttribute( 1041645 ) ); // recovered from a shipwreck
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ namespace Server.Items
|
|||
{
|
||||
Quality = (ClothingQuality)quality;
|
||||
|
||||
if( Quality == ClothingQuality.Exceptional )
|
||||
if ( Quality == ClothingQuality.Exceptional )
|
||||
DistributeBonuses( (tool is BaseRunicTool ? 6 : (Core.SE ? 15 : 14)) ); //BLAME OSI. (We can't confirm it's an OSI bug yet.)
|
||||
|
||||
return base.OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( m_DecayTimer != null );
|
||||
|
||||
if( m_DecayTimer != null )
|
||||
if ( m_DecayTimer != null )
|
||||
writer.WriteDeltaTime( m_DecayTime );
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ namespace Server.Items
|
|||
{
|
||||
case 2:
|
||||
{
|
||||
if( reader.ReadBool() )
|
||||
if ( reader.ReadBool() )
|
||||
{
|
||||
m_DecayTime = reader.ReadDeltaTime();
|
||||
BeginDecay( m_DecayTime - DateTime.UtcNow );
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Server.Items
|
|||
|
||||
public override bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if( DefaultResource == CraftResource.None )
|
||||
if ( DefaultResource == CraftResource.None )
|
||||
return base.Scissor( from, scissors );
|
||||
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Server.Items
|
|||
|
||||
if ( !m.InRange( item.GetWorldLocation(), ResurrectRange ) )
|
||||
m.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
else if( m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
|
||||
else if ( m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
|
||||
{
|
||||
m.CloseGump( typeof( ResurrectGump ) );
|
||||
m.SendGump( new ResurrectGump( m, ResurrectMessage.VirtueShrine ) );
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace Server.Items
|
|||
set {
|
||||
if ( base.Locked != value ) {
|
||||
base.Locked = value;
|
||||
|
||||
|
||||
if ( !value )
|
||||
StartResetTimer();
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ namespace Server.Items
|
|||
m_MinSpawnTime = reader.ReadShort();
|
||||
m_MaxSpawnTime = reader.ReadShort();
|
||||
|
||||
if( !Locked )
|
||||
if ( !Locked )
|
||||
StartResetTimer();
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ namespace Server.Items
|
|||
|
||||
private void StartResetTimer()
|
||||
{
|
||||
if( m_ResetTimer == null )
|
||||
if ( m_ResetTimer == null )
|
||||
m_ResetTimer = new TreasureResetTimer( this );
|
||||
else
|
||||
m_ResetTimer.Delay = TimeSpan.FromMinutes( Utility.Random( m_MinSpawnTime, m_MaxSpawnTime ));
|
||||
|
|
@ -215,9 +215,9 @@ namespace Server.Items
|
|||
|
||||
public void Reset()
|
||||
{
|
||||
if( m_ResetTimer != null )
|
||||
if ( m_ResetTimer != null )
|
||||
{
|
||||
if( m_ResetTimer.Running )
|
||||
if ( m_ResetTimer.Running )
|
||||
m_ResetTimer.Stop();
|
||||
}
|
||||
|
||||
|
|
@ -228,13 +228,13 @@ namespace Server.Items
|
|||
|
||||
public enum TreasureLevel
|
||||
{
|
||||
Level1,
|
||||
Level2,
|
||||
Level3,
|
||||
Level4,
|
||||
Level1,
|
||||
Level2,
|
||||
Level3,
|
||||
Level4,
|
||||
Level5,
|
||||
Level6,
|
||||
};
|
||||
};
|
||||
|
||||
private class TreasureResetTimer : Timer
|
||||
{
|
||||
|
|
@ -252,4 +252,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@ namespace Server.Items
|
|||
get { return m_Content; }
|
||||
set
|
||||
{
|
||||
if( m_Content == value )
|
||||
if ( m_Content == value )
|
||||
return;
|
||||
|
||||
m_Content = value;
|
||||
|
||||
for( int i = Items.Count - 1; i >= 0; --i )
|
||||
{
|
||||
if( i < Items.Count )
|
||||
if ( i < Items.Count )
|
||||
Items[ i ].Delete();
|
||||
}
|
||||
|
||||
|
|
@ -70,12 +70,12 @@ namespace Server.Items
|
|||
|
||||
public virtual void AcquireContent()
|
||||
{
|
||||
if( m_Content != null )
|
||||
if ( m_Content != null )
|
||||
return;
|
||||
|
||||
m_Content = FillableContent.Acquire( this.GetWorldLocation(), this.Map );
|
||||
|
||||
if( m_Content != null )
|
||||
if ( m_Content != null )
|
||||
Respawn();
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ namespace Server.Items
|
|||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if( m_RespawnTimer != null )
|
||||
if ( m_RespawnTimer != null )
|
||||
{
|
||||
m_RespawnTimer.Stop();
|
||||
m_RespawnTimer = null;
|
||||
|
|
@ -111,9 +111,9 @@ namespace Server.Items
|
|||
{
|
||||
bool canSpawn = ( m_Content != null && !Deleted && GetItemsCount() <= SpawnThreshold && !Movable && Parent == null && !IsLockedDown && !IsSecure );
|
||||
|
||||
if( canSpawn )
|
||||
if ( canSpawn )
|
||||
{
|
||||
if( m_RespawnTimer == null )
|
||||
if ( m_RespawnTimer == null )
|
||||
{
|
||||
int mins = Utility.RandomMinMax( this.MinRespawnMinutes, this.MaxRespawnMinutes );
|
||||
TimeSpan delay = TimeSpan.FromMinutes( mins );
|
||||
|
|
@ -122,7 +122,7 @@ namespace Server.Items
|
|||
m_RespawnTimer = Timer.DelayCall( delay, new TimerCallback( Respawn ) );
|
||||
}
|
||||
}
|
||||
else if( m_RespawnTimer != null )
|
||||
else if ( m_RespawnTimer != null )
|
||||
{
|
||||
m_RespawnTimer.Stop();
|
||||
m_RespawnTimer = null;
|
||||
|
|
@ -131,18 +131,18 @@ namespace Server.Items
|
|||
|
||||
public void Respawn()
|
||||
{
|
||||
if( m_RespawnTimer != null )
|
||||
if ( m_RespawnTimer != null )
|
||||
{
|
||||
m_RespawnTimer.Stop();
|
||||
m_RespawnTimer = null;
|
||||
}
|
||||
|
||||
if( m_Content == null || Deleted )
|
||||
if ( m_Content == null || Deleted )
|
||||
return;
|
||||
|
||||
GenerateContent();
|
||||
|
||||
if( IsLockable )
|
||||
if ( IsLockable )
|
||||
{
|
||||
Locked = true;
|
||||
|
||||
|
|
@ -153,9 +153,9 @@ namespace Server.Items
|
|||
RequiredSkill = difficulty;
|
||||
}
|
||||
|
||||
if( IsTrappable && ( m_Content.Level > 1 || 4 > Utility.Random( 5 ) ) )
|
||||
if ( IsTrappable && ( m_Content.Level > 1 || 4 > Utility.Random( 5 ) ) )
|
||||
{
|
||||
if( m_Content.Level > Utility.Random( 5 ) )
|
||||
if ( m_Content.Level > Utility.Random( 5 ) )
|
||||
TrapType = TrapType.PoisonTrap;
|
||||
else
|
||||
TrapType = TrapType.ExplosionTrap;
|
||||
|
|
@ -177,7 +177,7 @@ namespace Server.Items
|
|||
{
|
||||
int itemsCount = GetItemsCount();
|
||||
|
||||
if( itemsCount > SpawnThreshold )
|
||||
if ( itemsCount > SpawnThreshold )
|
||||
return 0;
|
||||
|
||||
int maxSpawnCount = ( 1 + SpawnThreshold - itemsCount ) * 2;
|
||||
|
|
@ -187,7 +187,7 @@ namespace Server.Items
|
|||
|
||||
public virtual void GenerateContent()
|
||||
{
|
||||
if( m_Content == null || Deleted )
|
||||
if ( m_Content == null || Deleted )
|
||||
return;
|
||||
|
||||
int toSpawn = GetSpawnCount();
|
||||
|
|
@ -196,7 +196,7 @@ namespace Server.Items
|
|||
{
|
||||
Item item = m_Content.Construct();
|
||||
|
||||
if( item != null )
|
||||
if ( item != null )
|
||||
{
|
||||
List<Item> list = this.Items;
|
||||
|
||||
|
|
@ -204,11 +204,11 @@ namespace Server.Items
|
|||
{
|
||||
Item subItem = list[ j ];
|
||||
|
||||
if( !( subItem is Container ) && subItem.StackWith( null, item, false ) )
|
||||
if ( !( subItem is Container ) && subItem.StackWith( null, item, false ) )
|
||||
break;
|
||||
}
|
||||
|
||||
if( item != null && !item.Deleted )
|
||||
if ( item != null && !item.Deleted )
|
||||
DropItem( item );
|
||||
}
|
||||
}
|
||||
|
|
@ -227,7 +227,7 @@ namespace Server.Items
|
|||
|
||||
writer.Write( (int)ContentType );
|
||||
|
||||
if( m_RespawnTimer != null )
|
||||
if ( m_RespawnTimer != null )
|
||||
{
|
||||
writer.Write( true );
|
||||
writer.WriteDeltaTime( (DateTime)m_NextRespawnTime );
|
||||
|
|
@ -253,7 +253,7 @@ namespace Server.Items
|
|||
}
|
||||
case 0:
|
||||
{
|
||||
if( reader.ReadBool() )
|
||||
if ( reader.ReadBool() )
|
||||
{
|
||||
m_NextRespawnTime = reader.ReadDeltaTime();
|
||||
|
||||
|
|
@ -284,12 +284,12 @@ namespace Server.Items
|
|||
|
||||
public override void AcquireContent()
|
||||
{
|
||||
if( m_Content != null )
|
||||
if ( m_Content != null )
|
||||
return;
|
||||
|
||||
m_Content = FillableContent.Library;
|
||||
|
||||
if( m_Content != null )
|
||||
if ( m_Content != null )
|
||||
Respawn();
|
||||
}
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if( version == 0 && m_Content == null )
|
||||
if ( version == 0 && m_Content == null )
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AcquireContent ) );
|
||||
}
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if( version == 0 && Weight == 3 )
|
||||
if ( version == 0 && Weight == 3 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -473,7 +473,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if( version == 0 && Weight == 25 )
|
||||
if ( version == 0 && Weight == 25 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -505,7 +505,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Weight == 25 )
|
||||
if ( version == 0 && Weight == 25 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -537,7 +537,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Weight == 25 )
|
||||
if ( version == 0 && Weight == 25 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -569,7 +569,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Weight == 2 )
|
||||
if ( version == 0 && Weight == 2 )
|
||||
Weight = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -616,11 +616,11 @@ namespace Server.Items
|
|||
{
|
||||
Item item = Loot.Construct( m_Types );
|
||||
|
||||
if( item is Key )
|
||||
if ( item is Key )
|
||||
( (Key)item ).ItemID = Utility.RandomList( (int)KeyType.Copper, (int)KeyType.Gold, (int)KeyType.Iron, (int)KeyType.Rusty );
|
||||
else if( item is Arrow || item is Bolt )
|
||||
else if ( item is Arrow || item is Bolt )
|
||||
item.Amount = Utility.RandomMinMax( 2, 6 );
|
||||
else if( item is Bandage || item is Lockpick )
|
||||
else if ( item is Bandage || item is Lockpick )
|
||||
item.Amount = Utility.RandomMinMax( 1, 3 );
|
||||
|
||||
return item;
|
||||
|
|
@ -650,11 +650,11 @@ namespace Server.Items
|
|||
|
||||
int index = Utility.Random( m_Types.Length );
|
||||
|
||||
if( m_Types[ index ] == typeof( BeverageBottle ) )
|
||||
if ( m_Types[ index ] == typeof( BeverageBottle ) )
|
||||
{
|
||||
item = new BeverageBottle( m_Content );
|
||||
}
|
||||
else if( m_Types[ index ] == typeof( Jug ) )
|
||||
else if ( m_Types[ index ] == typeof( Jug ) )
|
||||
{
|
||||
item = new Jug( m_Content );
|
||||
}
|
||||
|
|
@ -662,7 +662,7 @@ namespace Server.Items
|
|||
{
|
||||
item = base.Construct();
|
||||
|
||||
if( item is BaseBeverage )
|
||||
if ( item is BaseBeverage )
|
||||
{
|
||||
BaseBeverage bev = (BaseBeverage)item;
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ namespace Server.Items
|
|||
{
|
||||
FillableEntry entry = m_Entries[ i ];
|
||||
|
||||
if( index < entry.Weight )
|
||||
if ( index < entry.Weight )
|
||||
return entry.Construct();
|
||||
|
||||
index -= entry.Weight;
|
||||
|
|
@ -1456,7 +1456,7 @@ namespace Server.Items
|
|||
{
|
||||
int v = (int)type;
|
||||
|
||||
if( v >= 0 && v < m_ContentTypes.Length )
|
||||
if ( v >= 0 && v < m_ContentTypes.Length )
|
||||
return m_ContentTypes[ v ];
|
||||
|
||||
return null;
|
||||
|
|
@ -1464,7 +1464,7 @@ namespace Server.Items
|
|||
|
||||
public static FillableContentType Lookup( FillableContent content )
|
||||
{
|
||||
if( content == null )
|
||||
if ( content == null )
|
||||
return FillableContentType.None;
|
||||
|
||||
return (FillableContentType)Array.IndexOf( m_ContentTypes, content );
|
||||
|
|
@ -1490,10 +1490,10 @@ namespace Server.Items
|
|||
|
||||
public static FillableContent Acquire( Point3D loc, Map map )
|
||||
{
|
||||
if( map == null || map == Map.Internal )
|
||||
if ( map == null || map == Map.Internal )
|
||||
return null;
|
||||
|
||||
if( m_AcquireTable == null )
|
||||
if ( m_AcquireTable == null )
|
||||
{
|
||||
m_AcquireTable = new Hashtable();
|
||||
|
||||
|
|
@ -1511,12 +1511,12 @@ namespace Server.Items
|
|||
|
||||
foreach( Mobile mob in map.GetMobilesInRange( loc, 20 ) )
|
||||
{
|
||||
if( nearest != null && mob.GetDistanceToSqrt( loc ) > nearest.GetDistanceToSqrt( loc ) && !( nearest is Cobbler && mob is Provisioner ) )
|
||||
if ( nearest != null && mob.GetDistanceToSqrt( loc ) > nearest.GetDistanceToSqrt( loc ) && !( nearest is Cobbler && mob is Provisioner ) )
|
||||
continue;
|
||||
|
||||
FillableContent check = m_AcquireTable[ mob.GetType() ] as FillableContent;
|
||||
|
||||
if( check != null )
|
||||
if ( check != null )
|
||||
{
|
||||
nearest = mob;
|
||||
content = check;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Items
|
|||
|
||||
private static int[] m_Hues = new int[]
|
||||
{
|
||||
0x0, 0x455, 0x47E, 0x89F, 0x8A5, 0x8AB,
|
||||
0x0, 0x455, 0x47E, 0x89F, 0x8A5, 0x8AB,
|
||||
0x966, 0x96D, 0x972, 0x973, 0x979
|
||||
};
|
||||
|
||||
|
|
@ -76,14 +76,14 @@ namespace Server.Items
|
|||
min = 10; max = 20;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Flip()
|
||||
{
|
||||
switch ( ItemID )
|
||||
{
|
||||
case 0x9AB : ItemID = 0xE7C; break;
|
||||
case 0xE7C : ItemID = 0x9AB; break;
|
||||
|
||||
|
||||
case 0xE40 : ItemID = 0xE41; break;
|
||||
case 0xE41 : ItemID = 0xE40; break;
|
||||
}
|
||||
|
|
@ -165,11 +165,11 @@ namespace Server.Items
|
|||
|
||||
DropItem( item );
|
||||
}
|
||||
else if( item is BaseHat )
|
||||
else if ( item is BaseHat )
|
||||
{
|
||||
BaseHat hat = (BaseHat)item;
|
||||
|
||||
if( Core.AOS )
|
||||
if ( Core.AOS )
|
||||
{
|
||||
int attributeCount;
|
||||
int min, max;
|
||||
|
|
@ -181,7 +181,7 @@ namespace Server.Items
|
|||
|
||||
DropItem( item );
|
||||
}
|
||||
else if( item is BaseJewel )
|
||||
else if ( item is BaseJewel )
|
||||
{
|
||||
int attributeCount;
|
||||
int min, max;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if( from.Alive )
|
||||
if ( from.Alive )
|
||||
{
|
||||
list.Add( new SalvageIngotsEntry( this, IsChildOf( from.Backpack ) && Resmeltables() ) );
|
||||
list.Add( new SalvageClothEntry( this, IsChildOf( from.Backpack ) && Scissorables() ) );
|
||||
|
|
@ -45,19 +45,19 @@ namespace Server.Items
|
|||
{
|
||||
foreach( Item i in Items )
|
||||
{
|
||||
if( i != null && !i.Deleted )
|
||||
if ( i != null && !i.Deleted )
|
||||
{
|
||||
if( i is BaseWeapon )
|
||||
if ( i is BaseWeapon )
|
||||
{
|
||||
if( CraftResources.GetType( ( (BaseWeapon)i ).Resource ) == CraftResourceType.Metal )
|
||||
if ( CraftResources.GetType( ( (BaseWeapon)i ).Resource ) == CraftResourceType.Metal )
|
||||
return true;
|
||||
}
|
||||
if( i is BaseArmor )
|
||||
if ( i is BaseArmor )
|
||||
{
|
||||
if( CraftResources.GetType( ( (BaseArmor)i ).Resource ) == CraftResourceType.Metal )
|
||||
if ( CraftResources.GetType( ( (BaseArmor)i ).Resource ) == CraftResourceType.Metal )
|
||||
return true;
|
||||
}
|
||||
if( i is DragonBardingDeed )
|
||||
if ( i is DragonBardingDeed )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -68,18 +68,18 @@ namespace Server.Items
|
|||
{
|
||||
foreach( Item i in Items )
|
||||
{
|
||||
if( i != null && !i.Deleted )
|
||||
if ( i != null && !i.Deleted )
|
||||
{
|
||||
if( i is IScissorable )
|
||||
if ( i is IScissorable )
|
||||
{
|
||||
if( i is BaseClothing )
|
||||
if ( i is BaseClothing )
|
||||
return true;
|
||||
if( i is BaseArmor )
|
||||
if ( i is BaseArmor )
|
||||
{
|
||||
if( CraftResources.GetType( ( (BaseArmor)i ).Resource ) == CraftResourceType.Leather )
|
||||
if ( CraftResources.GetType( ( (BaseArmor)i ).Resource ) == CraftResourceType.Leather )
|
||||
return true;
|
||||
}
|
||||
if( ( i is Cloth ) || ( i is BoltOfCloth ) || ( i is Hides ) || ( i is BonePile ) )
|
||||
if ( ( i is Cloth ) || ( i is BoltOfCloth ) || ( i is Hides ) || ( i is BonePile ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,22 +93,22 @@ namespace Server.Items
|
|||
{
|
||||
try
|
||||
{
|
||||
if( CraftResources.GetType( resource ) != CraftResourceType.Metal )
|
||||
if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
|
||||
return false;
|
||||
|
||||
CraftResourceInfo info = CraftResources.GetInfo( resource );
|
||||
|
||||
if( info == null || info.ResourceTypes.Length == 0 )
|
||||
if ( info == null || info.ResourceTypes.Length == 0 )
|
||||
return false;
|
||||
|
||||
CraftItem craftItem = DefBlacksmithy.CraftSystem.CraftItems.SearchFor( item.GetType() );
|
||||
|
||||
if( craftItem == null || craftItem.Resources.Count == 0 )
|
||||
if ( craftItem == null || craftItem.Resources.Count == 0 )
|
||||
return false;
|
||||
|
||||
CraftRes craftResource = craftItem.Resources.GetAt( 0 );
|
||||
|
||||
if( craftResource.Amount < 2 )
|
||||
if ( craftResource.Amount < 2 )
|
||||
return false; // Not enough metal to resmelt
|
||||
|
||||
double difficulty = 0.0;
|
||||
|
|
@ -128,13 +128,13 @@ namespace Server.Items
|
|||
Type resourceType = info.ResourceTypes[ 0 ];
|
||||
Item ingot = (Item)Activator.CreateInstance( resourceType );
|
||||
|
||||
if( item is DragonBardingDeed || ( item is BaseArmor && ( (BaseArmor)item ).PlayerConstructed ) || ( item is BaseWeapon && ( (BaseWeapon)item ).PlayerConstructed ) || ( item is BaseClothing && ( (BaseClothing)item ).PlayerConstructed ) )
|
||||
if ( item is DragonBardingDeed || ( item is BaseArmor && ( (BaseArmor)item ).PlayerConstructed ) || ( item is BaseWeapon && ( (BaseWeapon)item ).PlayerConstructed ) || ( item is BaseClothing && ( (BaseClothing)item ).PlayerConstructed ) )
|
||||
{
|
||||
double mining = from.Skills[ SkillName.Mining ].Value;
|
||||
if( mining > 100.0 )
|
||||
if ( mining > 100.0 )
|
||||
mining = 100.0;
|
||||
double amount = ( ( ( 4 + mining ) * craftResource.Amount - 4 ) * 0.0068 );
|
||||
if( amount < 2 )
|
||||
if ( amount < 2 )
|
||||
ingot.Amount = 2;
|
||||
else
|
||||
ingot.Amount = (int)amount;
|
||||
|
|
@ -176,11 +176,11 @@ namespace Server.Items
|
|||
bool ToolFound = false;
|
||||
foreach( Item tool in tools )
|
||||
{
|
||||
if( tool is BaseTool && ( (BaseTool)tool ).CraftSystem == DefBlacksmithy.CraftSystem )
|
||||
if ( tool is BaseTool && ( (BaseTool)tool ).CraftSystem == DefBlacksmithy.CraftSystem )
|
||||
ToolFound = true;
|
||||
}
|
||||
|
||||
if( !ToolFound )
|
||||
if ( !ToolFound )
|
||||
{
|
||||
from.SendLocalizedMessage( 1079822 ); // You need a blacksmithing tool in order to salvage ingots.
|
||||
return;
|
||||
|
|
@ -189,7 +189,7 @@ namespace Server.Items
|
|||
bool anvil, forge;
|
||||
DefBlacksmithy.CheckAnvilAndForge( from, 2, out anvil, out forge );
|
||||
|
||||
if( !forge )
|
||||
if ( !forge )
|
||||
{
|
||||
from.SendLocalizedMessage( 1044265 ); // You must be near a forge.
|
||||
return;
|
||||
|
|
@ -206,30 +206,30 @@ namespace Server.Items
|
|||
{
|
||||
Item item = Smeltables[ i ];
|
||||
|
||||
if( item is BaseArmor )
|
||||
if ( item is BaseArmor )
|
||||
{
|
||||
if( Resmelt( from, item, ( (BaseArmor)item ).Resource ) )
|
||||
if ( Resmelt( from, item, ( (BaseArmor)item ).Resource ) )
|
||||
salvaged++;
|
||||
else
|
||||
notSalvaged++;
|
||||
}
|
||||
else if( item is BaseWeapon )
|
||||
else if ( item is BaseWeapon )
|
||||
{
|
||||
if( Resmelt( from, item, ( (BaseWeapon)item ).Resource ) )
|
||||
if ( Resmelt( from, item, ( (BaseWeapon)item ).Resource ) )
|
||||
salvaged++;
|
||||
else
|
||||
notSalvaged++;
|
||||
}
|
||||
else if( item is DragonBardingDeed )
|
||||
else if ( item is DragonBardingDeed )
|
||||
{
|
||||
if( Resmelt( from, item, ( (DragonBardingDeed)item ).Resource ) )
|
||||
if ( Resmelt( from, item, ( (DragonBardingDeed)item ).Resource ) )
|
||||
salvaged++;
|
||||
|
||||
else
|
||||
notSalvaged++;
|
||||
}
|
||||
}
|
||||
if( m_Failure )
|
||||
if ( m_Failure )
|
||||
{
|
||||
from.SendLocalizedMessage( 1079975 ); // You failed to smelt some metal for lack of skill.
|
||||
m_Failure = false;
|
||||
|
|
@ -241,7 +241,7 @@ namespace Server.Items
|
|||
private void SalvageCloth( Mobile from )
|
||||
{
|
||||
Scissors scissors = from.Backpack.FindItemByType( typeof( Scissors ) ) as Scissors;
|
||||
if( scissors == null )
|
||||
if ( scissors == null )
|
||||
{
|
||||
from.SendLocalizedMessage( 1079823 ); // You need scissors in order to salvage cloth.
|
||||
return;
|
||||
|
|
@ -275,7 +275,7 @@ namespace Server.Items
|
|||
|
||||
foreach (Item i in ((Container)this).FindItemsByType(typeof(Item), true))
|
||||
{
|
||||
if( ( i is Leather ) || ( i is Cloth ) || ( i is SpinedLeather ) || ( i is HornedLeather ) || ( i is BarbedLeather ) || ( i is Bandage ) || ( i is Bone ) )
|
||||
if ( ( i is Leather ) || ( i is Cloth ) || ( i is SpinedLeather ) || ( i is HornedLeather ) || ( i is BarbedLeather ) || ( i is Bandage ) || ( i is Bone ) )
|
||||
{
|
||||
from.AddToBackpack( i );
|
||||
}
|
||||
|
|
@ -300,18 +300,18 @@ namespace Server.Items
|
|||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if( !enabled )
|
||||
if ( !enabled )
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if( m_Bag.Deleted )
|
||||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if( from.CheckAlive() )
|
||||
if ( from.CheckAlive() )
|
||||
m_Bag.SalvageAll( from );
|
||||
}
|
||||
}
|
||||
|
|
@ -325,18 +325,18 @@ namespace Server.Items
|
|||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if( !enabled )
|
||||
if ( !enabled )
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if( m_Bag.Deleted )
|
||||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if( from.CheckAlive() )
|
||||
if ( from.CheckAlive() )
|
||||
m_Bag.SalvageIngots( from );
|
||||
}
|
||||
}
|
||||
|
|
@ -350,18 +350,18 @@ namespace Server.Items
|
|||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if( !enabled )
|
||||
if ( !enabled )
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if( m_Bag.Deleted )
|
||||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if( from.CheckAlive() )
|
||||
if ( from.CheckAlive() )
|
||||
m_Bag.SalvageCloth( from );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ namespace Server.Items
|
|||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 );
|
||||
Effects.PlaySound( Location, Map, 0x1F5 );
|
||||
|
||||
if( this.TrapOnOpen )
|
||||
if ( this.TrapOnOpen )
|
||||
{
|
||||
ExecuteTrap( from );
|
||||
}
|
||||
|
|
@ -257,4 +257,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,11 +241,11 @@ namespace Server.Items
|
|||
|
||||
cont.DropItem( item );
|
||||
}
|
||||
else if( item is BaseHat )
|
||||
else if ( item is BaseHat )
|
||||
{
|
||||
BaseHat hat = (BaseHat)item;
|
||||
|
||||
if( Core.AOS )
|
||||
if ( Core.AOS )
|
||||
{
|
||||
int attributeCount;
|
||||
int min, max;
|
||||
|
|
@ -257,7 +257,7 @@ namespace Server.Items
|
|||
|
||||
cont.DropItem( item );
|
||||
}
|
||||
else if( item is BaseJewel )
|
||||
else if ( item is BaseJewel )
|
||||
{
|
||||
int attributeCount;
|
||||
int min, max;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ namespace Server.Items
|
|||
{
|
||||
get
|
||||
{
|
||||
if( m_TypesOfEntries == null )
|
||||
if ( m_TypesOfEntries == null )
|
||||
{
|
||||
m_TypesOfEntries = new Type[m_Entries.Length];
|
||||
|
||||
|
|
@ -417,4 +417,4 @@ namespace Server.Items
|
|||
m_RespawnTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( 15.0 ), new TimerCallback( CheckRespawn ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ namespace Server.Items
|
|||
}
|
||||
else if ( ( box == null || !IsChildOf( box ) ) && cox == null )
|
||||
{
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
|
|
@ -249,7 +249,7 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if( m_From == null || !m_From.Alive )
|
||||
if ( m_From == null || !m_From.Alive )
|
||||
return;
|
||||
|
||||
if ( m_Deed.Deleted )
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Items
|
|||
|
||||
public static Hair GetRandomHair( bool female, int hairHue )
|
||||
{
|
||||
if( female )
|
||||
if ( female )
|
||||
{
|
||||
switch ( Utility.Random( 9 ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( !IsEmpty )
|
||||
if ( !IsEmpty )
|
||||
{
|
||||
switch( Content )
|
||||
{
|
||||
|
|
@ -85,17 +85,17 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
if( CheckType( "BottleAle" ) )
|
||||
if ( CheckType( "BottleAle" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Ale;
|
||||
}
|
||||
else if( CheckType( "BottleLiquor" ) )
|
||||
else if ( CheckType( "BottleLiquor" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Liquor;
|
||||
}
|
||||
else if( CheckType( "BottleWine" ) )
|
||||
else if ( CheckType( "BottleWine" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Wine;
|
||||
|
|
@ -119,7 +119,7 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( !IsEmpty )
|
||||
if ( !IsEmpty )
|
||||
return 0x9C8;
|
||||
|
||||
return 0;
|
||||
|
|
@ -159,9 +159,9 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( ItemID >= 0x995 && ItemID <= 0x999 )
|
||||
if ( ItemID >= 0x995 && ItemID <= 0x999 )
|
||||
return ItemID;
|
||||
else if( ItemID == 0x9CA )
|
||||
else if ( ItemID == 0x9CA )
|
||||
return ItemID;
|
||||
|
||||
return 0x995;
|
||||
|
|
@ -207,7 +207,7 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( ItemID >= 0xFFF && ItemID <= 0x1002 )
|
||||
if ( ItemID >= 0xFFF && ItemID <= 0x1002 )
|
||||
return ItemID;
|
||||
|
||||
return 0xFFF;
|
||||
|
|
@ -253,7 +253,7 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( ItemID == 0x99A || ItemID == 0x9B3 || ItemID == 0x9BF || ItemID == 0x9CB )
|
||||
if ( ItemID == 0x99A || ItemID == 0x9B3 || ItemID == 0x9BF || ItemID == 0x9CB )
|
||||
return ItemID;
|
||||
|
||||
return 0x99A;
|
||||
|
|
@ -302,7 +302,7 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
return ( ItemID >= 0x1F81 && ItemID <= 0x1F84 ? ItemID : 0x1F81 );
|
||||
|
||||
switch( Content )
|
||||
|
|
@ -353,32 +353,32 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
if( CheckType( "MugAle" ) )
|
||||
if ( CheckType( "MugAle" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Ale;
|
||||
}
|
||||
else if( CheckType( "GlassCider" ) )
|
||||
else if ( CheckType( "GlassCider" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Cider;
|
||||
}
|
||||
else if( CheckType( "GlassLiquor" ) )
|
||||
else if ( CheckType( "GlassLiquor" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Liquor;
|
||||
}
|
||||
else if( CheckType( "GlassMilk" ) )
|
||||
else if ( CheckType( "GlassMilk" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Milk;
|
||||
}
|
||||
else if( CheckType( "GlassWine" ) )
|
||||
else if ( CheckType( "GlassWine" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Wine;
|
||||
}
|
||||
else if( CheckType( "GlassWater" ) )
|
||||
else if ( CheckType( "GlassWater" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Water;
|
||||
|
|
@ -404,9 +404,9 @@ namespace Server.Items
|
|||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
if( ItemID == 0x9A7 || ItemID == 0xFF7 )
|
||||
if ( ItemID == 0x9A7 || ItemID == 0xFF7 )
|
||||
return ItemID;
|
||||
|
||||
return 0xFF6;
|
||||
|
|
@ -416,42 +416,42 @@ namespace Server.Items
|
|||
{
|
||||
case BeverageType.Ale:
|
||||
{
|
||||
if( ItemID == 0x1F96 )
|
||||
if ( ItemID == 0x1F96 )
|
||||
return ItemID;
|
||||
|
||||
return 0x1F95;
|
||||
}
|
||||
case BeverageType.Cider:
|
||||
{
|
||||
if( ItemID == 0x1F98 )
|
||||
if ( ItemID == 0x1F98 )
|
||||
return ItemID;
|
||||
|
||||
return 0x1F97;
|
||||
}
|
||||
case BeverageType.Liquor:
|
||||
{
|
||||
if( ItemID == 0x1F9A )
|
||||
if ( ItemID == 0x1F9A )
|
||||
return ItemID;
|
||||
|
||||
return 0x1F99;
|
||||
}
|
||||
case BeverageType.Milk:
|
||||
{
|
||||
if( ItemID == 0x9AD )
|
||||
if ( ItemID == 0x9AD )
|
||||
return ItemID;
|
||||
|
||||
return 0x9F0;
|
||||
}
|
||||
case BeverageType.Wine:
|
||||
{
|
||||
if( ItemID == 0x1F9C )
|
||||
if ( ItemID == 0x1F9C )
|
||||
return ItemID;
|
||||
|
||||
return 0x1F9B;
|
||||
}
|
||||
case BeverageType.Water:
|
||||
{
|
||||
if( ItemID == 0xFF8 || ItemID == 0xFF9 || ItemID == 0x1F9E )
|
||||
if ( ItemID == 0xFF8 || ItemID == 0xFF9 || ItemID == 0x1F9E )
|
||||
return ItemID;
|
||||
|
||||
return 0x1F9D;
|
||||
|
|
@ -488,7 +488,7 @@ namespace Server.Items
|
|||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
if( CheckType( "PitcherWater" ) || CheckType( "GlassPitcher" ) )
|
||||
if ( CheckType( "PitcherWater" ) || CheckType( "GlassPitcher" ) )
|
||||
base.InternalDeserialize( reader, false );
|
||||
else
|
||||
base.InternalDeserialize( reader, true );
|
||||
|
|
@ -499,37 +499,37 @@ namespace Server.Items
|
|||
{
|
||||
case 0:
|
||||
{
|
||||
if( CheckType( "PitcherAle" ) )
|
||||
if ( CheckType( "PitcherAle" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Ale;
|
||||
}
|
||||
else if( CheckType( "PitcherCider" ) )
|
||||
else if ( CheckType( "PitcherCider" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Cider;
|
||||
}
|
||||
else if( CheckType( "PitcherLiquor" ) )
|
||||
else if ( CheckType( "PitcherLiquor" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Liquor;
|
||||
}
|
||||
else if( CheckType( "PitcherMilk" ) )
|
||||
else if ( CheckType( "PitcherMilk" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Milk;
|
||||
}
|
||||
else if( CheckType( "PitcherWine" ) )
|
||||
else if ( CheckType( "PitcherWine" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Wine;
|
||||
}
|
||||
else if( CheckType( "PitcherWater" ) )
|
||||
else if ( CheckType( "PitcherWater" ) )
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
Content = BeverageType.Water;
|
||||
}
|
||||
else if( CheckType( "GlassPitcher" ) )
|
||||
else if ( CheckType( "GlassPitcher" ) )
|
||||
{
|
||||
Quantity = 0;
|
||||
Content = BeverageType.Water;
|
||||
|
|
@ -558,7 +558,7 @@ namespace Server.Items
|
|||
{
|
||||
int num = BaseLabelNumber;
|
||||
|
||||
if( IsEmpty || num == 0 )
|
||||
if ( IsEmpty || num == 0 )
|
||||
return EmptyLabelNumber;
|
||||
|
||||
return BaseLabelNumber + (int)m_Content;
|
||||
|
|
@ -620,7 +620,7 @@ namespace Server.Items
|
|||
|
||||
int itemID = ComputeItemID();
|
||||
|
||||
if( itemID > 0 )
|
||||
if ( itemID > 0 )
|
||||
ItemID = itemID;
|
||||
else
|
||||
Delete();
|
||||
|
|
@ -633,9 +633,9 @@ namespace Server.Items
|
|||
get { return m_Quantity; }
|
||||
set
|
||||
{
|
||||
if( value < 0 )
|
||||
if ( value < 0 )
|
||||
value = 0;
|
||||
else if( value > MaxQuantity )
|
||||
else if ( value > MaxQuantity )
|
||||
value = MaxQuantity;
|
||||
|
||||
m_Quantity = value;
|
||||
|
|
@ -644,7 +644,7 @@ namespace Server.Items
|
|||
|
||||
int itemID = ComputeItemID();
|
||||
|
||||
if( itemID > 0 )
|
||||
if ( itemID > 0 )
|
||||
ItemID = itemID;
|
||||
else
|
||||
Delete();
|
||||
|
|
@ -655,11 +655,11 @@ namespace Server.Items
|
|||
{
|
||||
int perc = ( m_Quantity * 100 ) / MaxQuantity;
|
||||
|
||||
if( perc <= 0 )
|
||||
if ( perc <= 0 )
|
||||
return 1042975; // It's empty.
|
||||
else if( perc <= 33 )
|
||||
else if ( perc <= 33 )
|
||||
return 1042974; // It's nearly empty.
|
||||
else if( perc <= 66 )
|
||||
else if ( perc <= 66 )
|
||||
return 1042973; // It's half full.
|
||||
else
|
||||
return 1042972; // It's full.
|
||||
|
|
@ -669,7 +669,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if( ShowQuantity )
|
||||
if ( ShowQuantity )
|
||||
list.Add( GetQuantityDescription() );
|
||||
}
|
||||
|
||||
|
|
@ -677,31 +677,31 @@ namespace Server.Items
|
|||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
if( ShowQuantity )
|
||||
if ( ShowQuantity )
|
||||
LabelTo( from, GetQuantityDescription() );
|
||||
}
|
||||
|
||||
public virtual bool ValidateUse( Mobile from, bool message )
|
||||
{
|
||||
if( Deleted )
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
if( !Movable && !Fillable )
|
||||
if ( !Movable && !Fillable )
|
||||
{
|
||||
Multis.BaseHouse house = Multis.BaseHouse.FindHouseAt( this );
|
||||
|
||||
if( house == null || !house.IsLockedDown( this ) )
|
||||
if ( house == null || !house.IsLockedDown( this ) )
|
||||
{
|
||||
if( message )
|
||||
if ( message )
|
||||
from.SendLocalizedMessage( 502946, "", 0x59 ); // That belongs to someone else.
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
|
||||
if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
|
||||
{
|
||||
if( message )
|
||||
if ( message )
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
|
||||
return false;
|
||||
|
|
@ -712,21 +712,21 @@ namespace Server.Items
|
|||
|
||||
public virtual void Fill_OnTarget( Mobile from, object targ )
|
||||
{
|
||||
if( !IsEmpty || !Fillable || !ValidateUse( from, false ) )
|
||||
if ( !IsEmpty || !Fillable || !ValidateUse( from, false ) )
|
||||
return;
|
||||
|
||||
if( targ is BaseBeverage )
|
||||
if ( targ is BaseBeverage )
|
||||
{
|
||||
BaseBeverage bev = (BaseBeverage)targ;
|
||||
|
||||
if( bev.IsEmpty || !bev.ValidateUse( from, true ) )
|
||||
if ( bev.IsEmpty || !bev.ValidateUse( from, true ) )
|
||||
return;
|
||||
|
||||
this.Content = bev.Content;
|
||||
this.Poison = bev.Poison;
|
||||
this.Poisoner = bev.Poisoner;
|
||||
|
||||
if( bev.Quantity > this.MaxQuantity )
|
||||
if ( bev.Quantity > this.MaxQuantity )
|
||||
{
|
||||
this.Quantity = this.MaxQuantity;
|
||||
bev.Quantity -= this.MaxQuantity;
|
||||
|
|
@ -737,15 +737,15 @@ namespace Server.Items
|
|||
bev.Quantity = 0;
|
||||
}
|
||||
}
|
||||
else if( targ is BaseWaterContainer )
|
||||
else if ( targ is BaseWaterContainer )
|
||||
{
|
||||
BaseWaterContainer bwc = targ as BaseWaterContainer;
|
||||
|
||||
if( Quantity == 0 || ( Content == BeverageType.Water && !IsFull ) )
|
||||
if ( Quantity == 0 || ( Content == BeverageType.Water && !IsFull ) )
|
||||
{
|
||||
int iNeed = Math.Min( ( MaxQuantity - Quantity ), bwc.Quantity );
|
||||
|
||||
if( iNeed > 0 && !bwc.IsEmpty && !IsFull )
|
||||
if ( iNeed > 0 && !bwc.IsEmpty && !IsFull )
|
||||
{
|
||||
bwc.Quantity -= iNeed;
|
||||
Quantity += iNeed;
|
||||
|
|
@ -755,20 +755,20 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
else if( targ is Item )
|
||||
else if ( targ is Item )
|
||||
{
|
||||
Item item = (Item)targ;
|
||||
IWaterSource src;
|
||||
|
||||
src = ( item as IWaterSource );
|
||||
|
||||
if( src == null && item is AddonComponent )
|
||||
if ( src == null && item is AddonComponent )
|
||||
src = ( ( (AddonComponent)item ).Addon as IWaterSource );
|
||||
|
||||
if( src == null || src.Quantity <= 0 )
|
||||
if ( src == null || src.Quantity <= 0 )
|
||||
return;
|
||||
|
||||
if( from.Map != item.Map || !from.InRange( item.GetWorldLocation(), 2 ) || !from.InLOS( item ) )
|
||||
if ( from.Map != item.Map || !from.InRange( item.GetWorldLocation(), 2 ) || !from.InLOS( item ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return;
|
||||
|
|
@ -778,7 +778,7 @@ namespace Server.Items
|
|||
this.Poison = null;
|
||||
this.Poisoner = null;
|
||||
|
||||
if( src.Quantity > this.MaxQuantity )
|
||||
if ( src.Quantity > this.MaxQuantity )
|
||||
{
|
||||
this.Quantity = this.MaxQuantity;
|
||||
src.Quantity -= this.MaxQuantity;
|
||||
|
|
@ -791,39 +791,39 @@ namespace Server.Items
|
|||
|
||||
from.SendLocalizedMessage( 1010089 ); // You fill the container with water.
|
||||
}
|
||||
else if( targ is Cow )
|
||||
else if ( targ is Cow )
|
||||
{
|
||||
Cow cow = (Cow)targ;
|
||||
|
||||
if( cow.TryMilk( from ) )
|
||||
if ( cow.TryMilk( from ) )
|
||||
{
|
||||
Content = BeverageType.Milk;
|
||||
Quantity = MaxQuantity;
|
||||
from.SendLocalizedMessage( 1080197 ); // You fill the container with milk.
|
||||
}
|
||||
}
|
||||
else if( targ is LandTarget )
|
||||
else if ( targ is LandTarget )
|
||||
{
|
||||
int tileID = ( (LandTarget)targ ).TileID;
|
||||
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if( player != null )
|
||||
if ( player != null )
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if( qs is WitchApprenticeQuest )
|
||||
if ( qs is WitchApprenticeQuest )
|
||||
{
|
||||
FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;
|
||||
|
||||
if( obj != null && !obj.Completed && obj.Ingredient == Ingredient.SwampWater )
|
||||
if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.SwampWater )
|
||||
{
|
||||
bool contains = false;
|
||||
|
||||
for( int i = 0; !contains && i < m_SwampTiles.Length; i += 2 )
|
||||
contains = ( tileID >= m_SwampTiles[ i ] && tileID <= m_SwampTiles[ i + 1 ] );
|
||||
|
||||
if( contains )
|
||||
if ( contains )
|
||||
{
|
||||
Delete();
|
||||
|
||||
|
|
@ -862,13 +862,13 @@ namespace Server.Items
|
|||
|
||||
public static void CheckHeaveTimer( Mobile from )
|
||||
{
|
||||
if( from.BAC > 0 && from.Map != Map.Internal && !from.Deleted )
|
||||
if ( from.BAC > 0 && from.Map != Map.Internal && !from.Deleted )
|
||||
{
|
||||
Timer t = (Timer)m_Table[ from ];
|
||||
|
||||
if( t == null )
|
||||
if ( t == null )
|
||||
{
|
||||
if( from.BAC > 60 )
|
||||
if ( from.BAC > 60 )
|
||||
from.BAC = 60;
|
||||
|
||||
t = new HeaveTimer( from );
|
||||
|
|
@ -881,7 +881,7 @@ namespace Server.Items
|
|||
{
|
||||
Timer t = (Timer)m_Table[ from ];
|
||||
|
||||
if( t != null )
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
m_Table.Remove( from );
|
||||
|
|
@ -905,27 +905,27 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if( m_Drunk.Deleted || m_Drunk.Map == Map.Internal )
|
||||
if ( m_Drunk.Deleted || m_Drunk.Map == Map.Internal )
|
||||
{
|
||||
Stop();
|
||||
m_Table.Remove( m_Drunk );
|
||||
}
|
||||
else if( m_Drunk.Alive )
|
||||
else if ( m_Drunk.Alive )
|
||||
{
|
||||
if( m_Drunk.BAC > 60 )
|
||||
if ( m_Drunk.BAC > 60 )
|
||||
m_Drunk.BAC = 60;
|
||||
|
||||
// chance to get sober
|
||||
if( 10 > Utility.Random( 100 ) )
|
||||
if ( 10 > Utility.Random( 100 ) )
|
||||
--m_Drunk.BAC;
|
||||
|
||||
// lose some stats
|
||||
m_Drunk.Stam -= 1;
|
||||
m_Drunk.Mana -= 1;
|
||||
|
||||
if( Utility.Random( 1, 4 ) == 1 )
|
||||
if ( Utility.Random( 1, 4 ) == 1 )
|
||||
{
|
||||
if( !m_Drunk.Mounted )
|
||||
if ( !m_Drunk.Mounted )
|
||||
{
|
||||
// turn in a random direction
|
||||
m_Drunk.Direction = (Direction)Utility.Random( 8 );
|
||||
|
|
@ -938,7 +938,7 @@ namespace Server.Items
|
|||
m_Drunk.PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, 500849 );
|
||||
}
|
||||
|
||||
if( m_Drunk.BAC <= 0 )
|
||||
if ( m_Drunk.BAC <= 0 )
|
||||
{
|
||||
Stop();
|
||||
m_Table.Remove( m_Drunk );
|
||||
|
|
@ -953,21 +953,21 @@ namespace Server.Items
|
|||
|
||||
public virtual void Pour_OnTarget( Mobile from, object targ )
|
||||
{
|
||||
if( IsEmpty || !Pourable || !ValidateUse( from, false ) )
|
||||
if ( IsEmpty || !Pourable || !ValidateUse( from, false ) )
|
||||
return;
|
||||
|
||||
if( targ is BaseBeverage )
|
||||
if ( targ is BaseBeverage )
|
||||
{
|
||||
BaseBeverage bev = (BaseBeverage)targ;
|
||||
|
||||
if( !bev.ValidateUse( from, true ) )
|
||||
if ( !bev.ValidateUse( from, true ) )
|
||||
return;
|
||||
|
||||
if( bev.IsFull && bev.Content == this.Content )
|
||||
if ( bev.IsFull && bev.Content == this.Content )
|
||||
{
|
||||
from.SendLocalizedMessage( 500848 ); // Couldn't pour it there. It was already full.
|
||||
}
|
||||
else if( !bev.IsEmpty )
|
||||
else if ( !bev.IsEmpty )
|
||||
{
|
||||
from.SendLocalizedMessage( 500846 ); // Can't pour it there.
|
||||
}
|
||||
|
|
@ -977,7 +977,7 @@ namespace Server.Items
|
|||
bev.Poison = this.Poison;
|
||||
bev.Poisoner = this.Poisoner;
|
||||
|
||||
if( this.Quantity > bev.MaxQuantity )
|
||||
if ( this.Quantity > bev.MaxQuantity )
|
||||
{
|
||||
bev.Quantity = bev.MaxQuantity;
|
||||
this.Quantity -= bev.MaxQuantity;
|
||||
|
|
@ -991,12 +991,12 @@ namespace Server.Items
|
|||
from.PlaySound( 0x4E );
|
||||
}
|
||||
}
|
||||
else if( from == targ )
|
||||
else if ( from == targ )
|
||||
{
|
||||
if( from.Thirst < 20 )
|
||||
if ( from.Thirst < 20 )
|
||||
from.Thirst += 1;
|
||||
|
||||
if( ContainsAlchohol )
|
||||
if ( ContainsAlchohol )
|
||||
{
|
||||
int bac = 0;
|
||||
|
||||
|
|
@ -1010,7 +1010,7 @@ namespace Server.Items
|
|||
|
||||
from.BAC += bac;
|
||||
|
||||
if( from.BAC > 60 )
|
||||
if ( from.BAC > 60 )
|
||||
from.BAC = 60;
|
||||
|
||||
CheckHeaveTimer( from );
|
||||
|
|
@ -1018,20 +1018,20 @@ namespace Server.Items
|
|||
|
||||
from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );
|
||||
|
||||
if( m_Poison != null )
|
||||
if ( m_Poison != null )
|
||||
from.ApplyPoison( m_Poisoner, m_Poison );
|
||||
|
||||
--Quantity;
|
||||
}
|
||||
else if( targ is BaseWaterContainer )
|
||||
else if ( targ is BaseWaterContainer )
|
||||
{
|
||||
BaseWaterContainer bwc = targ as BaseWaterContainer;
|
||||
|
||||
if( Content != BeverageType.Water )
|
||||
if ( Content != BeverageType.Water )
|
||||
{
|
||||
from.SendLocalizedMessage( 500842 ); // Can't pour that in there.
|
||||
}
|
||||
else if( bwc.Items.Count != 0 )
|
||||
else if ( bwc.Items.Count != 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 500841 ); // That has something in it.
|
||||
}
|
||||
|
|
@ -1039,7 +1039,7 @@ namespace Server.Items
|
|||
{
|
||||
int itNeeds = Math.Min( ( bwc.MaxQuantity - bwc.Quantity ), Quantity );
|
||||
|
||||
if( itNeeds > 0 )
|
||||
if ( itNeeds > 0 )
|
||||
{
|
||||
bwc.Quantity += itNeeds;
|
||||
Quantity -= itNeeds;
|
||||
|
|
@ -1048,32 +1048,32 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
else if( targ is PlantItem )
|
||||
else if ( targ is PlantItem )
|
||||
{
|
||||
( (PlantItem)targ ).Pour( from, this );
|
||||
}
|
||||
else if( targ is AddonComponent &&
|
||||
else if ( targ is AddonComponent &&
|
||||
( ( (AddonComponent)targ ).Addon is WaterVatEast || ( (AddonComponent)targ ).Addon is WaterVatSouth ) &&
|
||||
this.Content == BeverageType.Water )
|
||||
{
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if( player != null )
|
||||
if ( player != null )
|
||||
{
|
||||
SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;
|
||||
|
||||
if( qs != null )
|
||||
if ( qs != null )
|
||||
{
|
||||
QuestObjective obj = qs.FindObjective( typeof( GatherWaterObjective ) );
|
||||
|
||||
if( obj != null && !obj.Completed )
|
||||
if ( obj != null && !obj.Completed )
|
||||
{
|
||||
BaseAddon vat = ( (AddonComponent)targ ).Addon;
|
||||
|
||||
if( vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 &&
|
||||
if ( vat.X > 5784 && vat.X < 5814 && vat.Y > 1903 && vat.Y < 1934 &&
|
||||
( ( qs.RedSolen && vat.Map == Map.Trammel ) || ( !qs.RedSolen && vat.Map == Map.Felucca ) ) )
|
||||
{
|
||||
if( obj.CurProgress + Quantity > obj.MaxProgress )
|
||||
if ( obj.CurProgress + Quantity > obj.MaxProgress )
|
||||
{
|
||||
int delta = obj.MaxProgress - obj.CurProgress;
|
||||
|
||||
|
|
@ -1098,15 +1098,15 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
if( !Fillable || !ValidateUse( from, true ) )
|
||||
if ( !Fillable || !ValidateUse( from, true ) )
|
||||
return;
|
||||
|
||||
from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Fill_OnTarget ) );
|
||||
SendLocalizedMessageTo( from, 500837 ); // Fill from what?
|
||||
}
|
||||
else if( Pourable && ValidateUse( from, true ) )
|
||||
else if ( Pourable && ValidateUse( from, true ) )
|
||||
{
|
||||
from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Pour_OnTarget ) );
|
||||
from.SendLocalizedMessage( 1010086 ); // What do you want to use this on?
|
||||
|
|
@ -1129,11 +1129,11 @@ namespace Server.Items
|
|||
{
|
||||
BaseBeverage bev = items[ i ] as BaseBeverage;
|
||||
|
||||
if( bev != null && bev.Content == content && !bev.IsEmpty )
|
||||
if ( bev != null && bev.Content == content && !bev.IsEmpty )
|
||||
total += bev.Quantity;
|
||||
}
|
||||
|
||||
if( total >= quantity )
|
||||
if ( total >= quantity )
|
||||
{
|
||||
// We've enough, so consume it
|
||||
|
||||
|
|
@ -1143,12 +1143,12 @@ namespace Server.Items
|
|||
{
|
||||
BaseBeverage bev = items[ i ] as BaseBeverage;
|
||||
|
||||
if( bev == null || bev.Content != content || bev.IsEmpty )
|
||||
if ( bev == null || bev.Content != content || bev.IsEmpty )
|
||||
continue;
|
||||
|
||||
int theirQuantity = bev.Quantity;
|
||||
|
||||
if( theirQuantity < need )
|
||||
if ( theirQuantity < need )
|
||||
{
|
||||
bev.Quantity = 0;
|
||||
need -= theirQuantity;
|
||||
|
|
@ -1208,7 +1208,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
if( !read )
|
||||
if ( !read )
|
||||
return;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( Guild.NewGuildSystem )
|
||||
if ( Guild.NewGuildSystem )
|
||||
return;
|
||||
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( Guild.NewGuildSystem )
|
||||
if ( Guild.NewGuildSystem )
|
||||
return;
|
||||
|
||||
Guildstone stone = m_Stone as Guildstone;
|
||||
|
|
@ -89,7 +89,7 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 501141 ); // You can only place a guildstone in a house you own!
|
||||
}
|
||||
else if( house.FindGuildstone() != null )
|
||||
else if ( house.FindGuildstone() != null )
|
||||
{
|
||||
from.SendLocalizedMessage( 501142 );//Only one guildstone may reside in a given house.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
|
|
@ -109,16 +109,16 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
if( Guild.NewGuildSystem && ItemID == 0xED4 )
|
||||
if ( Guild.NewGuildSystem && ItemID == 0xED4 )
|
||||
ItemID = 0xED6;
|
||||
|
||||
if( version <= 2 )
|
||||
if ( version <= 2 )
|
||||
m_BeforeChangeover = true;
|
||||
|
||||
if( Guild.NewGuildSystem && m_BeforeChangeover )
|
||||
if ( Guild.NewGuildSystem && m_BeforeChangeover )
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AddToHouse ) );
|
||||
|
||||
if( !Guild.NewGuildSystem && m_Guild == null )
|
||||
if ( !Guild.NewGuildSystem && m_Guild == null )
|
||||
this.Delete();
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ namespace Server.Items
|
|||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if( Guild.NewGuildSystem && m_BeforeChangeover && house != null && !house.Addons.Contains( this ) )
|
||||
if ( Guild.NewGuildSystem && m_BeforeChangeover && house != null && !house.Addons.Contains( this ) )
|
||||
{
|
||||
house.Addons.Add( this );
|
||||
m_BeforeChangeover = false;
|
||||
|
|
@ -137,21 +137,21 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
if( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
if ( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
abbr = "";
|
||||
|
||||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( name ), Utility.FixHtml( abbr ) ) );
|
||||
}
|
||||
else if( m_GuildName != null && m_GuildAbbrev != null )
|
||||
else if ( m_GuildName != null && m_GuildAbbrev != null )
|
||||
{
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( m_GuildName ), Utility.FixHtml( m_GuildAbbrev ) ) );
|
||||
}
|
||||
|
|
@ -161,16 +161,16 @@ namespace Server.Items
|
|||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
|
||||
if( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
this.LabelTo( from, name );
|
||||
}
|
||||
else if( m_GuildName != null )
|
||||
else if ( m_GuildName != null )
|
||||
{
|
||||
this.LabelTo( from, m_GuildName );
|
||||
}
|
||||
|
|
@ -178,24 +178,24 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if( !Guild.NewGuildSystem && m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( !Guild.NewGuildSystem && m_Guild != null && !m_Guild.Disbanded )
|
||||
m_Guild.Disband();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( Guild.NewGuildSystem )
|
||||
if ( Guild.NewGuildSystem )
|
||||
return;
|
||||
|
||||
if( m_Guild == null || m_Guild.Disbanded )
|
||||
if ( m_Guild == null || m_Guild.Disbanded )
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else if( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
else if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if( m_Guild.Accepted.Contains( from ) )
|
||||
else if ( m_Guild.Accepted.Contains( from ) )
|
||||
{
|
||||
#region Factions
|
||||
PlayerState guildState = PlayerState.Find( m_Guild.Leader );
|
||||
|
|
@ -204,10 +204,10 @@ namespace Server.Items
|
|||
Faction guildFaction = (guildState == null ? null : guildState.Faction);
|
||||
Faction targetFaction = (targetState == null ? null : targetState.Faction);
|
||||
|
||||
if( guildFaction != targetFaction || (targetState != null && targetState.IsLeaving) )
|
||||
if ( guildFaction != targetFaction || (targetState != null && targetState.IsLeaving) )
|
||||
return;
|
||||
|
||||
if( guildState != null && targetState != null )
|
||||
if ( guildState != null && targetState != null )
|
||||
targetState.Leaving = guildState.Leaving;
|
||||
#endregion
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ namespace Server.Items
|
|||
GuildGump.EnsureClosed( from );
|
||||
from.SendGump( new GuildGump( from, m_Guild ) );
|
||||
}
|
||||
else if( from.AccessLevel < AccessLevel.GameMaster && !m_Guild.IsMember( from ) )
|
||||
else if ( from.AccessLevel < AccessLevel.GameMaster && !m_Guild.IsMember( from ) )
|
||||
{
|
||||
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 501158, "", "" ) ); // You are not a member ...
|
||||
}
|
||||
|
|
@ -245,24 +245,24 @@ namespace Server.Items
|
|||
|
||||
public void OnChop( Mobile from )
|
||||
{
|
||||
if( !Guild.NewGuildSystem )
|
||||
if ( !Guild.NewGuildSystem )
|
||||
return;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
|
||||
if( ( house == null && m_BeforeChangeover ) || ( house != null && house.IsOwner( from ) && house.Addons.Contains( this ) ))
|
||||
if ( ( house == null && m_BeforeChangeover ) || ( house != null && house.IsOwner( from ) && house.Addons.Contains( this ) ))
|
||||
{
|
||||
Effects.PlaySound( GetWorldLocation(), Map, 0x3B3 );
|
||||
from.SendLocalizedMessage( 500461 ); // You destroy the item.
|
||||
|
||||
Delete();
|
||||
|
||||
if( house != null && house.Addons.Contains( this ) )
|
||||
if ( house != null && house.Addons.Contains( this ) )
|
||||
house.Addons.Remove( this );
|
||||
|
||||
Item deed = Deed;
|
||||
|
||||
if( deed != null )
|
||||
if ( deed != null )
|
||||
{
|
||||
from.AddToBackpack( deed );
|
||||
}
|
||||
|
|
@ -331,7 +331,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
m_GuildName = m_Guild.Name;
|
||||
m_GuildAbbrev = m_Guild.Abbreviation;
|
||||
|
|
@ -369,21 +369,21 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if( m_Guild != null && !m_Guild.Disbanded )
|
||||
if ( m_Guild != null && !m_Guild.Disbanded )
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
if ( (name = m_Guild.Name) == null || (name = name.Trim()).Length <= 0 )
|
||||
name = "(unnamed)";
|
||||
|
||||
if( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
if ( (abbr = m_Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0 )
|
||||
abbr = "";
|
||||
|
||||
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( name ), Utility.FixHtml( abbr ) ) );
|
||||
}
|
||||
else if( m_GuildName != null && m_GuildAbbrev != null )
|
||||
else if ( m_GuildName != null && m_GuildAbbrev != null )
|
||||
{
|
||||
list.Add( 1060802, String.Format( "{0} [{1}]", Utility.FixHtml( m_GuildName ), Utility.FixHtml( m_GuildAbbrev ) ) );
|
||||
}
|
||||
|
|
@ -391,11 +391,11 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsChildOf( from.Backpack ) )
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
|
||||
if( house != null && house.IsOwner( from ) )
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration?
|
||||
from.BeginTarget( -1, true, Targeting.TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), null );
|
||||
|
|
@ -415,16 +415,16 @@ namespace Server.Items
|
|||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if( p == null || Deleted )
|
||||
if ( p == null || Deleted )
|
||||
return;
|
||||
|
||||
Point3D loc = new Point3D( p );
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 );
|
||||
|
||||
if( IsChildOf( from.Backpack ) )
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
if( house != null && house.IsOwner( from ) )
|
||||
if ( house != null && house.IsOwner( from ) )
|
||||
{
|
||||
Item addon = new Guildstone( m_Guild, m_GuildName, m_GuildAbbrev );
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( Attributes.AttackChance == 50 )
|
||||
if ( Attributes.AttackChance == 50 )
|
||||
Attributes.AttackChance = 10;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( ItemID == 0x1F47 )
|
||||
if ( ItemID == 0x1F47 )
|
||||
ItemID = 0x14F7;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if( m_Timer != null )
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
|
|
@ -47,10 +47,10 @@ namespace Server.Items
|
|||
DateTime now = DateTime.UtcNow;
|
||||
TimeSpan age = now - m_Created;
|
||||
|
||||
if( age > m_Duration ) {
|
||||
if ( age > m_Duration ) {
|
||||
Delete();
|
||||
} else {
|
||||
if( !m_Drying && age > (m_Duration - age) )
|
||||
if ( !m_Drying && age > (m_Duration - age) )
|
||||
{
|
||||
m_Drying = true;
|
||||
ItemID = 0x122B;
|
||||
|
|
@ -61,7 +61,7 @@ namespace Server.Items
|
|||
foreach( Mobile m in GetMobilesInRange( 0 ) )
|
||||
{
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
if( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
|
||||
if ( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
|
||||
{
|
||||
toDamage.Add( m );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ namespace Server.Items
|
|||
Item item = (Item)obj;
|
||||
CraftResource resource = CraftResource.None;
|
||||
|
||||
if( item is BaseClothing )
|
||||
if ( item is BaseClothing )
|
||||
resource = ((BaseClothing)item).Resource;
|
||||
else if( item is BaseArmor )
|
||||
else if ( item is BaseArmor )
|
||||
resource = ((BaseArmor)item).Resource;
|
||||
else if( item is BaseWeapon ) // Sanity, weapons cannot receive gems...
|
||||
else if ( item is BaseWeapon ) // Sanity, weapons cannot receive gems...
|
||||
resource = ((BaseWeapon)item).Resource;
|
||||
|
||||
IArcaneEquip eq = (IArcaneEquip)obj;
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ namespace Server.Items
|
|||
// shouldFillCorpse = !((BaseCreature)owner).IsBonded;
|
||||
|
||||
Corpse c;
|
||||
if( owner is MilitiaFighter )
|
||||
if ( owner is MilitiaFighter )
|
||||
c = new MilitiaFighterCorpse( owner, hair, facialhair, shouldFillCorpse ? equipItems : new List<Item>() );
|
||||
else
|
||||
c = new Corpse( owner, hair, facialhair, shouldFillCorpse ? equipItems : new List<Item>() );
|
||||
|
|
@ -591,7 +591,7 @@ namespace Server.Items
|
|||
BaseCreature bc = (BaseCreature)owner;
|
||||
|
||||
Mobile master = bc.GetMaster();
|
||||
if( master != null )
|
||||
if ( master != null )
|
||||
m_Aggressors.Add( master );
|
||||
|
||||
List<DamageStore> rights = BaseCreature.GetLootingRights( bc.DamageEntries, bc.HitsMax );
|
||||
|
|
@ -716,13 +716,13 @@ namespace Server.Items
|
|||
{
|
||||
Item item = reader.ReadItem();
|
||||
|
||||
if( reader.ReadBool() )
|
||||
if ( reader.ReadBool() )
|
||||
SetRestoreInfo( item, reader.ReadPoint3D() );
|
||||
else if( item != null )
|
||||
else if ( item != null )
|
||||
SetRestoreInfo( item, item.Location );
|
||||
}
|
||||
|
||||
if( reader.ReadBool() )
|
||||
if ( reader.ReadBool() )
|
||||
BeginDecay( reader.ReadDeltaTime() - DateTime.UtcNow );
|
||||
|
||||
m_Looters = reader.ReadStrongMobileList();
|
||||
|
|
@ -840,7 +840,7 @@ namespace Server.Items
|
|||
|
||||
public bool DevourCorpse()
|
||||
{
|
||||
if( Devoured || Deleted || m_Killer == null || m_Killer.Deleted || !m_Killer.Alive || !(m_Killer is IDevourer) || m_Owner == null || m_Owner.Deleted )
|
||||
if ( Devoured || Deleted || m_Killer == null || m_Killer.Deleted || !m_Killer.Alive || !(m_Killer is IDevourer) || m_Owner == null || m_Owner.Deleted )
|
||||
return false;
|
||||
|
||||
m_Devourer = (IDevourer)m_Killer; // Set the devourer the killer
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ namespace Server.Network
|
|||
List<Item> list = beheld.EquipItems;
|
||||
|
||||
int count = list.Count;
|
||||
if( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
if ( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
count++;
|
||||
if( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
if ( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
count++;
|
||||
|
||||
EnsureCapacity( 8 + (count * 5) );
|
||||
|
|
@ -34,13 +34,13 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
|
||||
if( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
if ( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
{
|
||||
m_Stream.Write( (byte)(Layer.Hair + 1) );
|
||||
m_Stream.Write( (int)HairInfo.FakeSerial( beheld.Owner ) - 2 );
|
||||
}
|
||||
|
||||
if( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
if ( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
{
|
||||
m_Stream.Write( (byte)(Layer.FacialHair + 1) );
|
||||
m_Stream.Write( (int)FacialHairInfo.FakeSerial( beheld.Owner ) - 2 );
|
||||
|
|
@ -58,9 +58,9 @@ namespace Server.Network
|
|||
List<Item> items = beheld.EquipItems;
|
||||
int count = items.Count;
|
||||
|
||||
if( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
if ( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
count++;
|
||||
if( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
if ( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
count++;
|
||||
|
||||
EnsureCapacity( 5 + (count * 19) );
|
||||
|
|
@ -75,7 +75,7 @@ namespace Server.Network
|
|||
{
|
||||
Item child = items[i];
|
||||
|
||||
if( !child.Deleted && child.Parent == beheld && beholder.CanSee( child ) )
|
||||
if ( !child.Deleted && child.Parent == beheld && beholder.CanSee( child ) )
|
||||
{
|
||||
m_Stream.Write( (int)child.Serial );
|
||||
m_Stream.Write( (ushort)child.ItemID );
|
||||
|
|
@ -90,7 +90,7 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
|
||||
if( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
if ( beheld.Hair != null && beheld.Hair.ItemID > 0 )
|
||||
{
|
||||
m_Stream.Write( (int)HairInfo.FakeSerial( beheld.Owner ) - 2 );
|
||||
m_Stream.Write( (ushort)beheld.Hair.ItemID );
|
||||
|
|
@ -104,7 +104,7 @@ namespace Server.Network
|
|||
++written;
|
||||
}
|
||||
|
||||
if( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
if ( beheld.FacialHair != null && beheld.FacialHair.ItemID > 0 )
|
||||
{
|
||||
m_Stream.Write( (int)FacialHairInfo.FakeSerial( beheld.Owner ) - 2 );
|
||||
m_Stream.Write( (ushort)beheld.FacialHair.ItemID );
|
||||
|
|
@ -198,4 +198,4 @@ namespace Server.Network
|
|||
m_Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version >= 0 )
|
||||
if ( version >= 0 )
|
||||
{
|
||||
m_SpawnRange = reader.ReadInt();
|
||||
m_NextSpawnDelay = reader.ReadTimeSpan();
|
||||
|
|
@ -134,11 +134,11 @@ namespace Server.Items
|
|||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
if( m_NextSpawn < DateTime.UtcNow ) // means we haven't spawned anything if the next spawn is below
|
||||
if ( m_NextSpawn < DateTime.UtcNow ) // means we haven't spawned anything if the next spawn is below
|
||||
{
|
||||
if( Utility.InRange( m.Location, Location, 1 ) && !Utility.InRange( oldLocation, Location, 1 ) && m.Player && !(m.AccessLevel > AccessLevel.Player || m.Hidden) )
|
||||
if ( Utility.InRange( m.Location, Location, 1 ) && !Utility.InRange( oldLocation, Location, 1 ) && m.Player && !(m.AccessLevel > AccessLevel.Player || m.Hidden) )
|
||||
{
|
||||
if( m_Timer == null || !m_Timer.Running )
|
||||
if ( m_Timer == null || !m_Timer.Running )
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerCallback( HeedWarning ) );
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ namespace Server.Items
|
|||
{
|
||||
Map map = Map;
|
||||
|
||||
if( map == null )
|
||||
if ( map == null )
|
||||
return Location;
|
||||
|
||||
// Try 10 times to find a Spawnable location.
|
||||
|
|
@ -160,9 +160,9 @@ namespace Server.Items
|
|||
int y = Location.Y + (Utility.Random( (m_SpawnRange * 2) + 1 ) - m_SpawnRange);
|
||||
int z = Map.GetAverageZ( x, y );
|
||||
|
||||
if( Map.CanSpawnMobile( new Point2D( x, y ), this.Z ) )
|
||||
if ( Map.CanSpawnMobile( new Point2D( x, y ), this.Z ) )
|
||||
return new Point3D( x, y, this.Z );
|
||||
else if( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
|
||||
else if ( Map.CanSpawnMobile( new Point2D( x, y ), z ) )
|
||||
return new Point3D( x, y, z );
|
||||
}
|
||||
|
||||
|
|
@ -177,22 +177,22 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( Utility.InRange( from.Location, Location, 2 ) )
|
||||
if ( Utility.InRange( from.Location, Location, 2 ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
if( m_NextSpawn < DateTime.UtcNow )
|
||||
if ( m_NextSpawn < DateTime.UtcNow )
|
||||
{
|
||||
Map map = this.Map;
|
||||
BaseCreature bc = (BaseCreature)Activator.CreateInstance( m_Creatures[Utility.Random( m_Creatures.Length )] );
|
||||
|
||||
if( bc != null )
|
||||
if ( bc != null )
|
||||
{
|
||||
Point3D spawnLoc = GetSpawnPosition();
|
||||
|
||||
DoEffect( spawnLoc, map );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1 ), delegate()
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1 ), delegate
|
||||
{
|
||||
bc.Home = Location;
|
||||
bc.RangeHome = m_SpawnRange;
|
||||
|
|
|
|||
|
|
@ -29,18 +29,18 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if( targeted is Item )
|
||||
if ( targeted is Item )
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if( item.Movable == false && from.AccessLevel == AccessLevel.Player )
|
||||
if ( item.Movable == false && from.AccessLevel == AccessLevel.Player )
|
||||
return;
|
||||
|
||||
Type type = targeted.GetType();
|
||||
|
||||
FlippableAttribute[] AttributeArray = (FlippableAttribute[])type.GetCustomAttributes( typeof( FlippableAttribute ), false );
|
||||
|
||||
if( AttributeArray.Length == 0 )
|
||||
if ( AttributeArray.Length == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -83,12 +83,12 @@ namespace Server.Items
|
|||
|
||||
public virtual void Flip( Item item )
|
||||
{
|
||||
if( m_ItemIDs == null )
|
||||
if ( m_ItemIDs == null )
|
||||
{
|
||||
try
|
||||
{
|
||||
MethodInfo flipMethod = item.GetType().GetMethod( "Flip", Type.EmptyTypes );
|
||||
if( flipMethod != null )
|
||||
if ( flipMethod != null )
|
||||
flipMethod.Invoke( item, new object[0] );
|
||||
}
|
||||
catch
|
||||
|
|
@ -101,14 +101,14 @@ namespace Server.Items
|
|||
int index = 0;
|
||||
for( int i = 0; i < m_ItemIDs.Length; i++ )
|
||||
{
|
||||
if( item.ItemID == m_ItemIDs[i] )
|
||||
if ( item.ItemID == m_ItemIDs[i] )
|
||||
{
|
||||
index = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( index > m_ItemIDs.Length - 1 )
|
||||
if ( index > m_ItemIDs.Length - 1 )
|
||||
index = 0;
|
||||
|
||||
item.ItemID = m_ItemIDs[index];
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace Server.Items
|
|||
|
||||
if ( info.ButtonID != 0 && switches.Length > 0 )
|
||||
{
|
||||
if( m.HairItemID == 0 && m.FacialHairItemID == 0 )
|
||||
if ( m.HairItemID == 0 && m.FacialHairItemID == 0 )
|
||||
{
|
||||
m.SendLocalizedMessage( 502623 ); // You have no hair to dye and cannot use this
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Server.Items
|
|||
case 5: i = new OrigamiFish(); break;
|
||||
}
|
||||
|
||||
if( i != null )
|
||||
if ( i != null )
|
||||
from.AddToBackpack( i );
|
||||
|
||||
from.SendLocalizedMessage( 1070822 ); // You fold the paper into an interesting shape.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if( m_Timer != null )
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
|
|
@ -49,10 +49,10 @@ namespace Server.Items
|
|||
DateTime now = DateTime.UtcNow;
|
||||
TimeSpan age = now - m_Created;
|
||||
|
||||
if( age > m_Duration ) {
|
||||
if ( age > m_Duration ) {
|
||||
Delete();
|
||||
} else {
|
||||
if( !m_Drying && age > (m_Duration - age) )
|
||||
if ( !m_Drying && age > (m_Duration - age) )
|
||||
{
|
||||
m_Drying = true;
|
||||
ItemID = 0x122B;
|
||||
|
|
@ -64,7 +64,7 @@ namespace Server.Items
|
|||
{
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
|
||||
if( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
|
||||
if ( m.Alive && !m.IsDeadBondedPet && (bc == null || bc.Controlled || bc.Summoned) )
|
||||
{
|
||||
toDamage.Add( m );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( !IsChildOf( from.Backpack ) )
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
|
@ -48,12 +48,12 @@ namespace Server.Items
|
|||
{
|
||||
Mobile m = null;
|
||||
|
||||
if( parent is Item )
|
||||
if ( parent is Item )
|
||||
m = ((Item)parent).RootParent as Mobile;
|
||||
else if( parent is Mobile )
|
||||
else if ( parent is Mobile )
|
||||
m = (Mobile)parent;
|
||||
|
||||
if( m != null )
|
||||
if ( m != null )
|
||||
m.CloseGump( typeof( PromotionalTokenGump ) );
|
||||
}
|
||||
|
||||
|
|
@ -94,12 +94,12 @@ namespace Server.Items
|
|||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if( info.ButtonID != 1 )
|
||||
if ( info.ButtonID != 1 )
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if( !m_Token.IsChildOf( from.Backpack ) )
|
||||
if ( !m_Token.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ namespace Server.Items
|
|||
{
|
||||
Item i = m_Token.CreateItemFor( from );
|
||||
|
||||
if( i != null )
|
||||
if ( i != null )
|
||||
{
|
||||
from.BankBox.AddItem( i );
|
||||
TextDefinition.SendMessageTo( from, m_Token.ItemReceiveMessage );
|
||||
|
|
@ -123,7 +123,7 @@ namespace Server.Items
|
|||
|
||||
public override Item CreateItemFor( Mobile from )
|
||||
{
|
||||
if( from != null && from.Account != null )
|
||||
if ( from != null && from.Account != null )
|
||||
return new SoulstoneFragment( from.Account.ToString() );
|
||||
else
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ namespace Server.Items
|
|||
|
||||
if ( info.ButtonID != 0 && switches.Length > 0 )
|
||||
{
|
||||
if( m.FacialHairItemID == 0 )
|
||||
if ( m.FacialHairItemID == 0 )
|
||||
{
|
||||
m.SendLocalizedMessage( 502623 ); // You have no hair to dye and cannot use this
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ namespace Server.Items
|
|||
Mobile m = from.Mobile;
|
||||
int[] switches = info.Switches;
|
||||
|
||||
if ( !m_SpecialHairDye.IsChildOf( m.Backpack ) )
|
||||
if ( !m_SpecialHairDye.IsChildOf( m.Backpack ) )
|
||||
{
|
||||
m.SendLocalizedMessage( 1042010 ); //You must have the objectin your backpack to use it.
|
||||
return;
|
||||
|
|
@ -153,7 +153,7 @@ namespace Server.Items
|
|||
|
||||
if ( info.ButtonID != 0 && switches.Length > 0 )
|
||||
{
|
||||
if( m.HairItemID == 0 )
|
||||
if ( m.HairItemID == 0 )
|
||||
{
|
||||
m.SendLocalizedMessage( 502623 ); // You have no hair to dye and cannot use this
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ namespace Server.Items
|
|||
int hue = e.HueStart + hueOffset;
|
||||
|
||||
m.HairHue = hue;
|
||||
|
||||
|
||||
m.SendLocalizedMessage( 501199 ); // You dye your hair
|
||||
m.PlaySound( 0x4E );
|
||||
}
|
||||
|
|
@ -188,4 +188,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
|
||||
}
|
||||
else if( TransformationSpellHelper.UnderTransformation( from ) )
|
||||
else if ( TransformationSpellHelper.UnderTransformation( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version <= 0 && ItemID == 0x318F )
|
||||
if ( version <= 0 && ItemID == 0x318F )
|
||||
ItemID = 0x318C;
|
||||
}
|
||||
}
|
||||
|
|
@ -981,7 +981,7 @@ namespace Server.Items
|
|||
public PristineDreadHorn()
|
||||
: base( 0x315A )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public PristineDreadHorn( Serial serial )
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ namespace Server.Items
|
|||
|
||||
public override int OnHit( BaseWeapon weapon, int damage )
|
||||
{
|
||||
if( Core.AOS )
|
||||
if ( Core.AOS )
|
||||
{
|
||||
if( ArmorAttributes.SelfRepair > Utility.Random( 10 ) )
|
||||
if ( ArmorAttributes.SelfRepair > Utility.Random( 10 ) )
|
||||
{
|
||||
HitPoints += 2;
|
||||
}
|
||||
|
|
@ -71,19 +71,19 @@ namespace Server.Items
|
|||
double halfArmor = ArmorRating / 2.0;
|
||||
int absorbed = (int)(halfArmor + (halfArmor*Utility.RandomDouble()));
|
||||
|
||||
if( absorbed < 2 )
|
||||
if ( absorbed < 2 )
|
||||
absorbed = 2;
|
||||
|
||||
int wear;
|
||||
|
||||
if( weapon.Type == WeaponType.Bashing )
|
||||
if ( weapon.Type == WeaponType.Bashing )
|
||||
wear = (absorbed / 2);
|
||||
else
|
||||
wear = Utility.Random( 2 );
|
||||
|
||||
if( wear > 0 && MaxHitPoints > 0 )
|
||||
if ( wear > 0 && MaxHitPoints > 0 )
|
||||
{
|
||||
if( HitPoints >= wear )
|
||||
if ( HitPoints >= wear )
|
||||
{
|
||||
HitPoints -= wear;
|
||||
wear = 0;
|
||||
|
|
@ -94,13 +94,13 @@ namespace Server.Items
|
|||
HitPoints = 0;
|
||||
}
|
||||
|
||||
if( wear > 0 )
|
||||
if ( wear > 0 )
|
||||
{
|
||||
if( MaxHitPoints > wear )
|
||||
if ( MaxHitPoints > wear )
|
||||
{
|
||||
MaxHitPoints -= wear;
|
||||
|
||||
if( Parent is Mobile )
|
||||
if ( Parent is Mobile )
|
||||
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
|
||||
}
|
||||
else
|
||||
|
|
@ -116,13 +116,13 @@ namespace Server.Items
|
|||
else
|
||||
{
|
||||
Mobile owner = this.Parent as Mobile;
|
||||
if( owner == null )
|
||||
if ( owner == null )
|
||||
return damage;
|
||||
|
||||
double ar = this.ArmorRating;
|
||||
double chance = (owner.Skills[SkillName.Parry].Value - (ar * 2.0)) / 100.0;
|
||||
|
||||
if( chance < 0.01 )
|
||||
if ( chance < 0.01 )
|
||||
chance = 0.01;
|
||||
/*
|
||||
FORMULA: Displayed AR = ((Parrying Skill * Base AR of Shield) <EFBFBD> 200) + 1
|
||||
|
|
@ -131,25 +131,25 @@ namespace Server.Items
|
|||
|
||||
FORMULA: Melee Damage Absorbed = (AR of Shield) / 2 | Archery Damage Absorbed = AR of Shield
|
||||
*/
|
||||
if( owner.CheckSkill( SkillName.Parry, chance ) )
|
||||
if ( owner.CheckSkill( SkillName.Parry, chance ) )
|
||||
{
|
||||
if( weapon.Skill == SkillName.Archery )
|
||||
if ( weapon.Skill == SkillName.Archery )
|
||||
damage -= (int)ar;
|
||||
else
|
||||
damage -= (int)(ar / 2.0);
|
||||
|
||||
if( damage < 0 )
|
||||
if ( damage < 0 )
|
||||
damage = 0;
|
||||
|
||||
owner.FixedEffect( 0x37B9, 10, 16 );
|
||||
|
||||
if( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability
|
||||
if ( 25 > Utility.Random( 100 ) ) // 25% chance to lower durability
|
||||
{
|
||||
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;
|
||||
|
|
@ -160,13 +160,13 @@ namespace Server.Items
|
|||
HitPoints = 0;
|
||||
}
|
||||
|
||||
if( wear > 0 )
|
||||
if ( wear > 0 )
|
||||
{
|
||||
if( MaxHitPoints > wear )
|
||||
if ( MaxHitPoints > wear )
|
||||
{
|
||||
MaxHitPoints -= wear;
|
||||
|
||||
if( Parent is Mobile )
|
||||
if ( Parent is Mobile )
|
||||
((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061121 ); // Your equipment is severely damaged.
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ namespace Server.Items
|
|||
if ( version < 2 )
|
||||
m_Level = GetRandomLevel();
|
||||
|
||||
if( version < 3 && m_TargetMap == Map.Tokuno )
|
||||
if ( version < 3 && m_TargetMap == Map.Tokuno )
|
||||
m_TargetMap = Map.Trammel;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -153,10 +153,10 @@ namespace Server.Items
|
|||
if ( version < 3 )
|
||||
UpdateHue();
|
||||
|
||||
if( version < 4 && m_TargetMap == Map.Tokuno )
|
||||
if ( version < 4 && m_TargetMap == Map.Tokuno )
|
||||
m_TargetMap = Map.Trammel;
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
|
|
@ -338,4 +338,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Core.ML )
|
||||
if ( version == 0 && Core.ML )
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Core.ML )
|
||||
if ( version == 0 && Core.ML )
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Core.ML )
|
||||
if ( version == 0 && Core.ML )
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,16 +91,16 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
{
|
||||
get
|
||||
{
|
||||
if( m_Held > 0 && ( int )m_Type >= ( int )PotionEffect.Conflagration )
|
||||
if ( m_Held > 0 && ( int )m_Type >= ( int )PotionEffect.Conflagration )
|
||||
{
|
||||
return 1072658 + ( int )m_Type - ( int )PotionEffect.Conflagration;
|
||||
}
|
||||
|
||||
return (m_Held > 0 ? 1041620 + (int)m_Type : 1041641);
|
||||
}
|
||||
return (m_Held > 0 ? 1041620 + (int)m_Type : 1041641);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
|
|
@ -248,7 +248,7 @@ namespace Server.Items
|
|||
|
||||
item.Consume( toHold );
|
||||
|
||||
if( !item.Deleted )
|
||||
if ( !item.Deleted )
|
||||
item.Bounce( from );
|
||||
|
||||
return true;
|
||||
|
|
@ -276,7 +276,7 @@ namespace Server.Items
|
|||
|
||||
item.Consume( toHold );
|
||||
|
||||
if( !item.Deleted )
|
||||
if ( !item.Deleted )
|
||||
item.Bounce( from );
|
||||
|
||||
return true;
|
||||
|
|
@ -342,7 +342,7 @@ namespace Server.Items
|
|||
case PotionEffect.ExplosionLesser: return new LesserExplosionPotion();
|
||||
case PotionEffect.Explosion: return new ExplosionPotion();
|
||||
case PotionEffect.ExplosionGreater: return new GreaterExplosionPotion();
|
||||
|
||||
|
||||
case PotionEffect.Conflagration: return new ConflagrationPotion();
|
||||
case PotionEffect.ConflagrationGreater: return new GreaterConflagrationPotion();
|
||||
|
||||
|
|
@ -356,4 +356,4 @@ namespace Server.Items
|
|||
TileData.ItemTable[0x1940].Height = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ namespace Server.Items
|
|||
m_TargetMap = m.Map;
|
||||
}
|
||||
|
||||
if( !setDesc )
|
||||
if ( !setDesc )
|
||||
m_Description = BaseRegion.GetRuneNameFor( Region.Find( m_Target, m_TargetMap ) );
|
||||
|
||||
CalculateHue();
|
||||
|
|
@ -318,4 +318,4 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version == 0 && Core.ML )
|
||||
if ( version == 0 && Core.ML )
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
if( version == 0 )
|
||||
if ( version == 0 )
|
||||
Stackable = Core.ML;
|
||||
}
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ namespace Server.Items
|
|||
|
||||
public override bool StackWith( Mobile from, Item dropped, bool playSound )
|
||||
{
|
||||
if( dropped is BasePotion && ((BasePotion)dropped).m_PotionEffect == m_PotionEffect )
|
||||
if ( dropped is BasePotion && ((BasePotion)dropped).m_PotionEffect == m_PotionEffect )
|
||||
return base.StackWith( from, dropped, playSound );
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ namespace Server.Items
|
|||
m_MinDamage = min;
|
||||
m_MaxDamage = max;
|
||||
|
||||
if( m_From == null )
|
||||
if ( m_From == null )
|
||||
return;
|
||||
|
||||
int alchemySkill = m_From.Skills.Alchemy.Fixed;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 500236 ); // You should throw it now!
|
||||
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.25 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 3.6 seconds explosion delay
|
||||
else
|
||||
m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 2.6 seconds explosion delay
|
||||
|
|
@ -205,9 +205,9 @@ namespace Server.Items
|
|||
|
||||
to = new Entity( Serial.Zero, new Point3D( p ), map );
|
||||
|
||||
if( p is Mobile )
|
||||
if ( p is Mobile )
|
||||
{
|
||||
if( !RelativeLocation ) // explosion location = current mob location.
|
||||
if ( !RelativeLocation ) // explosion location = current mob location.
|
||||
p = ((Mobile)p).Location;
|
||||
else
|
||||
to = (Mobile)p;
|
||||
|
|
@ -215,7 +215,7 @@ namespace Server.Items
|
|||
|
||||
Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
|
||||
if( m_Potion.Amount > 1 )
|
||||
if ( m_Potion.Amount > 1 )
|
||||
{
|
||||
Mobile.LiftItemDupe( m_Potion, 1 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ namespace Server.Items
|
|||
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
if( Core.SE && Weight == 3.0 )
|
||||
if ( Core.SE && Weight == 3.0 )
|
||||
Weight = 1.0;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ namespace Server.Items
|
|||
return SpellbookType.Necromancer;
|
||||
else if ( spellID >= 200 && spellID < 210 )
|
||||
return SpellbookType.Paladin;
|
||||
else if( spellID >= 400 && spellID < 406 )
|
||||
else if ( spellID >= 400 && spellID < 406 )
|
||||
return SpellbookType.Samurai;
|
||||
else if( spellID >= 500 && spellID < 508 )
|
||||
else if ( spellID >= 500 && spellID < 508 )
|
||||
return SpellbookType.Ninja;
|
||||
else if ( spellID >= 600 && spellID < 617 )
|
||||
return SpellbookType.Arcanist;
|
||||
|
|
@ -597,17 +597,17 @@ namespace Server.Items
|
|||
|
||||
m_AosSkillBonuses.GetProperties( list );
|
||||
|
||||
if( m_Slayer != SlayerName.None )
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
|
|
@ -879,9 +879,9 @@ namespace Server.Items
|
|||
|
||||
if ( magery >= 1000 )
|
||||
{
|
||||
if( magery >= 1200 )
|
||||
if ( magery >= 1200 )
|
||||
propertyCounts = m_LegendPropertyCounts;
|
||||
else if( magery >= 1100 )
|
||||
else if ( magery >= 1100 )
|
||||
propertyCounts = m_ElderPropertyCounts;
|
||||
else
|
||||
propertyCounts = m_GrandPropertyCounts;
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ namespace Server.Items
|
|||
{
|
||||
Mobile master = petPatient.ControlMaster;
|
||||
|
||||
if( master != null && m_Healer == master )
|
||||
if ( master != null && m_Healer == master )
|
||||
{
|
||||
petPatient.ResurrectPet();
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace Server.Items
|
|||
|
||||
Recipe r = this.Recipe;
|
||||
|
||||
if( r != null )
|
||||
if ( r != null )
|
||||
list.Add( 1049644, r.TextDefinition.ToString() ); // [~1_stuff~]
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( !from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
return;
|
||||
|
|
@ -67,11 +67,11 @@ namespace Server.Items
|
|||
|
||||
Recipe r = this.Recipe;
|
||||
|
||||
if( r != null && from is PlayerMobile )
|
||||
if ( r != null && from is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if( !pm.HasRecipe( r ) )
|
||||
if ( !pm.HasRecipe( r ) )
|
||||
{
|
||||
bool allRequiredSkills = true;
|
||||
double chance = r.CraftItem.GetSuccessChance( from, null, r.CraftSystem, false, ref allRequiredSkills );
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace Server.Items
|
|||
{
|
||||
int v = (int)type;
|
||||
|
||||
if( v < 0 || v >= m_Table.Length )
|
||||
if ( v < 0 || v >= m_Table.Length )
|
||||
v = 0;
|
||||
|
||||
return m_Table[v];
|
||||
|
|
@ -101,7 +101,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if( m_Crafter != null )
|
||||
if ( m_Crafter != null )
|
||||
list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
|
||||
//On OSI it says it's exceptional. Intentional difference.
|
||||
|
|
@ -114,7 +114,7 @@ namespace Server.Items
|
|||
|
||||
this.LabelTo( from, 1061133, String.Format( "{0}\t{1}", GetSkillTitle( m_SkillLevel ).ToString(), RepairSkillInfo.GetInfo( m_Skill ).Name ) ); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
|
||||
|
||||
if( m_Crafter != null )
|
||||
if ( m_Crafter != null )
|
||||
this.LabelTo( from, 1050043, m_Crafter.Name ); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ namespace Server.Items
|
|||
|
||||
public RepairDeed( RepairSkillType skill, double level, Mobile crafter, bool normalizeLevel ) : base( 0x14F0 )
|
||||
{
|
||||
if( normalizeLevel )
|
||||
if ( normalizeLevel )
|
||||
SkillLevel = (int)(level/10)*10;
|
||||
else
|
||||
SkillLevel = level;
|
||||
|
|
@ -158,9 +158,9 @@ namespace Server.Items
|
|||
{
|
||||
int skill = (int)(skillLevel/10);
|
||||
|
||||
if( skill >= 11 )
|
||||
if ( skill >= 11 )
|
||||
return (1062008 + skill-11);
|
||||
else if( skill >=5 )
|
||||
else if ( skill >=5 )
|
||||
return (1061123 + skill-5);
|
||||
|
||||
switch( skill )
|
||||
|
|
@ -178,7 +178,7 @@ namespace Server.Items
|
|||
{
|
||||
for( int i = 0; i < RepairSkillInfo.Table.Length; i++ )
|
||||
{
|
||||
if( RepairSkillInfo.Table[i].System == s )
|
||||
if ( RepairSkillInfo.Table[i].System == s )
|
||||
return (RepairSkillType)i;
|
||||
}
|
||||
|
||||
|
|
@ -187,15 +187,15 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( Check( from ) )
|
||||
if ( Check( from ) )
|
||||
Repair.Do( from, RepairSkillInfo.GetInfo( m_Skill ).System, this );
|
||||
}
|
||||
|
||||
public bool Check( Mobile from )
|
||||
{
|
||||
if( !IsChildOf( from.Backpack ) )
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
from.SendLocalizedMessage( 1047012 ); // The contract must be in your backpack to use it.
|
||||
else if( !VerifyRegion( from ) )
|
||||
else if ( !VerifyRegion( from ) )
|
||||
TextDefinition.SendMessageTo( from, RepairSkillInfo.GetInfo( m_Skill ).NotNearbyMessage );
|
||||
else
|
||||
return true;
|
||||
|
|
@ -207,7 +207,7 @@ namespace Server.Items
|
|||
{
|
||||
//TODO: When the entire region system data is in, convert to that instead of a proximity thing.
|
||||
|
||||
if( !m.Region.IsPartOf( typeof( TownRegion ) ) )
|
||||
if ( !m.Region.IsPartOf( typeof( TownRegion ) ) )
|
||||
return false;
|
||||
|
||||
return Server.Factions.Faction.IsNearType( m, RepairSkillInfo.GetInfo( m_Skill ).NearbyTypes, 6 );
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ namespace Server.Items
|
|||
public bool ReplenishesCharges
|
||||
{
|
||||
get { return m_ReplenishesCharges; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if( value != m_ReplenishesCharges && value )
|
||||
if ( value != m_ReplenishesCharges && value )
|
||||
m_LastReplenished = DateTime.UtcNow;
|
||||
|
||||
m_ReplenishesCharges = value;
|
||||
m_ReplenishesCharges = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,17 +109,17 @@ namespace Server.Items
|
|||
|
||||
public void CheckReplenishUses( bool invalidate )
|
||||
{
|
||||
if( !m_ReplenishesCharges || m_UsesRemaining >= InitMaxUses )
|
||||
if ( !m_ReplenishesCharges || m_UsesRemaining >= InitMaxUses )
|
||||
return;
|
||||
|
||||
if( m_LastReplenished + ChargeReplenishRate < DateTime.UtcNow )
|
||||
if ( m_LastReplenished + ChargeReplenishRate < DateTime.UtcNow )
|
||||
{
|
||||
TimeSpan timeDifference = DateTime.UtcNow - m_LastReplenished;
|
||||
|
||||
m_UsesRemaining = Math.Min( m_UsesRemaining + (int)( timeDifference.Ticks / ChargeReplenishRate.Ticks), InitMaxUses ); //How rude of TimeSpan to not allow timespan division.
|
||||
m_LastReplenished = DateTime.UtcNow;
|
||||
|
||||
if( invalidate )
|
||||
if ( invalidate )
|
||||
InvalidateProperties();
|
||||
|
||||
}
|
||||
|
|
@ -354,24 +354,24 @@ namespace Server.Items
|
|||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
if ( m_ReplenishesCharges )
|
||||
list.Add( 1070928 ); // Replenish Charges
|
||||
|
||||
if( m_Slayer != SlayerName.None )
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_UsesRemaining != oldUses )
|
||||
if ( m_UsesRemaining != oldUses )
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InvalidateProperties ) );
|
||||
}
|
||||
|
||||
|
|
@ -390,21 +390,21 @@ namespace Server.Items
|
|||
if ( m_Quality == InstrumentQuality.Exceptional )
|
||||
attrs.Add( new EquipInfoAttribute( 1018305 - (int)m_Quality ) );
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
if ( m_ReplenishesCharges )
|
||||
attrs.Add( new EquipInfoAttribute( 1070928 ) ); // Replenish Charges
|
||||
|
||||
// TODO: Must this support item identification?
|
||||
if( m_Slayer != SlayerName.None )
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ namespace Server.Items
|
|||
writer.Write( (int) 3 ); // version
|
||||
|
||||
writer.Write( m_ReplenishesCharges );
|
||||
if( m_ReplenishesCharges )
|
||||
if ( m_ReplenishesCharges )
|
||||
writer.Write( m_LastReplenished );
|
||||
|
||||
|
||||
|
|
@ -467,7 +467,7 @@ namespace Server.Items
|
|||
{
|
||||
m_ReplenishesCharges = reader.ReadBool();
|
||||
|
||||
if( m_ReplenishesCharges )
|
||||
if ( m_ReplenishesCharges )
|
||||
m_LastReplenished = reader.ReadDateTime();
|
||||
|
||||
goto case 2;
|
||||
|
|
@ -484,7 +484,7 @@ namespace Server.Items
|
|||
|
||||
m_WellSound = reader.ReadEncodedInt();
|
||||
m_BadlySound = reader.ReadEncodedInt();
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
|
|
@ -584,4 +584,4 @@ namespace Server.Items
|
|||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace Server.Items
|
|||
{
|
||||
case 1: // Okay
|
||||
{
|
||||
if( info.Switches.Length > 0 )
|
||||
if ( info.Switches.Length > 0 )
|
||||
{
|
||||
m_Callback( m_From, m_State, info.Switches[ 0 ] );
|
||||
}
|
||||
|
|
@ -79,4 +79,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ namespace Server.Items
|
|||
|
||||
public virtual void SetTubHue( Mobile from, object state, int hue )
|
||||
{
|
||||
if( state is DyeTub )
|
||||
if ( state is DyeTub )
|
||||
{
|
||||
DyeTub tub = state as DyeTub;
|
||||
|
||||
|
|
@ -95,11 +95,11 @@ namespace Server.Items
|
|||
|
||||
if ( tub.Redyable )
|
||||
{
|
||||
if( tub.MetallicHues ) /* OSI has three metallic tubs now */
|
||||
if ( tub.MetallicHues ) /* OSI has three metallic tubs now */
|
||||
{
|
||||
from.SendGump( new MetallicHuePicker( from, new MetallicHuePicker.MetallicHuePickerCallback( SetTubHue ), tub ) );
|
||||
}
|
||||
else if( tub.CustomHuePicker != null )
|
||||
else if ( tub.CustomHuePicker != null )
|
||||
{
|
||||
from.SendGump( new CustomHuePickerGump( from, tub.CustomHuePicker, new CustomHuePickerCallback( SetTubHue ), tub ) );
|
||||
}
|
||||
|
|
@ -124,4 +124,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ namespace Server.Items
|
|||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
}
|
||||
else */
|
||||
if( Core.AOS && targeted == from )
|
||||
if ( Core.AOS && targeted == from )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062845 + Utility.Random( 3 ) ); //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
|
||||
}
|
||||
|
|
@ -71,9 +71,9 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 1063305 ); // Didn't your parents ever tell you not to run with scissors in your hand?!
|
||||
}
|
||||
else if( targeted is Item && !((Item)targeted).Movable )
|
||||
else if ( targeted is Item && !((Item)targeted).Movable )
|
||||
{
|
||||
if( targeted is IScissorable && ( targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore ) )
|
||||
if ( targeted is IScissorable && ( targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore ) )
|
||||
{
|
||||
IScissorable obj = (IScissorable) targeted;
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ namespace Server.Items
|
|||
AosElementAttribute.Poison
|
||||
};
|
||||
|
||||
if( randomizeOrder )
|
||||
if ( randomizeOrder )
|
||||
{
|
||||
for( int i = 0; i < attrs.Length; i++ )
|
||||
{
|
||||
|
|
@ -399,7 +399,7 @@ namespace Server.Items
|
|||
|
||||
private static int AssignElementalDamage( BaseWeapon weapon, AosElementAttribute attr, int totalDamage )
|
||||
{
|
||||
if( totalDamage <= 0 )
|
||||
if ( totalDamage <= 0 )
|
||||
return 0;
|
||||
|
||||
int random = Utility.Random( (int)(totalDamage/10) + 1 ) * 10;
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@ namespace Server.Items
|
|||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if( dropped is Bandage )
|
||||
if ( dropped is Bandage )
|
||||
{
|
||||
bool allow = base.OnDragDrop( from, dropped );
|
||||
|
||||
if( allow )
|
||||
if ( allow )
|
||||
Enhance( from );
|
||||
|
||||
return allow;
|
||||
|
|
@ -127,11 +127,11 @@ namespace Server.Items
|
|||
|
||||
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
|
||||
{
|
||||
if( item is Bandage )
|
||||
if ( item is Bandage )
|
||||
{
|
||||
bool allow = base.OnDragDropInto( from, item, p );
|
||||
|
||||
if( allow )
|
||||
if ( allow )
|
||||
Enhance( from );
|
||||
|
||||
return allow;
|
||||
|
|
@ -152,7 +152,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if( m_Timer != null )
|
||||
if ( m_Timer != null )
|
||||
m_Timer.Stop();
|
||||
|
||||
base.OnDelete();
|
||||
|
|
@ -178,7 +178,7 @@ namespace Server.Items
|
|||
|
||||
DateTime next = reader.ReadDateTime();
|
||||
|
||||
if( next < DateTime.UtcNow )
|
||||
if ( next < DateTime.UtcNow )
|
||||
m_Timer = Timer.DelayCall( TimeSpan.Zero, RechargeTime, new TimerCallback( Recharge ) );
|
||||
else
|
||||
m_Timer = Timer.DelayCall( next - DateTime.UtcNow, RechargeTime, new TimerCallback( Recharge ) );
|
||||
|
|
@ -200,11 +200,11 @@ namespace Server.Items
|
|||
|
||||
Bandage bandage = Items[i] as Bandage;
|
||||
|
||||
if( bandage != null )
|
||||
if ( bandage != null )
|
||||
{
|
||||
Item enhanced;
|
||||
|
||||
if( bandage.Amount > m_Charges )
|
||||
if ( bandage.Amount > m_Charges )
|
||||
{
|
||||
bandage.Amount -= m_Charges;
|
||||
enhanced = new EnhancedBandage( m_Charges );
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Server.Items
|
|||
{
|
||||
bool allow = base.OnMoveOver( m );
|
||||
|
||||
if( allow && Addon is BedOfNailsAddon )
|
||||
if ( allow && Addon is BedOfNailsAddon )
|
||||
( (BedOfNailsAddon)Addon ).OnMoveOver( m );
|
||||
|
||||
return allow;
|
||||
|
|
@ -64,17 +64,17 @@ namespace Server.Items
|
|||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if( m.Alive && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) )
|
||||
if ( m.Alive && ( m.AccessLevel == AccessLevel.Player || !m.Hidden ) )
|
||||
{
|
||||
if( m.Player )
|
||||
if ( m.Player )
|
||||
{
|
||||
if( m.Female )
|
||||
if ( m.Female )
|
||||
Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53B, 0x53D ) );
|
||||
else
|
||||
Effects.PlaySound( Location, Map, Utility.RandomMinMax( 0x53E, 0x540 ) );
|
||||
}
|
||||
|
||||
if( m_Timer == null || !m_Timer.Running )
|
||||
if ( m_Timer == null || !m_Timer.Running )
|
||||
( m_Timer = new InternalTimer( m ) ).Start();
|
||||
}
|
||||
|
||||
|
|
@ -124,13 +124,13 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if( m_Mobile == null || m_Mobile.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
|
||||
if ( m_Mobile == null || m_Mobile.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_Location != m_Mobile.Location )
|
||||
if ( m_Location != m_Mobile.Location )
|
||||
{
|
||||
int amount = Utility.RandomMinMax( 0, 7 );
|
||||
|
||||
|
|
@ -140,11 +140,11 @@ namespace Server.Items
|
|||
int y = m_Mobile.Y + Utility.RandomMinMax( -1, 1 );
|
||||
int z = m_Mobile.Z;
|
||||
|
||||
if( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
|
||||
if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
|
||||
{
|
||||
z = m_Mobile.Map.GetAverageZ( x, y );
|
||||
|
||||
if( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
|
||||
if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace Server.Mobiles
|
|||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if( version < 1 )
|
||||
if ( version < 1 )
|
||||
{
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 0 ), new TimerCallback( OnAfterDeserialize_Callback ) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,11 +160,11 @@ namespace Server.Items
|
|||
m_Type = value;
|
||||
ItemID = MonsterStatuetteInfo.GetInfo( m_Type ).ItemID;
|
||||
|
||||
if( m_Type == MonsterStatuetteType.Slime )
|
||||
if ( m_Type == MonsterStatuetteType.Slime )
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
else if( m_Type == MonsterStatuetteType.RedDeath )
|
||||
else if ( m_Type == MonsterStatuetteType.RedDeath )
|
||||
Hue = 0x21;
|
||||
else if( m_Type == MonsterStatuetteType.HalloweenGhoul )
|
||||
else if ( m_Type == MonsterStatuetteType.HalloweenGhoul )
|
||||
Hue = 0xF4;
|
||||
else
|
||||
Hue = 0;
|
||||
|
|
@ -195,11 +195,11 @@ namespace Server.Items
|
|||
|
||||
m_Type = type;
|
||||
|
||||
if( m_Type == MonsterStatuetteType.Slime )
|
||||
if ( m_Type == MonsterStatuetteType.Slime )
|
||||
Hue = Utility.RandomSlimeHue();
|
||||
else if( m_Type == MonsterStatuetteType.RedDeath )
|
||||
else if ( m_Type == MonsterStatuetteType.RedDeath )
|
||||
Hue = 0x21;
|
||||
else if( m_Type == MonsterStatuetteType.HalloweenGhoul )
|
||||
else if ( m_Type == MonsterStatuetteType.HalloweenGhoul )
|
||||
Hue = 0xF4;
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ namespace Server.Items
|
|||
{
|
||||
int[] sounds = MonsterStatuetteInfo.GetInfo( m_Type ).Sounds;
|
||||
|
||||
if( sounds.Length > 0 )
|
||||
if ( sounds.Length > 0 )
|
||||
Effects.PlaySound( this.Location, this.Map, sounds[Utility.Random( sounds.Length )] );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
set
|
||||
{
|
||||
if( value != m_Quantity )
|
||||
if ( value != m_Quantity )
|
||||
{
|
||||
m_Quantity = ( value < 1 ) ? 0 : ( value > MaxQuantity ) ? MaxQuantity : value;
|
||||
|
||||
|
|
@ -31,11 +31,11 @@
|
|||
|
||||
ItemID = ( IsEmpty ) ? voidItem_ID : fullItem_ID;
|
||||
|
||||
if( !IsEmpty )
|
||||
if ( !IsEmpty )
|
||||
{
|
||||
IEntity rootParent = RootParent;
|
||||
|
||||
if( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
|
||||
if ( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
|
||||
MoveToWorld( rootParent.Location, rootParent.Map );
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
|
|
@ -62,13 +62,13 @@
|
|||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Name == null )
|
||||
if ( Name == null )
|
||||
LabelTo( from, LabelNumber );
|
||||
else
|
||||
LabelTo( from, Name );
|
||||
|
|
@ -77,13 +77,13 @@
|
|||
|
||||
public override void OnAosSingleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
base.OnAosSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Name == null )
|
||||
if ( Name == null )
|
||||
LabelTo( from, LabelNumber );
|
||||
else
|
||||
LabelTo( from, Name );
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
|
||||
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
|
||||
{
|
||||
if( !IsEmpty )
|
||||
if ( !IsEmpty )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,15 +155,15 @@ namespace Server.Items
|
|||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
{
|
||||
from.SendMessage( "You may not do that in jail." );
|
||||
}
|
||||
else if( !this.IsChildOf( from.Backpack ) )
|
||||
else if ( !this.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
|
||||
}
|
||||
else if( this.Charges == 0 )
|
||||
else if ( this.Charges == 0 )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo( this, from, 1042544, 0x59 ); // This item is out of charges.
|
||||
}
|
||||
|
|
@ -187,11 +187,11 @@ namespace Server.Items
|
|||
if ( m_Bag.Deleted )
|
||||
return;
|
||||
|
||||
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
if ( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
{
|
||||
from.SendMessage( "You may not do that in jail." );
|
||||
}
|
||||
else if( !m_Bag.IsChildOf( from.Backpack ) )
|
||||
else if ( !m_Bag.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ namespace Server.Items
|
|||
|
||||
AnimalFormContext animalContext = AnimalForm.GetContext( from );
|
||||
|
||||
if( Core.ML && animalContext != null )
|
||||
if ( Core.ML && animalContext != null )
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1080073 ); // You cannot use a Crystal Ball of Pet Summoning while in animal form.
|
||||
return;
|
||||
|
|
@ -266,7 +266,7 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
new PetSummoningSpell( this, from ).Cast();
|
||||
else
|
||||
SummonPet( from );
|
||||
|
|
@ -436,7 +436,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckDisturb( DisturbType type, bool checkFirst, bool resistable )
|
||||
{
|
||||
if( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
|
||||
if ( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -444,19 +444,19 @@ namespace Server.Items
|
|||
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
if( !m_Stop )
|
||||
if ( !m_Stop )
|
||||
base.DoHurtFizzle();
|
||||
}
|
||||
|
||||
public override void DoFizzle()
|
||||
{
|
||||
if( !m_Stop )
|
||||
if ( !m_Stop )
|
||||
base.DoFizzle();
|
||||
}
|
||||
|
||||
public override void OnDisturb( DisturbType type, bool message )
|
||||
{
|
||||
if( message && !m_Stop )
|
||||
if ( message && !m_Stop )
|
||||
Caster.SendLocalizedMessage( 1080074 ); // You have been disrupted while attempting to summon your pet!
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace Server.Items
|
|||
{
|
||||
m_ActiveItemID = value;
|
||||
|
||||
if( !IsEmpty )
|
||||
if ( !IsEmpty )
|
||||
this.ItemID = m_ActiveItemID;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ namespace Server.Items
|
|||
{
|
||||
m_InactiveItemID = value;
|
||||
|
||||
if( IsEmpty )
|
||||
if ( IsEmpty )
|
||||
this.ItemID = m_InactiveItemID;
|
||||
}
|
||||
}
|
||||
|
|
@ -642,11 +642,11 @@ namespace Server.Items
|
|||
|
||||
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
|
||||
|
||||
if( m_Stone is SoulstoneFragment )
|
||||
if ( m_Stone is SoulstoneFragment )
|
||||
{
|
||||
SoulstoneFragment frag = m_Stone as SoulstoneFragment;
|
||||
|
||||
if( --frag.UsesRemaining <= 0 )
|
||||
if ( --frag.UsesRemaining <= 0 )
|
||||
from.SendLocalizedMessage( 1070974 ); // You have used up your soulstone fragment.
|
||||
}
|
||||
}
|
||||
|
|
@ -807,7 +807,7 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
if( version == 0 )
|
||||
if ( version == 0 )
|
||||
{
|
||||
m_ActiveItemID = 0x2A94;
|
||||
m_InactiveItemID = 0x2A93;
|
||||
|
|
@ -879,9 +879,9 @@ namespace Server.Items
|
|||
|
||||
m_UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
if( version <= 1 )
|
||||
if ( version <= 1 )
|
||||
{
|
||||
if( ItemID == 0x2A93 || ItemID == 0x2A94 )
|
||||
if ( ItemID == 0x2A93 || ItemID == 0x2A94 )
|
||||
{
|
||||
ActiveItemID = Utility.Random( 0x2AA1, 9 );
|
||||
}
|
||||
|
|
@ -905,9 +905,9 @@ namespace Server.Items
|
|||
{
|
||||
bool canUse = base.CheckUse( from );
|
||||
|
||||
if( canUse )
|
||||
if ( canUse )
|
||||
{
|
||||
if( m_UsesRemaining <= 0 )
|
||||
if ( m_UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070975 ); // That soulstone fragment has no more uses.
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -132,9 +132,9 @@ namespace Server.Items
|
|||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if( info.ButtonID == 1 || info.ButtonID == 2 )
|
||||
if ( info.ButtonID == 1 || info.ButtonID == 2 )
|
||||
{
|
||||
if( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
|
||||
if ( from.Map == null || !from.Map.CanFit( from.Location, 16, false, false ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
if( relay.Text.Length > 64 )
|
||||
if ( relay.Text.Length > 64 )
|
||||
m_Target.EngravedText = Utility.FixHtml( relay.Text.Substring( 0, 64 ) );
|
||||
else
|
||||
m_Target.EngravedText = Utility.FixHtml( relay.Text );
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Server.Items
|
|||
//DropItem( new Bolt( 10 ) );
|
||||
|
||||
// Gems
|
||||
if( Utility.RandomBool() == true )
|
||||
if ( Utility.RandomBool() == true )
|
||||
{
|
||||
Item GemLoot = Loot.RandomGem();
|
||||
GemLoot.Amount = Utility.Random( 1, 3 );
|
||||
|
|
@ -83,19 +83,19 @@ namespace Server.Items
|
|||
}
|
||||
|
||||
// Weapon
|
||||
if( Utility.RandomBool() == true )
|
||||
if ( Utility.RandomBool() == true )
|
||||
DropItem( Loot.RandomWeapon() );
|
||||
|
||||
// Armour
|
||||
if( Utility.RandomBool() == true )
|
||||
if ( Utility.RandomBool() == true )
|
||||
DropItem( Loot.RandomArmorOrShield() );
|
||||
|
||||
// Clothing
|
||||
if( Utility.RandomBool() == true )
|
||||
if ( Utility.RandomBool() == true )
|
||||
DropItem( Loot.RandomClothing() );
|
||||
|
||||
// Jewelry
|
||||
if( Utility.RandomBool() == true )
|
||||
if ( Utility.RandomBool() == true )
|
||||
DropItem( Loot.RandomJewelry() );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ namespace Server.Items
|
|||
{
|
||||
Item item = Loot.RandomArmorOrShieldOrWeapon();
|
||||
|
||||
if( item is BaseWeapon )
|
||||
if ( item is BaseWeapon )
|
||||
{
|
||||
BaseWeapon weapon = ( BaseWeapon )item;
|
||||
weapon.DamageLevel = ( WeaponDamageLevel )Utility.Random( m_Level );
|
||||
|
|
@ -125,7 +125,7 @@ namespace Server.Items
|
|||
weapon.DurabilityLevel = ( WeaponDurabilityLevel )Utility.Random( m_Level );
|
||||
weapon.Quality = WeaponQuality.Regular;
|
||||
}
|
||||
else if( item is BaseArmor )
|
||||
else if ( item is BaseArmor )
|
||||
{
|
||||
BaseArmor armor = ( BaseArmor )item;
|
||||
armor.ProtectionLevel = ( ArmorProtectionLevel )Utility.Random( m_Level );
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ namespace Server.Items
|
|||
{
|
||||
Item item = Loot.RandomArmorOrShieldOrWeapon();
|
||||
|
||||
if( item is BaseWeapon )
|
||||
if ( item is BaseWeapon )
|
||||
{
|
||||
BaseWeapon weapon = ( BaseWeapon )item;
|
||||
weapon.DamageLevel = ( WeaponDamageLevel )Utility.Random( m_Level );
|
||||
|
|
@ -132,7 +132,7 @@ namespace Server.Items
|
|||
weapon.DurabilityLevel = ( WeaponDurabilityLevel )Utility.Random( m_Level );
|
||||
weapon.Quality = WeaponQuality.Regular;
|
||||
}
|
||||
else if( item is BaseArmor )
|
||||
else if ( item is BaseArmor )
|
||||
{
|
||||
BaseArmor armor = ( BaseArmor )item;
|
||||
armor.ProtectionLevel = ( ArmorProtectionLevel )Utility.Random( m_Level );
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -28,7 +28,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
|
@ -41,7 +41,7 @@ namespace Server.Items
|
|||
|
||||
DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;
|
||||
|
||||
if( info != null )
|
||||
if ( info != null )
|
||||
EndDefense( (object)info );
|
||||
|
||||
ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, 50 + modifier );
|
||||
|
|
@ -76,7 +76,7 @@ namespace Server.Items
|
|||
{
|
||||
DefenseMasteryInfo info = m_Table[targ] as DefenseMasteryInfo;
|
||||
|
||||
if( info == null )
|
||||
if ( info == null )
|
||||
return false;
|
||||
|
||||
damageMalus = info.m_DamageMalus;
|
||||
|
|
@ -87,10 +87,10 @@ namespace Server.Items
|
|||
{
|
||||
DefenseMasteryInfo info = (DefenseMasteryInfo)state;
|
||||
|
||||
if( info.m_Mod != null )
|
||||
if ( info.m_Mod != null )
|
||||
info.m_From.RemoveResistanceMod( info.m_Mod );
|
||||
|
||||
if( info.m_Timer != null )
|
||||
if ( info.m_Timer != null )
|
||||
info.m_Timer.Stop();
|
||||
|
||||
// No message is sent to the player.
|
||||
|
|
|
|||
|
|
@ -90,15 +90,15 @@ namespace Server.Items
|
|||
defender.Mount.Rider = null;
|
||||
}
|
||||
|
||||
if( attacker is PlayerMobile )
|
||||
if ( attacker is PlayerMobile )
|
||||
{
|
||||
(attacker as PlayerMobile).SetMountBlock(BlockMountType.DismountRecovery, RemountDelay, true );
|
||||
}
|
||||
else if( Core.ML && attacker is BaseCreature )
|
||||
else if ( Core.ML && attacker is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = attacker as BaseCreature;
|
||||
|
||||
if( bc.ControlMaster is PlayerMobile )
|
||||
if ( bc.ControlMaster is PlayerMobile )
|
||||
{
|
||||
PlayerMobile pm = bc.ControlMaster as PlayerMobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -37,9 +37,9 @@ namespace Server.Items
|
|||
|
||||
public override bool Validate( Mobile from )
|
||||
{
|
||||
if( base.Validate( from ) )
|
||||
if ( base.Validate( from ) )
|
||||
{
|
||||
if( from.Mounted )
|
||||
if ( from.Mounted )
|
||||
return true;
|
||||
else
|
||||
{
|
||||
|
|
@ -53,7 +53,7 @@ namespace Server.Items
|
|||
|
||||
public void Use( Mobile attacker, Mobile defender )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) || attacker.Weapon == null ) //sanity
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) || attacker.Weapon == null ) //sanity
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063352, "50" ); // You need ~1_SKILL_REQUIREMENT~ Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -32,10 +32,10 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
if( Registry.Contains( attacker ) )
|
||||
if ( Registry.Contains( attacker ) )
|
||||
{
|
||||
DualWieldTimer existingtimer = (DualWieldTimer)Registry[attacker];
|
||||
existingtimer.Stop();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -32,10 +32,10 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
if( Registry.Contains( defender ) )
|
||||
if ( Registry.Contains( defender ) )
|
||||
{
|
||||
FeintTimer existingtimer = (FeintTimer)Registry[defender];
|
||||
existingtimer.Stop();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 && GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063347, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -33,19 +33,19 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) ) //Mana check after check that there are targets
|
||||
if ( !Validate( attacker ) ) //Mana check after check that there are targets
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
||||
Map map = attacker.Map;
|
||||
|
||||
if( map == null )
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
BaseWeapon weapon = attacker.Weapon as BaseWeapon;
|
||||
|
||||
if( weapon == null )
|
||||
if ( weapon == null )
|
||||
return;
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
|
|
@ -59,22 +59,22 @@ namespace Server.Items
|
|||
{
|
||||
Mobile m = (Mobile)list[i];
|
||||
|
||||
if( m != defender && m != attacker && SpellHelper.ValidIndirectTarget( attacker, m ) )
|
||||
if ( m != defender && m != attacker && SpellHelper.ValidIndirectTarget( attacker, m ) )
|
||||
{
|
||||
if( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) )
|
||||
if ( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) )
|
||||
continue;
|
||||
|
||||
if( !attacker.InRange( m, weapon.MaxRange ) )
|
||||
if ( !attacker.InRange( m, weapon.MaxRange ) )
|
||||
continue;
|
||||
|
||||
if( attacker.InLOS( m ) )
|
||||
if ( attacker.InLOS( m ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
}
|
||||
|
||||
if( targets.Count > 0 )
|
||||
if ( targets.Count > 0 )
|
||||
{
|
||||
if( !CheckMana( attacker, true ) )
|
||||
if ( !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
attacker.FixedEffect( 0x3728, 10, 15 );
|
||||
|
|
@ -90,7 +90,7 @@ namespace Server.Items
|
|||
|
||||
Timer t = Registry[m] as Timer;
|
||||
|
||||
if( t != null )
|
||||
if ( t != null )
|
||||
{
|
||||
t.Stop();
|
||||
Registry.Remove( m );
|
||||
|
|
@ -136,7 +136,7 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
if ( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
{
|
||||
Stop();
|
||||
Server.Items.FrenziedWhirlwind.Registry.Remove( m_Defender );
|
||||
|
|
@ -146,18 +146,18 @@ namespace Server.Items
|
|||
m_DamageRemaining -= DamagePerTick;
|
||||
m_DamageToDo += DamagePerTick;
|
||||
|
||||
if( m_DamageRemaining <= 0 && m_DamageToDo < 1 )
|
||||
if ( m_DamageRemaining <= 0 && m_DamageToDo < 1 )
|
||||
m_DamageToDo = 1.0; //Confirm this 'round up' at the end
|
||||
|
||||
int damage = (int)m_DamageToDo;
|
||||
|
||||
if( damage > 0 )
|
||||
if ( damage > 0 )
|
||||
{
|
||||
m_Defender.Damage( damage, m_Attacker );
|
||||
m_DamageToDo -= damage;
|
||||
}
|
||||
|
||||
if( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
if ( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
{
|
||||
Stop();
|
||||
Server.Items.FrenziedWhirlwind.Registry.Remove( m_Defender );
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit(Mobile attacker, Mobile defender, int damage)
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070768, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -27,7 +27,7 @@ namespace Server.Items
|
|||
|
||||
public override bool OnBeforeSwing( Mobile attacker, Mobile defender )
|
||||
{
|
||||
if( defender.Paralyzed )
|
||||
if ( defender.Paralyzed )
|
||||
{
|
||||
attacker.SendLocalizedMessage( 1061923 ); // The target is already frozen.
|
||||
return false;
|
||||
|
|
@ -38,7 +38,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
|
@ -70,7 +70,7 @@ namespace Server.Items
|
|||
Server.Items.ParalyzingBlow.BeginImmunity( defender, Server.Items.ParalyzingBlow.FreezeDelayDuration );
|
||||
}
|
||||
}
|
||||
else if( !cantpara )
|
||||
else if ( !cantpara )
|
||||
{
|
||||
AOS.Damage( defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0 ); //10-25
|
||||
defender.Freeze(TimeSpan.FromSeconds(2.0));
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace Server.Items
|
|||
|
||||
public override bool OnBeforeSwing( Mobile attacker, Mobile defender )
|
||||
{
|
||||
if( defender.Paralyzed )
|
||||
if ( defender.Paralyzed )
|
||||
{
|
||||
attacker.SendLocalizedMessage( 1061923 ); // The target is already frozen.
|
||||
return false;
|
||||
|
|
@ -61,12 +61,12 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
||||
if( IsImmune( defender ) ) //Intentionally going after Mana consumption
|
||||
if ( IsImmune( defender ) ) //Intentionally going after Mana consumption
|
||||
{
|
||||
attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
|
||||
defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Bushido ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1070768, "50" ); // You need ~1_SKILL_REQUIREMENT~ Bushido skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -33,24 +33,24 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( !defender.Mounted )
|
||||
if ( !defender.Mounted )
|
||||
{
|
||||
attacker.SendLocalizedMessage( 1060848 ); // This attack only works on mounted targets
|
||||
ClearCurrentAbility( attacker );
|
||||
return;
|
||||
}
|
||||
|
||||
if( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
||||
if( !attacker.Mounted )
|
||||
if ( !attacker.Mounted )
|
||||
{
|
||||
Mobile mount = defender.Mount as Mobile;
|
||||
BaseMount.Dismount( defender );
|
||||
|
||||
if( mount != null ) //Ethy mounts don't take damage
|
||||
if ( mount != null ) //Ethy mounts don't take damage
|
||||
{
|
||||
int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ namespace Server.Items
|
|||
|
||||
AOS.Damage( defender, attacker, amount, 100, 0, 0, 0, 0 );
|
||||
|
||||
if( Server.Items.ParalyzingBlow.IsImmune( defender ) ) //Does it still do damage?
|
||||
if ( Server.Items.ParalyzingBlow.IsImmune( defender ) ) //Does it still do damage?
|
||||
{
|
||||
attacker.SendLocalizedMessage( 1070804 ); // Your target resists paralysis.
|
||||
defender.SendLocalizedMessage( 1070813 ); // You resist paralysis.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Server.Items
|
|||
|
||||
public override bool CheckSkills( Mobile from )
|
||||
{
|
||||
if( GetSkill( from, SkillName.Ninjitsu ) < 50.0 )
|
||||
if ( GetSkill( from, SkillName.Ninjitsu ) < 50.0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063352, "50" ); // You need ~1_SKILL_REQUIREMENT~ Ninjitsu skill to perform that attack!
|
||||
return false;
|
||||
|
|
@ -33,7 +33,7 @@ namespace Server.Items
|
|||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if( Registry.Contains( defender ) || !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
if ( Registry.Contains( defender ) || !Validate( attacker ) || !CheckMana( attacker, true ) )
|
||||
return;
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
|
|
@ -73,7 +73,7 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
if ( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
{
|
||||
Stop();
|
||||
Server.Items.TalonStrike.Registry.Remove( m_Defender );
|
||||
|
|
@ -83,19 +83,19 @@ namespace Server.Items
|
|||
m_DamageRemaining -= DamagePerTick;
|
||||
m_DamageToDo += DamagePerTick;
|
||||
|
||||
if( m_DamageRemaining <= 0 && m_DamageToDo < 1 )
|
||||
if ( m_DamageRemaining <= 0 && m_DamageToDo < 1 )
|
||||
m_DamageToDo = 1.0; //Confirm this 'round up' at the end
|
||||
|
||||
int damage = (int)m_DamageToDo;
|
||||
|
||||
if( damage > 0 )
|
||||
if ( damage > 0 )
|
||||
{
|
||||
//m_Defender.Damage( damage, m_Attacker, false );
|
||||
m_Defender.Hits -= damage; //Don't show damage, don't disrupt
|
||||
m_DamageToDo -= damage;
|
||||
}
|
||||
|
||||
if( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
if ( !m_Defender.Alive || m_DamageRemaining <= 0 )
|
||||
{
|
||||
Stop();
|
||||
Server.Items.TalonStrike.Registry.Remove( m_Defender );
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace Server.Items
|
|||
|
||||
if ( from.Mana < mana )
|
||||
{
|
||||
if( ( from is BaseCreature ) && ( from as BaseCreature ).HasManaOveride )
|
||||
if ( ( from is BaseCreature ) && ( from as BaseCreature ).HasManaOveride )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -176,7 +176,7 @@ namespace Server.Items
|
|||
if ( state == null )
|
||||
return false;
|
||||
|
||||
if( RequiresSE && !state.SupportsExpansion( Expansion.SE ) )
|
||||
if ( RequiresSE && !state.SupportsExpansion( Expansion.SE ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1063456 ); // You must upgrade to Samurai Empire in order to use that ability.
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -578,9 +578,9 @@ namespace Server.Items
|
|||
if ( !Ethics.Ethic.CheckEquip( from, this ) )
|
||||
return false;
|
||||
|
||||
if( RequiredRace != null && from.Race != RequiredRace )
|
||||
if ( RequiredRace != null && from.Race != RequiredRace )
|
||||
{
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
from.SendLocalizedMessage( 1072203 ); // Only Elves may use this.
|
||||
else
|
||||
from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName );
|
||||
|
|
@ -893,15 +893,15 @@ namespace Server.Items
|
|||
// Bonus granted by successful use of Honorable Execution.
|
||||
bonus += HonorableExecution.GetSwingBonus( m );
|
||||
|
||||
if( DualWield.Registry.Contains( m ) )
|
||||
if ( DualWield.Registry.Contains( m ) )
|
||||
bonus += ((DualWield.DualWieldTimer)DualWield.Registry[m]).BonusSwingSpeed;
|
||||
|
||||
if( Feint.Registry.Contains( m ) )
|
||||
if ( Feint.Registry.Contains( m ) )
|
||||
bonus -= ((Feint.FeintTimer)Feint.Registry[m]).SwingSpeedReduction;
|
||||
|
||||
TransformContext context = TransformationSpellHelper.GetContext( m );
|
||||
|
||||
if( context != null && context.Spell is ReaperFormSpell )
|
||||
if ( context != null && context.Spell is ReaperFormSpell )
|
||||
bonus += ((ReaperFormSpell)context.Spell).SwingSpeedBonus;
|
||||
|
||||
int discordanceEffect = 0;
|
||||
|
|
@ -910,7 +910,7 @@ namespace Server.Items
|
|||
if ( SkillHandlers.Discordance.GetEffect( m, ref discordanceEffect ) )
|
||||
bonus -= discordanceEffect;
|
||||
|
||||
if( EssenceOfWindSpell.IsDebuffed( m ) )
|
||||
if ( EssenceOfWindSpell.IsDebuffed( m ) )
|
||||
bonus -= EssenceOfWindSpell.GetSSIMalus( m );
|
||||
|
||||
if ( bonus > 60 )
|
||||
|
|
@ -985,12 +985,12 @@ namespace Server.Items
|
|||
{
|
||||
WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
|
||||
|
||||
if( a != null && !a.OnBeforeSwing( attacker, defender ) )
|
||||
if ( a != null && !a.OnBeforeSwing( attacker, defender ) )
|
||||
WeaponAbility.ClearCurrentAbility( attacker );
|
||||
|
||||
SpecialMove move = SpecialMove.GetCurrentMove( attacker );
|
||||
|
||||
if( move != null && !move.OnBeforeSwing( attacker, defender ) )
|
||||
if ( move != null && !move.OnBeforeSwing( attacker, defender ) )
|
||||
SpecialMove.ClearCurrentMove( attacker );
|
||||
}
|
||||
|
||||
|
|
@ -1135,22 +1135,22 @@ namespace Server.Items
|
|||
double aosChance = parry / 800.0;
|
||||
|
||||
// Parry or Bushido over 100 grant a 5% bonus.
|
||||
if( parry >= 100.0 )
|
||||
if ( parry >= 100.0 )
|
||||
{
|
||||
chance += 0.05;
|
||||
aosChance += 0.05;
|
||||
}
|
||||
else if( bushido >= 100.0 )
|
||||
else if ( bushido >= 100.0 )
|
||||
{
|
||||
chance += 0.05;
|
||||
}
|
||||
|
||||
// Evasion grants a variable bonus post ML. 50% prior.
|
||||
if( Evasion.IsEvading( defender ) )
|
||||
if ( Evasion.IsEvading( defender ) )
|
||||
chance *= Evasion.GetParryScalar( defender );
|
||||
|
||||
// Low dexterity lowers the chance.
|
||||
if( defender.Dex < 80 )
|
||||
if ( defender.Dex < 80 )
|
||||
chance = chance * (20 + defender.Dex) / 100;
|
||||
|
||||
if ( chance > aosChance )
|
||||
|
|
@ -1216,15 +1216,15 @@ namespace Server.Items
|
|||
|
||||
Item armorItem;
|
||||
|
||||
if( positionChance < 0.07 )
|
||||
if ( positionChance < 0.07 )
|
||||
armorItem = defender.NeckArmor;
|
||||
else if( positionChance < 0.14 )
|
||||
else if ( positionChance < 0.14 )
|
||||
armorItem = defender.HandArmor;
|
||||
else if( positionChance < 0.28 )
|
||||
else if ( positionChance < 0.28 )
|
||||
armorItem = defender.ArmsArmor;
|
||||
else if( positionChance < 0.43 )
|
||||
else if ( positionChance < 0.43 )
|
||||
armorItem = defender.HeadArmor;
|
||||
else if( positionChance < 0.65 )
|
||||
else if ( positionChance < 0.65 )
|
||||
armorItem = defender.LegsArmor;
|
||||
else
|
||||
armorItem = defender.ChestArmor;
|
||||
|
|
@ -1251,15 +1251,15 @@ namespace Server.Items
|
|||
|
||||
Item armorItem;
|
||||
|
||||
if( chance < 0.07 )
|
||||
if ( chance < 0.07 )
|
||||
armorItem = defender.NeckArmor;
|
||||
else if( chance < 0.14 )
|
||||
else if ( chance < 0.14 )
|
||||
armorItem = defender.HandArmor;
|
||||
else if( chance < 0.28 )
|
||||
else if ( chance < 0.28 )
|
||||
armorItem = defender.ArmsArmor;
|
||||
else if( chance < 0.43 )
|
||||
else if ( chance < 0.43 )
|
||||
armorItem = defender.HeadArmor;
|
||||
else if( chance < 0.65 )
|
||||
else if ( chance < 0.65 )
|
||||
armorItem = defender.LegsArmor;
|
||||
else
|
||||
armorItem = defender.ChestArmor;
|
||||
|
|
@ -1402,12 +1402,12 @@ namespace Server.Items
|
|||
WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
|
||||
SpecialMove move = SpecialMove.GetCurrentMove( attacker );
|
||||
|
||||
if( a != null )
|
||||
if ( a != null )
|
||||
{
|
||||
percentageBonus += (int)(a.DamageScalar * 100) - 100;
|
||||
}
|
||||
|
||||
if( move != null )
|
||||
if ( move != null )
|
||||
{
|
||||
percentageBonus += (int)(move.GetDamageScalar( attacker, defender ) * 100) - 100;
|
||||
}
|
||||
|
|
@ -1426,11 +1426,9 @@ namespace Server.Items
|
|||
|
||||
if ( !attacker.Player )
|
||||
{
|
||||
if ( defender is PlayerMobile )
|
||||
if ( defender is PlayerMobile pm )
|
||||
{
|
||||
PlayerMobile pm = (PlayerMobile)defender;
|
||||
|
||||
if( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
|
||||
if ( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
|
||||
{
|
||||
percentageBonus += 100;
|
||||
}
|
||||
|
|
@ -1459,19 +1457,19 @@ namespace Server.Items
|
|||
|
||||
int packInstinctBonus = GetPackInstinctBonus( attacker, defender );
|
||||
|
||||
if( packInstinctBonus != 0 )
|
||||
if ( packInstinctBonus != 0 )
|
||||
{
|
||||
percentageBonus += packInstinctBonus;
|
||||
}
|
||||
|
||||
if( m_InDoubleStrike )
|
||||
if ( m_InDoubleStrike )
|
||||
{
|
||||
percentageBonus -= 10;
|
||||
}
|
||||
|
||||
TransformContext context = TransformationSpellHelper.GetContext( defender );
|
||||
|
||||
if( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Spell is NecromancerSpell && context.Type != typeof( HorrificBeastSpell ) )
|
||||
if ( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Spell is NecromancerSpell && context.Type != typeof( HorrificBeastSpell ) )
|
||||
{
|
||||
// Every necromancer transformation other than horrific beast takes an additional 25% damage
|
||||
percentageBonus += 25;
|
||||
|
|
@ -1481,12 +1479,12 @@ namespace Server.Items
|
|||
{
|
||||
PlayerMobile pmAttacker = (PlayerMobile) attacker;
|
||||
|
||||
if( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
|
||||
if ( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
|
||||
{
|
||||
percentageBonus += 25;
|
||||
}
|
||||
|
||||
if( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
|
||||
if ( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
|
||||
{
|
||||
percentageBonus += pmAttacker.SentHonorContext.PerfectionDamageBonus;
|
||||
}
|
||||
|
|
@ -1502,11 +1500,11 @@ namespace Server.Items
|
|||
damage = AOS.Scale( damage, 100 + percentageBonus );
|
||||
#endregion
|
||||
|
||||
if ( attacker is BaseCreature )
|
||||
((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );
|
||||
BaseCreature bcAtt = attacker as BaseCreature;
|
||||
BaseCreature bcDef = defender as BaseCreature;
|
||||
|
||||
if ( defender is BaseCreature )
|
||||
((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );
|
||||
bcAtt?.AlterMeleeDamageTo( defender, ref damage );
|
||||
bcDef?.AlterMeleeDamageFrom( attacker, ref damage );
|
||||
|
||||
damage = AbsorbDamage( attacker, defender, damage );
|
||||
|
||||
|
|
@ -1531,9 +1529,7 @@ namespace Server.Items
|
|||
|
||||
if ( Core.ML && this is BaseRanged )
|
||||
{
|
||||
BaseQuiver quiver = attacker.FindItemOnLayer( Layer.Cloak ) as BaseQuiver;
|
||||
|
||||
if ( quiver != null )
|
||||
if ( attacker.FindItemOnLayer( Layer.Cloak ) is BaseQuiver quiver )
|
||||
quiver.AlterBowDamage( ref phys, ref fire, ref cold, ref pois, ref nrgy, ref chaos, ref direct );
|
||||
}
|
||||
|
||||
|
|
@ -1661,13 +1657,9 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
|
||||
if ( attacker is VampireBatFamiliar )
|
||||
if ( attacker is VampireBatFamiliar bc )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)attacker;
|
||||
Mobile caster = bc.ControlMaster;
|
||||
|
||||
if ( caster == null )
|
||||
caster = bc.SummonMaster;
|
||||
Mobile caster = bc.ControlMaster ?? bc.SummonMaster;
|
||||
|
||||
if ( caster != null && caster.Map == bc.Map && caster.InRange( bc, 2 ) )
|
||||
caster.Hits += damage;
|
||||
|
|
@ -1729,20 +1721,14 @@ namespace Server.Items
|
|||
DoLowerDefense( attacker, defender );
|
||||
}
|
||||
|
||||
if ( attacker is BaseCreature )
|
||||
((BaseCreature)attacker).OnGaveMeleeAttack( defender );
|
||||
bcAtt?.OnGaveMeleeAttack( defender );
|
||||
bcDef?.OnGotMeleeAttack( attacker );
|
||||
|
||||
if ( defender is BaseCreature )
|
||||
((BaseCreature)defender).OnGotMeleeAttack( attacker );
|
||||
a?.OnHit( attacker, defender, damage );
|
||||
move?.OnHit( attacker, defender, damage );
|
||||
|
||||
if ( a != null )
|
||||
a.OnHit( attacker, defender, damage );
|
||||
|
||||
if ( move != null )
|
||||
move.OnHit( attacker, defender, damage );
|
||||
|
||||
if ( defender is IHonorTarget && ((IHonorTarget)defender).ReceivedHonorContext != null )
|
||||
((IHonorTarget)defender).ReceivedHonorContext.OnTargetHit( attacker );
|
||||
if ( defender is IHonorTarget it )
|
||||
it.ReceivedHonorContext?.OnTargetHit( attacker );
|
||||
|
||||
if ( !(this is BaseRanged) )
|
||||
{
|
||||
|
|
@ -1777,7 +1763,7 @@ namespace Server.Items
|
|||
|
||||
TransformContext context = TransformationSpellHelper.GetContext( attacker );
|
||||
|
||||
if( context != null && context.Spell is ReaperFormSpell )
|
||||
if ( context != null && context.Spell is ReaperFormSpell )
|
||||
damageBonus += ((ReaperFormSpell)context.Spell).SpellDamageBonus;
|
||||
}
|
||||
|
||||
|
|
@ -1930,11 +1916,11 @@ namespace Server.Items
|
|||
double scalar = Core.ML ? 1.0 : ( 11 - from.GetDistanceToSqrt( m ) ) / 10;
|
||||
double damage = GetBaseDamage( from );
|
||||
|
||||
if(scalar <= 0)
|
||||
if (scalar <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if( scalar < 1.0 )
|
||||
else if ( scalar < 1.0 )
|
||||
{
|
||||
damage *= ( 11 - from.GetDistanceToSqrt( m ) ) / 10;
|
||||
}
|
||||
|
|
@ -1952,7 +1938,7 @@ namespace Server.Items
|
|||
SlayerEntry atkSlayer = SlayerGroup.GetEntryByName( atkWeapon.Slayer );
|
||||
SlayerEntry atkSlayer2 = SlayerGroup.GetEntryByName( atkWeapon.Slayer2 );
|
||||
|
||||
if( atkWeapon is ButchersWarCleaver && TalismanSlayer.Slays( TalismanSlayerName.Bovine, defender ) )
|
||||
if ( atkWeapon is ButchersWarCleaver && TalismanSlayer.Slays( TalismanSlayerName.Bovine, defender ) )
|
||||
return CheckSlayerResult.Slayer;
|
||||
|
||||
if ( atkSlayer != null && atkSlayer.Slays( defender ) || atkSlayer2 != null && atkSlayer2.Slays( defender ) )
|
||||
|
|
@ -1967,15 +1953,15 @@ namespace Server.Items
|
|||
{
|
||||
ISlayer defISlayer = Spellbook.FindEquippedSpellbook( defender );
|
||||
|
||||
if( defISlayer == null )
|
||||
if ( defISlayer == null )
|
||||
defISlayer = defender.Weapon as ISlayer;
|
||||
|
||||
if( defISlayer != null )
|
||||
if ( defISlayer != null )
|
||||
{
|
||||
SlayerEntry defSlayer = SlayerGroup.GetEntryByName( defISlayer.Slayer );
|
||||
SlayerEntry defSlayer2 = SlayerGroup.GetEntryByName( defISlayer.Slayer2 );
|
||||
|
||||
if( defSlayer != null && defSlayer.Group.OppositionSuperSlays( attacker ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( attacker ) )
|
||||
if ( defSlayer != null && defSlayer.Group.OppositionSuperSlays( attacker ) || defSlayer2 != null && defSlayer2.Group.OppositionSuperSlays( attacker ) )
|
||||
return CheckSlayerResult.Opposition;
|
||||
}
|
||||
}
|
||||
|
|
@ -2003,7 +1989,7 @@ namespace Server.Items
|
|||
|
||||
public virtual void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct )
|
||||
{
|
||||
if( wielder is BaseCreature )
|
||||
if ( wielder is BaseCreature )
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)wielder;
|
||||
|
||||
|
|
@ -2028,11 +2014,11 @@ namespace Server.Items
|
|||
|
||||
CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource );
|
||||
|
||||
if( resInfo != null )
|
||||
if ( resInfo != null )
|
||||
{
|
||||
CraftAttributeInfo attrInfo = resInfo.AttributeInfo;
|
||||
|
||||
if( attrInfo != null )
|
||||
if ( attrInfo != null )
|
||||
{
|
||||
int left = phys;
|
||||
|
||||
|
|
@ -2051,7 +2037,7 @@ namespace Server.Items
|
|||
|
||||
private int ApplyCraftAttributeElementDamage( int attrDamage, ref int element, int totalRemaining )
|
||||
{
|
||||
if( totalRemaining <= 0 )
|
||||
if ( totalRemaining <= 0 )
|
||||
return 0;
|
||||
|
||||
if ( attrDamage <= 0 )
|
||||
|
|
@ -2062,7 +2048,7 @@ namespace Server.Items
|
|||
if ( (appliedDamage + element) > 100 )
|
||||
appliedDamage = 100 - element;
|
||||
|
||||
if( appliedDamage > totalRemaining )
|
||||
if ( appliedDamage > totalRemaining )
|
||||
appliedDamage = totalRemaining;
|
||||
|
||||
element += appliedDamage;
|
||||
|
|
@ -2241,7 +2227,7 @@ namespace Server.Items
|
|||
int damageBonus = AosAttributes.GetValue( attacker, AosAttribute.WeaponDamage );
|
||||
|
||||
// Horrific Beast transformation gives a +25% bonus to damage.
|
||||
if( TransformationSpellHelper.UnderTransformation( attacker, typeof( HorrificBeastSpell ) ) )
|
||||
if ( TransformationSpellHelper.UnderTransformation( attacker, typeof( HorrificBeastSpell ) ) )
|
||||
damageBonus += 25;
|
||||
|
||||
// Divine Fury gives a +10% bonus to damage.
|
||||
|
|
@ -2593,10 +2579,10 @@ namespace Server.Items
|
|||
if ( GetSaveFlag( flags, SaveFlag.Slayer2 ) )
|
||||
writer.Write( (int)m_Slayer2 );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
|
||||
m_AosElementDamages.Serialize( writer );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
writer.Write( (string) m_EngravedText );
|
||||
}
|
||||
|
||||
|
|
@ -2801,20 +2787,20 @@ namespace Server.Items
|
|||
if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
|
||||
m_PlayerConstructed = true;
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
|
||||
m_AosSkillBonuses = new AosSkillBonuses( this, reader );
|
||||
else
|
||||
m_AosSkillBonuses = new AosSkillBonuses( this );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.Slayer2 ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.Slayer2 ) )
|
||||
m_Slayer2 = (SlayerName)reader.ReadInt();
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
|
||||
m_AosElementDamages = new AosElementAttributes( this, reader );
|
||||
else
|
||||
m_AosElementDamages = new AosElementAttributes( this );
|
||||
|
||||
if( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
if ( GetSaveFlag( flags, SaveFlag.EngravedText ) )
|
||||
m_EngravedText = reader.ReadString();
|
||||
|
||||
break;
|
||||
|
|
@ -3020,25 +3006,25 @@ namespace Server.Items
|
|||
int currentMax = 50;
|
||||
int hue = 0;
|
||||
|
||||
if( pois >= currentMax )
|
||||
if ( pois >= currentMax )
|
||||
{
|
||||
hue = 1267 + (pois - 50) / 10;
|
||||
currentMax = pois;
|
||||
}
|
||||
|
||||
if( fire >= currentMax )
|
||||
if ( fire >= currentMax )
|
||||
{
|
||||
hue = 1255 + (fire - 50) / 10;
|
||||
currentMax = fire;
|
||||
}
|
||||
|
||||
if( nrgy >= currentMax )
|
||||
if ( nrgy >= currentMax )
|
||||
{
|
||||
hue = 1273 + (nrgy - 50) / 10;
|
||||
currentMax = nrgy;
|
||||
}
|
||||
|
||||
if( cold >= currentMax )
|
||||
if ( cold >= currentMax )
|
||||
{
|
||||
hue = 1261 + (cold - 50) / 10;
|
||||
currentMax = cold;
|
||||
|
|
@ -3145,7 +3131,7 @@ namespace Server.Items
|
|||
if ( m_Quality == WeaponQuality.Exceptional )
|
||||
list.Add( 1060636 ); // exceptional
|
||||
|
||||
if( RequiredRace == Race.Elf )
|
||||
if ( RequiredRace == Race.Elf )
|
||||
list.Add( 1075086 ); // Elves Only
|
||||
|
||||
if ( ArtifactRarity > 0 )
|
||||
|
|
@ -3157,17 +3143,17 @@ namespace Server.Items
|
|||
if ( m_Poison != null && m_PoisonCharges > 0 )
|
||||
list.Add( 1062412 + m_Poison.Level, m_PoisonCharges.ToString() );
|
||||
|
||||
if( m_Slayer != SlayerName.None )
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
list.Add( entry.Title );
|
||||
}
|
||||
|
||||
|
|
@ -3396,17 +3382,17 @@ namespace Server.Items
|
|||
|
||||
if ( m_Identified || from.AccessLevel >= AccessLevel.GameMaster )
|
||||
{
|
||||
if( m_Slayer != SlayerName.None )
|
||||
if ( m_Slayer != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
if( m_Slayer2 != SlayerName.None )
|
||||
if ( m_Slayer2 != SlayerName.None )
|
||||
{
|
||||
SlayerEntry entry = SlayerGroup.GetEntryByName( m_Slayer2 );
|
||||
if( entry != null )
|
||||
if ( entry != null )
|
||||
attrs.Add( new EquipInfoAttribute( entry.Title ) );
|
||||
}
|
||||
|
||||
|
|
@ -3419,7 +3405,7 @@ namespace Server.Items
|
|||
if ( m_AccuracyLevel != WeaponAccuracyLevel.Regular )
|
||||
attrs.Add( new EquipInfoAttribute( 1038010 + (int)m_AccuracyLevel ) );
|
||||
}
|
||||
else if( m_Slayer != SlayerName.None || m_Slayer2 != SlayerName.None || m_DurabilityLevel != WeaponDurabilityLevel.Regular || m_DamageLevel != WeaponDamageLevel.Regular || m_AccuracyLevel != WeaponAccuracyLevel.Regular )
|
||||
else if ( m_Slayer != SlayerName.None || m_Slayer2 != SlayerName.None || m_DurabilityLevel != WeaponDurabilityLevel.Regular || m_DamageLevel != WeaponDamageLevel.Regular || m_AccuracyLevel != WeaponAccuracyLevel.Regular )
|
||||
attrs.Add( new EquipInfoAttribute( 1038000 ) ); // Unidentified
|
||||
|
||||
if ( m_Poison != null && m_PoisonCharges > 0 )
|
||||
|
|
@ -3488,7 +3474,7 @@ namespace Server.Items
|
|||
else
|
||||
Attributes.WeaponDamage = 15;
|
||||
|
||||
if( Core.ML )
|
||||
if ( Core.ML )
|
||||
{
|
||||
Attributes.WeaponDamage += (int)(from.Skills.ArmsLore.Value / 20);
|
||||
|
||||
|
|
|
|||
|
|
@ -100,10 +100,10 @@ namespace Server.Items
|
|||
abyss.Opposition = new SlayerGroup[]{ elemental, fey };
|
||||
abyss.FoundOn = new Type[]{ typeof( BloodElemental ) };
|
||||
|
||||
if( Core.AOS )
|
||||
if ( Core.AOS )
|
||||
{
|
||||
abyss.Super = new SlayerEntry( SlayerName.Exorcism, typeof( AbysmalHorror ), typeof( ArcaneDaemon ), typeof( Balron ), typeof( BoneDemon ), typeof( ChaosDaemon ), typeof( Daemon ), typeof( SummonedDaemon ), typeof( DemonKnight ), typeof( Devourer ), typeof( EnslavedGargoyle ), typeof( FanDancer ), typeof( FireGargoyle ), typeof( Gargoyle ), typeof( GargoyleDestroyer ), typeof( GargoyleEnforcer ), typeof( Gibberling ), typeof( HordeMinion ), typeof( IceFiend ), typeof( Imp ), typeof( Impaler ), typeof( Moloch ), typeof( Oni ), typeof( Ravager ), typeof( Semidar ), typeof( StoneGargoyle ), typeof( Succubus ), typeof( TsukiWolf ) );
|
||||
|
||||
|
||||
abyss.Entries = new SlayerEntry[]
|
||||
{
|
||||
// Daemon Dismissal & Balron Damnation have been removed and moved up to super slayer on OSI.
|
||||
|
|
@ -204,4 +204,4 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue