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,64 @@
using System;
using Server.Mobiles;
namespace Server.Items
{
public class BasketWeavingBook : Item
{
public override int LabelNumber {get {return 1153529;} } // Making valuables with Basket Weaving
[Constructable]
public BasketWeavingBook()
: base(0xFBE)
{
Weight = 1.0;
}
public BasketWeavingBook(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();
}
public override void OnDoubleClick(Mobile from)
{
PlayerMobile pm = from as PlayerMobile;
if (pm == null)
{
return;
}
if (!IsChildOf(pm.Backpack))
{
pm.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (pm.Skills[SkillName.Tinkering].Base < 100.0)
{
pm.SendLocalizedMessage(1112255); // Only a Grandmaster Tinker can learn from this book.
}
else if (pm.BasketWeaving)
{
pm.SendLocalizedMessage(1080066); // You have already learned this information.
}
else
{
pm.BasketWeaving = true;
pm.SendLocalizedMessage(1112254); // You have learned to make baskets. You will need gardeners to make reeds out of plants for you to make these items.
Delete();
}
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using Server;
namespace Server.Items
{
public class BasketCraftable : BaseContainer
{
public override int LabelNumber { get { return 1022448; } } //basket
[Constructable]
public BasketCraftable() : base(9431)
{
}
public BasketCraftable(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
}

View File

@@ -0,0 +1,32 @@
using System;
using Server;
using Server.Items;
public class PicnicBasket2 : BaseContainer
{
[Constructable]
public PicnicBasket2()
: base(0xE7A)
{
this.Weight = 1.0;
}
public PicnicBasket2(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,40 @@
using System;
using Server;
using Server.Items;
public class RoundBasket : BaseContainer
{
[Constructable]
public RoundBasket()
: base(0x990)
{
this.Weight = 1.0;
}
public RoundBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112293;
}
}// round basket
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,34 @@
using System;
using Server;
using Server.Items;
public class RoundBasketHandles : BaseContainer
{
public override int LabelNumber { get { return 1112293; } } // round basket
[Constructable]
public RoundBasketHandles()
: base(0x9AC)
{
Weight = 1.0;
}
public RoundBasketHandles(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,40 @@
using System;
using Server;
using Server.Items;
public class SmallBushel : BaseContainer
{
[Constructable]
public SmallBushel()
: base(0x09B1)
{
this.Weight = 1.0;
}
public SmallBushel(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112337;
}
}// small bushel
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,40 @@
using System;
using Server;
using Server.Items;
public class SmallRoundBasket : BaseContainer
{
[Constructable]
public SmallRoundBasket()
: base(0x24DD)
{
this.Weight = 1.0;
}
public SmallRoundBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112298;
}
}// small round basket
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,40 @@
using System;
using Server;
using Server.Items;
public class SmallSquareBasket : BaseContainer
{
[Constructable]
public SmallSquareBasket()
: base(0x24D9)
{
this.Weight = 1.0;
}
public SmallSquareBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112296;
}
}// small square basket
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,40 @@
using System;
using Server;
using Server.Items;
public class SquareBasket : BaseContainer
{
[Constructable]
public SquareBasket()
: base(0x24D5)
{
this.Weight = 1.0;
}
public SquareBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112295;
}
}// square basket
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,40 @@
using System;
using Server;
using Server.Items;
public class TallBasket : BaseContainer
{
[Constructable]
public TallBasket()
: base(0x24DB)
{
this.Weight = 1.0;
}
public TallBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112299;
}
}// tall basket
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,40 @@
using System;
using Server;
using Server.Items;
public class TallRoundBasket : BaseContainer
{
[Constructable]
public TallRoundBasket()
: base(0x24D8)
{
this.Weight = 1.0;
}
public TallRoundBasket(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112297;
}
}//Tall Round Basket
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,32 @@
using System;
using Server;
using Server.Items;
public class WinnowingBasket : BaseContainer
{
[Constructable]
public WinnowingBasket()
: base(0x1882)
{
Weight = 1.0;
}
public WinnowingBasket(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,380 @@
#region References
using System;
using System.Collections.Generic;
using Server.Gumps;
using Server.Network;
using Server.ContextMenus;
using Server.Engines.Craft;
using Server.Engines.Plants;
using Server.Mobiles;
using Server.Targeting;
#endregion
namespace Server.Items
{
[Flipable(0x0DFC, 0x0DFD)]
public class Clippers : BaseTool
{
public override int LabelNumber { get { return 1112117; } } // clippers
[Constructable]
public Clippers()
: base(0x0DFC)
{
Weight = 1.0;
Hue = 1168;
}
[Constructable]
public Clippers(int uses)
: base(uses, 0x0DFC)
{
Weight = 1.0;
Hue = 1168;
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
//Makers mark not displayed on OSI
if (Crafter != null)
{
list.Add(1050043, Crafter.TitleName); // crafted by ~1_NAME~
}
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
AddContextMenuEntries(from, this, list);
}
public static void AddContextMenuEntries(Mobile from, Item item, List<ContextMenuEntry> list)
{
if (!item.IsChildOf(from.Backpack) && item.Parent != from)
return;
PlayerMobile pm = from as PlayerMobile;
if (pm == null)
return;
list.Add(new ToggleClippings(pm, true, false, false, 1112282)); //Set to clip plants
list.Add(new ToggleClippings(pm, false, true, false, 1112283)); //Set to cut reeds
list.Add(new ToggleClippings(pm, false, false, true, 1150660)); //Set to cut topiaries
}
private class ToggleClippings : ContextMenuEntry
{
private readonly PlayerMobile m_Mobile;
private readonly bool m_Valueclips;
private readonly bool m_Valuereeds;
private readonly bool m_Valuetopiaries;
public ToggleClippings(PlayerMobile mobile, bool valueclips, bool valuereeds, bool valuetopiaries, int number)
: base(number)
{
m_Mobile = mobile;
m_Valueclips = valueclips;
m_Valuereeds = valuereeds;
m_Valuetopiaries = valuetopiaries;
}
public override void OnClick()
{
bool oldValueclips = m_Mobile.ToggleCutClippings;
bool oldValuereeds = m_Mobile.ToggleCutReeds;
bool oldValuetopiaries = m_Mobile.ToggleCutTopiaries;
if (m_Valueclips)
{
if (oldValueclips)
{
m_Mobile.ToggleCutClippings = true;
m_Mobile.ToggleCutReeds = false;
m_Mobile.ToggleCutTopiaries = false;
m_Mobile.SendLocalizedMessage(1112284); // You are already set to make plant clippings
}
else
{
m_Mobile.ToggleCutClippings = true;
m_Mobile.ToggleCutReeds = false;
m_Mobile.ToggleCutTopiaries = false;
m_Mobile.SendLocalizedMessage(1112285); // You are now set to make plant clippings
}
}
else if (m_Valuereeds)
{
if (oldValuereeds)
{
m_Mobile.ToggleCutReeds = true;
m_Mobile.ToggleCutClippings = false;
m_Mobile.ToggleCutTopiaries = false;
m_Mobile.SendLocalizedMessage(1112287); // You are already set to cut reeds.
}
else
{
m_Mobile.ToggleCutReeds = true;
m_Mobile.ToggleCutClippings = false;
m_Mobile.ToggleCutTopiaries = false;
m_Mobile.SendLocalizedMessage(1112286); // You are now set to cut reeds.
}
}
else if (m_Valuetopiaries)
{
if (oldValuetopiaries)
{
m_Mobile.ToggleCutTopiaries = true;
m_Mobile.ToggleCutReeds = false;
m_Mobile.ToggleCutClippings = false;
m_Mobile.SendLocalizedMessage(1150653); // You are already set to cut topiaries!
}
else
{
m_Mobile.ToggleCutTopiaries = true;
m_Mobile.ToggleCutReeds = false;
m_Mobile.ToggleCutClippings = false;
m_Mobile.SendLocalizedMessage(1150652); // You are now set to cut topiaries.
}
}
}
}
public Clippers(Serial serial)
: base(serial)
{ }
public virtual PlantHue PlantHue { get { return PlantHue.None; } }
public override CraftSystem CraftSystem
{
get
{
return DefTinkering.CraftSystem;
}
}
public void ConsumeUse(Mobile from)
{
if (UsesRemaining > 1)
{
--UsesRemaining;
}
else
{
if (from != null)
from.SendLocalizedMessage(1112126); // Your clippers break as you use up the last charge..
Delete();
}
}
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1112118); // What plant do you wish to use these clippers on?
from.Target = new InternalTarget(this);
}
}
private class InternalTarget : Target
{
private readonly Clippers m_Item;
public InternalTarget(Clippers item)
: base(2, false, TargetFlags.None)
{
m_Item = item;
}
protected override void OnTarget(Mobile from, object targeted)
{
PlayerMobile pm = from as PlayerMobile;
if (pm == null || m_Item == null || m_Item.Deleted)
{
return;
}
PlantItem plant = targeted as PlantItem;
if (null == plant || PlantStatus.DecorativePlant != plant.PlantStatus)
{
from.SendLocalizedMessage(1112119); // You may only use these clippers on decorative plants.
return;
}
if (pm.ToggleCutClippings)
{
from.PlaySound(0x248);
from.AddToBackpack(
new PlantClippings
{
Hue = ((PlantItem)targeted).Hue,
PlantHue = plant.PlantHue
});
plant.Delete();
m_Item.ConsumeUse(from);
}
else if (pm.ToggleCutReeds)
{
from.PlaySound(0x248);
from.AddToBackpack(
new DryReeds
{
Hue = ((PlantItem)targeted).Hue,
PlantHue = plant.PlantHue
});
plant.Delete();
m_Item.ConsumeUse(from);
}
else if (pm.ToggleCutTopiaries)
{
if (plant.PlantType == PlantType.HedgeTall || plant.PlantType == PlantType.HedgeShort || plant.PlantType == PlantType.JuniperBush)
{
from.CloseGump(typeof(TopiaryGump));
from.SendGump(new TopiaryGump(plant, m_Item));
}
}
}
}
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 class TopiaryGump : Gump
{
PlantItem m_plant;
Clippers m_clippers;
public TopiaryGump(PlantItem plant, Clippers clippers) : base(0, 0)
{
m_plant = plant;
m_clippers = clippers;
AddPage(0);
AddBackground(50, 89, 508, 195, 2600);
AddLabel(103, 114, 0, @"Choose a Topiary:");
AddButton(92, 155, 1209, 1210, 1, GumpButtonType.Reply, 0);
AddItem(75, 178, 18713);
AddButton(133, 155, 1209, 1210, 2, GumpButtonType.Reply, 0);
AddItem(119, 178, 18714);
AddButton(177, 155, 1209, 1210, 3, GumpButtonType.Reply, 0);
AddItem(165, 182, 18715);
AddButton(217, 155, 1209, 1210, 4, GumpButtonType.Reply, 0);
AddItem(205, 182, 18736);
AddButton(267, 155, 1209, 1210, 5, GumpButtonType.Reply, 0);
AddItem(220, 133, 18813);
AddButton(333, 155, 1209, 1210, 6, GumpButtonType.Reply, 0);
AddItem(272, 133, 18814);
AddButton(388, 155, 1209, 1210, 7, GumpButtonType.Reply, 0);
AddItem(374, 178, 18784);
AddButton(426, 155, 1209, 1210, 8, GumpButtonType.Reply, 0);
AddItem(413, 175, 18713);
AddButton(480, 155, 1209, 1210, 9, GumpButtonType.Reply, 0);
AddItem(463, 176, 19369);
}
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile from = sender.Mobile;
switch (info.ButtonID)
{
case 0:
{
break;
}
case 1:
{
from.PlaySound(0x248);
m_plant.ItemID = 18713;
m_clippers.ConsumeUse(from);
break;
}
case 2:
{
from.PlaySound(0x248);
m_plant.ItemID = 18714;
m_clippers.ConsumeUse(from);
break;
}
case 3:
{
from.PlaySound(0x248);
m_plant.ItemID = 18715;
m_clippers.ConsumeUse(from);
break;
}
case 4:
{
from.PlaySound(0x248);
m_plant.ItemID = 18736;
m_clippers.ConsumeUse(from);
break;
}
case 5:
{
from.PlaySound(0x248);
m_plant.ItemID = 18813;
m_clippers.ConsumeUse(from);
break;
}
case 6:
{
from.PlaySound(0x248);
m_plant.ItemID = 18814;
m_clippers.ConsumeUse(from);
break;
}
case 7:
{
from.PlaySound(0x248);
m_plant.ItemID = 18814;
m_clippers.ConsumeUse(from);
break;
}
case 8:
{
from.PlaySound(0x248);
m_plant.ItemID = 18713;
m_clippers.ConsumeUse(from);
break;
}
case 9:
{
from.PlaySound(0x248);
m_plant.ItemID = 19369;
m_clippers.ConsumeUse(from);
break;
}
}
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
namespace Server.Items
{
public class ColorFixative : Item
{
[Constructable]
public ColorFixative()
: base(0x182D)
{
this.Weight = 1.0;
this.Hue = 473; // ...make this the proper shade of green
}
public ColorFixative(Serial serial)
: base(serial)
{
}
public override int LabelNumber
{
get
{
return 1112135;
}
}// color fixative
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,227 @@
#region References
using Server.Engines.Plants;
using Server.Engines.Craft;
using System;
#endregion
namespace Server.Items
{
public class DryReeds : Item, IPlantHue
{
private PlantHue m_PlantHue;
[CommandProperty(AccessLevel.GameMaster)]
public PlantHue PlantHue { get { return m_PlantHue; } set { m_PlantHue = value; InvalidatePlantHue(); InvalidateProperties(); } }
public override int LabelNumber { get { return 1112248; } } //dry reeds
public DryReeds(PlantHue hue)
: base(0x1BD5)
{
PlantHue = hue;
Stackable = true;
}
[Constructable]
public DryReeds()
: this(PlantHue.Plain)
{
}
public void InvalidatePlantHue()
{
PlantHueInfo info = PlantHueInfo.GetInfo(m_PlantHue);
if (info == null)
{
m_PlantHue = PlantHue.Plain;
Hue = 0;
}
else
Hue = info.Hue;
InvalidateProperties();
}
public override void AddNameProperty(ObjectPropertyList list)
{
PlantHueInfo info = PlantHueInfo.GetInfo(m_PlantHue);
int cliloc;
if (Amount > 1)
{
cliloc = info.IsBright() ? 1113273 : 1113275;
list.Add(cliloc, String.Format("{0}\t#{1}", Amount.ToString(), info.Name));
}
else
{
cliloc = info.IsBright() ? 1112288 : 1112289;
list.Add(cliloc, String.Format("#{0}", info.Name));
}
}
public override bool WillStack(Mobile from, Item dropped)
{
return dropped is IPlantHue && ((IPlantHue)dropped).PlantHue == m_PlantHue && base.WillStack(from, dropped);
}
public override void OnAfterDuped(Item newItem)
{
if (newItem is IPlantHue)
((IPlantHue)newItem).PlantHue = this.PlantHue;
base.OnAfterDuped(newItem);
}
public DryReeds(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1);
writer.Write((int)m_PlantHue);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
if(v > 0)
m_PlantHue = (PlantHue)reader.ReadInt();
}
}
public class SoftenedReeds : Item, IPlantHue
{
private PlantHue m_PlantHue;
[CommandProperty(AccessLevel.GameMaster)]
public PlantHue PlantHue { get { return m_PlantHue; } set { m_PlantHue = value; InvalidatePlantHue(); InvalidateProperties(); } }
public override int LabelNumber { get { return 1112249; } } //Softened reeds
[Constructable]
public SoftenedReeds()
: this(PlantHue.Plain)
{
}
public SoftenedReeds(PlantHue hue)
: base(0x4006)
{
m_PlantHue = hue;
InvalidatePlantHue();
Stackable = true;
}
public void InvalidatePlantHue()
{
PlantHueInfo info = PlantHueInfo.GetInfo(m_PlantHue);
if (info == null)
{
m_PlantHue = PlantHue.Plain;
Hue = 0;
}
else
Hue = info.Hue;
InvalidateProperties();
}
public void InvalidateHue()
{
PlantHueInfo info = PlantHueInfo.GetInfo(Hue);
m_PlantHue = info.PlantHue;
}
public override void AddNameProperty(ObjectPropertyList list)
{
PlantHueInfo info = PlantHueInfo.GetInfo(m_PlantHue);
int cliloc;
if (Amount > 1)
{
cliloc = info.IsBright() ? 1113273 : 1113275;
list.Add(cliloc, String.Format("{0}\t#{1}", Amount.ToString(), info.Name));
}
else
{
cliloc = info.IsBright() ? 1112288 : 1112289;
list.Add(cliloc, String.Format("#{0}", info.Name));
}
}
public override bool WillStack(Mobile from, Item dropped)
{
return dropped is IPlantHue && ((IPlantHue)dropped).PlantHue == m_PlantHue && base.WillStack(from, dropped);
}
public override void OnAfterDuped(Item newItem)
{
if (newItem is IPlantHue)
((IPlantHue)newItem).PlantHue = this.PlantHue;
base.OnAfterDuped(newItem);
}
public SoftenedReeds(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)2);
writer.Write((int)m_PlantHue);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
if(v > 1)
m_PlantHue = (PlantHue)reader.ReadInt();
}
}
public class CrystalGranules : Item
{
public override int LabelNumber { get { return 1112329; } } // crystal granules
[Constructable]
public CrystalGranules()
: base(16392)
{
Hue = 2625;
}
public CrystalGranules(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,223 @@
using System;
using Server.Engines.Plants;
using Server.Multis;
using Server.Targeting;
namespace Server.Items
{
public class NaturalDye : Item, IPigmentHue
{
private PlantPigmentHue m_Hue;
private int m_UsesRemaining;
[Constructable]
public NaturalDye()
: this(PlantPigmentHue.None)
{
}
[Constructable]
public NaturalDye(PlantPigmentHue hue)
: base(0x182B)
{
Weight = 1.0;
PigmentHue = hue;
m_UsesRemaining = 5;
}
public NaturalDye(Serial serial)
: base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public PlantPigmentHue PigmentHue
{
get
{
return m_Hue;
}
set
{
m_Hue = value;
// set any invalid pigment hue to Plain
if (m_Hue != PlantPigmentHueInfo.GetInfo(m_Hue).PlantPigmentHue)
m_Hue = PlantPigmentHue.Plain;
Hue = PlantPigmentHueInfo.GetInfo(m_Hue).Hue;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
get
{
return m_UsesRemaining;
}
set
{
m_UsesRemaining = value;
InvalidateProperties();
}
}
public override int LabelNumber
{
get
{
return 1112136;
}
}// natural dye
public bool RetainsColorFrom
{
get
{
return true;
}
}
public override bool ForceShowProperties
{
get
{
return ObjectPropertyList.Enabled;
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
}
public override void AddNameProperty(ObjectPropertyList list)
{
PlantPigmentHueInfo hueInfo = PlantPigmentHueInfo.GetInfo(m_Hue);
if (Amount > 1)
list.Add(PlantPigmentHueInfo.IsBright(m_Hue) ? 1113277 : 1113276, "{0}\t{1}", Amount, "#" + hueInfo.Name); // ~1_COLOR~ Softened Reeds
else
list.Add(hueInfo.IsBright() ? 1112138 : 1112137, "#" + hueInfo.Name); // ~1_COLOR~ natural dye
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write((int)m_Hue);
writer.Write((int)m_UsesRemaining);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 1:
m_Hue = (PlantPigmentHue)reader.ReadInt();
m_UsesRemaining = reader.ReadInt();
break;
}
}
public override void OnDoubleClick(Mobile from)
{
from.SendLocalizedMessage(1112139); // Select the item you wish to dye.
from.Target = new InternalTarget(this);
}
private class InternalTarget : Target
{
private readonly NaturalDye m_Item;
public InternalTarget(NaturalDye item)
: base(1, false, TargetFlags.None)
{
m_Item = item;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Item.Deleted)
return;
Item item = targeted as Item;
if (item != null)
{
bool valid = (item is IDyable || item is BaseTalisman ||
item is BaseBook || item is BaseClothing ||
item is BaseJewel || item is BaseStatuette ||
item is BaseWeapon || item is Runebook ||
item is Spellbook || item is DecorativePlant || item is ShoulderParrot ||
item.IsArtifact || BasePigmentsOfTokuno.IsValidItem(item));
if (item is HoodedShroudOfShadows || item is MonkRobe)
{
from.SendLocalizedMessage(1042083); // You cannot dye that.
return;
}
if (!valid && FurnitureAttribute.Check(item))
{
if (!from.InRange(m_Item.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
{
from.SendLocalizedMessage(500446); // That is too far away.
return;
}
else
{
BaseHouse house = BaseHouse.FindHouseAt(item);
if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)))
{
from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
return;
}
else if (!house.IsCoOwner(from))
{
from.SendLocalizedMessage(501023); // You must be the owner to use this item.
return;
}
else
valid = true;
}
}
else if (!item.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return;
}
if (!valid && item is BaseArmor)
{
CraftResourceType restype = CraftResources.GetType(((BaseArmor)item).Resource);
if ((CraftResourceType.Leather == restype || CraftResourceType.Metal == restype) &&
ArmorMaterialType.Bone != ((BaseArmor)item).MaterialType)
{
valid = true;
}
}
// need to add any bags, chests, boxes, crates not IDyable but dyable by natural dyes
if (valid)
{
item.Hue = PlantPigmentHueInfo.GetInfo(m_Item.PigmentHue).Hue;
from.PlaySound(0x23E);
if (--m_Item.UsesRemaining > 0)
m_Item.InvalidateProperties();
else
m_Item.Delete();
return;
}
}
from.SendLocalizedMessage(1042083); // You cannot dye that.
}
}
}
}

View File

@@ -0,0 +1,185 @@
using System;
using Server.Engines.Plants;
using Server.Targeting;
namespace Server.Items
{
public class PlantPigment : Item, IPigmentHue
{
private PlantPigmentHue m_Hue;
[Constructable]
public PlantPigment()
: this(PlantPigmentHue.None)
{
}
[Constructable]
public PlantPigment(PlantPigmentHue hue)
: base(0x0F02)
{
Weight = 1.0;
PigmentHue = hue;
}
[Constructable]
public PlantPigment(PlantHue hue)
: base(0x0F02)
{
Weight = 1.0;
PigmentHue = PlantPigmentHueInfo.HueFromPlantHue(hue);
}
public PlantPigment(Serial serial)
: base(serial)
{
}
public bool RetainsColorFrom
{
get
{
return true;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public PlantPigmentHue PigmentHue
{
get
{
return m_Hue;
}
set
{
m_Hue = value;
//set any invalid pigment hue to Plain
if (m_Hue != PlantPigmentHueInfo.GetInfo(m_Hue).PlantPigmentHue)
m_Hue = PlantPigmentHue.Plain;
Hue = PlantPigmentHueInfo.GetInfo(m_Hue).Hue;
InvalidateProperties();
}
}
public override int LabelNumber
{
get
{
return 1112132;
}
}// plant pigment
public override void AddNameProperty(ObjectPropertyList list)
{
PlantPigmentHueInfo info = PlantPigmentHueInfo.GetInfo(m_Hue);
int cliloc;
if (Amount > 1)
{
cliloc = info.IsBright() ? 1113271 : 1113270;
list.Add(cliloc, String.Format("{0}\t#{1}", Amount.ToString(), info.Name));
}
else
{
cliloc = info.IsBright() ? 1112134 : 1112133;
list.Add(cliloc, String.Format("#{0}", info.Name));
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write((int)m_Hue);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 1:
m_Hue = (PlantPigmentHue)reader.ReadInt();
break;
}
}
public override void OnDoubleClick(Mobile from)
{
if (!PlantPigmentHueInfo.IsMixable(PigmentHue))
from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
else
{
from.SendLocalizedMessage(1112123); // Which plant pigment do you wish to mix this with?
from.Target = new InternalTarget(this);
}
}
private class InternalTarget : Target
{
private readonly PlantPigment m_Item;
public InternalTarget(PlantPigment item)
: base(2, false, TargetFlags.None)
{
m_Item = item;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Item.Deleted)
return;
PlantPigment pigment = targeted as PlantPigment;
if (null == pigment)
{
from.SendLocalizedMessage(1112124); // You may only mix this with another non-saturated plant pigment.
return;
}
if (from.Skills[SkillName.Alchemy].Base < 75.0 && from.Skills[SkillName.Cooking].Base < 75.0)
{
from.SendLocalizedMessage(1112214); // You lack the alchemy or cooking skills to mix plant pigments.
}
else if ((PlantPigmentHue.White == pigment.PigmentHue || PlantPigmentHue.Black == pigment.PigmentHue ||
PlantPigmentHue.White == m_Item.PigmentHue || PlantPigmentHue.Black == m_Item.PigmentHue) &&
from.Skills[SkillName.Alchemy].Base < 100.0 &&
from.Skills[SkillName.Cooking].Base < 100.0)
{
from.SendLocalizedMessage(1112213); // You lack the alchemy or cooking skills to mix so unstable a pigment.
}
else if (m_Item.PigmentHue == pigment.PigmentHue)
{
from.SendLocalizedMessage(1112242); // You decide not to waste pigments by mixing two identical colors.
}
else if ((m_Item.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)) ==
(pigment.PigmentHue & ~(PlantPigmentHue.Bright | PlantPigmentHue.Dark | PlantPigmentHue.Ice)))
{
from.SendLocalizedMessage(1112243); // You decide not to waste pigments by mixing variations of the same hue.
}
else if ((PlantPigmentHue.White == m_Item.PigmentHue && PlantPigmentHueInfo.IsBright(pigment.PigmentHue)) ||
(PlantPigmentHue.White == pigment.PigmentHue && PlantPigmentHueInfo.IsBright(m_Item.PigmentHue)))
{
from.SendLocalizedMessage(1112241); // This pigment is too diluted to be faded further.
}
else if (!PlantPigmentHueInfo.IsMixable(pigment.PigmentHue))
from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
else
{
PlantPigmentHue newHue = PlantPigmentHueInfo.Mix(m_Item.PigmentHue, pigment.PigmentHue);
if (PlantPigmentHue.None == newHue)
from.SendLocalizedMessage(1112125); // This pigment is saturated and cannot be mixed further.
else
{
pigment.PigmentHue = newHue;
Bottle bottle = new Bottle();
bottle.MoveToWorld(m_Item.Location, m_Item.Map);
m_Item.Delete();
from.PlaySound(0x240);
}
}
}
}
}
}

View File

@@ -0,0 +1,259 @@
using System;
using System.Collections.Generic;
namespace Server.Engines.Plants
{
public interface IPlantHue
{
PlantHue PlantHue { get; set; }
void InvalidatePlantHue();
}
public interface IPigmentHue
{
PlantPigmentHue PigmentHue { get; set; }
}
[Flags]
public enum PlantPigmentHue
{
None = 0,
Plain = 0x1,
Red = 0x2,
Blue = 0x4,
Yellow = 0x8,
Purple = Red | Blue,
Green = Blue | Yellow,
Orange = Red | Yellow,
Black = 0x10,
White = 0x20,
Pink = 0x40,
Magenta = 0x80,
Aqua = 0x100,
FireRed = 0x200,
BrightRed = Red | Bright,
BrightBlue = Blue | Bright,
BrightYellow = Yellow | Bright,
BrightPurple = Purple | Bright,
BrightGreen = Green | Bright,
BrightOrange = Orange | Bright,
DarkRed = Red | Dark,
DarkBlue = Blue | Dark,
DarkYellow = Yellow | Dark,
DarkPurple = Purple | Dark,
DarkGreen = Green | Dark,
DarkOrange = Orange | Dark,
IceRed = Red | Ice,
IceBlue = Blue | Ice,
IceYellow = Yellow | Ice,
IcePurple = Purple | Ice,
IceGreen = Green | Ice,
IceOrange = Orange | Ice,
IceBlack = Black | Ice,
OffWhite = White | Bright,
Metal = Black | Bright,
Ice = 0x2000000,
Dark = 0x4000000,
Bright = 0x8000000,
}
public class PlantPigmentHueInfo
{
private static Dictionary<PlantPigmentHue, PlantPigmentHueInfo> m_Table;
private readonly PlantHue m_PlantHue;
private readonly int m_Hue;
private readonly int m_Name;
private readonly PlantPigmentHue m_PlantPigmentHue;
static PlantPigmentHueInfo()
{
m_Table = new Dictionary<PlantPigmentHue, PlantPigmentHueInfo>();
m_Table[PlantPigmentHue.Plain] = new PlantPigmentHueInfo(PlantHue.Plain, 2101, 1060813, PlantPigmentHue.Plain);
m_Table[PlantPigmentHue.Red] = new PlantPigmentHueInfo(PlantHue.Red, 1652, 1060814, PlantPigmentHue.Red);
m_Table[PlantPigmentHue.Blue] = new PlantPigmentHueInfo(PlantHue.Blue, 2122, 1060815, PlantPigmentHue.Blue);
m_Table[PlantPigmentHue.Yellow] = new PlantPigmentHueInfo(PlantHue.Yellow, 2125, 1060818, PlantPigmentHue.Yellow);
m_Table[PlantPigmentHue.BrightRed] = new PlantPigmentHueInfo(PlantHue.BrightRed, 1646, 1060814, PlantPigmentHue.BrightRed);
m_Table[PlantPigmentHue.BrightBlue] = new PlantPigmentHueInfo(PlantHue.BrightBlue, 1310, 1060815, PlantPigmentHue.BrightBlue);
m_Table[PlantPigmentHue.BrightYellow] = new PlantPigmentHueInfo(PlantHue.BrightYellow, 253, 1060818, PlantPigmentHue.BrightYellow);
m_Table[PlantPigmentHue.DarkRed] = new PlantPigmentHueInfo(PlantHue.Plain, 1141, 1112162, PlantPigmentHue.DarkRed);
m_Table[PlantPigmentHue.DarkBlue] = new PlantPigmentHueInfo(PlantHue.Plain, 1317, 1112164, PlantPigmentHue.DarkBlue);
m_Table[PlantPigmentHue.DarkYellow] = new PlantPigmentHueInfo(PlantHue.Plain, 2217, 1112165, PlantPigmentHue.DarkYellow);
m_Table[PlantPigmentHue.IceRed] = new PlantPigmentHueInfo(PlantHue.Plain, 335, 1112169, PlantPigmentHue.IceRed);
m_Table[PlantPigmentHue.IceBlue] = new PlantPigmentHueInfo(PlantHue.Plain, 1154, 1112168, PlantPigmentHue.IceBlue);
m_Table[PlantPigmentHue.IceYellow] = new PlantPigmentHueInfo(PlantHue.Plain, 56, 1112171, PlantPigmentHue.IceYellow);
m_Table[PlantPigmentHue.Purple] = new PlantPigmentHueInfo(PlantHue.Purple, 15, 1060816, PlantPigmentHue.Purple);
m_Table[PlantPigmentHue.Green] = new PlantPigmentHueInfo(PlantHue.Green, 2128, 1060819, PlantPigmentHue.Green);
m_Table[PlantPigmentHue.Orange] = new PlantPigmentHueInfo(PlantHue.Orange, 1128, 1060817, PlantPigmentHue.Orange);
m_Table[PlantPigmentHue.BrightPurple] = new PlantPigmentHueInfo(PlantHue.BrightPurple, 316, 1060816, PlantPigmentHue.BrightPurple);
m_Table[PlantPigmentHue.BrightGreen] = new PlantPigmentHueInfo(PlantHue.BrightGreen, 671, 1060819, PlantPigmentHue.BrightGreen);
m_Table[PlantPigmentHue.BrightOrange] = new PlantPigmentHueInfo(PlantHue.BrightOrange, 1501, 1060817, PlantPigmentHue.BrightOrange);
m_Table[PlantPigmentHue.DarkPurple] = new PlantPigmentHueInfo(PlantHue.Plain, 1254, 1113166, PlantPigmentHue.DarkPurple);
m_Table[PlantPigmentHue.DarkGreen] = new PlantPigmentHueInfo(PlantHue.Plain, 1425, 1112163, PlantPigmentHue.DarkGreen);
m_Table[PlantPigmentHue.DarkOrange] = new PlantPigmentHueInfo(PlantHue.Plain, 1509, 1112161, PlantPigmentHue.DarkOrange);
m_Table[PlantPigmentHue.IcePurple] = new PlantPigmentHueInfo(PlantHue.Plain, 511, 1112172, PlantPigmentHue.IcePurple);
m_Table[PlantPigmentHue.IceGreen] = new PlantPigmentHueInfo(PlantHue.Plain, 261, 1112167, PlantPigmentHue.IceGreen);
m_Table[PlantPigmentHue.IceOrange] = new PlantPigmentHueInfo(PlantHue.Plain, 346, 1112170, PlantPigmentHue.IceOrange);
m_Table[PlantPigmentHue.Black] = new PlantPigmentHueInfo(PlantHue.Black, 1175, 1060820, PlantPigmentHue.Black);
m_Table[PlantPigmentHue.White] = new PlantPigmentHueInfo(PlantHue.White, 1150, 1060821, PlantPigmentHue.White);
m_Table[PlantPigmentHue.IceBlack] = new PlantPigmentHueInfo(PlantHue.Plain, 2422, 1112988, PlantPigmentHue.IceBlack);
m_Table[PlantPigmentHue.OffWhite] = new PlantPigmentHueInfo(PlantHue.Plain, 746, 1112224, PlantPigmentHue.OffWhite);
m_Table[PlantPigmentHue.Metal] = new PlantPigmentHueInfo(PlantHue.Plain, 1105, 1015046, PlantPigmentHue.Metal);
m_Table[PlantPigmentHue.Pink] = new PlantPigmentHueInfo(PlantHue.Pink, 341, 1061854, PlantPigmentHue.Pink);
m_Table[PlantPigmentHue.Magenta] = new PlantPigmentHueInfo(PlantHue.Magenta, 1163, 1061852, PlantPigmentHue.Magenta);
m_Table[PlantPigmentHue.Aqua] = new PlantPigmentHueInfo(PlantHue.Aqua, 391, 1061853, PlantPigmentHue.Aqua);
m_Table[PlantPigmentHue.FireRed] = new PlantPigmentHueInfo(PlantHue.FireRed, 1358, 1061855, PlantPigmentHue.FireRed);
}
private PlantPigmentHueInfo(PlantHue planthue, int hue, int name, PlantPigmentHue pigmentHue)
{
this.m_PlantHue = planthue;
this.m_Hue = hue;
this.m_Name = name;
this.m_PlantPigmentHue = pigmentHue;
}
public PlantHue PlantHue
{
get
{
return this.m_PlantHue;
}
}
public int Hue
{
get
{
return this.m_Hue;
}
}
public int Name
{
get
{
return this.m_Name;
}
}
public PlantPigmentHue PlantPigmentHue
{
get
{
return this.m_PlantPigmentHue;
}
}
public static PlantPigmentHue HueFromPlantHue(PlantHue hue)
{
if (hue == PlantHue.None || hue == PlantHue.Plain)
return PlantPigmentHue.Plain;
foreach (KeyValuePair<PlantPigmentHue, PlantPigmentHueInfo> kvp in m_Table)
{
if (kvp.Value.PlantHue == hue)
return kvp.Key;
}
return PlantPigmentHue.Plain;
}
public static PlantPigmentHueInfo GetInfo(PlantPigmentHue hue)
{
if (!m_Table.ContainsKey(hue))
return m_Table[PlantPigmentHue.Plain];
return m_Table[hue];
}
public static bool IsMixable(PlantPigmentHue hue)
{
return (hue <= PlantPigmentHue.White && hue != PlantPigmentHue.None);
}
public static bool IsBright(PlantPigmentHue hue)
{
return (hue & PlantPigmentHue.Bright) != PlantPigmentHue.None;
}
public static bool IsPrimary(PlantPigmentHue hue)
{
return hue == PlantPigmentHue.Red || hue == PlantPigmentHue.Blue || hue == PlantPigmentHue.Yellow;
}
public static PlantPigmentHue Mix(PlantPigmentHue first, PlantPigmentHue second)
{
if (!IsMixable(first) || !IsMixable(second))
return PlantPigmentHue.None;
if (first == second && (PlantPigmentHue.Plain == first || PlantPigmentHue.Black == first || PlantPigmentHue.White == first))
return PlantPigmentHue.None;
if (first == second)
return second | PlantPigmentHue.Bright;
if (first == PlantPigmentHue.Plain)
return second | PlantPigmentHue.Bright;
else if (second == PlantPigmentHue.Plain)
return first | PlantPigmentHue.Bright;
if (first == PlantPigmentHue.White)
return second | PlantPigmentHue.Ice;
else if (second == PlantPigmentHue.White)
return first | PlantPigmentHue.Ice;
if (first == PlantPigmentHue.Black)
return second | PlantPigmentHue.Dark;
else if (second == PlantPigmentHue.Black)
return first | PlantPigmentHue.Dark;
bool firstPrimary = IsPrimary(first);
bool secondPrimary = IsPrimary(second);
if (firstPrimary && secondPrimary)
return first | second;
//
// not sure after this point
//
// the remaining combinations to precess are (orange,purple,green with
// any of red, blue, yellow, orange, purple, green)
// the code below is temporary until proper mixed hues can be confirmed
//
// mixing table on stratics seems incorrect because the table is not symmetrical
//
if (firstPrimary && !secondPrimary)
return first;
if (!firstPrimary && secondPrimary)
return second;
return first & second;
}
public bool IsMixable()
{
return IsMixable(this.m_PlantPigmentHue);
}
public bool IsBright()
{
return IsBright(this.m_PlantPigmentHue);
}
public bool IsPrimary()
{
return IsPrimary(this.m_PlantPigmentHue);
}
}
}

View File

@@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Mobiles;
namespace Server.Items
{
public class SilverSapling : Item
{
public override int LabelNumber { get { return 1113052; } } // The Silver Sapling
[Constructable]
public SilverSapling()
: base(0x0CE3)
{
Hue = 1150;
Movable = false;
}
public SilverSapling(Serial serial)
: base(serial)
{
}
public override bool HandlesOnMovement { get { return true; } }
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (Parent == null && Utility.InRange(Location, m.Location, 1) && !Utility.InRange(Location, oldLocation, 1))
Ankhs.Resurrect(m, this);
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
Ankhs.GetContextMenuEntries(from, this, list);
}
public override void OnDoubleClickDead(Mobile m)
{
Ankhs.Resurrect(m, this);
}
public override void OnDoubleClick(Mobile m)
{
PlayerMobile pm = m as PlayerMobile;
if (pm != null && pm.Backpack != null)
{
if (pm.SSNextSeed > DateTime.UtcNow)
{
pm.SendLocalizedMessage(1113042); // You must wait a full day before receiving another Seed of the Silver Sapling
}
else
{
pm.SendLocalizedMessage(1113043); // The Silver Sapling pulses with light, and a shining seed appears in your hands.
pm.SSNextSeed = DateTime.UtcNow + TimeSpan.FromDays(1.0);
pm.PlaceInBackpack(new SilverSaplingSeed());
}
}
}
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 class SilverSaplingSeed : Item
{
public override int LabelNumber { get { return 1113053; } } // a seed of the Silver Sapling
[Constructable]
public SilverSaplingSeed()
: base(0x0DCF)
{
Hue = 1150;
Stackable = true;
}
public SilverSaplingSeed(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile m)
{
PlayerMobile pm = m as PlayerMobile;
if (pm == null)
return;
if (pm.Region.IsPartOf("Abyss"))
{
pm.SendLocalizedMessage(1113056, "", 0x3C); // The seed disappears into the earth and for a brief moment you see a vision of a small sapling growing before you. Should you perish in your adventures in the Abyss, you shall be restored to this place with your possessions.
Consume();
pm.SSSeedLocation = pm.Location;
pm.SSSeedMap = pm.Map;
pm.SSSeedExpire = DateTime.UtcNow + TimeSpan.FromDays(1.0);
}
else
{
pm.SendLocalizedMessage(1113055, "", 0x23); // The seed of the Silver Sapling can only be planted within the Stygian Abyss...
}
}
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();
}
}
}