Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
42
Scripts/Items/Artifacts/Consumables/AdmiralsHeartyRum.cs
Normal file
42
Scripts/Items/Artifacts/Consumables/AdmiralsHeartyRum.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[TypeAlias("Server.Items.AdmiralHeartyRum")]
|
||||
public class AdmiralsHeartyRum : BeverageBottle
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public AdmiralsHeartyRum()
|
||||
: base(BeverageType.Ale)
|
||||
{
|
||||
Hue = 0x66C;
|
||||
}
|
||||
|
||||
public AdmiralsHeartyRum(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1063477;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
218
Scripts/Items/Artifacts/Consumables/BasePigmentsOfTokuno.cs
Normal file
218
Scripts/Items/Artifacts/Consumables/BasePigmentsOfTokuno.cs
Normal file
@@ -0,0 +1,218 @@
|
||||
using System;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BasePigmentsOfTokuno : Item, IUsesRemaining
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1070933;
|
||||
}
|
||||
}// Pigments of Tokuno
|
||||
|
||||
private int m_UsesRemaining;
|
||||
private TextDefinition m_Label;
|
||||
|
||||
protected TextDefinition Label
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Label;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Label = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
#region Old Item Serialization Vars
|
||||
/* DO NOT USE! Only used in serialization of pigments that originally derived from Item */
|
||||
private bool m_InheritsItem;
|
||||
|
||||
protected bool InheritsItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_InheritsItem;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public BasePigmentsOfTokuno()
|
||||
: base(0xEFF)
|
||||
{
|
||||
Weight = 1.0;
|
||||
m_UsesRemaining = 1;
|
||||
}
|
||||
|
||||
public BasePigmentsOfTokuno(int uses)
|
||||
: base(0xEFF)
|
||||
{
|
||||
Weight = 1.0;
|
||||
m_UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public BasePigmentsOfTokuno(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Label != null && m_Label > 0)
|
||||
TextDefinition.AddTo(list, m_Label);
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsAccessibleTo(from) && from.InRange(GetWorldLocation(), 3))
|
||||
{
|
||||
from.SendLocalizedMessage(1070929); // Select the artifact or enhanced magic item to dye.
|
||||
from.BeginTarget(3, false, Server.Targeting.TargetFlags.None, new TargetStateCallback(InternalCallback), this);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(502436); // That is not accessible.
|
||||
}
|
||||
|
||||
private void InternalCallback(Mobile from, object targeted, object state)
|
||||
{
|
||||
BasePigmentsOfTokuno pigment = (BasePigmentsOfTokuno)state;
|
||||
|
||||
if (pigment.Deleted || pigment.UsesRemaining <= 0 || !from.InRange(pigment.GetWorldLocation(), 3) || !pigment.IsAccessibleTo(from))
|
||||
return;
|
||||
|
||||
Item i = targeted as Item;
|
||||
|
||||
if (i == null)
|
||||
from.SendLocalizedMessage(1070931); // You can only dye artifacts and enhanced magic items with this tub.
|
||||
else if (!from.InRange(i.GetWorldLocation(), 3) || !IsAccessibleTo(from))
|
||||
from.SendLocalizedMessage(502436); // That is not accessible.
|
||||
else if (from.Items.Contains(i))
|
||||
from.SendLocalizedMessage(1070930); // Can't dye artifacts or enhanced magic items that are being worn.
|
||||
else if (i.IsLockedDown)
|
||||
from.SendLocalizedMessage(1070932); // You may not dye artifacts and enhanced magic items which are locked down.
|
||||
else if (i is MetalPigmentsOfTokuno || i is LesserPigmentsOfTokuno || i is PigmentsOfTokuno || i is CompassionPigment)
|
||||
from.SendLocalizedMessage(1042417); // You cannot dye that.
|
||||
else if (!IsValidItem(i))
|
||||
from.SendLocalizedMessage(1070931); // You can only dye artifacts and enhanced magic items with this tub. //Yes, it says tub on OSI. Don't ask me why ;p
|
||||
else
|
||||
{
|
||||
//Notes: on OSI there IS no hue check to see if it's already hued. and no messages on successful hue either
|
||||
i.Hue = Hue;
|
||||
|
||||
if (--pigment.UsesRemaining <= 0)
|
||||
pigment.Delete();
|
||||
|
||||
from.PlaySound(0x23E); // As per OSI TC1
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValidItem(Item i)
|
||||
{
|
||||
if (i is BasePigmentsOfTokuno)
|
||||
return false;
|
||||
|
||||
Type t = i.GetType();
|
||||
|
||||
CraftResource resource = CraftResource.None;
|
||||
|
||||
if (i is BaseWeapon)
|
||||
resource = ((BaseWeapon)i).Resource;
|
||||
else if (i is BaseArmor)
|
||||
resource = ((BaseArmor)i).Resource;
|
||||
else if (i is BaseClothing)
|
||||
resource = ((BaseClothing)i).Resource;
|
||||
|
||||
if (!CraftResources.IsStandard(resource))
|
||||
return true;
|
||||
|
||||
if (i.IsArtifact)
|
||||
return true;
|
||||
|
||||
if (i is BaseAddonDeed && ((BaseAddonDeed)i).UseCraftResource && !((BaseAddonDeed)i).IsReDeed && ((BaseAddonDeed)i).Resource != CraftResource.None)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.WriteEncodedInt(m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
case 0: // Old pigments that inherited from item
|
||||
{
|
||||
m_InheritsItem = true;
|
||||
|
||||
if (this is LesserPigmentsOfTokuno)
|
||||
((LesserPigmentsOfTokuno)this).Type = (LesserPigmentType)reader.ReadEncodedInt();
|
||||
else if (this is PigmentsOfTokuno)
|
||||
((PigmentsOfTokuno)this).Type = (PigmentType)reader.ReadEncodedInt();
|
||||
else if (this is MetalPigmentsOfTokuno)
|
||||
reader.ReadEncodedInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadEncodedInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region IUsesRemaining Members
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UsesRemaining;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Artifacts/Consumables/Bleach.cs
Normal file
40
Scripts/Items/Artifacts/Consumables/Bleach.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bleach : PigmentsOfTokuno
|
||||
{
|
||||
[Constructable]
|
||||
public Bleach()
|
||||
: base(PigmentType.None)
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public Bleach(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1075375;
|
||||
}
|
||||
}// Bleach
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirofAgapiteConversion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1113008; } } // Elixir of Agapite Conversion
|
||||
|
||||
[Constructable]
|
||||
public ElixirofAgapiteConversion()
|
||||
: base(0x99B)
|
||||
{
|
||||
Hue = 2425;
|
||||
Movable = true;
|
||||
}
|
||||
|
||||
public ElixirofAgapiteConversion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
||||
Container backpack = from.Backpack;
|
||||
ShadowIronIngot item1 = (ShadowIronIngot)backpack.FindItemByType(typeof(ShadowIronIngot));
|
||||
|
||||
if (item1 != null)
|
||||
{
|
||||
BaseIngot m_Ore1 = item1 as BaseIngot;
|
||||
|
||||
int toConsume = m_Ore1.Amount;
|
||||
|
||||
if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
|
||||
{
|
||||
m_Ore1.Delete();
|
||||
from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
|
||||
from.AddToBackpack(new AgapiteIngot(500));
|
||||
this.Delete();
|
||||
}
|
||||
else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
|
||||
{
|
||||
from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirofGoldConversion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1113007; } } // Elixir of Gold Conversion
|
||||
|
||||
[Constructable]
|
||||
public ElixirofGoldConversion()
|
||||
: base(0x99B)
|
||||
{
|
||||
Hue = 2213;
|
||||
Movable = true;
|
||||
}
|
||||
|
||||
public ElixirofGoldConversion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
||||
Container backpack = from.Backpack;
|
||||
DullCopperIngot item1 = (DullCopperIngot)backpack.FindItemByType(typeof(DullCopperIngot));
|
||||
|
||||
if (item1 != null)
|
||||
{
|
||||
BaseIngot m_Ore1 = item1 as BaseIngot;
|
||||
|
||||
int toConsume = m_Ore1.Amount;
|
||||
|
||||
if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
|
||||
{
|
||||
m_Ore1.Delete();
|
||||
from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
|
||||
from.AddToBackpack(new GoldIngot(500));
|
||||
this.Delete();
|
||||
}
|
||||
else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
|
||||
{
|
||||
from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirofMetalConversion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1113011; } } // Elixir of Metal Conversion
|
||||
|
||||
[Constructable]
|
||||
public ElixirofMetalConversion()
|
||||
: base(0x99B)
|
||||
{
|
||||
Hue = 1159;
|
||||
Movable = true;
|
||||
}
|
||||
|
||||
public ElixirofMetalConversion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
||||
Container backpack = from.Backpack;
|
||||
IronIngot item1 = (IronIngot)backpack.FindItemByType(typeof(IronIngot));
|
||||
|
||||
if (item1 != null)
|
||||
{
|
||||
BaseIngot m_Ore1 = item1 as BaseIngot;
|
||||
|
||||
int toConsume = m_Ore1.Amount;
|
||||
|
||||
if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
|
||||
{
|
||||
m_Ore1.Delete();
|
||||
|
||||
switch ( Utility.Random(4) )
|
||||
{
|
||||
case 0:
|
||||
from.AddToBackpack(new DullCopperIngot(500));
|
||||
break;
|
||||
case 2:
|
||||
from.AddToBackpack(new ShadowIronIngot(500));
|
||||
break;
|
||||
case 1:
|
||||
from.AddToBackpack(new CopperIngot(500));
|
||||
break;
|
||||
case 3:
|
||||
from.AddToBackpack(new BronzeIngot(500));
|
||||
break;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
|
||||
this.Delete();
|
||||
}
|
||||
else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
|
||||
{
|
||||
from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirofValoriteConversion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1113010; } } // Elixir of Valorite Conversion
|
||||
|
||||
[Constructable]
|
||||
public ElixirofValoriteConversion()
|
||||
: base(0x99B)
|
||||
{
|
||||
Hue = 2219;
|
||||
Movable = true;
|
||||
}
|
||||
|
||||
public ElixirofValoriteConversion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
||||
Container backpack = from.Backpack;
|
||||
BronzeIngot item1 = (BronzeIngot)backpack.FindItemByType(typeof(BronzeIngot));
|
||||
|
||||
if (item1 != null)
|
||||
{
|
||||
BaseIngot m_Ore1 = item1 as BaseIngot;
|
||||
|
||||
int toConsume = m_Ore1.Amount;
|
||||
|
||||
if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
|
||||
{
|
||||
m_Ore1.Delete();
|
||||
from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
|
||||
from.AddToBackpack(new ValoriteIngot(500));
|
||||
this.Delete();
|
||||
}
|
||||
else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
|
||||
{
|
||||
from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirofVeriteConversion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1113009; } } // Elixir of Verite Conversion
|
||||
|
||||
[Constructable]
|
||||
public ElixirofVeriteConversion()
|
||||
: base(0x99B)
|
||||
{
|
||||
Hue = 2207;
|
||||
Movable = true;
|
||||
}
|
||||
|
||||
public ElixirofVeriteConversion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
||||
Container backpack = from.Backpack;
|
||||
CopperIngot item1 = (CopperIngot)backpack.FindItemByType(typeof(CopperIngot));
|
||||
|
||||
if (item1 != null)
|
||||
{
|
||||
BaseIngot m_Ore1 = item1 as BaseIngot;
|
||||
|
||||
int toConsume = m_Ore1.Amount;
|
||||
|
||||
if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
|
||||
{
|
||||
m_Ore1.Delete();
|
||||
from.SendLocalizedMessage(1113048); // You've successfully converted the metal.
|
||||
from.AddToBackpack(new VeriteIngot(500));
|
||||
this.Delete();
|
||||
}
|
||||
else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
|
||||
{
|
||||
from.SendLocalizedMessage(1113046); // You can only convert five hundred ingots at a time.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1078618); // The item must be in your backpack to be exchanged.
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Scripts/Items/Artifacts/Consumables/GobletOfCelebration.cs
Normal file
121
Scripts/Items/Artifacts/Consumables/GobletOfCelebration.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GobletOfCelebration : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1075430; } } // Goblet of Celebration
|
||||
|
||||
private bool m_Full;
|
||||
private DateTime m_NextFill;
|
||||
private Timer m_FillTimer;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Full
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Full;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_Full != value)
|
||||
{
|
||||
m_Full = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_FillTimer != null)
|
||||
m_FillTimer.Stop();
|
||||
|
||||
if (!m_Full)
|
||||
{
|
||||
m_NextFill = DateTime.Now + TimeSpan.FromDays(1.0);
|
||||
|
||||
m_FillTimer = Timer.DelayCall(TimeSpan.FromDays(1.0), new TimerCallback(delegate { Full = true; }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GobletOfCelebration()
|
||||
: base(0x99A)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
Hue = 19;
|
||||
|
||||
m_Full = true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1075438); // You can only drink from the goblet of celebration when its in your inventory.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Full)
|
||||
{
|
||||
from.SendLocalizedMessage(1075272); // You drink from the goblet of celebration
|
||||
|
||||
Full = false;
|
||||
|
||||
from.BAC = 60;
|
||||
BaseBeverage.CheckHeaveTimer(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1075439); // You need to wait a day for the goblet of celebration to be replenished.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Full)
|
||||
list.Add(1042972); // It's full.
|
||||
else
|
||||
list.Add(1042975); // It's empty.
|
||||
}
|
||||
|
||||
public GobletOfCelebration(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(m_Full);
|
||||
|
||||
if (!m_Full)
|
||||
{
|
||||
writer.Write(m_NextFill);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Full = reader.ReadBool();
|
||||
|
||||
if (!m_Full)
|
||||
{
|
||||
m_NextFill = reader.ReadDateTime();
|
||||
|
||||
m_FillTimer = Timer.DelayCall(m_NextFill - DateTime.Now, new TimerCallback(delegate { Full = true; }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Artifacts/Consumables/GrapeBunch.cs
Normal file
36
Scripts/Items/Artifacts/Consumables/GrapeBunch.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GrapeBunch : Food
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int LabelNumber { get { return 1022513; } }
|
||||
|
||||
[Constructable]
|
||||
public GrapeBunch() : base(1, 3354)
|
||||
{
|
||||
Weight = 1.0;
|
||||
FillFactor = 1;
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public GrapeBunch(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
101
Scripts/Items/Artifacts/Consumables/HangoverCure.cs
Normal file
101
Scripts/Items/Artifacts/Consumables/HangoverCure.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Engines.Quests.Hag
|
||||
{
|
||||
public class HangoverCure : Item
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
private int m_Uses;
|
||||
[Constructable]
|
||||
public HangoverCure()
|
||||
: base(0xE2B)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x2D;
|
||||
|
||||
m_Uses = 20;
|
||||
}
|
||||
|
||||
public HangoverCure(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1055060;
|
||||
}
|
||||
}// Grizelda's Extra Strength Hangover Cure
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Uses
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Uses;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Uses = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!this.IsChildOf(from.Backpack))
|
||||
{
|
||||
this.SendLocalizedMessageTo(from, 1042038); // You must have the object in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.m_Uses > 0)
|
||||
{
|
||||
from.PlaySound(0x2D6);
|
||||
from.SendLocalizedMessage(501206); // An awful taste fills your mouth.
|
||||
|
||||
if (from.BAC > 0)
|
||||
{
|
||||
from.BAC = 0;
|
||||
from.SendLocalizedMessage(501204); // You are now sober!
|
||||
}
|
||||
|
||||
this.m_Uses--;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Delete();
|
||||
from.SendLocalizedMessage(501201); // There wasn't enough left to have any effect.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.WriteEncodedInt(this.m_Uses);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_Uses = reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
this.m_Uses = 20;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Scripts/Items/Artifacts/Consumables/InfusedAlchemistsGem.cs
Normal file
55
Scripts/Items/Artifacts/Consumables/InfusedAlchemistsGem.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class InfusedAlchemistsGem : Item
|
||||
{
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
[Constructable]
|
||||
public InfusedAlchemistsGem()
|
||||
: base(0x1EA7)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public InfusedAlchemistsGem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1113006;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1070722, "Alchemy Skill Increaser + 1");
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.Skills[SkillName.Alchemy].Base += 1;
|
||||
from.SendMessage("You have increased your Alchemy Skill by 1 Point !.");
|
||||
this.Delete();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
139
Scripts/Items/Artifacts/Consumables/VialofArmorEssence.cs
Normal file
139
Scripts/Items/Artifacts/Consumables/VialofArmorEssence.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class VialofArmorEssence : Item
|
||||
{
|
||||
public static Dictionary<BaseCreature, DateTime> m_Table = new Dictionary<BaseCreature, DateTime>();
|
||||
|
||||
public virtual int Bonus { get { return 10; } }
|
||||
public virtual TimeSpan Duration { get { return TimeSpan.FromMinutes(10); } }
|
||||
public virtual TimeSpan CoolDown { get { return TimeSpan.FromMinutes(120); } }
|
||||
|
||||
[Constructable]
|
||||
public VialofArmorEssence()
|
||||
: base(0x5722)
|
||||
{
|
||||
}
|
||||
|
||||
public VialofArmorEssence(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1113018;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DropToMobile(Mobile from, Mobile target, Point3D p)
|
||||
{
|
||||
TryFeed(from, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
m.BeginTarget(2, false, TargetFlags.Beneficial, (from, targeted) =>
|
||||
{
|
||||
if (targeted is Mobile)
|
||||
{
|
||||
TryFeed(from, (Mobile)targeted);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void TryFeed(Mobile from, Mobile target)
|
||||
{
|
||||
if (target is BaseCreature && !((BaseCreature)target).IsDeadBondedPet)
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)target;
|
||||
|
||||
if (UnderInfluence(bc))
|
||||
{
|
||||
if (m_Table[bc] + (CoolDown + Duration) < DateTime.Now)
|
||||
{
|
||||
from.SendLocalizedMessage(1113076); //Your pet is still recovering from the last armor essence it consumed.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1113075); //Your pet is still under the effect of armor essence.
|
||||
}
|
||||
}
|
||||
else if (bc.ControlMaster == from)
|
||||
{
|
||||
from.SendLocalizedMessage(1113050); //Your pet looks much happier.
|
||||
DoEffects(bc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool DoEffects(BaseCreature bc)
|
||||
{
|
||||
bc.PlaySound(0x1EA);
|
||||
bc.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
|
||||
|
||||
m_Table.Add(bc, DateTime.Now);
|
||||
Timer.DelayCall(Duration + CoolDown, new TimerStateCallback(RemoveInfluence), bc);
|
||||
|
||||
bc.TempDamageAbsorb = Bonus;
|
||||
bc.Loyalty = BaseCreature.MaxLoyalty;
|
||||
|
||||
Consume();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1113213); //* For Pets Only *
|
||||
list.Add(1113219); //Stats Increased by 10%
|
||||
|
||||
list.Add(1113212, Duration.TotalMinutes.ToString()); //Duration: ~1_val~ minutes
|
||||
list.Add(1113218, CoolDown.TotalMinutes.ToString()); //Cooldown: ~1_val~ minutes
|
||||
}
|
||||
|
||||
public static bool UnderInfluence(BaseCreature bc)
|
||||
{
|
||||
return m_Table.ContainsKey(bc);
|
||||
}
|
||||
|
||||
public static void RemoveInfluence(object obj)
|
||||
{
|
||||
BaseCreature bc = (BaseCreature)obj;
|
||||
|
||||
if (m_Table.ContainsKey(bc))
|
||||
m_Table.Remove(bc);
|
||||
|
||||
bc.TempDamageAbsorb = 0;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user