Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,333 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
using Server.Network;
using Server.ContextMenus;
using System.Collections.Generic;
namespace Server.Items
{
public interface IEverlastingTool : IEntity, IUsesRemaining
{
CraftSystem CraftSystem { get; }
bool BreakOnDepletion { get; }
bool CheckAccessible(Mobile from, ref int num);
}
public abstract class BaseEverlastingTool : Item, ITool, IResource
{
private Mobile m_Crafter;
private ItemQuality m_Quality;
private int m_UsesRemaining;
private bool m_RepairMode;
private CraftResource _Resource;
private bool _PlayerConstructed;
[CommandProperty(AccessLevel.GameMaster)]
public CraftResource Resource
{
get { return _Resource; }
set
{
_Resource = value;
Hue = CraftResources.GetHue(_Resource);
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public Mobile Crafter
{
get { return m_Crafter; }
set { m_Crafter = value; InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public ItemQuality Quality
{
get { return m_Quality; }
set
{
UnscaleUses();
m_Quality = value;
InvalidateProperties();
ScaleUses();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public bool PlayerConstructed
{
get { return _PlayerConstructed; }
set
{
_PlayerConstructed = value; InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
get { return m_UsesRemaining; }
set { m_UsesRemaining = value; InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public bool RepairMode
{
get { return m_RepairMode; }
set { m_RepairMode = value; }
}
public void ScaleUses()
{
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
InvalidateProperties();
}
public void UnscaleUses()
{
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
}
public int GetUsesScalar()
{
if (m_Quality == ItemQuality.Exceptional)
return 200;
return 100;
}
public bool ShowUsesRemaining
{
get { return true; }
set { }
}
public virtual bool BreakOnDepletion { get { return true; } }
public abstract CraftSystem CraftSystem { get; }
public BaseEverlastingTool(int itemID)
: this(10000, itemID)
{
}
public BaseEverlastingTool(int uses, int itemID)
: base(itemID)
{
Hue = 0x47E;
m_UsesRemaining = uses;
m_Quality = ItemQuality.Normal;
LootType = LootType.Blessed;
}
public BaseEverlastingTool(Serial serial)
: base(serial)
{
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
if (m_Crafter != null)
list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
if (m_Quality == ItemQuality.Exceptional)
list.Add(1060636); // exceptional
//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 virtual bool CheckAccessible(Mobile m, ref int num)
{
if (RootParent != m)
{
num = 1044263;
return false;
}
return true;
}
public static bool CheckAccessible(Item tool, Mobile m)
{
return CheckAccessible(tool, m, false);
}
public static bool CheckAccessible(Item tool, Mobile m, bool message)
{
if (tool == null || tool.Deleted)
{
return false;
}
var num = 0;
bool res;
if (tool is IEverlastingTool)
{
res = ((IEverlastingTool)tool).CheckAccessible(m, ref num);
}
else
{
res = tool.IsChildOf(m) || tool.Parent == m;
}
if (num > 0 && message)
{
m.SendLocalizedMessage(num);
}
return res;
}
public static bool CheckTool(Item tool, Mobile m)
{
if (tool == null || tool.Deleted)
{
return false;
}
Item check = m.FindItemOnLayer(Layer.OneHanded);
if (check is IEverlastingTool && check != tool && !(check is AncientSmithyHammer))
return false;
check = m.FindItemOnLayer(Layer.TwoHanded);
if (check is IEverlastingTool && check != tool && !(check is AncientSmithyHammer))
return false;
return true;
}
public override void OnSingleClick(Mobile from)
{
DisplayDurabilityTo(from);
base.OnSingleClick(from);
}
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack) || Parent == from)
{
if (this.UsesRemaining < 10000)
{
this.UsesRemaining = 10000;
}
CraftSystem system = CraftSystem;
if (Core.TOL && m_RepairMode)
{
Repair.Do(from, system, this);
}
else
{
int num = system.CanCraft(from, this, null);
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
{
from.SendLocalizedMessage(num);
}
else
{
CraftContext context = system.GetContext(from);
from.SendGump(new CraftGump(from, system, this, null));
}
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)4); // version
writer.Write(_PlayerConstructed);
writer.Write((int)_Resource);
writer.Write(m_RepairMode);
writer.Write((Mobile)m_Crafter);
writer.Write((int)m_Quality);
writer.Write((int)m_UsesRemaining);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 4:
{
_PlayerConstructed = reader.ReadBool();
goto case 3;
}
case 3:
{
_Resource = (CraftResource)reader.ReadInt();
goto case 2;
}
case 2:
{
m_RepairMode = reader.ReadBool();
goto case 1;
}
case 1:
{
m_Crafter = reader.ReadMobile();
m_Quality = (ItemQuality)reader.ReadInt();
goto case 0;
}
case 0:
{
m_UsesRemaining = reader.ReadInt();
break;
}
}
}
#region ICraftable Members
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
{
PlayerConstructed = true;
Quality = (ItemQuality)quality;
if (makersMark)
Crafter = from;
return quality;
}
#endregion
}
}

View File

@@ -0,0 +1,58 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute(0xE8A, 0xE89)]
public class EverlastingBlowpipe : BaseEverlastingTool
{
//public override int LabelNumber { get { return 1044609; } } // Blow Pipe
[Constructable]
public EverlastingBlowpipe()
: base(0xE8A)
{
Name = "Everlasting Blowpipe";
Weight = 1.0;
Hue = 1150;
}
public EverlastingBlowpipe(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefGlassblowing.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (Weight != 1.0)
Weight = 1.0;
}
}
}

View File

@@ -0,0 +1,57 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute(0x1022, 0x1023)]
public class EverlastingFletcherTools : BaseEverlastingTool
{
[Constructable]
public EverlastingFletcherTools()
: base(0x1022)
{
this.Name = "Everlasting Fletcher Tools";
this.Weight = 2.0;
this.Hue = 1150;
}
public EverlastingFletcherTools(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefBowFletching.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (this.Weight == 1.0)
this.Weight = 2.0;
}
}
}

View File

@@ -0,0 +1,53 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
public class EverlastingMalletAndChisel : BaseEverlastingTool
{
[Constructable]
public EverlastingMalletAndChisel()
: base(0x12B3)
{
this.Name = "Everlasting Mallet and Chisel";
this.Weight = 1.0;
this.Hue = 1150;
}
public EverlastingMalletAndChisel(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefMasonry.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,52 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
public class EverlastingMortarPestle : BaseEverlastingTool
{
[Constructable]
public EverlastingMortarPestle() : base(0xE9B)
{
Name = "Everlasting Mortar and Pestle";
this.Weight = 1.0;
Hue = 1150;
}
public EverlastingMortarPestle(Serial serial) : base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefAlchemy.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,54 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute(0x1034, 0x1035)]
public class EverlastingSaw : BaseEverlastingTool
{
[Constructable]
public EverlastingSaw()
: base(0x1034)
{
Name = "Everlasting Saw";
this.Weight = 2.0;
}
public EverlastingSaw(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefCarpentry.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,64 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute(0x0FBF, 0x0FC0)]
public class EverlastingScribesPen : BaseEverlastingTool
{
[Constructable]
public EverlastingScribesPen()
: base(0x0FBF)
{
Name = "Everlasting Scribes Pen";
this.Weight = 1.0;
}
public EverlastingScribesPen(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefInscription.CraftSystem;
}
}
public override int LabelNumber
{
get
{
return 1044168;
}
}// scribe's pen
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (this.Weight == 2.0)
this.Weight = 1.0;
}
}
}

View File

@@ -0,0 +1,53 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
public class EverlastingSewingKit : BaseEverlastingTool
{
[Constructable]
public EverlastingSewingKit()
: base(0xF9D)
{
Name = "Everlasting Sewing Kit";
this.Weight = 2.0;
}
public EverlastingSewingKit(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefTailoring.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,55 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
namespace Server.Items
{
[FlipableAttribute(0x13E3, 0x13E4)]
public class EverlastingSmithHammer : BaseEverlastingTool
{
[Constructable]
public EverlastingSmithHammer()
: base(0x13E3)
{
Name = "Everlasting Smith Hammer";
this.Weight = 8.0;
this.Layer = Layer.OneHanded;
}
public EverlastingSmithHammer(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefBlacksmithy.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,90 @@
/* Scripted By
* █▀▀▀ █▀▀ █▀▀█ █▀▀ █▀▀ ▀█ █▀ █▀▀█ █▀▀█
* █▀▀▀ ▀▀█ █ █ █ █▀ █▄█ █▄▄█ █ █
* █▄▄▄ ▀▀▀ █▀▀▀ ▀▀▀ ▀▀▀ ▀ ▀ ▀ █ █
* █
*
* █ █ █▀█ ▄▀█ █▀▀ █▀▀ █▀▀ █▀ █▀   █▀▀ █▀█ █▀█▀█
* █▄█ █▄█ █▀█ █▄▄ █▄▄ ██▄ ▄█ ▄█ ▄ █▄▄ █▄█ █ ▀ █
*/
using System;
using Server.Engines.Craft;
using Server.ContextMenus;
namespace Server.Items
{
[Flipable(0x1EB8, 0x1EB9)]
public class EverlastingTinkerTools : BaseEverlastingTool
{
[Constructable]
public EverlastingTinkerTools()
: base(0x1EB8)
{
Name = "Everlasting Tinker Tools";
this.Weight = 1.0;
}
public EverlastingTinkerTools(Serial serial)
: base(serial)
{
}
public override CraftSystem CraftSystem
{
get
{
return DefTinkering.CraftSystem;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
if (Core.TOL)
list.Add(new ToggleRepairContextMenuEntry(from, this));
}
public class ToggleRepairContextMenuEntry : ContextMenuEntry
{
private Mobile _From;
private BaseEverlastingTool _Tool;
public ToggleRepairContextMenuEntry(Mobile from, BaseEverlastingTool tool)
: base(1157040) // Toggle Repair Mode
{
_From = from;
_Tool = tool;
}
public override void OnClick()
{
if (_Tool.RepairMode)
{
_From.SendLocalizedMessage(1157042); // This tool is fully functional.
_Tool.RepairMode = false;
}
else
{
_From.SendLocalizedMessage(1157041); // This tool will only repair items in this mode.
_Tool.RepairMode = true;
}
}
}
}
}

View File

@@ -0,0 +1,540 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
namespace Server.Items
{
public class EverlastingBandage : Item, IDyable
{
public static int Range = ( Core.AOS ? 2 : 1 );
public override double DefaultWeight
{
get { return 0.1; }
}
[Constructable]
public EverlastingBandage() : this( 1 )
{
}
[Constructable]
public EverlastingBandage( int amount ) : base( 0xE21 )
{
Name = "Everlasting Bandage";
Stackable = true;
Amount = amount;
LootType = LootType.Blessed;
Hue = 1152;
}
public EverlastingBandage(Serial serial)
: base(serial)
{
}
public virtual bool Dye( Mobile from, DyeTub sender )
{
if ( Deleted )
return false;
Hue = sender.DyedHue;
return true;
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void OnDoubleClick( Mobile from )
{
if ( from.InRange( GetWorldLocation(), Range ) )
{
from.RevealingAction();
from.SendLocalizedMessage( 500948 ); // Who will you use the bandages on?
from.Target = new InternalTarget( this );
}
else
{
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
}
}
private class InternalTarget : Target
{
private EverlastingBandage m_EverlastingBandage;
public InternalTarget( EverlastingBandage bandage ) : base( EverlastingBandage.Range, false, TargetFlags.Beneficial )
{
m_EverlastingBandage = bandage;
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( m_EverlastingBandage.Deleted )
return; //* Here
if ( targeted is Mobile )
{
if ( from.InRange( m_EverlastingBandage.GetWorldLocation(), EverlastingBandage.Range ) )
{
if ( BandageContext1.BeginHeal( from, (Mobile)targeted, m_EverlastingBandage is EnhancedBandage ) != null )
{
//m_Bandage.Consume();
}
}
else
{
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
}
}
else if ( targeted is PlagueBeastInnard )
{
if ( ((PlagueBeastInnard) targeted).OnBandage( from ) )
m_EverlastingBandage.Consume();
}
else
{
from.SendLocalizedMessage( 500970 ); // Bandages can not be used on that.
}
}
protected override void OnNonlocalTarget( Mobile from, object targeted )
{
if ( targeted is PlagueBeastInnard )
{
//if ( ((PlagueBeastInnard) targeted).OnBandage( from ) )
// m_Bandage.Consume();
}
else
base.OnNonlocalTarget( from, targeted );
}
}
}
public class BandageContext1
{
private Mobile m_Healer;
private Mobile m_Patient;
private int m_Slips;
private Timer m_Timer;
public Mobile Healer{ get{ return m_Healer; } }
public Mobile Patient{ get{ return m_Patient; } }
public int Slips{ get{ return m_Slips; } set{ m_Slips = value; } }
public Timer Timer{ get{ return m_Timer; } }
#region Heritage Items
private bool m_Enhanced;
public bool Enhanced{ get{ return m_Enhanced; } }
#endregion
public void Slip()
{
m_Healer.SendLocalizedMessage( 500961 ); // Your fingers slip!
++m_Slips;
}
public BandageContext1( Mobile healer, Mobile patient, TimeSpan delay, bool enhanced )
{
m_Healer = healer;
m_Patient = patient;
m_Timer = new InternalTimer1( this, delay );
m_Timer.Start();
m_Enhanced = enhanced;
}
public void StopHeal()
{
m_Table.Remove( m_Healer );
if ( m_Timer != null )
m_Timer.Stop();
m_Timer = null;
}
private static Dictionary<Mobile, BandageContext1> m_Table = new Dictionary<Mobile, BandageContext1>();
public static BandageContext1 GetContext( Mobile healer )
{
BandageContext1 bc = null;
m_Table.TryGetValue( healer, out bc );
return bc;
}
public static SkillName GetPrimarySkill( Mobile m )
{
if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal) )
return SkillName.Veterinary;
else
return SkillName.Healing;
}
public static SkillName GetSecondarySkill( Mobile m )
{
if ( !m.Player && (m.Body.IsMonster || m.Body.IsAnimal) )
return SkillName.AnimalLore;
else
return SkillName.Anatomy;
}
public void EndHeal()
{
StopHeal();
int healerNumber = -1, patientNumber = -1;
bool playSound = true;
bool checkSkills = false;
SkillName primarySkill = GetPrimarySkill( m_Patient );
SkillName secondarySkill = GetSecondarySkill( m_Patient );
BaseCreature petPatient = m_Patient as BaseCreature;
if ( !m_Healer.Alive )
{
healerNumber = 500962; // You were unable to finish your work before you died.
patientNumber = -1;
playSound = false;
}
else if ( !m_Healer.InRange( m_Patient, EverlastingBandage.Range ) )
{
healerNumber = 500963; // You did not stay close enough to heal your target.
patientNumber = -1;
playSound = false;
}
else if ( !m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet) )
{
double healing = m_Healer.Skills[primarySkill].Value;
double anatomy = m_Healer.Skills[secondarySkill].Value;
double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);
if (( (checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble() )
|| ( Core.SE && petPatient is Factions.FactionWarHorse && petPatient.ControlMaster == m_Healer) ) //TODO: Dbl check doesn't check for faction of the horse here?
{
if ( m_Patient.Map == null || !m_Patient.Map.CanFit( m_Patient.Location, 16, false, false ) )
{
healerNumber = 501042; // Target can not be resurrected at that location.
patientNumber = 502391; // Thou can not be resurrected there!
}
else if ( m_Patient.Region != null && m_Patient.Region.IsPartOf( "Khaldun" ) )
{
healerNumber = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
patientNumber = -1;
}
else
{
healerNumber = 500965; // You are able to resurrect your patient.
patientNumber = -1;
m_Patient.PlaySound( 0x214 );
m_Patient.FixedEffect( 0x376A, 10, 16 );
if ( petPatient != null && petPatient.IsDeadPet )
{
Mobile master = petPatient.ControlMaster;
if( master != null && m_Healer == master )
{
petPatient.ResurrectPet();
for ( int i = 0; i < petPatient.Skills.Length; ++i )
{
petPatient.Skills[i].Base -= 0.1;
}
}
else if ( master != null && master.InRange( petPatient, 3 ) )
{
healerNumber = 503255; // You are able to resurrect the creature.
master.CloseGump( typeof( PetResurrectGump ) );
master.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
}
else
{
bool found = false;
List<Mobile> friends = petPatient.Friends;
for ( int i = 0; friends != null && i < friends.Count; ++i )
{
Mobile friend = friends[i];
if ( friend.InRange( petPatient, 3 ) )
{
healerNumber = 503255; // You are able to resurrect the creature.
friend.CloseGump( typeof( PetResurrectGump ) );
friend.SendGump( new PetResurrectGump( m_Healer, petPatient ) );
found = true;
break;
}
}
if ( !found )
healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection.
}
}
else
{
m_Patient.CloseGump( typeof( ResurrectGump ) );
m_Patient.SendGump( new ResurrectGump( m_Patient, m_Healer ) );
}
}
}
else
{
if ( petPatient != null && petPatient.IsDeadPet )
healerNumber = 503256; // You fail to resurrect the creature.
else
healerNumber = 500966; // You are unable to resurrect your patient.
patientNumber = -1;
}
}
else if ( m_Patient.Poisoned )
{
m_Healer.SendLocalizedMessage( 500969 ); // You finish applying the bandages.
double healing = m_Healer.Skills[primarySkill].Value;
double anatomy = m_Healer.Skills[secondarySkill].Value;
double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.1) - (m_Slips * 0.02);
if ( (checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble() )
{
if ( m_Patient.CurePoison( m_Healer ) )
{
healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
patientNumber = 1010059; // You have been cured of all poisons.
}
else
{
healerNumber = -1;
patientNumber = -1;
}
}
else
{
healerNumber = 1010060; // You have failed to cure your target!
patientNumber = -1;
}
}
else if ( BleedAttack.IsBleeding( m_Patient ) )
{
healerNumber = 1060088; // You bind the wound and stop the bleeding
patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!
BleedAttack.EndBleed( m_Patient, false );
}
else if ( MortalStrike.IsWounded( m_Patient ) )
{
healerNumber = ( m_Healer == m_Patient ? 1005000 : 1010398 );
patientNumber = -1;
playSound = false;
}
else if ( m_Patient.Hits == m_Patient.HitsMax )
{
healerNumber = 500967; // You heal what little damage your patient had.
patientNumber = -1;
}
else
{
checkSkills = true;
patientNumber = -1;
double healing = m_Healer.Skills[primarySkill].Value;
double anatomy = m_Healer.Skills[secondarySkill].Value;
double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);
#region Heritage Items
healing += EnhancedBandage.HealingBonus;
#endregion
if ( chance > Utility.RandomDouble() )
{
healerNumber = 500969; // You finish applying the bandages.
double min, max;
if ( Core.AOS )
{
min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
}
else
{
min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
}
double toHeal = min + (Utility.RandomDouble() * (max - min));
if ( m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal )
toHeal += m_Patient.HitsMax / 100;
if ( Core.AOS )
toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm
else
toHeal -= m_Slips * 4;
if ( toHeal < 1 )
{
toHeal = 1;
healerNumber = 500968; // You apply the bandages, but they barely help.
}
m_Patient.Heal( (int) toHeal, m_Healer, false );
}
else
{
healerNumber = 500968; // You apply the bandages, but they barely help.
playSound = false;
}
}
if ( healerNumber != -1 )
m_Healer.SendLocalizedMessage( healerNumber );
if ( patientNumber != -1 )
m_Patient.SendLocalizedMessage( patientNumber );
if ( playSound )
m_Patient.PlaySound( 0x57 );
if ( checkSkills )
{
m_Healer.CheckSkill( secondarySkill, 0.0, 120.0 );
m_Healer.CheckSkill( primarySkill, 0.0, 120.0 );
}
}
private class InternalTimer1 : Timer
{
private BandageContext1 m_Context;
public InternalTimer1( BandageContext1 context, TimeSpan delay ) : base( delay )
{
m_Context = context;
Priority = TimerPriority.FiftyMS;
}
protected override void OnTick()
{
m_Context.EndHeal();
}
}
public static BandageContext1 BeginHeal( Mobile healer, Mobile patient )
{
return BeginHeal( healer, patient, false );
}
public static BandageContext1 BeginHeal( Mobile healer, Mobile patient, bool enhanced )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if ( Core.AOS )
seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
else
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
}
else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
seconds = 2.0;
}
else if ( Core.AOS )
{
if (dex < 204)
{
seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay;
}
else
{
seconds = 0.7 + resDelay;
}
}
else
{
if ( dex >= 100 )
seconds = 3.0 + resDelay;
else if ( dex >= 40 )
seconds = 4.0 + resDelay;
else
seconds = 5.0 + resDelay;
}
}
BandageContext1 context = GetContext( healer );
if ( context != null )
context.StopHeal();
seconds *= 1000;
context = new BandageContext1( healer, patient, TimeSpan.FromMilliseconds( seconds ), enhanced );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
}
}

View File

@@ -0,0 +1,82 @@
#region AuthorHeader
//
// Shrink System version 2.1, by Xanthos
//
//
#endregion AuthorHeader
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Xanthos.Interfaces;
namespace Xanthos.ShrinkSystem
{
public class EverlastingPetLeash : Item, IShrinkTool
{
private int m_Charges = ShrinkConfig.ShrinkCharges;
[CommandProperty( AccessLevel.GameMaster )]
public int ShrinkCharges
{
get { return m_Charges; }
set
{
//if ( 0 == m_Charges || 0 == (m_Charges = value ))
//Delete();
//else
InvalidateProperties();
}
}
[Constructable]
public EverlastingPetLeash() : base( 0x1374 )
{
Weight = 1.0;
Movable = true;
Name = "Everlasting Pet Leash";
LootType = LootType.Blessed;
Hue = 0x480;
}
public EverlastingPetLeash( Serial serial ) : base( serial )
{
}
public override void AddNameProperties( ObjectPropertyList list )
{
base.AddNameProperties( list );
//if ( m_Charges >= 0 )
//list.Add( 1060658, "Charges\t{0}", m_Charges.ToString() );
}
public override void OnDoubleClick( Mobile from )
{
bool isStaff = from.AccessLevel != AccessLevel.Player;
if ( !IsChildOf( from.Backpack ) )
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
else if ( isStaff || from.Skills[ SkillName.AnimalTaming ].Value >= ShrinkConfig.TamingRequired )
from.Target = new ShrinkTarget( from, this, isStaff );
else
from.SendMessage( "You must have at least " + ShrinkConfig.TamingRequired + " animal taming to use a pet leash." );
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
writer.Write( m_Charges );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_Charges = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,61 @@
using System;
using Server.Items;
using Server.Network;
namespace Server.Items
{
[FlipableAttribute( 0xF43, 0xF44 )]
public class IndestructableHatchet : Hatchet
{
public override WeaponAbility PrimaryAbility { get { return WeaponAbility.ArmorIgnore; } }
public override WeaponAbility SecondaryAbility { get { return WeaponAbility.Disarm; } }
public override int AosStrengthReq { get { return 20; } }
public override int AosMinDamage { get { return 13; } }
public override int AosMaxDamage { get { return 15; } }
public override int AosSpeed { get { return 41; } }
public override float MlSpeed { get { return 2.75f; } }
public override int OldStrengthReq { get { return 15; } }
public override int OldMinDamage { get { return 2; } }
public override int OldMaxDamage { get { return 17; } }
public override int OldSpeed { get { return 40; } }
[Constructable]
public IndestructableHatchet() : base( 0xF43 )
{
Weight = 2.0;
UsesRemaining = 10000;
LootType = LootType.Blessed;
Hue = 1150;
}
public override void OnDoubleClick(Mobile from)
{
if (UsesRemaining < 10000)
{
UsesRemaining = 10000;
}
}
public IndestructableHatchet(Serial serial) : base(serial)
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,59 @@
using System;
using Server.Items;
using Server.Network;
using Server.Engines.Harvest;
using Server.CustomMining;
namespace Server.Items
{
//[FlipableAttribute( 0xE86, 0xE85 )]
public class IndestructablePickaxe : VeinPickaxe//BaseAxe, IHarvestTool
{
/*
public override HarvestSystem HarvestSystem{ get{ return Mining.System; } }
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.DoubleStrike; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.Disarm; } }
public override int AosStrengthReq{ get{ return 50; } }
public override int AosMinDamage{ get{ return 13; } }
public override int AosMaxDamage{ get{ return 15; } }
public override int AosSpeed{ get{ return 35; } }
public override float MlSpeed{ get{ return 3.00f; } }
public override int OldStrengthReq{ get{ return 25; } }
public override int OldMinDamage{ get{ return 1; } }
public override int OldMaxDamage{ get{ return 15; } }
public override int OldSpeed{ get{ return 35; } }
public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.Slash1H; } }
*/
[Constructable]
public IndestructablePickaxe() : base()
{
Weight = 5.0;
Hue = 1150;
LootType = LootType.Blessed;
}
public IndestructablePickaxe(Serial serial) : base(serial)
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}