v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
|
|
@ -0,0 +1,120 @@
|
|||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flippable(0x13E4, 0x13E3)]
|
||||
public class AncientSmithyHammer : BaseTool
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
|
||||
[Constructible]
|
||||
public AncientSmithyHammer(int bonus, int uses = 600) : base(uses, 0x13E4)
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = 0x482;
|
||||
}
|
||||
|
||||
public AncientSmithyHammer(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Bonus
|
||||
{
|
||||
get => m_Bonus;
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_Bonus == 0)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if (m_SkillMod == null && Parent is Mobile mobile)
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
mobile.AddSkillMod(m_SkillMod);
|
||||
}
|
||||
else if (m_SkillMod != null)
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem => DefBlacksmithy.CraftSystem;
|
||||
public override int LabelNumber => 1045127; // ancient smithy hammer
|
||||
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
base.OnAdded(parent);
|
||||
|
||||
if (m_Bonus != 0 && parent is Mobile mobile)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
mobile.AddSkillMod(m_SkillMod);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
base.OnRemoved(parent);
|
||||
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
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 override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(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 mobile)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
mobile.AddSkillMod(m_SkillMod);
|
||||
}
|
||||
|
||||
if (Hue == 0)
|
||||
Hue = 0x482;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Anvil]
|
||||
[Flippable(0xFAF, 0xFB0)]
|
||||
public class ColoredAnvil : Item
|
||||
{
|
||||
[Constructible]
|
||||
public ColoredAnvil() : this(CraftResources.GetHue(
|
||||
(CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite)))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
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(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Flippable(0x13c6, 0x13ce)]
|
||||
public class LeatherGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
[Constructible]
|
||||
public LeatherGlovesOfMining(int bonus) : base(bonus, 0x13C6)
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public LeatherGlovesOfMining(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BasePhysicalResistance => 2;
|
||||
public override int BaseFireResistance => 4;
|
||||
public override int BaseColdResistance => 3;
|
||||
public override int BasePoisonResistance => 3;
|
||||
public override int BaseEnergyResistance => 3;
|
||||
|
||||
public override int InitMinHits => 30;
|
||||
public override int InitMaxHits => 40;
|
||||
|
||||
public override int AosStrReq => 20;
|
||||
public override int OldStrReq => 10;
|
||||
|
||||
public override int ArmorBase => 13;
|
||||
|
||||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Leather;
|
||||
public override CraftResource DefaultResource => CraftResource.RegularLeather;
|
||||
|
||||
public override ArmorMeditationAllowance DefMedAllowance => ArmorMeditationAllowance.All;
|
||||
|
||||
public override int LabelNumber => 1045122; // leather blacksmith gloves of mining
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flippable(0x13d5, 0x13dd)]
|
||||
public class StuddedGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
[Constructible]
|
||||
public StuddedGlovesOfMining(int bonus) : base(bonus, 0x13D5)
|
||||
{
|
||||
Weight = 2;
|
||||
}
|
||||
|
||||
public StuddedGlovesOfMining(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BasePhysicalResistance => 2;
|
||||
public override int BaseFireResistance => 4;
|
||||
public override int BaseColdResistance => 3;
|
||||
public override int BasePoisonResistance => 3;
|
||||
public override int BaseEnergyResistance => 4;
|
||||
|
||||
public override int InitMinHits => 35;
|
||||
public override int InitMaxHits => 45;
|
||||
|
||||
public override int AosStrReq => 25;
|
||||
public override int OldStrReq => 25;
|
||||
|
||||
public override int ArmorBase => 16;
|
||||
|
||||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Studded;
|
||||
public override CraftResource DefaultResource => CraftResource.RegularLeather;
|
||||
|
||||
public override int LabelNumber => 1045123; // studded leather blacksmith gloves of mining
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
[Flippable(0x13eb, 0x13f2)]
|
||||
public class RingmailGlovesOfMining : BaseGlovesOfMining
|
||||
{
|
||||
[Constructible]
|
||||
public RingmailGlovesOfMining(int bonus) : base(bonus, 0x13EB)
|
||||
{
|
||||
Weight = 1;
|
||||
}
|
||||
|
||||
public RingmailGlovesOfMining(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BasePhysicalResistance => 3;
|
||||
public override int BaseFireResistance => 3;
|
||||
public override int BaseColdResistance => 1;
|
||||
public override int BasePoisonResistance => 5;
|
||||
public override int BaseEnergyResistance => 3;
|
||||
|
||||
public override int InitMinHits => 40;
|
||||
public override int InitMaxHits => 50;
|
||||
|
||||
public override int AosStrReq => 40;
|
||||
public override int OldStrReq => 20;
|
||||
|
||||
public override int OldDexBonus => -1;
|
||||
|
||||
public override int ArmorBase => 22;
|
||||
|
||||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Ringmail;
|
||||
|
||||
public override int LabelNumber => 1045124; // ringmail blacksmith gloves of mining
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(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;
|
||||
|
||||
public BaseGlovesOfMining(int bonus, int itemID) : base(itemID)
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
|
||||
Hue = CraftResources.GetHue(
|
||||
(CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite));
|
||||
}
|
||||
|
||||
public BaseGlovesOfMining(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Bonus
|
||||
{
|
||||
get => m_Bonus;
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_Bonus == 0)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if (m_SkillMod == null && Parent is Mobile mobile)
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Mining, true, m_Bonus);
|
||||
mobile.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 mobile)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Mining, true, m_Bonus);
|
||||
mobile.AddSkillMod(m_SkillMod);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
base.OnRemoved(parent);
|
||||
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Bonus != 0)
|
||||
list.Add(1062005, m_Bonus.ToString()); // mining bonus +~1_val~
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(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 mobile)
|
||||
{
|
||||
m_SkillMod?.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Mining, true, m_Bonus);
|
||||
mobile.AddSkillMod(m_SkillMod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowderOfTemperament : Item, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[Constructible]
|
||||
public PowderOfTemperament(int charges = 10) : base(4102)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 2419;
|
||||
UsesRemaining = charges;
|
||||
}
|
||||
|
||||
public PowderOfTemperament(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1049082; // powder of fortifying
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get => m_UsesRemaining;
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
bool IUsesRemaining.ShowUsesRemaining
|
||||
{
|
||||
get => true;
|
||||
set { }
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
writer.Write(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); // 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 != false || m_Powder.UsesRemaining <= 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1049086); // You have used up your powder of temperament.
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is Item item && item is IDurability wearable)
|
||||
{
|
||||
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