Inital Commit
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Server
|
||||
Virtuoso,
|
||||
Aloron,
|
||||
Darden,
|
||||
ForsakenVirtues
|
||||
ForsakenVirtues
|
||||
}
|
||||
|
||||
public interface ISetItem
|
||||
|
||||
@@ -562,4 +562,4 @@ namespace Server.Items
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,53 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Custom; // Required for durability extension methods
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PowderOfTemperament : Item, IUsesRemaining
|
||||
{
|
||||
public static bool CanPOFJewelry = Config.Get("Loot.CanPOFJewelry", false);
|
||||
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament()
|
||||
: this(10)
|
||||
public PowderOfTemperament() : this(10)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PowderOfTemperament(int charges)
|
||||
: base(4102)
|
||||
public PowderOfTemperament(int charges) : base(4102)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 2419;
|
||||
UsesRemaining = charges;
|
||||
}
|
||||
|
||||
public PowderOfTemperament(Serial serial)
|
||||
: base(serial)
|
||||
public PowderOfTemperament(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UsesRemaining;
|
||||
}
|
||||
get { return m_UsesRemaining; }
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
get { return true; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049082;
|
||||
}
|
||||
}// powder of fortifying
|
||||
get { return 1049082; } // powder of fortifying
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
@@ -74,31 +62,13 @@ namespace Server.Items
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (version == 0)
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList 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);
|
||||
list.Add(1060584, m_UsesRemaining.ToString());
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
@@ -106,12 +76,13 @@ namespace Server.Items
|
||||
if (IsChildOf(from.Backpack))
|
||||
from.Target = new InternalTarget(this);
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
from.SendLocalizedMessage(1042001); // Must be in pack
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly PowderOfTemperament m_Powder;
|
||||
private PowderOfTemperament m_Powder;
|
||||
|
||||
public InternalTarget(PowderOfTemperament powder)
|
||||
: base(2, false, TargetFlags.None)
|
||||
{
|
||||
@@ -122,153 +93,169 @@ namespace Server.Items
|
||||
{
|
||||
if (m_Powder.Deleted || m_Powder.UsesRemaining <= 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1049086); // You have used up your powder of temperament.
|
||||
from.SendLocalizedMessage(1049086); // used up
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is Item)
|
||||
Item item = targeted as Item;
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
bool noGo = false;
|
||||
int antique = 0;
|
||||
|
||||
if (!Server.Engines.Craft.Repair.AllowsRepair(item, null) || (item is BaseJewel && !CanPOFJewelry))
|
||||
{
|
||||
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
|
||||
return;
|
||||
}
|
||||
|
||||
#region SA
|
||||
if (item is BaseWeapon)
|
||||
{
|
||||
if (((BaseWeapon)item).Attributes.Brittle > 0 || ((BaseWeapon)item).NegativeAttributes.Brittle > 0)
|
||||
noGo = true;
|
||||
antique = ((BaseWeapon)item).NegativeAttributes.Antique;
|
||||
}
|
||||
else if (item is BaseArmor)
|
||||
{
|
||||
if (((BaseArmor)item).Attributes.Brittle > 0 || ((BaseArmor)item).NegativeAttributes.Brittle > 0)
|
||||
noGo = true;
|
||||
antique = ((BaseArmor)item).NegativeAttributes.Antique;
|
||||
}
|
||||
else if (item is BaseClothing)
|
||||
{
|
||||
if (((BaseClothing)item).Attributes.Brittle > 0 || ((BaseClothing)item).NegativeAttributes.Brittle > 0)
|
||||
noGo = true;
|
||||
antique = ((BaseClothing)item).NegativeAttributes.Antique;
|
||||
}
|
||||
else if (item is BaseJewel)
|
||||
{
|
||||
if (((BaseJewel)item).Attributes.Brittle > 0 || ((BaseJewel)item).NegativeAttributes.Brittle > 0)
|
||||
noGo = true;
|
||||
antique = ((BaseJewel)item).NegativeAttributes.Antique;
|
||||
}
|
||||
else if (item is BaseTalisman && ((BaseTalisman)item).Attributes.Brittle > 0)
|
||||
{
|
||||
noGo = true;
|
||||
}
|
||||
if (noGo)
|
||||
{
|
||||
from.SendLocalizedMessage(1149799); //That cannot be used on brittle items.
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (targeted is IDurability)
|
||||
{
|
||||
IDurability wearable = (IDurability)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 = antique <= 0 ? 255 : antique == 1 ? 250 : antique == 2 ? 200 : 150;
|
||||
|
||||
wearable.UnscaleDurability();
|
||||
|
||||
if (wearable.MaxHitPoints < initMaxHP)
|
||||
{
|
||||
if (antique > 0)
|
||||
{
|
||||
wearable.MaxHitPoints = initMaxHP;
|
||||
wearable.HitPoints += initMaxHP;
|
||||
}
|
||||
else
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
if (antique > 0)
|
||||
{
|
||||
if (item is BaseWeapon) ((BaseWeapon)item).NegativeAttributes.Antique++;
|
||||
if (item is BaseArmor) ((BaseArmor)item).NegativeAttributes.Antique++;
|
||||
if (item is BaseJewel) ((BaseJewel)item).NegativeAttributes.Antique++;
|
||||
if (item is BaseClothing) ((BaseClothing)item).NegativeAttributes.Antique++;
|
||||
}
|
||||
}
|
||||
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.
|
||||
}
|
||||
}
|
||||
from.SendLocalizedMessage(1042001);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// Jewelry cannot be fortified (OSI)
|
||||
if (item is BaseJewel)
|
||||
{
|
||||
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
|
||||
from.SendLocalizedMessage(1049083);
|
||||
return;
|
||||
}
|
||||
|
||||
// Brittle or Antique items cannot be fortified (OSI)
|
||||
if (IsBrittle(item) || IsAntique(item))
|
||||
{
|
||||
from.SendLocalizedMessage(1049083);
|
||||
return;
|
||||
}
|
||||
|
||||
IDurability wearable = targeted as IDurability;
|
||||
|
||||
if (wearable == null || !wearable.CanFortify)
|
||||
{
|
||||
from.SendLocalizedMessage(1049083);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) || !m_Powder.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1049085);
|
||||
return;
|
||||
}
|
||||
|
||||
// ===============================
|
||||
// HARD CAP CHECK — OSI ACCURATE
|
||||
// ===============================
|
||||
int oldMax = wearable.MaxHitPoints;
|
||||
|
||||
if (oldMax >= 255)
|
||||
{
|
||||
from.SendMessage("This item cannot be fortified any further.");
|
||||
return;
|
||||
}
|
||||
|
||||
// ===============================
|
||||
// APPLY +10 DURABILITY (CAPPED)
|
||||
// ===============================
|
||||
int delta = 10;
|
||||
|
||||
if (oldMax + delta > 255)
|
||||
delta = 255 - oldMax;
|
||||
|
||||
if (delta <= 0)
|
||||
{
|
||||
from.SendMessage("This item cannot be fortified any further.");
|
||||
return;
|
||||
}
|
||||
|
||||
int newMax = oldMax + delta;
|
||||
|
||||
wearable.MaxHitPoints = newMax;
|
||||
wearable.HitPoints += delta;
|
||||
|
||||
if (wearable.HitPoints > wearable.MaxHitPoints)
|
||||
wearable.HitPoints = wearable.MaxHitPoints;
|
||||
|
||||
// ===============================================
|
||||
// REMOVE SELF REPAIR ON FIRST PoF USE
|
||||
// ===============================================
|
||||
if (item is BaseWeapon bw)
|
||||
{
|
||||
bw.WeaponAttributes.SelfRepair = 0;
|
||||
}
|
||||
|
||||
if (item is BaseArmor ba)
|
||||
{
|
||||
ba.ArmorAttributes.SelfRepair = 0;
|
||||
}
|
||||
|
||||
if (item is BaseShield bs)
|
||||
{
|
||||
bs.ArmorAttributes.SelfRepair = 0;
|
||||
}
|
||||
|
||||
if (item is BaseClothing bc)
|
||||
{
|
||||
bc.ClothingAttributes.SelfRepair = 0;
|
||||
}
|
||||
|
||||
// ===============================
|
||||
// TRACK POF USES
|
||||
// ===============================
|
||||
item.SetPoFUses(item.GetPoFUses() + 1);
|
||||
// ===============================
|
||||
// APPLY REPAIR LOCK
|
||||
// ===============================
|
||||
item.SetRepairLocked(true);
|
||||
|
||||
|
||||
|
||||
from.SendMessage("You successfully fortify the item.");
|
||||
from.PlaySound(0x247);
|
||||
|
||||
m_Powder.UsesRemaining--;
|
||||
|
||||
if (m_Powder.UsesRemaining <= 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1049086);
|
||||
m_Powder.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsBrittle(Item item)
|
||||
{
|
||||
BaseWeapon bw = item as BaseWeapon;
|
||||
if (bw != null && (bw.Attributes.Brittle > 0 || bw.NegativeAttributes.Brittle > 0))
|
||||
return true;
|
||||
|
||||
BaseArmor ba = item as BaseArmor;
|
||||
if (ba != null && (ba.Attributes.Brittle > 0 || ba.NegativeAttributes.Brittle > 0))
|
||||
return true;
|
||||
|
||||
BaseClothing bc = item as BaseClothing;
|
||||
if (bc != null && (bc.Attributes.Brittle > 0 || bc.NegativeAttributes.Brittle > 0))
|
||||
return true;
|
||||
|
||||
BaseJewel bj = item as BaseJewel;
|
||||
if (bj != null && (bj.Attributes.Brittle > 0 || bj.NegativeAttributes.Brittle > 0))
|
||||
return true;
|
||||
|
||||
BaseTalisman bt = item as BaseTalisman;
|
||||
if (bt != null && bt.Attributes.Brittle > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsAntique(Item item)
|
||||
{
|
||||
BaseWeapon bw = item as BaseWeapon;
|
||||
if (bw != null && bw.NegativeAttributes.Antique > 0)
|
||||
return true;
|
||||
|
||||
BaseArmor ba = item as BaseArmor;
|
||||
if (ba != null && ba.NegativeAttributes.Antique > 0)
|
||||
return true;
|
||||
|
||||
BaseClothing bc = item as BaseClothing;
|
||||
if (bc != null && bc.NegativeAttributes.Antique > 0)
|
||||
return true;
|
||||
|
||||
BaseJewel bj = item as BaseJewel;
|
||||
if (bj != null && bj.NegativeAttributes.Antique > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace Server.Items
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CanAlter { get { return true; } }
|
||||
public virtual bool CanAlter { get { return true; } }
|
||||
|
||||
public virtual bool UseIntOrDexProperty
|
||||
{
|
||||
@@ -401,9 +401,9 @@ namespace Server.Items
|
||||
return m_ArmorBase;
|
||||
}
|
||||
set
|
||||
{
|
||||
{
|
||||
m_ArmorBase = value;
|
||||
Invalidate();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ namespace Server.Items
|
||||
if (m_Protection != ArmorProtectionLevel.Regular)
|
||||
ar += 10 + (5 * (int)m_Protection);
|
||||
|
||||
switch ( m_Resource )
|
||||
switch (m_Resource)
|
||||
{
|
||||
case CraftResource.DullCopper:
|
||||
ar += 2;
|
||||
@@ -538,7 +538,7 @@ namespace Server.Items
|
||||
armor.m_RefinedPoison > 0 ||
|
||||
armor.m_RefinedEnergy > 0);
|
||||
}
|
||||
|
||||
|
||||
public override void AddResistanceProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (PhysicalResistance != 0 || m_RefinedPhysical != 0)
|
||||
@@ -761,9 +761,9 @@ namespace Server.Items
|
||||
|
||||
#region Runic Reforging
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ReforgedPrefix ReforgedPrefix
|
||||
{
|
||||
get { return m_ReforgedPrefix; }
|
||||
public ReforgedPrefix ReforgedPrefix
|
||||
{
|
||||
get { return m_ReforgedPrefix; }
|
||||
set { m_ReforgedPrefix = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
@@ -776,9 +776,9 @@ namespace Server.Items
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemPower ItemPower
|
||||
{
|
||||
get { return m_ItemPower; }
|
||||
set { m_ItemPower = value; InvalidateProperties(); }
|
||||
{
|
||||
get { return m_ItemPower; }
|
||||
set { m_ItemPower = value; InvalidateProperties(); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -963,11 +963,11 @@ namespace Server.Items
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int HitPoints
|
||||
{
|
||||
get
|
||||
get
|
||||
{
|
||||
return m_HitPoints;
|
||||
}
|
||||
set
|
||||
set
|
||||
{
|
||||
if (value != m_HitPoints && MaxHitPoints > 0)
|
||||
{
|
||||
@@ -1298,7 +1298,7 @@ namespace Server.Items
|
||||
{
|
||||
get
|
||||
{
|
||||
switch ( Layer )
|
||||
switch (Layer)
|
||||
{
|
||||
default:
|
||||
case Layer.Neck:
|
||||
@@ -1327,7 +1327,7 @@ namespace Server.Items
|
||||
|
||||
public int GetProtOffset()
|
||||
{
|
||||
switch ( m_Protection )
|
||||
switch (m_Protection)
|
||||
{
|
||||
case ArmorProtectionLevel.Guarding:
|
||||
return 1;
|
||||
@@ -1372,10 +1372,10 @@ namespace Server.Items
|
||||
{
|
||||
int bonus = 0;
|
||||
|
||||
if (m_Quality == ItemQuality.Exceptional &&!(this is GargishLeatherWingArmor))
|
||||
if (m_Quality == ItemQuality.Exceptional && !(this is GargishLeatherWingArmor))
|
||||
bonus += 20;
|
||||
|
||||
switch ( m_Durability )
|
||||
switch (m_Durability)
|
||||
{
|
||||
case ArmorDurabilityLevel.Durable:
|
||||
bonus += 20;
|
||||
@@ -1630,10 +1630,10 @@ namespace Server.Items
|
||||
PlayerConstructed = 0x01000000,
|
||||
xAbsorptionAttributes = 0x02000000,
|
||||
xWeaponAttributes = 0x04000000,
|
||||
NegativeAttributes = 0x08000000,
|
||||
Altered = 0x10000000,
|
||||
NegativeAttributes = 0x08000000,
|
||||
Altered = 0x10000000,
|
||||
TalismanProtection = 0x20000000,
|
||||
EngravedText = 0x40000000
|
||||
EngravedText = 0x40000000
|
||||
}
|
||||
|
||||
#region Mondain's Legacy Sets
|
||||
@@ -1720,7 +1720,7 @@ namespace Server.Items
|
||||
|
||||
// Version 8
|
||||
writer.Write((int)m_TimesImbued);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
writer.Write((Mobile)m_BlessedBy);
|
||||
@@ -1903,7 +1903,7 @@ namespace Server.Items
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
switch (version)
|
||||
{
|
||||
case 15:
|
||||
case 14:
|
||||
@@ -1961,12 +1961,12 @@ namespace Server.Items
|
||||
case 8:
|
||||
{
|
||||
m_TimesImbued = reader.ReadInt();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
m_BlessedBy = reader.ReadMobile();
|
||||
|
||||
SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
|
||||
SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
|
||||
|
||||
if (GetSaveFlag(sflags, SetFlag.Attributes))
|
||||
m_SetAttributes = new AosAttributes(this, reader);
|
||||
@@ -2198,7 +2198,8 @@ namespace Server.Items
|
||||
if (m_ArmorBase == RevertArmorBase)
|
||||
m_ArmorBase = -1;
|
||||
|
||||
/*m_BodyPos = (ArmorBodyType)*/reader.ReadInt();
|
||||
/*m_BodyPos = (ArmorBodyType)*/
|
||||
reader.ReadInt();
|
||||
|
||||
if (version < 4)
|
||||
{
|
||||
@@ -2217,7 +2218,7 @@ namespace Server.Items
|
||||
{
|
||||
OreInfo info;
|
||||
|
||||
switch ( reader.ReadInt() )
|
||||
switch (reader.ReadInt())
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
@@ -2595,7 +2596,7 @@ namespace Server.Items
|
||||
|
||||
damageTaken -= Absorbed;
|
||||
|
||||
if (damageTaken < 0)
|
||||
if (damageTaken < 0)
|
||||
damageTaken = 0;
|
||||
|
||||
if (Absorbed < 2)
|
||||
@@ -2682,7 +2683,7 @@ namespace Server.Items
|
||||
{
|
||||
int oreType;
|
||||
|
||||
switch ( m_Resource )
|
||||
switch (m_Resource)
|
||||
{
|
||||
case CraftResource.DullCopper: oreType = 1053108; break; // dull copper
|
||||
case CraftResource.ShadowIron: oreType = 1053107; break; // shadow iron
|
||||
@@ -2701,7 +2702,7 @@ namespace Server.Items
|
||||
case CraftResource.GreenScales: oreType = 1060819; break; // green
|
||||
case CraftResource.WhiteScales: oreType = 1060821; break; // white
|
||||
case CraftResource.BlueScales: oreType = 1060815; break; // blue
|
||||
case CraftResource.OakWood: oreType = 1072533; break; // oak
|
||||
case CraftResource.OakWood: oreType = 1072533; break; // oak
|
||||
case CraftResource.AshWood: oreType = 1072534; break; // ash
|
||||
case CraftResource.YewWood: oreType = 1072535; break; // yew
|
||||
case CraftResource.Heartwood: oreType = 1072536; break; // heartwood
|
||||
@@ -2794,6 +2795,17 @@ namespace Server.Items
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
// ===============================================
|
||||
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
|
||||
// ===============================================
|
||||
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
|
||||
as Server.Custom.DurabilityAttachment;
|
||||
|
||||
if (dura != null && dura.RepairLocked)
|
||||
{
|
||||
list.Add("Tempered — Cannot be repaired");
|
||||
}
|
||||
|
||||
#region Factions
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
#endregion
|
||||
@@ -2895,14 +2907,14 @@ namespace Server.Items
|
||||
|
||||
if (m_TalismanProtection != null && !m_TalismanProtection.IsEmpty && m_TalismanProtection.Amount > 0)
|
||||
list.Add(1072387, "{0}\t{1}", m_TalismanProtection.Name != null ? m_TalismanProtection.Name.ToString() : "Unknown", m_TalismanProtection.Amount); // ~1_NAME~ Protection: +~2_val~%
|
||||
|
||||
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
|
||||
|
||||
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
|
||||
list.Add(1113630, prop.ToString()); // Soul Charge ~1_val~%
|
||||
|
||||
if((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
|
||||
|
||||
if ((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
|
||||
list.Add(1112364); // reactive paralyze
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
|
||||
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.EaterCold) != 0)
|
||||
@@ -2919,8 +2931,8 @@ namespace Server.Items
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.EaterDamage) != 0)
|
||||
list.Add(1113598, prop.ToString()); // Damage Eater ~1_Val~%
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
|
||||
list.Add(1113691, prop.ToString()); // Fire Resonance ~1_val~%
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.ResonanceCold) != 0)
|
||||
@@ -2934,41 +2946,41 @@ namespace Server.Items
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
|
||||
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
|
||||
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.SpellChanneling) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.SpellChanneling) != 0)
|
||||
list.Add(1060482); // spell channeling
|
||||
|
||||
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
|
||||
|
||||
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
|
||||
list.Add(1060450, prop.ToString()); // self repair ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.NightSight) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.NightSight) != 0)
|
||||
list.Add(1060441); // night sight
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStr) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStr) != 0)
|
||||
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusDex) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusDex) != 0)
|
||||
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusInt) != 0)
|
||||
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusHits) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusHits) != 0)
|
||||
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStam) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStam) != 0)
|
||||
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusMana) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusMana) != 0)
|
||||
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenHits) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.RegenHits) != 0)
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenStam) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.RegenStam) != 0)
|
||||
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenMana) != 0)
|
||||
@@ -2976,8 +2988,8 @@ namespace Server.Items
|
||||
|
||||
if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
|
||||
list.Add(1060436, prop.ToString()); // luck ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.EnhancePotions) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.EnhancePotions) != 0)
|
||||
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
|
||||
@@ -2985,45 +2997,45 @@ namespace Server.Items
|
||||
|
||||
if (this is SurgeShield && ((SurgeShield)this).Surge > SurgeType.None)
|
||||
list.Add(1153098, ((SurgeShield)this).Charges.ToString());
|
||||
|
||||
if ((prop = m_AosAttributes.AttackChance) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.AttackChance) != 0)
|
||||
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
|
||||
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponDamage) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponDamage) != 0)
|
||||
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.DefendChance) != 0)
|
||||
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.CastRecovery) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.CastRecovery) != 0)
|
||||
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.CastSpeed) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.CastSpeed) != 0)
|
||||
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.SpellDamage) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.SpellDamage) != 0)
|
||||
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.LowerManaCost) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.LowerManaCost) != 0)
|
||||
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.LowerRegCost) != 0)
|
||||
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
|
||||
|
||||
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
|
||||
|
||||
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
|
||||
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
|
||||
|
||||
AddResistanceProperties(list);
|
||||
|
||||
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
|
||||
|
||||
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
|
||||
list.Add(1060437); // mage armor
|
||||
|
||||
if ((prop = GetLowerStatReq()) != 0)
|
||||
|
||||
if ((prop = GetLowerStatReq()) != 0)
|
||||
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
|
||||
|
||||
|
||||
if ((prop = ComputeStatReq(StatType.Str)) > 0)
|
||||
list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
|
||||
|
||||
@@ -3122,15 +3134,15 @@ namespace Server.Items
|
||||
#region Mondain's Legacy
|
||||
if (!Core.ML || !craftItem.ForceNonExceptional)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (typeRes == null || craftItem.ForceNonExceptional)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
PlayerConstructed = true;
|
||||
|
||||
@@ -3239,7 +3251,7 @@ namespace Server.Items
|
||||
}
|
||||
|
||||
info = GetResourceAttrs(m_Resource);
|
||||
|
||||
|
||||
// add new bonus
|
||||
m_PhysicalBonus += info.ArmorPhysicalResist;
|
||||
m_FireBonus += info.ArmorFireResist;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Engines.XmlSpawner2;
|
||||
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
@@ -69,6 +71,16 @@ namespace Server.Items
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
// ===============================================
|
||||
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
|
||||
// ===============================================
|
||||
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
|
||||
as Server.Custom.DurabilityAttachment;
|
||||
|
||||
if (dura != null && dura.RepairLocked)
|
||||
{
|
||||
list.Add("Tempered — Cannot be repaired");
|
||||
}
|
||||
|
||||
if (Core.EJ && LastParryChance > 0)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,8 @@ using Server.Engines.Craft;
|
||||
using Server.Factions;
|
||||
using Server.Network;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.XmlSpawner2;
|
||||
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
@@ -78,7 +80,7 @@ namespace Server.Items
|
||||
|
||||
public virtual bool CanFortify { get { return !IsImbued && NegativeAttributes.Antique < 4; } }
|
||||
public virtual bool CanRepair { get { return m_NegativeAttributes.NoRepair == 0; } }
|
||||
public virtual bool CanAlter { get { return true; } }
|
||||
public virtual bool CanAlter { get { return true; } }
|
||||
|
||||
private int m_MaxHitPoints;
|
||||
private int m_HitPoints;
|
||||
@@ -126,7 +128,7 @@ namespace Server.Items
|
||||
public int HitPoints
|
||||
{
|
||||
get { return m_HitPoints; }
|
||||
set
|
||||
set
|
||||
{
|
||||
if (value != m_HitPoints && MaxHitPoints > 0)
|
||||
{
|
||||
@@ -362,10 +364,10 @@ namespace Server.Items
|
||||
public AosArmorAttributes ClothingAttributes { get { return m_AosClothingAttributes; } set { } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
|
||||
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
|
||||
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SAAbsorptionAttributes SAAbsorptionAttributes { get { return m_SAAbsorptionAttributes; } set { } }
|
||||
@@ -381,7 +383,7 @@ namespace Server.Items
|
||||
public virtual int BaseColdResistance { get { return 0; } }
|
||||
public virtual int BasePoisonResistance { get { return 0; } }
|
||||
public virtual int BaseEnergyResistance { get { return 0; } }
|
||||
|
||||
|
||||
#region Mondain's Legacy Sets
|
||||
public override int PhysicalResistance
|
||||
{
|
||||
@@ -779,7 +781,7 @@ namespace Server.Items
|
||||
|
||||
damageTaken -= Absorbed;
|
||||
|
||||
if (damageTaken < 0)
|
||||
if (damageTaken < 0)
|
||||
damageTaken = 0;
|
||||
|
||||
double chance = NegativeAttributes.Antique > 0 ? 80 : 25;
|
||||
@@ -955,7 +957,7 @@ namespace Server.Items
|
||||
{
|
||||
int oreType;
|
||||
|
||||
switch ( m_Resource )
|
||||
switch (m_Resource)
|
||||
{
|
||||
case CraftResource.DullCopper:
|
||||
oreType = 1053108;
|
||||
@@ -1071,6 +1073,16 @@ namespace Server.Items
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
// ===============================================
|
||||
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
|
||||
// ===============================================
|
||||
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
|
||||
as Server.Custom.DurabilityAttachment;
|
||||
|
||||
if (dura != null && dura.RepairLocked)
|
||||
{
|
||||
list.Add("Tempered — Cannot be repaired");
|
||||
}
|
||||
|
||||
#region Factions
|
||||
FactionEquipment.AddFactionProperties(this, list);
|
||||
@@ -1078,7 +1090,7 @@ namespace Server.Items
|
||||
|
||||
if (m_GorgonLenseCharges > 0)
|
||||
list.Add(1112590, m_GorgonLenseCharges.ToString()); //Gorgon Lens Charges: ~1_val~
|
||||
|
||||
|
||||
#region Mondain's Legacy Sets
|
||||
if (IsSetItem)
|
||||
{
|
||||
@@ -1122,8 +1134,8 @@ namespace Server.Items
|
||||
|
||||
if ((prop = ArtifactRarity) > 0)
|
||||
list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~
|
||||
|
||||
#region SA
|
||||
|
||||
#region SA
|
||||
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
|
||||
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
|
||||
|
||||
@@ -1156,8 +1168,8 @@ namespace Server.Items
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
|
||||
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
|
||||
|
||||
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
|
||||
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
|
||||
#endregion
|
||||
|
||||
@@ -1208,91 +1220,91 @@ namespace Server.Items
|
||||
|
||||
if ((prop = m_AosAttributes.SpellChanneling) != 0)
|
||||
list.Add(1060482); // spell channeling
|
||||
|
||||
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
|
||||
|
||||
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
|
||||
list.Add(1060450, prop.ToString()); // self repair ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.NightSight) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.NightSight) != 0)
|
||||
list.Add(1060441); // night sight
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStr) != 0)
|
||||
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusDex) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusDex) != 0)
|
||||
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusInt) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusInt) != 0)
|
||||
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusHits) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusHits) != 0)
|
||||
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStam) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStam) != 0)
|
||||
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusMana) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.BonusMana) != 0)
|
||||
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenHits) != 0)
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenStam) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.RegenStam) != 0)
|
||||
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenMana) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.RegenMana) != 0)
|
||||
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.Luck) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.Luck) != 0)
|
||||
list.Add(1060436, prop.ToString()); // luck ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.EnhancePotions) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.EnhancePotions) != 0)
|
||||
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
|
||||
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.AttackChance) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.AttackChance) != 0)
|
||||
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
|
||||
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponDamage) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.WeaponDamage) != 0)
|
||||
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.DefendChance) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.DefendChance) != 0)
|
||||
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.CastRecovery) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.CastRecovery) != 0)
|
||||
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.CastSpeed) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.CastSpeed) != 0)
|
||||
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.SpellDamage) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.SpellDamage) != 0)
|
||||
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.LowerManaCost) != 0)
|
||||
|
||||
if ((prop = m_AosAttributes.LowerManaCost) != 0)
|
||||
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.LowerRegCost) != 0)
|
||||
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
|
||||
|
||||
|
||||
if ((prop = m_AosAttributes.LowerAmmoCost) != 0)
|
||||
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
|
||||
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
|
||||
|
||||
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
|
||||
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
|
||||
|
||||
base.AddResistanceProperties(list);
|
||||
|
||||
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
|
||||
|
||||
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
|
||||
list.Add(1060437); // mage armor
|
||||
|
||||
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
|
||||
|
||||
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
|
||||
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
|
||||
|
||||
if ((prop = ComputeStatReq(StatType.Str)) > 0)
|
||||
|
||||
if ((prop = ComputeStatReq(StatType.Str)) > 0)
|
||||
list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
|
||||
|
||||
if ((prop = m_AosClothingAttributes.DurabilityBonus) > 0)
|
||||
@@ -1402,7 +1414,7 @@ namespace Server.Items
|
||||
Crafter = 0x00000100,
|
||||
Quality = 0x00000200,
|
||||
StrReq = 0x00000400,
|
||||
NegativeAttributes = 0x00000800,
|
||||
NegativeAttributes = 0x00000800,
|
||||
#region Imbuing
|
||||
//TimesImbued = 0x12000000,
|
||||
#endregion
|
||||
@@ -1614,7 +1626,7 @@ namespace Server.Items
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
switch (version)
|
||||
{
|
||||
case 12:
|
||||
case 11:
|
||||
@@ -1633,10 +1645,10 @@ namespace Server.Items
|
||||
goto case 8;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
m_IsImbued = reader.ReadBool();
|
||||
goto case 7;
|
||||
}
|
||||
{
|
||||
m_IsImbued = reader.ReadBool();
|
||||
goto case 7;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
|
||||
@@ -1668,11 +1680,11 @@ namespace Server.Items
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
if(version == 6)
|
||||
if (version == 6)
|
||||
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
|
||||
|
||||
m_TimesImbued = reader.ReadInt();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
m_BlessedBy = reader.ReadMobile();
|
||||
@@ -1933,7 +1945,7 @@ namespace Server.Items
|
||||
{
|
||||
for (int i = 0; i < amount; ++i)
|
||||
{
|
||||
switch ( Utility.Random(5) )
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
case 0: ++m_AosResistances.Physical; break;
|
||||
case 1: ++m_AosResistances.Fire; break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Executable → Regular
+10
-3
@@ -119,7 +119,7 @@ namespace Server.Items
|
||||
{
|
||||
m_BagOfSendingHue = value;
|
||||
|
||||
switch ( value )
|
||||
switch (value)
|
||||
{
|
||||
case BagOfSendingHue.Yellow:
|
||||
Hue = 0x8A5;
|
||||
@@ -135,7 +135,7 @@ namespace Server.Items
|
||||
}
|
||||
public static BagOfSendingHue RandomHue()
|
||||
{
|
||||
switch ( Utility.Random(3) )
|
||||
switch (Utility.Random(3))
|
||||
{
|
||||
case 0:
|
||||
return BagOfSendingHue.Yellow;
|
||||
@@ -206,7 +206,7 @@ namespace Server.Items
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
@@ -260,6 +260,13 @@ namespace Server.Items
|
||||
if (m_Bag.Deleted)
|
||||
return;
|
||||
|
||||
// Block usage anywhere in Felucca
|
||||
if (from.Map == Map.Felucca)
|
||||
{
|
||||
from.SendMessage("A mysterious force prevents the bag from working in Felucca.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.Region.IsPartOf<Regions.Jail>())
|
||||
{
|
||||
from.SendMessage("You may not do that in jail.");
|
||||
|
||||
Executable
+318
@@ -0,0 +1,318 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum BagOfSendingHue
|
||||
{
|
||||
Yellow,
|
||||
Blue,
|
||||
Red
|
||||
}
|
||||
|
||||
public class BagOfSending : Item, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private BagOfSendingHue m_BagOfSendingHue;
|
||||
[Constructable]
|
||||
public BagOfSending()
|
||||
: this(RandomHue())
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BagOfSending(BagOfSendingHue hue)
|
||||
: base(0xE76)
|
||||
{
|
||||
Weight = 2.0;
|
||||
|
||||
BagOfSendingHue = hue;
|
||||
|
||||
m_Charges = Utility.RandomMinMax(3, 9);
|
||||
}
|
||||
|
||||
public BagOfSending(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Recharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Recharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxRecharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 255;
|
||||
}
|
||||
}
|
||||
public string TranslocationItemName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "bag of sending";
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1054104;
|
||||
}
|
||||
}// a bag of sending
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BagOfSendingHue BagOfSendingHue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_BagOfSendingHue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_BagOfSendingHue = value;
|
||||
|
||||
switch ( value )
|
||||
{
|
||||
case BagOfSendingHue.Yellow:
|
||||
Hue = 0x8A5;
|
||||
break;
|
||||
case BagOfSendingHue.Blue:
|
||||
Hue = 0x8AD;
|
||||
break;
|
||||
case BagOfSendingHue.Red:
|
||||
Hue = 0x89B;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static BagOfSendingHue RandomHue()
|
||||
{
|
||||
switch ( Utility.Random(3) )
|
||||
{
|
||||
case 0:
|
||||
return BagOfSendingHue.Yellow;
|
||||
case 1:
|
||||
return BagOfSendingHue.Blue;
|
||||
default:
|
||||
return BagOfSendingHue.Red;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo(from, 1060741, m_Charges.ToString()); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive)
|
||||
list.Add(new UseBagEntry(this, Charges > 0 && IsChildOf(from.Backpack)));
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.Region.IsPartOf<Regions.Jail>())
|
||||
{
|
||||
from.SendMessage("You may not do that in jail.");
|
||||
}
|
||||
else if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
|
||||
}
|
||||
else if (Charges == 0)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1042544, 0x59); // This item is out of charges.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new SendTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)1); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Recharges);
|
||||
|
||||
writer.WriteEncodedInt((int)m_Charges);
|
||||
writer.WriteEncodedInt((int)m_BagOfSendingHue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min(reader.ReadEncodedInt(), MaxCharges);
|
||||
m_BagOfSendingHue = (BagOfSendingHue)reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class UseBagEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly BagOfSending m_Bag;
|
||||
public UseBagEntry(BagOfSending bag, bool enabled)
|
||||
: base(6189)
|
||||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if (!enabled)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Bag.Deleted)
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if (from.CheckAlive())
|
||||
m_Bag.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
|
||||
private class SendTarget : Target
|
||||
{
|
||||
private readonly BagOfSending m_Bag;
|
||||
public SendTarget(BagOfSending bag)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Bag = bag;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Bag.Deleted)
|
||||
return;
|
||||
|
||||
if (from.Region.IsPartOf<Regions.Jail>())
|
||||
{
|
||||
from.SendMessage("You may not do that in jail.");
|
||||
}
|
||||
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
|
||||
}
|
||||
else if (m_Bag.Charges == 0)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges.
|
||||
}
|
||||
else if (targeted is Item)
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
int reqCharges = 1; // (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0));
|
||||
// change was ML, however reverted during ML period so we can put it at 1
|
||||
|
||||
if (!item.IsChildOf(from.Backpack))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box.
|
||||
}
|
||||
else if (item is BagOfSending || item is Container)
|
||||
{
|
||||
from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending."));
|
||||
}
|
||||
else if (item.LootType == LootType.Cursed)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item.
|
||||
}
|
||||
else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item.
|
||||
}
|
||||
else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location))
|
||||
{
|
||||
from.SendLocalizedMessage(1062089); // You cannot use that here.
|
||||
}
|
||||
else if (!from.BankBox.TryDropItem(from, item, false))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full.
|
||||
}
|
||||
else if (Core.ML && reqCharges > m_Bag.Charges)
|
||||
{
|
||||
from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Bag.Charges -= (Core.ML ? reqCharges : 1);
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user