#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
|
|
@ -0,0 +1,134 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x13E4, 0x13E3 )]
|
||||
public class AncientSmithyHammer : BaseTool
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Bonus
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bonus;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if ( m_Bonus == 0 )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if ( m_SkillMod == null && Parent is Mobile )
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
else if ( m_SkillMod != null )
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
base.OnAdded( parent );
|
||||
|
||||
if ( m_Bonus != 0 && parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem{ get{ return DefBlacksmithy.CraftSystem; } }
|
||||
public override int LabelNumber{ get{ return 1045127; } } // ancient smithy hammer
|
||||
|
||||
[Constructable]
|
||||
public AncientSmithyHammer( int bonus ) : this( bonus, 600 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSmithyHammer( int bonus, int uses ) : base( uses, 0x13E4 )
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = 0x482;
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Bonus != 0 )
|
||||
list.Add( 1060451, "#1042354\t{0}", m_Bonus.ToString() ); // ~1_skillname~ +~2_val~
|
||||
}
|
||||
|
||||
public AncientSmithyHammer( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Bonus );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Bonus = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Bonus != 0 && Parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Blacksmith, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
|
||||
if ( Hue == 0 )
|
||||
Hue = 0x482;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Anvil, Flipable( 0xFAF, 0xFB0 )]
|
||||
public class ColoredAnvil : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ColoredAnvil() : this( CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Valorite ) ) )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ColoredAnvil( int hue ) : base( 0xFAF )
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 20;
|
||||
}
|
||||
|
||||
public ColoredAnvil( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x13c6, 0x13ce )]
|
||||
public class LeatherGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 2; } }
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
public override int BaseColdResistance{ get{ return 3; } }
|
||||
public override int BasePoisonResistance{ get{ return 3; } }
|
||||
public override int BaseEnergyResistance{ get{ return 3; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 30; } }
|
||||
public override int InitMaxHits{ get{ return 40; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 20; } }
|
||||
public override int OldStrReq{ get{ return 10; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 13; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Leather; } }
|
||||
public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }
|
||||
|
||||
public override ArmorMeditationAllowance DefMedAllowance{ get{ return ArmorMeditationAllowance.All; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045122; } } // leather blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public LeatherGlovesOfMining( int bonus ) : base( bonus, 0x13C6 )
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public LeatherGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x13d5, 0x13dd )]
|
||||
public class StuddedGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 2; } }
|
||||
public override int BaseFireResistance{ get{ return 4; } }
|
||||
public override int BaseColdResistance{ get{ return 3; } }
|
||||
public override int BasePoisonResistance{ get{ return 3; } }
|
||||
public override int BaseEnergyResistance{ get{ return 4; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 35; } }
|
||||
public override int InitMaxHits{ get{ return 45; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 25; } }
|
||||
public override int OldStrReq{ get{ return 25; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 16; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Studded; } }
|
||||
public override CraftResource DefaultResource{ get{ return CraftResource.RegularLeather; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045123; } } // studded leather blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public StuddedGlovesOfMining( int bonus ) : base( bonus, 0x13D5 )
|
||||
{
|
||||
Weight = 2;
|
||||
}
|
||||
|
||||
public StuddedGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x13eb, 0x13f2 )]
|
||||
public class RingmailGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
public override int BasePhysicalResistance{ get{ return 3; } }
|
||||
public override int BaseFireResistance{ get{ return 3; } }
|
||||
public override int BaseColdResistance{ get{ return 1; } }
|
||||
public override int BasePoisonResistance{ get{ return 5; } }
|
||||
public override int BaseEnergyResistance{ get{ return 3; } }
|
||||
|
||||
public override int InitMinHits{ get{ return 40; } }
|
||||
public override int InitMaxHits{ get{ return 50; } }
|
||||
|
||||
public override int AosStrReq{ get{ return 40; } }
|
||||
public override int OldStrReq{ get{ return 20; } }
|
||||
|
||||
public override int OldDexBonus{ get{ return -1; } }
|
||||
|
||||
public override int ArmorBase{ get{ return 22; } }
|
||||
|
||||
public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Ringmail; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1045124; } } // ringmail blacksmith gloves of mining
|
||||
|
||||
[Constructable]
|
||||
public RingmailGlovesOfMining( int bonus ) : base( bonus, 0x13EB )
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public RingmailGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseGlovesOfMining : BaseArmor
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Bonus
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bonus;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if ( m_Bonus == 0 )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if ( m_SkillMod == null && Parent is Mobile )
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
else if ( m_SkillMod != null )
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
base.OnAdded( parent );
|
||||
|
||||
if ( m_Bonus != 0 && parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
base.OnRemoved( parent );
|
||||
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public BaseGlovesOfMining( int bonus, int itemID ) : base( itemID )
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
|
||||
this.Hue = CraftResources.GetHue( (CraftResource)Utility.RandomMinMax( (int)CraftResource.DullCopper, (int)CraftResource.Valorite ) );
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( m_Bonus != 0 )
|
||||
list.Add( 1062005, m_Bonus.ToString() ); // mining bonus +~1_val~
|
||||
}
|
||||
|
||||
public BaseGlovesOfMining( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( (int) m_Bonus );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Bonus = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_Bonus != 0 && Parent is Mobile )
|
||||
{
|
||||
if ( m_SkillMod != null )
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod( SkillName.Mining, true, m_Bonus );
|
||||
((Mobile)Parent).AddSkillMod( m_SkillMod );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowderOfTemperament : Item, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining{ get{ return true; } set{} }
|
||||
|
||||
public override int LabelNumber{ get{ return 1049082; } } // powder of fortifying
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament() : this( 10 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament( int charges ) : base( 4102 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 2419;
|
||||
UsesRemaining = charges;
|
||||
}
|
||||
|
||||
public PowderOfTemperament( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1060584, m_UsesRemaining.ToString() ); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo( Mobile m )
|
||||
{
|
||||
LabelToAffix( m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString() ); // Durability
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
DisplayDurabilityTo( from );
|
||||
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
from.Target = new InternalTarget( this );
|
||||
else
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private PowderOfTemperament m_Powder;
|
||||
|
||||
public InternalTarget( PowderOfTemperament powder ) : base( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_Powder = powder;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Powder.Deleted || m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of temperament.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( targeted is IDurability && targeted is Item )
|
||||
{
|
||||
IDurability wearable = (IDurability) targeted;
|
||||
Item item = (Item) targeted;
|
||||
|
||||
if ( !wearable.CanFortify )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( item.IsChildOf( from.Backpack ) || ( Core.ML && item.Parent == from ) ) && m_Powder.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
int origMaxHP = wearable.MaxHitPoints;
|
||||
int origCurHP = wearable.HitPoints;
|
||||
|
||||
if ( origMaxHP > 0 )
|
||||
{
|
||||
int initMaxHP = Core.AOS ? 255 : wearable.InitMaxHits;
|
||||
|
||||
wearable.UnscaleDurability();
|
||||
|
||||
if ( wearable.MaxHitPoints < initMaxHP )
|
||||
{
|
||||
int bonus = initMaxHP - wearable.MaxHitPoints;
|
||||
|
||||
if ( bonus > 10 )
|
||||
bonus = 10;
|
||||
|
||||
wearable.MaxHitPoints += bonus;
|
||||
wearable.HitPoints += bonus;
|
||||
|
||||
wearable.ScaleDurability();
|
||||
|
||||
if ( wearable.MaxHitPoints > 255 ) wearable.MaxHitPoints = 255;
|
||||
if ( wearable.HitPoints > 255 ) wearable.HitPoints = 255;
|
||||
|
||||
if ( wearable.MaxHitPoints > origMaxHP )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049084 ); // You successfully use the powder on the item.
|
||||
from.PlaySound( 0x247 );
|
||||
|
||||
--m_Powder.UsesRemaining;
|
||||
|
||||
if ( m_Powder.UsesRemaining <= 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1049086 ); // You have used up your powder of fortifying.
|
||||
m_Powder.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wearable.MaxHitPoints = origMaxHP;
|
||||
wearable.HitPoints = origCurHP;
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049085 ); // The item cannot be improved any further.
|
||||
wearable.ScaleDurability();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue