Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
146
Scripts/Items/Tools/AncientSmithyHammer.cs
Normal file
146
Scripts/Items/Tools/AncientSmithyHammer.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x13E4, 0x13E3)]
|
||||
public class AncientSmithyHammer : BaseTool
|
||||
{
|
||||
private int m_Bonus;
|
||||
private SkillMod m_SkillMod;
|
||||
[Constructable]
|
||||
public AncientSmithyHammer(int bonus)
|
||||
: this(bonus, 600)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public AncientSmithyHammer(int bonus, int uses)
|
||||
: base(uses, 0x13E4)
|
||||
{
|
||||
m_Bonus = bonus;
|
||||
Weight = 8.0;
|
||||
Layer = Layer.OneHanded;
|
||||
Hue = 0x482;
|
||||
}
|
||||
|
||||
public AncientSmithyHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Bonus
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Bonus;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bonus = value;
|
||||
InvalidateProperties();
|
||||
|
||||
if (m_Bonus == 0)
|
||||
{
|
||||
if (m_SkillMod != null)
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
else if (m_SkillMod == null && Parent is Mobile)
|
||||
{
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
((Mobile)Parent).AddSkillMod(m_SkillMod);
|
||||
}
|
||||
else if (m_SkillMod != null)
|
||||
{
|
||||
m_SkillMod.Value = m_Bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1045127;
|
||||
}
|
||||
}// ancient smithy hammer
|
||||
public override void OnAdded(object parent)
|
||||
{
|
||||
base.OnAdded(parent);
|
||||
|
||||
if (m_Bonus != 0 && parent is Mobile)
|
||||
{
|
||||
if (m_SkillMod != null)
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
((Mobile)parent).AddSkillMod(m_SkillMod);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
base.OnRemoved(parent);
|
||||
|
||||
if (m_SkillMod != null)
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = null;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Bonus != 0)
|
||||
list.Add(1060451, "#1042354\t{0}", m_Bonus.ToString()); // ~1_skillname~ +~2_val~
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)m_Bonus);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
case 0:
|
||||
{
|
||||
m_Bonus = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Bonus != 0 && Parent is Mobile)
|
||||
{
|
||||
if (m_SkillMod != null)
|
||||
m_SkillMod.Remove();
|
||||
|
||||
m_SkillMod = new DefaultSkillMod(SkillName.Blacksmith, true, m_Bonus);
|
||||
((Mobile)Parent).AddSkillMod(m_SkillMod);
|
||||
}
|
||||
|
||||
if (version == 0 && Hue == 0)
|
||||
Hue = 0x482;
|
||||
}
|
||||
}
|
||||
}
|
||||
318
Scripts/Items/Tools/BagOfSending.cs
Normal file
318
Scripts/Items/Tools/BagOfSending.cs
Normal file
@@ -0,0 +1,318 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum BagOfSendingHue
|
||||
{
|
||||
Yellow,
|
||||
Blue,
|
||||
Red
|
||||
}
|
||||
|
||||
public class BagOfSending : Item, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private BagOfSendingHue m_BagOfSendingHue;
|
||||
[Constructable]
|
||||
public BagOfSending()
|
||||
: this(RandomHue())
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BagOfSending(BagOfSendingHue hue)
|
||||
: base(0xE76)
|
||||
{
|
||||
Weight = 2.0;
|
||||
|
||||
BagOfSendingHue = hue;
|
||||
|
||||
m_Charges = Utility.RandomMinMax(3, 9);
|
||||
}
|
||||
|
||||
public BagOfSending(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Recharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Recharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 30;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxRecharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 255;
|
||||
}
|
||||
}
|
||||
public string TranslocationItemName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "bag of sending";
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1054104;
|
||||
}
|
||||
}// a bag of sending
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BagOfSendingHue BagOfSendingHue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_BagOfSendingHue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_BagOfSendingHue = value;
|
||||
|
||||
switch ( value )
|
||||
{
|
||||
case BagOfSendingHue.Yellow:
|
||||
Hue = 0x8A5;
|
||||
break;
|
||||
case BagOfSendingHue.Blue:
|
||||
Hue = 0x8AD;
|
||||
break;
|
||||
case BagOfSendingHue.Red:
|
||||
Hue = 0x89B;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static BagOfSendingHue RandomHue()
|
||||
{
|
||||
switch ( Utility.Random(3) )
|
||||
{
|
||||
case 0:
|
||||
return BagOfSendingHue.Yellow;
|
||||
case 1:
|
||||
return BagOfSendingHue.Blue;
|
||||
default:
|
||||
return BagOfSendingHue.Red;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo(from, 1060741, m_Charges.ToString()); // charges: ~1_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive)
|
||||
list.Add(new UseBagEntry(this, Charges > 0 && IsChildOf(from.Backpack)));
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.Region.IsPartOf<Regions.Jail>())
|
||||
{
|
||||
from.SendMessage("You may not do that in jail.");
|
||||
}
|
||||
else if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
|
||||
}
|
||||
else if (Charges == 0)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1042544, 0x59); // This item is out of charges.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new SendTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)1); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Recharges);
|
||||
|
||||
writer.WriteEncodedInt((int)m_Charges);
|
||||
writer.WriteEncodedInt((int)m_BagOfSendingHue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min(reader.ReadEncodedInt(), MaxCharges);
|
||||
m_BagOfSendingHue = (BagOfSendingHue)reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class UseBagEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly BagOfSending m_Bag;
|
||||
public UseBagEntry(BagOfSending bag, bool enabled)
|
||||
: base(6189)
|
||||
{
|
||||
m_Bag = bag;
|
||||
|
||||
if (!enabled)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Bag.Deleted)
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if (from.CheckAlive())
|
||||
m_Bag.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
|
||||
private class SendTarget : Target
|
||||
{
|
||||
private readonly BagOfSending m_Bag;
|
||||
public SendTarget(BagOfSending bag)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Bag = bag;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Bag.Deleted)
|
||||
return;
|
||||
|
||||
if (from.Region.IsPartOf<Regions.Jail>())
|
||||
{
|
||||
from.SendMessage("You may not do that in jail.");
|
||||
}
|
||||
else if (!m_Bag.IsChildOf(from.Backpack))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
|
||||
}
|
||||
else if (m_Bag.Charges == 0)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges.
|
||||
}
|
||||
else if (targeted is Item)
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
int reqCharges = 1; // (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0));
|
||||
// change was ML, however reverted during ML period so we can put it at 1
|
||||
|
||||
if (!item.IsChildOf(from.Backpack))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box.
|
||||
}
|
||||
else if (item is BagOfSending || item is Container)
|
||||
{
|
||||
from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending."));
|
||||
}
|
||||
else if (item.LootType == LootType.Cursed)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item.
|
||||
}
|
||||
else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item.
|
||||
}
|
||||
else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location))
|
||||
{
|
||||
from.SendLocalizedMessage(1062089); // You cannot use that here.
|
||||
}
|
||||
else if (!from.BankBox.TryDropItem(from, item, false))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full.
|
||||
}
|
||||
else if (Core.ML && reqCharges > m_Bag.Charges)
|
||||
{
|
||||
from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Bag.Charges -= (Core.ML ? reqCharges : 1);
|
||||
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
502
Scripts/Items/Tools/BallOfSummoning.cs
Normal file
502
Scripts/Items/Tools/BallOfSummoning.cs
Normal file
@@ -0,0 +1,502 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Ninjitsu;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BallOfSummoning : Item, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private BaseCreature m_Pet;
|
||||
private string m_PetName;
|
||||
[Constructable]
|
||||
public BallOfSummoning()
|
||||
: base(0xE2E)
|
||||
{
|
||||
this.Weight = 10.0;
|
||||
this.Light = LightType.Circle150;
|
||||
|
||||
this.m_Charges = Utility.RandomMinMax(3, 9);
|
||||
|
||||
this.m_PetName = "";
|
||||
}
|
||||
|
||||
public BallOfSummoning(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private delegate void BallCallback(Mobile from);
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > this.MaxCharges)
|
||||
this.m_Charges = this.MaxCharges;
|
||||
else if (value < 0)
|
||||
this.m_Charges = 0;
|
||||
else
|
||||
this.m_Charges = value;
|
||||
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Recharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Recharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > this.MaxRecharges)
|
||||
this.m_Recharges = this.MaxRecharges;
|
||||
else if (value < 0)
|
||||
this.m_Recharges = 0;
|
||||
else
|
||||
this.m_Recharges = value;
|
||||
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxRecharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 255;
|
||||
}
|
||||
}
|
||||
public string TranslocationItemName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "crystal ball of pet summoning";
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseCreature Pet
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.m_Pet != null && this.m_Pet.Deleted)
|
||||
{
|
||||
this.m_Pet = null;
|
||||
this.InternalUpdatePetName();
|
||||
}
|
||||
|
||||
return this.m_Pet;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Pet = value;
|
||||
this.InternalUpdatePetName();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string PetName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_PetName;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1054131, this.m_Charges.ToString() + (this.m_PetName.Length == 0 ? "\t " : "\t" + this.m_PetName)); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
this.LabelTo(from, 1054131, this.m_Charges.ToString() + (this.m_PetName.Length == 0 ? "\t " : "\t" + this.m_PetName)); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && this.RootParent == from)
|
||||
{
|
||||
if (this.Pet == null)
|
||||
{
|
||||
list.Add(new BallEntry(new BallCallback(LinkPet), 6180));
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(new BallEntry(new BallCallback(CastSummonPet), 6181));
|
||||
list.Add(new BallEntry(new BallCallback(UpdatePetName), 6183));
|
||||
list.Add(new BallEntry(new BallCallback(UnlinkPet), 6182));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.RootParent != from) // TODO: Previous implementation allowed use on ground, without house protection checks. What is the correct behavior?
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
AnimalFormContext animalContext = AnimalForm.GetContext(from);
|
||||
|
||||
if (Core.ML && animalContext != null)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1080073); // You cannot use a Crystal Ball of Pet Summoning while in animal form.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.Pet == null)
|
||||
{
|
||||
this.LinkPet(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.CastSummonPet(from);
|
||||
}
|
||||
}
|
||||
|
||||
public void LinkPet(Mobile from)
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if (this.Deleted || pet != null || this.RootParent != from)
|
||||
return;
|
||||
|
||||
from.SendLocalizedMessage(1054114); // Target your pet that you wish to link to this Crystal Ball of Pet Summoning.
|
||||
from.Target = new PetLinkTarget(this);
|
||||
}
|
||||
|
||||
public void CastSummonPet(Mobile from)
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if (this.Deleted || pet == null || this.RootParent != from)
|
||||
return;
|
||||
|
||||
if (this.Charges == 0)
|
||||
{
|
||||
this.SendLocalizedMessageTo(from, 1054122); // The Crystal Ball darkens. It must be charged before it can be used again.
|
||||
}
|
||||
else if (pet is BaseMount && ((BaseMount)pet).Rider == from)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1054124, 0x36); // The Crystal Ball fills with a yellow mist. Why would you summon your pet while riding it?
|
||||
}
|
||||
else if (pet.Map == Map.Internal && (!pet.IsStabled || (from.Followers + pet.ControlSlots) > from.FollowersMax))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1054125, 0x5); // The Crystal Ball fills with a blue mist. Your pet is not responding to the summons.
|
||||
}
|
||||
else if ((!pet.Controlled || pet.ControlMaster != from) && !from.Stabled.Contains(pet))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1054126, 0x8FD); // The Crystal Ball fills with a grey mist. You are not the owner of the pet you are attempting to summon.
|
||||
}
|
||||
else if (!pet.IsBonded)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1054127, 0x22); // The Crystal Ball fills with a red mist. You appear to have let your bond to your pet deteriorate.
|
||||
}
|
||||
else if (from.Map == Map.Ilshenar || from.Region.IsPartOf<DungeonRegion>() || from.Region.IsPartOf<Jail>())
|
||||
{
|
||||
from.Send(new AsciiMessage(this.Serial, this.ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location."));
|
||||
}
|
||||
else if (Core.ML && from is PlayerMobile && DateTime.UtcNow < ((PlayerMobile)from).LastPetBallTime.AddSeconds(15.0))
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1080072, 0x22); // You must wait a few seconds before you can summon your pet.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Core.ML)
|
||||
new PetSummoningSpell(this, from).Cast();
|
||||
else
|
||||
this.SummonPet(from);
|
||||
}
|
||||
}
|
||||
|
||||
public void SummonPet(Mobile from)
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if (pet == null)
|
||||
return;
|
||||
|
||||
this.Charges--;
|
||||
|
||||
if (pet.IsStabled)
|
||||
{
|
||||
pet.SetControlMaster(from);
|
||||
|
||||
if (pet.Summoned)
|
||||
pet.SummonMaster = from;
|
||||
|
||||
pet.ControlTarget = from;
|
||||
pet.ControlOrder = OrderType.Follow;
|
||||
|
||||
pet.IsStabled = false;
|
||||
pet.StabledBy = null;
|
||||
from.Stabled.Remove(pet);
|
||||
|
||||
if (from is PlayerMobile)
|
||||
((PlayerMobile)from).AutoStabled.Remove(pet);
|
||||
}
|
||||
|
||||
pet.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
MessageHelper.SendLocalizedMessageTo(this, from, 1054128, 0x43); // The Crystal Ball fills with a green mist. Your pet has been summoned.
|
||||
|
||||
if (from is PlayerMobile)
|
||||
{
|
||||
((PlayerMobile)from).LastPetBallTime = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public void UnlinkPet(Mobile from)
|
||||
{
|
||||
if (!this.Deleted && this.Pet != null && this.RootParent == from)
|
||||
{
|
||||
this.Pet = null;
|
||||
|
||||
this.SendLocalizedMessageTo(from, 1054120); // This crystal ball is no longer linked to a pet.
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdatePetName(Mobile from)
|
||||
{
|
||||
this.InternalUpdatePetName();
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)1); // version
|
||||
|
||||
writer.WriteEncodedInt((int)this.m_Recharges);
|
||||
|
||||
writer.WriteEncodedInt((int)this.m_Charges);
|
||||
writer.Write((Mobile)this.Pet);
|
||||
writer.Write((string)this.m_PetName);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
this.m_Charges = Math.Min(reader.ReadEncodedInt(), this.MaxCharges);
|
||||
this.Pet = (BaseCreature)reader.ReadMobile();
|
||||
this.m_PetName = reader.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InternalUpdatePetName()
|
||||
{
|
||||
BaseCreature pet = this.Pet;
|
||||
|
||||
if (pet == null)
|
||||
this.m_PetName = "";
|
||||
else
|
||||
this.m_PetName = pet.Name;
|
||||
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
|
||||
private class BallEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly BallCallback m_Callback;
|
||||
public BallEntry(BallCallback callback, int number)
|
||||
: base(number, 2)
|
||||
{
|
||||
this.m_Callback = callback;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Mobile from = this.Owner.From;
|
||||
|
||||
if (from.CheckAlive())
|
||||
this.m_Callback(from);
|
||||
}
|
||||
}
|
||||
|
||||
private class PetLinkTarget : Target
|
||||
{
|
||||
private readonly BallOfSummoning m_Ball;
|
||||
public PetLinkTarget(BallOfSummoning ball)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
this.m_Ball = ball;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (this.m_Ball.Deleted || this.m_Ball.Pet != null)
|
||||
return;
|
||||
|
||||
if (this.m_Ball.RootParent != from)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (targeted is BaseCreature)
|
||||
{
|
||||
BaseCreature creature = (BaseCreature)targeted;
|
||||
|
||||
if (!creature.Controlled || creature.ControlMaster != from)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this.m_Ball, from, 1054117, 0x59); // You may only link your own pets to a Crystal Ball of Pet Summoning.
|
||||
}
|
||||
else if (!creature.IsBonded)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this.m_Ball, from, 1054118, 0x59); // You must bond with your pet before it can be linked to a Crystal Ball of Pet Summoning.
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this.m_Ball, from, 1054119, 0x59); // Your pet is now linked to this Crystal Ball of Pet Summoning.
|
||||
|
||||
this.m_Ball.Pet = creature;
|
||||
}
|
||||
}
|
||||
else if (targeted == this.m_Ball)
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this.m_Ball, from, 1054115, 0x59); // The Crystal Ball of Pet Summoning cannot summon itself.
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageHelper.SendLocalizedMessageTo(this.m_Ball, from, 1054116, 0x59); // Only pets can be linked to this Crystal Ball of Pet Summoning.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class PetSummoningSpell : Spell
|
||||
{
|
||||
private static readonly SpellInfo m_Info = new SpellInfo("Ball Of Summoning", "", 230);
|
||||
private readonly BallOfSummoning m_Ball;
|
||||
private readonly Mobile m_Caster;
|
||||
private bool m_Stop;
|
||||
public PetSummoningSpell(BallOfSummoning ball, Mobile caster)
|
||||
: base(caster, null, m_Info)
|
||||
{
|
||||
this.m_Caster = caster;
|
||||
this.m_Ball = ball;
|
||||
}
|
||||
|
||||
public override bool ClearHandsOnCast
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override bool RevealOnCast
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override double CastDelayFastScalar
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public override TimeSpan CastDelayBase
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromSeconds(2.0);
|
||||
}
|
||||
}
|
||||
public override TimeSpan GetCastRecovery()
|
||||
{
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override bool ConsumeReagents()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckFizzle()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
this.m_Stop = true;
|
||||
this.Disturb(DisturbType.Hurt, false, false);
|
||||
}
|
||||
|
||||
public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable)
|
||||
{
|
||||
if (type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
if (!this.m_Stop)
|
||||
base.DoHurtFizzle();
|
||||
}
|
||||
|
||||
public override void DoFizzle()
|
||||
{
|
||||
if (!this.m_Stop)
|
||||
base.DoFizzle();
|
||||
}
|
||||
|
||||
public override void OnDisturb(DisturbType type, bool message)
|
||||
{
|
||||
if (message && !this.m_Stop)
|
||||
this.Caster.SendLocalizedMessage(1080074); // You have been disrupted while attempting to summon your pet!
|
||||
}
|
||||
|
||||
public override void OnCast()
|
||||
{
|
||||
this.m_Ball.SummonPet(this.m_Caster);
|
||||
|
||||
this.FinishSequence();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
373
Scripts/Items/Tools/BaseHarvestTool.cs
Normal file
373
Scripts/Items/Tools/BaseHarvestTool.cs
Normal file
@@ -0,0 +1,373 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MiningType
|
||||
{
|
||||
OreOnly,
|
||||
OreAndStone,
|
||||
OreAndGems,
|
||||
StoneOnly,
|
||||
}
|
||||
|
||||
public abstract class BaseHarvestTool : Item, IUsesRemaining, ICraftable, IHarvestTool
|
||||
{
|
||||
private Mobile m_Crafter;
|
||||
private ItemQuality m_Quality;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Crafter;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Crafter = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Quality;
|
||||
}
|
||||
set
|
||||
{
|
||||
UnscaleUses();
|
||||
m_Quality = value;
|
||||
InvalidateProperties();
|
||||
ScaleUses();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UsesRemaining;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
set
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool BreakOnDepletion { get { return true; } }
|
||||
|
||||
public abstract HarvestSystem HarvestSystem { get; }
|
||||
|
||||
public BaseHarvestTool(int itemID)
|
||||
: this(50, itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseHarvestTool(int usesRemaining, int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
m_UsesRemaining = usesRemaining;
|
||||
m_Quality = ItemQuality.Normal;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo(Mobile m)
|
||||
{
|
||||
LabelToAffix(m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString()); // Durability
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
DisplayDurabilityTo(from);
|
||||
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (m_Crafter != null)
|
||||
{
|
||||
LabelTo(from, 1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
HarvestSystem.BeginHarvesting(from, this);
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
AddContextMenuEntries(from, this, list, HarvestSystem);
|
||||
}
|
||||
|
||||
public static void AddContextMenuEntries(Mobile from, Item item, List<ContextMenuEntry> list, HarvestSystem system)
|
||||
{
|
||||
if (system != Mining.System)
|
||||
return;
|
||||
|
||||
if (!item.IsChildOf(from.Backpack) && item.Parent != from)
|
||||
return;
|
||||
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if (pm == null)
|
||||
return;
|
||||
|
||||
int typeentry = 0;
|
||||
|
||||
if (pm.ToggleMiningStone)
|
||||
typeentry = 6179;
|
||||
if (pm.ToggleMiningGem)
|
||||
typeentry = 1112239;
|
||||
if (pm.ToggleStoneOnly)
|
||||
typeentry = 1156865;
|
||||
if (!pm.ToggleMiningStone && !pm.ToggleMiningGem && !pm.ToggleStoneOnly)
|
||||
typeentry = 6178;
|
||||
|
||||
ContextMenuEntry miningEntry = new ContextMenuEntry(typeentry);
|
||||
miningEntry.Color = 0x421F;
|
||||
list.Add(miningEntry);
|
||||
|
||||
list.Add(new ToggleMiningStoneEntry(pm, MiningType.OreOnly, 6176)); // Set To Ore
|
||||
list.Add(new ToggleMiningStoneEntry(pm, MiningType.OreAndStone, 6177)); // Set To Ore and Stone
|
||||
list.Add(new ToggleMiningStoneEntry(pm, MiningType.OreAndGems, 1112237)); // Set To Ore and Gems
|
||||
list.Add(new ToggleMiningStoneEntry(pm, MiningType.StoneOnly, 1156864)); // Set To Stone
|
||||
}
|
||||
|
||||
public class ToggleMiningStoneEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly PlayerMobile m_Mobile;
|
||||
private MiningType MiningType;
|
||||
//private bool m_Valuestone;
|
||||
//private bool m_Valuegem;
|
||||
|
||||
public ToggleMiningStoneEntry(PlayerMobile mobile, MiningType type, int number)
|
||||
: base(number)
|
||||
{
|
||||
m_Mobile = mobile;
|
||||
MiningType = type;
|
||||
//m_Valuestone = valuestone;
|
||||
//m_Valuegem = valuegem;
|
||||
|
||||
bool canMineStone = (mobile.StoneMining && mobile.Skills[SkillName.Mining].Base >= 100.0);
|
||||
bool canMineGems = (mobile.GemMining && mobile.Skills[SkillName.Mining].Base >= 100.0);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MiningType.OreOnly:
|
||||
if(!mobile.ToggleMiningStone && !mobile.ToggleMiningGem && !mobile.ToggleStoneOnly)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
break;
|
||||
case MiningType.OreAndStone:
|
||||
if (mobile.ToggleMiningStone || !canMineStone)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
break;
|
||||
case MiningType.OreAndGems:
|
||||
if(mobile.ToggleMiningGem || !canMineGems)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
break;
|
||||
case MiningType.StoneOnly:
|
||||
if(mobile.ToggleStoneOnly || !canMineStone)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
break;
|
||||
}
|
||||
|
||||
/*if (valuestone && mobile.ToggleMiningStone == valuestone || (valuestone && !stoneMining))
|
||||
Flags |= CMEFlags.Disabled;
|
||||
else if (valuegem && mobile.ToggleMiningGem == valuegem || (valuegem && !gemMining))
|
||||
Flags |= CMEFlags.Disabled;
|
||||
else if (!valuestone && !valuegem && !mobile.ToggleMiningStone && !mobile.ToggleMiningGem)
|
||||
Flags |= CMEFlags.Disabled;*/
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
bool oldValuestoneandore = m_Mobile.ToggleMiningStone;
|
||||
bool oldValuegem = m_Mobile.ToggleMiningGem;
|
||||
bool oldValuestone = m_Mobile.ToggleStoneOnly;
|
||||
|
||||
switch (MiningType)
|
||||
{
|
||||
case MiningType.OreAndStone:
|
||||
{
|
||||
if (oldValuestoneandore)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1054023); // You are already set to mine both ore and stone!
|
||||
}
|
||||
else if (!m_Mobile.StoneMining || m_Mobile.Skills[SkillName.Mining].Base < 100.0)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1054024); // You have not learned how to mine stone or you do not have enough skill!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.ToggleMiningStone = true;
|
||||
m_Mobile.ToggleMiningGem = false;
|
||||
m_Mobile.ToggleStoneOnly = false;
|
||||
m_Mobile.SendLocalizedMessage(1054022); // You are now set to mine both ore and stone.
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MiningType.OreAndGems:
|
||||
{
|
||||
if (oldValuegem)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1112235); // You are already set to mine both ore and gems!
|
||||
}
|
||||
else if (!m_Mobile.GemMining || m_Mobile.Skills[SkillName.Mining].Base < 100.0)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1112234); // You have not learned how to mine gems or you do not have enough skill!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.ToggleMiningGem = true;
|
||||
m_Mobile.ToggleMiningStone = false;
|
||||
m_Mobile.ToggleStoneOnly = false;
|
||||
m_Mobile.SendLocalizedMessage(1112236); // You are now set to mine both ore and gems.
|
||||
}
|
||||
}
|
||||
break;
|
||||
case MiningType.StoneOnly:
|
||||
{
|
||||
if (oldValuestone)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1156866); // You are already mining only stone.
|
||||
}
|
||||
else if (!m_Mobile.StoneMining || m_Mobile.Skills[SkillName.Mining].Base < 100.0)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1054024); // You have not learned how to mine stone or you do not have enough skill!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.ToggleMiningStone = false;
|
||||
m_Mobile.ToggleMiningGem = false;
|
||||
m_Mobile.ToggleStoneOnly = true;
|
||||
m_Mobile.SendLocalizedMessage(1156867); // You are now set to mine only stone.
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (oldValuestoneandore || oldValuegem || oldValuestone)
|
||||
{
|
||||
m_Mobile.ToggleMiningStone = false;
|
||||
m_Mobile.ToggleMiningGem = false;
|
||||
m_Mobile.ToggleStoneOnly = false;
|
||||
m_Mobile.SendLocalizedMessage(1054020); // You are now set to mine only ore.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1054021); // You are already set to mine only ore!
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseHarvestTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((Mobile)m_Crafter);
|
||||
writer.Write((int)m_Quality);
|
||||
|
||||
writer.Write((int)m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
m_Quality = (ItemQuality)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
1128
Scripts/Items/Tools/BaseRunicTool.cs
Normal file
1128
Scripts/Items/Tools/BaseRunicTool.cs
Normal file
File diff suppressed because it is too large
Load Diff
315
Scripts/Items/Tools/BaseTool.cs
Normal file
315
Scripts/Items/Tools/BaseTool.cs
Normal file
@@ -0,0 +1,315 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.Network;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface ITool : IEntity, IUsesRemaining
|
||||
{
|
||||
CraftSystem CraftSystem { get; }
|
||||
|
||||
bool BreakOnDepletion { get; }
|
||||
|
||||
bool CheckAccessible(Mobile from, ref int num);
|
||||
}
|
||||
|
||||
public abstract class BaseTool : Item, ITool, IResource, IQuality
|
||||
{
|
||||
private Mobile m_Crafter;
|
||||
private ItemQuality m_Quality;
|
||||
private int m_UsesRemaining;
|
||||
private bool m_RepairMode;
|
||||
private CraftResource _Resource;
|
||||
private bool _PlayerConstructed;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return _Resource; }
|
||||
set
|
||||
{
|
||||
_Resource = value;
|
||||
Hue = CraftResources.GetHue(_Resource);
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get { return m_Crafter; }
|
||||
set { m_Crafter = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality
|
||||
{
|
||||
get { return m_Quality; }
|
||||
set
|
||||
{
|
||||
UnscaleUses();
|
||||
m_Quality = value;
|
||||
InvalidateProperties();
|
||||
ScaleUses();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool PlayerConstructed
|
||||
{
|
||||
get { return _PlayerConstructed; }
|
||||
set
|
||||
{
|
||||
_PlayerConstructed = value; InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool RepairMode
|
||||
{
|
||||
get { return m_RepairMode; }
|
||||
set { m_RepairMode = value; }
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get { return true; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public virtual bool BreakOnDepletion { get { return true; } }
|
||||
|
||||
public abstract CraftSystem CraftSystem { get; }
|
||||
|
||||
public BaseTool(int itemID)
|
||||
: this(Utility.RandomMinMax(25, 75), itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseTool(int uses, int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
m_UsesRemaining = uses;
|
||||
m_Quality = ItemQuality.Normal;
|
||||
}
|
||||
|
||||
public BaseTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Crafter != null)
|
||||
list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
|
||||
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1060584, UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public virtual void DisplayDurabilityTo(Mobile m)
|
||||
{
|
||||
LabelToAffix(m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString()); // Durability
|
||||
}
|
||||
|
||||
public virtual bool CheckAccessible(Mobile m, ref int num)
|
||||
{
|
||||
if (RootParent != m)
|
||||
{
|
||||
num = 1044263;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CheckAccessible(Item tool, Mobile m)
|
||||
{
|
||||
return CheckAccessible(tool, m, false);
|
||||
}
|
||||
|
||||
public static bool CheckAccessible(Item tool, Mobile m, bool message)
|
||||
{
|
||||
if (tool == null || tool.Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var num = 0;
|
||||
|
||||
bool res;
|
||||
|
||||
if (tool is ITool)
|
||||
{
|
||||
res = ((ITool)tool).CheckAccessible(m, ref num);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = tool.IsChildOf(m) || tool.Parent == m;
|
||||
}
|
||||
|
||||
if (num > 0 && message)
|
||||
{
|
||||
m.SendLocalizedMessage(num);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool CheckTool(Item tool, Mobile m)
|
||||
{
|
||||
if (tool == null || tool.Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Item check = m.FindItemOnLayer(Layer.OneHanded);
|
||||
|
||||
if (check is ITool && check != tool && !(check is AncientSmithyHammer))
|
||||
return false;
|
||||
|
||||
check = m.FindItemOnLayer(Layer.TwoHanded);
|
||||
|
||||
if (check is ITool && check != tool && !(check is AncientSmithyHammer))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
DisplayDurabilityTo(from);
|
||||
|
||||
base.OnSingleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
{
|
||||
CraftSystem system = CraftSystem;
|
||||
|
||||
if (Core.TOL && m_RepairMode)
|
||||
{
|
||||
Repair.Do(from, system, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num = system.CanCraft(from, this, null);
|
||||
|
||||
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
{
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new CraftGump(from, system, this, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)4); // version
|
||||
|
||||
writer.Write(_PlayerConstructed);
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
writer.Write(m_RepairMode);
|
||||
writer.Write((Mobile)m_Crafter);
|
||||
writer.Write((int)m_Quality);
|
||||
writer.Write((int)m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
_PlayerConstructed = reader.ReadBool();
|
||||
goto case 3;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_RepairMode = reader.ReadBool();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Crafter = reader.ReadMobile();
|
||||
m_Quality = (ItemQuality)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
PlayerConstructed = true;
|
||||
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
131
Scripts/Items/Tools/Bedroll.cs
Normal file
131
Scripts/Items/Tools/Bedroll.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xA57, 0xA58, 0xA59)]
|
||||
public class Bedroll : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Bedroll()
|
||||
: base(0xA57)
|
||||
{
|
||||
this.Weight = 5.0;
|
||||
}
|
||||
|
||||
public Bedroll(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.Parent != null || !this.VerifyMove(from))
|
||||
return;
|
||||
|
||||
if (!from.InRange(this, 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.ItemID == 0xA57) // rolled
|
||||
{
|
||||
Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);
|
||||
|
||||
if (dir == Direction.North || dir == Direction.South)
|
||||
this.ItemID = 0xA55;
|
||||
else
|
||||
this.ItemID = 0xA56;
|
||||
}
|
||||
else // unrolled
|
||||
{
|
||||
this.ItemID = 0xA57;
|
||||
|
||||
if (!from.HasGump(typeof(LogoutGump)))
|
||||
{
|
||||
CampfireEntry entry = Campfire.GetEntry(from);
|
||||
|
||||
if (entry != null && entry.Safe)
|
||||
from.SendGump(new LogoutGump(entry, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private class LogoutGump : Gump
|
||||
{
|
||||
private readonly Timer m_CloseTimer;
|
||||
private readonly CampfireEntry m_Entry;
|
||||
private readonly Bedroll m_Bedroll;
|
||||
public LogoutGump(CampfireEntry entry, Bedroll bedroll)
|
||||
: base(100, 0)
|
||||
{
|
||||
this.m_Entry = entry;
|
||||
this.m_Bedroll = bedroll;
|
||||
|
||||
this.m_CloseTimer = Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerCallback(CloseGump));
|
||||
|
||||
this.AddBackground(0, 0, 400, 350, 0xA28);
|
||||
|
||||
this.AddHtmlLocalized(100, 20, 200, 35, 1011015, false, false); // <center>Logging out via camping</center>
|
||||
|
||||
/* Using a bedroll in the safety of a camp will log you out of the game safely.
|
||||
* If this is what you wish to do choose CONTINUE and you will be logged out.
|
||||
* Otherwise, select the CANCEL button to avoid logging out at this time.
|
||||
* The camp will remain secure for 10 seconds at which time this window will close
|
||||
* and you not be logged out.
|
||||
*/
|
||||
this.AddHtmlLocalized(50, 55, 300, 140, 1011016, true, true);
|
||||
|
||||
this.AddButton(45, 298, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(80, 300, 110, 35, 1011011, false, false); // CONTINUE
|
||||
|
||||
this.AddButton(200, 298, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
|
||||
this.AddHtmlLocalized(235, 300, 110, 35, 1011012, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
PlayerMobile pm = this.m_Entry.Player;
|
||||
|
||||
this.m_CloseTimer.Stop();
|
||||
|
||||
if (Campfire.GetEntry(pm) != this.m_Entry)
|
||||
return;
|
||||
|
||||
if (info.ButtonID == 1 && this.m_Entry.Safe && this.m_Bedroll.Parent == null && this.m_Bedroll.IsAccessibleTo(pm) &&
|
||||
this.m_Bedroll.VerifyMove(pm) && this.m_Bedroll.Map == pm.Map && pm.InRange(this.m_Bedroll, 2))
|
||||
{
|
||||
pm.PlaceInBackpack(this.m_Bedroll);
|
||||
|
||||
pm.BedrollLogout = true;
|
||||
sender.Dispose();
|
||||
}
|
||||
|
||||
Campfire.RemoveEntry(this.m_Entry);
|
||||
}
|
||||
|
||||
private void CloseGump()
|
||||
{
|
||||
Campfire.RemoveEntry(this.m_Entry);
|
||||
this.m_Entry.Player.CloseGump(typeof(LogoutGump));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Tools/BegFishingPole.cs
Normal file
36
Scripts/Items/Tools/BegFishingPole.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BegFishingPole : FishingPole
|
||||
{
|
||||
[Constructable]
|
||||
public BegFishingPole()
|
||||
{
|
||||
}
|
||||
|
||||
public BegFishingPole(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Tools/BlackDyeTub.cs
Normal file
33
Scripts/Items/Tools/BlackDyeTub.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlackDyeTub : DyeTub
|
||||
{
|
||||
[Constructable]
|
||||
public BlackDyeTub()
|
||||
{
|
||||
this.Hue = this.DyedHue = 0x0001;
|
||||
this.Redyable = false;
|
||||
}
|
||||
|
||||
public BlackDyeTub(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/Tools/BlankMap.cs
Normal file
36
Scripts/Items/Tools/BlankMap.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlankMap : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public BlankMap()
|
||||
{
|
||||
}
|
||||
|
||||
public BlankMap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
this.SendLocalizedMessageTo(from, 500208); // It appears to be blank.
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Tools/BlazeDyeTub.cs
Normal file
33
Scripts/Items/Tools/BlazeDyeTub.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlazeDyeTub : DyeTub
|
||||
{
|
||||
[Constructable]
|
||||
public BlazeDyeTub()
|
||||
{
|
||||
this.Hue = this.DyedHue = 0x489;
|
||||
this.Redyable = false;
|
||||
}
|
||||
|
||||
public BlazeDyeTub(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/Tools/Blowpipe.cs
Normal file
43
Scripts/Items/Tools/Blowpipe.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xE8A, 0xE89)]
|
||||
public class Blowpipe : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem { get { return DefGlassblowing.CraftSystem; } }
|
||||
public override int LabelNumber { get { return 1044609; } } // Blow Pipe
|
||||
|
||||
[Constructable]
|
||||
public Blowpipe()
|
||||
: base(0xE8A)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Blowpipe(int uses)
|
||||
: base(uses, 0xE8A)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x3B9;
|
||||
}
|
||||
|
||||
public Blowpipe(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
514
Scripts/Items/Tools/BraceletOfBinding.cs
Normal file
514
Scripts/Items/Tools/BraceletOfBinding.cs
Normal file
@@ -0,0 +1,514 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BraceletOfBinding : BaseBracelet, TranslocationItem
|
||||
{
|
||||
private int m_Charges;
|
||||
private int m_Recharges;
|
||||
private string m_Inscription;
|
||||
private BraceletOfBinding m_Bound;
|
||||
private TransportTimer m_Timer;
|
||||
|
||||
[Constructable]
|
||||
public BraceletOfBinding()
|
||||
: base(0x1086)
|
||||
{
|
||||
Hue = 0x489;
|
||||
Weight = 1.0;
|
||||
|
||||
m_Inscription = "";
|
||||
}
|
||||
|
||||
public BraceletOfBinding(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private delegate void BraceletCallback(Mobile from);
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Charges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Recharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Recharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value > MaxRecharges)
|
||||
m_Recharges = MaxRecharges;
|
||||
else if (value < 0)
|
||||
m_Recharges = 0;
|
||||
else
|
||||
m_Recharges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return 999;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual int MaxRecharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string TranslocationItemName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "bracelet of binding";
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Inscription
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Inscription;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Inscription = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BraceletOfBinding Bound
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_Bound != null && m_Bound.Deleted)
|
||||
m_Bound = null;
|
||||
|
||||
return m_Bound;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Bound = value;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1054000, m_Charges.ToString() + (m_Inscription.Length == 0 ? "\t " : " :\t" + m_Inscription)); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, 1054000, m_Charges.ToString() + (m_Inscription.Length == 0 ? "\t " : " :\t" + m_Inscription)); // a bracelet of binding : ~1_val~ ~2_val~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.Alive && IsChildOf(from))
|
||||
{
|
||||
BraceletOfBinding bound = Bound;
|
||||
|
||||
list.Add(new BraceletEntry(new BraceletCallback(Activate), 6170, bound != null));
|
||||
list.Add(new BraceletEntry(new BraceletCallback(Search), 6171, bound != null));
|
||||
list.Add(new BraceletEntry(new BraceletCallback(Bind), bound == null ? 6173 : 6174, true));
|
||||
list.Add(new BraceletEntry(new BraceletCallback(Inscribe), 6175, true));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
BraceletOfBinding bound = Bound;
|
||||
|
||||
if (Bound == null)
|
||||
{
|
||||
Bind(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
Activate(from);
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate(Mobile from)
|
||||
{
|
||||
BraceletOfBinding bound = Bound;
|
||||
|
||||
if (Deleted || bound == null)
|
||||
return;
|
||||
|
||||
if (!IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (m_Timer != null)
|
||||
{
|
||||
from.SendLocalizedMessage(1054013); // The bracelet is already attempting contact. You decide to wait a moment.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(0xF9);
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1151783);
|
||||
|
||||
from.Frozen = true;
|
||||
|
||||
m_Timer = new TransportTimer(this, from);
|
||||
m_Timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Search(Mobile from)
|
||||
{
|
||||
BraceletOfBinding bound = Bound;
|
||||
|
||||
if (Deleted || bound == null)
|
||||
return;
|
||||
|
||||
if (!IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckUse(from, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void Bind(Mobile from)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
if (!IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1054001); // Target the bracelet of binding you wish to bind this bracelet to.
|
||||
from.Target = new BindTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void Inscribe(Mobile from)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
if (!IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1054009); // Enter the text to inscribe upon the bracelet :
|
||||
from.Prompt = new InscribePrompt(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)1); // version
|
||||
|
||||
writer.WriteEncodedInt((int)m_Recharges);
|
||||
|
||||
writer.WriteEncodedInt((int)m_Charges);
|
||||
writer.Write((string)m_Inscription);
|
||||
writer.Write((Item)Bound);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Recharges = reader.ReadEncodedInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Charges = Math.Min(reader.ReadEncodedInt(), MaxCharges);
|
||||
m_Inscription = reader.ReadString();
|
||||
Bound = (BraceletOfBinding)reader.ReadItem();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckUse(Mobile from, bool successMessage)
|
||||
{
|
||||
BraceletOfBinding bound = Bound;
|
||||
|
||||
if (bound == null)
|
||||
return false;
|
||||
|
||||
Mobile boundRoot = bound.RootParent as Mobile;
|
||||
|
||||
if (Charges == 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1054005); // The bracelet glows black. It must be charged before it can be used again.
|
||||
return false;
|
||||
}
|
||||
else if (from.FindItemOnLayer(Layer.Bracelet) != this)
|
||||
{
|
||||
from.SendLocalizedMessage(1054004); // You must equip the bracelet in order to use its power.
|
||||
return false;
|
||||
}
|
||||
else if (boundRoot == null || boundRoot.NetState == null || boundRoot.FindItemOnLayer(Layer.Bracelet) != bound)
|
||||
{
|
||||
from.SendLocalizedMessage(1054006); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
|
||||
return false;
|
||||
}
|
||||
else if (!Core.AOS && from.Map != boundRoot.Map)
|
||||
{
|
||||
from.SendLocalizedMessage(1054014); // The bracelet glows black. The bracelet's target is on another facet.
|
||||
return false;
|
||||
}
|
||||
else if (Factions.Sigil.ExistsOn(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
|
||||
return false;
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!SpellHelper.CheckTravel(from, boundRoot.Map, boundRoot.Location, TravelCheckType.RecallTo))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (boundRoot.Map == Map.Felucca && from is PlayerMobile && ((PlayerMobile)from).Young)
|
||||
{
|
||||
from.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
|
||||
return false;
|
||||
}
|
||||
else if (SpellHelper.RestrictRedTravel && from.Murderer && boundRoot.Map != Map.Felucca)
|
||||
{
|
||||
from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
|
||||
return false;
|
||||
}
|
||||
else if (from.Criminal)
|
||||
{
|
||||
from.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
|
||||
return false;
|
||||
}
|
||||
else if (SpellHelper.CheckCombat(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
|
||||
return false;
|
||||
}
|
||||
else if (Server.Misc.WeightOverloading.IsOverloaded(from))
|
||||
{
|
||||
from.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
|
||||
return false;
|
||||
}
|
||||
else if (from.Region.IsPartOf<Server.Regions.Jail>())
|
||||
{
|
||||
from.SendLocalizedMessage(1114345, "", 0x35); // You'll need a better jailbreak plan than that!
|
||||
return false;
|
||||
}
|
||||
else if (boundRoot.Region.IsPartOf<Server.Regions.Jail>())
|
||||
{
|
||||
from.SendLocalizedMessage(1019004); // You are not allowed to travel there.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (successMessage)
|
||||
from.SendLocalizedMessage(1054015); // The bracelet's twin is available for transport.
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private class BraceletEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly BraceletCallback m_Callback;
|
||||
public BraceletEntry(BraceletCallback callback, int number, bool enabled)
|
||||
: base(number)
|
||||
{
|
||||
m_Callback = callback;
|
||||
|
||||
if (!enabled)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if (from.CheckAlive())
|
||||
m_Callback(from);
|
||||
}
|
||||
}
|
||||
|
||||
private class TransportTimer : Timer
|
||||
{
|
||||
private readonly BraceletOfBinding m_Bracelet;
|
||||
private readonly Mobile m_From;
|
||||
|
||||
public TransportTimer(BraceletOfBinding bracelet, Mobile from)
|
||||
: base(TimeSpan.FromSeconds(2.0))
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Bracelet.m_Timer = null;
|
||||
m_From.Frozen = false;
|
||||
|
||||
if (m_Bracelet.Deleted || m_From.Deleted)
|
||||
return;
|
||||
|
||||
if (m_Bracelet.CheckUse(m_From, false))
|
||||
{
|
||||
Mobile boundRoot = m_Bracelet.Bound.RootParent as Mobile;
|
||||
|
||||
if (boundRoot != null)
|
||||
{
|
||||
m_Bracelet.Charges--;
|
||||
Point3D loc = boundRoot.Location;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(boundRoot);
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
loc = house.BanLocation;
|
||||
}
|
||||
|
||||
BaseCreature.TeleportPets(m_From, boundRoot.Location, boundRoot.Map, true);
|
||||
|
||||
m_From.PlaySound(0x1FC);
|
||||
m_From.MoveToWorld(boundRoot.Location, boundRoot.Map);
|
||||
m_From.PlaySound(0x1FC);
|
||||
|
||||
if (house != null)
|
||||
{
|
||||
m_From.SendLocalizedMessage(1070905); // Strong magics have redirected you to a safer location!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class BindTarget : Target
|
||||
{
|
||||
private readonly BraceletOfBinding m_Bracelet;
|
||||
public BindTarget(BraceletOfBinding bracelet)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Bracelet.Deleted)
|
||||
return;
|
||||
|
||||
if (!m_Bracelet.IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (targeted.GetType() == typeof(BraceletOfBinding))
|
||||
{
|
||||
BraceletOfBinding bindBracelet = targeted as BraceletOfBinding;
|
||||
|
||||
if (bindBracelet == m_Bracelet)
|
||||
{
|
||||
from.SendLocalizedMessage(1054012); // You cannot bind a bracelet of binding to itself!
|
||||
}
|
||||
else if (!bindBracelet.IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1054003); // You bind the bracelet to its counterpart. The bracelets glow with power.
|
||||
from.PlaySound(0xF9);
|
||||
|
||||
m_Bracelet.Bound = bindBracelet;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1054002); // You can only bind this bracelet to another bracelet of binding!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InscribePrompt : Prompt
|
||||
{
|
||||
private readonly BraceletOfBinding m_Bracelet;
|
||||
public InscribePrompt(BraceletOfBinding bracelet)
|
||||
{
|
||||
m_Bracelet = bracelet;
|
||||
}
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (m_Bracelet.Deleted)
|
||||
return;
|
||||
|
||||
if (!m_Bracelet.IsChildOf(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1054011); // You mark the bracelet with your inscription.
|
||||
m_Bracelet.Inscription = text;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCancel(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(1054010); // You decide not to inscribe the bracelet at this time.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
68
Scripts/Items/Tools/CheckersPieces.cs
Normal file
68
Scripts/Items/Tools/CheckersPieces.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PieceWhiteChecker : BasePiece
|
||||
{
|
||||
public PieceWhiteChecker(BaseBoard board)
|
||||
: base(0x3584, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteChecker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white checker";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackChecker : BasePiece
|
||||
{
|
||||
public PieceBlackChecker(BaseBoard board)
|
||||
: base(0x358B, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackChecker(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black checker";
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
388
Scripts/Items/Tools/ChessPieces.cs
Normal file
388
Scripts/Items/Tools/ChessPieces.cs
Normal file
@@ -0,0 +1,388 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PieceWhiteKing : BasePiece
|
||||
{
|
||||
public PieceWhiteKing(BaseBoard board)
|
||||
: base(0x3587, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteKing(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white king";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackKing : BasePiece
|
||||
{
|
||||
public PieceBlackKing(BaseBoard board)
|
||||
: base(0x358E, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackKing(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black king";
|
||||
}
|
||||
}
|
||||
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 class PieceWhiteQueen : BasePiece
|
||||
{
|
||||
public PieceWhiteQueen(BaseBoard board)
|
||||
: base(0x358A, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteQueen(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white queen";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackQueen : BasePiece
|
||||
{
|
||||
public PieceBlackQueen(BaseBoard board)
|
||||
: base(0x3591, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackQueen(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black queen";
|
||||
}
|
||||
}
|
||||
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 class PieceWhiteRook : BasePiece
|
||||
{
|
||||
public PieceWhiteRook(BaseBoard board)
|
||||
: base(0x3586, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteRook(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white rook";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackRook : BasePiece
|
||||
{
|
||||
public PieceBlackRook(BaseBoard board)
|
||||
: base(0x358D, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackRook(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black rook";
|
||||
}
|
||||
}
|
||||
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 class PieceWhiteBishop : BasePiece
|
||||
{
|
||||
public PieceWhiteBishop(BaseBoard board)
|
||||
: base(0x3585, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteBishop(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white bishop";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackBishop : BasePiece
|
||||
{
|
||||
public PieceBlackBishop(BaseBoard board)
|
||||
: base(0x358C, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackBishop(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black bishop";
|
||||
}
|
||||
}
|
||||
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 class PieceWhiteKnight : BasePiece
|
||||
{
|
||||
public PieceWhiteKnight(BaseBoard board)
|
||||
: base(0x3588, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhiteKnight(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white knight";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackKnight : BasePiece
|
||||
{
|
||||
public PieceBlackKnight(BaseBoard board)
|
||||
: base(0x358F, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackKnight(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black knight";
|
||||
}
|
||||
}
|
||||
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 class PieceWhitePawn : BasePiece
|
||||
{
|
||||
public PieceWhitePawn(BaseBoard board)
|
||||
: base(0x3589, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceWhitePawn(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "white pawn";
|
||||
}
|
||||
}
|
||||
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 class PieceBlackPawn : BasePiece
|
||||
{
|
||||
public PieceBlackPawn(BaseBoard board)
|
||||
: base(0x3590, board)
|
||||
{
|
||||
}
|
||||
|
||||
public PieceBlackPawn(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "black pawn";
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
239
Scripts/Items/Tools/ChestOfSending.cs
Normal file
239
Scripts/Items/Tools/ChestOfSending.cs
Normal file
@@ -0,0 +1,239 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Regions;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x4910, 0x4911)]
|
||||
public class ChestOfSending : Item, ISecurable
|
||||
{
|
||||
public static readonly int MaxCharges = 50;
|
||||
|
||||
private SecureLevel m_Level;
|
||||
private int m_Charges;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get { return m_Level; }
|
||||
set { m_Level = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
{
|
||||
get { return m_Charges; }
|
||||
set
|
||||
{
|
||||
if (value > MaxCharges)
|
||||
m_Charges = MaxCharges;
|
||||
else if (value < 0)
|
||||
m_Charges = 0;
|
||||
else
|
||||
m_Charges = value;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextRecharge { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1150418; } } // a chest of sending
|
||||
|
||||
[Constructable]
|
||||
public ChestOfSending() : base(0x4910)
|
||||
{
|
||||
m_Level = SecureLevel.CoOwners;
|
||||
m_Charges = 50;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
else if (!from.Region.IsPartOf<HouseRegion>())
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
else if (!IsLockedDown && !IsSecure)
|
||||
from.SendLocalizedMessage(1112573); // This must be locked down or secured in order to use it.
|
||||
else if (m_Charges == 0)
|
||||
from.SendLocalizedMessage(1019073); // This item is out of charges.
|
||||
else if(CheckAccessible(from, this))
|
||||
from.Target = new SendTarget(this);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~
|
||||
list.Add(1150598); // auto recharge
|
||||
}
|
||||
|
||||
public bool CheckAccessible(Mobile from, Item item)
|
||||
{
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster)
|
||||
return true; // Staff can access anything
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(item);
|
||||
|
||||
if (house == null)
|
||||
return false;
|
||||
|
||||
switch ( m_Level )
|
||||
{
|
||||
case SecureLevel.Owner: return house.IsOwner(from);
|
||||
case SecureLevel.CoOwners: return house.IsCoOwner(from);
|
||||
case SecureLevel.Friends: return house.IsFriend(from);
|
||||
case SecureLevel.Anyone: return true;
|
||||
case SecureLevel.Guild: return house.IsGuildMember(from);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private class SendTarget : Target
|
||||
{
|
||||
private ChestOfSending m_Chest;
|
||||
|
||||
public SendTarget(ChestOfSending chest) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_Chest = chest;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Chest.Deleted)
|
||||
return;
|
||||
|
||||
Item item = targeted as Item;
|
||||
|
||||
if (item == null || from.Backpack == null)
|
||||
return;
|
||||
|
||||
if (!from.Region.IsPartOf<HouseRegion>())
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
else if (!item.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1054107); // This item must be in your backpack.
|
||||
}
|
||||
else if (item is Container || item is BagOfSending || item is ChestOfSending)
|
||||
{
|
||||
from.SendLocalizedMessage(1150420, "#1150424"); // You cannot send a container through the ~1_NAME~.
|
||||
}
|
||||
else if (!m_Chest.IsLockedDown && !m_Chest.IsSecure)
|
||||
{
|
||||
from.SendLocalizedMessage(1112573); // This must be locked down or secured in order to use it.
|
||||
}
|
||||
else if (m_Chest.Charges == 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1019073); // This item is out of charges.
|
||||
}
|
||||
else if (!m_Chest.CheckAccessible(from, m_Chest))
|
||||
{
|
||||
}
|
||||
else if (m_Chest.InSecureTrade)
|
||||
{
|
||||
from.SendLocalizedMessage(1150422, "#1150424"); // The ~1_NAME~ will not function while being traded.
|
||||
}
|
||||
else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem)
|
||||
{
|
||||
from.SendLocalizedMessage(1150421, "#1150424"); // The ~1_NAME~ rejects that item.
|
||||
}
|
||||
else if (!from.BankBox.TryDropItem(from, item, false))
|
||||
{
|
||||
from.SendLocalizedMessage(1054110); // Your bank box is full.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Chest.Charges--;
|
||||
from.SendLocalizedMessage(1054150); // The item was placed in your bank box.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.CheckAlive())
|
||||
list.Add(new UseChestEntry(this, CheckAccessible(from, this)));
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
private class UseChestEntry : ContextMenuEntry
|
||||
{
|
||||
private ChestOfSending m_Chest;
|
||||
|
||||
public UseChestEntry(ChestOfSending chest, bool enabled) : base(1150419, 2)
|
||||
{
|
||||
m_Chest = chest;
|
||||
|
||||
if (!enabled)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Chest.Deleted)
|
||||
return;
|
||||
|
||||
Mobile from = Owner.From;
|
||||
|
||||
if (from.CheckAlive())
|
||||
m_Chest.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
|
||||
public ChestOfSending(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)2); // version
|
||||
|
||||
writer.Write((int)m_Level);
|
||||
writer.Write(m_Charges);
|
||||
|
||||
if (NextRecharge < DateTime.UtcNow)
|
||||
{
|
||||
Charges++;
|
||||
NextRecharge = DateTime.UtcNow + TimeSpan.FromHours(Utility.RandomMinMax(11, 13));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
case 1:
|
||||
if(version == 1)
|
||||
reader.ReadInt();
|
||||
goto case 0;
|
||||
case 0:
|
||||
m_Level = (SecureLevel)reader.ReadInt();
|
||||
m_Charges = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
Scripts/Items/Tools/CityMap.cs
Normal file
57
Scripts/Items/Tools/CityMap.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CityMap : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public CityMap()
|
||||
{
|
||||
this.SetDisplay(0, 0, 5119, 4095, 400, 400);
|
||||
}
|
||||
|
||||
public CityMap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1015231;
|
||||
}
|
||||
}// city map
|
||||
public override void CraftInit(Mobile from)
|
||||
{
|
||||
double skillValue = from.Skills[SkillName.Cartography].Value;
|
||||
int dist = 64 + (int)(skillValue * 4);
|
||||
|
||||
if (dist < 200)
|
||||
dist = 200;
|
||||
|
||||
int size = 32 + (int)(skillValue * 2);
|
||||
|
||||
if (size < 200)
|
||||
size = 200;
|
||||
else if (size > 400)
|
||||
size = 400;
|
||||
|
||||
this.SetDisplay(from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, size, size);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
427
Scripts/Items/Tools/Clocks.cs
Normal file
427
Scripts/Items/Tools/Clocks.cs
Normal file
@@ -0,0 +1,427 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Server.Multis;
|
||||
using Server.Gumps;
|
||||
using Server.ContextMenus;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MoonPhase
|
||||
{
|
||||
WaxingCrescent,
|
||||
FirstQuarter,
|
||||
WaxingGibbous,
|
||||
Full,
|
||||
WaningGibbous,
|
||||
LastQuarter,
|
||||
WaningCrescent,
|
||||
New
|
||||
}
|
||||
|
||||
[Flipable(0x104B, 0x104C)]
|
||||
public class Clock : Item, ISecurable
|
||||
{
|
||||
public const double SecondsPerUOMinute = 5.0;
|
||||
public const double MinutesPerUODay = SecondsPerUOMinute * 24;
|
||||
|
||||
private static readonly DateTime WorldStart = new DateTime(1997, 9, 1);
|
||||
|
||||
public static DateTime ServerStart { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public Clock()
|
||||
: this(0x104B)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Clock(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Weight = 3.0;
|
||||
Level = SecureLevel.CoOwners;
|
||||
}
|
||||
|
||||
public Clock(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CallPriority(-1)]
|
||||
public static void Initialize()
|
||||
{
|
||||
ServerStart = DateTime.UtcNow;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2), ClockTime.Tick_Callback);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public static MoonPhase GetMoonPhase(Map map, int x, int y)
|
||||
{
|
||||
int hours, minutes, totalMinutes;
|
||||
|
||||
GetTime(map, x, y, out hours, out minutes, out totalMinutes);
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
totalMinutes /= 10 + (map.MapIndex * 20);
|
||||
}
|
||||
|
||||
return (MoonPhase)(totalMinutes % 8);
|
||||
}
|
||||
|
||||
public static void GetTime(Map map, int x, int y, out int hours, out int minutes)
|
||||
{
|
||||
int totalMinutes;
|
||||
|
||||
GetTime(map, x, y, out hours, out minutes, out totalMinutes);
|
||||
}
|
||||
|
||||
public static void GetTime(Map map, int x, int y, out int hours, out int minutes, out int totalMinutes)
|
||||
{
|
||||
var timeSpan = DateTime.UtcNow - WorldStart;
|
||||
|
||||
totalMinutes = (int)(timeSpan.TotalSeconds / SecondsPerUOMinute);
|
||||
|
||||
if (map != null)
|
||||
{
|
||||
totalMinutes += map.MapIndex * 320;
|
||||
}
|
||||
|
||||
// Really on OSI this must be by subserver
|
||||
totalMinutes += x / 16;
|
||||
|
||||
hours = (totalMinutes / 60) % 24;
|
||||
minutes = totalMinutes % 60;
|
||||
}
|
||||
|
||||
public static void GetTime(out int generalNumber, out string exactTime)
|
||||
{
|
||||
GetTime(null, 0, 0, out generalNumber, out exactTime);
|
||||
}
|
||||
|
||||
public static void GetTime(Mobile from, out int generalNumber, out string exactTime)
|
||||
{
|
||||
GetTime(from.Map, from.X, from.Y, out generalNumber, out exactTime);
|
||||
}
|
||||
|
||||
public static void GetTime(Map map, int x, int y, out int generalNumber, out string exactTime)
|
||||
{
|
||||
int hours, minutes;
|
||||
|
||||
GetTime(map, x, y, out hours, out minutes);
|
||||
|
||||
// 00:00 AM - 00:59 AM : Witching hour
|
||||
// 01:00 AM - 03:59 AM : Middle of night
|
||||
// 04:00 AM - 07:59 AM : Early morning
|
||||
// 08:00 AM - 11:59 AM : Late morning
|
||||
// 12:00 PM - 12:59 PM : Noon
|
||||
// 01:00 PM - 03:59 PM : Afternoon
|
||||
// 04:00 PM - 07:59 PM : Early evening
|
||||
// 08:00 PM - 11:59 AM : Late at night
|
||||
|
||||
if (hours >= 20)
|
||||
{
|
||||
generalNumber = 1042957; // It's late at night
|
||||
}
|
||||
else if (hours >= 16)
|
||||
{
|
||||
generalNumber = 1042956; // It's early in the evening
|
||||
}
|
||||
else if (hours >= 13)
|
||||
{
|
||||
generalNumber = 1042955; // It's the afternoon
|
||||
}
|
||||
else if (hours >= 12)
|
||||
{
|
||||
generalNumber = 1042954; // It's around noon
|
||||
}
|
||||
else if (hours >= 08)
|
||||
{
|
||||
generalNumber = 1042953; // It's late in the morning
|
||||
}
|
||||
else if (hours >= 04)
|
||||
{
|
||||
generalNumber = 1042952; // It's early in the morning
|
||||
}
|
||||
else if (hours >= 01)
|
||||
{
|
||||
generalNumber = 1042951; // It's the middle of the night
|
||||
}
|
||||
else
|
||||
{
|
||||
generalNumber = 1042950; // 'Tis the witching hour. 12 Midnight.
|
||||
}
|
||||
|
||||
hours %= 12;
|
||||
|
||||
if (hours == 0)
|
||||
{
|
||||
hours = 12;
|
||||
}
|
||||
|
||||
exactTime = String.Format("{0}:{1:D2}", hours, minutes);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
int genericNumber;
|
||||
string exactTime;
|
||||
|
||||
GetTime(from, out genericNumber, out exactTime);
|
||||
|
||||
SendLocalizedMessageTo(from, genericNumber);
|
||||
SendLocalizedMessageTo(from, 1042958, exactTime); // ~1_TIME~ to be exact
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ClockTime : Clock
|
||||
{
|
||||
private static List<ClockTime> _Instances = new List<ClockTime>();
|
||||
|
||||
[Constructable]
|
||||
public ClockTime()
|
||||
: this(0x104B)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ClockTime(int itemID)
|
||||
: base(itemID)
|
||||
{
|
||||
Weight = 10.0;
|
||||
LootType = LootType.Blessed;
|
||||
_Instances.Add(this);
|
||||
}
|
||||
|
||||
public ClockTime(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
_Instances.Remove(this);
|
||||
}
|
||||
|
||||
public static void Tick_Callback()
|
||||
{
|
||||
foreach (var clock in _Instances.Where(p => p != null && !p.Deleted && p.IsLockedDown))
|
||||
{
|
||||
IPooledEnumerable ie = clock.GetMobilesInRange(10);
|
||||
|
||||
foreach (Mobile m in ie)
|
||||
{
|
||||
if (m.Player)
|
||||
{
|
||||
int hours, minutes;
|
||||
|
||||
GetTime(m.Map, m.X, m.Y, out hours, out minutes);
|
||||
|
||||
if (minutes == 00 && (hours == 12 || hours == 00 || hours == 06 || hours == 18))
|
||||
m.PlaySound(1634);
|
||||
else if (minutes == 00)
|
||||
m.PlaySound(1635);
|
||||
}
|
||||
}
|
||||
|
||||
ie.Free();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
reader.ReadInt();
|
||||
|
||||
_Instances.Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(0x104B, 0x104C)]
|
||||
public class ClockRight : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public ClockRight()
|
||||
: base(0x104B)
|
||||
{
|
||||
}
|
||||
|
||||
public ClockRight(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(0x104B, 0x104C)]
|
||||
public class ClockLeft : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public ClockLeft()
|
||||
: base(0x104C)
|
||||
{
|
||||
}
|
||||
|
||||
public ClockLeft(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(0x44DD, 0x44E1)]
|
||||
public class LargeGrandfatherClock : ClockTime
|
||||
{
|
||||
public override int LabelNumber { get { return 1149902; } } // Large Grandfather Clock
|
||||
|
||||
[Constructable]
|
||||
public LargeGrandfatherClock()
|
||||
: base(0x44DD)
|
||||
{
|
||||
}
|
||||
|
||||
public LargeGrandfatherClock(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(0x44D5, 0x44D9)]
|
||||
public class SmallGrandfatherClock : ClockTime
|
||||
{
|
||||
public override int LabelNumber { get { return 1149901; } } // Small Grandfather Clock
|
||||
|
||||
[Constructable]
|
||||
public SmallGrandfatherClock()
|
||||
: base(0x44D5)
|
||||
{
|
||||
}
|
||||
|
||||
public SmallGrandfatherClock(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();
|
||||
}
|
||||
}
|
||||
|
||||
[Flipable(0x48D4, 0x48D8)]
|
||||
public class WhiteGrandfatherClock : ClockTime
|
||||
{
|
||||
public override int LabelNumber { get { return 1149903; } } // White Grandfather Clock
|
||||
|
||||
[Constructable]
|
||||
public WhiteGrandfatherClock()
|
||||
: base(0x48D4)
|
||||
{
|
||||
}
|
||||
|
||||
public WhiteGrandfatherClock(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Scripts/Items/Tools/Dices.cs
Normal file
85
Scripts/Items/Tools/Dices.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Dices : Item, ITelekinesisable, ISecurable
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public Dices()
|
||||
: base(0xFA7)
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
Level = SecureLevel.Friends;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public Dices(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
return;
|
||||
|
||||
Roll(from);
|
||||
}
|
||||
|
||||
public void OnTelekinesis(Mobile from)
|
||||
{
|
||||
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5022);
|
||||
Effects.PlaySound(Location, Map, 0x1F5);
|
||||
|
||||
Roll(from);
|
||||
}
|
||||
|
||||
public void Roll(Mobile from)
|
||||
{
|
||||
int one = Utility.Random(1, 6);
|
||||
int two = Utility.Random(1, 6);
|
||||
|
||||
this.SendLocalizedMessage(MessageType.Emote, 1042713, AffixType.Prepend, from.Name + " ", ""); // The first die rolls to a stop and shows:
|
||||
this.SendLocalizedMessage(MessageType.Regular, 1042714, AffixType.Append, " " + one.ToString(), ""); // The first die rolls to a stop and shows:
|
||||
this.SendLocalizedMessage(MessageType.Regular, 1042715, AffixType.Append, " " + two.ToString(), ""); // The second die stops and shows:
|
||||
this.SendLocalizedMessage(MessageType.Regular, 1042716, AffixType.Append, " " + (one + two).ToString(), ""); // Total for this roll:
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write((int)Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version > 0)
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
Level = SecureLevel.Friends;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
405
Scripts/Items/Tools/DisguiseKit.cs
Normal file
405
Scripts/Items/Tools/DisguiseKit.cs
Normal file
@@ -0,0 +1,405 @@
|
||||
#region References
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.SkillHandlers;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Fifth;
|
||||
using Server.Spells.Seventh;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DisguiseKit : Item
|
||||
{
|
||||
[Constructable]
|
||||
public DisguiseKit()
|
||||
: base(0xE05)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public DisguiseKit(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override int LabelNumber { get { return 1041078; } } // a disguise kit
|
||||
|
||||
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 bool ValidateUse(Mobile from)
|
||||
{
|
||||
var pm = from as PlayerMobile;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
// That must be in your pack for you to use it.
|
||||
from.SendLocalizedMessage(1042001);
|
||||
}
|
||||
else if (pm == null || pm.NpcGuild != NpcGuild.ThievesGuild)
|
||||
{
|
||||
// Only Members of the thieves guild are trained to use this item.
|
||||
from.SendLocalizedMessage(501702);
|
||||
}
|
||||
else if (Stealing.SuspendOnMurder && pm.Kills > 0)
|
||||
{
|
||||
// You are currently suspended from the thieves guild. They would frown upon your actions.
|
||||
from.SendLocalizedMessage(501703);
|
||||
}
|
||||
else if (!from.CanBeginAction(typeof(IncognitoSpell)))
|
||||
{
|
||||
// You cannot disguise yourself while incognitoed.
|
||||
from.SendLocalizedMessage(501704);
|
||||
}
|
||||
else if (Sigil.ExistsOn(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil
|
||||
}
|
||||
else if (TransformationSpellHelper.UnderTransformation(from))
|
||||
{
|
||||
// You cannot disguise yourself while in that form.
|
||||
from.SendLocalizedMessage(1061634);
|
||||
}
|
||||
else if (from.BodyMod == 183 || from.BodyMod == 184)
|
||||
{
|
||||
// You cannot disguise yourself while wearing body paint
|
||||
from.SendLocalizedMessage(1040002);
|
||||
}
|
||||
else if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod)
|
||||
{
|
||||
// You cannot disguise yourself while polymorphed.
|
||||
from.SendLocalizedMessage(501705);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (ValidateUse(from))
|
||||
{
|
||||
from.SendGump(new DisguiseGump(from, this, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DisguiseGump : Gump
|
||||
{
|
||||
private static readonly DisguiseEntry[] m_HairEntries = {new DisguiseEntry(8251, 50700, 0, 5, 1011052), // Short
|
||||
new DisguiseEntry(8261, 60710, 0, 3, 1011047), // Pageboy
|
||||
new DisguiseEntry(8252, 60708, 0, -5, 1011053), // Long
|
||||
new DisguiseEntry(8264, 60901, 0, 5, 1011048), // Receding
|
||||
new DisguiseEntry(8253, 60702, 0, -5, 1011054), // Ponytail
|
||||
new DisguiseEntry(8265, 60707, 0, -5, 1011049), // 2-tails
|
||||
new DisguiseEntry(8260, 50703, 0, 5, 1011055), // Mohawk
|
||||
new DisguiseEntry(8266, 60713, 0, 10, 1011050), // Topknot
|
||||
null, new DisguiseEntry(0, 0, 0, 0, 1011051) // None
|
||||
};
|
||||
|
||||
private static readonly DisguiseEntry[] m_BeardEntries = {new DisguiseEntry(8269, 50906, 0, 0, 1011401), // Vandyke
|
||||
new DisguiseEntry(8257, 50808, 0, -2, 1011062), // Mustache
|
||||
new DisguiseEntry(8255, 50802, 0, 0, 1011060), // Short beard
|
||||
new DisguiseEntry(8268, 50905, 0, -10, 1011061), // Long beard
|
||||
new DisguiseEntry(8267, 50904, 0, 0, 1011060), // Short beard
|
||||
new DisguiseEntry(8254, 50801, 0, -10, 1011061), // Long beard
|
||||
null, new DisguiseEntry(0, 0, 0, 0, 1011051) // None
|
||||
};
|
||||
|
||||
private readonly Mobile m_From;
|
||||
private readonly DisguiseKit m_Kit;
|
||||
private readonly bool m_Used;
|
||||
|
||||
public DisguiseGump(Mobile from, DisguiseKit kit, bool startAtHair, bool used)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_From = from;
|
||||
m_Kit = kit;
|
||||
m_Used = used;
|
||||
|
||||
from.CloseGump(typeof(DisguiseGump));
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(100, 10, 400, 385, 2600);
|
||||
|
||||
// <center>THIEF DISGUISE KIT</center>
|
||||
AddHtmlLocalized(100, 25, 400, 35, 1011045, false, false);
|
||||
|
||||
AddButton(140, 353, 4005, 4007, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(172, 355, 90, 35, 1011036, false, false); // OKAY
|
||||
|
||||
AddButton(257, 353, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(289, 355, 90, 35, 1011046, false, false); // APPLY
|
||||
|
||||
if (from.Female || from.Body.IsFemale)
|
||||
{
|
||||
DrawEntries(0, 1, -1, m_HairEntries, -1);
|
||||
}
|
||||
else if (startAtHair)
|
||||
{
|
||||
DrawEntries(0, 1, 2, m_HairEntries, 1011056);
|
||||
DrawEntries(1, 2, 1, m_BeardEntries, 1011059);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawEntries(1, 1, 2, m_BeardEntries, 1011059);
|
||||
DrawEntries(0, 2, 1, m_HairEntries, 1011056);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0)
|
||||
{
|
||||
// Disguises wear off after 2 hours. : You're looking good.
|
||||
m_From.SendLocalizedMessage(m_Used ? 501706 : 501707);
|
||||
return;
|
||||
}
|
||||
|
||||
var switches = info.Switches;
|
||||
|
||||
if (switches.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var switched = switches[0];
|
||||
var type = switched % 2;
|
||||
var index = switched / 2;
|
||||
|
||||
var hair = (type == 0);
|
||||
|
||||
var entries = (hair ? m_HairEntries : m_BeardEntries);
|
||||
|
||||
if (index >= 0 && index < entries.Length)
|
||||
{
|
||||
var entry = entries[index];
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_Kit.ValidateUse(m_From))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hair && (m_From.Female || m_From.Body.IsFemale))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_From.NameMod = NameList.RandomName(m_From.Female ? "female" : "male");
|
||||
|
||||
if (m_From is PlayerMobile)
|
||||
{
|
||||
var pm = (PlayerMobile)m_From;
|
||||
|
||||
if (hair)
|
||||
{
|
||||
pm.SetHairMods(entry.m_ItemID, -2);
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.SetHairMods(-2, entry.m_ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
m_From.SendGump(new DisguiseGump(m_From, m_Kit, hair, true));
|
||||
|
||||
DisguiseTimers.RemoveTimer(m_From);
|
||||
|
||||
DisguiseTimers.CreateTimer(m_From, TimeSpan.FromHours(2.0));
|
||||
DisguiseTimers.StartTimer(m_From);
|
||||
|
||||
BuffInfo.AddBuff(m_From, new BuffInfo(BuffIcon.Disguised, 1075821, 1075820, TimeSpan.FromHours(2.0), m_From));
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawEntries(int index, int page, int nextPage, DisguiseEntry[] entries, int nextNumber)
|
||||
{
|
||||
AddPage(page);
|
||||
|
||||
if (nextPage != -1)
|
||||
{
|
||||
AddButton(155, 320, 250 + (index * 2), 251 + (index * 2), 0, GumpButtonType.Page, nextPage);
|
||||
AddHtmlLocalized(180, 320, 150, 35, nextNumber, false, false);
|
||||
}
|
||||
|
||||
for (var i = 0; i < entries.Length; ++i)
|
||||
{
|
||||
var entry = entries[i];
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var x = (i % 2) * 205;
|
||||
var y = (i / 2) * 55;
|
||||
|
||||
if (entry.m_GumpID != 0)
|
||||
{
|
||||
AddBackground(220 + x, 60 + y, 50, 50, 2620);
|
||||
AddImage(153 + x + entry.m_OffsetX, 15 + y + entry.m_OffsetY, entry.m_GumpID);
|
||||
}
|
||||
|
||||
AddHtmlLocalized(140 + x, 72 + y, 80, 35, entry.m_Number, false, false);
|
||||
AddRadio(118 + x, 73 + y, 208, 209, false, (i * 2) + index);
|
||||
}
|
||||
}
|
||||
|
||||
private class DisguiseEntry
|
||||
{
|
||||
public readonly int m_Number;
|
||||
public readonly int m_ItemID;
|
||||
public readonly int m_GumpID;
|
||||
public readonly int m_OffsetX;
|
||||
public readonly int m_OffsetY;
|
||||
|
||||
public DisguiseEntry(int itemID, int gumpID, int ox, int oy, int name)
|
||||
{
|
||||
m_ItemID = itemID;
|
||||
m_GumpID = gumpID;
|
||||
m_OffsetX = ox;
|
||||
m_OffsetY = oy;
|
||||
m_Number = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DisguiseTimers
|
||||
{
|
||||
private static Dictionary<Mobile, InternalTimer> m_Timers = new Dictionary<Mobile, InternalTimer>();
|
||||
|
||||
public static Dictionary<Mobile, InternalTimer> Timers { get { return m_Timers; } }
|
||||
|
||||
public static void CreateTimer(Mobile m, TimeSpan delay)
|
||||
{
|
||||
if (m != null)
|
||||
{
|
||||
if (!m_Timers.ContainsKey(m))
|
||||
{
|
||||
m_Timers[m] = new InternalTimer(m, delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void StartTimer(Mobile m)
|
||||
{
|
||||
if (m_Timers.ContainsKey(m))
|
||||
{
|
||||
var t = m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsDisguised(Mobile m)
|
||||
{
|
||||
return m_Timers.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static bool StopTimer(Mobile m)
|
||||
{
|
||||
if (m_Timers.ContainsKey(m))
|
||||
{
|
||||
var t = m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool RemoveTimer(Mobile m)
|
||||
{
|
||||
if (m_Timers.ContainsKey(m))
|
||||
{
|
||||
var t = m_Timers[m];
|
||||
|
||||
if (t != null)
|
||||
{
|
||||
t.Stop();
|
||||
m_Timers.Remove(m);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static TimeSpan TimeRemaining(Mobile m)
|
||||
{
|
||||
if (m_Timers.ContainsKey(m))
|
||||
{
|
||||
var t = m_Timers[m];
|
||||
|
||||
if (t != null && t.Expires > DateTime.UtcNow)
|
||||
{
|
||||
return t.Expires - DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
public class InternalTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Player;
|
||||
|
||||
public DateTime Expires { get; private set; }
|
||||
|
||||
public InternalTimer(Mobile m, TimeSpan delay)
|
||||
: base(delay)
|
||||
{
|
||||
m_Player = m;
|
||||
Priority = TimerPriority.OneMinute;
|
||||
|
||||
Expires = DateTime.UtcNow + delay;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Player.NameMod = null;
|
||||
|
||||
if (m_Player is PlayerMobile)
|
||||
{
|
||||
((PlayerMobile)m_Player).SetHairMods(-1, -1);
|
||||
}
|
||||
|
||||
RemoveTimer(m_Player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Tools/DovetailSaw.cs
Normal file
52
Scripts/Items/Tools/DovetailSaw.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x1028, 0x1029)]
|
||||
public class DovetailSaw : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public DovetailSaw()
|
||||
: base(0x1028)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DovetailSaw(int uses)
|
||||
: base(uses, 0x1028)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public DovetailSaw(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (this.Weight == 1.0)
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/DrawKnife.cs
Normal file
48
Scripts/Items/Tools/DrawKnife.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DrawKnife : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public DrawKnife()
|
||||
: base(0x10E4)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DrawKnife(int uses)
|
||||
: base(uses, 0x10E4)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public DrawKnife(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
278
Scripts/Items/Tools/DyeTub.cs
Normal file
278
Scripts/Items/Tools/DyeTub.cs
Normal file
@@ -0,0 +1,278 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IDyable
|
||||
{
|
||||
bool Dye(Mobile from, DyeTub sender);
|
||||
}
|
||||
|
||||
public class DyeTub : Item, ISecurable
|
||||
{
|
||||
private bool m_Redyable;
|
||||
private int m_DyedHue;
|
||||
private SecureLevel m_SecureLevel;
|
||||
|
||||
[Constructable]
|
||||
public DyeTub()
|
||||
: base(0xFAB)
|
||||
{
|
||||
Weight = 10.0;
|
||||
m_Redyable = true;
|
||||
}
|
||||
|
||||
public DyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual CustomHuePicker CustomHuePicker { get { return null; } }
|
||||
public virtual bool AllowRunebooks { get { return false; } }
|
||||
public virtual bool AllowFurniture { get { return false; } }
|
||||
public virtual bool AllowStatuettes { get { return false; } }
|
||||
public virtual bool AllowLeather { get { return false; } }
|
||||
public virtual bool AllowDyables { get { return true; } }
|
||||
public virtual bool AllowMetal { get { return false; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Redyable
|
||||
{
|
||||
get { return m_Redyable; }
|
||||
set { m_Redyable = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int DyedHue
|
||||
{
|
||||
get { return m_DyedHue; }
|
||||
set
|
||||
{
|
||||
if (m_Redyable)
|
||||
{
|
||||
m_DyedHue = value;
|
||||
Hue = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get { return m_SecureLevel; }
|
||||
set { m_SecureLevel = value; }
|
||||
}
|
||||
|
||||
public virtual int TargetMessage { get { return 500859; } } // Select the clothing to dye.
|
||||
public virtual int FailMessage { get { return 1042083; } } // You can not dye that.
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)m_SecureLevel);
|
||||
writer.Write((bool)m_Redyable);
|
||||
writer.Write((int)m_DyedHue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_SecureLevel = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Redyable = reader.ReadBool();
|
||||
m_DyedHue = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(TargetMessage);
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly DyeTub m_Tub;
|
||||
|
||||
public InternalTarget(DyeTub tub)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Tub = tub;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is Item)
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
|
||||
if (item is IDyable && m_Tub.AllowDyables)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
else if (item.Parent is Mobile)
|
||||
from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
|
||||
else if (((IDyable)item).Dye(from, m_Tub))
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else
|
||||
{
|
||||
bool okay = (item.IsChildOf(from.Backpack));
|
||||
|
||||
if (!okay)
|
||||
{
|
||||
if (item.Parent == null)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(item);
|
||||
|
||||
if (!house.IsCoOwner(from))
|
||||
from.SendLocalizedMessage(501023); // You must be the owner to use this item.
|
||||
else if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)) && (!(item is AddonComponent) || !house.Addons.ContainsKey(((AddonComponent)item).Addon)))
|
||||
from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
|
||||
else
|
||||
okay = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1048135); // The furniture must be in your backpack to be painted.
|
||||
}
|
||||
}
|
||||
|
||||
if (okay)
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (!item.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1049776); // You cannot dye runes or runebooks that are locked down.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (!item.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1049779); // You cannot dye statuettes that are locked down.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else if (m_Tub.AllowLeather)
|
||||
{
|
||||
if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) ||
|
||||
(item is BaseClothing && (((BaseClothing)item).DefaultResource == CraftResource.RegularLeather) || item is WoodlandBelt || item is BarbedWhip
|
||||
|| item is BladedWhip || item is SpikedWhip))
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (!item.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1042419); // You may not dye leather items which are locked down.
|
||||
}
|
||||
else if (item.Parent is Mobile)
|
||||
{
|
||||
from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(m_Tub.FailMessage);
|
||||
}
|
||||
}
|
||||
else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Chainmail || ((BaseArmor)item).MaterialType == ArmorMaterialType.Ringmail || ((BaseArmor)item).MaterialType == ArmorMaterialType.Plate)) && m_Tub.AllowMetal)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (!item.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1042419); // You may not dye leather items which are locked down.
|
||||
}
|
||||
else if (item.Parent is Mobile)
|
||||
{
|
||||
from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
|
||||
}
|
||||
else
|
||||
{
|
||||
item.Hue = m_Tub.DyedHue;
|
||||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(m_Tub.FailMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(m_Tub.FailMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
100
Scripts/Items/Tools/Dyes.cs
Normal file
100
Scripts/Items/Tools/Dyes.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Server.HuePickers;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Dyes : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Dyes()
|
||||
: base(0xFA9)
|
||||
{
|
||||
this.Weight = 3.0;
|
||||
}
|
||||
|
||||
public Dyes(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();
|
||||
|
||||
if (this.Weight == 0.0)
|
||||
this.Weight = 3.0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(500856); // Select the dye tub to use the dyes on.
|
||||
from.Target = new InternalTarget();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
public InternalTarget()
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is DyeTub)
|
||||
{
|
||||
DyeTub tub = (DyeTub)targeted;
|
||||
|
||||
if (tub.Redyable)
|
||||
{
|
||||
if (tub.CustomHuePicker == null)
|
||||
from.SendHuePicker(new InternalPicker(tub));
|
||||
else
|
||||
from.SendGump(new CustomHuePickerGump(from, tub.CustomHuePicker, new CustomHuePickerCallback(SetTubHue), tub));
|
||||
}
|
||||
else if (tub is BlackDyeTub)
|
||||
{
|
||||
from.SendLocalizedMessage(1010092); // You can not use this on a black dye tub.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("That dye tub may not be redyed.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(500857); // Use this on a dye tub.
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetTubHue(Mobile from, object state, int hue)
|
||||
{
|
||||
((DyeTub)state).DyedHue = hue;
|
||||
}
|
||||
|
||||
private class InternalPicker : HuePicker
|
||||
{
|
||||
private readonly DyeTub m_Tub;
|
||||
public InternalPicker(DyeTub tub)
|
||||
: base(tub.ItemID)
|
||||
{
|
||||
this.m_Tub = tub;
|
||||
}
|
||||
|
||||
public override void OnResponse(int hue)
|
||||
{
|
||||
this.m_Tub.DyedHue = hue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
678
Scripts/Items/Tools/FishingPole.cs
Normal file
678
Scripts/Items/Tools/FishingPole.cs
Normal file
@@ -0,0 +1,678 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
using Server.Engines.Harvest;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Misc;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FishingPole : Item, ICraftable, IUsesRemaining, IResource, IQuality
|
||||
{
|
||||
private Type m_BaitType;
|
||||
private bool m_EnhancedBait;
|
||||
private HookType m_HookType;
|
||||
private int m_HookUses;
|
||||
private int m_BaitUses;
|
||||
private int m_OriginalHue;
|
||||
|
||||
private Mobile m_Crafter;
|
||||
private ItemQuality m_Quality;
|
||||
|
||||
private AosAttributes m_AosAttributes;
|
||||
private AosSkillBonuses m_AosSkillBonuses;
|
||||
private CraftResource m_Resource;
|
||||
private bool m_PlayerConstructed;
|
||||
|
||||
private int m_UsesRemaining;
|
||||
private bool m_ShowUsesRemaining;
|
||||
|
||||
private int m_LowerStatReq;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Type BaitType
|
||||
{
|
||||
get { return m_BaitType; }
|
||||
set
|
||||
{
|
||||
m_BaitType = value;
|
||||
|
||||
if (m_BaitType == null)
|
||||
m_EnhancedBait = false;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool EnhancedBait
|
||||
{
|
||||
get { return m_EnhancedBait; }
|
||||
set { m_EnhancedBait = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HookType HookType
|
||||
{
|
||||
get { return m_HookType; }
|
||||
set
|
||||
{
|
||||
m_HookType = value;
|
||||
|
||||
if (m_HookType == HookType.None)
|
||||
Hue = m_OriginalHue;
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int HookUses
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_HookUses;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_HookUses = value;
|
||||
|
||||
if (m_HookUses <= 0)
|
||||
{
|
||||
m_HookUses = 0;
|
||||
HookType = HookType.None;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int BaitUses
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_BaitUses;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_BaitUses = value;
|
||||
|
||||
if (m_BaitUses <= 0)
|
||||
{
|
||||
m_BaitUses = 0;
|
||||
BaitType = null;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AosAttributes Attributes
|
||||
{
|
||||
get { return m_AosAttributes; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public AosSkillBonuses SkillBonuses
|
||||
{
|
||||
get { return m_AosSkillBonuses; }
|
||||
set { }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return m_Resource; }
|
||||
set { m_Resource = value; Hue = CraftResources.GetHue(m_Resource); InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool PlayerConstructed
|
||||
{
|
||||
get { return m_PlayerConstructed; }
|
||||
set { m_PlayerConstructed = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int OriginalHue
|
||||
{
|
||||
get { return m_OriginalHue; }
|
||||
set { m_OriginalHue = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter
|
||||
{
|
||||
get { return m_Crafter; }
|
||||
set { m_Crafter = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality
|
||||
{
|
||||
get { return m_Quality; }
|
||||
set
|
||||
{
|
||||
UnscaleUses();
|
||||
m_Quality = value;
|
||||
ScaleUses();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get { return m_ShowUsesRemaining; }
|
||||
set { m_ShowUsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int LowerStatReq
|
||||
{
|
||||
get { return m_LowerStatReq; }
|
||||
set { m_LowerStatReq = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FishingPole()
|
||||
: base(0x0DC0)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
Weight = 8.0;
|
||||
Resource = CraftResource.RegularWood;
|
||||
|
||||
m_BaitType = null;
|
||||
m_HookType = HookType.None;
|
||||
|
||||
m_AosAttributes = new AosAttributes(this);
|
||||
m_AosSkillBonuses = new AosSkillBonuses(this);
|
||||
|
||||
UsesRemaining = 150;
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public int GetStrRequirement()
|
||||
{
|
||||
return AOS.Scale(10, 100 - m_LowerStatReq);
|
||||
}
|
||||
|
||||
public void OnFishedHarvest(Mobile from, bool caughtAnything)
|
||||
{
|
||||
if (m_HookType != HookType.None)
|
||||
{
|
||||
HookUses--;
|
||||
|
||||
if (m_HookType == HookType.None)
|
||||
from.SendLocalizedMessage(1149854); //As the magic of the hook fades, it transforms to a normal fishhook. The fishing pole returns to normal.
|
||||
}
|
||||
|
||||
if (caughtAnything && m_BaitType != null)
|
||||
BaitUses--;
|
||||
}
|
||||
|
||||
public override bool AllowEquipedCast(Mobile from)
|
||||
{
|
||||
if (base.AllowEquipedCast(from))
|
||||
return true;
|
||||
|
||||
return (m_AosAttributes.SpellChanneling != 0);
|
||||
}
|
||||
|
||||
public virtual int GetLuckBonus()
|
||||
{
|
||||
if (m_Resource == CraftResource.Heartwood)
|
||||
return 0;
|
||||
|
||||
CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);
|
||||
|
||||
if (resInfo == null)
|
||||
return 0;
|
||||
|
||||
CraftAttributeInfo attrInfo = resInfo.AttributeInfo;
|
||||
|
||||
if (attrInfo == null)
|
||||
return 0;
|
||||
|
||||
return attrInfo.WeaponLuck;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
Fishing.System.BeginHarvesting(from, this);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
BaseHarvestTool.AddContextMenuEntries(from, this, list, Fishing.System);
|
||||
}
|
||||
|
||||
public override bool CanEquip(Mobile from)
|
||||
{
|
||||
if (from.Str < GetStrRequirement())
|
||||
{
|
||||
from.SendLocalizedMessage(500213); // You are not strong enough to equip that.
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CanEquip(from);
|
||||
}
|
||||
|
||||
public override bool OnEquip(Mobile from)
|
||||
{
|
||||
int strBonus = m_AosAttributes.BonusStr;
|
||||
int dexBonus = m_AosAttributes.BonusDex;
|
||||
int intBonus = m_AosAttributes.BonusInt;
|
||||
|
||||
if ((strBonus != 0 || dexBonus != 0 || intBonus != 0))
|
||||
{
|
||||
Mobile m = from;
|
||||
|
||||
string modName = this.Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
|
||||
|
||||
if (dexBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
|
||||
|
||||
if (intBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnAdded(object parent)
|
||||
{
|
||||
if (parent is Mobile)
|
||||
{
|
||||
Mobile from = (Mobile)parent;
|
||||
|
||||
if (Core.AOS)
|
||||
m_AosSkillBonuses.AddTo(from);
|
||||
|
||||
from.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
if (parent is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)parent;
|
||||
|
||||
string modName = this.Serial.ToString();
|
||||
|
||||
m.RemoveStatMod(modName + "Str");
|
||||
m.RemoveStatMod(modName + "Dex");
|
||||
m.RemoveStatMod(modName + "Int");
|
||||
|
||||
if (Core.AOS)
|
||||
m_AosSkillBonuses.Remove();
|
||||
|
||||
m.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Crafter != null)
|
||||
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
|
||||
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (Siege.SiegeShard && m_ShowUsesRemaining)
|
||||
{
|
||||
list.Add(1060584, UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_AosAttributes.Brittle != 0)
|
||||
list.Add(1116209); // Brittle
|
||||
|
||||
if (m_AosSkillBonuses != null)
|
||||
m_AosSkillBonuses.GetProperties(list);
|
||||
|
||||
base.AddResistanceProperties(list);
|
||||
|
||||
int prop = 0;
|
||||
|
||||
if ((prop = (m_AosAttributes.WeaponDamage)) != 0)
|
||||
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.DefendChance) != 0)
|
||||
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.EnhancePotions) != 0)
|
||||
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.CastRecovery) != 0)
|
||||
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.CastSpeed) != 0)
|
||||
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
|
||||
|
||||
if ((prop = (m_AosAttributes.AttackChance)) != 0)
|
||||
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.BonusDex) != 0)
|
||||
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusHits) != 0)
|
||||
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusInt) != 0)
|
||||
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.LowerManaCost) != 0)
|
||||
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.LowerRegCost) != 0)
|
||||
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
|
||||
|
||||
if ((prop = m_LowerStatReq) != 0)
|
||||
list.Add(1060435, m_LowerStatReq.ToString()); // lower requirements ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.SpellChanneling) != 0)
|
||||
list.Add(1060482); // spell channeling
|
||||
|
||||
if (!CraftResources.IsStandard(m_Resource))
|
||||
list.Add(CraftResources.GetName(m_Resource));
|
||||
|
||||
if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
|
||||
list.Add(1060436, prop.ToString()); // luck ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusMana) != 0)
|
||||
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenMana) != 0)
|
||||
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.NightSight) != 0)
|
||||
list.Add(1060441); // night sight
|
||||
|
||||
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
|
||||
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.RegenStam) != 0)
|
||||
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.RegenHits) != 0)
|
||||
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.SpellDamage) != 0)
|
||||
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStam) != 0)
|
||||
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
|
||||
|
||||
if ((prop = m_AosAttributes.BonusStr) != 0)
|
||||
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
|
||||
|
||||
//if ( (prop = m_AosAttributes.WeaponSpeed) != 0 )
|
||||
// list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%
|
||||
|
||||
int hookCliloc = BaseFishingHook.GetHookType(m_HookType);
|
||||
|
||||
if (m_HookType > HookType.None && hookCliloc > 0)
|
||||
{
|
||||
list.Add(1150885, String.Format("#{0}", hookCliloc)); //special hook: ~1_token~
|
||||
list.Add(1150889, String.Format("#{0}", BaseFishingHook.GetCondition(m_HookUses))); //Hook condition: ~1_val~
|
||||
}
|
||||
|
||||
if (m_BaitType != null)
|
||||
{
|
||||
object label = FishInfo.GetFishLabel(m_BaitType);
|
||||
if (label is int)
|
||||
list.Add(1116468, String.Format("#{0}", (int)label)); //baited to attract: ~1_val~
|
||||
else if (label is string)
|
||||
list.Add(1116468, (string)label);
|
||||
|
||||
list.Add(1116466, m_BaitUses.ToString()); // amount: ~1_val~
|
||||
}
|
||||
|
||||
list.Add(1061170, GetStrRequirement().ToString()); // strength requirement ~1_val~
|
||||
}
|
||||
|
||||
public FishingPole(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf)
|
||||
{
|
||||
if (setIf)
|
||||
flags |= toSet;
|
||||
}
|
||||
|
||||
private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet)
|
||||
{
|
||||
return ((flags & toGet) != 0);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)4); // version
|
||||
|
||||
writer.Write(m_PlayerConstructed);
|
||||
writer.Write(m_LowerStatReq);
|
||||
|
||||
writer.Write(m_UsesRemaining);
|
||||
writer.Write(m_ShowUsesRemaining);
|
||||
|
||||
writer.Write(m_OriginalHue);
|
||||
|
||||
writer.Write(FishInfo.GetIndexFromType(m_BaitType));
|
||||
writer.Write((int)m_HookType);
|
||||
writer.Write(m_HookUses);
|
||||
writer.Write(m_BaitUses);
|
||||
writer.Write(m_EnhancedBait);
|
||||
|
||||
SaveFlag flags = SaveFlag.None;
|
||||
|
||||
SetSaveFlag(ref flags, SaveFlag.xAttributes, !m_AosAttributes.IsEmpty);
|
||||
SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
|
||||
|
||||
writer.Write((int)flags);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.xAttributes))
|
||||
m_AosAttributes.Serialize(writer);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
|
||||
m_AosSkillBonuses.Serialize(writer);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 4:
|
||||
m_PlayerConstructed = reader.ReadBool();
|
||||
m_LowerStatReq = reader.ReadInt();
|
||||
goto case 3;
|
||||
case 3:
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_ShowUsesRemaining = reader.ReadBool();
|
||||
goto case 2;
|
||||
case 2:
|
||||
m_OriginalHue = reader.ReadInt();
|
||||
int idx = reader.ReadInt();
|
||||
m_BaitType = FishInfo.GetTypeFromIndex(idx);
|
||||
m_HookType = (HookType)reader.ReadInt();
|
||||
m_HookUses = reader.ReadInt();
|
||||
m_BaitUses = reader.ReadInt();
|
||||
m_EnhancedBait = reader.ReadBool();
|
||||
|
||||
SaveFlag flags = (SaveFlag)reader.ReadInt();
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.xAttributes))
|
||||
m_AosAttributes = new AosAttributes(this, reader);
|
||||
else
|
||||
m_AosAttributes = new AosAttributes(this);
|
||||
|
||||
if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
|
||||
m_AosSkillBonuses = new AosSkillBonuses(this, reader);
|
||||
else
|
||||
m_AosSkillBonuses = new AosSkillBonuses(this);
|
||||
break;
|
||||
case 1:
|
||||
m_AosAttributes = new AosAttributes(this);
|
||||
m_AosSkillBonuses = new AosSkillBonuses(this);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Core.AOS && Parent is Mobile)
|
||||
m_AosSkillBonuses.AddTo((Mobile)Parent);
|
||||
|
||||
int strBonus = m_AosAttributes.BonusStr;
|
||||
int dexBonus = m_AosAttributes.BonusDex;
|
||||
int intBonus = m_AosAttributes.BonusInt;
|
||||
|
||||
if (this.Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
|
||||
{
|
||||
Mobile m = (Mobile)this.Parent;
|
||||
|
||||
string modName = this.Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
|
||||
|
||||
if (dexBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
|
||||
|
||||
if (intBonus != 0)
|
||||
m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (Parent is Mobile)
|
||||
((Mobile)Parent).CheckStatTimers();
|
||||
|
||||
if (m_BaitType != null && m_BaitUses <= 0)
|
||||
BaitType = null;
|
||||
|
||||
if (m_HookType != HookType.None && m_HookUses <= 0)
|
||||
HookType = HookType.None;
|
||||
|
||||
if (version < 3 && m_Crafter != null)
|
||||
{
|
||||
m_PlayerConstructed = true;
|
||||
|
||||
if (m_Resource == CraftResource.None)
|
||||
Resource = CraftResource.RegularWood;
|
||||
else
|
||||
{
|
||||
DistributeMaterialBonus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum SaveFlag
|
||||
{
|
||||
None = 0x00000000,
|
||||
xAttributes = 0x00000001,
|
||||
SkillBonuses = 0x00000002
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
PlayerConstructed = true;
|
||||
|
||||
if (makersMark) // Add to CraftItem.cs mark table
|
||||
Crafter = from;
|
||||
|
||||
Type resourceType = typeRes;
|
||||
|
||||
if (resourceType == null)
|
||||
resourceType = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(resourceType);
|
||||
DistributeMaterialBonus();
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public void DistributeMaterialBonus()
|
||||
{
|
||||
CraftResourceInfo resInfo = CraftResources.GetInfo(m_Resource);
|
||||
|
||||
if (resInfo == null)
|
||||
return;
|
||||
|
||||
CraftAttributeInfo attrInfo = resInfo.AttributeInfo;
|
||||
|
||||
if (attrInfo != null)
|
||||
DistributeMaterialBonus(attrInfo);
|
||||
}
|
||||
|
||||
public void DistributeMaterialBonus(CraftAttributeInfo attrInfo)
|
||||
{
|
||||
if (m_Resource != CraftResource.Heartwood)
|
||||
{
|
||||
Attributes.SpellChanneling = attrInfo.OtherSpellChanneling;
|
||||
Attributes.Luck = attrInfo.OtherLuck;
|
||||
Attributes.RegenHits = attrInfo.OtherRegenHits;
|
||||
LowerStatReq = attrInfo.OtherLowerRequirements;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Utility.Random(5))
|
||||
{
|
||||
case 0: Attributes.Luck += 40; break;
|
||||
case 1: Attributes.Luck += 10; break;
|
||||
case 2: Attributes.RegenHits += attrInfo.OtherRegenHits; break;
|
||||
case 3: Attributes.SpellChanneling = attrInfo.OtherSpellChanneling; break;
|
||||
case 4: LowerStatReq = attrInfo.OtherLowerRequirements; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Scripts/Items/Tools/FletcherTools.cs
Normal file
42
Scripts/Items/Tools/FletcherTools.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x1022, 0x1023)]
|
||||
public class FletcherTools : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem { get { return DefBowFletching.CraftSystem; } }
|
||||
public override int LabelNumber { get { return 1044559; } } // Fletcher's Tools
|
||||
|
||||
[Constructable]
|
||||
public FletcherTools()
|
||||
: base(0x1022)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FletcherTools(int uses)
|
||||
: base(uses, 0x1022)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public FletcherTools(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/FlourSifter.cs
Normal file
48
Scripts/Items/Tools/FlourSifter.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FlourSifter : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public FlourSifter()
|
||||
: base(0x103E)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FlourSifter(int uses)
|
||||
: base(uses, 0x103E)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public FlourSifter(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCooking.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
220
Scripts/Items/Tools/ForgedMetalOfArtifacts.cs
Normal file
220
Scripts/Items/Tools/ForgedMetalOfArtifacts.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ForgedMetalOfArtifacts : Item
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
|
||||
public override int LabelNumber { get { return 1149868; } } // Forged Metal of Artifacts
|
||||
|
||||
[Constructable]
|
||||
public ForgedMetalOfArtifacts(int uses)
|
||||
: base(0xE8A)
|
||||
{
|
||||
Weight = 5.0;
|
||||
Hue = 51;
|
||||
ItemID = 4023;
|
||||
m_UsesRemaining = uses;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ForgedMetalOfArtifacts()
|
||||
: this(5)
|
||||
{
|
||||
}
|
||||
|
||||
public ForgedMetalOfArtifacts(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
from.CloseGump(typeof(CancelGump));
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (pm.NextEnhanceSuccess)
|
||||
{
|
||||
from.SendGump(new CancelGump(pm, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new InternalGump(pm, this));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void Use(PlayerMobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.NextEnhanceSuccess = true;
|
||||
from.SendLocalizedMessage(1149956); // A magical aura surrounds you and you feel your next item enhancing attempt will most certainly be successful.
|
||||
this.m_UsesRemaining -= 1;
|
||||
InvalidateProperties();
|
||||
if (this.m_UsesRemaining <= 0)
|
||||
{
|
||||
this.Delete();
|
||||
from.SendLocalizedMessage(1044038); // You have worn out your tool!
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalGump : Gump
|
||||
{
|
||||
private PlayerMobile m_Mobile;
|
||||
private ForgedMetalOfArtifacts m_Tool;
|
||||
|
||||
public InternalGump(PlayerMobile from, ForgedMetalOfArtifacts tool)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_Tool = tool;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 400, 230, 0x13BE);
|
||||
|
||||
AddImageTiled(5, 5, 390, 25, 0xA40);
|
||||
AddHtmlLocalized(5, 8, 390, 25, 1113302, "#1149868", 0x7FFF, false, false); // <CENTER>Forged Metal of Artifacts</CENTER>
|
||||
|
||||
AddImageTiled(5, 35, 390, 125, 0xA40);
|
||||
|
||||
/*
|
||||
* The next time that you try to enhance an item the success rate will be the value listed
|
||||
* below regardless of your skill and total intensity of the item. Skill requirements still
|
||||
* apply to material usage. One charge on this item will be consumed per use and only one
|
||||
* instance of this buff can be active at any time.
|
||||
*/
|
||||
AddHtmlLocalized(10, 40, 380, 125, 1149920, 0x7FFF, false, false);
|
||||
|
||||
AddImageTiled(5, 165, 120, 30, 0xA40);
|
||||
AddHtmlLocalized(10, 170, 120, 30, 1149921, 0x7FFF, false, false); // Skill:
|
||||
AddImageTiled(125, 165, 140, 30, 0xA40);
|
||||
AddHtmlLocalized(130, 170, 140, 30, 1114057, "#1149992", 0x7FFF, false, false); // All Crafting Skills
|
||||
|
||||
AddImageTiled(5, 195, 120, 30, 0xA40);
|
||||
AddHtmlLocalized(10, 200, 120, 30, 1149933, 0x7FFF, false, false); // Success Rate:
|
||||
AddImageTiled(125, 195, 140, 30, 0xA40);
|
||||
AddHtmlLocalized(130, 200, 140, 30, 1149934, "100", 0x7FFF, false, false); // ~1_VAL~%
|
||||
|
||||
AddImageTiled(270, 165, 125, 60, 0xA40);
|
||||
AddButton(275, 170, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(310, 172, 85, 30, 1149935, 0x7FFF, false, false); // OKAY
|
||||
AddButton(275, 200, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(310, 202, 85, 30, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
m_Tool.Use(m_Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CancelGump : Gump
|
||||
{
|
||||
private PlayerMobile m_Mobile;
|
||||
private ForgedMetalOfArtifacts m_Tool;
|
||||
|
||||
public CancelGump(PlayerMobile from, ForgedMetalOfArtifacts tool)
|
||||
: base(50, 50)
|
||||
{
|
||||
m_Mobile = from;
|
||||
m_Tool = tool;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 400, 155, 0x13BE);
|
||||
AddImageTiled(5, 5, 390, 25, 0xA40);
|
||||
AddHtmlLocalized(5, 8, 390, 25, 1113302, "#1149868", 0x7FFF, false, false); // <CENTER>~1_VAL~</CENTER>
|
||||
AddImageTiled(5, 35, 390, 52, 0xA40);
|
||||
AddHtmlLocalized(10, 40, 380, 52, 1149967, 0x7FFF, false, false); // *CAUTION* You are under the following ENHANCE ITEM buff. Do you want to remove it?
|
||||
AddImageTiled(5, 92, 120, 29, 0xA40);
|
||||
AddHtmlLocalized(10, 97, 120, 29, 1149921, 0x7FFF, false, false); // Skill:
|
||||
AddImageTiled(5, 121, 120, 29, 0xA40);
|
||||
AddHtmlLocalized(10, 126, 120, 29, 1149933, 0x7FFF, false, false); // Success Rate:
|
||||
AddImageTiled(125, 92, 140, 29, 0xA40);
|
||||
AddHtmlLocalized(130, 97, 140, 29, 1114057, "#1149992", 0x7FFF, false, false); // ~1_val~
|
||||
AddImageTiled(125, 121, 140, 29, 0xA40);
|
||||
AddHtmlLocalized(130, 126, 140, 29, 1149934, "100", 0x7FFF, false, false); // ~1_VAL~%
|
||||
AddImageTiled(270, 92, 125, 58, 0xA40);
|
||||
AddButton(275, 97, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(310, 99, 85, 29, 1149968, 0x7FFF, false, false); // REMOVE
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
if (m_Tool == null || m_Tool.Deleted)
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1155766); // A charge could not be refunded to the last Forged Metal of Artifacts tool you used, you must use this charge.
|
||||
}
|
||||
else if (!m_Tool.IsChildOf(m_Mobile.Backpack))
|
||||
{
|
||||
m_Mobile.SendLocalizedMessage(1155767); // A charge could not be refunded to the last Forged Metal of Artifacts tool you used because the item is not in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Mobile.NextEnhanceSuccess = false;
|
||||
m_Mobile.SendLocalizedMessage(1149969); // The magical aura that surrounded you disipates and you feel that your item enhancement chances have returned to normal.
|
||||
|
||||
m_Tool.UsesRemaining += 1;
|
||||
m_Mobile.SendLocalizedMessage(1155768); // A charged has been refunded to your Forged Metal of Artifacts tool.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/Froe.cs
Normal file
48
Scripts/Items/Tools/Froe.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Froe : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Froe()
|
||||
: base(0x10E5)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Froe(int uses)
|
||||
: base(uses, 0x10E5)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public Froe(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
110
Scripts/Items/Tools/FurnitureDyeTub.cs
Normal file
110
Scripts/Items/Tools/FurnitureDyeTub.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FurnitureDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public FurnitureDyeTub()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public FurnitureDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override bool AllowFurniture
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override int TargetMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 501019;
|
||||
}
|
||||
}// Select the furniture to dye.
|
||||
public override int FailMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 501021;
|
||||
}
|
||||
}// That is not a piece of furniture.
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041246;
|
||||
}
|
||||
}// Furniture Dye Tub
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.LootType == LootType.Regular)
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
}
|
||||
174
Scripts/Items/Tools/GMEthereal.cs
Normal file
174
Scripts/Items/Tools/GMEthereal.cs
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
snicker7
|
||||
Released: 03/26/06
|
||||
*/
|
||||
using System;
|
||||
|
||||
using CustomsFramework;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class GMEthereal : EtherealMount
|
||||
{
|
||||
public override int FollowerSlots { get { return 0; } }
|
||||
|
||||
private static readonly EtherealInfo[] EthyItemTypes = new EtherealInfo[]
|
||||
{
|
||||
new EtherealInfo(0x20DD, 0x3EAA), //Horse
|
||||
new EtherealInfo(0x20F6, 0x3EAB), //Llama
|
||||
new EtherealInfo(0x2135, 0x3EAC), //Ostard
|
||||
new EtherealInfo(8501, 16035), //DesertOstard
|
||||
new EtherealInfo(8502, 16036), //FrenziedOstard
|
||||
new EtherealInfo(0x2615, 0x3E9A), //Ridgeback
|
||||
new EtherealInfo(0x25CE, 0x3E9B), //Unicorn
|
||||
new EtherealInfo(0x260F, 0x3E97), //Beetle
|
||||
new EtherealInfo(0x25A0, 0x3E9C), //Kirin
|
||||
new EtherealInfo(0x2619, 0x3E98), //SwampDragon
|
||||
new EtherealInfo(9751, 16059), //SkeletalMount
|
||||
new EtherealInfo(10090, 16020), //Hiryu
|
||||
new EtherealInfo(11676, 16018), //ChargerOfTheFallen
|
||||
new EtherealInfo(9658, 16051), //SeaHorse
|
||||
new EtherealInfo(11669, 16016), //Chimera
|
||||
new EtherealInfo(11670, 16017), //CuSidhe
|
||||
new EtherealInfo(8417, 16069), //PolarBear
|
||||
new EtherealInfo(0x46f8, 0x3EC6)
|
||||
};
|
||||
private EtherealTypes m_EthyType;
|
||||
[Constructable]
|
||||
public GMEthereal()
|
||||
: this(EtherealTypes.Horse)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GMEthereal(EtherealTypes type)
|
||||
: base(0,0,0)
|
||||
{
|
||||
EthyType = type;
|
||||
LootType = LootType.Blessed;
|
||||
Name = "Staff Ethereal Steed";
|
||||
}
|
||||
|
||||
public GMEthereal(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public enum EtherealTypes
|
||||
{
|
||||
Horse,
|
||||
Llama,
|
||||
Ostard,
|
||||
OstardDesert,
|
||||
OstardFrenzied,
|
||||
Ridgeback,
|
||||
Unicorn,
|
||||
Beetle,
|
||||
Kirin,
|
||||
SwampDragon,
|
||||
SkeletalHorse,
|
||||
Hiryu,
|
||||
ChargerOfTheFallen,
|
||||
SeaHorse,
|
||||
Chimera,
|
||||
CuSidhe,
|
||||
PolarBear,
|
||||
Boura
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public EtherealTypes EthyType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_EthyType;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((int)value > EthyItemTypes.Length)
|
||||
return;
|
||||
m_EthyType = value;
|
||||
|
||||
TransparentMountedID = EthyItemTypes[(int)value].MountedID;
|
||||
NonTransparentMountedID = TransparentMountedID;
|
||||
StatueID = EthyItemTypes[(int)value].RegularID;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Utilities.IsStaff(from))
|
||||
{
|
||||
if (from.Mounted)
|
||||
from.SendLocalizedMessage(1005583); // Please dismount first.
|
||||
else if (from.Race == Race.Gargoyle)
|
||||
from.SendLocalizedMessage(1112281); // gargs can't mount
|
||||
else if (from.HasTrade)
|
||||
from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time
|
||||
else if (Multis.DesignContext.Check(from))
|
||||
{
|
||||
if (!Deleted && Rider == null && IsChildOf(from.Backpack))
|
||||
{
|
||||
Rider = from;
|
||||
if (MountedID == 16051)
|
||||
Rider.CanSwim = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("This item is to only be used by staff members.");
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
writer.Write((int)m_EthyType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
EthyType = (EtherealTypes)reader.ReadInt();
|
||||
}
|
||||
|
||||
public struct EtherealInfo
|
||||
{
|
||||
public int RegularID;
|
||||
public int MountedID;
|
||||
public EtherealInfo(int id, int mid)
|
||||
{
|
||||
RegularID = id;
|
||||
MountedID = mid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class GMEthVirtual : EtherealMount
|
||||
{
|
||||
public GMEthVirtual(int id, int mid)
|
||||
: base(id, mid, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public GMEthVirtual(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
477
Scripts/Items/Tools/GMHidingStone.cs
Normal file
477
Scripts/Items/Tools/GMHidingStone.cs
Normal file
@@ -0,0 +1,477 @@
|
||||
/*
|
||||
Script Name: GMHidingStone.cs
|
||||
Author: Marchenzio
|
||||
Version: 1.0
|
||||
Public Release: 01/01/09
|
||||
Updated Release: 01/01/09
|
||||
Purpose: A stone that allows for multiple hide/appear effects for GM and above.
|
||||
*/
|
||||
using System;
|
||||
using CustomsFramework;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum StoneEffect
|
||||
{
|
||||
Gate,
|
||||
FlameStrike1,
|
||||
FlameStrike3,
|
||||
FlameStrikeLightningBolt,
|
||||
Sparkle1,
|
||||
Sparkle3,
|
||||
Explosion,
|
||||
ExplosionLightningBolt,
|
||||
DefaultRunUO,
|
||||
Snow,
|
||||
Glow,
|
||||
PoisonField,
|
||||
Fireball,
|
||||
FireStorm1,
|
||||
FireStorm2,
|
||||
RedSparkle,
|
||||
RedSparkle2,
|
||||
Marchenzio1,
|
||||
Hell
|
||||
}
|
||||
|
||||
public class GMHidingStone : Item
|
||||
{
|
||||
private StoneEffect mAppearEffect;
|
||||
private StoneEffect mHideEffect;
|
||||
private int mAppearEffectHue;
|
||||
private int mHideEffectHue;
|
||||
|
||||
[Constructable]
|
||||
public GMHidingStone()
|
||||
: base(0x1870)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Hue = 0x0;
|
||||
Name = "GM hiding stone";
|
||||
LootType = LootType.Blessed;
|
||||
mAppearEffect = StoneEffect.DefaultRunUO;
|
||||
mAppearEffectHue = 0;
|
||||
mHideEffect = StoneEffect.DefaultRunUO;
|
||||
mHideEffectHue = 0;
|
||||
}
|
||||
|
||||
public GMHidingStone(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public StoneEffect AppearEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return mAppearEffect;
|
||||
}
|
||||
set
|
||||
{
|
||||
mAppearEffect = value;
|
||||
}
|
||||
}
|
||||
[Hue, CommandProperty(AccessLevel.Counselor)]
|
||||
public int AppearEffectHue
|
||||
{
|
||||
get
|
||||
{
|
||||
return mAppearEffectHue;
|
||||
}
|
||||
set
|
||||
{
|
||||
mAppearEffectHue = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public StoneEffect HideEffect
|
||||
{
|
||||
get
|
||||
{
|
||||
return mHideEffect;
|
||||
}
|
||||
set
|
||||
{
|
||||
mHideEffect = value;
|
||||
}
|
||||
}
|
||||
[Hue, CommandProperty(AccessLevel.Counselor)]
|
||||
public int HideEffectHue
|
||||
{
|
||||
get
|
||||
{
|
||||
return mHideEffectHue;
|
||||
}
|
||||
set
|
||||
{
|
||||
mHideEffectHue = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (Utilities.IsStaff(m))
|
||||
{
|
||||
if (m.Hidden)
|
||||
{
|
||||
ToggleHidden(m, mAppearEffect);
|
||||
SendStoneEffects(mAppearEffect, mAppearEffectHue, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendStoneEffects(mHideEffect, mHideEffectHue, m);
|
||||
ToggleHidden(m, mHideEffect);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage("You are unable to use that!");
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendStoneEffects(StoneEffect mStoneEffect, int effHue, Mobile m)
|
||||
{
|
||||
if (effHue > 0)
|
||||
effHue--; //Adjust the friggin hue to match true effect color
|
||||
switch (mStoneEffect)
|
||||
{
|
||||
//[s7]
|
||||
case StoneEffect.Gate:
|
||||
Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x1FCB, 10, 14, effHue, 0, 0x1FCB, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x20E);
|
||||
m.Frozen = true;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.65), new TimerStateCallback(InternalShowGate), new object[] { m, effHue });
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(InternalHideGate), new object[] { m, effHue });
|
||||
break;
|
||||
//[/s7]
|
||||
case StoneEffect.FlameStrike1:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
break;
|
||||
case StoneEffect.FlameStrike3:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
break;
|
||||
case StoneEffect.Snow:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x376A, 15, effHue, 0); //0x47D );
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 492);
|
||||
break;
|
||||
case StoneEffect.FlameStrikeLightningBolt:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
break;
|
||||
case StoneEffect.Sparkle1:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x375A, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213);
|
||||
break;
|
||||
case StoneEffect.Sparkle3:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z - 1), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213);
|
||||
break;
|
||||
case StoneEffect.Explosion:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
|
||||
break;
|
||||
case StoneEffect.ExplosionLightningBolt:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
|
||||
break;
|
||||
case StoneEffect.DefaultRunUO:
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x228);
|
||||
break;
|
||||
case StoneEffect.Glow:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x37C4, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1E2);
|
||||
break;
|
||||
case StoneEffect.PoisonField:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x3915, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x231);
|
||||
break;
|
||||
case StoneEffect.Fireball:
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 10), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x15E);
|
||||
break;
|
||||
case StoneEffect.FireStorm1: //Added By Nitewender (further modifed by me to carry color effect to timer
|
||||
m.PlaySound(520);
|
||||
m.PlaySound(525);
|
||||
m.Hidden = !m.Hidden;
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y - 1, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Timer t = new FireStormTimer(DateTime.UtcNow, m, effHue, 0, 1);
|
||||
t.Start();
|
||||
break;
|
||||
case StoneEffect.FireStorm2: //CEO Using above idea, this one does the firestorm outside->in
|
||||
m.PlaySound(520);
|
||||
m.PlaySound(525);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Timer t1 = new FireStormTimer(DateTime.UtcNow, m, effHue, 5, -1);
|
||||
t1.Start();
|
||||
break;
|
||||
case StoneEffect.RedSparkle:
|
||||
Effects.SendLocationEffect(new Point3D(m.X , m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1f7);
|
||||
break;
|
||||
case StoneEffect.RedSparkle2:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1E0);
|
||||
break;
|
||||
case StoneEffect.Marchenzio1:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x376A, 15, effHue, 0); //0x47D );
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 492);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x375A, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z - 1), m.Map, 0x373A, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3728, 13, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x228);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x37C4, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1E2);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 10), m.Map, 0x36D4, 13, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x15E);
|
||||
m.PlaySound(520);
|
||||
m.PlaySound(525);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Timer t2 = new FireStormTimer(DateTime.UtcNow, m, effHue, 5, -1);
|
||||
t2.Start();
|
||||
Effects.SendLocationEffect(new Point3D(m.X , m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1f7);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x374A, 15);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1E0);
|
||||
m.Hidden = !m.Hidden;
|
||||
break;
|
||||
case StoneEffect.Hell:
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0);
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307);
|
||||
m.PlaySound(520);
|
||||
m.PlaySound(525);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y - 1, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0);
|
||||
Timer t3 = new FireStormTimer(DateTime.UtcNow, m, effHue, 0, 1);
|
||||
t3.Start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2); // version
|
||||
writer.Write((int)mAppearEffect);
|
||||
writer.Write((int)mHideEffect);
|
||||
writer.Write(mAppearEffectHue);
|
||||
writer.Write(mHideEffectHue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
mAppearEffect = (StoneEffect)reader.ReadInt();
|
||||
mHideEffect = (StoneEffect)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
mAppearEffect = (StoneEffect)reader.ReadInt();
|
||||
mHideEffect = (StoneEffect)reader.ReadInt();
|
||||
mAppearEffectHue = reader.ReadInt();
|
||||
mHideEffectHue = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleHidden(Mobile m, StoneEffect heffect)
|
||||
{
|
||||
switch (heffect)
|
||||
{
|
||||
case StoneEffect.Gate:
|
||||
break;
|
||||
case StoneEffect.FireStorm1:
|
||||
break;
|
||||
case StoneEffect.FireStorm2:
|
||||
break;
|
||||
default:
|
||||
m.Hidden = !m.Hidden;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//[s7] gate!
|
||||
private static void InternalHideGate(object arg)
|
||||
{
|
||||
object[] args = arg as object[];
|
||||
Mobile m = args[0] as Mobile;
|
||||
int hue = (int)args[1];
|
||||
if (m != null)
|
||||
{
|
||||
m.Hidden = !m.Hidden;
|
||||
Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x376A, 9, 20, hue, 0, 5042, 0);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x201);
|
||||
m.Frozen = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void InternalShowGate(object arg)
|
||||
{
|
||||
object[] args = arg as object[];
|
||||
Mobile m = args[0] as Mobile;
|
||||
int hue = (int)args[1];
|
||||
if (m is Mobile)
|
||||
Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 8148, 9, 20, hue, 0, 8149, 0);
|
||||
}
|
||||
|
||||
//[/s7]
|
||||
public class FireStormTimer : Timer
|
||||
{
|
||||
public Mobile m;
|
||||
public int inc;
|
||||
public int ehue;
|
||||
public int fstart;
|
||||
public int fdir;
|
||||
public FireStormTimer(DateTime time, Mobile from, int hue, int start, int dir)
|
||||
: base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1))
|
||||
{
|
||||
Priority = TimerPriority.FiftyMS;
|
||||
m = from;
|
||||
ehue = hue;
|
||||
fstart = start;
|
||||
fdir = dir;
|
||||
inc = start;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
inc = inc + fdir;
|
||||
|
||||
Effects.SendLocationEffect(new Point3D(m.X + inc, m.Y, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - inc, m.Y, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y + inc, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X, m.Y - inc, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X + inc, m.Y - inc, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
Effects.SendLocationEffect(new Point3D(m.X - inc, m.Y + inc, m.Z), m.Map, 0x3709, 17, ehue, 0);
|
||||
|
||||
if ((fdir == 1 && inc >= (fstart + 5)) || (fdir == -1 && inc < 0))
|
||||
{
|
||||
if (fdir == -1)
|
||||
{
|
||||
m.Hidden = !m.Hidden;
|
||||
}
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
155
Scripts/Items/Tools/GargoylesPickaxe.cs
Normal file
155
Scripts/Items/Tools/GargoylesPickaxe.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GargoylesPickaxe : BaseAxe, IUsesRemaining
|
||||
{
|
||||
[Constructable]
|
||||
public GargoylesPickaxe()
|
||||
: this(Utility.RandomMinMax(101, 125))
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public GargoylesPickaxe(int uses)
|
||||
: base(0xE85 + Utility.Random(2))
|
||||
{
|
||||
Weight = 11.0;
|
||||
UsesRemaining = uses;
|
||||
ShowUsesRemaining = true;
|
||||
Hue = 0x76c;
|
||||
}
|
||||
|
||||
public GargoylesPickaxe(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041281;
|
||||
}
|
||||
}// a gargoyle's pickaxe
|
||||
public override HarvestSystem HarvestSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mining.System;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility PrimaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.DoubleStrike;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility SecondaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.Disarm;
|
||||
}
|
||||
}
|
||||
public override int AosStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
public override int AosMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
public override int AosMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
public override int AosSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 35;
|
||||
}
|
||||
}
|
||||
public override float MlSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3.00f;
|
||||
}
|
||||
}
|
||||
public override int OldStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
public override int OldMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public override int OldMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
public override int OldSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 35;
|
||||
}
|
||||
}
|
||||
public override int InitMinHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 31;
|
||||
}
|
||||
}
|
||||
public override int InitMaxHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
public override WeaponAnimation DefAnimation
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAnimation.Slash1H;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
472
Scripts/Items/Tools/GreaterBraceletOfBinding.cs
Normal file
472
Scripts/Items/Tools/GreaterBraceletOfBinding.cs
Normal file
@@ -0,0 +1,472 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.ContextMenus;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreaterBraceletOfBinding : BraceletOfBinding
|
||||
{
|
||||
public BindEntry[] Friends = new BindEntry[10];
|
||||
public BindEntry Pending { get; set; }
|
||||
|
||||
public bool IsFull { get { return Friends.FirstOrDefault(entry => entry == null) != null; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public override int MaxRecharges { get { return -1; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterBraceletOfBinding()
|
||||
{
|
||||
Hue = 2575;
|
||||
Weight = 1.0;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public GreaterBraceletOfBinding(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override string TranslocationItemName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "greater bracelet of binding";
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1151769); // Greater Bracelet of Binding
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
LabelTo(from, 1151769); // Greater Bracelet of Binding
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Siege.SiegeShard)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (from is PlayerMobile && from.Items.Contains(this))
|
||||
{
|
||||
if (Pending != null)
|
||||
{
|
||||
BaseGump.SendGump(new GreaterBraceletOfBindingGump((PlayerMobile)from, this, Pending));
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseGump.SendGump(new GreaterBraceletOfBindingGump((PlayerMobile)from, this));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1151772); // You must be wearing this item to bind to another character.
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsBound(Mobile m)
|
||||
{
|
||||
foreach (var e in Friends)
|
||||
{
|
||||
if (e != null && m == e.Mobile)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Remove(PlayerMobile pm)
|
||||
{
|
||||
for (int i = 0; i < Friends.Length; i++)
|
||||
{
|
||||
if (Friends[i] != null && Friends[i].Mobile == pm)
|
||||
{
|
||||
Friends[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(BindEntry entry, int index)
|
||||
{
|
||||
if (index >= 0 && index < Friends.Length && Friends[index] == null)
|
||||
{
|
||||
Friends[index] = entry;
|
||||
|
||||
if (Pending == entry)
|
||||
{
|
||||
Pending = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
if (RootParent is Mobile)
|
||||
{
|
||||
Mobile m = (Mobile)RootParent;
|
||||
|
||||
m.CloseGump(typeof(GreaterBraceletOfBindingGump));
|
||||
m.CloseGump(typeof(ConfirmBindGump));
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterBraceletOfBindingGump : BaseGump
|
||||
{
|
||||
public GreaterBraceletOfBinding Bracelet { get; set; }
|
||||
public bool Choose { get; set; }
|
||||
public BindEntry Entry { get; set; }
|
||||
|
||||
public GreaterBraceletOfBindingGump(PlayerMobile pm, GreaterBraceletOfBinding bracelet, BindEntry entry)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Bracelet = bracelet;
|
||||
Entry = entry;
|
||||
Choose = true;
|
||||
}
|
||||
|
||||
public GreaterBraceletOfBindingGump(PlayerMobile pm, GreaterBraceletOfBinding bracelet)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Bracelet = bracelet;
|
||||
Choose = false;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
User.CloseGump(typeof(ConfirmBindGump));
|
||||
User.CloseGump(typeof(GreaterBraceletOfBindingGump));
|
||||
|
||||
AddBackground(0, 0, 220, 320, 5170);
|
||||
|
||||
if (Choose)
|
||||
{
|
||||
AddHtmlLocalized(0, 3, 220, 20, CenterLoc, "#1151796", Server.Engines.Quests.BaseQuestGump.C32216(0x0000CD), false, false); // **Choose slot to bind**
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(0, 3, 220, 20, CenterLoc, "#1151769", Server.Engines.Quests.BaseQuestGump.C32216(0x0000CD), false, false); // Greater Bracelet of Binding
|
||||
AddHtmlLocalized(40, 275, 220, 20, 1017337, Bracelet.Charges.ToString(), Server.Engines.Quests.BaseQuestGump.C32216(0x0000CD), false, false); // Teleport Charges: ~1_val~
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if (Bracelet.Friends[i] != null)
|
||||
{
|
||||
AddLabel(60, 25 + (i * 25), 0x21, Bracelet.Friends[i].Mobile.Name);
|
||||
|
||||
if (!Choose)
|
||||
{
|
||||
if (Bracelet.Friends[i].Mobile.NetState != null)
|
||||
{
|
||||
AddButton(32, 28 + (i * 25), 0x2C89, 0x2C8A, i + 10, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
AddButton(165, 25 + (i * 25), 4017, 4019, i + 100, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(25, 25 + (i * 25), 4006, 4005, i + 10, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(60, 25 + (i * 25), 150, 20, 3006110, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
int id = info.ButtonID - 10;
|
||||
|
||||
if (id >= 0 && id < Bracelet.Friends.Length)
|
||||
{
|
||||
if (Bracelet.Friends[id] == null)
|
||||
{
|
||||
if (Choose)
|
||||
{
|
||||
Bracelet.Add(Entry, id);
|
||||
Choose = false;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
else if (!Bracelet.IsFull)
|
||||
{
|
||||
User.BeginTarget(10, false, TargetFlags.None, (from, targeted) =>
|
||||
{
|
||||
if (targeted is PlayerMobile)
|
||||
{
|
||||
PlayerMobile pm = targeted as PlayerMobile;
|
||||
BraceletOfBinding pmBrac = pm.FindItemOnLayer(Layer.Bracelet) as BraceletOfBinding;
|
||||
|
||||
if (pm == User)
|
||||
{
|
||||
User.SendLocalizedMessage(1151779); // The bracelet cannot bind with itself.
|
||||
}
|
||||
else if (Bracelet.IsBound(pm))
|
||||
{
|
||||
User.SendLocalizedMessage(1151770); // This bracelet is already bound to this character.
|
||||
}
|
||||
else if (!User.Items.Contains(Bracelet))
|
||||
{
|
||||
User.SendLocalizedMessage(1151772); // You must be wearing this item to bind to another character.
|
||||
}
|
||||
else if (pmBrac == null)
|
||||
{
|
||||
User.SendLocalizedMessage(1151771); // The target player must be wearing a Bracelet of Binding or Greater Bracelet of Binding for the device to work.
|
||||
}
|
||||
else if (pm.HasGump(typeof(ConfirmBindGump)) || (pmBrac is GreaterBraceletOfBinding && ((GreaterBraceletOfBinding)pmBrac).Pending != null))
|
||||
{
|
||||
User.SendLocalizedMessage(1151833); // You may not get confirmation from this player at this time.
|
||||
}
|
||||
else if ((pmBrac is GreaterBraceletOfBinding && ((GreaterBraceletOfBinding)pmBrac).IsFull) || (!(pmBrac is GreaterBraceletOfBinding) && pmBrac.Bound != null))
|
||||
{
|
||||
User.SendLocalizedMessage(1151781); // The target player's greater bracelet of binding is full.
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendLocalizedMessage(1151777, pm.Name); // Waiting for ~1_val~ to respond.
|
||||
Refresh();
|
||||
|
||||
BaseGump.SendGump(new ConfirmBindGump(pm, User, id, Bracelet, false));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendLocalizedMessage(1151775); // You may not bind your bracelet to that.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Bracelet.Bound = Bracelet.Friends[id].Bracelet;
|
||||
Bracelet.Activate(User);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
id = info.ButtonID - 100;
|
||||
|
||||
if (id >= 0 && id < Bracelet.Friends.Length && Bracelet.Friends[id] != null)
|
||||
{
|
||||
BaseGump.SendGump(new ConfirmBindGump(User, Bracelet.Friends[id].Mobile, id, Bracelet.Friends[id].Bracelet as GreaterBraceletOfBinding, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmBindGump : BaseGump
|
||||
{
|
||||
public GreaterBraceletOfBinding Bracelet { get; set; }
|
||||
public PlayerMobile From { get; set; }
|
||||
public int Index { get; set; }
|
||||
|
||||
public bool RemoveFromBracelet { get; set; }
|
||||
|
||||
public ConfirmBindGump(PlayerMobile user, PlayerMobile from, int index, GreaterBraceletOfBinding bracelet, bool remove)
|
||||
: base(user, 200, 200)
|
||||
{
|
||||
Bracelet = bracelet;
|
||||
From = from;
|
||||
|
||||
RemoveFromBracelet = remove;
|
||||
Index = index;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 405, 110, 5054);
|
||||
AddImageTiled(10, 10, 385, 90, 2702);
|
||||
AddAlphaRegion(10, 10, 385, 90);
|
||||
|
||||
if (RemoveFromBracelet)
|
||||
{
|
||||
AddHtmlLocalized(55, 20, 285, 60, 1151774, From.Name, 0xFFFF, false, false); // Releasing ~1_val~'s bracelet from yours. Are you sure you want to do this?
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(55, 20, 285, 60, 1151773, From.Name, 0xFFFF, false, false); // ~1_val~ is attempting to bind bracelets with you. Do you accept?
|
||||
}
|
||||
|
||||
AddHtml(110, 60, 100, 20, "<BASEFONT COLOR=#FFFFFF>Yes", false, false);
|
||||
AddButton(75, 60, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
|
||||
AddHtml(250, 60, 100, 20, "<BASEFONT COLOR=#FFFFFF>No", false, false);
|
||||
AddButton(285, 60, 4005, 4007, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
if (RemoveFromBracelet)
|
||||
{
|
||||
GreaterBraceletOfBinding bracelet = User.FindItemOnLayer(Layer.Bracelet) as GreaterBraceletOfBinding;
|
||||
|
||||
if (bracelet != null && bracelet.Friends[Index] != null)
|
||||
{
|
||||
var entry = bracelet.Friends[Index];
|
||||
|
||||
if (entry.Bracelet is GreaterBraceletOfBinding)
|
||||
{
|
||||
PlayerMobile pm = entry.Mobile;
|
||||
GreaterBraceletOfBinding gbr = entry.Bracelet as GreaterBraceletOfBinding;
|
||||
|
||||
gbr.Remove(User);
|
||||
|
||||
if (pm != null && pm.NetState != null)
|
||||
{
|
||||
var gump = pm.FindGump<GreaterBraceletOfBindingGump>();
|
||||
|
||||
if (gump != null)
|
||||
{
|
||||
gump.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bracelet.Remove(entry.Mobile);
|
||||
BaseGump.SendGump(new GreaterBraceletOfBindingGump(User, bracelet));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BraceletOfBinding brac = User.FindItemOnLayer(Layer.Bracelet) as BraceletOfBinding;
|
||||
|
||||
if (brac != null)
|
||||
{
|
||||
var entry = new BindEntry(User, brac);
|
||||
Bracelet.Add(entry, Index);
|
||||
|
||||
var g = From.FindGump<GreaterBraceletOfBindingGump>();
|
||||
|
||||
if (g != null)
|
||||
{
|
||||
g.Refresh();
|
||||
}
|
||||
|
||||
if (brac is GreaterBraceletOfBinding && !((GreaterBraceletOfBinding)brac).IsBound(From))
|
||||
{
|
||||
entry = new BindEntry(From, Bracelet);
|
||||
((GreaterBraceletOfBinding)brac).Pending = entry;
|
||||
|
||||
BaseGump.SendGump(new GreaterBraceletOfBindingGump(User, (GreaterBraceletOfBinding)brac, entry));
|
||||
}
|
||||
else
|
||||
{
|
||||
brac.Bound = Bracelet;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendLocalizedMessage(1151772); // You must be wearing this item to bind to another character.
|
||||
From.SendLocalizedMessage(1151771); // The target player must be wearing a Bracelet of Binding or Greater Bracelet of Binding for the device to work.
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (!RemoveFromBracelet)
|
||||
From.SendLocalizedMessage(1151778, User.Name); // ~1_val~ has declined your request to bind bracelets.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
if (Pending != null)
|
||||
{
|
||||
writer.Write(1);
|
||||
writer.WriteMobile<PlayerMobile>(Pending.Mobile);
|
||||
writer.WriteItem<BraceletOfBinding>(Pending.Bracelet);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
foreach (var entry in Friends)
|
||||
{
|
||||
if (entry == null)
|
||||
{
|
||||
writer.Write(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(1);
|
||||
|
||||
writer.WriteMobile<PlayerMobile>(entry.Mobile);
|
||||
writer.WriteItem<BraceletOfBinding>(entry.Bracelet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if (reader.ReadInt() == 1)
|
||||
{
|
||||
PlayerMobile pm = reader.ReadMobile<PlayerMobile>();
|
||||
GreaterBraceletOfBinding brac = reader.ReadItem<GreaterBraceletOfBinding>();
|
||||
|
||||
if (pm != null && brac != null)
|
||||
{
|
||||
Pending = new BindEntry(pm, brac);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < Friends.Length; i++)
|
||||
{
|
||||
if (reader.ReadInt() == 0)
|
||||
continue;
|
||||
|
||||
PlayerMobile pm = reader.ReadMobile<PlayerMobile>();
|
||||
GreaterBraceletOfBinding brac = reader.ReadItem<GreaterBraceletOfBinding>();
|
||||
|
||||
if (pm != null && brac != null)
|
||||
{
|
||||
Friends[i] = new BindEntry(pm, brac);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BindEntry
|
||||
{
|
||||
public PlayerMobile Mobile { get; set; }
|
||||
public BraceletOfBinding Bracelet { get; set; }
|
||||
|
||||
public BindEntry(PlayerMobile m, BraceletOfBinding bracelet)
|
||||
{
|
||||
Mobile = m;
|
||||
Bracelet = bracelet;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/Hammer.cs
Normal file
48
Scripts/Items/Tools/Hammer.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Hammer : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Hammer()
|
||||
: base(0x102A)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Hammer(int uses)
|
||||
: base(uses, 0x102A)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public Hammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Items/Tools/HammerOfHephaestus.cs
Normal file
114
Scripts/Items/Tools/HammerOfHephaestus.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HammerOfHephaestus : AncientSmithyHammer
|
||||
{
|
||||
private static List<HammerOfHephaestus> _Instances = new List<HammerOfHephaestus>();
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5), new TimerCallback(Tick_Callback));
|
||||
}
|
||||
|
||||
private static void Tick_Callback()
|
||||
{
|
||||
foreach (var hammer in _Instances.Where(h => h != null && !h.Deleted && h.UsesRemaining < 20))
|
||||
{
|
||||
hammer.UsesRemaining++;
|
||||
hammer.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HammerOfHephaestus()
|
||||
: base(10, 20)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x0;
|
||||
|
||||
_Instances.Add(this);
|
||||
}
|
||||
|
||||
public HammerOfHephaestus(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
_Instances.Remove(this);
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1077740;
|
||||
}
|
||||
}// Hammer of Hephaestus
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
{
|
||||
if (UsesRemaining > 0)
|
||||
{
|
||||
CraftSystem system = CraftSystem;
|
||||
|
||||
int num = system.CanCraft(from, this, null);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftContext context = system.GetContext(from);
|
||||
|
||||
from.SendGump(new CraftGump(from, system, this, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1072306); // You must wait a moment for it to recharge.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanEquip(Mobile from)
|
||||
{
|
||||
if (UsesRemaining > 0)
|
||||
return base.CanEquip(from);
|
||||
|
||||
from.SendLocalizedMessage(1072306); // You must wait a moment for it to recharge.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
if (version == 0 && Hue == 0x482)
|
||||
Hue = 0x0;
|
||||
|
||||
_Instances.Add(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/HolidayTimepiece.cs
Normal file
49
Scripts/Items/Tools/HolidayTimepiece.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HolidayTimepiece : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public HolidayTimepiece()
|
||||
: base(0x1086)
|
||||
{
|
||||
this.Weight = this.DefaultWeight;
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Layer = Layer.Bracelet;
|
||||
}
|
||||
|
||||
public HolidayTimepiece(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041113;
|
||||
}
|
||||
}// a holiday timepiece
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Tools/IndecipherableMap.cs
Normal file
47
Scripts/Items/Tools/IndecipherableMap.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class IndecipherableMap : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public IndecipherableMap()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
this.Hue = 0x965;
|
||||
else
|
||||
this.Hue = 0x961;
|
||||
}
|
||||
|
||||
public IndecipherableMap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1070799;
|
||||
}
|
||||
}// indecipherable map
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(1070801); // You cannot decipher this ruined map.
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/Inshave.cs
Normal file
48
Scripts/Items/Tools/Inshave.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Inshave : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Inshave()
|
||||
: base(0x10E6)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Inshave(int uses)
|
||||
: base(uses, 0x10E6)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public Inshave(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
395
Scripts/Items/Tools/InteriorDecorator.cs
Normal file
395
Scripts/Items/Tools/InteriorDecorator.cs
Normal file
@@ -0,0 +1,395 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum DecorateCommand
|
||||
{
|
||||
None,
|
||||
Turn,
|
||||
Up,
|
||||
Down,
|
||||
GetHue
|
||||
}
|
||||
|
||||
public class InteriorDecorator : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1041280; } } // an interior decorator
|
||||
|
||||
[Constructable]
|
||||
public InteriorDecorator()
|
||||
: base(0xFC1)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public InteriorDecorator(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DecorateCommand Command { get; set; }
|
||||
|
||||
public static bool InHouse(Mobile from)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
return (house != null && house.IsCoOwner(from));
|
||||
}
|
||||
|
||||
public static bool CheckUse(InteriorDecorator tool, Mobile from)
|
||||
{
|
||||
if (!InHouse(from))
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
else
|
||||
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();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!InHouse(from))
|
||||
Command = DecorateCommand.GetHue;
|
||||
|
||||
if (from.FindGump(typeof(InternalGump)) == null)
|
||||
from.SendGump(new InternalGump(from, this));
|
||||
|
||||
if (Command != DecorateCommand.None)
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly InteriorDecorator m_Decorator;
|
||||
|
||||
public InternalGump(Mobile from, InteriorDecorator decorator)
|
||||
: base(150, 50)
|
||||
{
|
||||
m_Decorator = decorator;
|
||||
|
||||
AddBackground(0, 0, 170, 260, 2600);
|
||||
|
||||
AddPage(0);
|
||||
|
||||
if (!InHouse(from))
|
||||
{
|
||||
AddButton(40, 36, (decorator.Command == DecorateCommand.GetHue ? 2154 : 2152), 2154, 4, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(80, 41, 100, 20, 1158863, false, false); // Get Hue
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(40, 36, (decorator.Command == DecorateCommand.Turn ? 2154 : 2152), 2154, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(80, 41, 100, 20, 1018323, false, false); // Turn
|
||||
|
||||
AddButton(40, 86, (decorator.Command == DecorateCommand.Up ? 2154 : 2152), 2154, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(80, 91, 100, 20, 1018324, false, false); // Up
|
||||
|
||||
AddButton(40, 136, (decorator.Command == DecorateCommand.Down ? 2154 : 2152), 2154, 3, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(80, 141, 100, 20, 1018325, false, false); // Down
|
||||
|
||||
AddButton(40, 186, (decorator.Command == DecorateCommand.GetHue ? 2154 : 2152), 2154, 4, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(80, 191, 100, 20, 1158863, false, false); // Get Hue
|
||||
}
|
||||
|
||||
AddHtmlLocalized(0, 0, 0, 0, 4, false, false);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
DecorateCommand command = DecorateCommand.None;
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
int cliloc = 0;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
cliloc = 1073404; // Select an object to turn.
|
||||
command = DecorateCommand.Turn;
|
||||
break;
|
||||
case 2:
|
||||
cliloc = 1073405; // Select an object to increase its height.
|
||||
command = DecorateCommand.Up;
|
||||
break;
|
||||
case 3:
|
||||
cliloc = 1073406; // Select an object to lower its height.
|
||||
command = DecorateCommand.Down;
|
||||
break;
|
||||
case 4:
|
||||
cliloc = 1158864; // Select an object to get the hue.
|
||||
command = DecorateCommand.GetHue;
|
||||
break;
|
||||
}
|
||||
|
||||
if (command != DecorateCommand.None)
|
||||
{
|
||||
m_Decorator.Command = command;
|
||||
m.SendGump(new InternalGump(m, m_Decorator));
|
||||
|
||||
if (cliloc != 0)
|
||||
m.SendLocalizedMessage(cliloc);
|
||||
|
||||
m.Target = new InternalTarget(m_Decorator);
|
||||
}
|
||||
else
|
||||
{
|
||||
Target.Cancel(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly InteriorDecorator m_Decorator;
|
||||
|
||||
public InternalTarget(InteriorDecorator decorator)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
CheckLOS = false;
|
||||
|
||||
m_Decorator = decorator;
|
||||
}
|
||||
|
||||
protected override void OnTargetNotAccessible(Mobile from, object targeted)
|
||||
{
|
||||
OnTarget(from, targeted);
|
||||
}
|
||||
|
||||
private static Type[] m_KingsCollectionTypes = new Type[]
|
||||
{
|
||||
typeof(BirdLamp), typeof(DragonLantern),
|
||||
typeof(KoiLamp), typeof(TallLamp)
|
||||
};
|
||||
|
||||
private static bool IsKingsCollection(Item item)
|
||||
{
|
||||
return m_KingsCollectionTypes.Any(t => t == item.GetType());
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Decorator.Command == DecorateCommand.GetHue)
|
||||
{
|
||||
int hue = 0;
|
||||
|
||||
if (targeted is Item)
|
||||
hue = ((Item)targeted).Hue;
|
||||
else if (targeted is Mobile)
|
||||
hue = ((Mobile)targeted).Hue;
|
||||
else
|
||||
{
|
||||
from.Target = new InternalTarget(m_Decorator);
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1158862, String.Format("{0}", hue)); // That object is hue ~1_HUE~
|
||||
}
|
||||
else if (targeted is Item && CheckUse(m_Decorator, from))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
Item item = (Item)targeted;
|
||||
|
||||
bool isDecorableComponent = false;
|
||||
|
||||
if (m_Decorator.Command == DecorateCommand.Turn && IsKingsCollection(item))
|
||||
{
|
||||
isDecorableComponent = true;
|
||||
}
|
||||
else if (item is AddonComponent || item is AddonContainerComponent || item is BaseAddonContainer)
|
||||
{
|
||||
object addon = null;
|
||||
int count = 0;
|
||||
|
||||
if (item is AddonComponent)
|
||||
{
|
||||
AddonComponent component = (AddonComponent)item;
|
||||
count = component.Addon.Components.Count;
|
||||
addon = component.Addon;
|
||||
}
|
||||
else if (item is AddonContainerComponent)
|
||||
{
|
||||
AddonContainerComponent component = (AddonContainerComponent)item;
|
||||
count = component.Addon.Components.Count;
|
||||
addon = component.Addon;
|
||||
}
|
||||
else if (item is BaseAddonContainer)
|
||||
{
|
||||
BaseAddonContainer container = (BaseAddonContainer)item;
|
||||
count = container.Components.Count;
|
||||
addon = container;
|
||||
}
|
||||
|
||||
if (count == 1 && Core.SE)
|
||||
isDecorableComponent = true;
|
||||
|
||||
if (item is EnormousVenusFlytrapAddon)
|
||||
isDecorableComponent = true;
|
||||
|
||||
if (m_Decorator.Command == DecorateCommand.Turn)
|
||||
{
|
||||
FlipableAddonAttribute[] attributes = (FlipableAddonAttribute[])addon.GetType().GetCustomAttributes(typeof(FlipableAddonAttribute), false);
|
||||
|
||||
if (attributes.Length > 0)
|
||||
isDecorableComponent = true;
|
||||
}
|
||||
}
|
||||
else if (item is Banner && m_Decorator.Command != DecorateCommand.Turn)
|
||||
{
|
||||
isDecorableComponent = true;
|
||||
}
|
||||
|
||||
if (house == null || !house.IsCoOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do
|
||||
}
|
||||
else if (item.Parent != null || !house.IsInside(item))
|
||||
{
|
||||
from.SendLocalizedMessage(1042270); // That is not in your house.
|
||||
}
|
||||
else if (!house.IsLockedDown(item) && !house.IsSecure(item) && !isDecorableComponent)
|
||||
{
|
||||
if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Turn)
|
||||
from.SendLocalizedMessage(1042273); // You cannot turn that.
|
||||
else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Up)
|
||||
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
|
||||
else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Down)
|
||||
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
|
||||
else
|
||||
from.SendLocalizedMessage(1042271); // That is not locked down.
|
||||
}
|
||||
else if (item is VendorRentalContract)
|
||||
{
|
||||
from.SendLocalizedMessage(1062491); // You cannot use the house decorator on that object.
|
||||
}
|
||||
/*else if (item.TotalWeight + item.PileWeight > 100)
|
||||
{
|
||||
from.SendLocalizedMessage(1042272); // That is too heavy.
|
||||
}*/
|
||||
else
|
||||
{
|
||||
switch (m_Decorator.Command)
|
||||
{
|
||||
case DecorateCommand.Up:
|
||||
Up(item, from);
|
||||
break;
|
||||
case DecorateCommand.Down:
|
||||
Down(item, from);
|
||||
break;
|
||||
case DecorateCommand.Turn:
|
||||
Turn(item, from);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
from.Target = new InternalTarget(m_Decorator);
|
||||
}
|
||||
|
||||
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
|
||||
{
|
||||
if (cancelType == TargetCancelType.Canceled)
|
||||
from.CloseGump(typeof(InteriorDecorator.InternalGump));
|
||||
}
|
||||
|
||||
private static void Turn(Item item, Mobile from)
|
||||
{
|
||||
if (item is IFlipable)
|
||||
{
|
||||
((IFlipable)item).OnFlip(from);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item is AddonComponent || item is AddonContainerComponent || item is BaseAddonContainer)
|
||||
{
|
||||
object addon = null;
|
||||
|
||||
if (item is AddonComponent)
|
||||
addon = ((AddonComponent)item).Addon;
|
||||
else if (item is AddonContainerComponent)
|
||||
addon = ((AddonContainerComponent)item).Addon;
|
||||
else if (item is BaseAddonContainer)
|
||||
addon = (BaseAddonContainer)item;
|
||||
|
||||
FlipableAddonAttribute[] aAttributes = (FlipableAddonAttribute[])addon.GetType().GetCustomAttributes(typeof(FlipableAddonAttribute), false);
|
||||
|
||||
if (aAttributes.Length > 0)
|
||||
{
|
||||
aAttributes[0].Flip(from, (Item)addon);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
FlipableAttribute[] attributes = (FlipableAttribute[])item.GetType().GetCustomAttributes(typeof(FlipableAttribute), false);
|
||||
|
||||
if (attributes.Length > 0)
|
||||
attributes[0].Flip(item);
|
||||
else
|
||||
from.SendLocalizedMessage(1042273); // You cannot turn that.
|
||||
}
|
||||
|
||||
private static void Up(Item item, Mobile from)
|
||||
{
|
||||
int floorZ = GetFloorZ(item);
|
||||
|
||||
if (floorZ > int.MinValue && item.Z < (floorZ + 15)) // Confirmed : no height checks here
|
||||
item.Location = new Point3D(item.Location, item.Z + 1);
|
||||
else
|
||||
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
|
||||
}
|
||||
|
||||
private static void Down(Item item, Mobile from)
|
||||
{
|
||||
int floorZ = GetFloorZ(item);
|
||||
|
||||
if (floorZ > int.MinValue && item.Z > GetFloorZ(item))
|
||||
item.Location = new Point3D(item.Location, item.Z - 1);
|
||||
else
|
||||
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
|
||||
}
|
||||
|
||||
private static int GetFloorZ(Item item)
|
||||
{
|
||||
Map map = item.Map;
|
||||
|
||||
if (map == null)
|
||||
return int.MinValue;
|
||||
|
||||
StaticTile[] tiles = map.Tiles.GetStaticTiles(item.X, item.Y, true);
|
||||
|
||||
int z = int.MinValue;
|
||||
|
||||
for (int i = 0; i < tiles.Length; ++i)
|
||||
{
|
||||
StaticTile tile = tiles[i];
|
||||
ItemData id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
|
||||
|
||||
int top = tile.Z; // Confirmed : no height checks here
|
||||
|
||||
if (id.Surface && !id.Impassable && top > z && top <= item.Z)
|
||||
z = top;
|
||||
}
|
||||
|
||||
return z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
52
Scripts/Items/Tools/JointingPlane.cs
Normal file
52
Scripts/Items/Tools/JointingPlane.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x1030, 0x1031)]
|
||||
public class JointingPlane : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public JointingPlane()
|
||||
: base(0x1030)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public JointingPlane(int uses)
|
||||
: base(uses, 0x1030)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public JointingPlane(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (this.Weight == 1.0)
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
541
Scripts/Items/Tools/Key.cs
Normal file
541
Scripts/Items/Tools/Key.cs
Normal file
@@ -0,0 +1,541 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
using Server.Prompts;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum KeyType
|
||||
{
|
||||
Copper = 0x100E,
|
||||
Gold = 0x100F,
|
||||
Iron = 0x1010,
|
||||
Rusty = 0x1013
|
||||
}
|
||||
|
||||
public interface ILockable
|
||||
{
|
||||
bool Locked { get; set; }
|
||||
uint KeyValue { get; set; }
|
||||
}
|
||||
|
||||
public class Key : Item, IResource, IQuality
|
||||
{
|
||||
private string m_Description;
|
||||
private uint m_KeyVal;
|
||||
private Item m_Link;
|
||||
private int m_MaxRange;
|
||||
|
||||
private CraftResource _Resource;
|
||||
private Mobile _Crafter;
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource { get { return _Resource; } set { _Resource = value; _Resource = value; Hue = CraftResources.GetHue(_Resource); InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter { get { return _Crafter; } set { _Crafter = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Key()
|
||||
: this(KeyType.Iron, 0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Key(KeyType type)
|
||||
: this(type, 0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Key(uint val)
|
||||
: this(KeyType.Iron, val)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Key(KeyType type, uint LockVal)
|
||||
: this(type, LockVal, null)
|
||||
{
|
||||
m_KeyVal = LockVal;
|
||||
}
|
||||
|
||||
public Key(KeyType type, uint LockVal, Item link)
|
||||
: base((int)type)
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
m_MaxRange = 3;
|
||||
m_KeyVal = LockVal;
|
||||
m_Link = link;
|
||||
}
|
||||
|
||||
public Key(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Description;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Description = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxRange
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MaxRange;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_MaxRange = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public uint KeyValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_KeyVal;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_KeyVal = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Item Link
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Link;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_Link = value;
|
||||
}
|
||||
}
|
||||
public static uint RandomValue()
|
||||
{
|
||||
return (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1;
|
||||
}
|
||||
|
||||
public static void RemoveKeys(Mobile m, uint keyValue)
|
||||
{
|
||||
if (keyValue == 0)
|
||||
return;
|
||||
|
||||
RemoveKeys(m.Backpack, keyValue);
|
||||
RemoveKeys(m.BankBox, keyValue);
|
||||
}
|
||||
|
||||
public static void RemoveKeys(Container cont, uint keyValue)
|
||||
{
|
||||
if (cont == null || keyValue == 0)
|
||||
return;
|
||||
|
||||
Item[] items = cont.FindItemsByType(new Type[] { typeof(Key), typeof(KeyRing) });
|
||||
|
||||
foreach (Item item in items)
|
||||
{
|
||||
if (item is Key)
|
||||
{
|
||||
Key key = (Key)item;
|
||||
|
||||
if (key.KeyValue == keyValue)
|
||||
key.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
KeyRing keyRing = (KeyRing)item;
|
||||
|
||||
keyRing.RemoveKeys(keyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ContainsKey(Container cont, uint keyValue)
|
||||
{
|
||||
if (cont == null)
|
||||
return false;
|
||||
|
||||
Item[] items = cont.FindItemsByType(new Type[] { typeof(Key), typeof(KeyRing) });
|
||||
|
||||
foreach (Item item in items)
|
||||
{
|
||||
if (item is Key)
|
||||
{
|
||||
Key key = (Key)item;
|
||||
|
||||
if (key.KeyValue == keyValue)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
KeyRing keyRing = (KeyRing)item;
|
||||
|
||||
if (keyRing.ContainsKey(keyValue))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)3); // version
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
writer.Write(_Crafter);
|
||||
writer.Write((int)_Quality);
|
||||
|
||||
writer.Write((int)m_MaxRange);
|
||||
|
||||
writer.Write((Item)m_Link);
|
||||
|
||||
writer.Write((string)m_Description);
|
||||
writer.Write((uint)m_KeyVal);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
_Crafter = reader.ReadMobile();
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_MaxRange = reader.ReadInt();
|
||||
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Link = reader.ReadItem();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
if (version < 2 || m_MaxRange == 0)
|
||||
m_MaxRange = 3;
|
||||
|
||||
m_Description = reader.ReadString();
|
||||
|
||||
m_KeyVal = reader.ReadUInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(501661); // That key is unreachable.
|
||||
return;
|
||||
}
|
||||
|
||||
Target t;
|
||||
int number;
|
||||
|
||||
if (m_KeyVal != 0)
|
||||
{
|
||||
number = 501662; // What shall I use this key on?
|
||||
t = new UnlockTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 501663; // This key is a key blank. Which key would you like to make a copy of?
|
||||
t = new CopyTarget(this);
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(number);
|
||||
from.Target = t;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
string desc;
|
||||
|
||||
if (m_KeyVal == 0)
|
||||
desc = "(blank)";
|
||||
else if ((desc = m_Description) == null || (desc = desc.Trim()).Length <= 0)
|
||||
desc = null;
|
||||
|
||||
if (desc != null)
|
||||
list.Add(desc);
|
||||
|
||||
if (_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, _Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_Resource > CraftResource.Iron)
|
||||
{
|
||||
list.Add(1053099, "#{0}\t{1}", CraftResources.GetLocalizationNumber(_Resource), String.Format("#{0}", LabelNumber.ToString())); // ~1_oretype~ ~2_armortype~
|
||||
}
|
||||
else
|
||||
{
|
||||
base.AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
if (!craftItem.ForceNonExceptional)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
string desc;
|
||||
|
||||
if (m_KeyVal == 0)
|
||||
desc = "(blank)";
|
||||
else if ((desc = m_Description) == null || (desc = desc.Trim()).Length <= 0)
|
||||
desc = "";
|
||||
|
||||
if (desc.Length > 0)
|
||||
from.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, "ENU", "", desc));
|
||||
}
|
||||
|
||||
public bool UseOn(Mobile from, ILockable o)
|
||||
{
|
||||
if (o.KeyValue == KeyValue)
|
||||
{
|
||||
if (o is BaseDoor && !((BaseDoor)o).UseLocks())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
o.Locked = !o.Locked;
|
||||
|
||||
if (o is LockableContainer)
|
||||
{
|
||||
LockableContainer cont = (LockableContainer)o;
|
||||
|
||||
if (cont.LockLevel == -255)
|
||||
cont.LockLevel = cont.RequiredSkill - 10;
|
||||
}
|
||||
|
||||
if (o is Item)
|
||||
{
|
||||
Item item = (Item)o;
|
||||
|
||||
if (o.Locked)
|
||||
item.SendLocalizedMessageTo(from, 1048000); // You lock it.
|
||||
else
|
||||
item.SendLocalizedMessageTo(from, 1048001); // You unlock it.
|
||||
|
||||
if (item is LockableContainer)
|
||||
{
|
||||
LockableContainer cont = (LockableContainer)item;
|
||||
|
||||
if (cont.TrapType != TrapType.None && cont.TrapOnLockpick)
|
||||
{
|
||||
if (o.Locked)
|
||||
item.SendLocalizedMessageTo(from, 501673); // You re-enable the trap.
|
||||
else
|
||||
item.SendLocalizedMessageTo(from, 501672); // You disable the trap temporarily. Lock it again to re-enable it.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class RenamePrompt : Prompt
|
||||
{
|
||||
public override int MessageCliloc { get { return 501665; } }
|
||||
private readonly Key m_Key;
|
||||
public RenamePrompt(Key key)
|
||||
{
|
||||
m_Key = key;
|
||||
}
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(501661); // That key is unreachable.
|
||||
return;
|
||||
}
|
||||
|
||||
m_Key.Description = Utility.FixHtml(text);
|
||||
}
|
||||
}
|
||||
|
||||
private class UnlockTarget : Target
|
||||
{
|
||||
private readonly Key m_Key;
|
||||
public UnlockTarget(Key key)
|
||||
: base(key.MaxRange, false, TargetFlags.None)
|
||||
{
|
||||
m_Key = key;
|
||||
CheckLOS = false;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(501661); // That key is unreachable.
|
||||
return;
|
||||
}
|
||||
|
||||
int number;
|
||||
|
||||
if (targeted == m_Key)
|
||||
{
|
||||
number = 501665; // Enter a description for this key.
|
||||
|
||||
from.Prompt = new RenamePrompt(m_Key);
|
||||
}
|
||||
else if (targeted is ILockable)
|
||||
{
|
||||
if (targeted is Plank && ((Plank)targeted).IsOpen)
|
||||
{
|
||||
((Item)targeted).SendLocalizedMessageTo(from, 501671); // You cannot currently lock that.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_Key.UseOn(from, (ILockable)targeted))
|
||||
number = -1;
|
||||
else
|
||||
number = 501668; // This key doesn't seem to unlock that.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 501666; // You can't unlock that!
|
||||
}
|
||||
|
||||
if (number != -1)
|
||||
{
|
||||
from.SendLocalizedMessage(number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CopyTarget : Target
|
||||
{
|
||||
private readonly Key m_Key;
|
||||
public CopyTarget(Key key)
|
||||
: base(3, false, TargetFlags.None)
|
||||
{
|
||||
m_Key = key;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(501661); // That key is unreachable.
|
||||
return;
|
||||
}
|
||||
|
||||
int number;
|
||||
|
||||
if (targeted is Key)
|
||||
{
|
||||
Key k = (Key)targeted;
|
||||
|
||||
if (k.m_KeyVal == 0)
|
||||
{
|
||||
number = 501675; // This key is also blank.
|
||||
}
|
||||
else if (from.CheckTargetSkill(SkillName.Tinkering, k, 0, 75.0))
|
||||
{
|
||||
number = 501676; // You make a copy of the key.
|
||||
|
||||
m_Key.Description = k.Description;
|
||||
m_Key.KeyValue = k.KeyValue;
|
||||
m_Key.Link = k.Link;
|
||||
m_Key.MaxRange = k.MaxRange;
|
||||
}
|
||||
else if (Utility.RandomDouble() <= 0.1) // 10% chance to destroy the key
|
||||
{
|
||||
from.SendLocalizedMessage(501677); // You fail to make a copy of the key.
|
||||
|
||||
number = 501678; // The key was destroyed in the attempt.
|
||||
|
||||
m_Key.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 501677; // You fail to make a copy of the key.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 501688; // Not a key.
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(number);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
284
Scripts/Items/Tools/KeyRing.cs
Normal file
284
Scripts/Items/Tools/KeyRing.cs
Normal file
@@ -0,0 +1,284 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class KeyRing : Item, IResource, IQuality
|
||||
{
|
||||
private CraftResource _Resource;
|
||||
private Mobile _Crafter;
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource { get { return _Resource; } set { _Resource = value; _Resource = value; Hue = CraftResources.GetHue(_Resource); InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter { get { return _Crafter; } set { _Crafter = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
public static readonly int MaxKeys = 20;
|
||||
private List<Key> m_Keys;
|
||||
|
||||
[Constructable]
|
||||
public KeyRing()
|
||||
: base(0x1011)
|
||||
{
|
||||
Weight = 1.0; // They seem to have no weight on OSI ?!
|
||||
|
||||
m_Keys = new List<Key>();
|
||||
}
|
||||
|
||||
public KeyRing(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public List<Key> Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Keys;
|
||||
}
|
||||
}
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
return false;
|
||||
}
|
||||
|
||||
Key key = dropped as Key;
|
||||
|
||||
if (key == null || key.KeyValue == 0)
|
||||
{
|
||||
from.SendLocalizedMessage(501689); // Only non-blank keys can be put on a keyring.
|
||||
return false;
|
||||
}
|
||||
else if (Keys.Count >= MaxKeys)
|
||||
{
|
||||
from.SendLocalizedMessage(1008138); // This keyring is full.
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Add(key);
|
||||
from.SendLocalizedMessage(501691); // You put the key on the keyring.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(501680); // What do you want to unlock?
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
foreach (Key key in m_Keys)
|
||||
{
|
||||
key.Delete();
|
||||
}
|
||||
|
||||
m_Keys.Clear();
|
||||
}
|
||||
|
||||
public void Add(Key key)
|
||||
{
|
||||
key.Internalize();
|
||||
m_Keys.Add(key);
|
||||
|
||||
UpdateItemID();
|
||||
}
|
||||
|
||||
public void Open(Mobile from)
|
||||
{
|
||||
Container cont = Parent as Container;
|
||||
|
||||
if (cont == null)
|
||||
return;
|
||||
|
||||
for (int i = m_Keys.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Key key = m_Keys[i];
|
||||
|
||||
if (!key.Deleted && !cont.TryDropItem(from, key, true))
|
||||
break;
|
||||
|
||||
m_Keys.RemoveAt(i);
|
||||
}
|
||||
|
||||
UpdateItemID();
|
||||
}
|
||||
|
||||
public void RemoveKeys(uint keyValue)
|
||||
{
|
||||
for (int i = m_Keys.Count - 1; i >= 0; i--)
|
||||
{
|
||||
Key key = m_Keys[i];
|
||||
|
||||
if (key.KeyValue == keyValue)
|
||||
{
|
||||
key.Delete();
|
||||
m_Keys.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateItemID();
|
||||
}
|
||||
|
||||
public bool ContainsKey(uint keyValue)
|
||||
{
|
||||
foreach (Key key in m_Keys)
|
||||
{
|
||||
if (key.KeyValue == keyValue)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, _Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_Resource > CraftResource.Iron)
|
||||
{
|
||||
list.Add(1053099, "#{0}\t{1}", CraftResources.GetLocalizationNumber(_Resource), String.Format("#{0}", LabelNumber.ToString())); // ~1_oretype~ ~2_armortype~
|
||||
}
|
||||
else
|
||||
{
|
||||
base.AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
if (!craftItem.ForceNonExceptional)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(1); // version
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
writer.Write(_Crafter);
|
||||
writer.Write((int)_Quality);
|
||||
|
||||
writer.WriteItemList<Key>(m_Keys);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
_Crafter = reader.ReadMobile();
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
goto case 0;
|
||||
case 0:
|
||||
m_Keys = reader.ReadStrongItemList<Key>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateItemID()
|
||||
{
|
||||
if (Keys.Count < 1)
|
||||
ItemID = 0x1011;
|
||||
else if (Keys.Count < 3)
|
||||
ItemID = 0x1769;
|
||||
else if (Keys.Count < 5)
|
||||
ItemID = 0x176A;
|
||||
else
|
||||
ItemID = 0x176B;
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly KeyRing m_KeyRing;
|
||||
public InternalTarget(KeyRing keyRing)
|
||||
: base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_KeyRing = keyRing;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_KeyRing.Deleted || !m_KeyRing.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_KeyRing == targeted)
|
||||
{
|
||||
m_KeyRing.Open(from);
|
||||
from.SendLocalizedMessage(501685); // You open the keyring.
|
||||
}
|
||||
else if (targeted is ILockable)
|
||||
{
|
||||
ILockable o = (ILockable)targeted;
|
||||
|
||||
foreach (Key key in m_KeyRing.Keys)
|
||||
{
|
||||
if (key.UseOn(from, o))
|
||||
return;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage(1008140); // You do not have a key for that.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(501666); // You can't unlock that!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Items/Tools/LeatherDyeTub.cs
Normal file
114
Scripts/Items/Tools/LeatherDyeTub.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LeatherDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public LeatherDyeTub()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public LeatherDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override bool AllowLeather
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override int TargetMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1042416;
|
||||
}
|
||||
}// Select the leather item to dye.
|
||||
public override int FailMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1042418;
|
||||
}
|
||||
}// You can only dye leather with this tub.
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041284;
|
||||
}
|
||||
}// Leather Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker
|
||||
{
|
||||
get
|
||||
{
|
||||
return CustomHuePicker.LeatherDyeTub;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076218); // 2nd Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Tools/LocalMap.cs
Normal file
47
Scripts/Items/Tools/LocalMap.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LocalMap : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public LocalMap()
|
||||
{
|
||||
this.SetDisplay(0, 0, 5119, 4095, 400, 400);
|
||||
}
|
||||
|
||||
public LocalMap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1015230;
|
||||
}
|
||||
}// local map
|
||||
public override void CraftInit(Mobile from)
|
||||
{
|
||||
double skillValue = from.Skills[SkillName.Cartography].Value;
|
||||
int dist = 64 + (int)(skillValue * 2);
|
||||
|
||||
this.SetDisplay(from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, 200, 200);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/MalletAndChisel.cs
Normal file
48
Scripts/Items/Tools/MalletAndChisel.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MalletAndChisel : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public MalletAndChisel()
|
||||
: base(0x12B3)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MalletAndChisel(int uses)
|
||||
: base(uses, 0x12B3)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public MalletAndChisel(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefMasonry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
463
Scripts/Items/Tools/MapItem.cs
Normal file
463
Scripts/Items/Tools/MapItem.cs
Normal file
@@ -0,0 +1,463 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable( 0x14EB, 0x14EC )]
|
||||
public class MapItem : Item, ICraftable
|
||||
{
|
||||
private Rectangle2D m_Bounds;
|
||||
private Map m_Facet;
|
||||
|
||||
private int m_Width, m_Height;
|
||||
|
||||
private bool m_Protected;
|
||||
private bool m_Editable;
|
||||
|
||||
private List<Point2D> m_Pins = new List<Point2D>();
|
||||
|
||||
private const int MaxUserPins = 50;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool Protected
|
||||
{
|
||||
get { return m_Protected; }
|
||||
set { m_Protected = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Rectangle2D Bounds
|
||||
{
|
||||
get { return m_Bounds; }
|
||||
set { m_Bounds = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Map Facet
|
||||
{
|
||||
get { return m_Facet; }
|
||||
set { m_Facet = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Width
|
||||
{
|
||||
get { return m_Width; }
|
||||
set { m_Width = value; }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Height
|
||||
{
|
||||
get { return m_Height; }
|
||||
set { m_Height = value; }
|
||||
}
|
||||
|
||||
public List<Point2D> Pins
|
||||
{
|
||||
get { return m_Pins; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MapItem() : this(Map.Trammel)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MapItem(Map map) : base( 0x14EC )
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
m_Width = 200;
|
||||
m_Height = 200;
|
||||
|
||||
m_Facet = map;
|
||||
}
|
||||
|
||||
public virtual void CraftInit( Mobile from )
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SetDisplayByFacet()
|
||||
{
|
||||
if (Facet == Map.Tokuno)
|
||||
SetDisplay(0, 0, 1448, 1430, 400, 400);
|
||||
else if (Facet == Map.Malas)
|
||||
SetDisplay(520, 0, 2580, 2050, 400, 400);
|
||||
else if (Facet == Map.Ilshenar)
|
||||
SetDisplay(130, 136, 1927, 1468, 400, 400);
|
||||
else if (Facet == Map.TerMur)
|
||||
SetDisplay(260, 2780, 1280, 4090, 400, 400);
|
||||
}
|
||||
|
||||
public void SetDisplay( int x1, int y1, int x2, int y2, int w, int h )
|
||||
{
|
||||
Width = w;
|
||||
Height = h;
|
||||
|
||||
if ( x1 < 0 )
|
||||
x1 = 0;
|
||||
|
||||
if ( y1 < 0 )
|
||||
y1 = 0;
|
||||
|
||||
if ( x2 >= 7164 )
|
||||
x2 = 7163;
|
||||
|
||||
if ( y2 >= 4096 )
|
||||
y2 = 4095;
|
||||
|
||||
Bounds = new Rectangle2D( x1, y1, x2-x1, y2-y1 );
|
||||
}
|
||||
|
||||
public MapItem( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 2 ) )
|
||||
DisplayTo( from );
|
||||
else
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
|
||||
public virtual void DisplayTo( Mobile from )
|
||||
{
|
||||
//from.Send(new MapDetails(this));
|
||||
from.Send( new NewMapDetails( this ) );
|
||||
from.Send( new MapDisplay( this ) );
|
||||
|
||||
for ( int i = 0; i < m_Pins.Count; ++i )
|
||||
from.Send( new MapAddPin( this, m_Pins[i] ) );
|
||||
|
||||
from.Send( new MapSetEditable( this, ValidateEdit( from ) ) );
|
||||
}
|
||||
|
||||
public virtual void OnAddPin( Mobile from, int x, int y )
|
||||
{
|
||||
if ( !ValidateEdit( from ) )
|
||||
return;
|
||||
else if ( m_Pins.Count >= MaxUserPins )
|
||||
return;
|
||||
|
||||
Validate( ref x, ref y );
|
||||
AddPin( x, y );
|
||||
}
|
||||
|
||||
public virtual void OnRemovePin( Mobile from, int number )
|
||||
{
|
||||
if ( !ValidateEdit( from ) )
|
||||
return;
|
||||
|
||||
RemovePin( number );
|
||||
}
|
||||
|
||||
public virtual void OnChangePin( Mobile from, int number, int x, int y )
|
||||
{
|
||||
if ( !ValidateEdit( from ) )
|
||||
return;
|
||||
|
||||
Validate( ref x, ref y );
|
||||
ChangePin( number, x, y );
|
||||
}
|
||||
|
||||
public virtual void OnInsertPin( Mobile from, int number, int x, int y )
|
||||
{
|
||||
if ( !ValidateEdit( from ) )
|
||||
return;
|
||||
else if ( m_Pins.Count >= MaxUserPins )
|
||||
return;
|
||||
|
||||
Validate( ref x, ref y );
|
||||
InsertPin( number, x, y );
|
||||
}
|
||||
|
||||
public virtual void OnClearPins( Mobile from )
|
||||
{
|
||||
if ( !ValidateEdit( from ) )
|
||||
return;
|
||||
|
||||
ClearPins();
|
||||
}
|
||||
|
||||
public virtual void OnToggleEditable( Mobile from )
|
||||
{
|
||||
if ( Validate( from ) )
|
||||
m_Editable = !m_Editable;
|
||||
|
||||
from.Send( new MapSetEditable( this, Validate( from ) && m_Editable ) );
|
||||
}
|
||||
|
||||
public virtual void Validate( ref int x, ref int y )
|
||||
{
|
||||
if ( x < 0 )
|
||||
x = 0;
|
||||
else if ( x >= m_Width )
|
||||
x = m_Width - 1;
|
||||
|
||||
if ( y < 0 )
|
||||
y = 0;
|
||||
else if ( y >= m_Height )
|
||||
y = m_Height - 1;
|
||||
}
|
||||
|
||||
public virtual bool ValidateEdit( Mobile from )
|
||||
{
|
||||
return m_Editable && Validate( from );
|
||||
}
|
||||
|
||||
public virtual bool Validate( Mobile from )
|
||||
{
|
||||
if ( !from.CanSee( this ) || from.Map != this.Map || !from.Alive || InSecureTrade )
|
||||
return false;
|
||||
else if ( from.AccessLevel >= AccessLevel.GameMaster )
|
||||
return true;
|
||||
else if ( !Movable || m_Protected || !from.InRange( GetWorldLocation(), 2 ) )
|
||||
return false;
|
||||
|
||||
object root = RootParent;
|
||||
|
||||
if ( root is Mobile && root != from )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ConvertToWorld( int x, int y, out int worldX, out int worldY )
|
||||
{
|
||||
if (Width == 0 || Height == 0)
|
||||
{
|
||||
worldX = worldY = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
worldX = ( ( m_Bounds.Width * x ) / Width ) + m_Bounds.X;
|
||||
worldY = ( ( m_Bounds.Height * y ) / Height ) + m_Bounds.Y;
|
||||
}
|
||||
|
||||
public void ConvertToMap( int x, int y, out int mapX, out int mapY )
|
||||
{
|
||||
if (m_Bounds.Width == 0 || m_Bounds.Height == 0)
|
||||
{
|
||||
mapX = mapY = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
mapX = ( ( x - m_Bounds.X ) * Width ) / m_Bounds.Width;
|
||||
mapY = ( ( y - m_Bounds.Y ) * Width ) / m_Bounds.Height;
|
||||
}
|
||||
|
||||
public virtual void AddWorldPin( int x, int y )
|
||||
{
|
||||
int mapX, mapY;
|
||||
ConvertToMap( x, y, out mapX, out mapY );
|
||||
|
||||
AddPin( mapX, mapY );
|
||||
}
|
||||
|
||||
public virtual void AddPin( int x, int y )
|
||||
{
|
||||
m_Pins.Add( new Point2D( x, y ) );
|
||||
}
|
||||
|
||||
public virtual void RemovePin( int index )
|
||||
{
|
||||
if ( index > 0 && index < m_Pins.Count )
|
||||
m_Pins.RemoveAt( index );
|
||||
}
|
||||
|
||||
public virtual void InsertPin( int index, int x, int y )
|
||||
{
|
||||
if ( index < 0 || index >= m_Pins.Count )
|
||||
m_Pins.Add( new Point2D( x, y ) );
|
||||
else
|
||||
m_Pins.Insert( index, new Point2D( x, y ) );
|
||||
}
|
||||
|
||||
public virtual void ChangePin( int index, int x, int y )
|
||||
{
|
||||
if ( index >= 0 && index < m_Pins.Count )
|
||||
m_Pins[index] = new Point2D( x, y );
|
||||
}
|
||||
|
||||
public virtual void ClearPins()
|
||||
{
|
||||
m_Pins.Clear();
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 );
|
||||
|
||||
writer.Write(m_Facet);
|
||||
|
||||
writer.Write( m_Bounds );
|
||||
|
||||
writer.Write( m_Width );
|
||||
writer.Write( m_Height );
|
||||
|
||||
writer.Write( m_Protected );
|
||||
|
||||
writer.Write( m_Pins.Count );
|
||||
for ( int i = 0; i < m_Pins.Count; ++i )
|
||||
writer.Write( m_Pins[i] );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Facet = reader.ReadMap();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Bounds = reader.ReadRect2D();
|
||||
|
||||
m_Width = reader.ReadInt();
|
||||
m_Height = reader.ReadInt();
|
||||
|
||||
m_Protected = reader.ReadBool();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for ( int i = 0; i < count; i++ )
|
||||
m_Pins.Add( reader.ReadPoint2D() );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
PacketHandlers.Register( 0x56, 11, true, new OnPacketReceive( OnMapCommand ) );
|
||||
}
|
||||
|
||||
private static void OnMapCommand( NetState state, PacketReader pvSrc )
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
MapItem map = World.FindItem( pvSrc.ReadInt32() ) as MapItem;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
int command = pvSrc.ReadByte();
|
||||
int number = pvSrc.ReadByte();
|
||||
|
||||
int x = pvSrc.ReadInt16();
|
||||
int y = pvSrc.ReadInt16();
|
||||
|
||||
switch ( command )
|
||||
{
|
||||
case 1: map.OnAddPin( from, x, y ); break;
|
||||
case 2: map.OnInsertPin( from, number, x, y ); break;
|
||||
case 3: map.OnChangePin( from, number, x, y ); break;
|
||||
case 4: map.OnRemovePin( from, number ); break;
|
||||
case 5: map.OnClearPins( from ); break;
|
||||
case 6: map.OnToggleEditable( from ); break;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class MapDetails : Packet
|
||||
{
|
||||
public MapDetails( MapItem map ) : base ( 0x90, 19 )
|
||||
{
|
||||
m_Stream.Write( (int) map.Serial );
|
||||
m_Stream.Write( (short) 0x139D );
|
||||
m_Stream.Write( (short) map.Bounds.Start.X );
|
||||
m_Stream.Write( (short) map.Bounds.Start.Y );
|
||||
m_Stream.Write( (short) map.Bounds.End.X );
|
||||
m_Stream.Write( (short) map.Bounds.End.Y );
|
||||
m_Stream.Write( (short) map.Width );
|
||||
m_Stream.Write( (short) map.Height );
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class NewMapDetails : Packet
|
||||
{
|
||||
public NewMapDetails(MapItem map) : base(0xF5, 21)
|
||||
{
|
||||
m_Stream.Write((int)map.Serial);
|
||||
m_Stream.Write((short)0x139D);
|
||||
m_Stream.Write((short)map.Bounds.Start.X);
|
||||
m_Stream.Write((short)map.Bounds.Start.Y);
|
||||
m_Stream.Write((short)map.Bounds.End.X);
|
||||
m_Stream.Write((short)map.Bounds.End.Y);
|
||||
m_Stream.Write((short)map.Width);
|
||||
m_Stream.Write((short)map.Height);
|
||||
|
||||
short mapValue = 0x00;
|
||||
if (map.Facet == Map.Felucca)
|
||||
mapValue = 0x00;
|
||||
else if (map.Facet == Map.Trammel)
|
||||
mapValue = 0x01;
|
||||
else if (map.Facet == Map.Ilshenar)
|
||||
mapValue = 0x02;
|
||||
else if (map.Facet == Map.Malas)
|
||||
mapValue = 0x03;
|
||||
else if (map.Facet == Map.Tokuno)
|
||||
mapValue = 0x04;
|
||||
else if (map.Facet == Map.TerMur)
|
||||
mapValue = 0x05;
|
||||
|
||||
m_Stream.Write(mapValue);
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class MapCommand : Packet
|
||||
{
|
||||
public MapCommand( MapItem map, int command, int number, int x, int y ) : base ( 0x56, 11 )
|
||||
{
|
||||
m_Stream.Write( (int) map.Serial );
|
||||
m_Stream.Write( (byte) command );
|
||||
m_Stream.Write( (byte) number );
|
||||
m_Stream.Write( (short) x );
|
||||
m_Stream.Write( (short) y );
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class MapDisplay : MapCommand
|
||||
{
|
||||
public MapDisplay( MapItem map ) : base( map, 5, 0, 0, 0 )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class MapAddPin : MapCommand
|
||||
{
|
||||
public MapAddPin( MapItem map, Point2D point ) : base( map, 1, 0, point.X, point.Y )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class MapSetEditable : MapCommand
|
||||
{
|
||||
public MapSetEditable( MapItem map, bool editable ) : base( map, 7, editable ? 1 : 0, 0, 0 )
|
||||
{
|
||||
}
|
||||
}
|
||||
#region ICraftable Members
|
||||
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
CraftInit( from );
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
59
Scripts/Items/Tools/MapmakersPen.cs
Normal file
59
Scripts/Items/Tools/MapmakersPen.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x0FBF, 0x0FC0)]
|
||||
public class MapmakersPen : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public MapmakersPen()
|
||||
: base(0x0FBF)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MapmakersPen(int uses)
|
||||
: base(uses, 0x0FBF)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public MapmakersPen(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCartography.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044167;
|
||||
}
|
||||
}// mapmaker's pen
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (this.Weight == 2.0)
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Tools/MasterSkeletonKey.cs
Normal file
35
Scripts/Items/Tools/MasterSkeletonKey.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MasterSkeletonKey : Skeletonkey
|
||||
{
|
||||
public override int LabelNumber { get { return 1095523; } }
|
||||
|
||||
public override bool IsSkeletonKey { get { return true; } }
|
||||
public override int SkillBonus { get { return 100; } }
|
||||
|
||||
[Constructable]
|
||||
public MasterSkeletonKey()
|
||||
{
|
||||
Uses = 10;
|
||||
}
|
||||
|
||||
public MasterSkeletonKey(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Scripts/Items/Tools/MetallicClothDyeTub.cs
Normal file
35
Scripts/Items/Tools/MetallicClothDyeTub.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MetallicClothDyeTub : DyeTub
|
||||
{
|
||||
[Constructable]
|
||||
public MetallicClothDyeTub()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MetallicClothDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int TargetMessage { get { return 500859; } } // Select the clothing to dye.
|
||||
public override int FailMessage { get { return 1153977; } } // You can only dye cloth with this tub.
|
||||
public override int LabelNumber { get { return 1152920; } } // Metallic Cloth Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker { get { return CustomHuePicker.MetallicDyeTub; } }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
66
Scripts/Items/Tools/MetallicDyeTub.cs
Normal file
66
Scripts/Items/Tools/MetallicDyeTub.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MetallicDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[Constructable]
|
||||
public MetallicDyeTub()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MetallicDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables { get { return false; } }
|
||||
public override bool AllowMetal { get { return true; } }
|
||||
public override int TargetMessage { get { return 1080393; } } // Select the metal item to dye.
|
||||
public override int FailMessage { get { return 1080394; } } // You can only dye metal with this tub.
|
||||
public override int LabelNumber { get { return 1150067; } } // Metallic Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker { get { return CustomHuePicker.MetallicDyeTub; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set { m_IsRewardItem = value; }
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && m_IsRewardItem)
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
66
Scripts/Items/Tools/MetallicLeatherDyeTub.cs
Normal file
66
Scripts/Items/Tools/MetallicLeatherDyeTub.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MetallicLeatherDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
|
||||
[Constructable]
|
||||
public MetallicLeatherDyeTub()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MetallicLeatherDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables { get { return false; } }
|
||||
public override bool AllowLeather { get { return true; } }
|
||||
public override int TargetMessage { get { return 1042416; } } // Select the leather item to dye.
|
||||
public override int FailMessage { get { return 1042418; } } // You can only dye leather with this tub.
|
||||
public override int LabelNumber { get { return 1153495; } } // Metallic Leather Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker { get { return CustomHuePicker.MetallicDyeTub; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get { return m_IsRewardItem; }
|
||||
set { m_IsRewardItem = value; }
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && m_IsRewardItem)
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((bool)m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_IsRewardItem = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/MortarPestle.cs
Normal file
48
Scripts/Items/Tools/MortarPestle.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MortarPestle : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public MortarPestle()
|
||||
: base(0xE9B)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MortarPestle(int uses)
|
||||
: base(uses, 0xE9B)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public MortarPestle(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefAlchemy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/MouldingPlane.cs
Normal file
49
Scripts/Items/Tools/MouldingPlane.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x102C, 0x102D)]
|
||||
public class MouldingPlane : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public MouldingPlane()
|
||||
: base(0x102C)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MouldingPlane(int uses)
|
||||
: base(uses, 0x102C)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public MouldingPlane(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/Nails.cs
Normal file
49
Scripts/Items/Tools/Nails.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x102E, 0x102F)]
|
||||
public class Nails : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Nails()
|
||||
: base(0x102E)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Nails(int uses)
|
||||
: base(uses, 0x102C)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public Nails(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
380
Scripts/Items/Tools/PenOfWisdom.cs
Normal file
380
Scripts/Items/Tools/PenOfWisdom.cs
Normal file
@@ -0,0 +1,380 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x0FBF, 0x0FC0)]
|
||||
public class PenOfWisdom : Item, IUsesRemaining
|
||||
{
|
||||
public override int LabelNumber { get { return 1115358; } } // Pen of Wisdom
|
||||
private int m_UsesRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get { return m_UsesRemaining; }
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PenOfWisdom() : this(100)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PenOfWisdom(int uses)
|
||||
: base(0x0FC0)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 1.0;
|
||||
m_UsesRemaining = uses;
|
||||
Hue = 1260;
|
||||
ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
public virtual bool ShowUsesRemaining
|
||||
{
|
||||
get { return true; }
|
||||
set { }
|
||||
}
|
||||
|
||||
public PenOfWisdom(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1115359); // Please select the source runebook. Recall runes and Mark scrolls at the base level of your backpack are consumed.
|
||||
from.Target = new SourceTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)m_UsesRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool CheckAccess(Mobile m, Runebook book)
|
||||
{
|
||||
if (!book.IsLockedDown || m.AccessLevel >= AccessLevel.GameMaster)
|
||||
return true;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(book);
|
||||
|
||||
return house != null && house.IsCoOwner(m);
|
||||
}
|
||||
|
||||
private class SourceTarget : Target
|
||||
{
|
||||
private readonly PenOfWisdom Pen;
|
||||
|
||||
public SourceTarget(PenOfWisdom pen) : base(12, false, TargetFlags.None)
|
||||
{
|
||||
Pen = pen;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targ)
|
||||
{
|
||||
if (targ is Runebook || targ is RunicAtlas)
|
||||
{
|
||||
Runebook book = targ as Runebook;
|
||||
|
||||
if (!book.IsChildOf(from.Backpack) && book.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1115329); // Runebooks you wish to copy must be in your backpack.
|
||||
}
|
||||
else if (!Pen.CheckAccess(from, book) && !book.Movable)
|
||||
{
|
||||
from.SendLocalizedMessage(1115332); // Only the house owner and co-owners can copy the lockdowned runebook with the Pen.
|
||||
}
|
||||
else if (book.Entries.Count == 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1115362); // Can't copy an empty runebook.
|
||||
}
|
||||
else if (book.Openers.Count != 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1115361); // Someone else is using this runebook.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1115363); // Please select the destination runebook.
|
||||
from.Target = new CopyTarget(Pen, book);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1115333); // This item only works on runebooks or runic atlas.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class CopyTarget : Target
|
||||
{
|
||||
private readonly PenOfWisdom Pen;
|
||||
private readonly Runebook SourceBook;
|
||||
|
||||
public CopyTarget(PenOfWisdom pen, Runebook book) : base(12, false, TargetFlags.None)
|
||||
{
|
||||
Pen = pen;
|
||||
SourceBook = book;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targ)
|
||||
{
|
||||
if (targ is Runebook)
|
||||
{
|
||||
Runebook book = targ as Runebook;
|
||||
|
||||
if (!book.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (book == SourceBook)
|
||||
{
|
||||
from.SendLocalizedMessage(1115360); // You can't select the same runebook!
|
||||
}
|
||||
else if (book.Openers.Count != 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1115361); // Someone else is using this runebook.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!from.HasGump(typeof(PenOfWisdomGump)))
|
||||
from.SendGump(new PenOfWisdomGump(from, Pen, SourceBook, book, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1115333); // This item only works on runebooks or runic atlas.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PenOfWisdomGump : Gump
|
||||
{
|
||||
public readonly int EntryColor = 0xFFFFFF;
|
||||
|
||||
public readonly List<RunebookEntry> Checked;
|
||||
public readonly Runebook SourceBook;
|
||||
public readonly Runebook CopyBook;
|
||||
public readonly int RuneAmount;
|
||||
public readonly int MarkScrollAmount;
|
||||
public readonly int Blank;
|
||||
public readonly PenOfWisdom Pen;
|
||||
|
||||
public PenOfWisdomGump(Mobile from, PenOfWisdom pen, Runebook sourcebook, Runebook copybook, List<RunebookEntry> list)
|
||||
: base(50, 50)
|
||||
{
|
||||
Container bp = from.Backpack;
|
||||
|
||||
Pen = pen;
|
||||
SourceBook = sourcebook;
|
||||
CopyBook = copybook;
|
||||
MarkScrollAmount = bp.GetAmount(typeof(MarkScroll), true);
|
||||
RuneAmount = bp.GetAmount(typeof(RecallRune), true);
|
||||
Blank = copybook.MaxEntries - copybook.Entries.Count;
|
||||
|
||||
if (list == null)
|
||||
{
|
||||
Checked = new List<RunebookEntry>();
|
||||
}
|
||||
else
|
||||
{
|
||||
Checked = list;
|
||||
}
|
||||
|
||||
Closable = false;
|
||||
Disposable = true;
|
||||
Dragable = true;
|
||||
|
||||
int entrycount = SourceBook.Entries.Count;
|
||||
|
||||
int y = entrycount <= 16 ? 0 : 25;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(4, 39, 391, 313 + y, 9200);
|
||||
AddImageTiled(8, 45, 380, 53, 2624);
|
||||
|
||||
AddHtmlLocalized(7, 50, 380, 53, 1115428, String.Format("@{0}@{1}@{2}@{3}", MarkScrollAmount.ToString(), RuneAmount.ToString(), Checked.Count, Blank.ToString()), EntryColor, false, false); // <CENTER>Pen of Wisdom<br>(Mark Scrolls: ~1_VAL~, Runes: ~2_VAL~ | Selected: ~3_VAL~, Blank: ~4_VAL~)</CENTER>
|
||||
|
||||
AddImageTiled(8, 101, 188, 220, 2624);
|
||||
AddImageTiled(199, 101, 188, 220, 2624);
|
||||
|
||||
AddButton(12, 325 + y, 4017, 4018, 20, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(48, 326 + y, 78, 20, 1006045, EntryColor, false, false); // Cancel
|
||||
|
||||
AddButton(153, 325 + y, 4011, 4012, 21, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(189, 326 + y, 78, 20, 1115427, EntryColor, false, false); // Select All
|
||||
|
||||
AddButton(309, 325 + y, 4023, 4024, 22, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(344, 326 + y, 78, 20, 1156596, EntryColor, false, false); // Okay
|
||||
|
||||
string description;
|
||||
|
||||
int page = 1;
|
||||
int yy = 0;
|
||||
|
||||
AddPage(page);
|
||||
|
||||
for (int i = 0; i < entrycount; i++)
|
||||
{
|
||||
if (page > 1)
|
||||
{
|
||||
AddButton(50, 325, 4014, 4015, 0, GumpButtonType.Page, page - 1);
|
||||
AddHtmlLocalized(85, 326, 150, 20, 1011067, EntryColor, false, false); // Previous page
|
||||
}
|
||||
|
||||
description = SourceBook.Entries[i].Description;
|
||||
|
||||
if (description == null)
|
||||
{
|
||||
if (i + 1 < 10)
|
||||
{
|
||||
description = "0" + (i + 1).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
description = (i + 1).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
if (yy < 8)
|
||||
{
|
||||
AddButton(15, 110 + (yy * 25), Checked.Contains(SourceBook.Entries[i]) ? 211 : 210, Checked.Contains(SourceBook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
|
||||
AddLabelCropped(45, 110 + (yy * 25), 115, 17, RunebookGump.GetMapHue(SourceBook.Entries[i].Map), String.Format("{0}", description));
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton(205, 110 + ((yy - 8) * 25), Checked.Contains(SourceBook.Entries[i]) ? 211 : 210, Checked.Contains(SourceBook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
|
||||
AddLabelCropped(235, 110 + ((yy - 8) * 25), 115, 17, RunebookGump.GetMapHue(SourceBook.Entries[i].Map), String.Format("{0}", description));
|
||||
}
|
||||
|
||||
yy++;
|
||||
|
||||
bool pages = (i + 1) % 16 == 0;
|
||||
|
||||
if (pages && entrycount - 1 != i)
|
||||
{
|
||||
AddButton(200, 325, 4005, 4006, 0, GumpButtonType.Page, page + 1);
|
||||
AddHtmlLocalized(235, 326, 150, 20, 1011066, EntryColor, false, false); // Next page
|
||||
page++;
|
||||
AddPage(page);
|
||||
yy = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (Checked == null)
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 20: // Cancel
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 21: // Select All
|
||||
{
|
||||
Checked.Clear();
|
||||
|
||||
for (int i = 0; i < SourceBook.Entries.Count; i++)
|
||||
{
|
||||
Checked.Add(SourceBook.Entries[i]);
|
||||
}
|
||||
|
||||
if (!from.HasGump(typeof(PenOfWisdomGump)))
|
||||
from.SendGump(new PenOfWisdomGump(from, Pen, SourceBook, CopyBook, Checked));
|
||||
|
||||
break;
|
||||
}
|
||||
case 22: // OK
|
||||
{
|
||||
if (MarkScrollAmount < Checked.Count || RuneAmount < Checked.Count)
|
||||
{
|
||||
from.SendLocalizedMessage(1115364); // You don't have enough recall runes and Mark scrolls to do that.
|
||||
}
|
||||
else if (Blank < Checked.Count)
|
||||
{
|
||||
from.SendLocalizedMessage(1115330); // The destination runebook doesn't have enough space.
|
||||
}
|
||||
else if (!SourceBook.IsChildOf(from.Backpack) && SourceBook.Movable || !CopyBook.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1115329); // Runebooks you wish to copy must be in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (RunebookEntry entry in Checked)
|
||||
{
|
||||
CopyBook.Entries.Add(entry);
|
||||
}
|
||||
|
||||
Container bp = from.Backpack;
|
||||
|
||||
bp.ConsumeTotal(typeof(MarkScroll), Checked.Count, true);
|
||||
bp.ConsumeTotal(typeof(RecallRune), Checked.Count, true);
|
||||
Pen.UsesRemaining -= 1;
|
||||
Pen.InvalidateProperties();
|
||||
|
||||
from.SendLocalizedMessage(1115331); // The Pen magically marks runes and binds them to the runebook.
|
||||
from.SendLocalizedMessage(1115366); // The pen's magical power is consumed and it crumbles to dust.
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
int index = info.ButtonID;
|
||||
|
||||
if (Checked.Contains(SourceBook.Entries[index]))
|
||||
{
|
||||
Checked.Remove(SourceBook.Entries[index]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Checked.Add(SourceBook.Entries[index]);
|
||||
}
|
||||
|
||||
if (!from.HasGump(typeof(PenOfWisdomGump)))
|
||||
from.SendGump(new PenOfWisdomGump(from, Pen, SourceBook, CopyBook, Checked));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
96
Scripts/Items/Tools/PetBondingPotion.cs
Normal file
96
Scripts/Items/Tools/PetBondingPotion.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PetBondingPotion : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1152921; } } // Pet Bonding Potion
|
||||
|
||||
[Constructable]
|
||||
public PetBondingPotion() : base(0x0F04)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 2629;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1152922); // Target the pet you wish to bond with. Press ESC to cancel. This item is consumed on successful use, so choose wisely!
|
||||
from.Target = new BondingTarget(this);
|
||||
}
|
||||
}
|
||||
|
||||
public PetBondingPotion(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 BondingTarget : Target
|
||||
{
|
||||
private PetBondingPotion m_Potion;
|
||||
|
||||
public BondingTarget(PetBondingPotion potion) : base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Potion = potion;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object target)
|
||||
{
|
||||
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
|
||||
return;
|
||||
|
||||
if (target is BaseCreature)
|
||||
{
|
||||
BaseCreature t = (BaseCreature)target;
|
||||
|
||||
if (t.IsBonded == true)
|
||||
{
|
||||
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
|
||||
}
|
||||
else if (t.ControlMaster != from)
|
||||
{
|
||||
from.SendLocalizedMessage(1114368); // This is not your pet!
|
||||
}
|
||||
else if (t.Allured || t.Summoned)
|
||||
{
|
||||
from.SendLocalizedMessage(1152924); // That is not a valid pet.
|
||||
}
|
||||
else if (target is BaseTalismanSummon)
|
||||
{
|
||||
from.SendLocalizedMessage(1152924); // That is not a valid pet.
|
||||
}
|
||||
else
|
||||
{
|
||||
t.IsBonded = !t.IsBonded;
|
||||
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
|
||||
m_Potion.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1152924); // That is not a valid pet.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
157
Scripts/Items/Tools/PresetMap.cs
Normal file
157
Scripts/Items/Tools/PresetMap.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PresetMap : MapItem
|
||||
{
|
||||
private int m_LabelNumber;
|
||||
|
||||
[Constructable]
|
||||
public PresetMap( PresetMapType type )
|
||||
{
|
||||
int v = (int)type;
|
||||
|
||||
if ( v >= 0 && v < PresetMapEntry.Table.Length )
|
||||
InitEntry( PresetMapEntry.Table[v] );
|
||||
}
|
||||
|
||||
public PresetMap( PresetMapEntry entry )
|
||||
{
|
||||
InitEntry( entry );
|
||||
}
|
||||
|
||||
public void InitEntry( PresetMapEntry entry )
|
||||
{
|
||||
m_LabelNumber = entry.Name;
|
||||
|
||||
Width = entry.Width;
|
||||
Height = entry.Height;
|
||||
|
||||
Bounds = entry.Bounds;
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return (m_LabelNumber == 0 ? base.LabelNumber : m_LabelNumber); } }
|
||||
|
||||
public PresetMap( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
|
||||
writer.Write( (int) m_LabelNumber );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_LabelNumber = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PresetMapEntry
|
||||
{
|
||||
private int m_Name;
|
||||
private int m_Width, m_Height;
|
||||
private Rectangle2D m_Bounds;
|
||||
|
||||
public int Name{ get{ return m_Name; } }
|
||||
public int Width{ get{ return m_Width; } }
|
||||
public int Height{ get{ return m_Height; } }
|
||||
public Rectangle2D Bounds{ get{ return m_Bounds; } }
|
||||
|
||||
public PresetMapEntry( int name, int width, int height, int xLeft, int yTop, int xRight, int yBottom )
|
||||
{
|
||||
m_Name = name;
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
m_Bounds = new Rectangle2D( xLeft, yTop, xRight - xLeft, yBottom - yTop );
|
||||
}
|
||||
|
||||
private static PresetMapEntry[] m_Table = new PresetMapEntry[]
|
||||
{
|
||||
new PresetMapEntry( 1041189, 200, 200, 1092, 1396, 1736, 1924 ), // map of Britain
|
||||
new PresetMapEntry( 1041203, 200, 200, 0256, 1792, 1736, 2560 ), // map of Britain to Skara Brae
|
||||
new PresetMapEntry( 1041192, 200, 200, 1024, 1280, 2304, 3072 ), // map of Britain to Trinsic
|
||||
new PresetMapEntry( 1041183, 200, 200, 2500, 1900, 3000, 2400 ), // map of Buccaneer's Den
|
||||
new PresetMapEntry( 1041198, 200, 200, 2560, 1792, 3840, 2560 ), // map of Buccaneer's Den to Magincia
|
||||
new PresetMapEntry( 1041194, 200, 200, 2560, 1792, 3840, 3072 ), // map of Buccaneer's Den to Ocllo
|
||||
new PresetMapEntry( 1041181, 200, 200, 1088, 3572, 1528, 4056 ), // map of Jhelom
|
||||
new PresetMapEntry( 1041186, 200, 200, 3530, 2022, 3818, 2298 ), // map of Magincia
|
||||
new PresetMapEntry( 1041199, 200, 200, 3328, 1792, 3840, 2304 ), // map of Magincia to Ocllo
|
||||
new PresetMapEntry( 1041182, 200, 200, 2360, 0356, 2706, 0702 ), // map of Minoc
|
||||
new PresetMapEntry( 1041190, 200, 200, 0000, 0256, 2304, 3072 ), // map of Minoc to Yew
|
||||
new PresetMapEntry( 1041191, 200, 200, 2467, 0572, 2878, 0746 ), // map of Minoc to Vesper
|
||||
new PresetMapEntry( 1041188, 200, 200, 4156, 0808, 4732, 1528 ), // map of Moonglow
|
||||
new PresetMapEntry( 1041201, 200, 200, 3328, 0768, 4864, 1536 ), // map of Moonglow to Nujelm
|
||||
new PresetMapEntry( 1041185, 200, 200, 3446, 1030, 3832, 1424 ), // map of Nujelm
|
||||
new PresetMapEntry( 1041197, 200, 200, 3328, 1024, 3840, 2304 ), // map of Nujelm to Magincia
|
||||
new PresetMapEntry( 1041187, 200, 200, 3582, 2456, 3770, 2742 ), // map of Ocllo
|
||||
new PresetMapEntry( 1041184, 200, 200, 2714, 3329, 3100, 3639 ), // map of Serpent's Hold
|
||||
new PresetMapEntry( 1041200, 200, 200, 2560, 2560, 3840, 3840 ), // map of Serpent's Hold to Ocllo
|
||||
new PresetMapEntry( 1041180, 200, 200, 0524, 2064, 0960, 2452 ), // map of Skara Brae
|
||||
new PresetMapEntry( 1041204, 200, 200, 0000, 0000, 5199, 4095 ), // map of The World
|
||||
new PresetMapEntry( 1041177, 200, 200, 1792, 2630, 2118, 2952 ), // map of Trinsic
|
||||
new PresetMapEntry( 1041193, 200, 200, 1792, 1792, 3072, 3072 ), // map of Trinsic to Buccaneer's Den
|
||||
new PresetMapEntry( 1041195, 200, 200, 0256, 1792, 2304, 4095 ), // map of Trinsic to Jhelom
|
||||
new PresetMapEntry( 1041178, 200, 200, 2636, 0592, 3064, 1012 ), // map of Vesper
|
||||
new PresetMapEntry( 1041196, 200, 200, 2636, 0592, 3840, 1536 ), // map of Vesper to Nujelm
|
||||
new PresetMapEntry( 1041179, 200, 200, 0236, 0741, 0766, 1269 ), // map of Yew
|
||||
new PresetMapEntry( 1041202, 200, 200, 0000, 0512, 1792, 2048 ), // map of Yew to Britain
|
||||
new PresetMapEntry( 0, 200, 200, 600, 3280, 950, 3650 ), // Royal City
|
||||
new PresetMapEntry( 0, 200, 200, 900, 3780, 1160, 4060 ), // Holy City
|
||||
new PresetMapEntry( 0, 200, 200, 890, 430, 1090, 600 ), // Luna
|
||||
new PresetMapEntry( 0, 200, 200, 1920, 1240, 2130, 1430 ), // Umbra
|
||||
new PresetMapEntry( 0, 200, 200, 5630, 3080, 5860, 3330 ), // Papua
|
||||
new PresetMapEntry( 0, 200, 200, 5140, 3900, 5330, 4094 ), // Deliucia
|
||||
};
|
||||
|
||||
public static PresetMapEntry[] Table{ get{ return m_Table; } }
|
||||
}
|
||||
|
||||
public enum PresetMapType
|
||||
{
|
||||
Britain,
|
||||
BritainToSkaraBrae,
|
||||
BritainToTrinsic,
|
||||
BucsDen,
|
||||
BucsDenToMagincia,
|
||||
BucsDenToOcllo,
|
||||
Jhelom,
|
||||
Magincia,
|
||||
MaginciaToOcllo,
|
||||
Minoc,
|
||||
MinocToYew,
|
||||
MinocToVesper,
|
||||
Moonglow,
|
||||
MoonglowToNujelm,
|
||||
Nujelm,
|
||||
NujelmToMagincia,
|
||||
Ocllo,
|
||||
SerpentsHold,
|
||||
SerpentsHoldToOcllo,
|
||||
SkaraBrae,
|
||||
TheWorld,
|
||||
Trinsic,
|
||||
TrinsicToBucsDen,
|
||||
TrinsicToJhelom,
|
||||
Vesper,
|
||||
VesperToNujelm,
|
||||
Yew,
|
||||
YewToBritain
|
||||
}
|
||||
}
|
||||
159
Scripts/Items/Tools/ProspectorsTool.cs
Normal file
159
Scripts/Items/Tools/ProspectorsTool.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ProspectorsTool : BaseBashing
|
||||
{
|
||||
public override int LabelNumber { get { return 1049065; } } // prospector's tool
|
||||
|
||||
[Constructable]
|
||||
public ProspectorsTool()
|
||||
: base(0xFB4)
|
||||
{
|
||||
Weight = 10.0;
|
||||
UsesRemaining = 50;
|
||||
ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
public ProspectorsTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override WeaponAbility PrimaryAbility { get { return WeaponAbility.CrushingBlow; } }
|
||||
public override WeaponAbility SecondaryAbility { get { return WeaponAbility.ShadowStrike; } }
|
||||
public override int AosStrengthReq { get { return 40; } }
|
||||
public override int AosMinDamage { get { return 13; } }
|
||||
public override int AosMaxDamage { get { return 15; } }
|
||||
public override int AosSpeed { get { return 33; } }
|
||||
public override float MlSpeed { get { return 3.25f; } }
|
||||
public override int OldStrengthReq { get { return 10; } }
|
||||
public override int OldMinDamage { get { return 6; } }
|
||||
public override int OldMaxDamage { get { return 8; } }
|
||||
public override int OldSpeed { get { return 33; } }
|
||||
public override int InitMinHits { get { return 31; } }
|
||||
public override int InitMaxHits { get { return 60; } }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
from.Target = new InternalTarget(this);
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public void Prospect(Mobile from, object toProspect)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack) && Parent != from)
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
HarvestSystem system = Mining.System;
|
||||
|
||||
int tileID;
|
||||
Map map;
|
||||
Point3D loc;
|
||||
|
||||
if (!system.GetHarvestDetails(from, this, toProspect, out tileID, out map, out loc))
|
||||
{
|
||||
from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that.
|
||||
return;
|
||||
}
|
||||
|
||||
HarvestDefinition def = system.GetDefinition(tileID);
|
||||
|
||||
if (def == null || def.Veins.Length <= 1)
|
||||
{
|
||||
from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that.
|
||||
return;
|
||||
}
|
||||
|
||||
HarvestBank bank = def.GetBank(map, loc.X, loc.Y);
|
||||
|
||||
if (bank == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that.
|
||||
return;
|
||||
}
|
||||
|
||||
HarvestVein vein = bank.Vein, defaultVein = bank.DefaultVein;
|
||||
|
||||
if (vein == null || defaultVein == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that.
|
||||
return;
|
||||
}
|
||||
else if (vein != defaultVein)
|
||||
{
|
||||
from.SendLocalizedMessage(1049049); // That ore looks to be prospected already.
|
||||
return;
|
||||
}
|
||||
|
||||
int veinIndex = Array.IndexOf(def.Veins, vein);
|
||||
|
||||
if (veinIndex < 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1049048); // You cannot use your prospector tool on that.
|
||||
}
|
||||
else if (veinIndex >= (def.Veins.Length - 1))
|
||||
{
|
||||
from.SendLocalizedMessage(1049061); // You cannot improve valorite ore through prospecting.
|
||||
}
|
||||
else
|
||||
{
|
||||
bank.Vein = def.Veins[veinIndex + 1];
|
||||
from.SendLocalizedMessage(1049050 + veinIndex);
|
||||
|
||||
--UsesRemaining;
|
||||
|
||||
if (UsesRemaining <= 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1049062); // You have used up your prospector's tool.
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
UsesRemaining = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly ProspectorsTool m_Tool;
|
||||
public InternalTarget(ProspectorsTool tool)
|
||||
: base(2, true, TargetFlags.None)
|
||||
{
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
m_Tool.Prospect(from, targeted);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
81
Scripts/Items/Tools/RewardBlackDyeTub.cs
Normal file
81
Scripts/Items/Tools/RewardBlackDyeTub.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RewardBlackDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public RewardBlackDyeTub()
|
||||
{
|
||||
this.Hue = this.DyedHue = 0x0001;
|
||||
this.Redyable = false;
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public RewardBlackDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1006008;
|
||||
}
|
||||
}// Black Dye Tub
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/RollingPin.cs
Normal file
48
Scripts/Items/Tools/RollingPin.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RollingPin : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public RollingPin()
|
||||
: base(0x1043)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RollingPin(int uses)
|
||||
: base(uses, 0x1043)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public RollingPin(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCooking.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
241
Scripts/Items/Tools/RoseOfTrinsic.cs
Normal file
241
Scripts/Items/Tools/RoseOfTrinsic.cs
Normal file
@@ -0,0 +1,241 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x234C, 0x234D)]
|
||||
public class RoseOfTrinsic : Item, ISecurable, ICommodity
|
||||
{
|
||||
private static readonly TimeSpan m_SpawnTime = TimeSpan.FromHours(4.0);
|
||||
private int m_Petals;
|
||||
private DateTime m_NextSpawnTime;
|
||||
private SpawnTimer m_SpawnTimer;
|
||||
private SecureLevel m_Level;
|
||||
[Constructable]
|
||||
public RoseOfTrinsic()
|
||||
: base(0x234D)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
this.LootType = LootType.Blessed;
|
||||
|
||||
this.m_Petals = 0;
|
||||
this.StartSpawnTimer(TimeSpan.FromMinutes(1.0));
|
||||
}
|
||||
|
||||
public RoseOfTrinsic(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
TextDefinition ICommodity.Description { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1062913;
|
||||
}
|
||||
}// Rose of Trinsic
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Level;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Level = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Petals
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Petals;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value >= 10)
|
||||
{
|
||||
this.m_Petals = 10;
|
||||
|
||||
this.StopSpawnTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value <= 0)
|
||||
this.m_Petals = 0;
|
||||
else
|
||||
this.m_Petals = value;
|
||||
|
||||
this.StartSpawnTimer(m_SpawnTime);
|
||||
}
|
||||
|
||||
this.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1062925, this.Petals.ToString()); // Petals: ~1_COUNT~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else if (this.Petals > 0)
|
||||
{
|
||||
from.AddToBackpack(new RoseOfTrinsicPetal(this.Petals));
|
||||
this.Petals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt((int)0); // version
|
||||
|
||||
writer.WriteEncodedInt((int)this.m_Petals);
|
||||
writer.WriteDeltaTime((DateTime)this.m_NextSpawnTime);
|
||||
writer.WriteEncodedInt((int)this.m_Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
this.m_Petals = reader.ReadEncodedInt();
|
||||
this.m_NextSpawnTime = reader.ReadDeltaTime();
|
||||
this.m_Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
|
||||
if (this.m_Petals < 10)
|
||||
this.StartSpawnTimer(this.m_NextSpawnTime - DateTime.UtcNow);
|
||||
}
|
||||
|
||||
private void StartSpawnTimer(TimeSpan delay)
|
||||
{
|
||||
this.StopSpawnTimer();
|
||||
|
||||
this.m_SpawnTimer = new SpawnTimer(this, delay);
|
||||
this.m_SpawnTimer.Start();
|
||||
|
||||
this.m_NextSpawnTime = DateTime.UtcNow + delay;
|
||||
}
|
||||
|
||||
private void StopSpawnTimer()
|
||||
{
|
||||
if (this.m_SpawnTimer != null)
|
||||
{
|
||||
this.m_SpawnTimer.Stop();
|
||||
this.m_SpawnTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private class SpawnTimer : Timer
|
||||
{
|
||||
private readonly RoseOfTrinsic m_Rose;
|
||||
public SpawnTimer(RoseOfTrinsic rose, TimeSpan delay)
|
||||
: base(delay)
|
||||
{
|
||||
this.m_Rose = rose;
|
||||
|
||||
this.Priority = TimerPriority.OneMinute;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (this.m_Rose.Deleted)
|
||||
return;
|
||||
|
||||
this.m_Rose.m_SpawnTimer = null;
|
||||
this.m_Rose.Petals++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RoseOfTrinsicPetal : Item
|
||||
{
|
||||
[Constructable]
|
||||
public RoseOfTrinsicPetal()
|
||||
: this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RoseOfTrinsicPetal(int amount)
|
||||
: base(0x1021)
|
||||
{
|
||||
this.Stackable = true;
|
||||
this.Amount = amount;
|
||||
|
||||
this.Weight = 1.0;
|
||||
this.Hue = 0xE;
|
||||
}
|
||||
|
||||
public RoseOfTrinsicPetal(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1062926;
|
||||
}
|
||||
}// Petal of the Rose of Trinsic
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!this.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
|
||||
{
|
||||
from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(0x1EE);
|
||||
from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));
|
||||
|
||||
this.Consume();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Items/Tools/RunebookDyeTub.cs
Normal file
114
Scripts/Items/Tools/RunebookDyeTub.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunebookDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public RunebookDyeTub()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public RunebookDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override bool AllowRunebooks
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override int TargetMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049774;
|
||||
}
|
||||
}// Target the runebook or runestone to dye
|
||||
public override int FailMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049775;
|
||||
}
|
||||
}// You can only dye runestones or runebooks with this tub.
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049740;
|
||||
}
|
||||
}// Runebook Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker
|
||||
{
|
||||
get
|
||||
{
|
||||
return CustomHuePicker.LeatherDyeTub;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076220); // 4th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Scripts/Items/Tools/RunicDovetailSaw.cs
Normal file
62
Scripts/Items/Tools/RunicDovetailSaw.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunicDovetailSaw : BaseRunicTool
|
||||
{
|
||||
[Constructable]
|
||||
public RunicDovetailSaw(CraftResource resource)
|
||||
: base(resource, 0x1028)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicDovetailSaw(CraftResource resource, int uses)
|
||||
: base(resource, uses, 0x1028)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public RunicDovetailSaw(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = CraftResources.GetIndex(this.Resource);
|
||||
|
||||
if (index >= 1 && index <= 6)
|
||||
return 1072633 + index;
|
||||
|
||||
return 1024137; // dovetail saw
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
62
Scripts/Items/Tools/RunicFletcherTool.cs
Normal file
62
Scripts/Items/Tools/RunicFletcherTool.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunicFletcherTool : BaseRunicTool
|
||||
{
|
||||
[Constructable]
|
||||
public RunicFletcherTool(CraftResource resource)
|
||||
: base(resource, 0x1022)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicFletcherTool(CraftResource resource, int uses)
|
||||
: base(resource, uses, 0x1022)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public RunicFletcherTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBowFletching.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = CraftResources.GetIndex(this.Resource);
|
||||
|
||||
if (index >= 1 && index <= 6)
|
||||
return 1072627 + index;
|
||||
|
||||
return 1044559; // Fletcher's Tools
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Scripts/Items/Tools/RunicHammer.cs
Normal file
85
Scripts/Items/Tools/RunicHammer.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x13E4, 0x13E3)]
|
||||
public class RunicHammer : BaseRunicTool
|
||||
{
|
||||
[Constructable]
|
||||
public RunicHammer(CraftResource resource)
|
||||
: base(resource, 0x13E3)
|
||||
{
|
||||
this.Weight = 8.0;
|
||||
this.Layer = Layer.OneHanded;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicHammer(CraftResource resource, int uses)
|
||||
: base(resource, uses, 0x13E3)
|
||||
{
|
||||
this.Weight = 8.0;
|
||||
this.Layer = Layer.OneHanded;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public RunicHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = CraftResources.GetIndex(this.Resource);
|
||||
|
||||
if (index >= 1 && index <= 8)
|
||||
return 1049019 + index;
|
||||
|
||||
return 1045128; // runic smithy hammer
|
||||
}
|
||||
}
|
||||
public override void AddNameProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddNameProperties(list);
|
||||
|
||||
int index = CraftResources.GetIndex(this.Resource);
|
||||
|
||||
if (index >= 1 && index <= 8)
|
||||
return;
|
||||
|
||||
if (!CraftResources.IsStandard(this.Resource))
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber(this.Resource);
|
||||
|
||||
if (num > 0)
|
||||
list.Add(num);
|
||||
else
|
||||
list.Add(CraftResources.GetName(this.Resource));
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
57
Scripts/Items/Tools/RunicMalletAndChisel.cs
Normal file
57
Scripts/Items/Tools/RunicMalletAndChisel.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunicMalletAndChisel : BaseRunicTool
|
||||
{
|
||||
public override CraftSystem CraftSystem{ get{ return DefMasonry.CraftSystem; } }
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
int index = CraftResources.GetIndex(Resource);
|
||||
|
||||
if (index >= 1 && index <= 8)
|
||||
return 1111795 + index;
|
||||
|
||||
return 1045128; // mallet and chisel
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicMalletAndChisel( CraftResource resource ) : base( resource, 4787 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicMalletAndChisel( CraftResource resource, int uses ) : base( resource, uses, 4787 )
|
||||
{
|
||||
Weight = 2.0;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
}
|
||||
|
||||
public RunicMalletAndChisel(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
87
Scripts/Items/Tools/RunicSewingKit.cs
Normal file
87
Scripts/Items/Tools/RunicSewingKit.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RunicSewingKit : BaseRunicTool
|
||||
{
|
||||
[Constructable]
|
||||
public RunicSewingKit(CraftResource resource)
|
||||
: base(resource, 0xF9D)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public RunicSewingKit(CraftResource resource, int uses)
|
||||
: base(resource, uses, 0xF9D)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
this.Hue = CraftResources.GetHue(resource);
|
||||
}
|
||||
|
||||
public RunicSewingKit(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefTailoring.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
string v = " ";
|
||||
|
||||
if (!CraftResources.IsStandard(this.Resource))
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber(this.Resource);
|
||||
|
||||
if (num > 0)
|
||||
v = String.Format("#{0}", num);
|
||||
else
|
||||
v = CraftResources.GetName(this.Resource);
|
||||
}
|
||||
|
||||
list.Add(1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
string v = " ";
|
||||
|
||||
if (!CraftResources.IsStandard(this.Resource))
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber(this.Resource);
|
||||
|
||||
if (num > 0)
|
||||
v = String.Format("#{0}", num);
|
||||
else
|
||||
v = CraftResources.GetName(this.Resource);
|
||||
}
|
||||
|
||||
this.LabelTo(from, 1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (this.ItemID == 0x13E4 || this.ItemID == 0x13E3)
|
||||
this.ItemID = 0xF9D;
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/Saw.cs
Normal file
49
Scripts/Items/Tools/Saw.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x1034, 0x1035)]
|
||||
public class Saw : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Saw()
|
||||
: base(0x1034)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Saw(int uses)
|
||||
: base(uses, 0x1034)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public Saw(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
168
Scripts/Items/Tools/Scales.cs
Normal file
168
Scripts/Items/Tools/Scales.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Scales : Item, IResource, IQuality
|
||||
{
|
||||
private CraftResource _Resource;
|
||||
private Mobile _Crafter;
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource { get { return _Resource; } set { _Resource = value; _Resource = value; Hue = CraftResources.GetHue(_Resource); InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter { get { return _Crafter; } set { _Crafter = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Scales()
|
||||
: base(0x1852)
|
||||
{
|
||||
Weight = 4.0;
|
||||
}
|
||||
|
||||
public Scales(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, _Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_Resource > CraftResource.Iron)
|
||||
{
|
||||
list.Add(1053099, "#{0}\t{1}", CraftResources.GetLocalizationNumber(_Resource), String.Format("#{0}", LabelNumber.ToString())); // ~1_oretype~ ~2_armortype~
|
||||
}
|
||||
else
|
||||
{
|
||||
base.AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
if (!craftItem.ForceNonExceptional)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
writer.Write(_Crafter);
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
_Crafter = reader.ReadMobile();
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(502431); // What would you like to weigh?
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly Scales m_Item;
|
||||
public InternalTarget(Scales item)
|
||||
: base(1, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
string message;
|
||||
|
||||
if (targeted == m_Item)
|
||||
{
|
||||
message = "It cannot weight itself.";
|
||||
}
|
||||
else if (targeted is Item)
|
||||
{
|
||||
Item item = (Item)targeted;
|
||||
object root = item.RootParent;
|
||||
|
||||
if ((root != null && root != from) || item.Parent == from)
|
||||
{
|
||||
message = "You decide that item's current location is too awkward to get an accurate result.";
|
||||
}
|
||||
else if (item.Movable)
|
||||
{
|
||||
if (item.Amount > 1)
|
||||
message = "You place one item on the scale. ";
|
||||
else
|
||||
message = "You place that item on the scale. ";
|
||||
|
||||
double weight = item.Weight;
|
||||
|
||||
if (weight <= 0.0)
|
||||
message += "It is lighter than a feather.";
|
||||
else
|
||||
message += String.Format("It weighs {0} stones.", weight);
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "You cannot weigh that object.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "You cannot weigh that object.";
|
||||
}
|
||||
|
||||
from.SendMessage(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
238
Scripts/Items/Tools/Scissors.cs
Normal file
238
Scripts/Items/Tools/Scissors.cs
Normal file
@@ -0,0 +1,238 @@
|
||||
#region References
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
using Server.Engines.Craft;
|
||||
#endregion
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public interface IScissorable
|
||||
{
|
||||
bool Scissor(Mobile from, Scissors scissors);
|
||||
}
|
||||
|
||||
[Flipable(0xf9f, 0xf9e)]
|
||||
public class Scissors : Item, ICraftable, IQuality, IUsesRemaining
|
||||
{
|
||||
private int m_UsesRemaining;
|
||||
private Mobile m_Crafter;
|
||||
private ItemQuality m_Quality;
|
||||
private bool m_ShowUsesRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining { get { return m_UsesRemaining; } set { m_UsesRemaining = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter { get { return m_Crafter; } set { m_Crafter = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool ShowUsesRemaining { get { return m_ShowUsesRemaining; } set { m_ShowUsesRemaining = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality
|
||||
{
|
||||
get { return m_Quality; }
|
||||
set
|
||||
{
|
||||
UnscaleUses();
|
||||
m_Quality = value;
|
||||
ScaleUses();
|
||||
}
|
||||
}
|
||||
|
||||
public bool PlayerConstructed { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public Scissors()
|
||||
: base(0xF9F)
|
||||
{
|
||||
Weight = 1.0;
|
||||
|
||||
m_UsesRemaining = 50;
|
||||
|
||||
if (Siege.SiegeShard)
|
||||
m_ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (m_Crafter != null)
|
||||
list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
|
||||
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
list.Add(1060636); // exceptional
|
||||
}
|
||||
|
||||
public override void AddUsesRemainingProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (Siege.SiegeShard)
|
||||
{
|
||||
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
public Scissors(Serial serial)
|
||||
: base(serial)
|
||||
{ }
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(2); // version
|
||||
|
||||
writer.Write(m_ShowUsesRemaining);
|
||||
|
||||
writer.Write(m_UsesRemaining);
|
||||
writer.Write(m_Crafter);
|
||||
writer.Write((int)m_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch(version)
|
||||
{
|
||||
case 2:
|
||||
m_ShowUsesRemaining = reader.ReadBool();
|
||||
goto case 1;
|
||||
case 1:
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
m_Crafter = reader.ReadMobile();
|
||||
m_Quality = (ItemQuality)reader.ReadInt();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void ScaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * GetUsesScalar()) / 100;
|
||||
InvalidateProperties();
|
||||
}
|
||||
|
||||
public void UnscaleUses()
|
||||
{
|
||||
m_UsesRemaining = (m_UsesRemaining * 100) / GetUsesScalar();
|
||||
}
|
||||
|
||||
public int GetUsesScalar()
|
||||
{
|
||||
if (m_Quality == ItemQuality.Exceptional)
|
||||
return 200;
|
||||
|
||||
return 100;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(502434); // What should I use these scissors on?
|
||||
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
return quality;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly Scissors m_Item;
|
||||
|
||||
public InternalTarget(Scissors item)
|
||||
: base(2, false, TargetFlags.None)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Item.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*if ( targeted is Item && !((Item)targeted).IsStandardLoot() )
|
||||
{
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
}
|
||||
else */
|
||||
if (Core.AOS && targeted == from)
|
||||
{
|
||||
from.SendLocalizedMessage(1062845 + Utility.Random(3));
|
||||
//"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
|
||||
}
|
||||
else if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 &&
|
||||
(Core.TickCount - from.LastMoveTime) < from.ComputeMovementSpeed(from.Direction))
|
||||
{
|
||||
from.SendLocalizedMessage(1063305); // Didn't your parents ever tell you not to run with scissors in your hand?!
|
||||
}
|
||||
else if (targeted is Item && !((Item)targeted).Movable)
|
||||
{
|
||||
if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if (obj.Scissor(from, m_Item))
|
||||
{
|
||||
from.PlaySound(0x248);
|
||||
|
||||
if (Siege.SiegeShard)
|
||||
{
|
||||
Siege.CheckUsesRemaining(from, m_Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (targeted is IScissorable)
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if (obj.Scissor(from, m_Item))
|
||||
{
|
||||
from.PlaySound(0x248);
|
||||
|
||||
if (Siege.SiegeShard)
|
||||
{
|
||||
Siege.CheckUsesRemaining(from, m_Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502440); // Scissors can not be used on that to produce anything.
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnNonlocalTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is IScissorable && (targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore))
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if (obj.Scissor(from, m_Item))
|
||||
{
|
||||
from.PlaySound(0x248);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnNonlocalTarget(from, targeted);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/Scorp.cs
Normal file
48
Scripts/Items/Tools/Scorp.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Scorp : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Scorp()
|
||||
: base(0x10E7)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Scorp(int uses)
|
||||
: base(uses, 0x10E7)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public Scorp(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/Tools/ScribesPen.cs
Normal file
43
Scripts/Items/Tools/ScribesPen.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x0FBF, 0x0FC0)]
|
||||
public class ScribesPen : BaseTool
|
||||
{
|
||||
public override CraftSystem CraftSystem { get { return DefInscription.CraftSystem; } }
|
||||
public override int LabelNumber { get { return 1044168; } }// scribe's pen
|
||||
|
||||
[Constructable]
|
||||
public ScribesPen()
|
||||
: base(0x0FBF)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ScribesPen(int uses)
|
||||
: base(uses, 0x0FBF)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public ScribesPen(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
57
Scripts/Items/Tools/SeaChart.cs
Normal file
57
Scripts/Items/Tools/SeaChart.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SeaChart : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public SeaChart()
|
||||
{
|
||||
SetDisplay( 0, 0, 5119, 4095, 400, 400 );
|
||||
}
|
||||
|
||||
public override void CraftInit( Mobile from )
|
||||
{
|
||||
Facet = from.Map;
|
||||
|
||||
double skillValue = from.Skills[SkillName.Cartography].Value;
|
||||
int dist = 64 + (int)(skillValue * 10);
|
||||
|
||||
if ( dist < 200 )
|
||||
dist = 200;
|
||||
|
||||
int size = 24 + (int)(skillValue * 3.3);
|
||||
|
||||
if ( size < 200 )
|
||||
size = 200;
|
||||
else if ( size > 400 )
|
||||
size = 400;
|
||||
|
||||
if (Facet == Map.Trammel || Facet == Map.Felucca)
|
||||
SetDisplay(from.X - dist, from.Y - dist, from.X + dist, from.Y + dist, size, size);
|
||||
else
|
||||
SetDisplayByFacet();
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return 1015232; } } // sea chart
|
||||
|
||||
public SeaChart( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/SewingKit.cs
Normal file
48
Scripts/Items/Tools/SewingKit.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SewingKit : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public SewingKit()
|
||||
: base(0xF9D)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SewingKit(int uses)
|
||||
: base(uses, 0xF9D)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public SewingKit(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefTailoring.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
183
Scripts/Items/Tools/Sextant.cs
Normal file
183
Scripts/Items/Tools/Sextant.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Sextant : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Sextant()
|
||||
: base(0x1058)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public Sextant(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public static bool ComputeMapDetails(Map map, int x, int y, out int xCenter, out int yCenter, out int xWidth, out int yHeight)
|
||||
{
|
||||
xWidth = 5120;
|
||||
yHeight = 4096;
|
||||
|
||||
if (map == Map.Trammel || map == Map.Felucca)
|
||||
{
|
||||
if (x >= 0 && y >= 0 && x < 5120 && y < 4096)
|
||||
{
|
||||
xCenter = 1323;
|
||||
yCenter = 1624;
|
||||
}
|
||||
else if (x >= 5120 && y >= 2304 && x < 6144 && y < 4096)
|
||||
{
|
||||
xCenter = 5936;
|
||||
yCenter = 3112;
|
||||
}
|
||||
else
|
||||
{
|
||||
xCenter = 0;
|
||||
yCenter = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (x >= 0 && y >= 0 && x < map.Width && y < map.Height)
|
||||
{
|
||||
xCenter = 1323;
|
||||
yCenter = 1624;
|
||||
}
|
||||
else
|
||||
{
|
||||
xCenter = 0;
|
||||
yCenter = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Point3D ReverseLookup(Map map, int xLong, int yLat, int xMins, int yMins, bool xEast, bool ySouth)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
return Point3D.Zero;
|
||||
|
||||
int xCenter, yCenter;
|
||||
int xWidth, yHeight;
|
||||
|
||||
if (!ComputeMapDetails(map, 0, 0, out xCenter, out yCenter, out xWidth, out yHeight))
|
||||
return Point3D.Zero;
|
||||
|
||||
double absLong = xLong + ((double)xMins / 60);
|
||||
double absLat = yLat + ((double)yMins / 60);
|
||||
|
||||
if (!xEast)
|
||||
absLong = 360.0 - absLong;
|
||||
|
||||
if (!ySouth)
|
||||
absLat = 360.0 - absLat;
|
||||
|
||||
int x, y, z;
|
||||
|
||||
x = xCenter + (int)((absLong * xWidth) / 360);
|
||||
y = yCenter + (int)((absLat * yHeight) / 360);
|
||||
|
||||
if (x < 0)
|
||||
x += xWidth;
|
||||
else if (x >= xWidth)
|
||||
x -= xWidth;
|
||||
|
||||
if (y < 0)
|
||||
y += yHeight;
|
||||
else if (y >= yHeight)
|
||||
y -= yHeight;
|
||||
|
||||
z = map.GetAverageZ(x, y);
|
||||
|
||||
return new Point3D(x, y, z);
|
||||
}
|
||||
|
||||
public static bool Format(Point3D p, Map map, ref int xLong, ref int yLat, ref int xMins, ref int yMins, ref bool xEast, ref bool ySouth)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
return false;
|
||||
|
||||
int x = p.X, y = p.Y;
|
||||
int xCenter, yCenter;
|
||||
int xWidth, yHeight;
|
||||
|
||||
if (!ComputeMapDetails(map, x, y, out xCenter, out yCenter, out xWidth, out yHeight))
|
||||
return false;
|
||||
|
||||
double absLong = (double)((x - xCenter) * 360) / xWidth;
|
||||
double absLat = (double)((y - yCenter) * 360) / yHeight;
|
||||
|
||||
if (absLong > 180.0)
|
||||
absLong = -180.0 + (absLong % 180.0);
|
||||
|
||||
if (absLat > 180.0)
|
||||
absLat = -180.0 + (absLat % 180.0);
|
||||
|
||||
bool east = (absLong >= 0), south = (absLat >= 0);
|
||||
|
||||
if (absLong < 0.0)
|
||||
absLong = -absLong;
|
||||
|
||||
if (absLat < 0.0)
|
||||
absLat = -absLat;
|
||||
|
||||
xLong = (int)absLong;
|
||||
yLat = (int)absLat;
|
||||
|
||||
xMins = (int)((absLong % 1.0) * 60);
|
||||
yMins = (int)((absLat % 1.0) * 60);
|
||||
|
||||
xEast = east;
|
||||
ySouth = south;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
var coords = GetCoords(from);
|
||||
|
||||
if (!String.IsNullOrEmpty(coords))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, from.SpeechHue, false, GetCoords(from));
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCoords(IEntity e)
|
||||
{
|
||||
return GetCoords(e.Location, e.Map);
|
||||
}
|
||||
|
||||
public static string GetCoords(Point3D location, Map map)
|
||||
{
|
||||
int xLong = 0, yLat = 0;
|
||||
int xMins = 0, yMins = 0;
|
||||
bool xEast = false, ySouth = false;
|
||||
|
||||
if (Sextant.Format(location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
|
||||
{
|
||||
return String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
|
||||
}
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/Tools/Shovel.cs
Normal file
40
Scripts/Items/Tools/Shovel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Shovel : BaseHarvestTool
|
||||
{
|
||||
public override HarvestSystem HarvestSystem { get { return Mining.System; } }
|
||||
|
||||
[Constructable]
|
||||
public Shovel()
|
||||
: this(50)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Shovel(int uses)
|
||||
: base(uses, 0xF39)
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public Shovel(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
57
Scripts/Items/Tools/SkeletonKey.cs
Normal file
57
Scripts/Items/Tools/SkeletonKey.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Skeletonkey : Lockpick
|
||||
{
|
||||
public override int LabelNumber { get { return 1095522; } }
|
||||
|
||||
public override bool IsSkeletonKey { get { return true; } }
|
||||
public override int SkillBonus { get { return 10; } }
|
||||
|
||||
private int m_Uses;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Uses { get { return m_Uses; } set { m_Uses = value; InvalidateProperties(); if (m_Uses <= 0) Delete(); } }
|
||||
|
||||
[Constructable]
|
||||
public Skeletonkey() : base(1)
|
||||
{
|
||||
Stackable = false;
|
||||
ItemID = 16650;
|
||||
m_Uses = 10;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060584, m_Uses.ToString()); //uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnUse()
|
||||
{
|
||||
Uses--;
|
||||
}
|
||||
|
||||
public Skeletonkey(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
writer.Write(m_Uses);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
m_Uses = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Scripts/Items/Tools/Skillet.cs
Normal file
55
Scripts/Items/Tools/Skillet.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Skillet : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Skillet()
|
||||
: base(0x97F)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Skillet(int uses)
|
||||
: base(uses, 0x97F)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public Skillet(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1044567;
|
||||
}
|
||||
}// skillet
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCooking.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
189
Scripts/Items/Tools/SledgeHammer.cs
Normal file
189
Scripts/Items/Tools/SledgeHammer.cs
Normal file
@@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xFB5, 0xFB4)]
|
||||
public class SledgeHammer : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public SledgeHammer()
|
||||
: base(0xFB5)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SledgeHammer(int uses)
|
||||
: base(uses, 0xFB5)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
}
|
||||
|
||||
public SledgeHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SledgeHammerWeapon : BaseBashing, ITool
|
||||
{
|
||||
[Constructable]
|
||||
public SledgeHammerWeapon()
|
||||
: base(0xFB5)
|
||||
{
|
||||
Layer = Layer.OneHanded;
|
||||
ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
#region ITool Members
|
||||
public CraftSystem CraftSystem { get { return DefBlacksmithy.CraftSystem; } }
|
||||
public bool BreakOnDepletion { get { return true; } }
|
||||
|
||||
public bool CheckAccessible(Mobile m, ref int num)
|
||||
{
|
||||
if (!IsChildOf(m) && Parent != m)
|
||||
{
|
||||
num = 1044263;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public SledgeHammerWeapon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override WeaponAbility PrimaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.CrushingBlow;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility SecondaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.ParalyzingBlow;
|
||||
}
|
||||
}
|
||||
public override int AosStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
public override int AosMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
public override int AosMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 17;
|
||||
}
|
||||
}
|
||||
public override int AosSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
public override float MlSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3.25f;
|
||||
}
|
||||
}
|
||||
public override int OldStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
public override int InitMinHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 31;
|
||||
}
|
||||
}
|
||||
public override int InitMaxHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 70;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (CraftSystem != null && (IsChildOf(from.Backpack) || Parent == from))
|
||||
{
|
||||
int num = CraftSystem.CanCraft(from, this, null);
|
||||
|
||||
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
{
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftContext context = CraftSystem.GetContext(from);
|
||||
|
||||
from.SendGump(new CraftGump(from, CraftSystem, this, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
189
Scripts/Items/Tools/SmithHammer.cs
Normal file
189
Scripts/Items/Tools/SmithHammer.cs
Normal file
@@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x13E3, 0x13E4)]
|
||||
public class SmithHammer : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public SmithHammer()
|
||||
: base(0x13E3)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmithHammer(int uses)
|
||||
: base(uses, 0x13E3)
|
||||
{
|
||||
this.Weight = 8.0;
|
||||
this.Layer = Layer.OneHanded;
|
||||
}
|
||||
|
||||
public SmithHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmithyHammer : BaseBashing, ITool
|
||||
{
|
||||
[Constructable]
|
||||
public SmithyHammer()
|
||||
: base(0x13E3)
|
||||
{
|
||||
Weight = 8.0;
|
||||
ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
#region ITool Members
|
||||
public CraftSystem CraftSystem { get { return DefBlacksmithy.CraftSystem; } }
|
||||
public bool BreakOnDepletion { get { return true; } }
|
||||
|
||||
public bool CheckAccessible(Mobile m, ref int num)
|
||||
{
|
||||
if (!IsChildOf(m) && Parent != m)
|
||||
{
|
||||
num = 1044263;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public SmithyHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override WeaponAbility PrimaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.CrushingBlow;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility SecondaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.ParalyzingBlow;
|
||||
}
|
||||
}
|
||||
public override int AosStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int AosMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
public override int AosMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 17;
|
||||
}
|
||||
}
|
||||
public override int AosSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
public override float MlSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3.25f;
|
||||
}
|
||||
}
|
||||
public override int OldStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
public override int InitMinHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 31;
|
||||
}
|
||||
}
|
||||
public override int InitMaxHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 70;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.CraftSystem != null && (IsChildOf(from.Backpack) || Parent == from))
|
||||
{
|
||||
int num = this.CraftSystem.CanCraft(from, this, null);
|
||||
|
||||
if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
|
||||
{
|
||||
from.SendLocalizedMessage(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftContext context = this.CraftSystem.GetContext(from);
|
||||
|
||||
from.SendGump(new CraftGump(from, this.CraftSystem, this, null));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/SmoothingPlane.cs
Normal file
49
Scripts/Items/Tools/SmoothingPlane.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x1032, 0x1033)]
|
||||
public class SmoothingPlane : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public SmoothingPlane()
|
||||
: base(0x1032)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmoothingPlane(int uses)
|
||||
: base(uses, 0x1032)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public SmoothingPlane(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefCarpentry.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
86
Scripts/Items/Tools/SpecialDyeTub.cs
Normal file
86
Scripts/Items/Tools/SpecialDyeTub.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SpecialDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public SpecialDyeTub()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public SpecialDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CustomHuePicker CustomHuePicker
|
||||
{
|
||||
get
|
||||
{
|
||||
return CustomHuePicker.SpecialDyeTub;
|
||||
}
|
||||
}
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041285;
|
||||
}
|
||||
}// Special Dye Tub
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076217); // 1st Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
149
Scripts/Items/Tools/Spyglass.cs
Normal file
149
Scripts/Items/Tools/Spyglass.cs
Normal file
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using Server.Engines.Quests;
|
||||
using Server.Engines.Quests.Hag;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x14F5, 0x14F6)]
|
||||
public class Spyglass : Item, IResource, IQuality
|
||||
{
|
||||
private CraftResource _Resource;
|
||||
private Mobile _Crafter;
|
||||
private ItemQuality _Quality;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource { get { return _Resource; } set { _Resource = value; _Resource = value; Hue = CraftResources.GetHue(_Resource); InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Crafter { get { return _Crafter; } set { _Crafter = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public ItemQuality Quality { get { return _Quality; } set { _Quality = value; InvalidateProperties(); } }
|
||||
|
||||
public bool PlayerConstructed { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Spyglass()
|
||||
: base(0x14F5)
|
||||
{
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public Spyglass(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1008155); // You peer into the heavens, seeking the moons...
|
||||
|
||||
from.Send(new MessageLocalizedAffix(from.NetState, from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ", ""));
|
||||
from.Send(new MessageLocalizedAffix(from.NetState, from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y), "", AffixType.Prepend, "Felucca : ", ""));
|
||||
|
||||
PlayerMobile player = from as PlayerMobile;
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
QuestSystem qs = player.Quest;
|
||||
|
||||
if (qs is WitchApprenticeQuest)
|
||||
{
|
||||
FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;
|
||||
|
||||
if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.StarChart)
|
||||
{
|
||||
int hours, minutes;
|
||||
Clock.GetTime(from.Map, from.X, from.Y, out hours, out minutes);
|
||||
|
||||
if (hours < 5 || hours > 17)
|
||||
{
|
||||
player.SendLocalizedMessage(1055040); // You gaze up into the glittering night sky. With great care, you compose a chart of the most prominent star patterns.
|
||||
|
||||
obj.Complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
player.SendLocalizedMessage(1055039); // You gaze up into the sky, but it is not dark enough to see any stars.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
if (_Crafter != null)
|
||||
{
|
||||
list.Add(1050043, _Crafter.TitleName); // crafted by ~1_NAME~
|
||||
}
|
||||
|
||||
if (_Quality == ItemQuality.Exceptional)
|
||||
{
|
||||
list.Add(1060636); // Exceptional
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_Resource > CraftResource.Iron)
|
||||
{
|
||||
list.Add(1053099, "#{0}\t{1}", CraftResources.GetLocalizationNumber(_Resource), String.Format("#{0}", LabelNumber.ToString())); // ~1_oretype~ ~2_armortype~
|
||||
}
|
||||
else
|
||||
{
|
||||
base.AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
Quality = (ItemQuality)quality;
|
||||
|
||||
if (makersMark)
|
||||
Crafter = from;
|
||||
|
||||
if (!craftItem.ForceNonExceptional)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
}
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
writer.Write(_Crafter);
|
||||
writer.Write((int)_Quality);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
_Crafter = reader.ReadMobile();
|
||||
_Quality = (ItemQuality)reader.ReadInt();
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
277
Scripts/Items/Tools/StaffOrb.cs
Normal file
277
Scripts/Items/Tools/StaffOrb.cs
Normal file
@@ -0,0 +1,277 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CustomsFramework;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
/// <summary>
|
||||
/// David O'Hara
|
||||
/// 08-13-2004
|
||||
/// Version 3.0
|
||||
/// This orb allows staff to switch between a Player access level and their current staff level.
|
||||
/// It also sets the mortality as appropriate for staff.
|
||||
/// A home location can be set/used thru the context menu.
|
||||
/// Will auto resurrect it's owner on death.
|
||||
/// </summary>
|
||||
public class StaffOrb : Item
|
||||
{
|
||||
public Point3D m_HomeLocation;
|
||||
public Map m_HomeMap;
|
||||
private Mobile m_Owner;
|
||||
private AccessLevel m_StaffLevel;
|
||||
private bool m_AutoRes = true;
|
||||
[Constructable]
|
||||
public StaffOrb()
|
||||
: base(0x0E2F)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 0;
|
||||
Name = "Unassigned Staff Orb";
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StaffOrb(Mobile player)
|
||||
: base(0x0E2F)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 0;
|
||||
m_Owner = player;
|
||||
Name = player.Name + "'s Staff Orb";
|
||||
}
|
||||
|
||||
public StaffOrb(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public Point3D HomeLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_HomeLocation;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_HomeLocation = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public Map HomeMap
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_HomeMap;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_HomeMap = value;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public bool AutoRes
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_AutoRes;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_AutoRes = value;
|
||||
}
|
||||
}
|
||||
public static void GetContextMenuEntries(Mobile from, Item item, List<ContextMenuEntry> list)
|
||||
{
|
||||
list.Add(new GoHomeEntry(from, item));
|
||||
list.Add(new SetHomeEntry(from, item));
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
if (m_Owner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Owner != from)
|
||||
{
|
||||
from.SendMessage("This is not yours to use.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
StaffOrb.GetContextMenuEntries(from, this, list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override DeathMoveResult OnInventoryDeath(Mobile parent)
|
||||
{
|
||||
if (m_AutoRes && parent == m_Owner)
|
||||
{
|
||||
SwitchAccessLevels(parent);
|
||||
new AutoResTimer(parent).Start();
|
||||
}
|
||||
return base.OnInventoryDeath(parent);
|
||||
}
|
||||
|
||||
|
||||
public override void OnDoubleClickDead(Mobile from)
|
||||
{
|
||||
if (m_Owner == from)
|
||||
{
|
||||
OnDoubleClick(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnDoubleClickDead(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
// set owner if not already set -- this is only done the first time.
|
||||
if (m_Owner == null)
|
||||
{
|
||||
m_Owner = from;
|
||||
Name = m_Owner.Name.ToString() + "'s Staff Orb";
|
||||
HomeLocation = from.Location;
|
||||
HomeMap = from.Map;
|
||||
from.SendMessage("This orb has been assigned to you.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_Owner != from)
|
||||
{
|
||||
from.SendMessage("This is not your's to use.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
SwitchAccessLevels(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)3); // version
|
||||
|
||||
// version 3
|
||||
writer.Write(m_AutoRes);
|
||||
|
||||
// version 2
|
||||
writer.Write(m_HomeLocation);
|
||||
writer.Write(m_HomeMap);
|
||||
|
||||
writer.Write(m_Owner);
|
||||
writer.WriteEncodedInt((int)m_StaffLevel);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
switch ( version )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
m_AutoRes = reader.ReadBool();
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_HomeLocation = reader.ReadPoint3D();
|
||||
m_HomeMap = reader.ReadMap();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_Owner = reader.ReadMobile();
|
||||
m_StaffLevel = (AccessLevel)reader.ReadEncodedInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SwitchAccessLevels(Mobile from)
|
||||
{
|
||||
// check current access level
|
||||
if (Utilities.IsPlayer(from))
|
||||
{
|
||||
// return to staff status
|
||||
from.AccessLevel = m_StaffLevel;
|
||||
from.Blessed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_StaffLevel = from.AccessLevel;
|
||||
from.AccessLevel = AccessLevel.Player;
|
||||
from.Blessed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private class GoHomeEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly StaffOrb m_Item;
|
||||
private readonly Mobile m_Mobile;
|
||||
public GoHomeEntry(Mobile from, Item item)
|
||||
: base(5134)// uses "Goto Loc" entry
|
||||
{
|
||||
m_Item = (StaffOrb)item;
|
||||
m_Mobile = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
// go to home location
|
||||
m_Mobile.Location = m_Item.HomeLocation;
|
||||
if (m_Item.HomeMap != null)
|
||||
m_Mobile.Map = m_Item.HomeMap;
|
||||
}
|
||||
}
|
||||
|
||||
private class SetHomeEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly StaffOrb m_Item;
|
||||
private readonly Mobile m_Mobile;
|
||||
public SetHomeEntry(Mobile from, Item item)
|
||||
: base(2055)// uses "Mark" entry
|
||||
{
|
||||
m_Item = (StaffOrb)item;
|
||||
m_Mobile = from;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
// set home location
|
||||
m_Item.HomeLocation = m_Mobile.Location;
|
||||
m_Item.HomeMap = m_Mobile.Map;
|
||||
m_Mobile.SendMessage("The home location on your orb has been set to your current position.");
|
||||
}
|
||||
}
|
||||
|
||||
private class AutoResTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Mobile;
|
||||
public AutoResTimer(Mobile mob)
|
||||
: base(TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_Mobile = mob;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_Mobile.Resurrect();
|
||||
m_Mobile.SendMessage("...How in the hell did you manage to die? You're a staff member!");
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Items/Tools/StatuetteDyeTub.cs
Normal file
114
Scripts/Items/Tools/StatuetteDyeTub.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StatuetteDyeTub : DyeTub, Engines.VeteranRewards.IRewardItem
|
||||
{
|
||||
private bool m_IsRewardItem;
|
||||
[Constructable]
|
||||
public StatuetteDyeTub()
|
||||
{
|
||||
this.LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public StatuetteDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool AllowDyables
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override bool AllowStatuettes
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public override int TargetMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049777;
|
||||
}
|
||||
}// Target the statuette to dye
|
||||
public override int FailMessage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049778;
|
||||
}
|
||||
}// You can only dye veteran reward statuettes with this tub.
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1049741;
|
||||
}
|
||||
}// Reward Statuette Dye Tub
|
||||
public override CustomHuePicker CustomHuePicker
|
||||
{
|
||||
get
|
||||
{
|
||||
return CustomHuePicker.LeatherDyeTub;
|
||||
}
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_IsRewardItem;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_IsRewardItem = value;
|
||||
}
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (this.m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
|
||||
return;
|
||||
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Core.ML && this.m_IsRewardItem)
|
||||
list.Add(1076221); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1); // version
|
||||
|
||||
writer.Write((bool)this.m_IsRewardItem);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
this.m_IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Tools/SteamPoweredBeverageMaker.cs
Normal file
33
Scripts/Items/Tools/SteamPoweredBeverageMaker.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SteamPoweredBeverageMaker : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1123598; } } // Steam Powered Beverage Maker
|
||||
|
||||
[Constructable]
|
||||
public SteamPoweredBeverageMaker()
|
||||
: base(0x9A96)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public SteamPoweredBeverageMaker(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);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
157
Scripts/Items/Tools/SturdyPickaxe.cs
Normal file
157
Scripts/Items/Tools/SturdyPickaxe.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SturdyPickaxe : BaseAxe, IUsesRemaining
|
||||
{
|
||||
[Constructable]
|
||||
public SturdyPickaxe()
|
||||
: this(180)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SturdyPickaxe(int uses)
|
||||
: base(0xE86)
|
||||
{
|
||||
Weight = 11.0;
|
||||
Hue = 0x973;
|
||||
UsesRemaining = uses;
|
||||
ShowUsesRemaining = true;
|
||||
}
|
||||
|
||||
public SturdyPickaxe(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1045126;
|
||||
}
|
||||
}// sturdy pickaxe
|
||||
public override HarvestSystem HarvestSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mining.System;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility PrimaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.DoubleStrike;
|
||||
}
|
||||
}
|
||||
public override WeaponAbility SecondaryAbility
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAbility.Disarm;
|
||||
}
|
||||
}
|
||||
public override int AosStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
}
|
||||
public override int AosMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
}
|
||||
public override int AosMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
public override int AosSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 35;
|
||||
}
|
||||
}
|
||||
public override float MlSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3.00f;
|
||||
}
|
||||
}
|
||||
public override int OldStrengthReq
|
||||
{
|
||||
get
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
}
|
||||
public override int OldMinDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
public override int OldMaxDamage
|
||||
{
|
||||
get
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
}
|
||||
public override int OldSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
return 35;
|
||||
}
|
||||
}
|
||||
|
||||
public override int InitMinHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 31;
|
||||
}
|
||||
}
|
||||
public override int InitMaxHits
|
||||
{
|
||||
get
|
||||
{
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
|
||||
public override WeaponAnimation DefAnimation
|
||||
{
|
||||
get
|
||||
{
|
||||
return WeaponAnimation.Slash1H;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Scripts/Items/Tools/SturdyShovel.cs
Normal file
55
Scripts/Items/Tools/SturdyShovel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SturdyShovel : BaseHarvestTool
|
||||
{
|
||||
[Constructable]
|
||||
public SturdyShovel()
|
||||
: this(180)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SturdyShovel(int uses)
|
||||
: base(uses, 0xF39)
|
||||
{
|
||||
this.Weight = 5.0;
|
||||
this.Hue = 0x973;
|
||||
}
|
||||
|
||||
public SturdyShovel(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1045125;
|
||||
}
|
||||
}// sturdy shovel
|
||||
public override HarvestSystem HarvestSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return Mining.System;
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
163
Scripts/Items/Tools/TinkerTools.cs
Normal file
163
Scripts/Items/Tools/TinkerTools.cs
Normal file
@@ -0,0 +1,163 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
using Server.ContextMenus;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x1EB8, 0x1EB9)]
|
||||
public class TinkerTools : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public TinkerTools()
|
||||
: base(0x1EB8)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TinkerTools(int uses)
|
||||
: base(uses, 0x1EB8)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public TinkerTools(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefTinkering.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Core.TOL)
|
||||
list.Add(new ToggleRepairContextMenuEntry(from, this));
|
||||
}
|
||||
|
||||
public class ToggleRepairContextMenuEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile _From;
|
||||
private BaseTool _Tool;
|
||||
|
||||
public ToggleRepairContextMenuEntry(Mobile from, BaseTool tool)
|
||||
: base(1157040) // Toggle Repair Mode
|
||||
{
|
||||
_From = from;
|
||||
_Tool = tool;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (_Tool.RepairMode)
|
||||
{
|
||||
_From.SendLocalizedMessage(1157042); // This tool is fully functional.
|
||||
_Tool.RepairMode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_From.SendLocalizedMessage(1157041); // This tool will only repair items in this mode.
|
||||
_Tool.RepairMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TinkersTools : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public TinkersTools()
|
||||
: base(0x1EBC)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TinkersTools(int uses)
|
||||
: base(uses, 0x1EBC)
|
||||
{
|
||||
this.Weight = 1.0;
|
||||
}
|
||||
|
||||
public TinkersTools(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefTinkering.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, System.Collections.Generic.List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (Core.TOL)
|
||||
list.Add(new ToggleRepairContextMenuEntry(from, this));
|
||||
}
|
||||
|
||||
public class ToggleRepairContextMenuEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile _From;
|
||||
private BaseTool _Tool;
|
||||
|
||||
public ToggleRepairContextMenuEntry(Mobile from, BaseTool tool)
|
||||
: base(1157040) // Toggle Repair Mode
|
||||
{
|
||||
_From = from;
|
||||
_Tool = tool;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (_Tool.RepairMode)
|
||||
{
|
||||
_From.SendLocalizedMessage(1157042); // This tool is fully functional.
|
||||
_Tool.RepairMode = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_From.SendLocalizedMessage(1157041); // This tool will only repair items in this mode.
|
||||
_Tool.RepairMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/Tongs.cs
Normal file
49
Scripts/Items/Tools/Tongs.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xfbb, 0xfbc)]
|
||||
public class Tongs : BaseTool
|
||||
{
|
||||
[Constructable]
|
||||
public Tongs()
|
||||
: base(0xFBB)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Tongs(int uses)
|
||||
: base(uses, 0xFBB)
|
||||
{
|
||||
this.Weight = 2.0;
|
||||
}
|
||||
|
||||
public Tongs(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefBlacksmithy.CraftSystem;
|
||||
}
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Items/Tools/WeaponEngravingTool.cs
Normal file
48
Scripts/Items/Tools/WeaponEngravingTool.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WeaponEngravingTool : BaseEngravingTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1076158; } } // Weapon 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 1076224; } } // 8th Year Veteran Reward
|
||||
|
||||
[Constructable]
|
||||
public WeaponEngravingTool()
|
||||
: base(0x32F8, 10)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
public WeaponEngravingTool(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Type[] Engraves
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Type[]
|
||||
{
|
||||
typeof(BaseWeapon)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Tools/WhiteLeatherDyeTub.cs
Normal file
33
Scripts/Items/Tools/WhiteLeatherDyeTub.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WhiteLeatherDyeTub : LeatherDyeTub
|
||||
{
|
||||
public override int LabelNumber { get { return 1149900; } } // White Leather Dye Tub
|
||||
|
||||
[Constructable]
|
||||
public WhiteLeatherDyeTub()
|
||||
{
|
||||
Hue = DyedHue = 2498;
|
||||
Redyable = false;
|
||||
}
|
||||
|
||||
public WhiteLeatherDyeTub(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Scripts/Items/Tools/WorldMap.cs
Normal file
63
Scripts/Items/Tools/WorldMap.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WorldMap : MapItem
|
||||
{
|
||||
[Constructable]
|
||||
public WorldMap()
|
||||
{
|
||||
SetDisplay( 0, 0, 5119, 4095, 400, 400 );
|
||||
}
|
||||
|
||||
public override void CraftInit( Mobile from )
|
||||
{
|
||||
// Unlike the others, world map is not based on crafted location
|
||||
Facet = from.Map;
|
||||
|
||||
double skillValue = from.Skills[SkillName.Cartography].Value;
|
||||
int x20 = (int)(skillValue * 20);
|
||||
int size = 25 + (int)(skillValue * 6.6);
|
||||
|
||||
if ( size < 200 )
|
||||
size = 200;
|
||||
else if ( size > 400 )
|
||||
size = 400;
|
||||
|
||||
if (Facet == Map.Trammel || Facet == Map.Felucca)
|
||||
{
|
||||
if (Server.Spells.SpellHelper.IsAnyT2A(Facet, from.Location))
|
||||
{
|
||||
Bounds = new Rectangle2D(5120, 2304, 1024, 1792);
|
||||
Width = size;
|
||||
Height = size;
|
||||
}
|
||||
else
|
||||
SetDisplay(1344 - x20, 1600 - x20, 1472 + x20, 1728 + x20, size, size);
|
||||
}
|
||||
else
|
||||
SetDisplayByFacet();
|
||||
}
|
||||
|
||||
public override int LabelNumber{ get{ return 1015233; } } // world map
|
||||
|
||||
public WorldMap( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Items/Tools/WristWatch.cs
Normal file
49
Scripts/Items/Tools/WristWatch.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WristWatch : Clock
|
||||
{
|
||||
[Constructable]
|
||||
public WristWatch()
|
||||
: base(0x1086)
|
||||
{
|
||||
this.Weight = this.DefaultWeight;
|
||||
this.LootType = LootType.Blessed;
|
||||
this.Layer = Layer.Bracelet;
|
||||
}
|
||||
|
||||
public WristWatch(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1041421;
|
||||
}
|
||||
}// a wrist watch
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user