Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
118
Scripts/Items/Consumables/2018HolidayGiftToken.cs
Normal file
118
Scripts/Items/Consumables/2018HolidayGiftToken.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum HolidayGift2018
|
||||
{
|
||||
None = 0,
|
||||
Wreath = 1,
|
||||
Sign = 2,
|
||||
RecipeBook = 3
|
||||
}
|
||||
|
||||
public class HolidayGiftToken2018 : Item, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1158831; } } // 2018 Holiday Gift Token
|
||||
|
||||
public HolidayGift2018 Gift { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public HolidayGiftToken2018()
|
||||
: this(HolidayGift2018.None)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public HolidayGiftToken2018(HolidayGift2018 gift)
|
||||
: base(0xA094)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Weight = 1.0;
|
||||
Gift = gift;
|
||||
Hue = 1371;
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)HolidayGift2018.Wreath, 1158812);
|
||||
list.Add((int)HolidayGift2018.Sign, 1158811);
|
||||
list.Add((int)HolidayGift2018.RecipeBook, 1158810);
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
Gift = (HolidayGift2018)choice;
|
||||
|
||||
if (!Deleted)
|
||||
GiveGift(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this, 1156381));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public void GiveGift(Mobile from)
|
||||
{
|
||||
GiftBox box = new GiftBox();
|
||||
|
||||
Item gift = new GingerBreadCookie();
|
||||
gift.LootType = LootType.Regular;
|
||||
box.DropItem(gift);
|
||||
|
||||
if (Utility.Random(100) < 60)
|
||||
box.DropItem(new Poinsettia(33));
|
||||
else
|
||||
box.DropItem(new Poinsettia(1154));
|
||||
|
||||
switch(Gift)
|
||||
{
|
||||
case HolidayGift2018.RecipeBook:
|
||||
{
|
||||
box.DropItem(new RecipeBook());
|
||||
break;
|
||||
}
|
||||
case HolidayGift2018.Sign:
|
||||
{
|
||||
box.DropItem(new HolidaysSign());
|
||||
break;
|
||||
}
|
||||
case HolidayGift2018.Wreath:
|
||||
{
|
||||
box.DropItem(new HolidayWreath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
from.AddToBackpack(box);
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public HolidayGiftToken2018(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
165
Scripts/Items/Consumables/2019HolidayGiftToken.cs
Normal file
165
Scripts/Items/Consumables/2019HolidayGiftToken.cs
Normal file
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HolidayGiftGiver2019 : GiftGiver
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
GiftGiving.Register(new HolidayGiftGiver2019());
|
||||
}
|
||||
|
||||
public override DateTime Start { get { return new DateTime(2019, 12, 03); } }
|
||||
public override DateTime Finish { get { return new DateTime(2020, 01, 03); } }
|
||||
public override TimeSpan MinimumAge { get { return TimeSpan.FromDays(30); } }
|
||||
|
||||
public override void GiveGift(Mobile mob)
|
||||
{
|
||||
Item token = new HolidayGiftToken2019();
|
||||
|
||||
switch (GiveGift(mob, token))
|
||||
{
|
||||
case GiftResult.Backpack:
|
||||
mob.SendLocalizedMessage(1062835); // Happy Holidays from the Origin team! Gift items have been placed in your backpack.
|
||||
break;
|
||||
case GiftResult.BankBox:
|
||||
mob.SendLocalizedMessage(1062836); // Happy Holidays from the Origin team! Gift items have been placed in your bank box.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum HolidayGift2019
|
||||
{
|
||||
None = 0,
|
||||
HolidayWallArt = 1,
|
||||
DoveCage = 2,
|
||||
JollyHolidayTree = 3
|
||||
}
|
||||
|
||||
public class HolidayGiftToken2019 : Item, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1159257; } } // 2019 Holiday Gift Token
|
||||
|
||||
public HolidayGift2019 Gift { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public HolidayGiftToken2019()
|
||||
: this(HolidayGift2019.None)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public HolidayGiftToken2019(HolidayGift2019 gift)
|
||||
: base(0xA094)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Weight = 1.0;
|
||||
Gift = gift;
|
||||
Hue = 133;
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)HolidayGift2019.HolidayWallArt, 1159254);
|
||||
list.Add((int)HolidayGift2019.DoveCage, 1159255);
|
||||
list.Add((int)HolidayGift2019.JollyHolidayTree, 1159256);
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
Gift = (HolidayGift2019)choice;
|
||||
|
||||
if (!Deleted)
|
||||
GiveGift(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this, 1156381));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public void GiveGift(Mobile from)
|
||||
{
|
||||
GiftBox box = new GiftBox();
|
||||
|
||||
Item gift = new GingerBreadCookie();
|
||||
gift.LootType = LootType.Regular;
|
||||
box.DropItem(gift);
|
||||
|
||||
if (Utility.Random(100) < 60)
|
||||
box.DropItem(new Poinsettia(33));
|
||||
else
|
||||
box.DropItem(new Poinsettia(1154));
|
||||
|
||||
switch(Gift)
|
||||
{
|
||||
case HolidayGift2019.JollyHolidayTree:
|
||||
{
|
||||
box.DropItem(new JollyHolidayTreeDeed());
|
||||
break;
|
||||
}
|
||||
case HolidayGift2019.DoveCage:
|
||||
{
|
||||
box.DropItem(new DoveCage());
|
||||
break;
|
||||
}
|
||||
case HolidayGift2019.HolidayWallArt:
|
||||
{
|
||||
switch (Utility.Random(2))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
box.DropItem(new HolidayWallArt1());
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
box.DropItem(new HolidayWallArt2());
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
box.DropItem(new HolidayWallArt3());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1062306); // Your gift has been created and placed in your backpack.
|
||||
from.AddToBackpack(box);
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public HolidayGiftToken2019(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Consumables/AgilityPotion.cs
Normal file
46
Scripts/Items/Consumables/AgilityPotion.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AgilityPotion : BaseAgilityPotion
|
||||
{
|
||||
[Constructable]
|
||||
public AgilityPotion()
|
||||
: base(PotionEffect.Agility)
|
||||
{
|
||||
}
|
||||
|
||||
public AgilityPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int DexOffset
|
||||
{
|
||||
get
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
public override TimeSpan Duration
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromMinutes(2.0);
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/AgilityScroll.cs
Normal file
38
Scripts/Items/Consumables/AgilityScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AgilityScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AgilityScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AgilityScroll(int amount)
|
||||
: base(8, 0x1F35, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public AgilityScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
137
Scripts/Items/Consumables/AlterContract.cs
Normal file
137
Scripts/Items/Consumables/AlterContract.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlterContract : Item
|
||||
{
|
||||
private RepairSkillType m_Type;
|
||||
private string m_CrafterName;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public RepairSkillType Type
|
||||
{
|
||||
get { return m_Type; }
|
||||
|
||||
set
|
||||
{
|
||||
m_Type = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string CrafterName
|
||||
{
|
||||
get { return m_CrafterName; }
|
||||
|
||||
set
|
||||
{
|
||||
m_CrafterName = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AlterContract(RepairSkillType type, Mobile crafter)
|
||||
: base(0x14F0)
|
||||
{
|
||||
m_CrafterName = crafter.Name;
|
||||
Type = type;
|
||||
|
||||
Hue = 0x1BC;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public AlterContract(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public string GetTitle()
|
||||
{
|
||||
if (m_Type == RepairSkillType.Smithing)
|
||||
return "Blacksmithing";
|
||||
else if (m_Type == RepairSkillType.Carpentry)
|
||||
return "Carpentry";
|
||||
else if (m_Type == RepairSkillType.Tailoring)
|
||||
return "Tailoring";
|
||||
else if (m_Type == RepairSkillType.Tinkering)
|
||||
return "Tinkering";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public CraftSystem GetCraftSystem()
|
||||
{
|
||||
if (m_Type == RepairSkillType.Smithing)
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
else if (m_Type == RepairSkillType.Carpentry)
|
||||
return DefCarpentry.CraftSystem;
|
||||
else if (m_Type == RepairSkillType.Tailoring)
|
||||
return DefTailoring.CraftSystem;
|
||||
else if (m_Type == RepairSkillType.Tinkering)
|
||||
return DefTinkering.CraftSystem;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
this.LabelTo(from, 1094795, GetTitle()); // An alter service contract (~1_SKILL_NAME~)
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1050043, m_CrafterName); // crafted by ~1_NAME~
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1094795, GetTitle());
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
// The contract must be in your backpack to use it.
|
||||
from.SendLocalizedMessage(1047012);
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftSystem cs = GetCraftSystem();
|
||||
|
||||
AlterItem.BeginTarget(from, cs, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)m_Type);
|
||||
writer.Write((string)m_CrafterName);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Type = (RepairSkillType)reader.ReadInt();
|
||||
m_CrafterName = (string)reader.ReadString();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/AnimateDeadScroll.cs
Normal file
38
Scripts/Items/Consumables/AnimateDeadScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnimateDeadScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AnimateDeadScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnimateDeadScroll(int amount)
|
||||
: base(100, 0x2260, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public AnimateDeadScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/AnimatedWeaponScroll.cs
Normal file
38
Scripts/Items/Consumables/AnimatedWeaponScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AnimatedWeaponScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public AnimatedWeaponScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AnimatedWeaponScroll(int amount)
|
||||
: base(683, 0x2DA4, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public AnimatedWeaponScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
174
Scripts/Items/Consumables/AnniversaryPromotionalToken.cs
Normal file
174
Scripts/Items/Consumables/AnniversaryPromotionalToken.cs
Normal file
@@ -0,0 +1,174 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum AnniversaryType
|
||||
{
|
||||
ShadowItems,
|
||||
CrystalItems
|
||||
}
|
||||
|
||||
public class AnniversaryPromotionalToken : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
int cliloc = 0;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case AnniversaryType.ShadowItems:
|
||||
cliloc = 1076594; // A Shadow Token
|
||||
break;
|
||||
case AnniversaryType.CrystalItems:
|
||||
cliloc = 1076592; // A Crystal Token
|
||||
break;
|
||||
}
|
||||
|
||||
return cliloc;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AnniversaryType Type { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public AnniversaryPromotionalToken(AnniversaryType type)
|
||||
: base(0x2AAA)
|
||||
{
|
||||
Type = type;
|
||||
|
||||
if (type == AnniversaryType.CrystalItems)
|
||||
ItemID = 0x3678;
|
||||
else if (type == AnniversaryType.ShadowItems)
|
||||
ItemID = 0x3679;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
int cliloc = 0;
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case AnniversaryType.ShadowItems:
|
||||
cliloc = 1076717;
|
||||
break;
|
||||
case AnniversaryType.CrystalItems:
|
||||
cliloc = 1076716;
|
||||
break;
|
||||
}
|
||||
|
||||
list.Add(1070998, String.Format("#{0}", cliloc)); // Use this to redeem<br>your ~1_PROMO~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.CloseGump(typeof(AnniversaryRewardGump));
|
||||
from.SendGump(new AnniversaryRewardGump(this));
|
||||
}
|
||||
}
|
||||
|
||||
public AnniversaryPromotionalToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Type = (AnniversaryType)reader.ReadInt();
|
||||
}
|
||||
|
||||
private class AnniversaryRewardGump : Gump
|
||||
{
|
||||
private readonly AnniversaryPromotionalToken Token;
|
||||
|
||||
public AnniversaryRewardGump(AnniversaryPromotionalToken token)
|
||||
: base(200, 200)
|
||||
{
|
||||
Token = token;
|
||||
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1015313, false, false); // <center></center>
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1049004, false, false); // Confirm
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1076597, false, false); // Clicking "OK" will create the items in your backpack if there is room. Otherwise it will be created in your bankbox.
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1011036, false, false); // OKAY
|
||||
AddHtmlLocalized(0, 0, 0, 0, 1011012, false, false); // CANCEL
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 291, 159, 0x13BE);
|
||||
|
||||
AddImageTiled(5, 6, 280, 20, 0xA40);
|
||||
AddHtmlLocalized(9, 8, 280, 20, 1049004, 0x7FFF, false, false); // Confirm
|
||||
|
||||
AddImageTiled(5, 31, 280, 100, 0xA40);
|
||||
AddHtmlLocalized(9, 35, 272, 100, 1076597, 0x7FFF, false, false); // Clicking "OK" will create the items in your backpack if there is room. Otherwise it will be created in your bankbox.
|
||||
|
||||
AddButton(190, 133, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(225, 135, 90, 20, 1006044, 0x7FFF, false, false); // OK
|
||||
|
||||
AddButton(5, 133, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 135, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
Mobile m = sender.Mobile;
|
||||
Item item = null;
|
||||
|
||||
switch (Token.Type)
|
||||
{
|
||||
case AnniversaryType.CrystalItems:
|
||||
{
|
||||
item = new BoxOfCrystalItems();
|
||||
break;
|
||||
}
|
||||
case AnniversaryType.ShadowItems:
|
||||
{
|
||||
item = new BoxOfShadowItems();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item != null && Token != null)
|
||||
{
|
||||
if (!m.AddToBackpack(item))
|
||||
{
|
||||
if (m.BankBox.TryDropItem(m, item, false))
|
||||
item.MoveToWorld(m.Location, m.Map);
|
||||
}
|
||||
|
||||
Token.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ArchProtectionScroll.cs
Normal file
38
Scripts/Items/Consumables/ArchProtectionScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArchProtectionScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ArchProtectionScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ArchProtectionScroll(int amount)
|
||||
: base(25, 0x1F46, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ArchProtectionScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ArchcureScroll.cs
Normal file
38
Scripts/Items/Consumables/ArchcureScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArchCureScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ArchCureScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ArchCureScroll(int amount)
|
||||
: base(24, 0x1F45, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ArchCureScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
380
Scripts/Items/Consumables/Asian.cs
Normal file
380
Scripts/Items/Consumables/Asian.cs
Normal file
@@ -0,0 +1,380 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Wasabi : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Wasabi()
|
||||
: base(0x24E8)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Wasabi(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 class WasabiClumps : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WasabiClumps()
|
||||
: base(0x24EB)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WasabiClumps(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 class EmptyBentoBox : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyBentoBox()
|
||||
: base(0x2834)
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public EmptyBentoBox(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 class BentoBox : Food
|
||||
{
|
||||
[Constructable]
|
||||
public BentoBox()
|
||||
: base(0x2836)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 5.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public BentoBox(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyBentoBox());
|
||||
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 class SushiRolls : Food
|
||||
{
|
||||
[Constructable]
|
||||
public SushiRolls()
|
||||
: base(0x283E)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 3.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public SushiRolls(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 class SushiPlatter : Food
|
||||
{
|
||||
[Constructable]
|
||||
public SushiPlatter()
|
||||
: base(0x2840)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
Weight = 3.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public SushiPlatter(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 class GreenTeaBasket : Item
|
||||
{
|
||||
[Constructable]
|
||||
public GreenTeaBasket()
|
||||
: base(0x284B)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public GreenTeaBasket(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 class GreenTea : Food
|
||||
{
|
||||
[Constructable]
|
||||
public GreenTea()
|
||||
: base(0x284C)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 4.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public GreenTea(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 class MisoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public MisoSoup()
|
||||
: base(0x284D)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 4.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public MisoSoup(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 class WhiteMisoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WhiteMisoSoup()
|
||||
: base(0x284E)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 4.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WhiteMisoSoup(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 class RedMisoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public RedMisoSoup()
|
||||
: base(0x284F)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 4.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public RedMisoSoup(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 class AwaseMisoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public AwaseMisoSoup()
|
||||
: base(0x2850)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 4.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public AwaseMisoSoup(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
311
Scripts/Items/Consumables/BankCheck.cs
Normal file
311
Scripts/Items/Consumables/BankCheck.cs
Normal file
@@ -0,0 +1,311 @@
|
||||
#region References
|
||||
using System;
|
||||
|
||||
using Server.Accounting;
|
||||
using Server.Engines.Quests.Haven;
|
||||
using Server.Engines.Quests.Necro;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
using CashBankCheckObjective = Server.Engines.Quests.Necro.CashBankCheckObjective;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public static class BankCheckExtensions
|
||||
{
|
||||
public static int GetChecksWorth(this Container cont, bool recurse)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
var items = cont.FindItemsByType(typeof(BankCheck), recurse);
|
||||
foreach (BankCheck check in items)
|
||||
{
|
||||
count += check.Worth;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
public static int TakeFromChecks(this Container cont, int amount, bool recurse)
|
||||
{
|
||||
int left = amount;
|
||||
|
||||
var items = cont.FindItemsByType(typeof(BankCheck), recurse);
|
||||
foreach(BankCheck check in items)
|
||||
{
|
||||
if(check.Worth <= left)
|
||||
{
|
||||
left -= check.Worth;
|
||||
check.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
check.Worth -= left;
|
||||
check.InvalidateProperties();
|
||||
left = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return amount - left;
|
||||
}
|
||||
}
|
||||
|
||||
public class BankCheck : Item
|
||||
{
|
||||
private int m_Worth;
|
||||
|
||||
public BankCheck(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public BankCheck(int worth)
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x34;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Worth = worth;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Worth
|
||||
{
|
||||
get { return m_Worth; }
|
||||
set
|
||||
{
|
||||
m_Worth = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DisplayLootType { get { return Core.AOS; } }
|
||||
|
||||
public override int LabelNumber { get { return 1041361; } } // A bank check
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(m_Worth);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Worth = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
var worth = Core.ML ? m_Worth.ToString("#,0") : m_Worth.ToString();
|
||||
|
||||
list.Add(1060738, worth); // value: ~1_val~
|
||||
}
|
||||
|
||||
#if NEWPARENT
|
||||
public override void OnAdded(IEntity parent)
|
||||
#else
|
||||
public override void OnAdded(object parent)
|
||||
#endif
|
||||
{
|
||||
base.OnAdded(parent);
|
||||
|
||||
if (!AccountGold.Enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Mobile owner = null;
|
||||
SecureTradeInfo tradeInfo = null;
|
||||
|
||||
Container root = parent as Container;
|
||||
|
||||
while (root != null && root.Parent is Container)
|
||||
{
|
||||
root = (Container)root.Parent;
|
||||
}
|
||||
|
||||
parent = root ?? parent;
|
||||
|
||||
if (parent is SecureTradeContainer && AccountGold.ConvertOnTrade)
|
||||
{
|
||||
var trade = (SecureTradeContainer)parent;
|
||||
|
||||
if (trade.Trade.From.Container == trade)
|
||||
{
|
||||
tradeInfo = trade.Trade.From;
|
||||
owner = tradeInfo.Mobile;
|
||||
}
|
||||
else if (trade.Trade.To.Container == trade)
|
||||
{
|
||||
tradeInfo = trade.Trade.To;
|
||||
owner = tradeInfo.Mobile;
|
||||
}
|
||||
}
|
||||
else if (parent is BankBox && AccountGold.ConvertOnBank)
|
||||
{
|
||||
owner = ((BankBox)parent).Owner;
|
||||
}
|
||||
|
||||
if (owner == null || owner.Account == null || !owner.Account.DepositGold(Worth))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tradeInfo != null)
|
||||
{
|
||||
if (owner.NetState != null && !owner.NetState.NewSecureTrading)
|
||||
{
|
||||
var total = Worth / Math.Max(1.0, Account.CurrencyThreshold);
|
||||
var plat = (int)Math.Truncate(total);
|
||||
var gold = (int)((total - plat) * Account.CurrencyThreshold);
|
||||
|
||||
tradeInfo.Plat += plat;
|
||||
tradeInfo.Gold += gold;
|
||||
}
|
||||
|
||||
if (tradeInfo.VirtualCheck != null)
|
||||
{
|
||||
tradeInfo.VirtualCheck.UpdateTrade(tradeInfo.Mobile);
|
||||
}
|
||||
}
|
||||
|
||||
owner.SendLocalizedMessage(1042763, Worth.ToString("#,0"));
|
||||
|
||||
Delete();
|
||||
|
||||
((Container)parent).UpdateTotals();
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
from.Send(
|
||||
new MessageLocalizedAffix(
|
||||
from.NetState,
|
||||
Serial,
|
||||
ItemID,
|
||||
MessageType.Label,
|
||||
0x3B2,
|
||||
3,
|
||||
1041361,
|
||||
"",
|
||||
AffixType.Append,
|
||||
String.Concat(" ", m_Worth.ToString()),
|
||||
"")); // A bank check:
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
// This probably isn't OSI accurate, but we can't just make the quests redundant.
|
||||
// Double-clicking the BankCheck in your pack will now credit your account.
|
||||
|
||||
var box = AccountGold.Enabled ? from.Backpack : from.FindBankNoCreate();
|
||||
|
||||
if (box == null || !IsChildOf(box))
|
||||
{
|
||||
from.SendLocalizedMessage(AccountGold.Enabled ? 1080058 : 1047026);
|
||||
// This must be in your backpack to use it. : That must be in your bank box to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
Delete();
|
||||
|
||||
var deposited = 0;
|
||||
var toAdd = m_Worth;
|
||||
|
||||
if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(toAdd))
|
||||
{
|
||||
deposited = toAdd;
|
||||
toAdd = 0;
|
||||
}
|
||||
|
||||
if (toAdd > 0)
|
||||
{
|
||||
Gold gold;
|
||||
|
||||
while (toAdd > 60000)
|
||||
{
|
||||
gold = new Gold(60000);
|
||||
|
||||
if (box.TryDropItem(from, gold, false))
|
||||
{
|
||||
toAdd -= 60000;
|
||||
deposited += 60000;
|
||||
}
|
||||
else
|
||||
{
|
||||
gold.Delete();
|
||||
|
||||
from.AddToBackpack(new BankCheck(toAdd));
|
||||
toAdd = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (toAdd > 0)
|
||||
{
|
||||
gold = new Gold(toAdd);
|
||||
|
||||
if (box.TryDropItem(from, gold, false))
|
||||
{
|
||||
deposited += toAdd;
|
||||
}
|
||||
else
|
||||
{
|
||||
gold.Delete();
|
||||
|
||||
from.AddToBackpack(new BankCheck(toAdd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gold was deposited in your account:
|
||||
from.SendLocalizedMessage(1042672, true, deposited.ToString("#,0"));
|
||||
|
||||
var pm = from as PlayerMobile;
|
||||
|
||||
if (pm != null)
|
||||
{
|
||||
var qs = pm.Quest;
|
||||
|
||||
if (qs is DarkTidesQuest)
|
||||
{
|
||||
var obj = qs.FindObjective(typeof(CashBankCheckObjective));
|
||||
|
||||
if (obj != null && !obj.Completed)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
}
|
||||
|
||||
if (qs is UzeraanTurmoilQuest)
|
||||
{
|
||||
var obj = qs.FindObjective(typeof(Engines.Quests.Haven.CashBankCheckObjective));
|
||||
|
||||
if (obj != null && !obj.Completed)
|
||||
{
|
||||
obj.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
Scripts/Items/Consumables/BarkeepContract.cs
Normal file
92
Scripts/Items/Consumables/BarkeepContract.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BarkeepContract : Item
|
||||
{
|
||||
public override int LabelNumber {get {return 1153779;} } // a barkeep contract
|
||||
|
||||
[Constructable]
|
||||
public BarkeepContract()
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public BarkeepContract(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)
|
||||
{
|
||||
if (!this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish.
|
||||
|
||||
Mobile v = new PlayerBarkeeper(from, BaseHouse.FindHouseAt(from));
|
||||
|
||||
v.Direction = from.Direction & Direction.Mask;
|
||||
v.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
this.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house == null || !house.IsOwner(from))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You are not the full owner of this house.");
|
||||
}
|
||||
else if (!house.CanPlaceNewBarkeep())
|
||||
{
|
||||
from.SendLocalizedMessage(1062490); // That action would exceed the maximum number of barkeeps for this house.
|
||||
}
|
||||
else
|
||||
{
|
||||
bool vendor, contract;
|
||||
BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);
|
||||
|
||||
if (vendor)
|
||||
{
|
||||
from.SendLocalizedMessage(1062677); // You cannot place a vendor or barkeep at this location.
|
||||
}
|
||||
else if (contract)
|
||||
{
|
||||
from.SendLocalizedMessage(1062678); // You cannot place a vendor or barkeep on top of a rental contract!
|
||||
}
|
||||
else
|
||||
{
|
||||
Mobile v = new PlayerBarkeeper(from, house);
|
||||
|
||||
v.Direction = from.Direction & Direction.Mask;
|
||||
v.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Scripts/Items/Consumables/BaseAgilityPotion.cs
Normal file
60
Scripts/Items/Consumables/BaseAgilityPotion.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseAgilityPotion : BasePotion
|
||||
{
|
||||
public BaseAgilityPotion(PotionEffect effect)
|
||||
: base(0xF08, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseAgilityPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract int DexOffset { get; }
|
||||
public abstract TimeSpan Duration { get; }
|
||||
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 bool DoAgility(Mobile from)
|
||||
{
|
||||
// TODO: Verify scaled; is it offset, duration, or both?
|
||||
int scale = Scale(from, this.DexOffset);
|
||||
if (Spells.SpellHelper.AddStatOffset(from, StatType.Dex, scale, this.Duration))
|
||||
{
|
||||
from.FixedEffect(0x375A, 10, 15);
|
||||
from.PlaySound(0x1E7);
|
||||
|
||||
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.Agility, 1075841, this.Duration, from, scale.ToString()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (this.DoAgility(from))
|
||||
{
|
||||
PlayDrinkEffect(from);
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
382
Scripts/Items/Consumables/BaseConflagrationPotion.cs
Normal file
382
Scripts/Items/Consumables/BaseConflagrationPotion.cs
Normal file
@@ -0,0 +1,382 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseConflagrationPotion : BasePotion
|
||||
{
|
||||
public abstract int MinDamage { get; }
|
||||
public abstract int MaxDamage { get; }
|
||||
|
||||
public override bool RequireFreeHand
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public BaseConflagrationPotion(PotionEffect effect)
|
||||
: base(0xF06, effect)
|
||||
{
|
||||
Hue = 0x489;
|
||||
}
|
||||
|
||||
public BaseConflagrationPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
|
||||
{
|
||||
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = GetDelay(from);
|
||||
|
||||
if (delay > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1072529, String.Format("{0}\t{1}", delay, delay > 1 ? "seconds." : "second.")); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
|
||||
return;
|
||||
}
|
||||
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
return;
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private readonly List<Mobile> m_Users = new List<Mobile>();
|
||||
|
||||
public void Explode_Callback(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
Explode((Mobile)states[0], (Point3D)states[1], (Map)states[2]);
|
||||
}
|
||||
|
||||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
return;
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (int i = 0; i < m_Users.Count; i ++)
|
||||
{
|
||||
ThrowTarget targ = m_Users[i].Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x20C);
|
||||
|
||||
for (int i = -2; i <= 2; i ++)
|
||||
{
|
||||
for (int j = -2; j <= 2; j ++)
|
||||
{
|
||||
Point3D p = new Point3D(loc.X + i, loc.Y + j, map.GetAverageZ(loc.X + i, loc.Y + j));
|
||||
SpellHelper.AdjustField(ref p, map, 16, true);
|
||||
|
||||
if (map.CanFit(new Point3D(p), 12, true, false) && from.InLOS(p))
|
||||
new InternalItem(from, p, map, MinDamage, MaxDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Delay
|
||||
private static readonly Hashtable m_Delay = new Hashtable();
|
||||
|
||||
public static void AddDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
timer.Stop();
|
||||
|
||||
m_Delay[m] = Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerStateCallback(EndDelay_Callback), m);
|
||||
}
|
||||
|
||||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null && timer.Next > DateTime.UtcNow)
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void EndDelay_Callback(object obj)
|
||||
{
|
||||
if (obj is Mobile)
|
||||
EndDelay((Mobile)obj);
|
||||
}
|
||||
|
||||
public static void EndDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
{
|
||||
timer.Stop();
|
||||
m_Delay.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private readonly BaseConflagrationPotion m_Potion;
|
||||
|
||||
public BaseConflagrationPotion Potion
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Potion;
|
||||
}
|
||||
}
|
||||
|
||||
public ThrowTarget(BaseConflagrationPotion potion)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if (p == null || from.Map == null)
|
||||
return;
|
||||
|
||||
// Add delay
|
||||
if (from.AccessLevel == AccessLevel.Player)
|
||||
{
|
||||
BaseConflagrationPotion.AddDelay(from);
|
||||
}
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
if (p is Mobile)
|
||||
to = (Mobile)p;
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, m_Potion.Hue, 0);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(m_Potion.Explode_Callback), new object[] { from, new Point3D(p), from.Map });
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalItem : Item
|
||||
{
|
||||
private Mobile m_From;
|
||||
private int m_MinDamage;
|
||||
private int m_MaxDamage;
|
||||
private DateTime m_End;
|
||||
private Timer m_Timer;
|
||||
|
||||
public Mobile From
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_From;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool BlocksFit
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public InternalItem(Mobile from, Point3D loc, Map map, int min, int max)
|
||||
: base(0x398C)
|
||||
{
|
||||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
MoveToWorld(loc, map);
|
||||
|
||||
m_From = from;
|
||||
m_End = DateTime.UtcNow + TimeSpan.FromSeconds(10);
|
||||
|
||||
SetDamage(min, max);
|
||||
|
||||
m_Timer = new InternalTimer(this, m_End);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
public InternalItem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public int GetDamage()
|
||||
{
|
||||
return Utility.RandomMinMax(m_MinDamage, m_MaxDamage);
|
||||
}
|
||||
|
||||
private void SetDamage(int min, int max)
|
||||
{
|
||||
/* new way to apply alchemy bonus according to Stratics' calculator.
|
||||
this gives a mean to values 25, 50, 75 and 100. Stratics' calculator is outdated.
|
||||
Those goals will give 2 to alchemy bonus. It's not really OSI-like but it's an approximation. */
|
||||
m_MinDamage = min;
|
||||
m_MaxDamage = max;
|
||||
|
||||
if (m_From == null)
|
||||
return;
|
||||
|
||||
int alchemySkill = m_From.Skills.Alchemy.Fixed;
|
||||
int alchemyBonus = alchemySkill / 125 + alchemySkill / 250 ;
|
||||
|
||||
m_MinDamage = Scale(m_From, m_MinDamage + alchemyBonus);
|
||||
m_MaxDamage = Scale(m_From, m_MaxDamage + alchemyBonus);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((Mobile)m_From);
|
||||
writer.Write((DateTime)m_End);
|
||||
writer.Write((int)m_MinDamage);
|
||||
writer.Write((int)m_MaxDamage);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_From = reader.ReadMobile();
|
||||
m_End = reader.ReadDateTime();
|
||||
m_MinDamage = reader.ReadInt();
|
||||
m_MaxDamage = reader.ReadInt();
|
||||
|
||||
m_Timer = new InternalTimer(this, m_End);
|
||||
m_Timer.Start();
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (Visible && m_From != null && (!Core.AOS || m != m_From) && SpellHelper.ValidIndirectTarget(m_From, m) && m_From.CanBeHarmful(m, false))
|
||||
{
|
||||
m_From.DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, m_From, GetDamage(), 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x208);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly InternalItem m_Item;
|
||||
private readonly DateTime m_End;
|
||||
|
||||
public InternalTimer(InternalItem item, DateTime end)
|
||||
: base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0))
|
||||
{
|
||||
m_Item = item;
|
||||
m_End = end;
|
||||
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (DateTime.UtcNow > m_End)
|
||||
{
|
||||
m_Item.Delete();
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
Mobile from = m_Item.From;
|
||||
|
||||
if (m_Item.Map == null || from == null)
|
||||
return;
|
||||
|
||||
List<Mobile> mobiles = new List<Mobile>();
|
||||
IPooledEnumerable eable = m_Item.GetMobilesInRange(0);
|
||||
|
||||
foreach (Mobile mobile in eable)
|
||||
mobiles.Add(mobile);
|
||||
eable.Free();
|
||||
|
||||
for (int i = 0; i < mobiles.Count; i++)
|
||||
{
|
||||
Mobile m = mobiles[i];
|
||||
|
||||
if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != from) && SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false))
|
||||
{
|
||||
if (from != null)
|
||||
from.DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x208);
|
||||
}
|
||||
}
|
||||
|
||||
ColUtility.Free(mobiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
230
Scripts/Items/Consumables/BaseConfusionBlastPotion.cs
Normal file
230
Scripts/Items/Consumables/BaseConfusionBlastPotion.cs
Normal file
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseConfusionBlastPotion : BasePotion
|
||||
{
|
||||
public abstract int Radius { get; }
|
||||
|
||||
public override bool RequireFreeHand
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public BaseConfusionBlastPotion(PotionEffect effect)
|
||||
: base(0xF06, effect)
|
||||
{
|
||||
this.Hue = 0x48D;
|
||||
}
|
||||
|
||||
public BaseConfusionBlastPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
|
||||
{
|
||||
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = GetDelay(from);
|
||||
|
||||
if (delay > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1072529, String.Format("{0}\t{1}", delay, delay > 1 ? "seconds." : "second.")); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
|
||||
return;
|
||||
}
|
||||
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
return;
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!this.m_Users.Contains(from))
|
||||
this.m_Users.Add(from);
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private readonly List<Mobile> m_Users = new List<Mobile>();
|
||||
|
||||
public void Explode_Callback(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
this.Explode((Mobile)states[0], (Point3D)states[1], (Map)states[2]);
|
||||
}
|
||||
|
||||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (this.Deleted || map == null)
|
||||
return;
|
||||
|
||||
this.Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (int i = 0; i < this.m_Users.Count; i ++)
|
||||
{
|
||||
ThrowTarget targ = this.m_Users[i].Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x207);
|
||||
|
||||
Geometry.Circle2D(loc, map, this.Radius, new DoEffect_Callback(BlastEffect), 270, 90);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.3), new TimerStateCallback(CircleEffect2), new object[] { loc, map });
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(loc, Radius);
|
||||
|
||||
foreach (Mobile mobile in eable)
|
||||
{
|
||||
if (mobile is BaseCreature)
|
||||
{
|
||||
BaseCreature mon = (BaseCreature)mobile;
|
||||
|
||||
if (mon.Controlled || mon.Summoned)
|
||||
continue;
|
||||
|
||||
mon.Pacify(from, DateTime.UtcNow + TimeSpan.FromSeconds(5.0)); // TODO check
|
||||
}
|
||||
}
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
#region Effects
|
||||
public virtual void BlastEffect(Point3D p, Map map)
|
||||
{
|
||||
if (map.CanFit(p, 12, true, false))
|
||||
Effects.SendLocationEffect(p, map, 0x376A, 4, 9);
|
||||
}
|
||||
|
||||
public void CircleEffect2(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
Geometry.Circle2D((Point3D)states[0], (Map)states[1], this.Radius, new DoEffect_Callback(BlastEffect), 90, 270);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Delay
|
||||
private static readonly Hashtable m_Delay = new Hashtable();
|
||||
|
||||
public static void AddDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
timer.Stop();
|
||||
|
||||
m_Delay[m] = Timer.DelayCall(TimeSpan.FromSeconds(60), new TimerStateCallback(EndDelay_Callback), m);
|
||||
}
|
||||
|
||||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null && timer.Next > DateTime.UtcNow)
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void EndDelay_Callback(object obj)
|
||||
{
|
||||
if (obj is Mobile)
|
||||
EndDelay((Mobile)obj);
|
||||
}
|
||||
|
||||
public static void EndDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
{
|
||||
timer.Stop();
|
||||
m_Delay.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private readonly BaseConfusionBlastPotion m_Potion;
|
||||
|
||||
public BaseConfusionBlastPotion Potion
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Potion;
|
||||
}
|
||||
}
|
||||
|
||||
public ThrowTarget(BaseConfusionBlastPotion potion)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
this.m_Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (this.m_Potion.Deleted || this.m_Potion.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if (p == null || from.Map == null)
|
||||
return;
|
||||
|
||||
// Add delay
|
||||
BaseConfusionBlastPotion.AddDelay(from);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
if (p is Mobile)
|
||||
to = (Mobile)p;
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
|
||||
Effects.SendMovingEffect(from, to, 0xF0D, 7, 0, false, false, this.m_Potion.Hue, 0);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(this.m_Potion.Explode_Callback), new object[] { from, new Point3D(p), from.Map });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
110
Scripts/Items/Consumables/BaseCurePotion.cs
Normal file
110
Scripts/Items/Consumables/BaseCurePotion.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CureLevelInfo
|
||||
{
|
||||
private readonly Poison m_Poison;
|
||||
private readonly double m_Chance;
|
||||
public CureLevelInfo(Poison poison, double chance)
|
||||
{
|
||||
this.m_Poison = poison;
|
||||
this.m_Chance = chance;
|
||||
}
|
||||
|
||||
public Poison Poison
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Poison;
|
||||
}
|
||||
}
|
||||
public double Chance
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Chance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseCurePotion : BasePotion
|
||||
{
|
||||
public BaseCurePotion(PotionEffect effect)
|
||||
: base(0xF07, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseCurePotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract CureLevelInfo[] LevelInfo { get; }
|
||||
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 void DoCure(Mobile from)
|
||||
{
|
||||
bool cure = false;
|
||||
|
||||
CureLevelInfo[] info = this.LevelInfo;
|
||||
|
||||
for (int i = 0; i < info.Length; ++i)
|
||||
{
|
||||
CureLevelInfo li = info[i];
|
||||
|
||||
if (li.Poison.RealLevel == from.Poison.RealLevel &&
|
||||
Scale(from, li.Chance) > Utility.RandomDouble())
|
||||
{
|
||||
cure = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cure && from.CurePoison(from))
|
||||
{
|
||||
from.SendLocalizedMessage(500231); // You feel cured of poison!
|
||||
|
||||
from.FixedEffect(0x373A, 10, 15);
|
||||
from.PlaySound(0x1E0);
|
||||
}
|
||||
else if (!cure)
|
||||
{
|
||||
from.SendLocalizedMessage(500232); // That potion was not strong enough to cure your ailment!
|
||||
}
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (TransformationSpellHelper.UnderTransformation(from, typeof(Spells.Necromancy.VampiricEmbraceSpell)))
|
||||
{
|
||||
from.SendLocalizedMessage(1061652); // The garlic in the potion would surely kill you.
|
||||
}
|
||||
else if (from.Poisoned)
|
||||
{
|
||||
DoCure(from);
|
||||
PlayDrinkEffect(from);
|
||||
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
|
||||
from.PlaySound(0x1E0);
|
||||
Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042000); // You are not poisoned.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
226
Scripts/Items/Consumables/BaseExplodingTarPotion.cs
Normal file
226
Scripts/Items/Consumables/BaseExplodingTarPotion.cs
Normal file
@@ -0,0 +1,226 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Spells;
|
||||
using Server.Mobiles;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseExplodingTarPotion : BasePotion
|
||||
{
|
||||
public abstract int Radius{ get; }
|
||||
|
||||
public override bool RequireFreeHand{ get{ return false; } }
|
||||
|
||||
public BaseExplodingTarPotion( PotionEffect effect ) : base( 0xF06, effect )
|
||||
{
|
||||
Hue = 1109;
|
||||
}
|
||||
|
||||
public BaseExplodingTarPotion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Drink( Mobile from )
|
||||
{
|
||||
if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062725 ); // You can not use that potion while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = GetDelay( from );
|
||||
|
||||
if ( delay > 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1072529, String.Format( "{0}\t{1}", delay, delay > 1 ? "seconds." : "second." ) ); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
|
||||
return;
|
||||
}
|
||||
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
|
||||
if ( targ != null && targ.Potion == this )
|
||||
return;
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if ( !m_Users.Contains( from ) )
|
||||
m_Users.Add( from );
|
||||
|
||||
from.Target = new ThrowTarget( this );
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private List<Mobile> m_Users = new List<Mobile>();
|
||||
|
||||
public void Explode_Callback( object state )
|
||||
{
|
||||
object[] states = (object[]) state;
|
||||
|
||||
Explode( (Mobile) states[ 0 ], (Point3D) states[ 1 ], (Map) states[ 2 ] );
|
||||
}
|
||||
|
||||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
return;
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (int i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
ThrowTarget targ = m_Users[i].Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
}
|
||||
|
||||
// Effects
|
||||
Effects.PlaySound(loc, map, 0x207);
|
||||
|
||||
Geometry.Circle2D(loc, map, Radius, new DoEffect_Callback(TarEffect), 270, 90);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(CircleEffect2), new object[] { loc, map });
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(loc, Radius);
|
||||
|
||||
foreach (Mobile mobile in eable)
|
||||
{
|
||||
if (mobile != from)
|
||||
{
|
||||
if (mobile is PlayerMobile)
|
||||
{
|
||||
PlayerMobile player = (PlayerMobile)mobile;
|
||||
|
||||
player.SendLocalizedMessage(1095151);
|
||||
}
|
||||
|
||||
mobile.SendSpeedControl(SpeedControlType.WalkSpeed);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(1.0), delegate()
|
||||
{
|
||||
mobile.SendSpeedControl(SpeedControlType.Disable);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
#region Effects
|
||||
public virtual void TarEffect( Point3D p, Map map )
|
||||
{
|
||||
if ( map.CanFit( p, 12, true, false ) )
|
||||
Effects.SendLocationEffect( p, map, 0x376A, 4, 9 );
|
||||
}
|
||||
|
||||
public void CircleEffect2( object state )
|
||||
{
|
||||
object[] states = (object[]) state;
|
||||
|
||||
Geometry.Circle2D( (Point3D)states[0], (Map)states[1], Radius, new DoEffect_Callback( TarEffect ), 90, 270 );
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delay
|
||||
private static Hashtable m_Delay = new Hashtable();
|
||||
|
||||
public static void AddDelay( Mobile m )
|
||||
{
|
||||
Timer timer = m_Delay[ m ] as Timer;
|
||||
|
||||
if ( timer != null )
|
||||
timer.Stop();
|
||||
|
||||
m_Delay[ m ] = Timer.DelayCall( TimeSpan.FromSeconds( 60 ), new TimerStateCallback( EndDelay_Callback ), m );
|
||||
}
|
||||
|
||||
public static int GetDelay( Mobile m )
|
||||
{
|
||||
Timer timer = m_Delay[ m ] as Timer;
|
||||
|
||||
if ( timer != null && timer.Next > DateTime.UtcNow )
|
||||
return (int) (timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void EndDelay_Callback( object obj )
|
||||
{
|
||||
if ( obj is Mobile )
|
||||
EndDelay( (Mobile) obj );
|
||||
}
|
||||
|
||||
public static void EndDelay( Mobile m )
|
||||
{
|
||||
Timer timer = m_Delay[ m ] as Timer;
|
||||
|
||||
if ( timer != null )
|
||||
{
|
||||
timer.Stop();
|
||||
m_Delay.Remove( m );
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private BaseExplodingTarPotion m_Potion;
|
||||
|
||||
public BaseExplodingTarPotion Potion
|
||||
{
|
||||
get{ return m_Potion; }
|
||||
}
|
||||
|
||||
public ThrowTarget( BaseExplodingTarPotion potion ) : base( 12, true, TargetFlags.None )
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if ( p == null || from.Map == null )
|
||||
return;
|
||||
|
||||
// Add delay
|
||||
BaseExplodingTarPotion.AddDelay( from );
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
if ( p is Mobile )
|
||||
to = (Mobile)p;
|
||||
else
|
||||
to = new Entity( Serial.Zero, new Point3D( p ), from.Map );
|
||||
|
||||
Effects.SendMovingEffect( from, to, 0xF0D, 7, 0, false, false, m_Potion.Hue, 0 );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Explode_Callback ), new object[] { from, new Point3D( p ), from.Map } );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
317
Scripts/Items/Consumables/BaseExplosionPotion.cs
Normal file
317
Scripts/Items/Consumables/BaseExplosionPotion.cs
Normal file
@@ -0,0 +1,317 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseExplosionPotion : BasePotion
|
||||
{
|
||||
private const int ExplosionRange = 2; // How long is the blast radius?
|
||||
private Timer m_Timer;
|
||||
|
||||
public BaseExplosionPotion(PotionEffect effect)
|
||||
: base(0xF0D, effect)
|
||||
{ }
|
||||
|
||||
public BaseExplosionPotion(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public abstract int MinDamage { get; }
|
||||
public abstract int MaxDamage { get; }
|
||||
public override bool RequireFreeHand { get { return false; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public virtual object FindParent(Mobile from)
|
||||
{
|
||||
Mobile m = HeldBy;
|
||||
|
||||
if (m != null && m.Holding == this)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
object obj = RootParent;
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
|
||||
if (Map == Map.Internal)
|
||||
{
|
||||
return from;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
|
||||
{
|
||||
from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
from.RevealingAction();
|
||||
from.Target = new ThrowTarget(this);
|
||||
|
||||
if (m_Timer == null)
|
||||
{
|
||||
from.SendLocalizedMessage(500236); // You should throw it now!
|
||||
|
||||
if (Core.ML)
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
TimeSpan.FromSeconds(1.25),
|
||||
5,
|
||||
new TimerStateCallback(Detonate_OnTick),
|
||||
new object[] {from, 3}); // 3.6 seconds explosion delay
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Timer = Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(0.75),
|
||||
TimeSpan.FromSeconds(1.0),
|
||||
4,
|
||||
new TimerStateCallback(Detonate_OnTick),
|
||||
new object[] {from, 3}); // 2.6 seconds explosion delay
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Explode(Mobile from, bool direct, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool damageThrower = false;
|
||||
|
||||
if (from != null)
|
||||
{
|
||||
if (from.Target is ThrowTarget && ((ThrowTarget)from.Target).Potion == this)
|
||||
{
|
||||
Target.Cancel(from);
|
||||
}
|
||||
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
{
|
||||
damageThrower = true;
|
||||
}
|
||||
}
|
||||
|
||||
Consume();
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Effects.PlaySound(loc, map, 0x307);
|
||||
|
||||
Effects.SendLocationEffect(loc, map, 0x36B0, 9, 10, 0, 0);
|
||||
int alchemyBonus = 0;
|
||||
|
||||
if (direct)
|
||||
{
|
||||
alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
|
||||
}
|
||||
|
||||
int min = Scale(from, MinDamage);
|
||||
int max = Scale(from, MaxDamage);
|
||||
|
||||
var list = SpellHelper.AcquireIndirectTargets(from, loc, map, ExplosionRange, false).OfType<Mobile>().ToList();
|
||||
|
||||
if (from != null && damageThrower && !list.Contains(from))
|
||||
{
|
||||
list.Add(from);
|
||||
}
|
||||
|
||||
foreach (var m in list)
|
||||
{
|
||||
if (from != null)
|
||||
{
|
||||
from.DoHarmful(m);
|
||||
}
|
||||
|
||||
int damage = Utility.RandomMinMax(min, max);
|
||||
|
||||
damage += alchemyBonus;
|
||||
|
||||
if (!Core.AOS && damage > 40)
|
||||
{
|
||||
damage = 40;
|
||||
}
|
||||
else if (Core.AOS && list.Count > 2)
|
||||
{
|
||||
damage /= list.Count - 1;
|
||||
}
|
||||
|
||||
AOS.Damage(m, from, damage, 0, 100, 0, 0, 0, Server.DamageType.SpellAOE);
|
||||
}
|
||||
|
||||
list.Clear();
|
||||
}
|
||||
|
||||
private void Detonate_OnTick(object state)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var states = (object[])state;
|
||||
Mobile from = (Mobile)states[0];
|
||||
int timer = (int)states[1];
|
||||
|
||||
object parent = FindParent(from);
|
||||
|
||||
if (timer == 0)
|
||||
{
|
||||
Point3D loc;
|
||||
Map map;
|
||||
|
||||
if (parent is Item)
|
||||
{
|
||||
Item item = (Item)parent;
|
||||
|
||||
loc = item.GetWorldLocation();
|
||||
map = item.Map;
|
||||
}
|
||||
else if (parent is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)parent;
|
||||
|
||||
loc = m.Location;
|
||||
map = m.Map;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Explode(from, true, loc, map);
|
||||
m_Timer = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parent is Item)
|
||||
{
|
||||
((Item)parent).PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
else if (parent is Mobile)
|
||||
{
|
||||
((Mobile)parent).PublicOverheadMessage(MessageType.Regular, 0x22, false, timer.ToString());
|
||||
}
|
||||
|
||||
states[1] = timer - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void Reposition_OnTick(object state)
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var states = (object[])state;
|
||||
Mobile from = (Mobile)states[0];
|
||||
IPoint3D p = (IPoint3D)states[1];
|
||||
Map map = (Map)states[2];
|
||||
|
||||
Point3D loc = new Point3D(p);
|
||||
MoveToWorld(loc, map);
|
||||
}
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private readonly BaseExplosionPotion m_Potion;
|
||||
|
||||
public ThrowTarget(BaseExplosionPotion potion)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
public BaseExplosionPotion Potion { get { return m_Potion; } }
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if (p == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if (map == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
to = new Entity(Serial.Zero, new Point3D(p), map);
|
||||
|
||||
if (p is Mobile)
|
||||
{
|
||||
to = (Mobile)p;
|
||||
}
|
||||
|
||||
Effects.SendMovingEffect(from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0);
|
||||
|
||||
if (m_Potion.Amount > 1)
|
||||
{
|
||||
Mobile.LiftItemDupe(m_Potion, 1);
|
||||
}
|
||||
|
||||
m_Potion.Internalize();
|
||||
Timer.DelayCall(
|
||||
TimeSpan.FromSeconds(1.0), new TimerStateCallback(m_Potion.Reposition_OnTick), new object[] {from, p, map});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
78
Scripts/Items/Consumables/BaseHealPotion.cs
Normal file
78
Scripts/Items/Consumables/BaseHealPotion.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseHealPotion : BasePotion
|
||||
{
|
||||
public BaseHealPotion(PotionEffect effect)
|
||||
: base(0xF0C, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseHealPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract int MinHeal { get; }
|
||||
public abstract int MaxHeal { get; }
|
||||
public abstract double Delay { get; }
|
||||
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 void DoHeal(Mobile from)
|
||||
{
|
||||
int min = Scale(from, this.MinHeal);
|
||||
int max = Scale(from, this.MaxHeal);
|
||||
|
||||
from.Heal(Utility.RandomMinMax(min, max));
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (from.Hits < from.HitsMax)
|
||||
{
|
||||
if (from.Poisoned || MortalStrike.IsWounded(from))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x22, 1005000); // You can not heal yourself in your current state.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.BeginAction(typeof(BaseHealPotion)))
|
||||
{
|
||||
DoHeal(from);
|
||||
PlayDrinkEffect(from);
|
||||
Consume();
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(this.Delay), new TimerStateCallback(ReleaseHealLock), from);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x22, 500235); // You must wait 10 seconds before using another healing potion.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1049547); // You decide against drinking this potion, as you are already at full health.
|
||||
}
|
||||
}
|
||||
|
||||
private static void ReleaseHealLock(object state)
|
||||
{
|
||||
((Mobile)state).EndAction(typeof(BaseHealPotion));
|
||||
}
|
||||
}
|
||||
}
|
||||
167
Scripts/Items/Consumables/BaseMagicalFood.cs
Normal file
167
Scripts/Items/Consumables/BaseMagicalFood.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MagicalFood
|
||||
{
|
||||
None = 0x0,
|
||||
GrapesOfWrath = 0x1,
|
||||
EnchantedApple = 0x2,
|
||||
}
|
||||
|
||||
public class BaseMagicalFood : Food
|
||||
{
|
||||
private static Hashtable m_Table;
|
||||
private static Hashtable m_Cooldown;
|
||||
[Constructable]
|
||||
public BaseMagicalFood(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Weight = 1.0;
|
||||
FillFactor = 0;
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public BaseMagicalFood(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual MagicalFood FoodID
|
||||
{
|
||||
get
|
||||
{
|
||||
return MagicalFood.None;
|
||||
}
|
||||
}
|
||||
public virtual TimeSpan Cooldown
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
public virtual TimeSpan Duration
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
public virtual int EatMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static bool IsUnderInfluence(Mobile mob, MagicalFood id)
|
||||
{
|
||||
if (m_Table != null && m_Table[mob] != null && ((int)m_Table[mob] & (int)id) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CoolingDown(Mobile mob, MagicalFood id)
|
||||
{
|
||||
if (m_Cooldown != null && m_Cooldown[mob] != null && ((int)m_Cooldown[mob] & (int)id) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void StartInfluence(Mobile mob, MagicalFood id, TimeSpan duration, TimeSpan cooldown)
|
||||
{
|
||||
if (m_Table == null)
|
||||
m_Table = new Hashtable();
|
||||
|
||||
if (m_Table[mob] == null)
|
||||
m_Table[mob] = 0;
|
||||
|
||||
m_Table[mob] = (int)m_Table[mob] | (int)id;
|
||||
|
||||
Timer.DelayCall(duration, new TimerStateCallback(EndInfluence), new object[] { mob, id, cooldown });
|
||||
}
|
||||
|
||||
public static void EndInfluence(object obj)
|
||||
{
|
||||
if (obj is object[] && (((object[])obj).Length == 3))
|
||||
{
|
||||
object[] args = (object[])obj;
|
||||
|
||||
if (args[0] is Mobile && args[1] is MagicalFood && args[2] is TimeSpan)
|
||||
EndInfluence((Mobile)args[0], (MagicalFood)args[1], (TimeSpan)args[2]);
|
||||
}
|
||||
}
|
||||
|
||||
public static void EndInfluence(Mobile mob, MagicalFood id, TimeSpan cooldown)
|
||||
{
|
||||
m_Table[mob] = (int)m_Table[mob] & ~((int)id);
|
||||
|
||||
if (cooldown != TimeSpan.Zero)
|
||||
{
|
||||
if (m_Cooldown == null)
|
||||
m_Cooldown = new Hashtable();
|
||||
|
||||
if (m_Cooldown[mob] == null)
|
||||
m_Cooldown[mob] = 0;
|
||||
|
||||
m_Cooldown[mob] = (int)m_Cooldown[mob] | (int)id;
|
||||
|
||||
Timer.DelayCall(cooldown, new TimerStateCallback(EndCooldown), new object[] { mob, id });
|
||||
}
|
||||
}
|
||||
|
||||
public static void EndCooldown(object obj)
|
||||
{
|
||||
if (obj is object[] && (((object[])obj).Length == 2))
|
||||
{
|
||||
object[] args = (object[])obj;
|
||||
|
||||
if (args[0] is Mobile && args[1] is MagicalFood)
|
||||
EndCooldown((Mobile)args[0], (MagicalFood)args[1]);
|
||||
}
|
||||
}
|
||||
|
||||
public static void EndCooldown(Mobile mob, MagicalFood id)
|
||||
{
|
||||
m_Cooldown[mob] = (int)m_Cooldown[mob] & ~((int)id);
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!IsUnderInfluence(from, FoodID))
|
||||
{
|
||||
if (!CoolingDown(from, FoodID))
|
||||
{
|
||||
from.SendLocalizedMessage(EatMessage);
|
||||
|
||||
StartInfluence(from, FoodID, Duration, Cooldown);
|
||||
Consume();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1070772); // You must wait a few seconds before you can use that item.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Consumables/BasePoisonPotion.cs
Normal file
46
Scripts/Items/Consumables/BasePoisonPotion.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BasePoisonPotion : BasePotion
|
||||
{
|
||||
public BasePoisonPotion(PotionEffect effect)
|
||||
: base(0xF0A, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BasePoisonPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract Poison Poison { get; }
|
||||
public abstract double MinPoisoningSkill { get; }
|
||||
public abstract double MaxPoisoningSkill { get; }
|
||||
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 void DoPoison(Mobile from)
|
||||
{
|
||||
from.ApplyPoison(from, this.Poison);
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
DoPoison(from);
|
||||
PlayDrinkEffect(from);
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
319
Scripts/Items/Consumables/BasePotion.cs
Normal file
319
Scripts/Items/Consumables/BasePotion.cs
Normal file
@@ -0,0 +1,319 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum PotionEffect
|
||||
{
|
||||
Nightsight,
|
||||
CureLesser,
|
||||
Cure,
|
||||
CureGreater,
|
||||
Agility,
|
||||
AgilityGreater,
|
||||
Strength,
|
||||
StrengthGreater,
|
||||
PoisonLesser,
|
||||
Poison,
|
||||
PoisonGreater,
|
||||
PoisonDeadly,
|
||||
Refresh,
|
||||
RefreshTotal,
|
||||
HealLesser,
|
||||
Heal,
|
||||
HealGreater,
|
||||
ExplosionLesser,
|
||||
Explosion,
|
||||
ExplosionGreater,
|
||||
Conflagration,
|
||||
ConflagrationGreater,
|
||||
MaskOfDeath, // Mask of Death is not available in OSI but does exist in cliloc files
|
||||
MaskOfDeathGreater, // included in enumeration for compatability if later enabled by OSI
|
||||
ConfusionBlast,
|
||||
ConfusionBlastGreater,
|
||||
Invisibility,
|
||||
Parasitic,
|
||||
Darkglow,
|
||||
ExplodingTarPotion,
|
||||
#region TOL Publish 93
|
||||
Barrab,
|
||||
Jukari,
|
||||
Kurak,
|
||||
Barako,
|
||||
Urali,
|
||||
Sakkhra,
|
||||
#endregion,
|
||||
Shatter,
|
||||
FearEssence
|
||||
}
|
||||
|
||||
public abstract class BasePotion : Item, ICraftable, ICommodity
|
||||
{
|
||||
private PotionEffect m_PotionEffect;
|
||||
|
||||
public PotionEffect PotionEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_PotionEffect;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_PotionEffect = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
TextDefinition ICommodity.Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.LabelNumber;
|
||||
}
|
||||
}
|
||||
bool ICommodity.IsDeedable
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Core.ML);
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041314 + (int)this.m_PotionEffect;
|
||||
}
|
||||
}
|
||||
|
||||
public BasePotion(int itemID, PotionEffect effect)
|
||||
: base(itemID)
|
||||
{
|
||||
this.m_PotionEffect = effect;
|
||||
|
||||
this.Stackable = Core.ML;
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public BasePotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool RequireFreeHand
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasFreeHand(Mobile m)
|
||||
{
|
||||
Item handOne = m.FindItemOnLayer(Layer.OneHanded);
|
||||
Item handTwo = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (handTwo is BaseWeapon)
|
||||
handOne = handTwo;
|
||||
if (handTwo is BaseWeapon)
|
||||
{
|
||||
BaseWeapon wep = (BaseWeapon)handTwo;
|
||||
|
||||
if (wep.Attributes.BalancedWeapon > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return (handOne == null || handTwo == null);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!this.Movable)
|
||||
return;
|
||||
|
||||
if (!from.BeginAction(this.GetType()))
|
||||
{
|
||||
from.SendLocalizedMessage(500119); // You must wait to perform another action.
|
||||
return;
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(500), () => from.EndAction(this.GetType()));
|
||||
|
||||
if (from.InRange(this.GetWorldLocation(), 1))
|
||||
{
|
||||
if (!this.RequireFreeHand || HasFreeHand(from))
|
||||
{
|
||||
if (this is BaseExplosionPotion && this.Amount > 1)
|
||||
{
|
||||
BasePotion pot = (BasePotion)Activator.CreateInstance(this.GetType());
|
||||
|
||||
if (pot != null)
|
||||
{
|
||||
this.Amount--;
|
||||
|
||||
if (from.Backpack != null && !from.Backpack.Deleted)
|
||||
{
|
||||
from.Backpack.DropItem(pot);
|
||||
}
|
||||
else
|
||||
{
|
||||
pot.MoveToWorld(from.Location, from.Map);
|
||||
}
|
||||
pot.Drink(from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Drink(from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502138); // That is too far away for you to use
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)this.m_PotionEffect);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
this.m_PotionEffect = (PotionEffect)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version == 0)
|
||||
this.Stackable = Core.ML;
|
||||
}
|
||||
|
||||
public abstract void Drink(Mobile from);
|
||||
|
||||
public static void PlayDrinkEffect(Mobile m)
|
||||
{
|
||||
m.RevealingAction();
|
||||
m.PlaySound(0x2D6);
|
||||
m.AddToBackpack(new Bottle());
|
||||
|
||||
if (m.Body.IsHuman && !m.Mounted)
|
||||
{
|
||||
if (Core.SA)
|
||||
{
|
||||
m.Animate(AnimationType.Eat, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.Animate(34, 5, 1, true, false, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int EnhancePotions(Mobile m)
|
||||
{
|
||||
int EP = AosAttributes.GetValue(m, AosAttribute.EnhancePotions);
|
||||
int skillBonus = m.Skills.Alchemy.Fixed / 330 * 10;
|
||||
|
||||
if (Core.ML && EP > 50 && m.IsPlayer())
|
||||
EP = 50;
|
||||
|
||||
return (EP + skillBonus);
|
||||
}
|
||||
|
||||
public static TimeSpan Scale(Mobile m, TimeSpan v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
return v;
|
||||
|
||||
double scalar = 1.0 + (0.01 * EnhancePotions(m));
|
||||
|
||||
return TimeSpan.FromSeconds(v.TotalSeconds * scalar);
|
||||
}
|
||||
|
||||
public static double Scale(Mobile m, double v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
return v;
|
||||
|
||||
double scalar = 1.0 + (0.01 * EnhancePotions(m));
|
||||
|
||||
return v * scalar;
|
||||
}
|
||||
|
||||
public static int Scale(Mobile m, int v)
|
||||
{
|
||||
if (!Core.AOS)
|
||||
return v;
|
||||
|
||||
return AOS.Scale(v, 100 + EnhancePotions(m));
|
||||
}
|
||||
|
||||
public override bool WillStack(Mobile from, Item dropped)
|
||||
{
|
||||
return dropped is BasePotion && ((BasePotion)dropped).m_PotionEffect == this.m_PotionEffect && base.WillStack(from, dropped);
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
if (craftSystem is DefAlchemy)
|
||||
{
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if (pack != null)
|
||||
{
|
||||
if ((int)this.PotionEffect >= (int)PotionEffect.Invisibility)
|
||||
return 1;
|
||||
|
||||
List<PotionKeg> kegs = pack.FindItemsByType<PotionKeg>();
|
||||
|
||||
for (int i = 0; i < kegs.Count; ++i)
|
||||
{
|
||||
PotionKeg keg = kegs[i];
|
||||
|
||||
if (keg == null)
|
||||
continue;
|
||||
|
||||
if (keg.Held <= 0 || keg.Held >= 100)
|
||||
continue;
|
||||
|
||||
if (keg.Type != this.PotionEffect)
|
||||
continue;
|
||||
|
||||
++keg.Held;
|
||||
|
||||
this.Consume();
|
||||
from.AddToBackpack(new Bottle());
|
||||
|
||||
return -1; // signal placed in keg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Consumables/BaseReagent.cs
Normal file
45
Scripts/Items/Consumables/BaseReagent.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseReagent : Item
|
||||
{
|
||||
public BaseReagent(int itemID)
|
||||
: this(itemID, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseReagent(int itemID, int amount)
|
||||
: base(itemID)
|
||||
{
|
||||
this.Stackable = true;
|
||||
this.Amount = amount;
|
||||
}
|
||||
|
||||
public BaseReagent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0.1;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Consumables/BaseRefreshPotion.cs
Normal file
47
Scripts/Items/Consumables/BaseRefreshPotion.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseRefreshPotion : BasePotion
|
||||
{
|
||||
public BaseRefreshPotion(PotionEffect effect)
|
||||
: base(0xF0B, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseRefreshPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract double Refresh { get; }
|
||||
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 Drink(Mobile from)
|
||||
{
|
||||
if (from.Stam < from.StamMax)
|
||||
{
|
||||
from.Stam += Scale(from, (int)(this.Refresh * from.StamMax));
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
Consume();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("You decide against drinking this potion, as you are already at full stamina.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
66
Scripts/Items/Consumables/BaseRewardTitleDeed.cs
Normal file
66
Scripts/Items/Consumables/BaseRewardTitleDeed.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseRewardTitleDeed : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1155604; } } // A Deed for a Reward Title
|
||||
public abstract TextDefinition Title { get; }
|
||||
|
||||
public BaseRewardTitleDeed()
|
||||
: base(5360)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (Title != null && (Title.String != null || Title.Number > 0))
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if (pm != null)
|
||||
{
|
||||
if ((Title.Number > 0 && pm.AddRewardTitle(Title.Number)) ||
|
||||
Title.String != null && pm.AddRewardTitle(Title.String))
|
||||
{
|
||||
|
||||
pm.SendLocalizedMessage(1155605, Title.ToString()); //Thou hath been bestowed the title ~1_TITLE~!
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
pm.SendLocalizedMessage(1073626); // You already have that title!
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1114057, Title.ToString()); // ~1_NOTHING~
|
||||
}
|
||||
|
||||
public BaseRewardTitleDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
109
Scripts/Items/Consumables/BaseRewardTitleScroll.cs
Normal file
109
Scripts/Items/Consumables/BaseRewardTitleScroll.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseRewardTitleToken : Item
|
||||
{
|
||||
public List<Tuple<TextDefinition, Type>> Titles { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1156719; } } // Reward Title Scroll
|
||||
|
||||
public BaseRewardTitleToken(int id) : base(id)
|
||||
{
|
||||
Titles = new List<Tuple<TextDefinition, Type>>();
|
||||
InitializeTitles();
|
||||
}
|
||||
|
||||
public abstract void InitializeTitles();
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if(from is PlayerMobile && IsChildOf(from.Backpack) && Titles != null && Titles.Count > 0)
|
||||
{
|
||||
from.SendGump(new InternalGump(from as PlayerMobile, this));
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public BaseRewardTitleToken Token { get; set; }
|
||||
public PlayerMobile User { get; set; }
|
||||
|
||||
public InternalGump(PlayerMobile pm, BaseRewardTitleToken token) : base(50, 50)
|
||||
{
|
||||
Token = token;
|
||||
User = pm;
|
||||
|
||||
AddGumpLayout();
|
||||
}
|
||||
|
||||
public void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 300, 350, 9270);
|
||||
AddHtmlLocalized(0, 25, 300, 16, 1154645, "#1156718", 0xFFFF, false, false); // Select a reward title deed:
|
||||
|
||||
int i = 0;
|
||||
Token.Titles.ForEach(tuple =>
|
||||
{
|
||||
AddButton(23, 68 + (i * 20), 1209, 1210, i + 1, GumpButtonType.Reply, 0);
|
||||
|
||||
var textdef = tuple.Item1;
|
||||
|
||||
if (textdef.Number > 0)
|
||||
AddHtmlLocalized(50, 65 + (i * 20), 240, 20, textdef.Number, 0xFFFF, false, false);
|
||||
else if (!String.IsNullOrEmpty(textdef.String))
|
||||
AddHtml(50, 65 + (i * 20), 240, 20, String.Format("<basefond color=#FFFFFF>{0}", textdef.String), false, false);
|
||||
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (Token != null && !Token.Deleted)
|
||||
{
|
||||
int id = info.ButtonID - 1;
|
||||
|
||||
if (id >= 0 && id < Token.Titles.Count)
|
||||
{
|
||||
var tuple = Token.Titles[id];
|
||||
|
||||
Item item = Loot.Construct(tuple.Item2);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
User.AddToBackpack(item);
|
||||
Token.Delete();
|
||||
|
||||
//TODO: Message?
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseRewardTitleToken(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Titles = new List<Tuple<TextDefinition, Type>>();
|
||||
InitializeTitles();
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Scripts/Items/Consumables/BaseStrengthPotion.cs
Normal file
60
Scripts/Items/Consumables/BaseStrengthPotion.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseStrengthPotion : BasePotion
|
||||
{
|
||||
public BaseStrengthPotion(PotionEffect effect)
|
||||
: base(0xF09, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseStrengthPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract int StrOffset { get; }
|
||||
public abstract TimeSpan Duration { get; }
|
||||
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 bool DoStrength(Mobile from)
|
||||
{
|
||||
// TODO: Verify scaled; is it offset, duration, or both?
|
||||
int scale = Scale(from, this.StrOffset);
|
||||
if (Spells.SpellHelper.AddStatOffset(from, StatType.Str, scale, this.Duration))
|
||||
{
|
||||
from.FixedEffect(0x375A, 10, 15);
|
||||
from.PlaySound(0x1E7);
|
||||
|
||||
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.Strength, 1075845, this.Duration, from, scale.ToString()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (DoStrength(from))
|
||||
{
|
||||
PlayDrinkEffect(from);
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
148
Scripts/Items/Consumables/BaseWaterContainer.cs
Normal file
148
Scripts/Items/Consumables/BaseWaterContainer.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseWaterContainer : Container, IHasQuantity
|
||||
{
|
||||
private int m_Quantity;
|
||||
public BaseWaterContainer(int Item_Id, bool filled)
|
||||
: base(Item_Id)
|
||||
{
|
||||
Quantity = (filled) ? MaxQuantity : 0;
|
||||
}
|
||||
|
||||
public BaseWaterContainer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract int voidItem_ID { get; }
|
||||
public abstract int fullItem_ID { get; }
|
||||
public abstract int MaxQuantity { get; }
|
||||
public override int DefaultGumpID
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0x3e;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_Quantity <= 0);
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual bool IsFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return (m_Quantity >= MaxQuantity);
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual int Quantity
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Quantity;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != m_Quantity)
|
||||
{
|
||||
m_Quantity = (value < 1) ? 0 : (value > MaxQuantity) ? MaxQuantity : value;
|
||||
|
||||
Movable = (!IsLockedDown) ? IsEmpty : false;
|
||||
|
||||
ItemID = (IsEmpty) ? voidItem_ID : fullItem_ID;
|
||||
|
||||
if (!IsEmpty)
|
||||
{
|
||||
IEntity rootParent = RootParentEntity;
|
||||
|
||||
if (rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal)
|
||||
MoveToWorld(rootParent.Location, rootParent.Map);
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsEmpty)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
if (IsEmpty)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Name == null)
|
||||
LabelTo(from, LabelNumber);
|
||||
else
|
||||
LabelTo(from, Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAosSingleClick(Mobile from)
|
||||
{
|
||||
if (IsEmpty)
|
||||
{
|
||||
base.OnAosSingleClick(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Name == null)
|
||||
LabelTo(from, LabelNumber);
|
||||
else
|
||||
LabelTo(from, Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (IsEmpty)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
if (!IsEmpty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.OnDragDropInto(from, item, p);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
writer.Write((int)m_Quantity);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Quantity = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Consumables/Bedroll.cs
Normal file
36
Scripts/Items/Consumables/Bedroll.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegBedRoll: Bedroll
|
||||
{
|
||||
[Constructable]
|
||||
public BegBedRoll()
|
||||
{
|
||||
}
|
||||
|
||||
public BegBedRoll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
1688
Scripts/Items/Consumables/Beverage.cs
Normal file
1688
Scripts/Items/Consumables/Beverage.cs
Normal file
File diff suppressed because it is too large
Load Diff
63
Scripts/Items/Consumables/BeverageEmpty.cs
Normal file
63
Scripts/Items/Consumables/BeverageEmpty.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x1f81, 0x1f82, 0x1f83, 0x1f84)]
|
||||
public class Glass : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Glass()
|
||||
: base(0x1f81)
|
||||
{
|
||||
this.Weight = 0.1;
|
||||
}
|
||||
|
||||
public Glass(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 class GlassBottle : Item
|
||||
{
|
||||
[Constructable]
|
||||
public GlassBottle()
|
||||
: base(0xe2b)
|
||||
{
|
||||
this.Weight = 0.3;
|
||||
}
|
||||
|
||||
public GlassBottle(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/BladeSpiritsScroll.cs
Normal file
38
Scripts/Items/Consumables/BladeSpiritsScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BladeSpiritsScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BladeSpiritsScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BladeSpiritsScroll(int amount)
|
||||
: base(32, 0x1F4D, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public BladeSpiritsScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/BlessScroll.cs
Normal file
38
Scripts/Items/Consumables/BlessScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlessScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BlessScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BlessScroll(int amount)
|
||||
: base(16, 0x1F3D, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public BlessScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/BloodOathScroll.cs
Normal file
38
Scripts/Items/Consumables/BloodOathScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BloodOathScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BloodOathScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BloodOathScroll(int amount)
|
||||
: base(101, 0x2261, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public BloodOathScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
260
Scripts/Items/Consumables/Bola.cs
Normal file
260
Scripts/Items/Consumables/Bola.cs
Normal file
@@ -0,0 +1,260 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using Server.Spells.Ninjitsu;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bola : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Bola()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bola(int amount)
|
||||
: base(0x26AC)
|
||||
{
|
||||
Weight = 4.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Bola(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
|
||||
}
|
||||
else if (!from.CanBeginAction(typeof(Bola)))
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // // You have to wait a few moments before you can use another bola!
|
||||
}
|
||||
else if (from.Target is BolaTarget)
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1049631, from.NetState); // This bola is already being used.
|
||||
}
|
||||
else if (from.Mounted)
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
|
||||
}
|
||||
else if (AnimalForm.UnderTransformation(from))
|
||||
{
|
||||
this.PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
|
||||
}
|
||||
else
|
||||
{
|
||||
EtherealMount.StopMounting(from);
|
||||
|
||||
if (Core.AOS)
|
||||
{
|
||||
Item one = from.FindItemOnLayer(Layer.OneHanded);
|
||||
Item two = from.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (one != null)
|
||||
from.AddToBackpack(one);
|
||||
|
||||
if (two != null)
|
||||
from.AddToBackpack(two);
|
||||
}
|
||||
|
||||
from.Target = new BolaTarget(this);
|
||||
from.LocalOverheadMessage(MessageType.Emote, 201, 1049632); // * You begin to swing the bola...*
|
||||
from.NonlocalOverheadMessage(MessageType.Emote, 201, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private static void ReleaseBolaLock(object state)
|
||||
{
|
||||
((Mobile)state).EndAction(typeof(Bola));
|
||||
}
|
||||
|
||||
private static void FinishThrow(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
Mobile from = (Mobile)states[0];
|
||||
Mobile to = (Mobile)states[1];
|
||||
Item bola = (Item)states[2];
|
||||
|
||||
if (!from.Alive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!bola.IsChildOf(from.Backpack))
|
||||
{
|
||||
bola.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
|
||||
}
|
||||
else if (!from.InRange(to, 15) || !from.InLOS(to) || !from.CanSee(to))
|
||||
{
|
||||
from.PrivateOverheadMessage(MessageType.Regular, 946, 1042060, from.NetState); // You cannot see that target!
|
||||
}
|
||||
else if (!to.Mounted && !to.Flying && (!Core.ML || !AnimalForm.UnderTransformation(to)))
|
||||
{
|
||||
to.PrivateOverheadMessage(MessageType.Regular, 946, 1049628, from.NetState); // You have no reason to throw a bola at that.
|
||||
}
|
||||
else
|
||||
{
|
||||
bola.Consume();
|
||||
|
||||
from.Direction = from.GetDirectionTo(to);
|
||||
from.Animate(AnimationType.Attack, 4);
|
||||
from.MovingEffect(to, 0x26AC, 10, 0, false, false);
|
||||
|
||||
new Bola().MoveToWorld(to.Location, to.Map);
|
||||
|
||||
if (to is Neira || to is ChaosDragoon || to is ChaosDragoonElite)
|
||||
{
|
||||
to.PrivateOverheadMessage(MessageType.Regular, 946, 1042047, from.NetState); // You fail to knock the rider from its mount.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CheckHit(to, from))
|
||||
{
|
||||
to.Damage(Utility.RandomMinMax(10, 20), from);
|
||||
|
||||
if (from.Flying)
|
||||
to.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1113590, from.Name); // You have been grounded by ~1_NAME~!
|
||||
else
|
||||
to.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1049623, from.Name); // You have been knocked off of your mount by ~1_NAME~!
|
||||
|
||||
BaseMount.Dismount(to);
|
||||
|
||||
BaseMount.SetMountPrevention(to, BlockMountType.Dazed, TimeSpan.FromSeconds(10.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckHit(Mobile to, Mobile from)
|
||||
{
|
||||
if (!Core.TOL)
|
||||
return true;
|
||||
|
||||
double toChance = Math.Min(45 + BaseArmor.GetRefinedDefenseChance(to),
|
||||
AosAttributes.GetValue(to, AosAttribute.DefendChance)) + 1;
|
||||
double fromChance = AosAttributes.GetValue(from, AosAttribute.AttackChance) + 1;
|
||||
|
||||
double hitChance = toChance / (fromChance * 2);
|
||||
|
||||
if (Utility.RandomDouble() < hitChance)
|
||||
{
|
||||
if (BaseWeapon.CheckParry(to))
|
||||
{
|
||||
to.FixedEffect(0x37B9, 10, 16);
|
||||
to.Animate(AnimationType.Parry, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
to.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, false, "*miss*");
|
||||
return false;
|
||||
}
|
||||
|
||||
private class BolaTarget : Target
|
||||
{
|
||||
private readonly Bola m_Bola;
|
||||
public BolaTarget(Bola bola)
|
||||
: base(20, false, TargetFlags.Harmful)
|
||||
{
|
||||
m_Bola = bola;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (m_Bola.Deleted)
|
||||
return;
|
||||
|
||||
if ((obj is Item))
|
||||
{
|
||||
((Item)obj).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049628, from.NetState); // You have no reason to throw a bola at that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (obj is Mobile)
|
||||
{
|
||||
Mobile to = (Mobile)obj;
|
||||
|
||||
if (!m_Bola.IsChildOf(from.Backpack))
|
||||
{
|
||||
m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
|
||||
}
|
||||
else if (from.Mounted)
|
||||
{
|
||||
m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
|
||||
}
|
||||
else if (from == to)
|
||||
{
|
||||
from.SendLocalizedMessage(1005576); // You can't throw this at yourself.
|
||||
}
|
||||
else if (AnimalForm.UnderTransformation(from))
|
||||
{
|
||||
from.PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
|
||||
}
|
||||
else if (!to.Mounted && !to.Flying && (!Core.ML || !AnimalForm.UnderTransformation(to)))
|
||||
{
|
||||
to.PrivateOverheadMessage(MessageType.Regular, 946, 1049628, from.NetState); // You have no reason to throw a bola at that.
|
||||
}
|
||||
else if (!from.CanBeHarmful(to))
|
||||
{
|
||||
}
|
||||
else if (from.BeginAction(typeof(Bola)))
|
||||
{
|
||||
from.RevealingAction();
|
||||
|
||||
EtherealMount.StopMounting(from);
|
||||
|
||||
Item one = from.FindItemOnLayer(Layer.OneHanded);
|
||||
Item two = from.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (one != null)
|
||||
from.AddToBackpack(one);
|
||||
|
||||
if (two != null)
|
||||
from.AddToBackpack(two);
|
||||
|
||||
from.DoHarmful(to);
|
||||
|
||||
BaseMount.SetMountPrevention(from, BlockMountType.BolaRecovery, TimeSpan.FromSeconds(10.0));
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseBolaLock), from);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(FinishThrow), new object[] { from, to, m_Bola });
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Bola.PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // You have to wait a few moments before you can use another bola!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/BombardScroll.cs
Normal file
38
Scripts/Items/Consumables/BombardScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BombardScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public BombardScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BombardScroll(int amount)
|
||||
: base(688, 0x2DA9, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public BombardScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
636
Scripts/Items/Consumables/Bowls.cs
Normal file
636
Scripts/Items/Consumables/Bowls.cs
Normal file
@@ -0,0 +1,636 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EmptyWoodenBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyWoodenBowl()
|
||||
: base(0x15F8)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EmptyWoodenBowl(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 class EmptyPewterBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyPewterBowl()
|
||||
: base(0x15FD)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EmptyPewterBowl(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 class WoodenBowlOfCarrots : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfCarrots()
|
||||
: base(0x15F9)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfCarrots(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenBowl());
|
||||
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 class WoodenBowlOfCorn : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfCorn()
|
||||
: base(0x15FA)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfCorn(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenBowl());
|
||||
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 class WoodenBowlOfLettuce : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfLettuce()
|
||||
: base(0x15FB)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfLettuce(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenBowl());
|
||||
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 class WoodenBowlOfPeas : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfPeas()
|
||||
: base(0x15FC)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfPeas(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenBowl());
|
||||
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 class PewterBowlOfCarrots : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfCarrots()
|
||||
: base(0x15FE)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public PewterBowlOfCarrots(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyPewterBowl());
|
||||
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 class PewterBowlOfCorn : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfCorn()
|
||||
: base(0x15FF)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public PewterBowlOfCorn(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyPewterBowl());
|
||||
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 class PewterBowlOfLettuce : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfLettuce()
|
||||
: base(0x1600)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public PewterBowlOfLettuce(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyPewterBowl());
|
||||
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 class PewterBowlOfPeas : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfPeas()
|
||||
: base(0x1601)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public PewterBowlOfPeas(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyPewterBowl());
|
||||
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 class PewterBowlOfPotatos : Food
|
||||
{
|
||||
[Constructable]
|
||||
public PewterBowlOfPotatos()
|
||||
: base(0x1602)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 1.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public PewterBowlOfPotatos(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyPewterBowl());
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
[TypeAlias("Server.Items.EmptyLargeWoodenBowl")]
|
||||
public class EmptyWoodenTub : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyWoodenTub()
|
||||
: base(0x1605)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public EmptyWoodenTub(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();
|
||||
}
|
||||
}
|
||||
|
||||
[TypeAlias("Server.Items.EmptyLargePewterBowl")]
|
||||
public class EmptyPewterTub : Item
|
||||
{
|
||||
[Constructable]
|
||||
public EmptyPewterTub()
|
||||
: base(0x1603)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public EmptyPewterTub(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 class BowlOfRotwormStew : Food
|
||||
{
|
||||
public override int LabelNumber { get { return 1031706; } } // bowl of rotworm stew
|
||||
|
||||
[Constructable]
|
||||
public BowlOfRotwormStew()
|
||||
: base(0x2DBA)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 1;
|
||||
}
|
||||
|
||||
public BowlOfRotwormStew(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 class WoodenBowlOfStew : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfStew()
|
||||
: base(0x1604)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfStew(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenTub());
|
||||
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 class WoodenBowlOfTomatoSoup : Food
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowlOfTomatoSoup()
|
||||
: base(0x1606)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 2;
|
||||
}
|
||||
|
||||
public WoodenBowlOfTomatoSoup(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!base.Eat(from))
|
||||
return false;
|
||||
|
||||
from.AddToBackpack(new EmptyWoodenTub());
|
||||
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 class BowlOfBlackrockStew : Food
|
||||
{
|
||||
public override int LabelNumber { get { return 1115752; } } // blackrock stew
|
||||
|
||||
[Constructable]
|
||||
public BowlOfBlackrockStew()
|
||||
: base(0x2DBA)
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 2.0;
|
||||
FillFactor = 1;
|
||||
|
||||
Hue = 1954;
|
||||
}
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(1115751); // You don't want to eat this, it smells horrible. It looks like food for some kind of demon.
|
||||
return false;
|
||||
}
|
||||
|
||||
public BowlOfBlackrockStew(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
59
Scripts/Items/Consumables/Bucket.cs
Normal file
59
Scripts/Items/Consumables/Bucket.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
namespace Server.Items
|
||||
{
|
||||
class Bucket : BaseWaterContainer
|
||||
{
|
||||
private static readonly int vItemID = 0x14e0;
|
||||
private static readonly int fItemID = 0x2004;
|
||||
[Constructable]
|
||||
public Bucket()
|
||||
: this(false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bucket(bool filled)
|
||||
: base((filled) ? Bucket.fItemID : Bucket.vItemID, filled)
|
||||
{
|
||||
}
|
||||
|
||||
public Bucket(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int voidItem_ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return vItemID;
|
||||
}
|
||||
}
|
||||
public override int fullItem_ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return fItemID;
|
||||
}
|
||||
}
|
||||
public override int MaxQuantity
|
||||
{
|
||||
get
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ChainLightningScroll.cs
Normal file
38
Scripts/Items/Consumables/ChainLightningScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ChainLightningScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ChainLightningScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ChainLightningScroll(int amount)
|
||||
: base(48, 0x1F5D, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ChainLightningScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Consumables/Cheese.cs
Normal file
36
Scripts/Items/Consumables/Cheese.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegCheeseWedge : CheeseWedge
|
||||
{
|
||||
[Constructable]
|
||||
public BegCheeseWedge()
|
||||
{
|
||||
}
|
||||
|
||||
public BegCheeseWedge(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
392
Scripts/Items/Consumables/Chocolatiering.cs
Normal file
392
Scripts/Items/Consumables/Chocolatiering.cs
Normal file
@@ -0,0 +1,392 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CocoaLiquor : Item, IQuality
|
||||
{
|
||||
public override int LabelNumber { get { return 1080007; } } // Cocoa liquor
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
public virtual bool PlayerConstructed { get { return true; } }
|
||||
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
[Constructable]
|
||||
public CocoaLiquor()
|
||||
: base(0x103F)
|
||||
{
|
||||
Hue = 1130;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public CocoaLiquor(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SackOfSugar : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1080003; } } // Sack of sugar
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public SackOfSugar()
|
||||
: this(1)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public SackOfSugar(int amount)
|
||||
: base(0x1039)
|
||||
{
|
||||
Hue = 1121;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public SackOfSugar(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CocoaButter : Item, IQuality
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber { get { return 1080005; } } // Cocoa butter
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public CocoaButter()
|
||||
: base(0x1044)
|
||||
{
|
||||
Hue = 1111;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public CocoaButter(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version > 0)
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SweetCocoaButter : Item, IQuality
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber { get { return 1156401; } } // Sweet Cocoa butter
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public SweetCocoaButter()
|
||||
: base(0x103D)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public SweetCocoaButter(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class Vanilla : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1080009; } } // Vanilla
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public Vanilla()
|
||||
: this(1)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public Vanilla(int amount)
|
||||
: base(0xE2A)
|
||||
{
|
||||
Hue = 1122;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Vanilla(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CocoaPulp : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1080530; } } // cocoa pulp
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public CocoaPulp()
|
||||
: this(1)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public CocoaPulp(int amount)
|
||||
: base(0xF7C)
|
||||
{
|
||||
Hue = 537;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public CocoaPulp(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DarkChocolate : BaseSweet
|
||||
{
|
||||
public override int LabelNumber { get { return 1079994; } } // Dark chocolate
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public DarkChocolate()
|
||||
: base(0xF10)
|
||||
{
|
||||
Hue = 1125;
|
||||
LootType = LootType.Regular;
|
||||
}
|
||||
|
||||
public DarkChocolate(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class MilkChocolate : BaseSweet
|
||||
{
|
||||
public override int LabelNumber { get { return 1079995; } } // Milk chocolate
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public MilkChocolate()
|
||||
: base(0xF18)
|
||||
{
|
||||
Hue = 1121;
|
||||
LootType = LootType.Regular;
|
||||
}
|
||||
|
||||
public MilkChocolate(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class WhiteChocolate : BaseSweet
|
||||
{
|
||||
public override int LabelNumber { get { return 1079996; } } // White chocolate
|
||||
public override double DefaultWeight { get { return 1.0; } }
|
||||
|
||||
[Constructable]
|
||||
public WhiteChocolate()
|
||||
: base(0xF11)
|
||||
{
|
||||
Hue = 1150;
|
||||
LootType = LootType.Regular;
|
||||
}
|
||||
|
||||
public WhiteChocolate(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CleansingWindsScroll.cs
Normal file
38
Scripts/Items/Consumables/CleansingWindsScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CleansingWindsScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CleansingWindsScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CleansingWindsScroll(int amount)
|
||||
: base(687, 0x2DA8, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CleansingWindsScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
113
Scripts/Items/Consumables/ClothingBlessDeed.cs
Normal file
113
Scripts/Items/Consumables/ClothingBlessDeed.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ClothingBlessTarget : Target // Create our targeting class (which we derive from the base target class)
|
||||
{
|
||||
private readonly ClothingBlessDeed m_Deed;
|
||||
public ClothingBlessTarget(ClothingBlessDeed deed)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
this.m_Deed = deed;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature
|
||||
{
|
||||
if (this.m_Deed.Deleted || this.m_Deed.RootParent != from)
|
||||
return;
|
||||
|
||||
if (target is BaseClothing)
|
||||
{
|
||||
BaseClothing item = (BaseClothing)target;
|
||||
|
||||
if (item is IArcaneEquip)
|
||||
{
|
||||
IArcaneEquip eq = (IArcaneEquip)item;
|
||||
if (eq.IsArcane)
|
||||
{
|
||||
from.SendLocalizedMessage(1005019); // This bless deed is for Clothes only.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.Insured)) // Check if its already newbied (blessed)
|
||||
{
|
||||
from.SendLocalizedMessage(1045113); // That item is already blessed
|
||||
}
|
||||
else if (item.LootType != LootType.Regular || (Siege.SiegeShard && Server.SkillHandlers.Imbuing.GetTotalMods(item) > 0) || item.NegativeAttributes.Prized > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1045114); // You can not bless that item
|
||||
}
|
||||
else if (!item.CanBeBlessed || item.RootParent != from)
|
||||
{
|
||||
from.SendLocalizedMessage(500509); // You cannot bless that object
|
||||
}
|
||||
else
|
||||
{
|
||||
item.LootType = LootType.Blessed;
|
||||
from.SendLocalizedMessage(1010026); // You bless the item....
|
||||
|
||||
this.m_Deed.Delete(); // Delete the bless deed
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500509); // You cannot bless that object
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ClothingBlessDeed : Item // Create the item class which is derived from the base item class
|
||||
{
|
||||
public override int LabelNumber { get { return 1041008; } } // A clothing bless deed
|
||||
|
||||
[Constructable]
|
||||
public ClothingBlessDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public ClothingBlessDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool DisplayLootType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.AOS;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
this.LootType = LootType.Blessed;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
|
||||
{
|
||||
if (!this.IsChildOf(from.Backpack)) // Make sure its in their pack
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005018); // What would you like to bless? (Clothes Only)
|
||||
from.Target = new ClothingBlessTarget(this); // Call our target
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ClumsyScroll.cs
Normal file
38
Scripts/Items/Consumables/ClumsyScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ClumsyScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ClumsyScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ClumsyScroll(int amount)
|
||||
: base(0, 0x1F2E, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ClumsyScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
106
Scripts/Items/Consumables/CommissionPlayerVendorDeed.cs
Normal file
106
Scripts/Items/Consumables/CommissionPlayerVendorDeed.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CommissionContractOfEmployment : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159156; } } // A Commission Contract of Employment
|
||||
|
||||
[Constructable]
|
||||
public CommissionContractOfEmployment()
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public CommissionContractOfEmployment(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)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (from.AccessLevel >= AccessLevel.GameMaster)
|
||||
{
|
||||
from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish.
|
||||
|
||||
Mobile v = new CommissionPlayerVendor(from, BaseHouse.FindHouseAt(from));
|
||||
|
||||
v.Direction = from.Direction & Direction.Mask;
|
||||
v.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
v.SayTo(from, 503246); // Ah! it feels good to be working again.
|
||||
|
||||
EventSink.InvokePlacePlayerVendor(new PlacePlayerVendorEventArgs(from, v));
|
||||
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
from.SendLocalizedMessage(503240); // Vendors can only be placed in houses.
|
||||
}
|
||||
else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
|
||||
{
|
||||
from.SendLocalizedMessage(503242); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
|
||||
}
|
||||
else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1062423); // Only the house owner can directly place vendors. Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
|
||||
}
|
||||
else if (!house.Public || !house.CanPlaceNewVendor())
|
||||
{
|
||||
from.SendLocalizedMessage(503241); // You cannot place this vendor or barkeep. Make sure the house is public and has sufficient storage available.
|
||||
}
|
||||
else
|
||||
{
|
||||
bool vendor, contract;
|
||||
BaseHouse.IsThereVendor(from.Location, from.Map, out vendor, out contract);
|
||||
|
||||
if (vendor)
|
||||
{
|
||||
from.SendLocalizedMessage(1062677); // You cannot place a vendor or barkeep at this location.
|
||||
}
|
||||
else if (contract)
|
||||
{
|
||||
from.SendLocalizedMessage(1062678); // You cannot place a vendor or barkeep on top of a rental contract!
|
||||
}
|
||||
else
|
||||
{
|
||||
Mobile v = new CommissionPlayerVendor(from, house);
|
||||
|
||||
v.Direction = from.Direction & Direction.Mask;
|
||||
v.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
v.SayTo(from, 503246); // Ah! it feels good to be working again.
|
||||
|
||||
EventSink.InvokePlacePlayerVendor(new PlacePlayerVendorEventArgs(from, v));
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
352
Scripts/Items/Consumables/CommodityDeed.cs
Normal file
352
Scripts/Items/Consumables/CommodityDeed.cs
Normal file
@@ -0,0 +1,352 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface ICommodity /* added IsDeedable prop so expansion-based deedables can determine true/false */
|
||||
{
|
||||
TextDefinition Description { get; }
|
||||
bool IsDeedable { get; }
|
||||
}
|
||||
|
||||
public static class CommodityDeedExtensions
|
||||
{
|
||||
public static int GetAmount(this Container cont, Type type, bool recurse, bool includeDeeds)
|
||||
{
|
||||
int amount = cont.GetAmount(type, recurse);
|
||||
|
||||
var deeds = cont.FindItemsByType(typeof(CommodityDeed), recurse);
|
||||
foreach(CommodityDeed deed in deeds)
|
||||
{
|
||||
if (deed.Commodity == null)
|
||||
continue;
|
||||
if (deed.Commodity.GetType() == type)
|
||||
amount += deed.Commodity.Amount;
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public static int GetAmount(this Container cont, Type[] types, bool recurse, bool includeDeeds)
|
||||
{
|
||||
int amount = cont.GetAmount(types, recurse);
|
||||
|
||||
var deeds = cont.FindItemsByType(typeof(CommodityDeed), recurse);
|
||||
foreach (CommodityDeed deed in deeds)
|
||||
{
|
||||
if (deed.Commodity == null)
|
||||
continue;
|
||||
foreach (Type type in types)
|
||||
{
|
||||
if (deed.Commodity.GetType() == type)
|
||||
{
|
||||
amount += deed.Commodity.Amount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public static int ConsumeTotal(this Container cont, Type type, int amount, bool recurse, bool includeDeeds)
|
||||
{
|
||||
int left = amount;
|
||||
|
||||
var items = cont.FindItemsByType(type, recurse);
|
||||
foreach(Item item in items)
|
||||
{
|
||||
if(item.Amount <= left)
|
||||
{
|
||||
left -= item.Amount;
|
||||
item.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Amount -= left;
|
||||
left = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!includeDeeds)
|
||||
return amount - left;
|
||||
|
||||
var deeds = cont.FindItemsByType(typeof(CommodityDeed), recurse);
|
||||
foreach(CommodityDeed deed in deeds)
|
||||
{
|
||||
if (deed.Commodity == null)
|
||||
continue;
|
||||
if (deed.Commodity.GetType() != type)
|
||||
continue;
|
||||
if(deed.Commodity.Amount <= left)
|
||||
{
|
||||
left -= deed.Commodity.Amount;
|
||||
deed.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
deed.Commodity.Amount -= left;
|
||||
deed.InvalidateProperties();
|
||||
left = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return amount - left;
|
||||
}
|
||||
}
|
||||
|
||||
public class CommodityDeed : Item
|
||||
{
|
||||
public CommodityDeed(Item commodity)
|
||||
: base(0x14F0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x47;
|
||||
|
||||
Commodity = commodity;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CommodityDeed()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public CommodityDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Item Commodity { get; private set; }
|
||||
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (Commodity == null)
|
||||
{
|
||||
list.Add(1047016);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(1115599, string.Format("{0}\t#{1}", Commodity.Amount, Commodity.LabelNumber));
|
||||
}
|
||||
}
|
||||
|
||||
public bool SetCommodity(Item item)
|
||||
{
|
||||
InvalidateProperties();
|
||||
|
||||
if (Commodity == null && item is ICommodity && ((ICommodity)item).IsDeedable)
|
||||
{
|
||||
Commodity = item;
|
||||
Commodity.Internalize();
|
||||
Hue = 0x592;
|
||||
|
||||
InvalidateProperties();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write(Commodity);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Commodity = reader.ReadItem();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (Commodity != null)
|
||||
{
|
||||
Hue = 0x592;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if (Commodity != null)
|
||||
Commodity.Delete();
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Commodity != null)
|
||||
{
|
||||
list.Add(1060747); // filled
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(1060748); // unfilled
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
int number;
|
||||
|
||||
BankBox box = from.FindBankNoCreate();
|
||||
CommodityDeedBox cox = CommodityDeedBox.Find(this);
|
||||
GalleonHold hold = RootParent as GalleonHold;
|
||||
|
||||
// Veteran Rewards mods
|
||||
if (Commodity != null)
|
||||
{
|
||||
if (box != null && IsChildOf(box))
|
||||
{
|
||||
number = 1047031; // The commodity has been redeemed.
|
||||
|
||||
box.DropItem(Commodity);
|
||||
|
||||
Commodity = null;
|
||||
Delete();
|
||||
}
|
||||
else if (cox != null)
|
||||
{
|
||||
if (cox.IsSecure)
|
||||
{
|
||||
number = 1047031; // The commodity has been redeemed.
|
||||
|
||||
cox.DropItem(Commodity);
|
||||
|
||||
Commodity = null;
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
number = 1080525; // The commodity deed box must be secured before you can use it.
|
||||
}
|
||||
else if (hold != null)
|
||||
{
|
||||
number = 1047031; // The commodity has been redeemed.
|
||||
|
||||
hold.DropItem(Commodity);
|
||||
Commodity = null;
|
||||
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Core.ML)
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047024; // To claim the resources ....
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cox != null && !cox.IsSecure)
|
||||
{
|
||||
number = 1080525; // The commodity deed box must be secured before you can use it.
|
||||
}
|
||||
else if ((box == null || !IsChildOf(box)) && cox == null && hold == null)
|
||||
{
|
||||
if (Core.ML)
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047029; // Target the commodity to fill this deed with.
|
||||
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(number);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly CommodityDeed m_Deed;
|
||||
|
||||
public InternalTarget(CommodityDeed deed)
|
||||
: base(3, false, TargetFlags.None)
|
||||
{
|
||||
m_Deed = deed;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Deed.Deleted)
|
||||
return;
|
||||
|
||||
int number;
|
||||
|
||||
if (m_Deed.Commodity != null)
|
||||
{
|
||||
number = 1047028; // The commodity deed has already been filled.
|
||||
}
|
||||
else if (targeted is Item)
|
||||
{
|
||||
BankBox box = from.FindBankNoCreate();
|
||||
CommodityDeedBox cox = CommodityDeedBox.Find(m_Deed);
|
||||
GalleonHold hold = ((Item)targeted).RootParent as GalleonHold;
|
||||
|
||||
// Veteran Rewards mods
|
||||
if (box != null && m_Deed.IsChildOf(box) && ((Item)targeted).IsChildOf(box) ||
|
||||
(cox != null && cox.IsSecure && ((Item)targeted).IsChildOf(cox)) ||
|
||||
hold != null)
|
||||
{
|
||||
if (m_Deed.SetCommodity((Item)targeted))
|
||||
{
|
||||
number = 1047030; // The commodity deed has been filled.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Core.ML)
|
||||
{
|
||||
number = 1080526; // That must be in your bank box or commodity deed box to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047026; // That must be in your bank box to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(number);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
515
Scripts/Items/Consumables/CommunicationCrystals.cs
Normal file
515
Scripts/Items/Consumables/CommunicationCrystals.cs
Normal file
@@ -0,0 +1,515 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CrystalRechargeInfo
|
||||
{
|
||||
public static readonly CrystalRechargeInfo[] Table = new CrystalRechargeInfo[]
|
||||
{
|
||||
new CrystalRechargeInfo(typeof(Citrine), 500),
|
||||
new CrystalRechargeInfo(typeof(Amber), 500),
|
||||
new CrystalRechargeInfo(typeof(Tourmaline), 750),
|
||||
new CrystalRechargeInfo(typeof(Emerald), 1000),
|
||||
new CrystalRechargeInfo(typeof(Sapphire), 1000),
|
||||
new CrystalRechargeInfo(typeof(Amethyst), 1000),
|
||||
new CrystalRechargeInfo(typeof(StarSapphire), 1250),
|
||||
new CrystalRechargeInfo(typeof(Diamond), 2000)
|
||||
};
|
||||
private readonly Type m_Type;
|
||||
private readonly int m_Amount;
|
||||
private CrystalRechargeInfo(Type type, int amount)
|
||||
{
|
||||
this.m_Type = type;
|
||||
this.m_Amount = amount;
|
||||
}
|
||||
|
||||
public Type Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Type;
|
||||
}
|
||||
}
|
||||
public int Amount
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Amount;
|
||||
}
|
||||
}
|
||||
public static CrystalRechargeInfo Get(Type type)
|
||||
{
|
||||
foreach (CrystalRechargeInfo info in Table)
|
||||
{
|
||||
if (info.Type == type)
|
||||
return info;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class BroadcastCrystal : Item
|
||||
{
|
||||
public static readonly int MaxCharges = 2000;
|
||||
private int m_Charges;
|
||||
private List<ReceiverCrystal> m_Receivers;
|
||||
[Constructable]
|
||||
public BroadcastCrystal()
|
||||
: this(2000)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BroadcastCrystal(int charges)
|
||||
: base(0x1ED0)
|
||||
{
|
||||
this.Light = LightType.Circle150;
|
||||
|
||||
this.m_Charges = charges;
|
||||
|
||||
this.m_Receivers = new List<ReceiverCrystal>();
|
||||
}
|
||||
|
||||
public BroadcastCrystal(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1060740;
|
||||
}
|
||||
}// communication crystal
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ItemID == 0x1ECD;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ItemID = value ? 0x1ECD : 0x1ED0;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Charges = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public List<ReceiverCrystal> Receivers
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Receivers;
|
||||
}
|
||||
}
|
||||
public override bool HandlesOnSpeech
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Active && this.Receivers.Count > 0 && (this.RootParent == null || this.RootParent is Mobile);
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(this.Active ? 1060742 : 1060743); // active / inactive
|
||||
list.Add(1060745); // broadcast
|
||||
list.Add(1060741, this.Charges.ToString()); // charges: ~1_val~
|
||||
|
||||
if (this.Receivers.Count > 0)
|
||||
list.Add(1060746, this.Receivers.Count.ToString()); // links: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
this.LabelTo(from, this.Active ? 1060742 : 1060743); // active / inactive
|
||||
this.LabelTo(from, 1060745); // broadcast
|
||||
this.LabelTo(from, 1060741, this.Charges.ToString()); // charges: ~1_val~
|
||||
|
||||
if (this.Receivers.Count > 0)
|
||||
this.LabelTo(from, 1060746, this.Receivers.Count.ToString()); // links: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSpeech(SpeechEventArgs e)
|
||||
{
|
||||
if (!this.Active || this.Receivers.Count == 0 || (this.RootParent != null && !(this.RootParent is Mobile)))
|
||||
return;
|
||||
|
||||
if (e.Type == MessageType.Emote)
|
||||
return;
|
||||
|
||||
Mobile from = e.Mobile;
|
||||
string speech = e.Speech;
|
||||
|
||||
foreach (ReceiverCrystal receiver in new List<ReceiverCrystal>(this.Receivers))
|
||||
{
|
||||
if (receiver.Deleted)
|
||||
{
|
||||
this.Receivers.Remove(receiver);
|
||||
}
|
||||
else if (this.Charges > 0)
|
||||
{
|
||||
receiver.TransmitMessage(from, speech);
|
||||
this.Charges--;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Active = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteEncodedInt(this.m_Charges);
|
||||
writer.WriteItemList<ReceiverCrystal>(this.m_Receivers);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Charges = reader.ReadEncodedInt();
|
||||
this.m_Receivers = reader.ReadStrongItemList<ReceiverCrystal>();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly BroadcastCrystal m_Crystal;
|
||||
public InternalTarget(BroadcastCrystal crystal)
|
||||
: base(2, false, TargetFlags.None)
|
||||
{
|
||||
this.m_Crystal = crystal;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (!this.m_Crystal.IsAccessibleTo(from))
|
||||
return;
|
||||
|
||||
if (from.Map != this.m_Crystal.Map || !from.InRange(this.m_Crystal.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted == this.m_Crystal)
|
||||
{
|
||||
if (this.m_Crystal.Active)
|
||||
{
|
||||
this.m_Crystal.Active = false;
|
||||
from.SendLocalizedMessage(500672); // You turn the crystal off.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.m_Crystal.Charges > 0)
|
||||
{
|
||||
this.m_Crystal.Active = true;
|
||||
from.SendLocalizedMessage(500673); // You turn the crystal on.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500676); // This crystal is out of charges.
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (targeted is ReceiverCrystal)
|
||||
{
|
||||
ReceiverCrystal receiver = (ReceiverCrystal)targeted;
|
||||
|
||||
if (this.m_Crystal.Receivers.Count >= 10)
|
||||
{
|
||||
from.SendLocalizedMessage(1010042); // This broadcast crystal is already linked to 10 receivers.
|
||||
}
|
||||
else if (receiver.Sender == this.m_Crystal)
|
||||
{
|
||||
from.SendLocalizedMessage(500674); // This crystal is already linked with that crystal.
|
||||
}
|
||||
else if (receiver.Sender != null)
|
||||
{
|
||||
from.SendLocalizedMessage(1010043); // That receiver crystal is already linked to another broadcast crystal.
|
||||
}
|
||||
else
|
||||
{
|
||||
receiver.Sender = this.m_Crystal;
|
||||
from.SendLocalizedMessage(500675); // That crystal has been linked to this crystal.
|
||||
}
|
||||
}
|
||||
else if (targeted == from)
|
||||
{
|
||||
foreach (ReceiverCrystal receiver in new List<ReceiverCrystal>(this.m_Crystal.Receivers))
|
||||
{
|
||||
receiver.Sender = null;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1010046); // You unlink the broadcast crystal from all of its receivers.
|
||||
}
|
||||
else
|
||||
{
|
||||
Item targItem = targeted as Item;
|
||||
|
||||
if (targItem != null && targItem.VerifyMove(from))
|
||||
{
|
||||
CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType());
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
if (this.m_Crystal.Charges >= MaxCharges)
|
||||
{
|
||||
from.SendLocalizedMessage(500678); // This crystal is already fully charged.
|
||||
}
|
||||
else
|
||||
{
|
||||
targItem.Consume();
|
||||
|
||||
if (this.m_Crystal.Charges + info.Amount >= MaxCharges)
|
||||
{
|
||||
this.m_Crystal.Charges = MaxCharges;
|
||||
from.SendLocalizedMessage(500679); // You completely recharge the crystal.
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Crystal.Charges += info.Amount;
|
||||
from.SendLocalizedMessage(500680); // You recharge the crystal.
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(500681); // You cannot use this crystal on that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ReceiverCrystal : Item
|
||||
{
|
||||
private BroadcastCrystal m_Sender;
|
||||
[Constructable]
|
||||
public ReceiverCrystal()
|
||||
: base(0x1ED0)
|
||||
{
|
||||
this.Light = LightType.Circle150;
|
||||
}
|
||||
|
||||
public ReceiverCrystal(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1060740;
|
||||
}
|
||||
}// communication crystal
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Active
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ItemID == 0x1ED1;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.ItemID = value ? 0x1ED1 : 0x1ED0;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BroadcastCrystal Sender
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Sender;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.m_Sender != null)
|
||||
{
|
||||
this.m_Sender.Receivers.Remove(this);
|
||||
this.m_Sender.InvalidateProperties();
|
||||
}
|
||||
|
||||
this.m_Sender = value;
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
value.Receivers.Add(this);
|
||||
value.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(this.Active ? 1060742 : 1060743); // active / inactive
|
||||
list.Add(1060744); // receiver
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
this.LabelTo(from, this.Active ? 1060742 : 1060743); // active / inactive
|
||||
this.LabelTo(from, 1060744); // receiver
|
||||
}
|
||||
|
||||
public void TransmitMessage(Mobile from, string message)
|
||||
{
|
||||
if (!this.Active)
|
||||
return;
|
||||
|
||||
string text = String.Format("{0} says {1}", from.Name, message);
|
||||
|
||||
if (this.RootParent is Mobile)
|
||||
{
|
||||
((Mobile)this.RootParent).SendMessage(0x2B2, "Crystal: " + text);
|
||||
}
|
||||
else if (this.RootParent is Item)
|
||||
{
|
||||
((Item)this.RootParent).PublicOverheadMessage(MessageType.Regular, 0x2B2, false, "Crystal: " + text);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PublicOverheadMessage(MessageType.Regular, 0x2B2, false, text);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteItem<BroadcastCrystal>(this.m_Sender);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Sender = reader.ReadItem<BroadcastCrystal>();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly ReceiverCrystal m_Crystal;
|
||||
public InternalTarget(ReceiverCrystal crystal)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
this.m_Crystal = crystal;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (!this.m_Crystal.IsAccessibleTo(from))
|
||||
return;
|
||||
|
||||
if (from.Map != this.m_Crystal.Map || !from.InRange(this.m_Crystal.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted == this.m_Crystal)
|
||||
{
|
||||
if (this.m_Crystal.Active)
|
||||
{
|
||||
this.m_Crystal.Active = false;
|
||||
from.SendLocalizedMessage(500672); // You turn the crystal off.
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_Crystal.Active = true;
|
||||
from.SendLocalizedMessage(500673); // You turn the crystal on.
|
||||
}
|
||||
}
|
||||
else if (targeted == from)
|
||||
{
|
||||
if (this.m_Crystal.Sender != null)
|
||||
{
|
||||
this.m_Crystal.Sender = null;
|
||||
from.SendLocalizedMessage(1010044); // You unlink the receiver crystal.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1010045); // That receiver crystal is not linked.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Item targItem = targeted as Item;
|
||||
|
||||
if (targItem != null && targItem.VerifyMove(from))
|
||||
{
|
||||
CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType());
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
from.SendLocalizedMessage(500677); // This crystal cannot be recharged.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1010045); // That receiver crystal is not linked.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Consumables/ConflagrationPotion.cs
Normal file
53
Scripts/Items/Consumables/ConflagrationPotion.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ConflagrationPotion : BaseConflagrationPotion
|
||||
{
|
||||
[Constructable]
|
||||
public ConflagrationPotion()
|
||||
: base(PotionEffect.Conflagration)
|
||||
{
|
||||
}
|
||||
|
||||
public ConflagrationPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int MinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
public override int MaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072095;
|
||||
}
|
||||
}// a Conflagration potion
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Consumables/ConfusionBlastPotion.cs
Normal file
46
Scripts/Items/Consumables/ConfusionBlastPotion.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ConfusionBlastPotion : BaseConfusionBlastPotion
|
||||
{
|
||||
[Constructable]
|
||||
public ConfusionBlastPotion()
|
||||
: base(PotionEffect.ConfusionBlast)
|
||||
{
|
||||
}
|
||||
|
||||
public ConfusionBlastPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Radius
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072105;
|
||||
}
|
||||
}// a Confusion Blast potion
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
1078
Scripts/Items/Consumables/CookableFood.cs
Normal file
1078
Scripts/Items/Consumables/CookableFood.cs
Normal file
File diff suppressed because it is too large
Load Diff
36
Scripts/Items/Consumables/Cookies.cs
Normal file
36
Scripts/Items/Consumables/Cookies.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegCookies : Cookies
|
||||
{
|
||||
[Constructable]
|
||||
public BegCookies()
|
||||
{
|
||||
}
|
||||
|
||||
public BegCookies(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
656
Scripts/Items/Consumables/Cooking.cs
Normal file
656
Scripts/Items/Consumables/Cooking.cs
Normal file
@@ -0,0 +1,656 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UtilityItem
|
||||
{
|
||||
static public int RandomChoice(int itemID1, int itemID2)
|
||||
{
|
||||
int iRet = 0;
|
||||
switch ( Utility.Random(2) )
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
iRet = itemID1;
|
||||
break;
|
||||
case 1:
|
||||
iRet = itemID2;
|
||||
break;
|
||||
}
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
|
||||
// ********** Dough **********
|
||||
public class Dough : Item, IQuality
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Dough()
|
||||
: base(0x103d)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override bool WillStack(Mobile from, Item item)
|
||||
{
|
||||
if (item is IQuality && ((IQuality)item).Quality != _Quality)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.WillStack(from, item);
|
||||
}
|
||||
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public Dough(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version > 0)
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
}
|
||||
|
||||
#if false
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly Dough m_Item;
|
||||
|
||||
public InternalTarget(Dough item)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (targeted is Eggs)
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Eggs)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new UnbakedQuiche());
|
||||
from.AddToBackpack(new Eggshells());
|
||||
}
|
||||
else if (targeted is CheeseWheel)
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((CheeseWheel)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new CheesePizza());
|
||||
}
|
||||
else if (targeted is Sausage)
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Sausage)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new SausagePizza());
|
||||
}
|
||||
else if (targeted is Apple)
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Apple)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new UnbakedApplePie());
|
||||
}
|
||||
else if (targeted is Peach)
|
||||
{
|
||||
m_Item.Delete();
|
||||
|
||||
((Peach)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new UnbakedPeachCobbler());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** SweetDough **********
|
||||
public class SweetDough : Item
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041340;
|
||||
}
|
||||
}// sweet dough
|
||||
|
||||
[Constructable]
|
||||
public SweetDough()
|
||||
: base(0x103d)
|
||||
{
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
Hue = 150;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public SweetDough(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version > 0)
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
|
||||
if (Hue == 51)
|
||||
Hue = 150;
|
||||
}
|
||||
|
||||
#if false
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}
|
||||
#endif
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly SweetDough m_Item;
|
||||
|
||||
public InternalTarget(SweetDough item)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (targeted is BowlFlour)
|
||||
{
|
||||
m_Item.Delete();
|
||||
((BowlFlour)targeted).Delete();
|
||||
|
||||
from.AddToBackpack(new CakeMix());
|
||||
}
|
||||
else if (targeted is Campfire)
|
||||
{
|
||||
from.PlaySound(0x225);
|
||||
m_Item.Delete();
|
||||
InternalTimer t = new InternalTimer(from, (Campfire)targeted);
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_From;
|
||||
private readonly Campfire m_Campfire;
|
||||
|
||||
public InternalTimer(Mobile from, Campfire campfire)
|
||||
: base(TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_From = from;
|
||||
m_Campfire = campfire;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_From.GetDistanceToSqrt(m_Campfire) > 3)
|
||||
{
|
||||
m_From.SendLocalizedMessage(500686); // You burn the food to a crisp! It's ruined.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_From.CheckSkill(SkillName.Cooking, 0, 10))
|
||||
{
|
||||
if (m_From.AddToBackpack(new Muffins()))
|
||||
m_From.PlaySound(0x57);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(500686); // You burn the food to a crisp! It's ruined.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** JarHoney **********
|
||||
public class JarHoney : Item
|
||||
{
|
||||
[Constructable]
|
||||
public JarHoney()
|
||||
: base(0x9ec)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public JarHoney(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();
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
/*public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !Movable )
|
||||
return;
|
||||
|
||||
from.Target = new InternalTarget( this );
|
||||
}*/
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly JarHoney m_Item;
|
||||
|
||||
public InternalTarget(JarHoney item)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (targeted is Dough)
|
||||
{
|
||||
m_Item.Delete();
|
||||
((Dough)targeted).Consume();
|
||||
|
||||
from.AddToBackpack(new SweetDough());
|
||||
}
|
||||
|
||||
if (targeted is BowlFlour)
|
||||
{
|
||||
m_Item.Consume();
|
||||
((BowlFlour)targeted).Delete();
|
||||
|
||||
from.AddToBackpack(new CookieMix());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** BowlFlour **********
|
||||
public class BowlFlour : Item
|
||||
{
|
||||
[Constructable]
|
||||
public BowlFlour()
|
||||
: base(0xa1e)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public BowlFlour(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();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** WoodenBowl **********
|
||||
public class WoodenBowl : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WoodenBowl()
|
||||
: base(0x15f8)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public WoodenBowl(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();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** SackFlour **********
|
||||
public class SackFlour : Item, IQuality
|
||||
{
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public SackFlour()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SackFlour(int amount)
|
||||
: base(0x1039)
|
||||
{
|
||||
Weight = 5.0;
|
||||
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!Movable)
|
||||
return;
|
||||
|
||||
var flour = new SackFlourOpen();
|
||||
flour.Location = Location;
|
||||
|
||||
if (Parent is Container)
|
||||
{
|
||||
((Container)Parent).DropItem(flour);
|
||||
}
|
||||
else
|
||||
{
|
||||
flour.MoveToWorld(GetWorldLocation(), Map);
|
||||
}
|
||||
|
||||
if (Amount > 1)
|
||||
{
|
||||
Amount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public SackFlour(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)4); // version
|
||||
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 4:
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
break;
|
||||
case 3:
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
reader.ReadInt();
|
||||
Stackable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********** SackFlourOpen **********
|
||||
public class SackFlourOpen : Item
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1024166; } } // open sack of flour
|
||||
|
||||
[Constructable]
|
||||
public SackFlourOpen() : base(0x103A)
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
|
||||
public SackFlourOpen( 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();
|
||||
}
|
||||
}
|
||||
|
||||
// ********** Eggshells **********
|
||||
public class Eggshells : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Eggshells()
|
||||
: base(0x9b4)
|
||||
{
|
||||
Weight = 0.5;
|
||||
}
|
||||
|
||||
public Eggshells(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 class WheatSheaf : Item
|
||||
{
|
||||
[Constructable]
|
||||
public WheatSheaf()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WheatSheaf(int amount)
|
||||
: base(7869)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!Movable)
|
||||
return;
|
||||
|
||||
from.BeginTarget(4, false, TargetFlags.None, new TargetCallback(OnTarget));
|
||||
}
|
||||
|
||||
public virtual void OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (obj is AddonComponent)
|
||||
obj = (obj as AddonComponent).Addon;
|
||||
|
||||
IFlourMill mill = obj as IFlourMill;
|
||||
|
||||
if (mill != null)
|
||||
{
|
||||
int needs = mill.MaxFlour - mill.CurFlour;
|
||||
|
||||
if (needs > Amount)
|
||||
needs = Amount;
|
||||
|
||||
mill.CurFlour += needs;
|
||||
Consume(needs);
|
||||
}
|
||||
}
|
||||
|
||||
public WheatSheaf(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CorpseSkinScroll.cs
Normal file
38
Scripts/Items/Consumables/CorpseSkinScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CorpseSkinScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CorpseSkinScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CorpseSkinScroll(int amount)
|
||||
: base(102, 0x2262, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CorpseSkinScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CreateFoodScroll.cs
Normal file
38
Scripts/Items/Consumables/CreateFoodScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CreateFoodScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CreateFoodScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CreateFoodScroll(int amount)
|
||||
: base(1, 0x1F2F, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CreateFoodScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Consumables/CreepyCake.cs
Normal file
33
Scripts/Items/Consumables/CreepyCake.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CreepyCake : Food
|
||||
{
|
||||
public override int LabelNumber {get {return 1153776;} } // Creepy Cake
|
||||
|
||||
[Constructable]
|
||||
public CreepyCake()
|
||||
: base(0x9e9)
|
||||
{
|
||||
Hue = 0x3E4;
|
||||
}
|
||||
|
||||
public CreepyCake(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CunningScroll.cs
Normal file
38
Scripts/Items/Consumables/CunningScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CunningScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CunningScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CunningScroll(int amount)
|
||||
: base(9, 0x1F36, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CunningScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Scripts/Items/Consumables/CurePotion.cs
Normal file
54
Scripts/Items/Consumables/CurePotion.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CurePotion : BaseCurePotion
|
||||
{
|
||||
private static readonly CureLevelInfo[] m_OldLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo(Poison.Lesser, 1.00), // 100% chance to cure lesser poison
|
||||
new CureLevelInfo(Poison.Regular, 0.75), // 75% chance to cure regular poison
|
||||
new CureLevelInfo(Poison.Greater, 0.50), // 50% chance to cure greater poison
|
||||
new CureLevelInfo(Poison.Deadly, 0.15)// 15% chance to cure deadly poison
|
||||
};
|
||||
private static readonly CureLevelInfo[] m_AosLevelInfo = new CureLevelInfo[]
|
||||
{
|
||||
new CureLevelInfo(Poison.Lesser, 1.00),
|
||||
new CureLevelInfo(Poison.Regular, 0.95),
|
||||
new CureLevelInfo(Poison.Greater, 0.45),
|
||||
new CureLevelInfo(Poison.Deadly, 0.25),
|
||||
new CureLevelInfo(Poison.Lethal, 0.15)
|
||||
};
|
||||
[Constructable]
|
||||
public CurePotion()
|
||||
: base(PotionEffect.Cure)
|
||||
{
|
||||
}
|
||||
|
||||
public CurePotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CureLevelInfo[] LevelInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Core.AOS ? m_AosLevelInfo : m_OldLevelInfo;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CureScroll.cs
Normal file
38
Scripts/Items/Consumables/CureScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CureScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CureScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CureScroll(int amount)
|
||||
: base(10, 0x1F37, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CureScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CurseScroll.cs
Normal file
38
Scripts/Items/Consumables/CurseScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CurseScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CurseScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CurseScroll(int amount)
|
||||
: base(26, 0x1F47, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CurseScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/CurseWeaponScroll.cs
Normal file
38
Scripts/Items/Consumables/CurseWeaponScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CurseWeaponScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public CurseWeaponScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CurseWeaponScroll(int amount)
|
||||
: base(103, 0x2263, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public CurseWeaponScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
61
Scripts/Items/Consumables/DarkglowPotion.cs
Normal file
61
Scripts/Items/Consumables/DarkglowPotion.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DarkglowPotion : BasePoisonPotion
|
||||
{
|
||||
[Constructable]
|
||||
public DarkglowPotion()
|
||||
: base(PotionEffect.Darkglow)
|
||||
{
|
||||
this.Hue = 0x96;
|
||||
}
|
||||
|
||||
public DarkglowPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison
|
||||
{
|
||||
get
|
||||
{
|
||||
return Poison.DarkGlow;
|
||||
}
|
||||
}/* MUST be restored when prerequisites are done */
|
||||
public override double MinPoisoningSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return 95.0;
|
||||
}
|
||||
}
|
||||
public override double MaxPoisoningSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072849;
|
||||
}
|
||||
}// Darkglow Poison
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Consumables/Dates.cs
Normal file
36
Scripts/Items/Consumables/Dates.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegDates : Dates
|
||||
{
|
||||
[Constructable]
|
||||
public BegDates()
|
||||
{
|
||||
}
|
||||
|
||||
public BegDates(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Consumables/DeadlyPoisonPotion.cs
Normal file
53
Scripts/Items/Consumables/DeadlyPoisonPotion.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DeadlyPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
[Constructable]
|
||||
public DeadlyPoisonPotion()
|
||||
: base(PotionEffect.PoisonDeadly)
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyPoisonPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison
|
||||
{
|
||||
get
|
||||
{
|
||||
return Poison.Deadly;
|
||||
}
|
||||
}
|
||||
public override double MinPoisoningSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return 80.0;
|
||||
}
|
||||
}
|
||||
public override double MaxPoisoningSkill
|
||||
{
|
||||
get
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Scripts/Items/Consumables/DecorativeKitchenSet.cs
Normal file
44
Scripts/Items/Consumables/DecorativeKitchenSet.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeKitchenSet : Backpack
|
||||
{
|
||||
public override int LabelNumber { get { return 1158970; } } // Decorative Kitchen Set
|
||||
|
||||
[Constructable]
|
||||
public DecorativeKitchenSet()
|
||||
{
|
||||
DropItem(new PieSafe());
|
||||
DropItem(new ChinaCabinet());
|
||||
DropItem(new ButcherBlock());
|
||||
DropItem(new WashBasinDeed());
|
||||
DropItem(new WoodStoveDeed());
|
||||
|
||||
Bag bag = new Bag();
|
||||
bag.DropItem(new Countertop());
|
||||
bag.DropItem(new Countertop());
|
||||
bag.DropItem(new Countertop());
|
||||
bag.DropItem(new Countertop());
|
||||
|
||||
DropItem(bag);
|
||||
}
|
||||
|
||||
public DecorativeKitchenSet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Consumables/DecorativeStableSet.cs
Normal file
41
Scripts/Items/Consumables/DecorativeStableSet.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeStableSet : Backpack
|
||||
{
|
||||
public override int LabelNumber { get { return 1159272; } } // Decorative Stable Set
|
||||
|
||||
[Constructable]
|
||||
public DecorativeStableSet()
|
||||
{
|
||||
DropItem(new CowStatue());
|
||||
DropItem(new HorseStatue());
|
||||
DropItem(new ChickenStatue());
|
||||
DropItem(new MetalTubDeed());
|
||||
DropItem(new Feedbag());
|
||||
DropItem(new CowPie());
|
||||
|
||||
Bag bag = new Bag();
|
||||
// Needs fencing added
|
||||
DropItem(bag);
|
||||
}
|
||||
|
||||
public DecorativeStableSet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Consumables/DeliciouslyTastyTreat.cs
Normal file
46
Scripts/Items/Consumables/DeliciouslyTastyTreat.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DeliciouslyTastyTreat : TastyTreat
|
||||
{
|
||||
public override double Bonus { get { return 0.10; } }
|
||||
public override TimeSpan Duration { get { return TimeSpan.FromMinutes(10); } }
|
||||
public override TimeSpan CoolDown { get { return TimeSpan.FromMinutes(60); } }
|
||||
|
||||
[Constructable]
|
||||
public DeliciouslyTastyTreat() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DeliciouslyTastyTreat(int amount)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public DeliciouslyTastyTreat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1113004; } } //Deliciously Tasty Treat
|
||||
|
||||
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 = (InheritsItem ? 0 : reader.ReadInt()); //Required for TastyTreat Insertion
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/DispelFieldScroll.cs
Normal file
38
Scripts/Items/Consumables/DispelFieldScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DispelFieldScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public DispelFieldScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DispelFieldScroll(int amount)
|
||||
: base(33, 0x1F4E, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public DispelFieldScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/DispelScroll.cs
Normal file
38
Scripts/Items/Consumables/DispelScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DispelScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public DispelScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DispelScroll(int amount)
|
||||
: base(40, 0x1F55, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public DispelScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
195
Scripts/Items/Consumables/DragonBardingDeed.cs
Normal file
195
Scripts/Items/Consumables/DragonBardingDeed.cs
Normal file
@@ -0,0 +1,195 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[TypeAlias("Server.Items.DragonBarding")]
|
||||
public class DragonBardingDeed : Item, ICraftable
|
||||
{
|
||||
private bool m_Exceptional;
|
||||
private Mobile m_Crafter;
|
||||
private CraftResource m_Resource;
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Exceptional ? 1053181 : 1053012;
|
||||
}
|
||||
}// dragon barding deed
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Crafter;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Crafter = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Exceptional
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Exceptional;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Exceptional = value;
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Resource;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Resource = value;
|
||||
this.Hue = CraftResources.GetHue(value);
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DragonBardingDeed()
|
||||
: base(0x14F0)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (this.m_Exceptional && this.m_Crafter != null)
|
||||
list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
LabelTo(from, 1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.BeginTarget(6, false, TargetFlags.None, new TargetCallback(OnTarget));
|
||||
from.SendLocalizedMessage(1053024); // Select the swamp dragon you wish to place the barding on.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTarget(Mobile from, object obj)
|
||||
{
|
||||
if (this.Deleted)
|
||||
return;
|
||||
|
||||
SwampDragon pet = obj as SwampDragon;
|
||||
|
||||
if (pet == null || pet.HasBarding)
|
||||
{
|
||||
from.SendLocalizedMessage(1053025); // That is not an unarmored swamp dragon.
|
||||
}
|
||||
else if (!pet.Controlled || pet.ControlMaster != from)
|
||||
{
|
||||
from.SendLocalizedMessage(1053026); // You can only put barding on a tamed swamp dragon that you own.
|
||||
}
|
||||
else if (!this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
pet.BardingExceptional = this.Exceptional;
|
||||
pet.BardingCrafter = this.Crafter;
|
||||
pet.BardingResource = this.Resource;
|
||||
pet.HasBarding = true;
|
||||
pet.Hue = this.Hue;
|
||||
pet.BardingHP = pet.BardingMaxHP;
|
||||
|
||||
this.Delete();
|
||||
|
||||
from.SendLocalizedMessage(1053027); // You place the barding on your swamp dragon. Use a bladed item on your dragon to remove the armor.
|
||||
}
|
||||
}
|
||||
|
||||
public DragonBardingDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_Exceptional);
|
||||
writer.Write((Mobile)this.m_Crafter);
|
||||
writer.Write((int)this.m_Resource);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
this.m_Exceptional = reader.ReadBool();
|
||||
this.m_Crafter = reader.ReadMobile();
|
||||
|
||||
if (version < 1)
|
||||
reader.ReadInt();
|
||||
|
||||
this.m_Resource = (CraftResource)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)
|
||||
{
|
||||
this.Exceptional = (quality >= 2);
|
||||
|
||||
if (makersMark)
|
||||
this.Crafter = from;
|
||||
|
||||
Type resourceType = typeRes;
|
||||
|
||||
if (resourceType == null)
|
||||
resourceType = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
this.Resource = CraftResources.GetFromType(resourceType);
|
||||
return quality;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EagleStrikeScroll.cs
Normal file
38
Scripts/Items/Consumables/EagleStrikeScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EagleStrikeScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EagleStrikeScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EagleStrikeScroll(int amount)
|
||||
: base(682, 0x2DA3, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EagleStrikeScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EarthquakeScroll.cs
Normal file
38
Scripts/Items/Consumables/EarthquakeScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EarthquakeScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EarthquakeScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EarthquakeScroll(int amount)
|
||||
: base(56, 0x1F65, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EarthquakeScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
86
Scripts/Items/Consumables/EggBomb.cs
Normal file
86
Scripts/Items/Consumables/EggBomb.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
#region References
|
||||
using Server.SkillHandlers;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EggBomb : Item, ICommodity
|
||||
{
|
||||
[Constructable]
|
||||
public EggBomb()
|
||||
: base(0x2808)
|
||||
{
|
||||
// Item ID should be 0x2809 - Temporary solution for clients 7.0.0.0 and up
|
||||
Stackable = Core.ML;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public EggBomb(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override int LabelNumber { get { return 1030249; } }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
// The item must be in your backpack to use it.
|
||||
from.SendLocalizedMessage(1060640);
|
||||
}
|
||||
else if (from.Skills.Ninjitsu.Value < 50.0)
|
||||
{
|
||||
// You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
|
||||
from.SendLocalizedMessage(1063013, "50\tNinjitsu");
|
||||
}
|
||||
else if (from.NextSkillTime > Core.TickCount)
|
||||
{
|
||||
// You must wait a few seconds before you can use that item.
|
||||
from.SendLocalizedMessage(1070772);
|
||||
}
|
||||
else if (from.Mana < 10)
|
||||
{
|
||||
// You don't have enough mana to do that.
|
||||
from.SendLocalizedMessage(1049456);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hiding.CombatOverride = true;
|
||||
|
||||
if (from.UseSkill(SkillName.Hiding))
|
||||
{
|
||||
from.Mana -= 10;
|
||||
|
||||
from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
|
||||
from.PlaySound(0x22F);
|
||||
|
||||
Consume();
|
||||
}
|
||||
|
||||
Hiding.CombatOverride = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (ItemID == 0x2809) // Temporary solution for clients 7.0.0.0 and up
|
||||
{
|
||||
ItemID = 0x2808;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
93
Scripts/Items/Consumables/ElixirOfRebirth.cs
Normal file
93
Scripts/Items/Consumables/ElixirOfRebirth.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ElixirOfRebirth : Item
|
||||
{
|
||||
[Constructable]
|
||||
public ElixirOfRebirth() : base(0x24E2)
|
||||
{
|
||||
this.Hue = 0x48E;
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1112762; } } // elixir of rebirth
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
else
|
||||
{
|
||||
from.Target = new ResurrectTarget(this);
|
||||
from.SendLocalizedMessage(1112763); // Which pet do you wish to revive?
|
||||
}
|
||||
}
|
||||
|
||||
private class ResurrectTarget : Target
|
||||
{
|
||||
private readonly ElixirOfRebirth m_Potion;
|
||||
|
||||
public ResurrectTarget(ElixirOfRebirth potion) : base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
public ElixirOfRebirth Potion { get { return m_Potion; } }
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Potion.Deleted)
|
||||
return;
|
||||
|
||||
if (!m_Potion.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (targeted is BaseCreature)
|
||||
{
|
||||
BaseCreature petPatient = targeted as BaseCreature;
|
||||
|
||||
if (!petPatient.IsDeadBondedPet)
|
||||
from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
|
||||
else if (petPatient.Corpse != null && !petPatient.Corpse.Deleted)
|
||||
from.SendLocalizedMessage(1113279); // That creature's spirit lacks cohesion. Try again in a few minutes.
|
||||
else if (!from.InRange(petPatient, 2))
|
||||
from.SendLocalizedMessage(501042); // Target is not close enough.
|
||||
else if (!from.Alive)
|
||||
from.SendLocalizedMessage(501040); // The resurrecter must be alive.
|
||||
else if (!petPatient.IsDeadPet)
|
||||
from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
|
||||
else if (petPatient.Map == null || !petPatient.Map.CanFit(petPatient.Location, 16, false, false))
|
||||
from.SendLocalizedMessage(501042); // Target can not be resurrected at that location.
|
||||
else
|
||||
{
|
||||
from.PlaySound(0x214);
|
||||
from.FixedEffect(0x376A, 10, 16);
|
||||
petPatient.ResurrectPet();
|
||||
m_Potion.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1112764); // This may only be used to resurrect dead pets.
|
||||
}
|
||||
}
|
||||
|
||||
public ElixirOfRebirth(Serial serial) : base(serial) { }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
56
Scripts/Items/Consumables/EmbroideryTool.cs
Normal file
56
Scripts/Items/Consumables/EmbroideryTool.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EmbroideryTool : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1158880; } } // Embroidery Tool
|
||||
|
||||
public override bool DeletedItem { get { return false; } }
|
||||
public override int LowSkillMessage { get { return 1158837; } } // Your tailoring skill is too low to fix this yourself. An NPC tailor can help you repair this for a fee.
|
||||
public override int VeteranRewardCliloc { get { return 1076220; } } // 4th Year Veteran Reward
|
||||
|
||||
public override int GumpTitle { get { return 1158846; } } // <CENTER>Embroidery Tool</CENTER>
|
||||
|
||||
public override int SuccessMessage { get { return 1158841; } } // You embroider the object.
|
||||
public override int TargetMessage { get { return 1158838; } } // Select an object to embroider
|
||||
public override int RemoveMessage { get { return 1158839; } } // You remove the embroidery from the object.
|
||||
public override int OutOfChargesMessage { get { return 1158844; } } // There are no charges left on this embroidery tool.
|
||||
public override int CannotEngraveMessage { get { return 1158843; } } // The selected item cannot be embroidered by this tool.
|
||||
public override int ObjectWasNotMessage { get { return 1158840; } } // The object was not embroidered.
|
||||
|
||||
[Constructable]
|
||||
public EmbroideryTool()
|
||||
: base(0xA20A, 10)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
public EmbroideryTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(BaseClothing)
|
||||
};
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EnchantScroll.cs
Normal file
38
Scripts/Items/Consumables/EnchantScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EnchantScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnchantScroll(int amount)
|
||||
: base(680, 0x2DA1, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EnchantScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
194
Scripts/Items/Consumables/EnchantedApple.cs
Normal file
194
Scripts/Items/Consumables/EnchantedApple.cs
Normal file
@@ -0,0 +1,194 @@
|
||||
using System;
|
||||
using Server.Spells.First;
|
||||
using Server.Spells.Fourth;
|
||||
using Server.Spells.Necromancy;
|
||||
using Server.Spells.Mysticism;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnchantedApple : BaseMagicalFood
|
||||
{
|
||||
[Constructable]
|
||||
public EnchantedApple()
|
||||
: base(0x2FD8)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x488;
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public EnchantedApple(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override MagicalFood FoodID
|
||||
{
|
||||
get
|
||||
{
|
||||
return MagicalFood.EnchantedApple;
|
||||
}
|
||||
}
|
||||
public override TimeSpan Cooldown
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromSeconds(30);
|
||||
}
|
||||
}
|
||||
public override int EatMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1074846;
|
||||
}
|
||||
}// A tasty bite of the enchanted apple lifts all curses from your soul.
|
||||
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (!IsUnderInfluence(from, FoodID))
|
||||
{
|
||||
if (CoolingDown(from, FoodID))
|
||||
{
|
||||
from.SendLocalizedMessage(1151180); // You must wait a while before eating another enchanted apple.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(0xF6);
|
||||
from.PlaySound(0x1F7);
|
||||
from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);
|
||||
|
||||
IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
|
||||
IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
|
||||
Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);
|
||||
|
||||
if (Core.TOL)
|
||||
{
|
||||
int power = CleansingWindsSpell.RemoveCurses(from);
|
||||
power = Math.Min(power, 15);
|
||||
|
||||
from.SendLocalizedMessage(EatMessage);
|
||||
|
||||
StartInfluence(from, FoodID, Duration, TimeSpan.FromSeconds(30 + power));
|
||||
Consume();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (Core.SA)
|
||||
{
|
||||
int totalCurses = GetTotalCurses(from);
|
||||
|
||||
if (totalCurses > 2 && totalCurses > Utility.Random(10))
|
||||
{
|
||||
from.SendLocalizedMessage(1150174); // The apple was not strong enough to purify you.
|
||||
|
||||
Consume();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
EvilOmenSpell.TryEndEffect(from);
|
||||
StrangleSpell.RemoveCurse(from);
|
||||
CorpseSkinSpell.RemoveCurse(from);
|
||||
WeakenSpell.RemoveEffects(from);
|
||||
FeeblemindSpell.RemoveEffects(from);
|
||||
ClumsySpell.RemoveEffects(from);
|
||||
CurseSpell.RemoveEffect(from);
|
||||
MortalStrike.EndWound(from);
|
||||
BloodOathSpell.RemoveCurse(from);
|
||||
MindRotSpell.ClearMindRotScalar(from);
|
||||
SpellPlagueSpell.RemoveFromList(from);
|
||||
SleepSpell.EndSleep(from);
|
||||
|
||||
BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);
|
||||
|
||||
from.SendLocalizedMessage(EatMessage);
|
||||
|
||||
StartInfluence(from, FoodID, Duration, Cooldown);
|
||||
Consume();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetTotalCurses(Mobile m)
|
||||
{
|
||||
int curses = 0;
|
||||
|
||||
if (EvilOmenSpell.UnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (StrangleSpell.UnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (CorpseSkinSpell.IsUnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (BloodOathSpell.GetBloodOath(m) != null)
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (MindRotSpell.HasMindRotScalar(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (SpellPlagueSpell.HasSpellPlague(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (SleepSpell.IsUnderSleepEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (CurseSpell.UnderEffect(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (FeeblemindSpell.IsUnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (ClumsySpell.IsUnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
if (WeakenSpell.IsUnderEffects(m))
|
||||
{
|
||||
curses++;
|
||||
}
|
||||
|
||||
return curses;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
237
Scripts/Items/Consumables/EndlessDecanter.cs
Normal file
237
Scripts/Items/Consumables/EndlessDecanter.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Server.ContextMenus;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EndlessDecanter : Pitcher
|
||||
{
|
||||
private Boolean m_Linked = false;
|
||||
private Point3D m_LinkLocation;
|
||||
private Map m_LinkMap;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Boolean Linked { get { return m_Linked; } set { m_Linked = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D LinkLocation { get { return m_LinkLocation; } set { m_LinkLocation = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Map LinkMap { get { return m_LinkMap; } set { m_LinkMap = value; } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1115929; // Endless Decanter of Water
|
||||
}
|
||||
}
|
||||
|
||||
public override int ComputeItemID()
|
||||
{
|
||||
return 0x0FF6;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EndlessDecanter() : base(BeverageType.Water)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = 0x399;
|
||||
}
|
||||
|
||||
public EndlessDecanter(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public static void HandleThrow(BaseBeverage beverage, WaterElemental elemental, Mobile thrower)
|
||||
{
|
||||
if (!beverage.IsFull)
|
||||
{
|
||||
thrower.SendLocalizedMessage(1113038); // It is not full.
|
||||
}
|
||||
else if (!thrower.InRange(elemental.Location, 5))
|
||||
{
|
||||
thrower.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
}
|
||||
else if (!elemental.HasDecanter)
|
||||
{
|
||||
thrower.SendLocalizedMessage(1115895); // It seems that this water elemental no longer has a magical decanter...
|
||||
}
|
||||
else if (0.1 > Utility.RandomDouble())
|
||||
{
|
||||
thrower.RevealingAction();
|
||||
elemental.Damage(1, thrower);
|
||||
|
||||
elemental.HasDecanter = false;
|
||||
beverage.Delete();
|
||||
thrower.AddToBackpack(new EndlessDecanter());
|
||||
thrower.SendLocalizedMessage(1115897); // The water elemental has thrown a magical decanter back to you!
|
||||
}
|
||||
else
|
||||
{
|
||||
thrower.RevealingAction();
|
||||
elemental.Damage(1, thrower);
|
||||
|
||||
beverage.Delete();
|
||||
thrower.PlaySound(0x040);
|
||||
thrower.SendLocalizedMessage(1115896); // The water pitcher has shattered.
|
||||
}
|
||||
}
|
||||
|
||||
public override void QuantityChanged()
|
||||
{
|
||||
if (Content == BeverageType.Water && Quantity == 0 && m_Linked && RootParent is Mobile)
|
||||
{
|
||||
if (((Mobile)RootParent).InRange(m_LinkLocation, 10) && ((Mobile)RootParent).Map == m_LinkMap)
|
||||
{
|
||||
Quantity = MaxQuantity;
|
||||
|
||||
((Mobile)RootParent).SendLocalizedMessage(1115901); // The decanter has automatically been filled from the linked water trough.
|
||||
((Mobile)RootParent).PlaySound(0x4E);
|
||||
}
|
||||
else
|
||||
{
|
||||
((Mobile)RootParent).SendLocalizedMessage(1115972); // The decanter’s refill attempt failed because the linked water trough is not in the area.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
list.Add(1115889); // Auto Water Refill
|
||||
|
||||
if (m_Linked)
|
||||
list.Add(1115893); // Linked
|
||||
else
|
||||
list.Add(1115894); // Unlinked
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive)
|
||||
{
|
||||
list.Add(new LinkEntry(from, this));
|
||||
|
||||
if (m_Linked)
|
||||
list.Add(new UnlinkEntry(from, this));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((Boolean)m_Linked);
|
||||
writer.Write((Point3D)m_LinkLocation);
|
||||
writer.Write((Map)m_LinkMap);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
Int32 version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
m_Linked = reader.ReadBool();
|
||||
m_LinkLocation = reader.ReadPoint3D();
|
||||
m_LinkMap = reader.ReadMap();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private class LinkEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private EndlessDecanter m_Decanter;
|
||||
|
||||
public LinkEntry(Mobile from, EndlessDecanter decanter) : base(1115891, 0) // Link
|
||||
{
|
||||
m_From = from;
|
||||
m_Decanter = decanter;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (this.m_Decanter.Deleted || !this.m_Decanter.Movable || !this.m_From.CheckAlive() || !this.m_Decanter.CheckItemUse(this.m_From))
|
||||
return;
|
||||
|
||||
m_From.SendLocalizedMessage(1115892); // Target a water trough you wish to link.
|
||||
|
||||
m_From.BeginTarget(10, false, TargetFlags.None, new TargetCallback(Link_OnTarget));
|
||||
}
|
||||
|
||||
private void Link_OnTarget(Mobile from, object targ)
|
||||
{
|
||||
Int32 itemID = 0;
|
||||
Point3D location = new Point3D();
|
||||
Map map = Map.Felucca;
|
||||
|
||||
if (targ is StaticTarget)
|
||||
{
|
||||
itemID = ((StaticTarget)targ).ItemID;
|
||||
location = ((StaticTarget)targ).Location;
|
||||
map = from.Map;
|
||||
}
|
||||
else if (targ is Item)
|
||||
{
|
||||
itemID = ((Item)targ).ItemID;
|
||||
location = ((Item)targ).Location;
|
||||
map = ((Item)targ).Map;
|
||||
}
|
||||
|
||||
if (itemID >= 0xB41 && itemID <= 0xB44)
|
||||
{
|
||||
m_Decanter.Linked = true;
|
||||
m_Decanter.LinkLocation = location;
|
||||
m_Decanter.LinkMap = map;
|
||||
|
||||
from.SendLocalizedMessage(1115899); // That water trough has been linked to this decanter.
|
||||
|
||||
if (m_Decanter.Quantity == 0 && m_Decanter.Content == BeverageType.Water)
|
||||
{
|
||||
m_Decanter.QuantityChanged();
|
||||
m_Decanter.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1115900); // Invalid target. Please target a water trough.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class UnlinkEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private EndlessDecanter m_Decanter;
|
||||
|
||||
public UnlinkEntry(Mobile from, EndlessDecanter decanter) : base(1115930, 0) // Unlink
|
||||
{
|
||||
m_From = from;
|
||||
m_Decanter = decanter;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (this.m_Decanter.Deleted || !this.m_Decanter.Movable || !this.m_From.CheckAlive() || !this.m_Decanter.CheckItemUse(this.m_From))
|
||||
return;
|
||||
|
||||
m_From.SendLocalizedMessage(1115898); // The link between this decanter and the water trough has been removed.
|
||||
m_Decanter.Linked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EnergyBoltScroll.cs
Normal file
38
Scripts/Items/Consumables/EnergyBoltScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnergyBoltScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EnergyBoltScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnergyBoltScroll(int amount)
|
||||
: base(41, 0x1F56, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EnergyBoltScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EnergyFieldScroll.cs
Normal file
38
Scripts/Items/Consumables/EnergyFieldScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnergyFieldScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EnergyFieldScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnergyFieldScroll(int amount)
|
||||
: base(49, 0x1F5E, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EnergyFieldScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EnergyVortexScroll.cs
Normal file
38
Scripts/Items/Consumables/EnergyVortexScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EnergyVortexScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EnergyVortexScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EnergyVortexScroll(int amount)
|
||||
: base(57, 0x1F66, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EnergyVortexScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
827
Scripts/Items/Consumables/EngravingTools.cs
Normal file
827
Scripts/Items/Consumables/EngravingTools.cs
Normal file
@@ -0,0 +1,827 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Engines.VeteranRewards;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
interface IEngravable
|
||||
{
|
||||
string EngravedText { get; set; }
|
||||
}
|
||||
|
||||
public class BaseEngravingTool : Item, IUsesRemaining, IRewardItem
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool ShowUsesRemaining
|
||||
{
|
||||
get { return true; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsRewardItem = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BaseEngravingTool(int itemID)
|
||||
: this(itemID, 1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BaseEngravingTool(int itemID, int uses)
|
||||
: base(itemID)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x48D;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_UsesRemaining = uses;
|
||||
}
|
||||
|
||||
public BaseEngravingTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool DeletedItem { get { return true; } }
|
||||
public virtual int LowSkillMessage { get { return 0; } }
|
||||
public virtual int VeteranRewardCliloc { get { return 0; } }
|
||||
|
||||
public virtual Type[] Engraves { get { return null; } }
|
||||
public virtual int GumpTitle { get { return 1072359; } } // <CENTER>Engraving Tool</CENTER>
|
||||
|
||||
public virtual int SuccessMessage { get { return 1072361; } } // You engraved the object.
|
||||
public virtual int TargetMessage { get { return 1072357; } } // Select an object to engrave.
|
||||
public virtual int RemoveMessage { get { return 1072362; } } // You remove the engraving from the object.
|
||||
public virtual int ReChargesMessage { get { return 1076166; } } // You do not have a blue diamond needed to recharge the engraving tool.
|
||||
public virtual int OutOfChargesMessage { get { return 1076163; } } // There are no charges left on this engraving tool.
|
||||
public virtual int NotAccessibleMessage { get { return 1072310; } } // The selected item is not accessible to engrave.
|
||||
public virtual int CannotEngraveMessage { get { return 1072309; } } // The selected item cannot be engraved by this engraving tool.
|
||||
public virtual int ObjectWasNotMessage { get { return 1072363; } } // The object was not engraved.
|
||||
|
||||
public virtual bool CheckType(IEntity entity)
|
||||
{
|
||||
if (Engraves == null || entity == null)
|
||||
return false;
|
||||
|
||||
Type type = entity.GetType();
|
||||
|
||||
for (int i = 0; i < Engraves.Length; i++)
|
||||
{
|
||||
if (type == Engraves[i] || type.IsSubclassOf(Engraves[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static BaseEngravingTool Find(Mobile from)
|
||||
{
|
||||
if (from.Backpack != null)
|
||||
{
|
||||
BaseEngravingTool tool = from.Backpack.FindItemByType(typeof(BaseEngravingTool)) as BaseEngravingTool;
|
||||
|
||||
if (tool != null && !tool.DeletedItem && tool.UsesRemaining <= 0)
|
||||
return tool;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if (!from.NetState.SupportsExpansion(Expansion.ML))
|
||||
{
|
||||
from.SendLocalizedMessage(1072791); // You must upgrade to Mondain's Legacy in order to use that item.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_UsesRemaining > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(TargetMessage);
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!DeletedItem)
|
||||
{
|
||||
if (CheckSkill(from))
|
||||
{
|
||||
Item diamond = from.Backpack.FindItemByType(typeof(BlueDiamond));
|
||||
|
||||
if (diamond != null)
|
||||
{
|
||||
from.SendGump(new ConfirmGump(this, null));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(ReChargesMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(OutOfChargesMessage);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsValid(IEntity entity, Mobile m)
|
||||
{
|
||||
if (entity is Item)
|
||||
{
|
||||
Item item = entity as Item;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(item);
|
||||
|
||||
if (m.InRange(item.GetWorldLocation(), 3))
|
||||
{
|
||||
if (item.Movable && !item.IsLockedDown && !item.IsSecure && (item.RootParent == null || item.RootParent == m))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (house != null && house.IsFriend(m))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (entity is BaseCreature)
|
||||
{
|
||||
BaseCreature bc = entity as BaseCreature;
|
||||
|
||||
if (bc.Controlled && bc.ControlMaster == m)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CheckSkill(Mobile from)
|
||||
{
|
||||
if (from.Skills[SkillName.Tinkering].Value < 75.0)
|
||||
{
|
||||
from.SendLocalizedMessage(LowSkillMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void Recharge(Mobile from, Mobile guildmaster)
|
||||
{
|
||||
if (from.Backpack != null)
|
||||
{
|
||||
Item diamond = from.Backpack.FindItemByType(typeof(BlueDiamond));
|
||||
|
||||
if (guildmaster != null)
|
||||
{
|
||||
if (m_UsesRemaining <= 0)
|
||||
{
|
||||
if (diamond != null && Banker.Withdraw(from, 100000))
|
||||
{
|
||||
diamond.Consume();
|
||||
UsesRemaining = 10;
|
||||
guildmaster.Say(1076165); // Your weapon engraver should be good as new!
|
||||
}
|
||||
else
|
||||
guildmaster.Say(1076167); // You need a 100,000 gold and a blue diamond to recharge the weapon engraver.
|
||||
}
|
||||
else
|
||||
guildmaster.Say(1076164); // I can only help with this if you are carrying an engraving tool that needs repair.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CheckSkill(from))
|
||||
{
|
||||
if (diamond != null)
|
||||
{
|
||||
diamond.Consume();
|
||||
|
||||
if (Utility.RandomDouble() < from.Skills[SkillName.Tinkering].Value / 100)
|
||||
{
|
||||
UsesRemaining = 10;
|
||||
from.SendLocalizedMessage(1076165); // Your engraver should be good as new!
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1076175); // You cracked the diamond attempting to fix the engraver.
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1076166); // You do not have a blue diamond needed to recharge the engraving tool.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_IsRewardItem)
|
||||
list.Add(VeteranRewardCliloc);
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (ShowUsesRemaining)
|
||||
{
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2); // version
|
||||
|
||||
writer.Write((int)m_UsesRemaining);
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
if (this is WeaponEngravingTool)
|
||||
{
|
||||
InheritsItem = true;
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
else
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Old Item Serialization Vars
|
||||
/* DO NOT USE! Only used in serialization of Weapon Engraving Tool that originally derived from Item */
|
||||
public bool InheritsItem { get; protected set; }
|
||||
#endregion
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly BaseEngravingTool m_Tool;
|
||||
|
||||
public InternalTarget(BaseEngravingTool tool)
|
||||
: base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Tool == null || m_Tool.Deleted)
|
||||
return;
|
||||
|
||||
if (targeted is IEntity)
|
||||
{
|
||||
IEntity entity = (IEntity)targeted;
|
||||
|
||||
if (m_Tool.IsValid(entity, from))
|
||||
{
|
||||
if (entity is IEngravable && m_Tool.CheckType(entity))
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.SendGump(new InternalGump(m_Tool, entity));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(m_Tool.CannotEngraveMessage);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(m_Tool.CannotEngraveMessage);
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(m_Tool.CannotEngraveMessage);
|
||||
}
|
||||
|
||||
protected override void OnTargetOutOfRange(Mobile from, object targeted)
|
||||
{
|
||||
from.SendLocalizedMessage(m_Tool.NotAccessibleMessage);
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmGump : Gump
|
||||
{
|
||||
private readonly BaseEngravingTool Tool;
|
||||
private readonly Mobile m_NPC;
|
||||
|
||||
public ConfirmGump(BaseEngravingTool tool, Mobile npc)
|
||||
: base(200, 200)
|
||||
{
|
||||
Tool = tool;
|
||||
m_NPC = npc;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
|
||||
if (npc != null)
|
||||
{
|
||||
AddHtmlLocalized(9, 9, 272, 100, 1076169, 0x7FFF, false, false); // It will cost you 100,000 gold and a blue diamond to recharge your weapon engraver with 10 charges.
|
||||
AddHtmlLocalized(195, 109, 120, 20, 1076172, 0x7FFF, false, false); // Recharge it
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(9, 9, 272, 100, 1076176, 0x7FFF, false, false); // You will need a blue diamond to repair the tip of the engraver. A successful repair will give the engraver 10 charges.
|
||||
AddHtmlLocalized(195, 109, 120, 20, 1076177, 0x7FFF, false, false); // Replace the tip.
|
||||
}
|
||||
|
||||
AddButton(160, 107, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(5, 107, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (Tool == null || Tool.Deleted)
|
||||
return;
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
Tool.Recharge(state.Mobile, m_NPC);
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly BaseEngravingTool m_Tool;
|
||||
private readonly IEntity m_Target;
|
||||
|
||||
public InternalGump(BaseEngravingTool tool, IEntity target)
|
||||
: base(0, 0)
|
||||
{
|
||||
m_Tool = tool;
|
||||
m_Target = target;
|
||||
|
||||
AddBackground(50, 50, 400, 300, 0xA28);
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddHtmlLocalized(50, 70, 400, 20, m_Tool.GumpTitle, 0x0, false, false);
|
||||
AddHtmlLocalized(75, 95, 350, 145, 1072360, 0x0, true, true);
|
||||
|
||||
AddButton(125, 300, 0x81A, 0x81B, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(320, 300, 0x819, 0x818, 0, GumpButtonType.Reply, 0);
|
||||
|
||||
AddImageTiled(75, 245, 350, 40, 0xDB0);
|
||||
AddImageTiled(76, 245, 350, 2, 0x23C5);
|
||||
AddImageTiled(75, 245, 2, 40, 0x23C3);
|
||||
AddImageTiled(75, 285, 350, 2, 0x23C5);
|
||||
AddImageTiled(425, 245, 2, 42, 0x23C3);
|
||||
|
||||
AddTextEntry(78, 246, 343, 37, 0x4FF, 15, "", 78);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
if (m_Tool == null || m_Tool.Deleted || m_Target == null || m_Target.Deleted)
|
||||
return;
|
||||
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
if (!m_Tool.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
return;
|
||||
}
|
||||
else if (!m_Tool.IsValid(m_Target, from))
|
||||
{
|
||||
from.SendLocalizedMessage(1072311); // The engraving failed.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
TextRelay relay = info.GetTextEntry(15);
|
||||
|
||||
IEngravable item = (IEngravable)m_Target;
|
||||
|
||||
if (relay != null)
|
||||
{
|
||||
if (relay.Text == null || relay.Text.Equals(""))
|
||||
{
|
||||
if (item.EngravedText != null)
|
||||
{
|
||||
item.EngravedText = null;
|
||||
from.SendLocalizedMessage(m_Tool.RemoveMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(m_Tool.ObjectWasNotMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string text;
|
||||
|
||||
if (relay.Text.Length > 40)
|
||||
text = relay.Text.Substring(0, 40);
|
||||
else
|
||||
text = relay.Text;
|
||||
|
||||
item.EngravedText = text;
|
||||
|
||||
from.SendLocalizedMessage(m_Tool.SuccessMessage);
|
||||
|
||||
m_Tool.UsesRemaining--;
|
||||
|
||||
if (m_Tool.UsesRemaining < 1)
|
||||
{
|
||||
if (m_Tool.DeletedItem)
|
||||
{
|
||||
m_Tool.Delete();
|
||||
from.SendLocalizedMessage(1044038); // You have worn out your tool!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LeatherContainerEngraver : BaseEngravingTool
|
||||
{
|
||||
[Constructable]
|
||||
public LeatherContainerEngraver()
|
||||
: base(0xF9D, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public LeatherContainerEngraver(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072152;
|
||||
}
|
||||
}// leather container engraving tool
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(Pouch), typeof(Backpack), typeof(Bag)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 WoodenContainerEngraver : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1072153; } } // wooden container engraving tool
|
||||
|
||||
[Constructable]
|
||||
public WoodenContainerEngraver()
|
||||
: base(0x1026, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public WoodenContainerEngraver(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(WoodenBox), typeof(LargeCrate), typeof(MediumCrate),
|
||||
typeof(SmallCrate), typeof(WoodenChest), typeof(EmptyBookcase),
|
||||
typeof(Armoire), typeof(FancyArmoire), typeof(PlainWoodenChest),
|
||||
typeof(OrnateWoodenChest), typeof(GildedWoodenChest), typeof(WoodenFootLocker),
|
||||
typeof(FinishedWoodenChest), typeof(TallCabinet), typeof(ShortCabinet),
|
||||
typeof(RedArmoire), typeof(CherryArmoire), typeof(MapleArmoire),
|
||||
typeof(ElegantArmoire), typeof(Keg), typeof(SimpleElvenArmoire),
|
||||
typeof(DecorativeBox), typeof(FancyElvenArmoire), typeof(RarewoodChest),
|
||||
typeof(RewardSign), typeof(GargoyleWoodenChest)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 MetalContainerEngraver : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1072154; } } // metal container engraving tool
|
||||
|
||||
[Constructable]
|
||||
public MetalContainerEngraver()
|
||||
: base(0x1EB8, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public MetalContainerEngraver(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(ParagonChest), typeof(MetalChest), typeof(MetalGoldenChest), typeof(MetalBox)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 FoodEngraver : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1072951; } } // food decoration tool
|
||||
|
||||
[Constructable]
|
||||
public FoodEngraver()
|
||||
: base(0x1BD1, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public FoodEngraver(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(Cake), typeof(CheesePizza), typeof(SausagePizza),
|
||||
typeof(Cookies)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 SpellbookEngraver : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1072151; } } // spellbook engraving tool
|
||||
|
||||
[Constructable]
|
||||
public SpellbookEngraver()
|
||||
: base(0xFBF, 1)
|
||||
{
|
||||
}
|
||||
|
||||
public SpellbookEngraver(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(Spellbook)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 StatuetteEngravingTool : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1080201; } } // Statuette Engraving Tool
|
||||
|
||||
[Constructable]
|
||||
public StatuetteEngravingTool()
|
||||
: base(0x12B3, 10)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
public StatuetteEngravingTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(MonsterStatuette)
|
||||
};
|
||||
}
|
||||
}
|
||||
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 ArmorEngravingTool : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1080547; } }// Armor Engraving Tool
|
||||
|
||||
[Constructable]
|
||||
public ArmorEngravingTool()
|
||||
: base(0x32F8, 30)
|
||||
{
|
||||
Hue = 0x490;
|
||||
}
|
||||
|
||||
public ArmorEngravingTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int GumpTitle { get { return 1071163; } } // <center>Armor Engraving Tool</center>
|
||||
|
||||
public override Type[] Engraves { get { return new Type[] { typeof(BaseArmor) }; } }
|
||||
|
||||
public override bool CheckType(IEntity entity)
|
||||
{
|
||||
bool check = base.CheckType(entity);
|
||||
|
||||
if (check && entity.GetType().IsSubclassOf(typeof(BaseShield)))
|
||||
{
|
||||
check = false;
|
||||
}
|
||||
|
||||
return check;
|
||||
}
|
||||
|
||||
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 ShieldEngravingTool : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1159004; } } // Shield Engraving Tool
|
||||
|
||||
public override bool DeletedItem { get { return false; } }
|
||||
public override int LowSkillMessage { get { return 1076178; } } // // Your tinkering skill is too low to fix this yourself. An NPC tinkerer can help you repair this for a fee.
|
||||
public override int VeteranRewardCliloc { get { return 0; } }
|
||||
|
||||
[Constructable]
|
||||
public ShieldEngravingTool()
|
||||
: base(0x1EB8, 10)
|
||||
{
|
||||
Hue = 1165;
|
||||
}
|
||||
|
||||
public ShieldEngravingTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(BaseShield)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
985
Scripts/Items/Consumables/EodonPotions.cs
Normal file
985
Scripts/Items/Consumables/EodonPotions.cs
Normal file
@@ -0,0 +1,985 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EodonPotionContext
|
||||
{
|
||||
public PotionEffect Type { get { return Potion.PotionEffect; } }
|
||||
public DateTime StartTime { get; set; }
|
||||
public DateTime Expires { get; set; }
|
||||
public EodonianPotion Potion { get; set; }
|
||||
|
||||
public Timer Timer { get; set; }
|
||||
|
||||
public EodonPotionContext(EodonianPotion potion)
|
||||
{
|
||||
Potion = potion;
|
||||
Expires = DateTime.UtcNow + potion.Cooldown;
|
||||
StartTime = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void OnTick(Mobile m)
|
||||
{
|
||||
if (DateTime.UtcNow >= Expires)
|
||||
{
|
||||
Potion.EndEffects(m);
|
||||
}
|
||||
else
|
||||
Potion.OnTick(m);
|
||||
}
|
||||
|
||||
public void StopTimer()
|
||||
{
|
||||
if (Timer != null)
|
||||
{
|
||||
Timer.Stop();
|
||||
Timer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class EodonianPotion : BasePotion
|
||||
{
|
||||
public static Dictionary<Mobile, List<EodonPotionContext>> Contexts { get; set; }
|
||||
public static Timer Timer { get; set; }
|
||||
|
||||
public virtual TimeSpan Cooldown { get { return TimeSpan.FromMinutes(20); } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (this.PotionEffect)
|
||||
{
|
||||
default:
|
||||
case PotionEffect.Barrab: return 1156724;
|
||||
case PotionEffect.Jukari: return 1156726;
|
||||
case PotionEffect.Kurak: return 1156728;
|
||||
case PotionEffect.Barako: return 1156729;
|
||||
case PotionEffect.Urali: return 1156734;
|
||||
case PotionEffect.Sakkhra: return 1156732;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
EventSink.PlayerDeath += new PlayerDeathEventHandler(EventSink_PlayerDeath);
|
||||
}
|
||||
|
||||
public EodonianPotion(int id, PotionEffect effect)
|
||||
: base(id, effect)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Drink(Mobile m)
|
||||
{
|
||||
if (CanDoEffects(m))
|
||||
{
|
||||
m.FixedEffect(0x375A, 10, 15);
|
||||
m.PlaySound(0x1E7);
|
||||
|
||||
DoEffects(m);
|
||||
BasePotion.PlayDrinkEffect(m);
|
||||
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnTick(Mobile m)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool CanDoEffects(Mobile m)
|
||||
{
|
||||
if (IsUnderEffects(m, this.PotionEffect))
|
||||
{
|
||||
m.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void DoEffects(Mobile m)
|
||||
{
|
||||
if (Contexts == null)
|
||||
Contexts = new Dictionary<Mobile, List<EodonPotionContext>>();
|
||||
|
||||
if (!Contexts.ContainsKey(m) || Contexts[m] == null)
|
||||
Contexts[m] = new List<EodonPotionContext>();
|
||||
|
||||
AddBuff(m);
|
||||
|
||||
Contexts[m].Add(new EodonPotionContext(this));
|
||||
BeginTimer();
|
||||
}
|
||||
|
||||
public virtual void EndEffects(Mobile m)
|
||||
{
|
||||
RemoveContext(m);
|
||||
}
|
||||
|
||||
public void RemoveContext(Mobile m)
|
||||
{
|
||||
EodonPotionContext context = GetContext(m, this.PotionEffect);
|
||||
|
||||
if (context != null)
|
||||
RemoveContext(m, context);
|
||||
}
|
||||
|
||||
public virtual void AddBuff(Mobile m)
|
||||
{
|
||||
switch (this.PotionEffect)
|
||||
{
|
||||
case PotionEffect.Barrab:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BarrabHemolymphConcentrate, LabelNumber, 1156738,"100\t10\t10\t5")); break;
|
||||
case PotionEffect.Jukari:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.JukariBurnPoiltice, LabelNumber, 1156739,"10\t10\t10\t5")); break;
|
||||
case PotionEffect.Kurak:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.KurakAmbushersEssence, LabelNumber, 1156740,"200")); break;
|
||||
case PotionEffect.Barako:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.BarakoDraftOfMight, LabelNumber, 1156741,"10\t10\t5\t10")); break;
|
||||
case PotionEffect.Urali:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.UraliTranceTonic, LabelNumber, 1156742,"10\t10\t10\t5")); break;
|
||||
case PotionEffect.Sakkhra:
|
||||
BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.SakkhraProphylaxis, LabelNumber, 1156743,"10\t10\t5\t10")); break;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void RemoveBuff(Mobile m)
|
||||
{
|
||||
switch (this.PotionEffect)
|
||||
{
|
||||
case PotionEffect.Barrab:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.BarrabHemolymphConcentrate); break;
|
||||
case PotionEffect.Jukari:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.JukariBurnPoiltice); break;
|
||||
case PotionEffect.Kurak:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.KurakAmbushersEssence); break;
|
||||
case PotionEffect.Barako:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.BarakoDraftOfMight); break;
|
||||
case PotionEffect.Urali:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.UraliTranceTonic); break;
|
||||
case PotionEffect.Sakkhra:
|
||||
BuffInfo.RemoveBuff(m, BuffIcon.SakkhraProphylaxis); break;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsUnderEffects(Mobile m, PotionEffect effect)
|
||||
{
|
||||
return GetContext(m, effect) != null;
|
||||
}
|
||||
|
||||
public static void RemoveEffects(Mobile m, PotionEffect effect)
|
||||
{
|
||||
RemoveContext(m, GetContext(m, effect));
|
||||
}
|
||||
|
||||
public static EodonPotionContext GetContext(Mobile m, PotionEffect effect)
|
||||
{
|
||||
if (m == null)
|
||||
return null;
|
||||
|
||||
if (Contexts == null || !Contexts.ContainsKey(m) || Contexts[m] == null)
|
||||
return null;
|
||||
|
||||
return Contexts[m].FirstOrDefault(c => c.Type == effect);
|
||||
}
|
||||
|
||||
public static void RemoveContext(Mobile m, PotionEffect effect)
|
||||
{
|
||||
RemoveContext(m, GetContext(m, effect));
|
||||
}
|
||||
|
||||
public static void RemoveContext(Mobile m, EodonPotionContext context)
|
||||
{
|
||||
if (context == null)
|
||||
return;
|
||||
|
||||
if (context.Potion != null)
|
||||
context.Potion.RemoveBuff(m);
|
||||
|
||||
if (Contexts.ContainsKey(m))
|
||||
{
|
||||
if (Contexts[m] != null && Contexts[m].Contains(context))
|
||||
{
|
||||
Contexts[m].Remove(context);
|
||||
}
|
||||
|
||||
if (Contexts[m] == null || Contexts[m].Count == 0)
|
||||
Contexts.Remove(m);
|
||||
|
||||
if (Contexts.Count == 0)
|
||||
EndTimer();
|
||||
|
||||
m.Delta(MobileDelta.WeaponDamage);
|
||||
}
|
||||
}
|
||||
|
||||
public static void BeginTimer()
|
||||
{
|
||||
if (Timer == null || !Timer.Running)
|
||||
{
|
||||
Timer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), OnTick);
|
||||
Timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public static void EndTimer()
|
||||
{
|
||||
if(Timer != null)
|
||||
{
|
||||
Timer.Stop();
|
||||
Timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnTick()
|
||||
{
|
||||
if (Contexts == null)
|
||||
EndTimer();
|
||||
else
|
||||
{
|
||||
var dictionary = new Dictionary<Mobile, List<EodonPotionContext>>(Contexts);
|
||||
|
||||
foreach (var kvp in dictionary)
|
||||
{
|
||||
var contexts = new List<EodonPotionContext>(kvp.Value);
|
||||
|
||||
foreach (var context in contexts)
|
||||
{
|
||||
context.OnTick(kvp.Key);
|
||||
}
|
||||
|
||||
ColUtility.Free(contexts);
|
||||
}
|
||||
|
||||
dictionary.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
|
||||
{
|
||||
if (Contexts != null)
|
||||
{
|
||||
if (e.Mobile != null && Contexts.ContainsKey(e.Mobile))
|
||||
Contexts.Remove(e.Mobile);
|
||||
|
||||
if (Contexts.Count == 0)
|
||||
EndTimer();
|
||||
}
|
||||
}
|
||||
|
||||
public EodonianPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BarrabHemolymphConcentrate : EodonianPotion
|
||||
{
|
||||
[Constructable]
|
||||
public BarrabHemolymphConcentrate() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public BarrabHemolymphConcentrate(int amount)
|
||||
: base(3846, PotionEffect.Barrab)
|
||||
{
|
||||
Hue = 1272;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override bool CanDoEffects(Mobile m)
|
||||
{
|
||||
if (MortalStrike.IsWounded(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1156869); // You may not use this with a mortal wound!
|
||||
}
|
||||
else if (m.Poison != null)
|
||||
{
|
||||
m.SendLocalizedMessage(1156868); // You may not use this while poisoned!
|
||||
}
|
||||
else if (Server.Spells.Bushido.Confidence.IsConfident(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1156873); // You may not use this while under the effects of confidence!
|
||||
}
|
||||
|
||||
return base.CanDoEffects(m);
|
||||
}
|
||||
|
||||
public static int GetHitBuff(Mobile m)
|
||||
{
|
||||
EodonPotionContext c = GetContext(m, PotionEffect.Barrab);
|
||||
|
||||
if (c != null && c.StartTime + TimeSpan.FromMinutes(5) > DateTime.UtcNow)
|
||||
return 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int HPRegenBonus(Mobile m)
|
||||
{
|
||||
EodonPotionContext c = GetContext(m, PotionEffect.Barrab);
|
||||
|
||||
if (c != null && c.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow)
|
||||
return 100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public BarrabHemolymphConcentrate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class JukariBurnPoiltice : EodonianPotion
|
||||
{
|
||||
[Constructable]
|
||||
public JukariBurnPoiltice() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public JukariBurnPoiltice(int amount)
|
||||
: base(3846, PotionEffect.Jukari)
|
||||
{
|
||||
Hue = 2727;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void DoEffects(Mobile m)
|
||||
{
|
||||
base.DoEffects(m);
|
||||
|
||||
ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, 10);
|
||||
m.AddResistanceMod(mod);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod));
|
||||
}
|
||||
|
||||
public static int GetStamBuff(Mobile m)
|
||||
{
|
||||
EodonPotionContext c = GetContext(m, PotionEffect.Jukari);
|
||||
|
||||
if (c != null && c.StartTime + TimeSpan.FromMinutes(5) > DateTime.UtcNow)
|
||||
return 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public JukariBurnPoiltice(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class KurakAmbushersEssence : EodonianPotion
|
||||
{
|
||||
public override TimeSpan Cooldown { get { return TimeSpan.FromMinutes(10); } }
|
||||
|
||||
[Constructable]
|
||||
public KurakAmbushersEssence() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public KurakAmbushersEssence(int amount)
|
||||
: base(3846, PotionEffect.Kurak)
|
||||
{
|
||||
Hue = 1260;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public KurakAmbushersEssence(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BarakoDraftOfMight : EodonianPotion
|
||||
{
|
||||
[Constructable]
|
||||
public BarakoDraftOfMight() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public BarakoDraftOfMight(int amount)
|
||||
: base(3846, PotionEffect.Barako)
|
||||
{
|
||||
Hue = 1072;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void DoEffects(Mobile m)
|
||||
{
|
||||
base.DoEffects(m);
|
||||
|
||||
ResistanceMod mod1 = new ResistanceMod(ResistanceType.Physical, 10);
|
||||
m.AddResistanceMod(mod1);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod1));
|
||||
|
||||
ResistanceMod mod2 = new ResistanceMod(ResistanceType.Cold, 5);
|
||||
m.AddResistanceMod(mod1);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod2));
|
||||
}
|
||||
|
||||
public BarakoDraftOfMight(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class UraliTranceTonic : EodonianPotion
|
||||
{
|
||||
[Constructable]
|
||||
public UraliTranceTonic() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public UraliTranceTonic(int amount)
|
||||
: base(3846, PotionEffect.Urali)
|
||||
{
|
||||
Hue = 1098;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void DoEffects(Mobile m)
|
||||
{
|
||||
base.DoEffects(m);
|
||||
|
||||
//TODO: Message?
|
||||
}
|
||||
|
||||
public override void OnTick(Mobile m)
|
||||
{
|
||||
var context = GetContext(m, this.PotionEffect);
|
||||
|
||||
if (context != null && context.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow)
|
||||
{
|
||||
m.Mana += 10;
|
||||
//TODO: Message?
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetManaBuff(Mobile m)
|
||||
{
|
||||
EodonPotionContext c = GetContext(m, PotionEffect.Urali);
|
||||
|
||||
if (c != null && c.StartTime + TimeSpan.FromMinutes(5) > DateTime.UtcNow)
|
||||
return 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public UraliTranceTonic(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SakkhraProphylaxisPotion : EodonianPotion
|
||||
{
|
||||
[Constructable]
|
||||
public SakkhraProphylaxisPotion() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public SakkhraProphylaxisPotion(int amount)
|
||||
: base(3846, PotionEffect.Sakkhra)
|
||||
{
|
||||
Hue = 2531;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override void DoEffects(Mobile m)
|
||||
{
|
||||
base.DoEffects(m);
|
||||
|
||||
ResistanceMod mod1 = new ResistanceMod(ResistanceType.Poison, 10);
|
||||
m.AddResistanceMod(mod1);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod1));
|
||||
|
||||
ResistanceMod mod2 = new ResistanceMod(ResistanceType.Energy, 5);
|
||||
m.AddResistanceMod(mod2);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), () => m.RemoveResistanceMod(mod2));
|
||||
}
|
||||
|
||||
public SakkhraProphylaxisPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
// resources
|
||||
public class MyrmidexEggsac : Item, ICommodity
|
||||
{
|
||||
public override int LabelNumber { get { return 1156725; } } // Myrmidex Eggsac
|
||||
|
||||
[Constructable]
|
||||
public MyrmidexEggsac() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public MyrmidexEggsac(int amount)
|
||||
: base(10248)
|
||||
{
|
||||
Hue = 1272;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public MyrmidexEggsac(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LavaBerry : Item
|
||||
{
|
||||
// TODO: Harvested near Jukari Village
|
||||
public override int LabelNumber { get { return 1156727; } } // Lava Berry
|
||||
|
||||
[Constructable]
|
||||
public LavaBerry() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public LavaBerry(int amount)
|
||||
: base(22326)
|
||||
{
|
||||
Hue = 1955;
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public LavaBerry(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LavaBerryBush : Item
|
||||
{
|
||||
// TODO: Harvested near Jukari Village
|
||||
public override int LabelNumber { get { return 1156735; } } // Lava Berry Bush
|
||||
|
||||
[Constructable]
|
||||
public LavaBerryBush()
|
||||
: base(Utility.RandomBool() ? 0xDC4 : 0xDC5)
|
||||
{
|
||||
Hue = 2075;
|
||||
Movable = false;
|
||||
Weight = 0.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.Location, 2))
|
||||
{
|
||||
var berry = new LavaBerry(1);
|
||||
from.AddToBackpack(berry);
|
||||
from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156736, "#1156727", from.NetState);
|
||||
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
|
||||
public LavaBerryBush(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PerfectBanana : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1156730; } } // Perfect Bananas
|
||||
|
||||
[Constructable]
|
||||
public PerfectBanana() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public PerfectBanana(int amount)
|
||||
: base(5922)
|
||||
{
|
||||
Hue = 1119;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public PerfectBanana(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RiverMossDecorate : Item
|
||||
{
|
||||
// TODO: Harvested near Urali Village
|
||||
public override int LabelNumber { get { return 1156731; } } // River Moss
|
||||
|
||||
[Constructable]
|
||||
public RiverMossDecorate()
|
||||
: base(3378)
|
||||
{
|
||||
Hue = 1272;
|
||||
Movable = false;
|
||||
Weight = 0.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.Location, 2))
|
||||
{
|
||||
var rm = new RiverMoss(1);
|
||||
from.AddToBackpack(rm);
|
||||
from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156736, "#1156731", from.NetState);
|
||||
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
|
||||
public RiverMossDecorate(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class RiverMoss : Item, ICommodity
|
||||
{
|
||||
// TODO: Harvested near Urali Village
|
||||
public override int LabelNumber { get { return 1156731; } } // River Moss
|
||||
|
||||
[Constructable]
|
||||
public RiverMoss() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public RiverMoss(int amount)
|
||||
: base(22333)
|
||||
{
|
||||
Hue = 1272;
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public RiverMoss(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BlueCorn : EarOfCorn
|
||||
{
|
||||
// TODO: Harvestable from Sakkhra corn fields
|
||||
public override int LabelNumber { get { return 1156733; } } // Blue Corn
|
||||
|
||||
[Constructable]
|
||||
public BlueCorn() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public BlueCorn(int amount)
|
||||
{
|
||||
Hue = 1284;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public BlueCorn(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CornStalk : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1035639; } } // corn stalk
|
||||
private int m_Used;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Used
|
||||
{
|
||||
get { return m_Used; }
|
||||
set { m_Used = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CornStalk()
|
||||
: base(3197)
|
||||
{
|
||||
m_Used = Utility.RandomMinMax(1, 4);
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(this.Location, 3))
|
||||
{
|
||||
Item corn;
|
||||
|
||||
if (Utility.RandomDouble() < 0.70)
|
||||
{
|
||||
corn = new EarOfCorn(1);
|
||||
from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156736, "#1156737", from.NetState);
|
||||
}
|
||||
else
|
||||
{
|
||||
corn = new BlueCorn(1);
|
||||
from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156736, "#1156733", from.NetState);
|
||||
}
|
||||
|
||||
from.AddToBackpack(corn);
|
||||
|
||||
if (Used > 1)
|
||||
{
|
||||
Used--;
|
||||
}
|
||||
else
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public CornStalk(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)m_Used);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_Used = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class MoonstoneCrystalShard : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1124142; } } // Moonstone Crystal Shards
|
||||
|
||||
[Constructable]
|
||||
public MoonstoneCrystalShard() : this(1) { }
|
||||
|
||||
[Constructable]
|
||||
public MoonstoneCrystalShard(int amount)
|
||||
: base(40118)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public MoonstoneCrystalShard(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/EvilOmenScroll.cs
Normal file
38
Scripts/Items/Consumables/EvilOmenScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class EvilOmenScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public EvilOmenScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public EvilOmenScroll(int amount)
|
||||
: base(104, 0x2264, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public EvilOmenScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ExorcismScroll.cs
Normal file
38
Scripts/Items/Consumables/ExorcismScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExorcismScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ExorcismScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ExorcismScroll(int amount)
|
||||
: base(116, 0x2270, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ExorcismScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Consumables/ExplodingTarPotion.cs
Normal file
35
Scripts/Items/Consumables/ExplodingTarPotion.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExplodingTarPotion : BaseExplodingTarPotion
|
||||
{
|
||||
public override int Radius{ get{ return 20; } }
|
||||
|
||||
public override int LabelNumber{ get{ return 1095147; } } // a Greater Confusion Blast potion
|
||||
|
||||
[Constructable]
|
||||
public ExplodingTarPotion() : base( PotionEffect.ExplodingTarPotion )
|
||||
{
|
||||
}
|
||||
|
||||
public ExplodingTarPotion( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Consumables/ExplosionPotion.cs
Normal file
46
Scripts/Items/Consumables/ExplosionPotion.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExplosionPotion : BaseExplosionPotion
|
||||
{
|
||||
[Constructable]
|
||||
public ExplosionPotion()
|
||||
: base(PotionEffect.Explosion)
|
||||
{
|
||||
}
|
||||
|
||||
public ExplosionPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int MinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
public override int MaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/ExplosionScroll.cs
Normal file
38
Scripts/Items/Consumables/ExplosionScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ExplosionScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public ExplosionScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ExplosionScroll(int amount)
|
||||
: base(42, 0x1F57, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public ExplosionScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
222
Scripts/Items/Consumables/FearEssence.cs
Normal file
222
Scripts/Items/Consumables/FearEssence.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FearEssence : BasePotion
|
||||
{
|
||||
public override int LabelNumber { get { return 1115744; } } // fear essence
|
||||
public virtual int Radius { get { return 20; } }
|
||||
public override bool RequireFreeHand { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public FearEssence()
|
||||
: base(0xF0D, PotionEffect.FearEssence)
|
||||
{
|
||||
Hue = 5;
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public FearEssence(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
|
||||
{
|
||||
from.SendLocalizedMessage(1062725); // You can not use that potion while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
int delay = GetDelay(from);
|
||||
|
||||
if (delay > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1072529, string.Format("{0}\t{1}", delay, delay > 1 ? "seconds." : "second.")); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
|
||||
return;
|
||||
}
|
||||
|
||||
ThrowTarget targ = from.Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
return;
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private List<Mobile> m_Users = new List<Mobile>();
|
||||
|
||||
public void Explode_Callback(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
Explode((Mobile)states[0], (Point3D)states[1], (Map)states[2]);
|
||||
}
|
||||
|
||||
public virtual void Explode(Mobile from, Point3D loc, Map map)
|
||||
{
|
||||
if (Deleted || map == null)
|
||||
return;
|
||||
|
||||
Consume();
|
||||
|
||||
// Check if any other players are using this potion
|
||||
for (int i = 0; i < m_Users.Count; i++)
|
||||
{
|
||||
ThrowTarget targ = m_Users[i].Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Potion == this)
|
||||
Target.Cancel(from);
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(TarEffect), new object[] { loc, map });
|
||||
IPooledEnumerable eable = map.GetMobilesInRange(loc, Radius);
|
||||
|
||||
foreach (Mobile mobile in eable)
|
||||
{
|
||||
if (mobile != from && from.CanBeHarmful(mobile, false))
|
||||
{
|
||||
double chance = (double)(((4 * mobile.Skills[SkillName.MagicResist].Value) + 150) / 700);
|
||||
|
||||
if (chance < Utility.RandomDouble())
|
||||
{
|
||||
mobile.SendLocalizedMessage(1115815); // You resist the effects of the Fear Essence.
|
||||
}
|
||||
else
|
||||
{
|
||||
Point3D p = mobile.Location;
|
||||
Effects.SendPacket(p, mobile.Map, new ParticleEffect(EffectType.FixedFrom, Serial, Serial.Zero, 0x376A, p, p, 9, 32, false, false, 0, 0, 0, 5039, 1, Serial.Zero, 254, 0));
|
||||
mobile.Damage(0, from);
|
||||
mobile.Paralyze(TimeSpan.FromSeconds(3));
|
||||
from.DoHarmful(mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
#region Effects
|
||||
public virtual void TarEffect(object state)
|
||||
{
|
||||
object[] states = (object[])state;
|
||||
|
||||
Point3D p = (Point3D)states[0];
|
||||
Map map = (Map)states[1];
|
||||
|
||||
Effects.PlaySound((Point3D)states[0], (Map)states[1], 1619);
|
||||
|
||||
for (int x = -4; x <= 4; x++)
|
||||
{
|
||||
for (int y = -1; y <= 1; y++)
|
||||
{
|
||||
Effects.SendPacket(p, map, new HuedEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x3E03, p, new Point3D(p.X + x, p.Y + y, p.Z), 0, 0, false, false, 5, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delay
|
||||
private static Hashtable m_Delay = new Hashtable();
|
||||
|
||||
public static void AddDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
timer.Stop();
|
||||
|
||||
m_Delay[m] = Timer.DelayCall(TimeSpan.FromSeconds(60), new TimerStateCallback(EndDelay_Callback), m);
|
||||
}
|
||||
|
||||
public static int GetDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null && timer.Next > DateTime.UtcNow)
|
||||
return (int)(timer.Next - DateTime.UtcNow).TotalSeconds;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void EndDelay_Callback(object obj)
|
||||
{
|
||||
if (obj is Mobile)
|
||||
EndDelay((Mobile)obj);
|
||||
}
|
||||
|
||||
public static void EndDelay(Mobile m)
|
||||
{
|
||||
Timer timer = m_Delay[m] as Timer;
|
||||
|
||||
if (timer != null)
|
||||
{
|
||||
timer.Stop();
|
||||
m_Delay.Remove(m);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
public FearEssence Potion { get; }
|
||||
|
||||
public ThrowTarget(FearEssence potion)
|
||||
: base(12, true, TargetFlags.Harmful)
|
||||
{
|
||||
Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (Potion.Deleted || Potion.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if (p == null || from.Map == null)
|
||||
return;
|
||||
|
||||
// Add delay
|
||||
AddDelay(from);
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
if (p is Mobile)
|
||||
to = (Mobile)p;
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), from.Map);
|
||||
|
||||
Effects.SendMovingEffect(from, to, Potion.ItemID, 7, 0, false, false, Potion.Hue, 0);
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(Potion.Explode_Callback), new object[] { from, new Point3D(p), from.Map });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/FeeblemindScroll.cs
Normal file
38
Scripts/Items/Consumables/FeeblemindScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FeeblemindScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public FeeblemindScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FeeblemindScroll(int amount)
|
||||
: base(2, 0x1F30, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public FeeblemindScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/FireFieldScroll.cs
Normal file
38
Scripts/Items/Consumables/FireFieldScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FireFieldScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public FireFieldScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FireFieldScroll(int amount)
|
||||
: base(27, 0x1F48, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public FireFieldScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/FireballScroll.cs
Normal file
38
Scripts/Items/Consumables/FireballScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FireballScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public FireballScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FireballScroll(int amount)
|
||||
: base(17, 0x1F3E, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public FireballScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
327
Scripts/Items/Consumables/Firebomb.cs
Normal file
327
Scripts/Items/Consumables/Firebomb.cs
Normal file
@@ -0,0 +1,327 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Firebomb : Item
|
||||
{
|
||||
private Timer m_Timer;
|
||||
private int m_Ticks = 0;
|
||||
private Mobile m_LitBy;
|
||||
private List<Mobile> m_Users;
|
||||
[Constructable]
|
||||
public Firebomb()
|
||||
: this(0x99B)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Firebomb(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
//Name = "a firebomb";
|
||||
Weight = 2.0;
|
||||
Hue = 1260;
|
||||
}
|
||||
|
||||
public Firebomb(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
|
||||
{
|
||||
// to prevent exploiting for pvp
|
||||
from.SendLocalizedMessage(1075857); // You cannot use that while paralyzed.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Timer == null)
|
||||
{
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), new TimerCallback(OnFirebombTimerTick));
|
||||
m_LitBy = from;
|
||||
from.SendLocalizedMessage(1060582); // You light the firebomb. Throw it now!
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1060581); // You've already lit it! Better throw it now!
|
||||
|
||||
if (m_Users == null)
|
||||
m_Users = new List<Mobile>();
|
||||
|
||||
if (!m_Users.Contains(from))
|
||||
m_Users.Add(from);
|
||||
|
||||
from.Target = new ThrowTarget(this);
|
||||
}
|
||||
|
||||
private void OnFirebombTimerTick()
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Map == Map.Internal && HeldBy == null)
|
||||
return;
|
||||
|
||||
switch ( m_Ticks )
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
{
|
||||
++m_Ticks;
|
||||
|
||||
if (HeldBy != null)
|
||||
HeldBy.PublicOverheadMessage(MessageType.Regular, 957, false, m_Ticks.ToString());
|
||||
else if (RootParent == null)
|
||||
PublicOverheadMessage(MessageType.Regular, 957, false, m_Ticks.ToString());
|
||||
else if (RootParent is Mobile)
|
||||
((Mobile)RootParent).PublicOverheadMessage(MessageType.Regular, 957, false, m_Ticks.ToString());
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (HeldBy != null)
|
||||
HeldBy.DropHolding();
|
||||
|
||||
if (m_Users != null)
|
||||
{
|
||||
foreach (Mobile m in m_Users)
|
||||
{
|
||||
ThrowTarget targ = m.Target as ThrowTarget;
|
||||
|
||||
if (targ != null && targ.Bomb == this)
|
||||
Target.Cancel(m);
|
||||
}
|
||||
|
||||
m_Users.Clear();
|
||||
m_Users = null;
|
||||
}
|
||||
|
||||
if (RootParent is Mobile)
|
||||
{
|
||||
Mobile parent = (Mobile)RootParent;
|
||||
parent.SendLocalizedMessage(1060583); // The firebomb explodes in your hand!
|
||||
AOS.Damage(parent, Utility.Random(3) + 4, 0, 100, 0, 0, 0);
|
||||
}
|
||||
else if (RootParent == null)
|
||||
{
|
||||
var targets = GetTargets();
|
||||
|
||||
foreach (var victim in targets)
|
||||
{
|
||||
if (m_LitBy != null)
|
||||
m_LitBy.DoHarmful(victim);
|
||||
|
||||
AOS.Damage(victim, m_LitBy, Utility.Random(3) + 4, 0, 100, 0, 0, 0);
|
||||
}
|
||||
|
||||
new FirebombField(m_LitBy, targets.ToList()).MoveToWorld(Location, Map);
|
||||
}
|
||||
|
||||
m_Timer.Stop();
|
||||
Delete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<Mobile> GetTargets()
|
||||
{
|
||||
if (Map == null)
|
||||
yield break;
|
||||
|
||||
IPooledEnumerable eable = Map.GetMobilesInRange(Location, 1);
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (m_LitBy == null || (SpellHelper.ValidIndirectTarget(m_LitBy, m) && m_LitBy.CanBeHarmful(m, false)))
|
||||
{
|
||||
yield return m;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
private void OnFirebombTarget(Mobile from, object obj)
|
||||
{
|
||||
if (Deleted || Map == Map.Internal || !IsChildOf(from.Backpack))
|
||||
return;
|
||||
|
||||
IPoint3D p = obj as IPoint3D;
|
||||
|
||||
if (p == null)
|
||||
return;
|
||||
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
from.RevealingAction();
|
||||
|
||||
IEntity to;
|
||||
|
||||
if (p is Mobile)
|
||||
to = (Mobile)p;
|
||||
else
|
||||
to = new Entity(Serial.Zero, new Point3D(p), Map);
|
||||
|
||||
Effects.SendMovingEffect(from, to, ItemID, 7, 0, false, false, Hue, 0);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(FirebombReposition_OnTick), new object[] { p, Map });
|
||||
Internalize();
|
||||
}
|
||||
|
||||
private void FirebombReposition_OnTick(object state)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
object[] states = (object[])state;
|
||||
IPoint3D p = (IPoint3D)states[0];
|
||||
Map map = (Map)states[1];
|
||||
|
||||
MoveToWorld(new Point3D(p), map);
|
||||
}
|
||||
|
||||
private class ThrowTarget : Target
|
||||
{
|
||||
private readonly Firebomb m_Bomb;
|
||||
public ThrowTarget(Firebomb bomb)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Bomb = bomb;
|
||||
}
|
||||
|
||||
public Firebomb Bomb
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bomb;
|
||||
}
|
||||
}
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
m_Bomb.OnFirebombTarget(from, targeted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class FirebombField : Item
|
||||
{
|
||||
private readonly List<Mobile> m_Burning;
|
||||
private readonly Timer m_Timer;
|
||||
private readonly Mobile m_LitBy;
|
||||
private readonly DateTime m_Expire;
|
||||
|
||||
public FirebombField(Mobile litBy, List<Mobile> toDamage)
|
||||
: base(0x376A)
|
||||
{
|
||||
Movable = false;
|
||||
m_LitBy = litBy;
|
||||
m_Expire = DateTime.UtcNow + TimeSpan.FromSeconds(10);
|
||||
m_Burning = toDamage;
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), new TimerCallback(OnFirebombFieldTimerTick));
|
||||
}
|
||||
|
||||
public FirebombField(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
// Don't serialize these...
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (ItemID == 0x398C && m_LitBy == null || (SpellHelper.ValidIndirectTarget(m_LitBy, m) && m_LitBy.CanBeHarmful(m, false)))
|
||||
{
|
||||
if (m_LitBy != null)
|
||||
m_LitBy.DoHarmful(m);
|
||||
|
||||
AOS.Damage(m, m_LitBy, 2, 0, 100, 0, 0, 0);
|
||||
m.PlaySound(0x208);
|
||||
|
||||
if (!m_Burning.Contains(m))
|
||||
m_Burning.Add(m);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnFirebombFieldTimerTick()
|
||||
{
|
||||
if (Deleted)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ItemID == 0x376A)
|
||||
{
|
||||
ItemID = 0x398C;
|
||||
return;
|
||||
}
|
||||
|
||||
Mobile victim;
|
||||
for (int i = 0; i < m_Burning.Count;)
|
||||
{
|
||||
victim = m_Burning[i];
|
||||
|
||||
if (victim.Location == Location && victim.Map == Map && (m_LitBy == null || (SpellHelper.ValidIndirectTarget(m_LitBy, victim) && m_LitBy.CanBeHarmful(victim, false))))
|
||||
{
|
||||
if (m_LitBy != null)
|
||||
m_LitBy.DoHarmful(victim);
|
||||
|
||||
AOS.Damage(victim, m_LitBy, Utility.Random(3) + 4, 0, 100, 0, 0, 0);
|
||||
++i;
|
||||
}
|
||||
else
|
||||
m_Burning.RemoveAt(i);
|
||||
}
|
||||
|
||||
if (DateTime.UtcNow >= m_Expire)
|
||||
{
|
||||
m_Timer.Stop();
|
||||
Delete();
|
||||
|
||||
ColUtility.Free(m_Burning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Consumables/Fish Steak.cs
Normal file
36
Scripts/Items/Consumables/Fish Steak.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegFishSteak : FishSteak
|
||||
{
|
||||
[Constructable]
|
||||
public BegFishSteak()
|
||||
{
|
||||
}
|
||||
|
||||
public BegFishSteak(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
Scripts/Items/Consumables/FlamestrikeScroll.cs
Normal file
38
Scripts/Items/Consumables/FlamestrikeScroll.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FlamestrikeScroll : SpellScroll
|
||||
{
|
||||
[Constructable]
|
||||
public FlamestrikeScroll()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlamestrikeScroll(int amount)
|
||||
: base(50, 0x1F5F, amount)
|
||||
{
|
||||
}
|
||||
|
||||
public FlamestrikeScroll(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Scripts/Items/Consumables/FlowerGarland.cs
Normal file
37
Scripts/Items/Consumables/FlowerGarland.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegFlowerGarland : FlowerGarland
|
||||
{
|
||||
[Constructable]
|
||||
public BegFlowerGarland()
|
||||
{
|
||||
ItemID = Utility.RandomDouble() > .5 ? 8965 : 8966;
|
||||
}
|
||||
|
||||
public BegFlowerGarland(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
1864
Scripts/Items/Consumables/Food.cs
Normal file
1864
Scripts/Items/Consumables/Food.cs
Normal file
File diff suppressed because it is too large
Load Diff
113
Scripts/Items/Consumables/ForgedPardon.cs
Normal file
113
Scripts/Items/Consumables/ForgedPardon.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ForgedPardon : Item
|
||||
{
|
||||
public static Dictionary<Mobile, DateTime> Table { get { return m_Table; } }
|
||||
private static Dictionary<Mobile, DateTime> m_Table = new Dictionary<Mobile, DateTime>();
|
||||
|
||||
public override int LabelNumber { get { return 1116234; } }
|
||||
|
||||
[Constructable]
|
||||
public ForgedPardon()
|
||||
: base(10289)
|
||||
{
|
||||
Hue = 1177;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
from.SendLocalizedMessage(1042004); //That must be in your pack for you to use it.
|
||||
else if (from.Kills <= 0)
|
||||
from.SendMessage("You have no use for this item.");
|
||||
else if (CanUsePardon(from))
|
||||
{
|
||||
from.Kills--;
|
||||
|
||||
from.SendLocalizedMessage(1116208); // Your murder count has been successfully updated.
|
||||
Delete();
|
||||
m_Table[from] = DateTime.UtcNow + TimeSpan.FromHours(24);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CanUsePardon(Mobile from)
|
||||
{
|
||||
Defrag();
|
||||
if (m_Table.ContainsKey(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1116587); //You must wait 24 hours before using another forged pardon.
|
||||
return false;
|
||||
}
|
||||
if (Server.Spells.SpellHelper.CheckCombat(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1116588); //You cannot use a forged pardon while in combat.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void Defrag()
|
||||
{
|
||||
List<Mobile> toRemove = new List<Mobile>();
|
||||
foreach (KeyValuePair<Mobile, DateTime> kvp in m_Table)
|
||||
{
|
||||
if (kvp.Value < DateTime.UtcNow)
|
||||
toRemove.Add(kvp.Key);
|
||||
}
|
||||
|
||||
foreach (Mobile mob in toRemove)
|
||||
m_Table.Remove(mob);
|
||||
}
|
||||
|
||||
public ForgedPardon(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();
|
||||
}
|
||||
|
||||
public static void Save(GenericWriter writer)
|
||||
{
|
||||
writer.Write((int)0);
|
||||
|
||||
Defrag();
|
||||
writer.Write(m_Table.Count);
|
||||
foreach (KeyValuePair<Mobile, DateTime> kvp in m_Table)
|
||||
{
|
||||
writer.Write(kvp.Key);
|
||||
writer.Write(kvp.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Load(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Mobile mob = reader.ReadMobile();
|
||||
DateTime dt = reader.ReadDateTime();
|
||||
|
||||
if (mob != null && dt > DateTime.UtcNow)
|
||||
m_Table.Add(mob, dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Consumables/FrenchBread.cs
Normal file
35
Scripts/Items/Consumables/FrenchBread.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegFrenchBread : FrenchBread
|
||||
{
|
||||
[Constructable]
|
||||
public BegFrenchBread()
|
||||
{
|
||||
}
|
||||
|
||||
public BegFrenchBread(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1075129); // Acquired by begging
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
65
Scripts/Items/Consumables/FruitBowl.cs
Normal file
65
Scripts/Items/Consumables/FruitBowl.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FruitBowl : Food, ICommodity
|
||||
{
|
||||
[Constructable]
|
||||
public FruitBowl()
|
||||
: base(0x2D4F)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.FillFactor = 20;
|
||||
}
|
||||
|
||||
public FruitBowl(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1072950;
|
||||
}
|
||||
}// fruit bowl
|
||||
public override bool Eat(Mobile from)
|
||||
{
|
||||
if (FillHunger(from, this.FillFactor))
|
||||
{
|
||||
string modName = this.Serial.ToString();
|
||||
|
||||
from.AddStatMod(new StatMod(StatType.Str, modName + "Str", 5, TimeSpan.FromSeconds(120)));
|
||||
from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 5, TimeSpan.FromSeconds(120)));
|
||||
from.AddStatMod(new StatMod(StatType.Int, modName + "Int", 5, TimeSpan.FromSeconds(120)));
|
||||
|
||||
from.PlaySound(0x1EA);
|
||||
from.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
|
||||
|
||||
this.Consume();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user