Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
50
Scripts/Items/StoreBought/AbyssalHairDye.cs
Normal file
50
Scripts/Items/StoreBought/AbyssalHairDye.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AbyssalHairDye : Item
|
||||
{
|
||||
[Constructable]
|
||||
public AbyssalHairDye()
|
||||
: base(0xEFE)
|
||||
{
|
||||
Hue = 2075;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public AbyssalHairDye(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
BaseGump.SendGump(new HairDyeConfirmGump(m as PlayerMobile, Hue, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042010); //You must have the object in your backpack to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1149822; } } // Abyssal Hair Dye
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
150
Scripts/Items/StoreBought/AncestralGravestone.cs
Normal file
150
Scripts/Items/StoreBought/AncestralGravestone.cs
Normal file
@@ -0,0 +1,150 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0x1173, 0x1174)]
|
||||
public class AncestralGravestone : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1071096; } } // Ancestral Gravestone
|
||||
|
||||
[Constructable]
|
||||
public AncestralGravestone()
|
||||
: base(0x1173)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
//TODO: Clilocs?
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && house.IsFriend(m) && (IsLockedDown || IsSecure))
|
||||
{
|
||||
if (IsInCooldown(m))
|
||||
{
|
||||
TimeSpan tsRem = _Cooldown[m] - DateTime.UtcNow;
|
||||
|
||||
m.SendLocalizedMessage(1071505, ((int)tsRem.TotalMinutes).ToString()); // In order to get a buff again, you have to wait for at least ~1_VAL~ minutes.
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBonus(m);
|
||||
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, SkillMod> _Table;
|
||||
private static Dictionary<Mobile, DateTime> _Cooldown;
|
||||
private static Timer _Timer;
|
||||
|
||||
public static bool UnderEffects(Mobile m)
|
||||
{
|
||||
return _Table != null && _Table.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static void AddBonus(Mobile m)
|
||||
{
|
||||
if (_Table == null)
|
||||
_Table = new Dictionary<Mobile, SkillMod>();
|
||||
|
||||
var mod = new DefaultSkillMod(SkillName.SpiritSpeak, true, 5.0);
|
||||
_Table[m] = mod;
|
||||
|
||||
m.AddSkillMod(mod);
|
||||
AddToCooldown(m);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(Utility.RandomMinMax(5, 40)), ExpireBonus, new object[] { m, mod });
|
||||
}
|
||||
|
||||
public static void ExpireBonus(object o)
|
||||
{
|
||||
object[] objects = (object[])o;
|
||||
Mobile mob = objects[0] as Mobile;
|
||||
SkillMod sm = objects[1] as SkillMod;
|
||||
|
||||
mob.RemoveSkillMod(sm);
|
||||
}
|
||||
|
||||
public static bool IsInCooldown(Mobile m)
|
||||
{
|
||||
if (UnderEffects(m))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CheckCooldown();
|
||||
|
||||
return _Cooldown != null && _Cooldown.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static void AddToCooldown(Mobile m)
|
||||
{
|
||||
if (_Cooldown == null)
|
||||
_Cooldown = new Dictionary<Mobile, DateTime>();
|
||||
|
||||
_Cooldown[m] = DateTime.UtcNow + TimeSpan.FromMinutes(90);
|
||||
|
||||
if (_Timer != null)
|
||||
{
|
||||
_Timer = Timer.DelayCall(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), CheckCooldown);
|
||||
_Timer.Priority = TimerPriority.FiveSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckCooldown()
|
||||
{
|
||||
if (_Cooldown == null)
|
||||
return;
|
||||
|
||||
List<Mobile> list = new List<Mobile>(_Cooldown.Keys);
|
||||
|
||||
foreach (var m in list)
|
||||
{
|
||||
if (_Cooldown[m] < DateTime.UtcNow)
|
||||
{
|
||||
_Cooldown.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
if (_Cooldown.Count == 0)
|
||||
{
|
||||
_Cooldown = null;
|
||||
|
||||
if (_Timer != null)
|
||||
{
|
||||
_Timer.Stop();
|
||||
_Timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
ColUtility.Free(list);
|
||||
}
|
||||
|
||||
public AncestralGravestone(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/StoreBought/ArmorEngravingToolToken.cs
Normal file
43
Scripts/Items/StoreBought/ArmorEngravingToolToken.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ArmorEngravingToolToken : PromotionalToken
|
||||
{
|
||||
public override TextDefinition ItemName { get { return 1080547; } } // Armor Engraving Tool
|
||||
public override TextDefinition ItemReceiveMessage { get { return 1072223; } } // An item has been placed in your backpack.
|
||||
public override TextDefinition ItemGumpName { get { return 1071163; } } // <center>Armor Engraving Tool</center>
|
||||
|
||||
public override bool PlaceInBank { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public ArmorEngravingToolToken()
|
||||
{
|
||||
}
|
||||
|
||||
public override Item CreateItemFor(Mobile from)
|
||||
{
|
||||
return new ArmorEngravingTool();
|
||||
}
|
||||
|
||||
public ArmorEngravingToolToken(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Items/StoreBought/BarrelMailbox.cs
Normal file
39
Scripts/Items/StoreBought/BarrelMailbox.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
public class BarrelMailbox : Mailbox, IFlipable
|
||||
{
|
||||
public override int LabelNumber { get { return 1113927; } } // Mailbox
|
||||
public override int DefaultGumpID { get { return 0x6D5; } }
|
||||
|
||||
public override int SouthMailBoxID { get { return 0xA1F8; } }
|
||||
public override int SouthEmptyMailBoxID { get { return 0xA1F9; } }
|
||||
public override int EastMailBoxID { get { return 0xA1F5; } }
|
||||
public override int EastEmptyMailBoxID { get { return 0xA1F7; } }
|
||||
|
||||
[Constructable]
|
||||
public BarrelMailbox()
|
||||
: base(0xA1F7)
|
||||
{
|
||||
}
|
||||
|
||||
public BarrelMailbox(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
285
Scripts/Items/StoreBought/BulkOrderBookCover.cs
Normal file
285
Scripts/Items/StoreBought/BulkOrderBookCover.cs
Normal file
@@ -0,0 +1,285 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Engines.BulkOrders;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum CoverType
|
||||
{
|
||||
Normal,
|
||||
DullCopper,
|
||||
ShadowIron,
|
||||
Copper,
|
||||
Bronze,
|
||||
Gold,
|
||||
Agapite,
|
||||
Verite,
|
||||
Valorite,
|
||||
Spined,
|
||||
Horned,
|
||||
Barbed,
|
||||
Oak,
|
||||
Ash,
|
||||
Yew,
|
||||
Heartwood,
|
||||
Bloodwood,
|
||||
Frostwood,
|
||||
Alchemy,
|
||||
Blacksmith,
|
||||
Cooking,
|
||||
Fletching,
|
||||
Carpentry,
|
||||
Inscription,
|
||||
Tailoring,
|
||||
Tinkering
|
||||
}
|
||||
|
||||
public class CoverInfo
|
||||
{
|
||||
public static List<CoverInfo> Infos { get; private set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Infos = new List<CoverInfo>();
|
||||
|
||||
Infos.Add(new CoverInfo(CoverType.Normal, 1071097, 0));
|
||||
Infos.Add(new CoverInfo(CoverType.DullCopper, 1071101, CraftResources.GetHue(CraftResource.DullCopper)));
|
||||
Infos.Add(new CoverInfo(CoverType.ShadowIron, 1071107, CraftResources.GetHue(CraftResource.ShadowIron)));
|
||||
Infos.Add(new CoverInfo(CoverType.Copper, 1071108, CraftResources.GetHue(CraftResource.Copper)));
|
||||
Infos.Add(new CoverInfo(CoverType.Bronze, 1071109, CraftResources.GetHue(CraftResource.Bronze)));
|
||||
Infos.Add(new CoverInfo(CoverType.Gold, 1071112, CraftResources.GetHue(CraftResource.Gold)));
|
||||
Infos.Add(new CoverInfo(CoverType.Agapite, 1071113, CraftResources.GetHue(CraftResource.Agapite)));
|
||||
Infos.Add(new CoverInfo(CoverType.Verite, 1071114, CraftResources.GetHue(CraftResource.Verite)));
|
||||
Infos.Add(new CoverInfo(CoverType.Valorite, 1071115, CraftResources.GetHue(CraftResource.Valorite)));
|
||||
Infos.Add(new CoverInfo(CoverType.Spined, 1071098, CraftResources.GetHue(CraftResource.SpinedLeather)));
|
||||
Infos.Add(new CoverInfo(CoverType.Horned, 1071099, CraftResources.GetHue(CraftResource.HornedLeather)));
|
||||
Infos.Add(new CoverInfo(CoverType.Barbed, 1071100, CraftResources.GetHue(CraftResource.BarbedLeather)));
|
||||
Infos.Add(new CoverInfo(CoverType.Oak, 1071410, CraftResources.GetHue(CraftResource.OakWood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Ash, 1071411, CraftResources.GetHue(CraftResource.AshWood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Yew, 1071412, CraftResources.GetHue(CraftResource.YewWood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Heartwood, 1071413, CraftResources.GetHue(CraftResource.Heartwood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Bloodwood, 1071414, CraftResources.GetHue(CraftResource.Bloodwood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Frostwood, 1071415, CraftResources.GetHue(CraftResource.Frostwood)));
|
||||
Infos.Add(new CoverInfo(CoverType.Alchemy, 1157605, 2505, 1002000));
|
||||
Infos.Add(new CoverInfo(CoverType.Blacksmith, 1157605, 0x44E, 1157607));
|
||||
Infos.Add(new CoverInfo(CoverType.Cooking, 1157605, 1169, 1002063));
|
||||
Infos.Add(new CoverInfo(CoverType.Fletching, 1157605, 1425, 1002047));
|
||||
Infos.Add(new CoverInfo(CoverType.Carpentry, 1157605, 1512, 1002054));
|
||||
Infos.Add(new CoverInfo(CoverType.Inscription, 1157605, 2598, 1002090));
|
||||
Infos.Add(new CoverInfo(CoverType.Tailoring, 1157605, 0x483, 1002155));
|
||||
Infos.Add(new CoverInfo(CoverType.Tinkering, 1157605, 1109, 1002162));
|
||||
}
|
||||
|
||||
public CoverType Type { get; private set; }
|
||||
public TextDefinition Label { get; private set; }
|
||||
public int Hue { get; private set; }
|
||||
public TextDefinition Args { get; private set; }
|
||||
|
||||
public CoverInfo(CoverType type, TextDefinition label, int hue, TextDefinition args = null)
|
||||
{
|
||||
Type = type;
|
||||
Label = label;
|
||||
Hue = hue;
|
||||
Args = args;
|
||||
}
|
||||
}
|
||||
|
||||
public class BulkOrderBookCover : Item
|
||||
{
|
||||
private CoverType _CoverType;
|
||||
private int _UsesRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CoverType CoverType
|
||||
{
|
||||
get { return _CoverType; }
|
||||
set
|
||||
{
|
||||
var current = _CoverType;
|
||||
|
||||
if (current != value)
|
||||
{
|
||||
_CoverType = value;
|
||||
InvalidateHue();
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining { get { return _UsesRemaining; } set { _UsesRemaining = value; InvalidateProperties(); } }
|
||||
|
||||
[Constructable]
|
||||
public BulkOrderBookCover(CoverType type)
|
||||
: this(type, 30)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BulkOrderBookCover(CoverType type, int uses)
|
||||
: base(0x2831)
|
||||
{
|
||||
UsesRemaining = uses;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
CoverType = type;
|
||||
}
|
||||
|
||||
public BulkOrderBookCover(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void InvalidateHue()
|
||||
{
|
||||
var info = CoverInfo.Infos.FirstOrDefault(x => x.Type == _CoverType);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
Hue = info.Hue;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
var info = CoverInfo.Infos.FirstOrDefault(x => x.Type == _CoverType);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
if (info.Args != null)
|
||||
{
|
||||
list.Add(1157605, info.Args.ToString()); // Bulk Order Cover (~1_HUE~)
|
||||
}
|
||||
else if (info.Label.Number > 0)
|
||||
{
|
||||
list.Add(info.Label.Number);
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(1114057, info.Label.ToString()); // ~1_val~
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(1071097); // Bulk Order Cover (Normal)
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060584, _UsesRemaining.ToString()); // uses remaining: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1071121); // Select the bulk order book you want to replace a cover.
|
||||
from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
|
||||
{
|
||||
if (targeted is BulkOrderBook)
|
||||
{
|
||||
var bob = (BulkOrderBook)targeted;
|
||||
|
||||
if (bob.IsChildOf(m.Backpack))
|
||||
{
|
||||
if (bob.Hue != Hue)
|
||||
{
|
||||
bob.Hue = Hue;
|
||||
UsesRemaining--;
|
||||
|
||||
m.SendLocalizedMessage(1071119); // You have successfully given the bulk order book a new cover.
|
||||
m.PlaySound(0x048);
|
||||
|
||||
if (UsesRemaining <= 0)
|
||||
{
|
||||
m.SendLocalizedMessage(1071120); // You have used up all the bulk order book covers.
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071122); // You cannot cover it with same color.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071117); // You cannot use this item for it.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071118); // You can only cover a bulk order book with this item.
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write(_UsesRemaining);
|
||||
writer.Write((int)_CoverType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
_UsesRemaining = reader.ReadInt();
|
||||
_CoverType = (CoverType)reader.ReadInt();
|
||||
break;
|
||||
case 0:
|
||||
_UsesRemaining = 30;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BagOfBulkOrderCovers : Bag
|
||||
{
|
||||
public override int LabelNumber { get { return 1071116; } } // Bag of bulk order covers
|
||||
|
||||
public BagOfBulkOrderCovers(int start, int end)
|
||||
{
|
||||
for(int i = start; i <= end; i++)
|
||||
{
|
||||
if (i >= 0 && i < CoverInfo.Infos.Count)
|
||||
{
|
||||
DropItem(new BulkOrderBookCover(CoverInfo.Infos[i].Type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BagOfBulkOrderCovers(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/StoreBought/CharacterReincarnationToken.cs
Normal file
49
Scripts/Items/StoreBought/CharacterReincarnationToken.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CharacterReincarnationToken : PromotionalToken
|
||||
{
|
||||
public override TextDefinition ItemName { get { return 1156612; } } // Character Reincarnation
|
||||
public override TextDefinition ItemReceiveMessage { get { return null; } }
|
||||
public override TextDefinition ItemGumpName { get { return "<center>Character Reincarnation</center>"; } }
|
||||
|
||||
public override bool PlaceInBank { get { return false; } }
|
||||
|
||||
[Constructable]
|
||||
public CharacterReincarnationToken()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override Item CreateItemFor(Mobile from)
|
||||
{
|
||||
var bag = new Bag();
|
||||
|
||||
bag.DropItem(new GenderChangeToken());
|
||||
bag.DropItem(new NameChangeToken());
|
||||
bag.DropItem(new RaceChangeToken());
|
||||
|
||||
return bag;
|
||||
}
|
||||
|
||||
public CharacterReincarnationToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/StoreBought/CommemorativeRobe.cs
Normal file
36
Scripts/Items/StoreBought/CommemorativeRobe.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CommemorativeRobe : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber { get { return 1157009; } } // Commemorative Robe
|
||||
|
||||
[Constructable]
|
||||
public CommemorativeRobe()
|
||||
: base(0x4B9D)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CommemorativeRobe(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xA4EA, 0xA4EB)]
|
||||
public class DecorativeDungeonChair : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159470; } } // decorative dungeon chair
|
||||
|
||||
[Constructable]
|
||||
public DecorativeDungeonChair()
|
||||
: base(0xA4EA)
|
||||
{
|
||||
Weight = 1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeDungeonChair(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xA4EF, 0xA4F0)]
|
||||
public class DecorativeDungeonMask : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159473; } } // decorative dungeon mask
|
||||
|
||||
[Constructable]
|
||||
public DecorativeDungeonMask()
|
||||
: base(0xA4EF)
|
||||
{
|
||||
Weight = 1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeDungeonMask(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeDungeonStool : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159471; } } // decorative dungeon stool
|
||||
|
||||
[Constructable]
|
||||
public DecorativeDungeonStool()
|
||||
: base(0xA4EC)
|
||||
{
|
||||
Weight = 1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeDungeonStool(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xA4ED, 0xA4EE)]
|
||||
public class DecorativeStocks : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159472; } } // decorative stocks
|
||||
|
||||
[Constructable]
|
||||
public DecorativeStocks()
|
||||
: base(0xA4ED)
|
||||
{
|
||||
Weight = 1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeStocks(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Flipable(0xA4E8, 0xA4E9)]
|
||||
public class DecorativeWallHook : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1159469; } } // decorative wall hook
|
||||
|
||||
[Constructable]
|
||||
public DecorativeWallHook()
|
||||
: base(0xA4E8)
|
||||
{
|
||||
Weight = 1;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeWallHook(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
113
Scripts/Items/StoreBought/Decorative Dungeon Set/DungeonBull.cs
Normal file
113
Scripts/Items/StoreBought/Decorative Dungeon Set/DungeonBull.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DungeonBullAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DungeonBullDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public DungeonBullAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DungeonBullAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east)
|
||||
{
|
||||
AddComponent(new AddonComponent(42247), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(42246), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(42245), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(42249), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(42248), 1, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new AddonComponent(42237), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(42236), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(42235), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(42239), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(42238), -1, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public DungeonBullAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DungeonBullDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1159467; } } // Dungeon Bull
|
||||
public override BaseAddon Addon { get { return new DungeonBullAddon(m_East); } }
|
||||
|
||||
private bool m_East;
|
||||
|
||||
[Constructable]
|
||||
public DungeonBullDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DungeonBullDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_East = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(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);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DungeonFountainAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DungeonFountainDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public DungeonFountainAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DungeonFountainAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
AddComponent(new AddonComponent(42226), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(42227), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(42225), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(42228), 1, 1, 0);
|
||||
}
|
||||
|
||||
public DungeonFountainAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DungeonFountainDeed : BaseAddonDeed
|
||||
{
|
||||
public override int LabelNumber { get { return 1159474; } } // Dungeon Fountain
|
||||
public override BaseAddon Addon { get { return new DungeonFountainAddon(); } }
|
||||
|
||||
[Constructable]
|
||||
public DungeonFountainDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DungeonFountainDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
68
Scripts/Items/StoreBought/DecorativeBlackWidow.cs
Normal file
68
Scripts/Items/StoreBought/DecorativeBlackWidow.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeBlackwidowAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DecorativeBlackwidowDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public DecorativeBlackwidowAddon()
|
||||
{
|
||||
AddComponent(new AddonComponent(40360), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(40362), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(40361), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(40363), 0, 0, 0);
|
||||
}
|
||||
|
||||
public DecorativeBlackwidowAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DecorativeBlackwidowDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon { get { return new DecorativeBlackwidowAddon(); } }
|
||||
public override int LabelNumber { get { return 1157897; } }
|
||||
|
||||
[Constructable]
|
||||
public DecorativeBlackwidowDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public DecorativeBlackwidowDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Items/StoreBought/FallenLog.cs
Normal file
114
Scripts/Items/StoreBought/FallenLog.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FallenLogAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new FallenLogDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public FallenLogAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FallenLogAddon(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east)
|
||||
{
|
||||
AddComponent(new AddonComponent(0x0CF5), -1, 0, 0);
|
||||
AddComponent(new AddonComponent(0x0CF6), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x0CF7), 1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new AddonComponent(0x0CF4), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x0CF3), 0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public FallenLogAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class FallenLogDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1071088; } } // Fallen Log
|
||||
public override BaseAddon Addon { get { return new FallenLogAddon(m_East); } }
|
||||
|
||||
private bool m_East;
|
||||
|
||||
[Constructable]
|
||||
public FallenLogDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public FallenLogDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_East = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(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.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
65
Scripts/Items/StoreBought/FreshGreenLadyBug.cs
Normal file
65
Scripts/Items/StoreBought/FreshGreenLadyBug.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FreshGreenLadyBug : BaseLight
|
||||
{
|
||||
public override int LabelNumber { get { return 1071401; } } // Fresh Green Lady Bug
|
||||
|
||||
public override int LitItemID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SouthFacing ? 0x2D04 : 0x2D02;
|
||||
}
|
||||
}
|
||||
|
||||
public override int UnlitItemID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SouthFacing ? 0x2D03 : 0x2D01;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SouthFacing { get { return ItemID == 0x2D03 || ItemID == 0x2D04; } }
|
||||
|
||||
[Constructable]
|
||||
public FreshGreenLadyBug()
|
||||
: base(0x2D04)
|
||||
{
|
||||
Duration = TimeSpan.Zero; // Never burnt out
|
||||
Burning = false;
|
||||
Light = LightType.Circle225;
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public FreshGreenLadyBug(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void Flip()
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x2D01: ItemID = 0x2D03; break;
|
||||
case 0x2D02: ItemID = 0x2D04; break;
|
||||
case 0x2D03: ItemID = 0x2D01; break;
|
||||
case 0x2D04: ItemID = 0x2D02; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/StoreBought/GardenSculpture.cs
Normal file
43
Scripts/Items/StoreBought/GardenSculpture.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0xA565, 0xA566)]
|
||||
public class GardenSculpture : Item, IDyable
|
||||
{
|
||||
public override string DefaultName { get { return "Garden Sculpture"; } }
|
||||
|
||||
[Constructable]
|
||||
public GardenSculpture()
|
||||
: base(0xA565)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public GardenSculpture(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
200
Scripts/Items/StoreBought/GenderChangeToken.cs
Normal file
200
Scripts/Items/StoreBought/GenderChangeToken.cs
Normal file
@@ -0,0 +1,200 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GenderChangeToken : Item, IPromotionalToken
|
||||
{
|
||||
public override int LabelNumber { get { return 1070997; } } // a promotional token
|
||||
public TextDefinition ItemName { get { return 1075252; } } // gender change
|
||||
|
||||
public Type GumpType { get { return typeof(GenderChangeConfirmGump); } }
|
||||
|
||||
[Constructable]
|
||||
public GenderChangeToken()
|
||||
: base(0x2AAA)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Server.Spells.Fifth.IncognitoSpell)))
|
||||
{
|
||||
from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
}
|
||||
else if (from is PlayerMobile)
|
||||
{
|
||||
_HairID = 0;
|
||||
_BeardID = 0;
|
||||
|
||||
from.CloseGump(typeof(GenderChangeConfirmGump));
|
||||
BaseGump.SendGump(new GenderChangeConfirmGump((PlayerMobile)from, this));
|
||||
}
|
||||
}
|
||||
|
||||
private int _HairID;
|
||||
private int _BeardID;
|
||||
|
||||
public void OnChangeHairstyle(Mobile from, bool facialHair, int itemID)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
return;
|
||||
|
||||
if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Server.Spells.Fifth.IncognitoSpell)))
|
||||
{
|
||||
from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
}
|
||||
else
|
||||
{
|
||||
if (facialHair)
|
||||
{
|
||||
_BeardID = itemID;
|
||||
}
|
||||
else
|
||||
{
|
||||
_HairID = itemID;
|
||||
}
|
||||
|
||||
if (!from.Female || from.Race == Race.Elf || facialHair)
|
||||
{
|
||||
EndGenderChange(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnFailedHairstyle(Mobile from, bool facialHair)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
return;
|
||||
|
||||
if (facialHair)
|
||||
{
|
||||
EndGenderChange(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.Female && from.Race != Race.Elf)
|
||||
{
|
||||
from.SendGump(new ChangeHairstyleGump(!from.Female, from, null, 0, true, from.Race == Race.Gargoyle ? ChangeHairstyleEntry.BeardEntriesGargoyle : ChangeHairstyleEntry.BeardEntries, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
EndGenderChange(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void EndGenderChange(Mobile from)
|
||||
{
|
||||
if (from.Female)
|
||||
{
|
||||
from.Body = from.Race.MaleBody;
|
||||
from.Female = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Body = from.Race.FemaleBody;
|
||||
from.Female = true;
|
||||
}
|
||||
|
||||
if ((from.Female || from.Race == Race.Elf) && _BeardID != 0)
|
||||
_BeardID = 0;
|
||||
|
||||
from.FacialHairItemID = _BeardID;
|
||||
from.HairItemID = _HairID;
|
||||
|
||||
from.SendMessage("You are now a {0}.", from.Female ? "woman" : "man"); // TODO: Message?
|
||||
Delete();
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : gender change
|
||||
}
|
||||
|
||||
public GenderChangeToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GenderChangeConfirmGump : BaseGump
|
||||
{
|
||||
public GenderChangeToken Token { get; private set; }
|
||||
|
||||
public GenderChangeConfirmGump(PlayerMobile pm, GenderChangeToken token)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Token = token;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 291, 159, 9200);
|
||||
AddImageTiled(5, 5, 281, 20, 2702);
|
||||
AddImageTiled(5, 30, 281, 100, 2702);
|
||||
|
||||
AddHtmlLocalized(8, 5, 279, 20, 1075249, 0x7FFF, false, false); // Change your character's gender.
|
||||
|
||||
AddButton(5, 132, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 132, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL
|
||||
|
||||
AddHtmlLocalized(8, 30, 279, 124, User.Female ? 1075254 : 1075253, 0x7FFF, false, false); // Click OK to change your gender to female. This change is permanent. Reversing this requires the purchase of an additional gender change token. For more details, <A HREF="http://www.uo.com/genderchange.html">visit our web site</A>.
|
||||
|
||||
AddButton(126, 132, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(160, 132, 120, 20, User.Female ? 1075251 : 1075250, 0x7FFF, false, false); // Make me a woman!
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1 && Token.IsChildOf(User.Backpack))
|
||||
{
|
||||
if (User.IsBodyMod || User.HueMod > 0 || !User.CanBeginAction(typeof(Server.Spells.Fifth.IncognitoSpell)))
|
||||
{
|
||||
User.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendGump(new ChangeHairstyleGump(!User.Female, User, null, 0, false, GetHairstyleEntries(User), Token));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ChangeHairstyleEntry[] GetHairstyleEntries(Mobile m)
|
||||
{
|
||||
ChangeHairstyleEntry[] entries = ChangeHairstyleEntry.HairEntries;
|
||||
|
||||
if (m.Race == Race.Elf)
|
||||
entries = ChangeHairstyleEntry.HairEntriesElf;
|
||||
else if (m.Race == Race.Gargoyle)
|
||||
entries = ChangeHairstyleEntry.HairEntriesGargoyle;
|
||||
|
||||
return entries;
|
||||
}
|
||||
}
|
||||
}
|
||||
147
Scripts/Items/StoreBought/GreenGoblinStatuette.cs
Normal file
147
Scripts/Items/StoreBought/GreenGoblinStatuette.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreenGoblinStatuette : MonsterStatuette
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile User { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public GreenGoblinStatuette()
|
||||
: base(MonsterStatuetteType.GreenGoblin)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.Mounted)
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted.
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
from.SendLocalizedMessage(1113414); // You can't use this while flying!
|
||||
}
|
||||
else if (from.IsBodyMod)
|
||||
{
|
||||
from.SendLocalizedMessage(1111896); // You may only change forms while in your original body.
|
||||
}
|
||||
else
|
||||
{
|
||||
TurnOn(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TurnOn(Mobile from)
|
||||
{
|
||||
User = from;
|
||||
TurnedOn = true;
|
||||
|
||||
from.BodyMod = 723;
|
||||
from.HueMod = 0;
|
||||
|
||||
ItemID = 0xA098;
|
||||
|
||||
from.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
TurnedOn = false;
|
||||
|
||||
if (User != null)
|
||||
{
|
||||
User.BodyMod = 0;
|
||||
User.HueMod = -1;
|
||||
}
|
||||
|
||||
ItemID = 0xA097;
|
||||
|
||||
User = null;
|
||||
}
|
||||
|
||||
public override bool OnDragLift(Mobile from)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
return base.OnDragLift(from);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public override void OnItemRemoved(Item item)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnItemRemoved(item);
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnRemoved(parent);
|
||||
}
|
||||
|
||||
public GreenGoblinStatuette(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
writer.Write(User);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch(version)
|
||||
{
|
||||
case 1:
|
||||
User = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
|
||||
if(User != null)
|
||||
{
|
||||
TurnOn(User);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
147
Scripts/Items/StoreBought/GreyGoblinStatuette.cs
Normal file
147
Scripts/Items/StoreBought/GreyGoblinStatuette.cs
Normal file
@@ -0,0 +1,147 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GreyGoblinStatuette : MonsterStatuette
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile User { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public GreyGoblinStatuette()
|
||||
: base(MonsterStatuetteType.GreyGoblin)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (from.Mounted)
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted.
|
||||
}
|
||||
else if (from.Flying)
|
||||
{
|
||||
from.SendLocalizedMessage(1113414); // You can't use this while flying!
|
||||
}
|
||||
else if (from.IsBodyMod)
|
||||
{
|
||||
from.SendLocalizedMessage(1111896); // You may only change forms while in your original body.
|
||||
}
|
||||
else
|
||||
{
|
||||
TurnOn(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TurnOn(Mobile from)
|
||||
{
|
||||
User = from;
|
||||
TurnedOn = true;
|
||||
|
||||
from.BodyMod = 723;
|
||||
from.HueMod = 0;
|
||||
|
||||
ItemID = 0xA098;
|
||||
|
||||
from.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
|
||||
}
|
||||
|
||||
public void TurnOff()
|
||||
{
|
||||
TurnedOn = false;
|
||||
|
||||
if (User != null)
|
||||
{
|
||||
User.BodyMod = 0;
|
||||
User.HueMod = -1;
|
||||
}
|
||||
|
||||
ItemID = 0xA097;
|
||||
|
||||
User = null;
|
||||
}
|
||||
|
||||
public override bool OnDragLift(Mobile from)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
return base.OnDragLift(from);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnDelete();
|
||||
}
|
||||
|
||||
public override void OnItemRemoved(Item item)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnItemRemoved(item);
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
if (TurnedOn)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
|
||||
base.OnRemoved(parent);
|
||||
}
|
||||
|
||||
public GreyGoblinStatuette(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
writer.Write(User);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
User = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
|
||||
if (User != null)
|
||||
{
|
||||
TurnOn(User);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
345
Scripts/Items/StoreBought/HABPromotionalToken.cs
Normal file
345
Scripts/Items/StoreBought/HABPromotionalToken.cs
Normal file
@@ -0,0 +1,345 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HABPromotionalToken : Item, IAccountRestricted
|
||||
{
|
||||
public override int LabelNumber { get { return 1070997; } } // A promotional token
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Account { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public HABPromotionalToken()
|
||||
: this(null)
|
||||
{ }
|
||||
|
||||
[Constructable]
|
||||
public HABPromotionalToken(string account)
|
||||
: base(0x2AAA)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Weight = 5.0;
|
||||
|
||||
Account = account;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, String.Format("#{0}", 1158657)); // Use this to redeem<br>your ~1_PROMO~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (Account == null)
|
||||
{
|
||||
from.SendLocalizedMessage(1158650); // You cannot redeem this promotional hairstyle change token right now.
|
||||
}
|
||||
else if (from.Account.Username != Account)
|
||||
{
|
||||
from.SendLocalizedMessage(1116257); // This token does not belong to this character.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.CloseGump(typeof(PromotionalTokenGump));
|
||||
from.SendGump(new PromotionalTokenGump(this));
|
||||
}
|
||||
}
|
||||
|
||||
public HABPromotionalToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Account);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Account = reader.ReadString();
|
||||
}
|
||||
|
||||
public enum StyleType
|
||||
{
|
||||
Hair = 0,
|
||||
Beard = 1,
|
||||
}
|
||||
|
||||
public class ChangeHairstyleEntry
|
||||
{
|
||||
public int GumpID { get; set; }
|
||||
public int Tooltip { get; set; }
|
||||
public StyleType Type { get; set; }
|
||||
public int ItemID { get; set; }
|
||||
|
||||
public ChangeHairstyleEntry(int gid, int tooltip, StyleType type, int itemid)
|
||||
{
|
||||
GumpID = gid;
|
||||
Tooltip = tooltip;
|
||||
Type = type;
|
||||
ItemID = itemid;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] HumanMaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xC8F7, 1125404, StyleType.Hair, 0xA1A4),
|
||||
new ChangeHairstyleEntry(0xC8F8, 1125405, StyleType.Hair, 0xA1A5),
|
||||
new ChangeHairstyleEntry(0xC8F9, 1125406, StyleType.Hair, 0xA1A6),
|
||||
new ChangeHairstyleEntry(0xC8FA, 1125407, StyleType.Hair, 0xA1A7),
|
||||
/* Beard */
|
||||
new ChangeHairstyleEntry(0xC8FB, 1125408, StyleType.Beard, 0xA1A8),
|
||||
new ChangeHairstyleEntry(0xC8FC, 1125409, StyleType.Beard, 0xA1A9),
|
||||
new ChangeHairstyleEntry(0xC8FD, 1125410, StyleType.Beard, 0xA1AA),
|
||||
new ChangeHairstyleEntry(0xC8FE, 1125411, StyleType.Beard, 0xA1AB)
|
||||
};
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] HumanFemaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xF00F, 1125412, StyleType.Hair, 0xA1AC),
|
||||
new ChangeHairstyleEntry(0xF010, 1125413, StyleType.Hair, 0xA1AD),
|
||||
new ChangeHairstyleEntry(0xF011, 1125414, StyleType.Hair, 0xA1AE),
|
||||
new ChangeHairstyleEntry(0xF012, 1125415, StyleType.Hair, 0xA1AF)
|
||||
};
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] ElfMaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xC903, 1125416, StyleType.Hair, 0xA1B0),
|
||||
new ChangeHairstyleEntry(0xC904, 1125417, StyleType.Hair, 0xA1B1),
|
||||
new ChangeHairstyleEntry(0xC905, 1125418, StyleType.Hair, 0xA1B2),
|
||||
new ChangeHairstyleEntry(0xC906, 1125419, StyleType.Hair, 0xA1B3)
|
||||
};
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] ElfFemaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xF017, 1125420, StyleType.Hair, 0xA1B4),
|
||||
new ChangeHairstyleEntry(0xF018, 1125421, StyleType.Hair, 0xA1B5),
|
||||
new ChangeHairstyleEntry(0xF019, 1125422, StyleType.Hair, 0xA1B6),
|
||||
new ChangeHairstyleEntry(0xF01A, 1125423, StyleType.Hair, 0xA1B7)
|
||||
};
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] GargoyleMaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xC90B, 1125424, StyleType.Hair, 0xA1B8),
|
||||
new ChangeHairstyleEntry(0xC90C, 1125425, StyleType.Hair, 0xA1B9),
|
||||
new ChangeHairstyleEntry(0xC90D, 1125426, StyleType.Hair, 0xA1BA),
|
||||
new ChangeHairstyleEntry(0xC90E, 1125427, StyleType.Hair, 0xA1BB),
|
||||
/* Beard */
|
||||
new ChangeHairstyleEntry(0xC90F, 1125428, StyleType.Beard, 0xA1BC),
|
||||
new ChangeHairstyleEntry(0xC910, 1125429, StyleType.Beard, 0xA1BD),
|
||||
new ChangeHairstyleEntry(0xC911, 1125430, StyleType.Beard, 0xA1BE),
|
||||
new ChangeHairstyleEntry(0xC912, 1125431, StyleType.Beard, 0xA1BF)
|
||||
};
|
||||
|
||||
public static readonly ChangeHairstyleEntry[] GargoyleFemaleEntries = new[]
|
||||
{
|
||||
/* Hair */
|
||||
new ChangeHairstyleEntry(0xF023, 1125432, StyleType.Hair, 0xA1C0),
|
||||
new ChangeHairstyleEntry(0xF024, 1125433, StyleType.Hair, 0xA1C1),
|
||||
new ChangeHairstyleEntry(0xF025, 1125434, StyleType.Hair, 0xA1C2),
|
||||
new ChangeHairstyleEntry(0xF026, 1125435, StyleType.Hair, 0xA1C3)
|
||||
};
|
||||
|
||||
private class PromotionalTokenGump : Gump
|
||||
{
|
||||
private readonly Item Token;
|
||||
|
||||
public PromotionalTokenGump(Item token)
|
||||
: base(170, 150)
|
||||
{
|
||||
Token = token;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 291, 99, 0x13BE);
|
||||
AddImageTiled(5, 6, 280, 20, 0xA40);
|
||||
AddHtmlLocalized(9, 8, 280, 20, 1158655, 0x7FFF, false, false); // Change your character's hairstyle.
|
||||
AddImageTiled(5, 31, 280, 40, 0xA40);
|
||||
AddHtmlLocalized(9, 35, 272, 40, 1158651, 0x7FFF, false, false); // Are you absolutely sure you wish to change your character's hairstyle?
|
||||
AddButton(125, 73, 0xFB7, 0xFB8, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(160, 75, 155, 20, 1158654, 0x7FFF, false, false); // Make me fabulous!
|
||||
AddButton(5, 73, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 75, 100, 20, 1060051, 0x7FFF, false, false); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID != 1)
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (!Token.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
|
||||
ChangeHairstyleEntry[] entry = HumanMaleEntries;
|
||||
|
||||
if (from.Race == Race.Human)
|
||||
{
|
||||
if (from.Female)
|
||||
{
|
||||
entry = HumanFemaleEntries;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = HumanMaleEntries;
|
||||
}
|
||||
}
|
||||
else if (from.Race == Race.Elf)
|
||||
{
|
||||
if (from.Female)
|
||||
{
|
||||
entry = ElfFemaleEntries;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = ElfMaleEntries;
|
||||
}
|
||||
}
|
||||
else if (from.Race == Race.Gargoyle)
|
||||
{
|
||||
if (from.Female)
|
||||
{
|
||||
entry = GargoyleFemaleEntries;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = GargoyleMaleEntries;
|
||||
}
|
||||
}
|
||||
|
||||
from.SendGump(new InternalGump(from, Token, entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly Item Token;
|
||||
private readonly ChangeHairstyleEntry[] _Entries;
|
||||
|
||||
public InternalGump(Mobile from, Item token, ChangeHairstyleEntry[] entries)
|
||||
: base(50, 50)
|
||||
{
|
||||
Token = token;
|
||||
_Entries = entries;
|
||||
|
||||
from.CloseGump(typeof(InternalGump));
|
||||
|
||||
if (_Entries.Length > 4)
|
||||
{
|
||||
AddBackground(0, 0, 560, 400, 0xA28);
|
||||
|
||||
AddButton(117, 345, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(149, 345, 90, 35, 1006044, 0x0, false, false); // OK
|
||||
AddButton(324, 345, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(356, 345, 90, 35, 1006045, 0x0, false, false); // Cancel
|
||||
|
||||
AddHtmlLocalized(50, 25, 460, 20, 1018353, 0x0, false, false); // <center>New Hairstyle</center>
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBackground(0, 0, 300, 250, 0xA28);
|
||||
|
||||
AddButton(69, 207, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(101, 207, 90, 35, 1006044, 0x0, false, false); // OK
|
||||
AddButton(191, 207, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(223, 207, 90, 35, 1006045, 0x0, false, false); // Cancel
|
||||
|
||||
AddHtmlLocalized(50, 25, 230, 20, 1018353, 0x0, false, false); // <center>New Hairstyle</center>
|
||||
}
|
||||
|
||||
for (int i = 0; i < _Entries.Length; ++i)
|
||||
{
|
||||
if (i > 3)
|
||||
{
|
||||
AddBackground(70 + (124 * (i - 4)), 135, 60, 64, 0xA3C);
|
||||
AddTooltip(_Entries[i].Tooltip);
|
||||
AddImage(10 + (124 * (i - 4)), 95, _Entries[i].GumpID);
|
||||
AddRadio(30 + (124 * (i - 4)), 155, 0xD0, 0xD1, false, 41400 + i);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i > 1 && _Entries.Length < 5)
|
||||
{
|
||||
AddBackground(70 + (124 * (i - 2)), 135, 60, 64, 0xA3C);
|
||||
AddTooltip(_Entries[i].Tooltip);
|
||||
AddImage(10 + (124 * (i - 2)), 95, _Entries[i].GumpID);
|
||||
AddRadio(30 + (124 * (i - 2)), 155, 0xD0, 0xD1, false, 41400 + i);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBackground(70 + (124 * i), 60, 60, 64, 0xA3C);
|
||||
AddTooltip(_Entries[i].Tooltip);
|
||||
AddImage(10 + (124 * i), 20, _Entries[i].GumpID);
|
||||
AddRadio(30 + (124 * i), 80, 0xD0, 0xD1, false, 41400 + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (!Token.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
var switches = info.Switches;
|
||||
|
||||
if (switches.Length > 0)
|
||||
{
|
||||
int index = switches[0];
|
||||
|
||||
ChangeHairstyleEntry entry = _Entries[index - 41400];
|
||||
|
||||
if (entry.Type == StyleType.Hair)
|
||||
from.HairItemID = entry.ItemID;
|
||||
else
|
||||
from.FacialHairItemID = entry.ItemID;
|
||||
|
||||
from.SendLocalizedMessage(1158661); // You have successfully changed your hairstyle.
|
||||
|
||||
Token.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1013009); // You decide not to change your hairstyle.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
134
Scripts/Items/StoreBought/HaochisPigments.cs
Normal file
134
Scripts/Items/StoreBought/HaochisPigments.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum HaochisPigmentType
|
||||
{
|
||||
None,
|
||||
HeartwoodSienna,
|
||||
CampionWhite,
|
||||
YewishPine,
|
||||
MinocianFire,
|
||||
NinjaBlack,
|
||||
Olive,
|
||||
DarkReddishBrown,
|
||||
Yellow,
|
||||
PrettyPink,
|
||||
MidnightBlue,
|
||||
Emerald,
|
||||
SmokyGold,
|
||||
GhostsGrey,
|
||||
OceanBlue,
|
||||
CelticLime
|
||||
}
|
||||
|
||||
public class HaochisPigment : BasePigmentsOfTokuno
|
||||
{
|
||||
private HaochisPigmentType m_Type;
|
||||
|
||||
[Constructable]
|
||||
public HaochisPigment()
|
||||
: this(HaochisPigmentType.None, 50)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HaochisPigment(HaochisPigmentType type)
|
||||
: this(type, 50)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HaochisPigment(HaochisPigmentType type, int uses)
|
||||
: base(uses)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public HaochisPigment(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HaochisPigmentType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Type = value;
|
||||
|
||||
var info = m_Table.FirstOrDefault(x => x.Type == m_Type);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
Hue = info.Hue;
|
||||
Label = info.Localization;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hue = 0;
|
||||
Label = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1071249; } } // Haochi's Pigments
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
writer.Write((int)m_Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
Type = (HaochisPigmentType)reader.ReadInt();
|
||||
}
|
||||
|
||||
public static HoachisPigmentInfo[] Table { get { return m_Table; } }
|
||||
private static HoachisPigmentInfo[] m_Table =
|
||||
{
|
||||
new HoachisPigmentInfo( HaochisPigmentType.None, 0, -1 ),
|
||||
new HoachisPigmentInfo( HaochisPigmentType.HeartwoodSienna, 2739, 1157275 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.CampionWhite, 2738, 1157274 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.YewishPine, 2737, 1157273 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.MinocianFire, 2736, 1157272 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.NinjaBlack, 1175, 1071246 ), // NOT Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.Olive, 2730, 1018352 ), // Not Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.DarkReddishBrown, 1148, 1071247 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.Yellow, 1169, 1071245 ), // NOT Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.PrettyPink, 1168, 1071244 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.MidnightBlue, 1176, 1071248 ), // NOT Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.Emerald, 1173, 1023856 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.SmokyGold, 1801, 1115467 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.GhostsGrey, 1000, 1115468 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.OceanBlue, 1195, 1115471 ), // Verified
|
||||
new HoachisPigmentInfo( HaochisPigmentType.CelticLime, 2733, 1157269 ), // Verified
|
||||
};
|
||||
|
||||
public class HoachisPigmentInfo
|
||||
{
|
||||
public HaochisPigmentType Type { get; private set; }
|
||||
public int Hue { get; private set; }
|
||||
public int Localization { get; private set; }
|
||||
|
||||
public HoachisPigmentInfo(HaochisPigmentType type, int hue, int loc)
|
||||
{
|
||||
Type = type;
|
||||
Hue = hue;
|
||||
Localization = loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
139
Scripts/Items/StoreBought/HildebrandtDragonRug.cs
Normal file
139
Scripts/Items/StoreBought/HildebrandtDragonRug.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HildebrandtDragonRugAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new HildebrandtDragonRugDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public HildebrandtDragonRugAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HildebrandtDragonRugAddon(bool south)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
for (int i = 0; i < m_SouthInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_SouthInfo[i, 0]), m_SouthInfo[i, 1], m_SouthInfo[i, 2], m_SouthInfo[i, 3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < m_EastInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_EastInfo[i, 0]), m_EastInfo[i, 1], m_EastInfo[i, 2], m_EastInfo[i, 3]);
|
||||
}
|
||||
}
|
||||
|
||||
private static int[,] m_SouthInfo = new int[,]
|
||||
{
|
||||
{40909, -2, -2, 0}, {40908, -2, -1, 0}, {40898, -1, -1, 0}// 1 2 3
|
||||
, {40897, -1, 0, 0}, {40896, -1, 1, 0}, {40895, -1, 2, 0}// 4 5 6
|
||||
, {40887, 1, 0, 0}, {40886, 0, 1, 0}, {40885, 1, 1, 0}// 7 8 9
|
||||
, {40904, 2, -2, 0}, {40894, 1, 2, 0}, {40888, 0, 0, 0}// 10 11 12
|
||||
, {40891, 1, -2, 0}, {40892, 0, -2, 0}, {40893, 0, 2, 0}// 13 14 15
|
||||
, {40899, -1, -2, 0}, {40900, 2, 2, 0}, {40901, 2, 1, 0}// 16 17 18
|
||||
, {40902, 2, 0, 0}, {40903, 2, -1, 0}, {40889, 1, -1, 0}// 19 20 21
|
||||
, {40890, 0, -1, 0}, {40905, -2, 2, 0}, {40906, -2, 1, 0}// 22 23 24
|
||||
, {40907, -2, 0, 0}// 25
|
||||
};
|
||||
|
||||
private static int[,] m_EastInfo = new int[,]
|
||||
{
|
||||
{40926, 2, 1, 0}, {40918, 0, 2, 0}, {40919, 1, 2, 0}// 1 2 3
|
||||
, {40920, -1, 2, 0}, {40910, 1, 1, 0}, {40911, 0, 1, 0}// 4 5 6
|
||||
, {40930, -2, 2, 0}, {40921, -1, 1, 0}, {40931, -2, 1, 0}// 7 8 9
|
||||
, {40925, 2, 2, 0}, {40914, 1, -1, 0}, {40915, 0, -1, 0}// 10 11 12
|
||||
, {40916, 0, -2, 0}, {40917, 1, -2, 0}, {40913, 0, 0, 0}// 13 14 15
|
||||
, {40934, -2, -2, 0}, {40927, 2, 0, 0}, {40932, -2, -1, 0}// 16 17 18
|
||||
, {40933, -2, 0, 0}, {40922, -1, 0, 0}, {40923, -1, -1, 0}// 19 20 21
|
||||
, {40928, 2, -1, 0}, {40929, 2, -2, 0}, {40924, -1, -2, 0}// 22 23 24
|
||||
, {40912, 1, 0, 0}// 25
|
||||
};
|
||||
|
||||
public HildebrandtDragonRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HildebrandtDragonRugDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new HildebrandtDragonRugAddon(m_South); } }
|
||||
public override int LabelNumber { get { return 1157889; } } // Hildebrandt Dragon Rug
|
||||
|
||||
private bool m_South;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool South
|
||||
{
|
||||
get { return m_South; }
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_South = choice == 0;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HildebrandtDragonRugDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public HildebrandtDragonRugDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/StoreBought/HoodedBritanniaRobe.cs
Normal file
36
Scripts/Items/StoreBought/HoodedBritanniaRobe.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class HoodedBritanniaRobe : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber { get { return 1125155; } } // Hooded Britannia Robe
|
||||
|
||||
[Constructable]
|
||||
public HoodedBritanniaRobe(int id)
|
||||
: base(id)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public HoodedBritanniaRobe(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Scripts/Items/StoreBought/ImprovedRockHammer.cs
Normal file
44
Scripts/Items/StoreBought/ImprovedRockHammer.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x9E7E, 0x9E7F)]
|
||||
public class ImprovedRockHammer : BaseHarvestTool
|
||||
{
|
||||
public override int LabelNumber { get { return 1157177; } } // Improved Rock Hammer
|
||||
|
||||
[Constructable]
|
||||
public ImprovedRockHammer()
|
||||
: this(500)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ImprovedRockHammer(int uses)
|
||||
: base(uses, 0x9E7E)
|
||||
{
|
||||
Hue = 2721;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public ImprovedRockHammer(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
65
Scripts/Items/StoreBought/LargeGlowingLadyBug.cs
Normal file
65
Scripts/Items/StoreBought/LargeGlowingLadyBug.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class LargeGlowingLadyBug : BaseLight
|
||||
{
|
||||
public override int LabelNumber { get { return 1071400; } } // Large Glowing Lady Bug
|
||||
|
||||
public override int LitItemID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SouthFacing ? 0x2CFE : 0x2D00;
|
||||
}
|
||||
}
|
||||
|
||||
public override int UnlitItemID
|
||||
{
|
||||
get
|
||||
{
|
||||
return SouthFacing ? 0x2CFD : 0x2CFF;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SouthFacing { get { return ItemID == 0x2CFD || ItemID == 0x2CFE; } }
|
||||
|
||||
[Constructable]
|
||||
public LargeGlowingLadyBug()
|
||||
: base(0x2CFD)
|
||||
{
|
||||
Duration = TimeSpan.Zero; // Never burnt out
|
||||
Burning = false;
|
||||
Light = LightType.Circle225;
|
||||
Weight = 3.0;
|
||||
}
|
||||
|
||||
public LargeGlowingLadyBug(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void Flip()
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x2CFD: ItemID = 0x2CFF; break;
|
||||
case 0x2CFE: ItemID = 0x2D00; break;
|
||||
case 0x2CFF: ItemID = 0x2CFF; break;
|
||||
case 0x2D00: ItemID = 0x2CFE; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Scripts/Items/StoreBought/MapleTree.cs
Normal file
98
Scripts/Items/StoreBought/MapleTree.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MapleTreeAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new MapleTreeDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public MapleTreeAddon(bool trunk)
|
||||
{
|
||||
AddComponent(new LocalizedAddonComponent(0x247D, 1071104), 0, 0, 0);
|
||||
|
||||
if (!trunk)
|
||||
AddComponent(new LocalizedAddonComponent(0x36A1, 1071104), 0, 0, 0);
|
||||
}
|
||||
|
||||
public MapleTreeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class MapleTreeDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new MapleTreeAddon(m_Trunk); } }
|
||||
public override int LabelNumber { get { return 1071104; } } // Maple Tree
|
||||
|
||||
private bool m_Trunk;
|
||||
|
||||
[Constructable]
|
||||
public MapleTreeDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MapleTreeDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1071104); // Maple Tree
|
||||
list.Add(1, 1071301); // Maple Tree (trunk)
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_Trunk = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(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.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
50
Scripts/Items/StoreBought/MerchantsTrinket.cs
Normal file
50
Scripts/Items/StoreBought/MerchantsTrinket.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Server;
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MerchantsTrinket : GoldEarrings
|
||||
{
|
||||
private bool _Greater;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Bonus { get { return Greater ? 10 : 5; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Greater { get { return _Greater; } set { _Greater = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber { get { return _Greater ? 1156828 : 1156827; } } // Merchant's Trinket - 5% / 10%
|
||||
|
||||
[Constructable]
|
||||
public MerchantsTrinket()
|
||||
: this(false)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MerchantsTrinket(bool greater)
|
||||
{
|
||||
Greater = greater;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MerchantsTrinket(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
writer.Write(_Greater);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
_Greater = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
145
Scripts/Items/StoreBought/MetalLadder.cs
Normal file
145
Scripts/Items/StoreBought/MetalLadder.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum MetalLadderType
|
||||
{
|
||||
SouthCastle = 0,
|
||||
EastCastle = 1,
|
||||
NorthCastle = 2,
|
||||
WestCastle = 3,
|
||||
South = 4,
|
||||
East = 5,
|
||||
North = 6,
|
||||
West = 7
|
||||
}
|
||||
|
||||
public class MetalLadderAddon : BaseAddon, IDyable
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new MetalLadderDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public MetalLadderAddon(MetalLadderType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MetalLadderType.SouthCastle:
|
||||
AddComponent(new LocalizedAddonComponent(0xA559, 1076791), 0, 2, 20);
|
||||
AddComponent(new AddonComponent(0xA557), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.EastCastle:
|
||||
AddComponent(new LocalizedAddonComponent(0xA55A, 1076791), 2, 0, 20);
|
||||
AddComponent(new AddonComponent(0xA558), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.NorthCastle:
|
||||
AddComponent(new LocalizedAddonComponent(0xA55C, 1154133), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.WestCastle:
|
||||
AddComponent(new LocalizedAddonComponent(0xA55B, 1154133), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.South:
|
||||
AddComponent(new LocalizedAddonComponent(0xA557, 1154133), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.East:
|
||||
AddComponent(new LocalizedAddonComponent(0xA558, 1154133), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.North:
|
||||
AddComponent(new LocalizedAddonComponent(0xA55C, 1154133), 0, 0, 0);
|
||||
break;
|
||||
case MetalLadderType.West:
|
||||
AddComponent(new LocalizedAddonComponent(0xA55B, 1154133), 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
|
||||
public MetalLadderAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class MetalLadderDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new MetalLadderAddon(_Direction); } }
|
||||
public override int LabelNumber { get { return 1159445; } } // metal ladder
|
||||
|
||||
private MetalLadderType _Direction;
|
||||
|
||||
[Constructable]
|
||||
public MetalLadderDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1154194, 300, 260)); // Choose a Facing:
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)MetalLadderType.SouthCastle, 1076794);
|
||||
list.Add((int)MetalLadderType.EastCastle, 1076795);
|
||||
list.Add((int)MetalLadderType.NorthCastle, 1076792);
|
||||
list.Add((int)MetalLadderType.WestCastle, 1076793);
|
||||
list.Add((int)MetalLadderType.South, 1075386);
|
||||
list.Add((int)MetalLadderType.East, 1075387);
|
||||
list.Add((int)MetalLadderType.North, 1075389);
|
||||
list.Add((int)MetalLadderType.West, 1075390);
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
_Direction = (MetalLadderType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public MetalLadderDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
208
Scripts/Items/StoreBought/MysticalPolymorphTotem.cs
Normal file
208
Scripts/Items/StoreBought/MysticalPolymorphTotem.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
using System;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MysticalPolymorphTotem : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1158780; } } // Mystical Polymorph Totem
|
||||
|
||||
private int m_Body = 0;
|
||||
private int m_Hue = -1;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Duration { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string CostumeCreatureName { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool Transformed { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int CostumeBody
|
||||
{
|
||||
get { return m_Body; }
|
||||
set { m_Body = value; }
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int CostumeHue
|
||||
{
|
||||
get { return m_Hue; }
|
||||
set { m_Hue = value; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MysticalPolymorphTotem()
|
||||
: base(0xA276)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public MysticalPolymorphTotem(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (CostumeCreatureName != null)
|
||||
{
|
||||
list.Add(1158707, String.Format("{0}", CostumeCreatureName)); // a ~1_name~ costume
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CostumeBody == 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1158781); // Target the costume that you wish to merge with this Mystical Polymorph Totem. Please be aware that this selection cannot be undone.
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Transformed)
|
||||
{
|
||||
EnMask(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeMask(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DropToWorld(Mobile from, Point3D p)
|
||||
{
|
||||
bool drop = base.DropToWorld(from, p);
|
||||
|
||||
if (Transformed)
|
||||
{
|
||||
DeMask(from);
|
||||
}
|
||||
|
||||
return drop;
|
||||
}
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
private void EnMask(Mobile from)
|
||||
{
|
||||
if (from.Mounted || from.Flying)
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted or flying.
|
||||
}
|
||||
else if (from.IsBodyMod || from.HueMod > -1)
|
||||
{
|
||||
from.SendLocalizedMessage(1158010); // You cannot use that item in this form.
|
||||
}
|
||||
else
|
||||
{
|
||||
Duration = 28800;
|
||||
|
||||
if (m_Timer == null || !m_Timer.Running)
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), delegate { Slice(from); });
|
||||
|
||||
BuffInfo.AddBuff(from, new BuffInfo(BuffIcon.MysticalPolymorphTotem, 1158780, 1158017, TimeSpan.FromSeconds(Duration), from, CostumeCreatureName));
|
||||
|
||||
ItemID = 0xA20B;
|
||||
from.BodyMod = m_Body;
|
||||
from.HueMod = m_Hue;
|
||||
Transformed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Slice(Mobile from)
|
||||
{
|
||||
if (Duration > 0)
|
||||
Duration--;
|
||||
else
|
||||
{
|
||||
DeMask(from);
|
||||
|
||||
if (m_Timer != null)
|
||||
m_Timer.Stop();
|
||||
|
||||
m_Timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void DeMask(Mobile from)
|
||||
{
|
||||
ItemID = 0xA276;
|
||||
from.BodyMod = 0;
|
||||
from.HueMod = -1;
|
||||
Transformed = false;
|
||||
Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
|
||||
from.PlaySound(250);
|
||||
BuffInfo.RemoveBuff(from, BuffIcon.MysticalPolymorphTotem);
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly MysticalPolymorphTotem m_Totem;
|
||||
|
||||
public InternalTarget(MysticalPolymorphTotem totem)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
m_Totem = totem;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Totem.Deleted)
|
||||
return;
|
||||
|
||||
if (!m_Totem.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is BaseCostume)
|
||||
{
|
||||
BaseCostume costume = targeted as BaseCostume;
|
||||
|
||||
m_Totem.CostumeCreatureName = costume.CreatureName;
|
||||
m_Totem.CostumeBody = costume.CostumeBody;
|
||||
|
||||
m_Totem.InvalidateProperties();
|
||||
|
||||
costume.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(CostumeCreatureName);
|
||||
writer.Write((int)CostumeBody);
|
||||
writer.Write((int)CostumeHue);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
CostumeCreatureName = reader.ReadString();
|
||||
CostumeBody = reader.ReadInt();
|
||||
CostumeHue = reader.ReadInt();
|
||||
|
||||
ItemID = 0xA276;
|
||||
}
|
||||
}
|
||||
}
|
||||
324
Scripts/Items/StoreBought/MythicalCharacterToken.cs
Normal file
324
Scripts/Items/StoreBought/MythicalCharacterToken.cs
Normal file
@@ -0,0 +1,324 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MythicCharacterToken : Item, IPromotionalToken
|
||||
{
|
||||
public override int LabelNumber { get { return 1070997; } } // a promotional token
|
||||
public TextDefinition ItemName { get { return 1152353; } } // Mythic Character Token
|
||||
|
||||
public Type GumpType { get { return typeof(MythicCharacterToken.InternalGump); } }
|
||||
|
||||
[Constructable]
|
||||
public MythicCharacterToken()
|
||||
: base(0x2AAA)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m is PlayerMobile && IsChildOf(m.Backpack))
|
||||
{
|
||||
if (m.Skills.Total > 2000)
|
||||
{
|
||||
m.SendLocalizedMessage(1152368); // You cannot use this token on this character because you have over 200 skill points. If you
|
||||
// don’t have a way to lower your skill point total, you will have to use this Mythic Character
|
||||
// Token on another character.
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseGump.SendGump(new InternalGump((PlayerMobile)m, this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~
|
||||
}
|
||||
|
||||
public MythicCharacterToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public class InternalGump : BaseGump
|
||||
{
|
||||
public MythicCharacterToken Token { get; set; }
|
||||
public Skill[] Selected { get; set; }
|
||||
|
||||
public bool Editing { get; set; }
|
||||
|
||||
public int Str { get; set; }
|
||||
public int Dex { get; set; }
|
||||
public int Int { get; set; }
|
||||
|
||||
public static readonly int Width = 500;
|
||||
public static readonly int Height = 510;
|
||||
|
||||
public static int Green { get { return C32216(0x32CD32); } }
|
||||
public static int LightGreen { get { return C32216(0x90EE90); } }
|
||||
public static int Yellow { get { return C32216(0xFFE4C4); } }
|
||||
public static int Beige { get { return C32216(0xF5F5DC); } }
|
||||
public static int Gray { get { return C32216(0x696969); } }
|
||||
public static int White { get { return 0x7FFF; } }
|
||||
|
||||
public bool HasAllFive
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Selected == null)
|
||||
return false;
|
||||
|
||||
foreach (var sk in Selected)
|
||||
{
|
||||
if (sk == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public InternalGump(PlayerMobile pm, MythicCharacterToken token)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Token = token;
|
||||
Selected = new Skill[5];
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, Width, Height, 9200);
|
||||
|
||||
AddImageTiled(10, 10, 480, 25, 2624);
|
||||
AddAlphaRegion(10, 10, 480, 25);
|
||||
|
||||
AddImageTiled(10, 45, 480, 425, 2624);
|
||||
AddAlphaRegion(10, 45, 480, 425);
|
||||
|
||||
AddImageTiled(10, 480, 480, 22, 2624);
|
||||
AddAlphaRegion(10, 480, 480, 22);
|
||||
|
||||
AddHtmlLocalized(0, 12, Width, 20, 1152352, White, false, false); // <center>Mythic Character Skill Selection</center>
|
||||
|
||||
AddHtmlLocalized(0, 45, Width / 3, 20, 1152354, Yellow, false, false); // <CENTER>Set Attributes</CENTER>
|
||||
AddHtmlLocalized(0, 65, Width / 3, 20, 1152355, User.StatCap.ToString(), Beige, false, false); // <CENTER>Total Must Equal ~1_VAL~
|
||||
|
||||
AddBackground(11, 85, 80, 20, 3000);
|
||||
AddBackground(11, 106, 80, 20, 3000);
|
||||
AddBackground(11, 127, 80, 20, 3000);
|
||||
|
||||
AddTextEntry(13, 85, 75, 20, 0, 1, Str > 0 ? Str.ToString() : "");
|
||||
AddTextEntry(13, 106, 75, 20, 0, 2, Dex > 0 ? Dex.ToString() : "");
|
||||
AddTextEntry(13, 127, 75, 20, 0, 3, Int > 0 ? Int.ToString() : "");
|
||||
|
||||
AddHtmlLocalized(98, 85, 100, 20, 3000111, White, false, false); // Strength
|
||||
AddHtmlLocalized(98, 106, 100, 20, 3000113, White, false, false); // Dexterity
|
||||
AddHtmlLocalized(98, 127, 100, 20, 3000112, White, false, false); // Intelligence
|
||||
|
||||
AddHtmlLocalized(0, 170, Width / 3, 20, 1152356, Yellow, false, false); // <CENTER>Selected Skills</CENTER>
|
||||
|
||||
AddButton(10, Height - 30, 4017, 4018, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(42, Height - 30, 100, 20, 1153439, White, false, false); // CANCEL
|
||||
|
||||
for (int i = 0; i < Selected.Length; i++)
|
||||
{
|
||||
Skill sk = Selected[i];
|
||||
|
||||
if (sk == null)
|
||||
continue;
|
||||
|
||||
AddButton(12, 190 + (i * 20), 4017, 4018, 5000 + i, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(45, 190 + (i * 20), 150, 20, sk.Info.Localization, Green, false, false);
|
||||
}
|
||||
|
||||
if (HasAllFive)
|
||||
{
|
||||
AddHtmlLocalized(Width / 3, 65, ((Width / 3) * 2) - 15, Height - 100, 1152358, LightGreen, false, false);
|
||||
/*Please confirm that you wish to set your attributes as indicated in the upper left area of this window.
|
||||
If you wish to change these values, edit them and click the EDIT button below.<br><br>Please confirm that
|
||||
you wish to set the five skills selected on the left to 90.0 skill. If you wish to make changes, click the
|
||||
[X] button next to a skill name to remove it from the list.<br><br>If are sure you wish to apply the selected
|
||||
skills and attributes, click the CONTINUE button below.<br><br>If you wish to abort the application of the
|
||||
Mythic Character Token, click the CANCEL button below.*/
|
||||
|
||||
AddButton(Width / 3, Height - 100, 4005, 4007, 2500, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized((Width / 3) + 32, Height - 100, 100, 20, 1150647, White, false, false); // EDIT
|
||||
|
||||
AddButton(Width / 3, Height - 120, 4005, 4007, 2501, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized((Width / 3) + 32, Height - 120, 100, 20, 1011011, White, false, false); // CONTINUE
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(Width / 3, 45, (Width / 3) * 2, 20, 1152357, White, false, false); // <CENTER>Select Five Skills to Advance</CENTER>
|
||||
|
||||
AddPage(1);
|
||||
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Magic), Width / 3, 65, SkillCat.Magic, ScrollOfAlacrityBook._SkillInfo[SkillCat.Magic]);
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Bard), Width / 3, 345, SkillCat.Bard, ScrollOfAlacrityBook._SkillInfo[SkillCat.Bard]);
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Combat), (Width / 3) * 2, 65, SkillCat.Combat, ScrollOfAlacrityBook._SkillInfo[SkillCat.Combat]);
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Wilderness), (Width / 3) * 2, 305, SkillCat.Wilderness, ScrollOfAlacrityBook._SkillInfo[SkillCat.Wilderness]);
|
||||
|
||||
AddButton(Width - 120, Height - 30, 4005, 4007, 0, GumpButtonType.Page, 2);
|
||||
AddHtmlLocalized(Width - 85, Height - 30, 75, 20, 3005109, White, false, false); // Next
|
||||
AddPage(2);
|
||||
AddButton(Width - 160, Height - 30, 4014, 4015, 0, GumpButtonType.Page, 1);
|
||||
AddHtmlLocalized(Width - 128, Height - 30, 75, 20, 3010002, White, false, false); // Back
|
||||
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.TradeSkills), Width / 3, 65, SkillCat.TradeSkills, ScrollOfAlacrityBook._SkillInfo[SkillCat.TradeSkills]);
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Miscellaneous), Width / 3, 285, SkillCat.Miscellaneous, ScrollOfAlacrityBook._SkillInfo[SkillCat.Miscellaneous]);
|
||||
BuildSkillCategory(BaseSpecialScrollBook.GetCategoryLocalization(SkillCat.Thievery), (Width / 3) * 2, 150, SkillCat.Thievery, ScrollOfAlacrityBook._SkillInfo[SkillCat.Thievery]);
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildSkillCategory(int titleLoc, int x, int y, SkillCat cat, List<SkillName> skills)
|
||||
{
|
||||
AddHtmlLocalized(x, y, Width / 3, 20, CenterLoc, "#" + titleLoc, White, false, false);
|
||||
y += 20;
|
||||
|
||||
for (int i = 0; i < skills.Count; i++)
|
||||
{
|
||||
int hue = Gray;
|
||||
if (CanSelect(skills[i]))
|
||||
{
|
||||
AddButton(x, y + (i * 20), 4005, 4006, (int)skills[i] + 500, GumpButtonType.Reply, 0);
|
||||
hue = Green;
|
||||
}
|
||||
|
||||
AddHtmlLocalized(x + 34, y + (i * 20), Width / 3, 20, User.Skills[skills[i]].Info.Localization, hue, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (!Token.IsChildOf(User.Backpack) || !User.Alive || User.Skills.Total > 2000)
|
||||
return;
|
||||
|
||||
int buttonID = info.ButtonID;
|
||||
|
||||
if (buttonID == 0)
|
||||
return;
|
||||
|
||||
switch (buttonID)
|
||||
{
|
||||
case 2500: // Edit
|
||||
SetStats(info);
|
||||
break;
|
||||
case 2501: // Continue
|
||||
SetStats(info);
|
||||
if ((Str + Dex + Int) != User.StatCap)
|
||||
{
|
||||
User.SendLocalizedMessage(1152359); // Your Strength, Dexterity, and Intelligence values do not add up to the total indicated in
|
||||
// the upper left area of this window. Before continuing, you must adjust these values so
|
||||
// their total adds up to exactly the displayed value. Please edit your desired attribute
|
||||
// values and click the EDIT button below to continue.
|
||||
}
|
||||
else
|
||||
{
|
||||
Effects.SendLocationParticles(EffectItem.Create(User.Location, User.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0);
|
||||
Effects.PlaySound(User.Location, User.Map, 0x243);
|
||||
|
||||
Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 6, User.Y - 6, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
|
||||
Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 4, User.Y - 6, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
|
||||
Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 6, User.Y - 4, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
|
||||
|
||||
Effects.SendTargetParticles(User, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100);
|
||||
|
||||
foreach (var sk in Selected)
|
||||
{
|
||||
sk.Base = 90;
|
||||
}
|
||||
|
||||
User.RawStr = Str;
|
||||
User.RawDex = Dex;
|
||||
User.RawInt = Int;
|
||||
|
||||
Token.Delete();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (buttonID >= 5000)
|
||||
{
|
||||
Selected[buttonID - 5000] = null;
|
||||
}
|
||||
else if (!HasAllFive)
|
||||
{
|
||||
SkillName sk = (SkillName)buttonID - 500;
|
||||
|
||||
for (int i = 0; i < Selected.Length; i++)
|
||||
{
|
||||
if (Selected[i] == null)
|
||||
{
|
||||
Selected[i] = User.Skills[sk];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void SetStats(RelayInfo info)
|
||||
{
|
||||
var entry1 = info.GetTextEntry(1);
|
||||
var entry2 = info.GetTextEntry(2);
|
||||
var entry3 = info.GetTextEntry(3);
|
||||
|
||||
if (entry1 != null)
|
||||
Str = Math.Min(125, Math.Max(10, Utility.ToInt32(entry1.Text)));
|
||||
|
||||
if (entry2 != null)
|
||||
Dex = Math.Min(125, Math.Max(10, Utility.ToInt32(entry2.Text)));
|
||||
|
||||
if (entry3 != null)
|
||||
Int = Math.Min(125, Math.Max(10, Utility.ToInt32(entry3.Text)));
|
||||
}
|
||||
|
||||
private bool CanSelect(SkillName skill)
|
||||
{
|
||||
foreach (var sk in Selected)
|
||||
{
|
||||
if (User.Skills[skill] == sk)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (skill == SkillName.Spellweaving && !User.Spellweaving)
|
||||
return false;
|
||||
|
||||
if (skill == SkillName.Throwing && User.Race != Race.Gargoyle)
|
||||
return false;
|
||||
|
||||
if (skill == SkillName.Archery && User.Race == Race.Gargoyle)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
Scripts/Items/StoreBought/NameChangeToken.cs
Normal file
124
Scripts/Items/StoreBought/NameChangeToken.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Misc;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class NameChangeToken : Item, IPromotionalToken
|
||||
{
|
||||
public override int LabelNumber { get { return 1070997; } } // a promotional token
|
||||
public TextDefinition ItemName { get { return 1075247; } } // name change
|
||||
|
||||
public Type GumpType { get { return typeof(NameChangeConfirmGump); } }
|
||||
|
||||
[Constructable]
|
||||
public NameChangeToken()
|
||||
: base(0x2AAA)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (from is PlayerMobile)
|
||||
{
|
||||
from.CloseGump(typeof(NameChangeConfirmGump));
|
||||
BaseGump.SendGump(new NameChangeConfirmGump((PlayerMobile)from, this));
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : name change
|
||||
}
|
||||
|
||||
public NameChangeToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class NameChangeConfirmGump : BaseGump
|
||||
{
|
||||
public NameChangeToken Token { get; private set; }
|
||||
|
||||
public NameChangeConfirmGump(PlayerMobile pm, NameChangeToken token)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Token = token;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 291, 179, 9200);
|
||||
AddImageTiled(5, 5, 281, 20, 2702);
|
||||
AddImageTiled(5, 30, 281, 120, 2702);
|
||||
|
||||
AddHtmlLocalized(8, 5, 279, 20, 1075241, 0x7FFF, false, false); // Change your character's name
|
||||
|
||||
AddHtmlLocalized(8, 30, 279, 16, 1075242, 0x7FFF, false, false); // Enter your new name (16 characters max, English characters only):
|
||||
AddImageTiled(8, 50, 276, 20, 0xDB0);
|
||||
AddTextEntry(9, 50, 275, 20, 0, 0, "");
|
||||
AddHtmlLocalized(8, 70, 279, 80, 1075561, 0x7FFF, false, false); // Clicking OK will permanently change your character's name. Reversing this requires the purchase of an additional name change token. For more details, <A HREF="http://store2.origin.com/store/ea/en_US/DisplayProductDetailsPage/productID.244034900">visit our web site</A>.
|
||||
|
||||
AddButton(5, 152, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 152, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL
|
||||
|
||||
AddButton(126, 152, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(160, 152, 120, 20, 1075243, 0x7FFF, false, false); // Change my name!
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1 && Token.IsChildOf(User.Backpack))
|
||||
{
|
||||
TextRelay relay = info.GetTextEntry(0);
|
||||
|
||||
if (relay != null)
|
||||
{
|
||||
var text = relay.Text;
|
||||
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
User.SendLocalizedMessage(1075245); // Your name cannot be blank.
|
||||
}
|
||||
else if (text.Length > 16)
|
||||
{
|
||||
User.SendLocalizedMessage(1075244); // That name is too long.
|
||||
}
|
||||
else if (!NameVerification.Validate(text, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote))
|
||||
{
|
||||
User.SendLocalizedMessage(1075246); // That name is not valid.
|
||||
}
|
||||
else
|
||||
{
|
||||
User.Name = text;
|
||||
Token.Delete();
|
||||
|
||||
User.SendMessage("You have successfully changed your name."); // TODO: Message?
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
212
Scripts/Items/StoreBought/NaturalHairDyes.cs
Normal file
212
Scripts/Items/StoreBought/NaturalHairDyes.cs
Normal file
@@ -0,0 +1,212 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum HairDyeType
|
||||
{
|
||||
None,
|
||||
LemonLime,
|
||||
YewBrown,
|
||||
BloodwoodRed,
|
||||
VividBlue,
|
||||
AshBlonde,
|
||||
HeartwoodGreen,
|
||||
OakBlonde,
|
||||
SacredWhite,
|
||||
FrostwoodIceGreen,
|
||||
FieryBlonde,
|
||||
BitterBrown,
|
||||
GnawsTwistedBlue,
|
||||
DuskBlack,
|
||||
}
|
||||
|
||||
public class NaturalHairDye : Item
|
||||
{
|
||||
private HairDyeType m_Type;
|
||||
private TextDefinition m_Label;
|
||||
|
||||
[Constructable]
|
||||
public NaturalHairDye(HairDyeType type)
|
||||
: base(0xEFE)
|
||||
{
|
||||
Weight = 1.0;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
public NaturalHairDye(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
protected TextDefinition Label
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Label;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Label = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HairDyeType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Type = value;
|
||||
|
||||
var info = m_Table.FirstOrDefault(x => x.Type == m_Type);
|
||||
|
||||
if (info != null)
|
||||
{
|
||||
Hue = info.Hue;
|
||||
Label = info.Localization;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hue = 0;
|
||||
Label = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber { get { return 1071387; } } // Natural Hair Dye
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (m_Label != null && m_Label > 0)
|
||||
TextDefinition.AddTo(list, m_Label);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
BaseGump.SendGump(new HairDyeConfirmGump(m as PlayerMobile, Hue, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042010); //You must have the object in your backpack to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.WriteEncodedInt((int)m_Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Type = (HairDyeType)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
public static HairDyeInfo[] Table { get { return m_Table; } }
|
||||
private static HairDyeInfo[] m_Table =
|
||||
{
|
||||
// Hue, Label
|
||||
new HairDyeInfo( HairDyeType.None, 0, -1 ),
|
||||
new HairDyeInfo( HairDyeType.LemonLime, 1167, 1071439 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.YewBrown, 1192, 1071470 ), // Confirmed
|
||||
new HairDyeInfo( HairDyeType.BloodwoodRed, 1194, 1071471 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.VividBlue, 1152, 1071438 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.AshBlonde, 1191, 1071469 ), // Confirmed
|
||||
new HairDyeInfo( HairDyeType.HeartwoodGreen, 1193, 1071472 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.OakBlonde, 2010, 1071468 ), // Confirmed
|
||||
new HairDyeInfo( HairDyeType.SacredWhite, 1153, 1071474 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.FrostwoodIceGreen, 1151, 1071473 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.FieryBlonde, 1174, 1071440 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.BitterBrown, 1149, 1071437 ), // NOT Confirmed
|
||||
new HairDyeInfo( HairDyeType.GnawsTwistedBlue, 1195, 1071442 ), // Confirmed
|
||||
new HairDyeInfo( HairDyeType.DuskBlack, 1175, 1071441 ), // NOT Confirmed
|
||||
};
|
||||
|
||||
public class HairDyeInfo
|
||||
{
|
||||
public HairDyeType Type { get; private set; }
|
||||
public int Hue { get; private set; }
|
||||
public int Localization { get; private set; }
|
||||
|
||||
public HairDyeInfo(HairDyeType type, int hue, int loc)
|
||||
{
|
||||
Type = type;
|
||||
Hue = hue;
|
||||
Localization = loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HairDyeConfirmGump : BaseGump
|
||||
{
|
||||
public int Hue { get; private set; }
|
||||
public Item Dye { get; private set; }
|
||||
|
||||
public HairDyeConfirmGump(PlayerMobile pm, int hue, Item dye)
|
||||
: base(pm, 200, 200)
|
||||
{
|
||||
Hue = hue;
|
||||
Dye = dye;
|
||||
|
||||
pm.CloseGump(typeof(HairDyeConfirmGump));
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 340, 200, 3600);
|
||||
AddBackground(0, 0, 100, 100, 3600);
|
||||
AddBackground(100, 140, 227, 50, 9270);
|
||||
|
||||
AddImage(-39, -23, 50702, Dye.Hue - 1);
|
||||
|
||||
AddHtmlLocalized(110, 25, 205, 80, 1074396, C32216(0x0080FF), false, false); // This special hair dye is made of a unique mixture of leaves, permanently changing one's hair color until another dye is used.
|
||||
AddHtmlLocalized(120, 155, 160, 20, 1074395, C32216(0x00FFFF), false, false); // <div align=right>Use Permanent Hair Dye</div>
|
||||
|
||||
AddButton(290, 157, 0x7538, 0x7539, 1, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
if (!Dye.Deleted && Dye.IsChildOf(User.Backpack))
|
||||
{
|
||||
if (User.HairItemID !=0)
|
||||
{
|
||||
User.HairHue = Hue;
|
||||
|
||||
User.SendLocalizedMessage(501199); // You dye your hair
|
||||
Dye.Delete();
|
||||
User.PlaySound(0x4E);
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendLocalizedMessage(502623); // You have no hair to dye and you cannot use this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
User.SendLocalizedMessage(1042010); //You must have the object in your backpack to use it.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/StoreBought/PetBrandingIron.cs
Normal file
51
Scripts/Items/StoreBought/PetBrandingIron.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[TypeAlias("Server.Items.PetBraningIron")]
|
||||
public class PetBrandingIron : BaseEngravingTool
|
||||
{
|
||||
public override int GumpTitle { get { return 1157374; } }
|
||||
public override int LabelNumber { get { return 1157314; } }
|
||||
|
||||
public override int SuccessMessage { get { return 1157382; } } // // You brand the pet.
|
||||
public override int TargetMessage { get { return 1157379; } } // Select a pet to brand.
|
||||
public override int RemoveMessage { get { return 1157380; } } // You remove the brand from the pet.
|
||||
public override int OutOfChargesMessage { get { return 1157377; } } // There are no charges left on this branding iron.
|
||||
public override int NotAccessibleMessage { get { return 1157376; } } // The selected pet is not accessible to brand.
|
||||
public override int CannotEngraveMessage { get { return 1157375; } } // The selected pet cannot be branded by this branding iron.
|
||||
|
||||
public override Type[] Engraves { get { return new Type[] { typeof(BaseCreature) }; } }
|
||||
|
||||
[Constructable]
|
||||
public PetBrandingIron()
|
||||
: this(30)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PetBrandingIron(int charges)
|
||||
: base(0x9E87, charges)
|
||||
{
|
||||
}
|
||||
|
||||
public PetBrandingIron(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
269
Scripts/Items/StoreBought/PetWhistle.cs
Normal file
269
Scripts/Items/StoreBought/PetWhistle.cs
Normal file
@@ -0,0 +1,269 @@
|
||||
using System;
|
||||
using Server.Accounting;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PetWhistle : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1126239; } } // whistle
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextLinkedTime { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Account { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public BaseCreature PetLinked { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsUsable { get { return NextLinkedTime < DateTime.UtcNow; } }
|
||||
|
||||
[Constructable]
|
||||
public PetWhistle()
|
||||
: base(0xA4E7)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public PetWhistle(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Account))
|
||||
{
|
||||
Account acct = from.Account as Account;
|
||||
|
||||
if (acct == null || acct.Username != Account)
|
||||
{
|
||||
from.SendLocalizedMessage(1151920); // This item is Account Bound, you are not permitted to take this action.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
if (PetLinked != null)
|
||||
{
|
||||
from.CloseGump(typeof(PetWhistleGump));
|
||||
from.SendGump(new PetWhistleGump(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1159390); // Target a bonded pet to link this whistle.
|
||||
from.Target = new InternalTarget(this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (PetLinked != null)
|
||||
list.Add(1159360, PetLinked.Name); // Pet Whistle for ~1_name~
|
||||
|
||||
if (!string.IsNullOrEmpty(Account))
|
||||
list.Add(1155526); // Account Bound
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
list.Add(new LinkBondedPetEntry(from, this));
|
||||
}
|
||||
|
||||
private class LinkBondedPetEntry : ContextMenuEntry
|
||||
{
|
||||
private readonly PetWhistle _Item;
|
||||
private readonly Mobile m_From;
|
||||
|
||||
public LinkBondedPetEntry(Mobile from, PetWhistle item)
|
||||
: base(1159393, 6) // Link Bonded Pet
|
||||
{
|
||||
m_From = from;
|
||||
_Item = item;
|
||||
|
||||
Enabled = _Item.IsUsable;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_From == null || _Item.Deleted)
|
||||
return;
|
||||
|
||||
if (_Item.IsChildOf(m_From.Backpack))
|
||||
{
|
||||
m_From.SendLocalizedMessage(1159390); // Target a bonded pet to link this whistle.
|
||||
m_From.Target = new InternalTarget(_Item);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private readonly PetWhistle _Item;
|
||||
|
||||
public InternalTarget(PetWhistle item)
|
||||
: base(12, true, TargetFlags.None)
|
||||
{
|
||||
_Item = item;
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (_Item.Deleted)
|
||||
return;
|
||||
|
||||
if (!_Item.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (targeted is BaseCreature && ((BaseCreature)targeted).ControlMaster == from)
|
||||
{
|
||||
if (((BaseCreature)targeted).IsBonded)
|
||||
{
|
||||
if (_Item.IsUsable)
|
||||
{
|
||||
_Item.PetLinked = (BaseCreature)targeted;
|
||||
_Item.NextLinkedTime = DateTime.UtcNow + TimeSpan.FromDays(7);
|
||||
_Item.InvalidateProperties();
|
||||
|
||||
from.CloseGump(typeof(PetWhistleGump));
|
||||
from.SendGump(new PetWhistleGump(_Item));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((DateTime.UtcNow -_Item.NextLinkedTime).Seconds > 60)
|
||||
{
|
||||
from.SendLocalizedMessage(1159391); // You must wait ~1_minutes~ minutes before you can link another pet to this whistle.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1159392); // You must wait ~1_seconds~ seconds before you can link another pet to this whistle.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1159373); // This item can only be linked to a bonded pet.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1149667); // Invalid target.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PetWhistleGump : Gump
|
||||
{
|
||||
private readonly PetWhistle _Item;
|
||||
|
||||
public PetWhistleGump(PetWhistle item)
|
||||
: base(100, 100)
|
||||
{
|
||||
_Item = item;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 255, 260, 0x5B4);
|
||||
AddAlphaRegion(0, 0, 255, 260);
|
||||
AddItem(100, 39, 42215);
|
||||
AddHtmlLocalized(81, 73, 157, 22, 1159405, 0x76F2, false, false); // Attack
|
||||
AddButton(41, 73, 0xFA5, 0xFA6, 1000, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 97, 157, 22, 1159407, 0x76F2, false, false); // Block
|
||||
AddButton(41, 97, 0xFA5, 0xFA6, 1002, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 121, 157, 22, 1159375, 0x76F2, false, false); // Play Dead
|
||||
AddButton(41, 121, 0xFA5, 0xFA6, 1003, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 145, 157, 22, 1159378, 0x76F2, false, false); // Settle Down
|
||||
AddButton(41, 145, 0xFA5, 0xFA6, 1004, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 169, 157, 22, 1159377, 0x76F2, false, false); // Wait
|
||||
AddButton(41, 169, 0xFA5, 0xFA6, 1005, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 193, 157, 22, 1159406, 0x76F2, false, false); // Eat
|
||||
AddButton(41, 193, 0xFA5, 0xFA6, 1006, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(81, 217, 157, 22, 1159388, 0x76F2, false, false); // What's that?
|
||||
AddButton(41, 217, 0xFA5, 0xFA6, 1008, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 15, 200, 18, 1159360, item.PetLinked.Name, 0x6A05, false, false); // Pet Whistle for ~1_name~
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (_Item.Deleted ||_Item.PetLinked == null)
|
||||
return;
|
||||
|
||||
Mobile m = sender.Mobile;
|
||||
|
||||
if (_Item.PetLinked.ControlOrder != OrderType.Stay || _Item.PetLinked.ControlMaster != m)
|
||||
m.SendLocalizedMessage(1159389); // You must command your pet to stay before using this item.
|
||||
|
||||
Effects.PlaySound(m.Location, m.Map, 1665);
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1000:
|
||||
_Item.PetLinked.Animate(AnimationType.Attack, 0);
|
||||
break;
|
||||
case 1002:
|
||||
_Item.PetLinked.Animate(AnimationType.Block, 0);
|
||||
break;
|
||||
case 1003:
|
||||
_Item.PetLinked.Animate(AnimationType.Die, 0);
|
||||
break;
|
||||
case 1004:
|
||||
_Item.PetLinked.Animate(AnimationType.Impact, 0);
|
||||
break;
|
||||
case 1005:
|
||||
_Item.PetLinked.Animate(AnimationType.Fidget, 0);
|
||||
break;
|
||||
case 1006:
|
||||
_Item.PetLinked.Animate(AnimationType.Eat, 0);
|
||||
break;
|
||||
case 1008:
|
||||
_Item.PetLinked.Animate(AnimationType.Alert, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Account);
|
||||
writer.Write(NextLinkedTime);
|
||||
writer.Write(PetLinked);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Account = reader.ReadString();
|
||||
NextLinkedTime = reader.ReadDateTime();
|
||||
PetLinked = (BaseCreature)reader.ReadMobile();
|
||||
}
|
||||
}
|
||||
}
|
||||
216
Scripts/Items/StoreBought/RaceChangeToken.cs
Normal file
216
Scripts/Items/StoreBought/RaceChangeToken.cs
Normal file
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Engines.Quests;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RaceChangeToken : Item, IPromotionalToken
|
||||
{
|
||||
public override int LabelNumber { get { return 1070997; } } // a promotional token
|
||||
public TextDefinition ItemName { get { return 1113656; } } // race change
|
||||
|
||||
public Type GumpType { get { return typeof(RaceChangeConfirmGump); } }
|
||||
[Constructable]
|
||||
public RaceChangeToken()
|
||||
: base(0x2AAA)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else if (from is PlayerMobile)
|
||||
{
|
||||
from.CloseGump(typeof(RaceChangeConfirmGump));
|
||||
BaseGump.SendGump(new RaceChangeConfirmGump((PlayerMobile)from, this));
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>Your ~1_PROMO~ : race change
|
||||
}
|
||||
|
||||
public RaceChangeToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public static Dictionary<Mobile, Tuple<RaceChangeToken, Race>> Pending { get; private set; }
|
||||
|
||||
public static bool AddPending(Mobile m, Race race, RaceChangeToken token)
|
||||
{
|
||||
if (token.IsChildOf(m.Backpack))
|
||||
{
|
||||
if (Pending == null)
|
||||
Pending = new Dictionary<Mobile, Tuple<RaceChangeToken, Race>>();
|
||||
|
||||
Pending[m] = new Tuple<RaceChangeToken, Race>(token, race);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void RemovePending(Mobile m)
|
||||
{
|
||||
if (Pending != null && Pending.ContainsKey(m))
|
||||
{
|
||||
Pending.Remove(m);
|
||||
|
||||
if (Pending.Count == 0)
|
||||
Pending = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsPending(Mobile m)
|
||||
{
|
||||
return Pending != null && Pending.ContainsKey(m);
|
||||
}
|
||||
|
||||
public static Race GetPendingRace(Mobile m)
|
||||
{
|
||||
if (Pending != null && Pending.ContainsKey(m))
|
||||
{
|
||||
var tuple = Pending[m];
|
||||
|
||||
if (!tuple.Item1.IsChildOf(m.Backpack))
|
||||
{
|
||||
m.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
return Pending[m].Item2;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void OnRaceChange(Mobile m)
|
||||
{
|
||||
if (Pending != null && Pending.ContainsKey(m))
|
||||
{
|
||||
var tuple = Pending[m];
|
||||
|
||||
if (tuple.Item1 != null && !tuple.Item1.Deleted)
|
||||
{
|
||||
tuple.Item1.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RaceChangeConfirmGump : BaseGump
|
||||
{
|
||||
public enum GumpMode
|
||||
{
|
||||
Confirm,
|
||||
Select
|
||||
}
|
||||
|
||||
public RaceChangeToken Token { get; private set; }
|
||||
public GumpMode Mode { get; private set; }
|
||||
|
||||
public RaceChangeConfirmGump(PlayerMobile pm, RaceChangeToken token, GumpMode mode = GumpMode.Confirm)
|
||||
: base(pm, 100, 100)
|
||||
{
|
||||
Token = token;
|
||||
Mode = mode;
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddBackground(0, 0, 291, 159, 9200);
|
||||
AddImageTiled(5, 5, 281, 20, 2702);
|
||||
AddImageTiled(5, 30, 281, 100, 2702);
|
||||
|
||||
AddHtmlLocalized(8, 5, 279, 20, 1113641, 0x7FFF, false, false); // Change your character's race.
|
||||
|
||||
AddButton(5, 132, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(40, 132, 100, 20, 1011012, 0x7FFF, false, false); // CANCEL
|
||||
|
||||
if (Mode == GumpMode.Confirm)
|
||||
{
|
||||
AddHtmlLocalized(8, 30, 279, 124, 1113642, 0x7FFF, false, false); // Click OK to change your character's race. This change is permanent.<BR><BR>Are you sure you wish to change your character's race?
|
||||
|
||||
AddButton(126, 132, 0xFB7, 0xFB9, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(160, 132, 120, 20, 1113643, 0x7FFF, false, false); // CHANGE RACE
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(8, 30, 279, 40, 1113657, 0x7FFF, false, false);
|
||||
|
||||
int y = 80;
|
||||
|
||||
if (User.Race != Race.Human)
|
||||
{
|
||||
AddButton(8, y, 0xFB7, 0xFB9, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(100, y, 150, 20, 1111906, 0x7FFF, false, false); // Make me a human!
|
||||
y += 25;
|
||||
}
|
||||
|
||||
if (User.Race != Race.Elf)
|
||||
{
|
||||
AddButton(8, y, 0xFB7, 0xFB9, 3, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(100, y, 150, 20, 1111910, 0x7FFF, false, false); // Make me an elf!
|
||||
y += 25;
|
||||
}
|
||||
|
||||
if (User.Race != Race.Gargoyle)
|
||||
{
|
||||
AddButton(8, y, 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(100, y, 150, 20, 1111900, 0x7FFF, false, false); // Make me a gargoyle!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
int id = info.ButtonID;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
Mode = GumpMode.Select;
|
||||
Refresh();
|
||||
break;
|
||||
default:
|
||||
if (User.NetState != null && HeritageQuester.Check(User) && RaceChangeToken.AddPending(User, Race.Races[id - 2], Token))
|
||||
{
|
||||
User.NetState.Send(new HeritagePacket(User.Female, (short)(id - 1)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
414
Scripts/Items/StoreBought/SecretChest.cs
Normal file
414
Scripts/Items/StoreBought/SecretChest.cs
Normal file
@@ -0,0 +1,414 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SecretChestArray
|
||||
{
|
||||
public Mobile Mobile { get; set; }
|
||||
public bool Permission { get; set; }
|
||||
public int TrialsNumber { get; set; }
|
||||
public DateTime Expire { get; set; }
|
||||
}
|
||||
|
||||
[FlipableAttribute(0x9707, 0x9706)]
|
||||
public class SecretChest : LockableContainer
|
||||
{
|
||||
public List<SecretChestArray> list = new List<SecretChestArray>();
|
||||
|
||||
public override int LabelNumber { get { return 1151583; } } // Secret Chest
|
||||
|
||||
public override int DefaultGumpID { get { return 0x58E; } }
|
||||
|
||||
public int[] SecretKey { get; set; } = { 0, 0, 0, 0, 0 };
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile LockingPerson { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public SecretChest()
|
||||
: this(0x9707)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SecretChest(int id)
|
||||
: base(id)
|
||||
{
|
||||
Weight = 5;
|
||||
}
|
||||
|
||||
public bool CheckPermission(Mobile from)
|
||||
{
|
||||
var p = list.FirstOrDefault(x => x.Mobile == from);
|
||||
|
||||
return Locked && LockingPerson.Account != from.Account && p != null && !p.Permission;
|
||||
}
|
||||
|
||||
public override void Open(Mobile from)
|
||||
{
|
||||
if (Locked && from.AccessLevel < AccessLevel.GameMaster && LockingPerson.Account != from.Account)
|
||||
{
|
||||
var l = list.FirstOrDefault(x => x.Mobile == from);
|
||||
|
||||
if (l == null)
|
||||
{
|
||||
l = new SecretChestArray { Mobile = from, TrialsNumber = 3 };
|
||||
list.Add(l);
|
||||
}
|
||||
|
||||
if (l.Permission)
|
||||
{
|
||||
from.SendLocalizedMessage(1151600); // You remember the key number of this chest, so you can open this now.
|
||||
DisplayTo(from);
|
||||
return;
|
||||
}
|
||||
|
||||
if (l.TrialsNumber == 0 && l.Expire < DateTime.UtcNow)
|
||||
{
|
||||
l.TrialsNumber = 3;
|
||||
}
|
||||
|
||||
if (l.TrialsNumber > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(501747); // It appears to be locked.
|
||||
from.SendLocalizedMessage(1151527); // Enter the key number to open.
|
||||
from.SendLocalizedMessage(1152346, string.Format("{0}", l.TrialsNumber)); // Number of tries left: ~1_times~
|
||||
from.SendGump(new SecretChestGump(this, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1151599); // You cannot access the chest now, having exhausted your number of attempts.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayTo(from);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (LockingPerson == null || LockingPerson != null && LockingPerson.Account == from.Account)
|
||||
{
|
||||
list.Add(new SetEditKeyNumber(from, this));
|
||||
list.Add(new ResetKeyNumber(from, this));
|
||||
}
|
||||
}
|
||||
|
||||
private class SetEditKeyNumber : ContextMenuEntry
|
||||
{
|
||||
private readonly SecretChest Chest;
|
||||
private Mobile Mobile;
|
||||
|
||||
public SetEditKeyNumber(Mobile m, SecretChest c)
|
||||
: base(1151608, -1) // Set/Edit Key Number
|
||||
{
|
||||
Mobile = m;
|
||||
Chest = c;
|
||||
|
||||
if (!c.IsChildOf(m.Backpack))
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (Mobile != null && Chest != null)
|
||||
{
|
||||
if (Chest.Locked)
|
||||
Mobile.SendLocalizedMessage(1151588); // Edit your key number. If you don't want to change current key number, click CANCEL button.
|
||||
else
|
||||
Mobile.SendLocalizedMessage(1151525); // Set your key number. If you want to leave this unlocked, click CANCEL button.
|
||||
|
||||
Mobile.SendGump(new SecretChestGump(Chest, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class ResetKeyNumber : ContextMenuEntry
|
||||
{
|
||||
private readonly SecretChest Chest;
|
||||
private Mobile Mobile;
|
||||
|
||||
public ResetKeyNumber(Mobile m, SecretChest c)
|
||||
: base(1151609, -1) // Reset Key Number
|
||||
{
|
||||
Mobile = m;
|
||||
Chest = c;
|
||||
|
||||
if (!c.IsChildOf(m.Backpack) || !Chest.Locked)
|
||||
Flags |= CMEFlags.Disabled;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (Mobile != null && Chest != null)
|
||||
{
|
||||
Chest.Locked = false;
|
||||
Chest.LockingPerson = null;
|
||||
Chest.list.Clear();
|
||||
Mobile.SendLocalizedMessage(1151598); // You have reset the number key of this chest. This is unlocked now.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DisplaysContent { get { return false; } }
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Locked)
|
||||
list.Add(1151610); // Locked
|
||||
|
||||
list.Add(1072241, "{0}\t{1}\t{2}\t{3}", TotalItems, MaxItems, TotalWeight, MaxWeight);
|
||||
// Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones
|
||||
}
|
||||
|
||||
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
|
||||
{
|
||||
if (CheckPermission(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1151591); // You cannot place items into a locked chest!
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CheckHold(from, dropped, true, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && IsLockedDown)
|
||||
{
|
||||
if (!house.CheckAccessibility(this, from))
|
||||
{
|
||||
PrivateOverheadMessage(MessageType.Regular, 0x21, 1061637, from.NetState); // You are not allowed to access this!
|
||||
from.SendLocalizedMessage(501727); // You cannot lock that down!
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DropItem(dropped);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsAccessibleTo(Mobile m)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public SecretChest(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write(LockingPerson);
|
||||
|
||||
writer.Write(list.Count);
|
||||
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
writer.Write(list[i].Mobile);
|
||||
writer.Write(list[i].Permission);
|
||||
writer.Write(list[i].TrialsNumber);
|
||||
writer.Write(list[i].Expire);
|
||||
}
|
||||
|
||||
writer.Write(SecretKey.Length);
|
||||
|
||||
for (int i = 0; i < SecretKey.Length; ++i)
|
||||
{
|
||||
writer.Write(SecretKey[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
LockingPerson = reader.ReadMobile();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
Mobile m = reader.ReadMobile();
|
||||
|
||||
if (m != null)
|
||||
{
|
||||
list.Add(new SecretChestArray { Mobile = m, Permission= reader.ReadBool(), TrialsNumber = reader.ReadInt(), Expire = reader.ReadDateTime() });
|
||||
}
|
||||
}
|
||||
|
||||
count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
SecretKey[i] = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SecretChestGump : Gump
|
||||
{
|
||||
private readonly SecretChest Chest;
|
||||
private readonly int[] TempSecretKey;
|
||||
private readonly bool SetEdit;
|
||||
|
||||
public SecretChestGump(SecretChest chest, bool setedit)
|
||||
: this(chest, null, setedit)
|
||||
{
|
||||
}
|
||||
|
||||
public SecretChestGump(SecretChest chest, int[] sk, bool setedit)
|
||||
: base(0, 0)
|
||||
{
|
||||
Chest = chest;
|
||||
|
||||
SetEdit = setedit;
|
||||
|
||||
if (setedit)
|
||||
{
|
||||
TempSecretKey = chest.SecretKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sk == null)
|
||||
{
|
||||
TempSecretKey = new int[] { 0, 0, 0, 0, 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
TempSecretKey = sk;
|
||||
}
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddImage(50, 50, 0x58D);
|
||||
|
||||
AddButton(133, 270, 0x81A, 0x81B, SetEdit ? 2 : 1, GumpButtonType.Reply, 0); // OKAY
|
||||
AddButton(320, 270, 0x819, 0x818, 0, GumpButtonType.Reply, 0); // CANCEL
|
||||
|
||||
for (int i = 0; i < TempSecretKey.Length; ++i)
|
||||
{
|
||||
AddButton(192 + (24 * i), 190, 0x58C, 0x58C, 10 + (i * 2), GumpButtonType.Reply, 0);
|
||||
AddImage(190 + (24 * i), 200, 0x58F + TempSecretKey[i]);
|
||||
AddButton(192 + (24 * i), 230, 0x599, 0x599, 11 + (i * 2), GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (Chest == null)
|
||||
return;
|
||||
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
from.SendLocalizedMessage(1042021); // Cancelled.
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
var l = Chest.list.FirstOrDefault(x => x.Mobile == from);
|
||||
|
||||
if (l == null)
|
||||
return;
|
||||
|
||||
if (Chest.SecretKey.SequenceEqual(TempSecretKey))
|
||||
{
|
||||
from.SendLocalizedMessage(1151589); // You succeed at entering the correct key number; you may open the chest now.
|
||||
l.Permission = true;
|
||||
Chest.DisplayTo(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
l.TrialsNumber--;
|
||||
|
||||
if (l.TrialsNumber > 0)
|
||||
{
|
||||
from.SendLocalizedMessage(1151590); // The number which you have entered is wrong. You still can't open this chest...
|
||||
from.SendLocalizedMessage(1152346, string.Format("{0}", l.TrialsNumber)); // Number of tries left: ~1_times~
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.2), () => from.SendGump(new SecretChestGump(Chest, TempSecretKey, SetEdit)));
|
||||
}
|
||||
else
|
||||
{
|
||||
l.Expire = DateTime.UtcNow + TimeSpan.FromDays(1);
|
||||
from.SendLocalizedMessage(1151611); // You have exhausted your unlock attempts for this chest; you must wait 24 hours to try again.
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
for (int i = 0; i < Chest.SecretKey.Length; ++i)
|
||||
{
|
||||
Chest.SecretKey[i] = TempSecretKey[i];
|
||||
}
|
||||
|
||||
Chest.Locked = true;
|
||||
Chest.LockingPerson = from;
|
||||
Chest.list.Clear();
|
||||
from.SendLocalizedMessage(1151528); // The key numbers have been set; this chest is now locked.
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
int index = info.ButtonID - 10;
|
||||
|
||||
if (info.ButtonID % 2 == 0)
|
||||
{
|
||||
index /= 2;
|
||||
|
||||
if (TempSecretKey[index] == 9)
|
||||
{
|
||||
TempSecretKey[index] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
TempSecretKey[index]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
index = (index - 1) / 2;
|
||||
|
||||
if (TempSecretKey[index] == 0)
|
||||
{
|
||||
TempSecretKey[index] = 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
TempSecretKey[index]--;
|
||||
}
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.2), () => from.SendGump(new SecretChestGump(Chest, TempSecretKey, SetEdit)));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
145
Scripts/Items/StoreBought/SmugglersEdge.cs
Normal file
145
Scripts/Items/StoreBought/SmugglersEdge.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.CreatureStealing;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Alterable(typeof(DefTinkering), typeof(GargishSmugglersEdge))]
|
||||
public class SmugglersEdge : ButcherKnife
|
||||
{
|
||||
public override int LabelNumber { get { return 1071499; } } // Smuggler's Edge
|
||||
public override bool CanFortify { get { return false; } }
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public SmugglersEdge()
|
||||
{
|
||||
Hue = 1461;
|
||||
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.WeaponSpeed = 30;
|
||||
|
||||
if (!Siege.SiegeShard)
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
public override int AosMinDamage { get { return 9; } }
|
||||
public override int AosMaxDamage { get { return 11; } }
|
||||
|
||||
public SmugglersEdge(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnHit(Mobile attacker, IDamageable damageable, double damageBonus)
|
||||
{
|
||||
base.OnHit(attacker, damageable, damageBonus);
|
||||
|
||||
if (damageable is BaseCreature)
|
||||
{
|
||||
if (attacker.FindItemOnLayer(Layer.TwoHanded) != null)
|
||||
{
|
||||
attacker.SendLocalizedMessage(1071501); // Your left hand must be free to steal an item from the creature.
|
||||
}
|
||||
else if (attacker is PlayerMobile)
|
||||
{
|
||||
StealingHandler.HandleSmugglersEdgeSteal((BaseCreature)damageable, (PlayerMobile)attacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1071500); // Monster Stealing
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Attributes.WeaponSpeed = 30;
|
||||
}
|
||||
}
|
||||
|
||||
public class GargishSmugglersEdge : GargishButcherKnife
|
||||
{
|
||||
public override int LabelNumber { get { return 1071499; } } // Smuggler's Edge
|
||||
public override bool CanFortify { get { return false; } }
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public GargishSmugglersEdge()
|
||||
{
|
||||
Hue = 1461;
|
||||
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.WeaponSpeed = 30;
|
||||
|
||||
if (!Siege.SiegeShard)
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
public override int AosMinDamage { get { return 9; } }
|
||||
public override int AosMaxDamage { get { return 11; } }
|
||||
|
||||
public GargishSmugglersEdge(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnHit(Mobile attacker, IDamageable damageable, double damageBonus)
|
||||
{
|
||||
base.OnHit(attacker, damageable, damageBonus);
|
||||
|
||||
if (damageable is BaseCreature)
|
||||
{
|
||||
if (attacker.FindItemOnLayer(Layer.TwoHanded) != null)
|
||||
{
|
||||
attacker.SendLocalizedMessage(1071501); // Your left hand must be free to steal an item from the creature.
|
||||
}
|
||||
else if (attacker is PlayerMobile)
|
||||
{
|
||||
StealingHandler.HandleSmugglersEdgeSteal((BaseCreature)damageable, (PlayerMobile)attacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1071500); // Monster Stealing
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Attributes.WeaponSpeed = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
107
Scripts/Items/StoreBought/SnowTree.cs
Normal file
107
Scripts/Items/StoreBought/SnowTree.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SnowTreeAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SnowTreeDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public SnowTreeAddon(bool trunk)
|
||||
{
|
||||
AddComponent(new LocalizedAddonComponent(0xDA0, 1071103), 0, 0, 0);
|
||||
|
||||
if (!trunk)
|
||||
{
|
||||
var comp = new LocalizedAddonComponent(0xD9D, 1071103);
|
||||
comp.Hue = 1153;
|
||||
AddComponent(comp, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public SnowTreeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class SnowTreeDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new SnowTreeAddon(m_Trunk); } }
|
||||
public override int LabelNumber { get { return 1071103; } } // Snow Tree
|
||||
|
||||
private bool m_Trunk;
|
||||
|
||||
[Constructable]
|
||||
public SnowTreeDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1071103); // Snow Tree
|
||||
list.Add(1, 1071300); // Snow Tree (trunk)
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_Trunk = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public SnowTreeDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
222
Scripts/Items/StoreBought/SpiralStaircase.cs
Normal file
222
Scripts/Items/StoreBought/SpiralStaircase.cs
Normal file
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using Server.Multis;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TeleporterComponent : AddonComponent
|
||||
{
|
||||
public override bool ForceShowProperties { get { return true; } }
|
||||
|
||||
public Direction _Direction { get; set; }
|
||||
|
||||
public TeleporterComponent(int itemID, Direction d)
|
||||
: base(itemID)
|
||||
{
|
||||
_Direction = d;
|
||||
}
|
||||
|
||||
public TeleporterComponent(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, Addon, list);
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if (m is PlayerMobile && ((SpiralStaircaseAddon)Addon).CheckAccessible(m, this))
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(0.5), () => DoTeleport(m));
|
||||
}
|
||||
|
||||
return base.OnMoveOver(m);
|
||||
}
|
||||
|
||||
public virtual void DoTeleport(Mobile m)
|
||||
{
|
||||
Map map = Map;
|
||||
|
||||
if (map == null || map == Map.Internal)
|
||||
{
|
||||
map = m.Map;
|
||||
}
|
||||
|
||||
TeleporterComponent c = Addon.Components.FirstOrDefault(x => x is TeleporterComponent && x != this) as TeleporterComponent;
|
||||
|
||||
Point3D p = new Point3D(c.Location.X, c.Location.Y, c._Direction == Direction.Up ? Location.Z + 20 : c.Location.Z);
|
||||
|
||||
BaseCreature.TeleportPets(m, p, map);
|
||||
|
||||
m.MoveToWorld(p, map);
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
|
||||
writer.Write((int)_Direction);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
_Direction = (Direction)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiralStaircaseAddon : BaseAddon, ISecurable, IDyable
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SpiralStaircaseDeed(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public SpiralStaircaseAddon(bool topper)
|
||||
{
|
||||
if (topper)
|
||||
{
|
||||
AddComponent(new AddonComponent(42319), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(42320), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(42333), 1, 1, 20);
|
||||
AddComponent(new AddonComponent(42334), 0, 1, 20);
|
||||
AddComponent(new AddonComponent(42335), 1, 0, 20);
|
||||
AddComponent(new TeleporterComponent(42336, Direction.Up), 0, 0, 20);
|
||||
AddComponent(new TeleporterComponent(42318, Direction.Down), 1, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new TeleporterComponent(42321, Direction.Up), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(42319), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(42320), 1, 0, 0);
|
||||
AddComponent(new TeleporterComponent(42318, Direction.Down), 1, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
|
||||
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 (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;
|
||||
}
|
||||
|
||||
public SpiralStaircaseAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0); // Version
|
||||
|
||||
writer.Write((int)Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiralStaircaseDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new SpiralStaircaseAddon(m_Topper); } }
|
||||
public override int LabelNumber { get { return 1159429; } } // spiral staircase
|
||||
|
||||
private bool m_Topper;
|
||||
|
||||
[Constructable]
|
||||
public SpiralStaircaseDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1159431); // Without Topper
|
||||
list.Add(1, 1159432); // With Topper
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_Topper = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(AddonOptionGump));
|
||||
from.SendGump(new AddonOptionGump(this, 1159430, 300, 180)); // Choose an option:
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public SpiralStaircaseDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
40
Scripts/Items/StoreBought/SquirrelMailbox.cs
Normal file
40
Scripts/Items/StoreBought/SquirrelMailbox.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
public class SquirrelMailbox : Mailbox, IFlipable
|
||||
{
|
||||
public override int LabelNumber { get { return 1113927; } } // Mailbox
|
||||
|
||||
public override int DefaultGumpID { get { return 0x6D4; } }
|
||||
|
||||
public override int SouthMailBoxID { get { return 0xA208; } }
|
||||
public override int SouthEmptyMailBoxID { get { return 0xA209; } }
|
||||
public override int EastMailBoxID { get { return 0xA206; } }
|
||||
public override int EastEmptyMailBoxID { get { return 0xA207; } }
|
||||
|
||||
[Constructable]
|
||||
public SquirrelMailbox()
|
||||
: base(0xA207)
|
||||
{
|
||||
}
|
||||
|
||||
public SquirrelMailbox(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
145
Scripts/Items/StoreBought/StableSlotIncreaseToken.cs
Normal file
145
Scripts/Items/StoreBought/StableSlotIncreaseToken.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Accounting;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class StableSlotIncreaseToken : Item, IAccountRestricted, IPromotionalToken
|
||||
{
|
||||
public const int SlotIncrease = 3;
|
||||
public const int MaxPerChar = 21;
|
||||
|
||||
public override int LabelNumber { get { return 1070997; } } // A promotional token
|
||||
public TextDefinition ItemName { get { return 1157618; } } // your Stable Slot Increase (Account-Bound)
|
||||
|
||||
public Type GumpType { get { return typeof(StableSlotIncreaseToken.InternalGump); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Account { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public StableSlotIncreaseToken()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public StableSlotIncreaseToken(string account)
|
||||
: base(0x2AAA)
|
||||
{
|
||||
Account = account;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1070998, ItemName.ToString()); // Use this to redeem<br>your Stable Slot Increase (Account-Bound)
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!IsChildOf(m.Backpack))
|
||||
{
|
||||
m.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
Account acct = m.Account as Account;
|
||||
|
||||
if (acct == null || acct.Username != Account)
|
||||
{
|
||||
m.SendLocalizedMessage(1157610); // You may not use this item as it is an account-bound item that is bound to a different account.
|
||||
return;
|
||||
}
|
||||
|
||||
m.CloseGump(typeof(InternalGump));
|
||||
m.SendGump(new InternalGump(this));
|
||||
}
|
||||
}
|
||||
|
||||
public void OnUsed(Mobile from)
|
||||
{
|
||||
PlayerMobile pm = from as PlayerMobile;
|
||||
|
||||
if (pm != null)
|
||||
{
|
||||
if (pm.RewardStableSlots >= 21)
|
||||
{
|
||||
pm.SendLocalizedMessage(1157612); // You cannot increase the number of stable slots on this character. You have already reached the cap of 21 additional token stable slots or 42 total stable slots.
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.RewardStableSlots += SlotIncrease;
|
||||
pm.SendLocalizedMessage(1157611, AnimalTrainer.GetMaxStabled(from).ToString()); // You have increased your stable slot count by 3. Your total stable count is now ~1_VAL~.
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private StableSlotIncreaseToken m_Token;
|
||||
|
||||
public InternalGump(StableSlotIncreaseToken token)
|
||||
: base(10, 10)
|
||||
{
|
||||
m_Token = token;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 240, 235, 0x2422);
|
||||
AddHtmlLocalized(15, 15, 210, 175, 1157609, 0x0, true, false); // This account-bound token will increase the maximum number of creatures a character can house at the stables by 3, up to a maximum of 42 total stables slots from all sources. A character may use a total of 7 tokens.
|
||||
|
||||
AddButton(160, 195, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0); //Okay
|
||||
AddButton(90, 195, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0); //Cancel
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID != 1)
|
||||
return;
|
||||
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (!m_Token.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Token.OnUsed(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public StableSlotIncreaseToken(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Account);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Account = reader.ReadString();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Scripts/Items/StoreBought/StoreSingingBall.cs
Normal file
85
Scripts/Items/StoreBought/StoreSingingBall.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public enum SBType
|
||||
{
|
||||
DrunkWomans,
|
||||
DrunkMans,
|
||||
Bedlam,
|
||||
SosarianSteeds,
|
||||
BlueBoar
|
||||
}
|
||||
|
||||
public class StoreSingingBall : SingingBall
|
||||
{
|
||||
public override int LabelNumber { get { return 1152323 + (int)Type; } }
|
||||
|
||||
public SBType Type { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public StoreSingingBall()
|
||||
: base(0x468A)
|
||||
{
|
||||
var values = Enum.GetValues(typeof(SBType));
|
||||
Type = (SBType)values.GetValue(Utility.Random(values.Length));
|
||||
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Regular;
|
||||
SetHue();
|
||||
}
|
||||
|
||||
private void SetHue()
|
||||
{
|
||||
if (Type == SBType.Bedlam)
|
||||
Hue = 2611;
|
||||
else if (Type == SBType.BlueBoar)
|
||||
Hue = 2514;
|
||||
else if (Type == SBType.DrunkMans)
|
||||
Hue = 2659;
|
||||
else if (Type == SBType.DrunkWomans)
|
||||
Hue = 2596;
|
||||
else
|
||||
Hue = 2554;
|
||||
}
|
||||
|
||||
public override int SoundList()
|
||||
{
|
||||
int sound = 0;
|
||||
|
||||
if (Type == SBType.Bedlam)
|
||||
sound = Utility.RandomList(897, 1005, 889, 1001, 1002, 1004, 1005, 894, 893, 889, 1003);
|
||||
else if (Type == SBType.BlueBoar)
|
||||
sound = Utility.RandomList(1073, 1085, 811, 799, 1066, 794, 801, 1075, 803, 811, 1071);
|
||||
else if (Type == SBType.DrunkMans)
|
||||
sound = Utility.RandomMinMax(1049, 1098);
|
||||
else if (Type == SBType.DrunkWomans)
|
||||
sound = Utility.RandomMinMax(778, 823);
|
||||
else
|
||||
sound = Utility.RandomList(1218, 751, 629, 1226, 1305, 1246, 1019, 1508, 674, 1241);
|
||||
|
||||
return sound;
|
||||
}
|
||||
|
||||
public StoreSingingBall(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write((int)Type);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Type = (SBType)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
376
Scripts/Items/StoreBought/UndertakersStaff.cs
Normal file
376
Scripts/Items/StoreBought/UndertakersStaff.cs
Normal file
@@ -0,0 +1,376 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.ContextMenus;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UndertakersStaff : GnarledStaff
|
||||
{
|
||||
private static Dictionary<Mobile, CorpseRetrieveTimer> _Timers = new Dictionary<Mobile, CorpseRetrieveTimer>();
|
||||
|
||||
private int _Charges;
|
||||
private bool _SummonAll;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges { get { return _Charges; } set { _Charges = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool SummonAll { get { return _SummonAll; } set { _SummonAll = value; InvalidateProperties(); } }
|
||||
|
||||
public override int LabelNumber { get { return 1071498; } } // Undertaker's Staff
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
[Constructable]
|
||||
public UndertakersStaff()
|
||||
{
|
||||
if (!Siege.SiegeShard)
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Charges = 100;
|
||||
SummonAll = true;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1071518, String.Format("#{0}", _SummonAll ? "1071508" : "1071507"));
|
||||
list.Add(1060584, _Charges.ToString());
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> entries)
|
||||
{
|
||||
base.GetContextMenuEntries(from, entries);
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
var entry1 = new SimpleContextMenuEntry(from, 1071507, m =>
|
||||
{
|
||||
SummonAll = false;
|
||||
InvalidateProperties();
|
||||
}); // Summon Most Recent Corpse Only
|
||||
|
||||
var entry2 = new SimpleContextMenuEntry(from, 1071508, m =>
|
||||
{
|
||||
_SummonAll = true;
|
||||
InvalidateProperties();
|
||||
}); // Summon All Corpses
|
||||
|
||||
if(_SummonAll)
|
||||
entry2.Flags |= CMEFlags.Highlighted;
|
||||
else
|
||||
entry1.Flags |= CMEFlags.Highlighted;
|
||||
|
||||
entry1.Enabled = !IsSummoning();
|
||||
entry2.Enabled = !IsSummoning();
|
||||
|
||||
entries.Add(entry1);
|
||||
entries.Add(entry2);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!_Timers.ContainsKey(m) && (IsChildOf(m.Backpack) || m.FindItemOnLayer(Layer) == this))
|
||||
{
|
||||
TryGetCorpse(m);
|
||||
}
|
||||
}
|
||||
|
||||
private void TryGetCorpse(Mobile m)
|
||||
{
|
||||
if (CanGetCorpse(m))
|
||||
{
|
||||
m.PlaySound(0xF5);
|
||||
|
||||
if (_SummonAll)
|
||||
{
|
||||
var corpses = GetCorpses(m);
|
||||
|
||||
if (corpses != null)
|
||||
{
|
||||
m.SendLocalizedMessage(1071527, corpses.Count.ToString()); // The staff reaches out to ~1_COUNT~ of your corpses and tries to draw them to you...
|
||||
|
||||
_Timers[m] = new CorpseRetrieveTimer(m, corpses, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071511); // The staff glows slightly, then fades. Its magic is unable to locate a corpse of yours to recover.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var corpse = GetCorpse(m);
|
||||
|
||||
if (corpse != null)
|
||||
{
|
||||
m.SendLocalizedMessage(1071528); // The staff reaches out to your corpse and tries to draw it to you...
|
||||
|
||||
_Timers[m] = new CorpseRetrieveTimer(m, new List<Corpse> { corpse }, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071511); // The staff glows slightly, then fades. Its magic is unable to locate a corpse of yours to recover.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanGetCorpse(Mobile m, bool firstCheck = true)
|
||||
{
|
||||
if(m.Criminal)
|
||||
{
|
||||
m.SendLocalizedMessage(1071510); // You are a criminal and cannot use this item...
|
||||
return false;
|
||||
}
|
||||
else if (Spells.SpellHelper.CheckCombat(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1071514); // You cannot use this item during the heat of battle.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void TryEndSummon(Mobile m, List<Corpse> corpses)
|
||||
{
|
||||
if (_Timers.ContainsKey(m))
|
||||
_Timers.Remove(m);
|
||||
|
||||
if (corpses == null || corpses.Count == 0)
|
||||
{
|
||||
m.SendLocalizedMessage(1071511); // The staff glows slightly, then fades. Its magic is unable to locate a corpse of yours to recover.
|
||||
return;
|
||||
}
|
||||
|
||||
bool tooFar = false;
|
||||
bool notEnoughTime = false;
|
||||
bool tooManySummons = false;
|
||||
bool success = true;
|
||||
|
||||
if (_SummonAll)
|
||||
{
|
||||
List<Corpse> copy = new List<Corpse>(corpses);
|
||||
|
||||
foreach (var c in copy)
|
||||
{
|
||||
bool remove = false;
|
||||
|
||||
if (c.Map != m.Map)
|
||||
{
|
||||
remove = true;
|
||||
tooFar = true;
|
||||
}
|
||||
|
||||
if (c.Killer is PlayerMobile && c.Killer != m && c.TimeOfDeath + TimeSpan.FromSeconds(180) > DateTime.UtcNow)
|
||||
{
|
||||
remove = true;
|
||||
notEnoughTime = true;
|
||||
}
|
||||
|
||||
if (Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
|
||||
{
|
||||
remove = true;
|
||||
tooManySummons = true;
|
||||
}
|
||||
|
||||
if (remove)
|
||||
corpses.Remove(c);
|
||||
}
|
||||
|
||||
if (corpses.Count == 0)
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Corpse c = corpses[0];
|
||||
|
||||
if (c.Map != m.Map)
|
||||
tooFar = true;
|
||||
|
||||
if (c.Killer is PlayerMobile && c.Killer != m && c.TimeOfDeath + TimeSpan.FromSeconds(180) > DateTime.UtcNow)
|
||||
notEnoughTime = true;
|
||||
|
||||
if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c) && Corpse.PlayerCorpses[c] >= 3)
|
||||
tooManySummons = true;
|
||||
|
||||
if (tooFar || notEnoughTime || tooManySummons)
|
||||
{
|
||||
if (tooFar)
|
||||
m.SendLocalizedMessage(1071512); // ...but the corpse is too far away!
|
||||
else if (notEnoughTime)
|
||||
m.SendLocalizedMessage(1071515); // ...but not enough time has passed since you were slain in battle!
|
||||
else
|
||||
m.SendLocalizedMessage(1071517); // ...but the corpse has already been summoned too many times!
|
||||
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
{
|
||||
m.PlaySound(0xFA);
|
||||
|
||||
foreach (var c in corpses)
|
||||
{
|
||||
c.MoveToWorld(m.Location, m.Map);
|
||||
|
||||
if (Corpse.PlayerCorpses != null && Corpse.PlayerCorpses.ContainsKey(c))
|
||||
Corpse.PlayerCorpses[c]++;
|
||||
}
|
||||
|
||||
if (_SummonAll)
|
||||
{
|
||||
m.SendLocalizedMessage(1071530, corpses.Count.ToString()); // ...and succeeds in summoning ~1_COUNT~ of them!
|
||||
|
||||
if (tooFar)
|
||||
m.SendLocalizedMessage(1071513); // ...but one of them is too far away!
|
||||
else if (notEnoughTime)
|
||||
m.SendLocalizedMessage(1071516); // ...but one of them deflects the magic because of the stain of war!
|
||||
else if (tooManySummons)
|
||||
m.SendLocalizedMessage(1071519); // ...but one of them has already been summoned too many times!
|
||||
}
|
||||
else
|
||||
m.SendLocalizedMessage(1071529); // ...and succeeds in the summoning of it!
|
||||
|
||||
if (Charges <= 0)
|
||||
{
|
||||
m.SendLocalizedMessage(1071509); // The staff has been reduced to pieces!
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
Charges--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int GetCorpseCount(Mobile m)
|
||||
{
|
||||
if (Corpse.PlayerCorpses == null)
|
||||
return 0;
|
||||
|
||||
int count = 0;
|
||||
|
||||
foreach (var kvp in Corpse.PlayerCorpses)
|
||||
{
|
||||
if (kvp.Key.Owner == m && kvp.Value < 3)
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
private List<Corpse> GetCorpses(Mobile m)
|
||||
{
|
||||
if (Corpse.PlayerCorpses == null)
|
||||
return null;
|
||||
|
||||
List<Corpse> list = null;
|
||||
|
||||
foreach (var kvp in Corpse.PlayerCorpses)
|
||||
{
|
||||
if (kvp.Key.Owner == m && kvp.Value < 3)
|
||||
{
|
||||
if (list == null)
|
||||
list = new List<Corpse>();
|
||||
|
||||
if(!list.Contains(kvp.Key))
|
||||
list.Add(kvp.Key);
|
||||
}
|
||||
|
||||
if (list != null && list.Count >= 15)
|
||||
break;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private Corpse GetCorpse(Mobile m)
|
||||
{
|
||||
var corpse = m.Corpse as Corpse;
|
||||
|
||||
if (corpse == null || Corpse.PlayerCorpses == null || !Corpse.PlayerCorpses.ContainsKey(corpse))
|
||||
return null;
|
||||
|
||||
return corpse;
|
||||
}
|
||||
|
||||
public static bool TryRemoveTimer(Mobile m)
|
||||
{
|
||||
if (_Timers.ContainsKey(m))
|
||||
{
|
||||
_Timers[m].Stop();
|
||||
_Timers.Remove(m);
|
||||
|
||||
m.FixedEffect(0x3735, 6, 30);
|
||||
m.PlaySound(0x5C);
|
||||
|
||||
m.SendLocalizedMessage(1071525); // You have been disrupted while attempting to pull your corpse!
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsSummoning()
|
||||
{
|
||||
foreach (var timer in _Timers.Values)
|
||||
{
|
||||
if (timer.Staff == this)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public class CorpseRetrieveTimer : Timer
|
||||
{
|
||||
public Mobile From { get; set; }
|
||||
public List<Corpse> Corpses { get; set; }
|
||||
public UndertakersStaff Staff { get; set; }
|
||||
|
||||
public CorpseRetrieveTimer(Mobile from, List<Corpse> corpses, UndertakersStaff staff)
|
||||
: base(TimeSpan.FromSeconds(3))
|
||||
{
|
||||
From = from;
|
||||
Corpses = corpses;
|
||||
Staff = staff;
|
||||
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Staff.TryEndSummon(From, Corpses);
|
||||
}
|
||||
}
|
||||
|
||||
public UndertakersStaff(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(_Charges);
|
||||
writer.Write(_SummonAll);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
reader.ReadInt();
|
||||
|
||||
_Charges = reader.ReadInt();
|
||||
_SummonAll = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
69
Scripts/Items/StoreBought/VirtueShield.cs
Normal file
69
Scripts/Items/StoreBought/VirtueShield.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class VirtueShield : BaseShield, Server.Engines.Craft.IRepairable
|
||||
{
|
||||
public Server.Engines.Craft.CraftSystem RepairSystem { get { return Server.Engines.Craft.DefBlacksmithy.CraftSystem; } }
|
||||
public override int BasePhysicalResistance { get { return 8; } }
|
||||
public override int BaseFireResistance { get { return 8; } }
|
||||
public override int BaseColdResistance { get { return 8; } }
|
||||
public override int BasePoisonResistance { get { return 8; } }
|
||||
public override int BaseEnergyResistance { get { return 8; } }
|
||||
|
||||
public override bool CanBeWornByGargoyles { get { return true; } }
|
||||
public override int LabelNumber { get { return 1109616; } } // Virtue Shield
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
public override bool IsArtifact { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public VirtueShield()
|
||||
: base(0x7818)
|
||||
{
|
||||
Attributes.SpellChanneling = 1;
|
||||
Attributes.DefendChance = 10;
|
||||
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override bool OnEquip(Mobile from)
|
||||
{
|
||||
bool yes = base.OnEquip(from);
|
||||
|
||||
if (yes)
|
||||
{
|
||||
Effects.PlaySound(from.Location, from.Map, 0x1F7);
|
||||
from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
}
|
||||
|
||||
return yes;
|
||||
}
|
||||
|
||||
public VirtueShield(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
HitPoints = MaxHitPoints = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
65
Scripts/Items/StoreBought/WillowTree.cs
Normal file
65
Scripts/Items/StoreBought/WillowTree.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WillowTreeAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new WillowTreeDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public WillowTreeAddon()
|
||||
{
|
||||
AddComponent(new LocalizedAddonComponent(0x224A, 1071105), 0, 0, 0);
|
||||
}
|
||||
|
||||
public WillowTreeAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class WillowTreeDeed : BaseAddonDeed
|
||||
{
|
||||
public override BaseAddon Addon { get { return new WillowTreeAddon(); } }
|
||||
public override int LabelNumber { get { return 1071105; } } // Willow Tree
|
||||
|
||||
[Constructable]
|
||||
public WillowTreeDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WillowTreeDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
217
Scripts/Items/StoreBought/WineRack.cs
Normal file
217
Scripts/Items/StoreBought/WineRack.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WineRack : LockableContainer, IFlipable, IDyable
|
||||
{
|
||||
public override string DefaultName { get { return "Wine Rack"; } }
|
||||
|
||||
public override int DefaultGumpID { get { return 0x44; } }
|
||||
|
||||
public virtual int SouthID { get { return 0xA568; } }
|
||||
public virtual int SouthEmptyID { get { return 0xA567; } }
|
||||
public virtual int EastID { get { return 0xA56A; } }
|
||||
public virtual int EastEmptyID { get { return 0xA569; } }
|
||||
|
||||
public bool IsEmpty { get { return Items.Count == 0; } }
|
||||
|
||||
public bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Decorator)]
|
||||
public override int ItemID
|
||||
{
|
||||
get { return base.ItemID; }
|
||||
set
|
||||
{
|
||||
base.ItemID = value;
|
||||
|
||||
CheckWineRack();
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckWineRack()
|
||||
{
|
||||
if (IsEmpty)
|
||||
{
|
||||
if (ItemID == SouthID)
|
||||
{
|
||||
base.ItemID = SouthEmptyID;
|
||||
}
|
||||
else if (ItemID == EastID)
|
||||
{
|
||||
base.ItemID = EastEmptyID;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ItemID == SouthEmptyID)
|
||||
{
|
||||
base.ItemID = SouthID;
|
||||
}
|
||||
else if (ItemID == EastEmptyID)
|
||||
{
|
||||
base.ItemID = EastID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WineRack()
|
||||
: this(0xA567)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WineRack(int id)
|
||||
: base(id)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnFlip(Mobile from)
|
||||
{
|
||||
if (ItemID == SouthID)
|
||||
{
|
||||
base.ItemID = EastID;
|
||||
}
|
||||
else if (ItemID == EastID)
|
||||
{
|
||||
base.ItemID = SouthID;
|
||||
}
|
||||
else if (ItemID == SouthEmptyID)
|
||||
{
|
||||
base.ItemID = EastEmptyID;
|
||||
}
|
||||
else if (ItemID == EastEmptyID)
|
||||
{
|
||||
base.ItemID = SouthEmptyID;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool DisplaysContent { get { return false; } }
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1072241, "{0}\t{1}\t{2}\t{3}", TotalItems, MaxItems, TotalWeight, MaxWeight);
|
||||
// Contents: ~1_COUNT~/~2_MAXCOUNT~ items, ~3_WEIGHT~/~4_MAXWEIGHT~ stones
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||
{
|
||||
bool dropped = base.OnDragDropInto(from, item, p);
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && dropped)
|
||||
{
|
||||
OnItemDropped(from, item, house);
|
||||
}
|
||||
|
||||
return dropped;
|
||||
}
|
||||
|
||||
public override bool TryDropItem(Mobile from, Item dropped, bool sendFullMessage)
|
||||
{
|
||||
if (!CheckHold(from, dropped, true, true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && IsLockedDown)
|
||||
{
|
||||
if (!house.CheckAccessibility(this, from))
|
||||
{
|
||||
PrivateOverheadMessage(MessageType.Regular, 0x21, 1061637, from.NetState); // You are not allowed to access this!
|
||||
from.SendLocalizedMessage(501727); // You cannot lock that down!
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DropItem(dropped);
|
||||
|
||||
if (house != null && !IsLockedDown)
|
||||
{
|
||||
OnItemDropped(from, dropped, house);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsAccessibleTo(Mobile m)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
|
||||
{
|
||||
if (item == this)
|
||||
{
|
||||
return base.CheckLift(from, item, ref reject);
|
||||
}
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house != null && IsSecure)
|
||||
{
|
||||
var secure = house.GetSecureInfoFor(this);
|
||||
|
||||
return secure != null && house.HasSecureAccess(from, secure);
|
||||
}
|
||||
|
||||
return base.CheckLift(from, item, ref reject);
|
||||
}
|
||||
|
||||
public virtual void OnItemDropped(Mobile from, Item item, BaseHouse house)
|
||||
{
|
||||
var secure = house.GetSecureInfoFor(this);
|
||||
|
||||
if (secure != null && !house.HasSecureAccess(from, secure))
|
||||
{
|
||||
item.InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnItemAdded(Item item)
|
||||
{
|
||||
base.OnItemAdded(item);
|
||||
|
||||
CheckWineRack();
|
||||
}
|
||||
|
||||
public override void OnItemRemoved(Item item)
|
||||
{
|
||||
base.OnItemRemoved(item);
|
||||
|
||||
CheckWineRack();
|
||||
}
|
||||
|
||||
public WineRack(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
124
Scripts/Items/StoreBought/WoodenBookcase.cs
Normal file
124
Scripts/Items/StoreBought/WoodenBookcase.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[Furniture]
|
||||
[Flipable(0x0A9D, 0x0A9E)]
|
||||
public class WoodenBookcase : BaseContainer
|
||||
{
|
||||
public override int LabelNumber { get { return 1071102; } } // Wooden Bookcase
|
||||
public override int DefaultGumpID { get { return 0x4D; } }
|
||||
|
||||
public bool IsEmpty { get { return Items.Count == 0; } }
|
||||
|
||||
[CommandProperty(AccessLevel.Decorator)]
|
||||
public override int ItemID
|
||||
{
|
||||
get { return base.ItemID; }
|
||||
set
|
||||
{
|
||||
int id = value;
|
||||
|
||||
if (!IsEmpty && (id == 0x0A9D || id == 0x0A9E))
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0x0A9D: base.ItemID = Utility.RandomList(0x0A97, 0x0A98, 0x0A9B); break;
|
||||
case 0x0A9E: base.ItemID = Utility.RandomList(0x0A99, 0x0A9A, 0x0A9C); break;
|
||||
}
|
||||
}
|
||||
else if (IsEmpty && id != 0x0A9D && id != 0x0A9E)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0x0A97:
|
||||
case 0x0A98:
|
||||
case 0x0A9B: base.ItemID = 0x0A9D; break;
|
||||
case 0x0A99:
|
||||
case 0x0A9A:
|
||||
case 0x0A9C: base.ItemID = 0x0A9E; break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.ItemID = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodenBookcase()
|
||||
: base(0x0A9D)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnItemAdded(Item item)
|
||||
{
|
||||
base.OnItemAdded(item);
|
||||
|
||||
if (ItemID == 0x0A9D || ItemID == 0x0A9E)
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
default:
|
||||
case 0x0A9D: ItemID = Utility.RandomList(0x0A97, 0x0A98, 0x0A9B); break;
|
||||
case 0x0A9E: ItemID = Utility.RandomList(0x0A99, 0x0A9A, 0x0A9C); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnItemRemoved(Item item)
|
||||
{
|
||||
base.OnItemRemoved(item);
|
||||
|
||||
if (IsEmpty && ItemID != 0x0A9D && ItemID != 0x0A9E)
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
default:
|
||||
case 0x0A97:
|
||||
case 0x0A98:
|
||||
case 0x0A9B: base.ItemID = 0x0A9D; break;
|
||||
case 0x0A99:
|
||||
case 0x0A9A:
|
||||
case 0x0A9C: base.ItemID = 0x0A9E; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Flip()
|
||||
{
|
||||
switch (ItemID)
|
||||
{
|
||||
case 0x0A97: ItemID = 0x0A99; break;
|
||||
case 0x0A98: ItemID = 0x0A9A; break;
|
||||
case 0x0A99: ItemID = 0x0A97; break;
|
||||
case 0x0A9A: ItemID = 0x0A98; break;
|
||||
case 0x0A9B: ItemID = 0x0A9C; break;
|
||||
case 0x0A9C: ItemID = 0x0A9B; break;
|
||||
case 0x0A9D: ItemID = 0x0A9E; break;
|
||||
case 0x0A9E: ItemID = 0x0A9D; break;
|
||||
}
|
||||
}
|
||||
|
||||
public WoodenBookcase(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
235
Scripts/Items/StoreBought/WoodworkersBench.cs
Normal file
235
Scripts/Items/StoreBought/WoodworkersBench.cs
Normal file
@@ -0,0 +1,235 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class WoodworkersBench : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new WoodworkersBenchDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public WoodworkersBench()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WoodworkersBench(bool east)
|
||||
: base()
|
||||
{
|
||||
if (east)
|
||||
{
|
||||
AddComponent(new AddonComponent(0x19F2), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x19F1), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(0x19F3), 0, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddComponent(new AddonComponent(0x19F6), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(0x19F5), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(0x19F7), -1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnComponentUsed(AddonComponent c, Mobile m)
|
||||
{
|
||||
if (IsInCooldown(m))
|
||||
{
|
||||
TimeSpan tsRem = (_Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration + Cooldown)) - DateTime.UtcNow;
|
||||
|
||||
m.SendLocalizedMessage(1071505, tsRem.Minutes.ToString()); // In order to get a buff again, you have to wait for at least ~1_VAL~ minutes.
|
||||
}
|
||||
else if (HasBonus(m))
|
||||
{
|
||||
TimeSpan tsRem = (_Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration) - DateTime.UtcNow);
|
||||
|
||||
m.SendLocalizedMessage(1071522, String.Format("{0}\t{1}", tsRem.Minutes.ToString(), tsRem.Seconds.ToString())); // You already have the bench's buff. Time remaining of the buff: ~1_VAL~ min ~2_VAL~ sec
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1071504); // Carpentry will go smoothly now...
|
||||
|
||||
AddBonus(m);
|
||||
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<Mobile, Tuple<bool, DateTime, SkillMod>> _Table;
|
||||
private static Timer _Timer;
|
||||
|
||||
public const int Cooldown = 45;
|
||||
public const int BonusDuration = 30;
|
||||
|
||||
public static void AddBonus(Mobile m)
|
||||
{
|
||||
if (_Table == null)
|
||||
{
|
||||
_Table = new Dictionary<Mobile, Tuple<bool, DateTime, SkillMod>>();
|
||||
}
|
||||
|
||||
var mod = new DefaultSkillMod(SkillName.Carpentry, true, 5.0);
|
||||
mod.ObeyCap = false;
|
||||
m.AddSkillMod(mod);
|
||||
|
||||
_Table[m] = new Tuple<bool, DateTime, SkillMod>(true, DateTime.UtcNow, mod);
|
||||
|
||||
if (_Timer == null)
|
||||
{
|
||||
_Timer = Timer.DelayCall(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), CheckTable);
|
||||
_Timer.Priority = TimerPriority.FiveSeconds;
|
||||
_Timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasBonus(Mobile m, SkillName skill)
|
||||
{
|
||||
return skill == SkillName.Carpentry && HasBonus(m);
|
||||
}
|
||||
|
||||
public static bool HasBonus(Mobile m)
|
||||
{
|
||||
if (_Table == null)
|
||||
return false;
|
||||
|
||||
return _Table.ContainsKey(m) && _Table[m].Item1;
|
||||
}
|
||||
|
||||
public static bool IsInCooldown(Mobile m)
|
||||
{
|
||||
if (m.AccessLevel > AccessLevel.Player || _Table == null || !_Table.ContainsKey(m))
|
||||
return false;
|
||||
|
||||
if (_Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration + Cooldown) < DateTime.UtcNow)
|
||||
{
|
||||
_Table.Remove(m);
|
||||
return false;
|
||||
}
|
||||
|
||||
return _Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration) < DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public static void CheckTable()
|
||||
{
|
||||
if (_Table == null)
|
||||
return;
|
||||
|
||||
List<Mobile> list = new List<Mobile>(_Table.Keys);
|
||||
|
||||
foreach (var m in list)
|
||||
{
|
||||
if (_Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration + Cooldown) < DateTime.UtcNow)
|
||||
{
|
||||
_Table.Remove(m);
|
||||
}
|
||||
else if (_Table[m].Item1 && _Table[m].Item2 + TimeSpan.FromMinutes(BonusDuration) < DateTime.UtcNow)
|
||||
{
|
||||
m.RemoveSkillMod(_Table[m].Item3);
|
||||
var dt = _Table[m].Item2;
|
||||
|
||||
if (m.NetState != null)
|
||||
{
|
||||
m.SendLocalizedMessage(1071506); // Your carpentry bonus was removed...
|
||||
}
|
||||
|
||||
_Table[m] = new Tuple<bool, DateTime, SkillMod>(false, dt, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (_Table.Count == 0)
|
||||
{
|
||||
_Table = null;
|
||||
|
||||
if (_Timer != null)
|
||||
{
|
||||
_Timer.Stop();
|
||||
_Timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
ColUtility.Free(list);
|
||||
}
|
||||
|
||||
public WoodworkersBench(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class WoodworkersBenchDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override int LabelNumber { get { return 1026641; } } // Woodworker's Bench
|
||||
public override BaseAddon Addon { get { return new WoodworkersBench(m_East); } }
|
||||
|
||||
private bool m_East;
|
||||
|
||||
[Constructable]
|
||||
public WoodworkersBenchDeed()
|
||||
: base()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public WoodworkersBenchDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1071502); // Woodworker's Bench (South)
|
||||
list.Add(1, 1071503); // Woodworker's Bench (East)
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_East = choice == 1;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(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.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
259
Scripts/Items/StoreBought/WorldTreeRug.cs
Normal file
259
Scripts/Items/StoreBought/WorldTreeRug.cs
Normal file
@@ -0,0 +1,259 @@
|
||||
using System;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SmallWorldTreeRugAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new SmallWorldTreeRugAddonDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public SmallWorldTreeRugAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SmallWorldTreeRugAddon(bool south)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
for (int i = 0; i < m_SouthInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_SouthInfo[i, 0]), m_SouthInfo[i, 1], m_SouthInfo[i, 2], m_SouthInfo[i, 3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < m_EastInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_EastInfo[i, 0]), m_EastInfo[i, 1], m_EastInfo[i, 2], m_EastInfo[i, 3]);
|
||||
}
|
||||
}
|
||||
|
||||
private static int[,] m_SouthInfo = new int[,]
|
||||
{
|
||||
{40514, 1, 1, 0}, {40513, 1, 0, 0}, {40512, 1, -1, 0}// 1 2 3
|
||||
, {40511, 0, -1, 0}, {40510, -1, -1, 0}, {40509, -1, 0, 0}// 4 5 6
|
||||
, {40508, -1, 1, 0}, {40507, 0, 1, 0}, {40506, 0, 0, 0}// 7 8 9
|
||||
};
|
||||
|
||||
private static int[,] m_EastInfo = new int[,]
|
||||
{
|
||||
{40523, 1, 1, 0}, {40522, 0, 1, 0}, {40521, -1, 1, 0}// 1 2 3
|
||||
, {40520, -1, 0, 0}, {40519, -1, -1, 0}, {40518, 0, -1, 0}// 4 5 6
|
||||
, {40517, 1, -1, 0}, {40516, 1, 0, 0}, {40515, 0, 0, 0}// 7 8 9
|
||||
};
|
||||
|
||||
public SmallWorldTreeRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SmallWorldTreeRugAddonDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new SmallWorldTreeRugAddon(m_South); } }
|
||||
public override int LabelNumber { get { return 1157206; } } // Small World Tree
|
||||
|
||||
[Constructable]
|
||||
public SmallWorldTreeRugAddonDeed()
|
||||
{
|
||||
}
|
||||
|
||||
private bool m_South;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool South
|
||||
{
|
||||
get { return m_South; }
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_South = choice == 0;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public SmallWorldTreeRugAddonDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeWorldTreeRugAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new LargeWorldTreeRugAddonDeed(); } }
|
||||
|
||||
[Constructable]
|
||||
public LargeWorldTreeRugAddon()
|
||||
: this(true)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeWorldTreeRugAddon(bool south)
|
||||
{
|
||||
if (south)
|
||||
{
|
||||
for (int i = 0; i < m_SouthInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_SouthInfo[i, 0]), m_SouthInfo[i, 1], m_SouthInfo[i, 2], m_SouthInfo[i, 3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < m_EastInfo.Length / 4; i++)
|
||||
AddComponent(new AddonComponent(m_EastInfo[i, 0]), m_EastInfo[i, 1], m_EastInfo[i, 2], m_EastInfo[i, 3]);
|
||||
}
|
||||
}
|
||||
|
||||
private static int[,] m_SouthInfo = new int[,]
|
||||
{
|
||||
{40546, -2, -1, 0}, {40545, -1, -1, 0}, {40544, -2, 0, 0}// 1 2 3
|
||||
, {40543, -1, 0, 0}, {40542, -2, 1, 0}, {40541, -1, 1, 0}// 4 5 6
|
||||
, {40540, -2, 2, 0}, {40539, -1, 2, 0}, {40536, 0, -1, 0}// 7 8 9
|
||||
, {40534, 1, -1, 0}, {40533, 2, -1, 0}, {40532, 0, 0, 0}// 10 11 12
|
||||
, {40531, 1, 0, 0}, {40530, 0, 1, 0}, {40529, 2, 0, 0}// 13 14 15
|
||||
, {40528, 1, 1, 0}, {40527, 0, 2, 0}, {40526, 2, 1, 0}// 16 17 18
|
||||
, {40525, 1, 2, 0}, {40547, -1, -2, 0}, {40538, 0, -2, 0}// 19 20 21
|
||||
, {40537, 1, -2, 0}, {40535, 2, -2, 0}// 22 23
|
||||
};
|
||||
|
||||
private static int[,] m_EastInfo = new int[,]
|
||||
{
|
||||
{40572, -2, -1, 0}, {40571, -1, -2, 0}, {40570, -1, -1, 0}// 1 2 3
|
||||
, {40569, 0, -2, 0}, {40568, 0, -1, 0}, {40567, 1, -2, 0}// 4 5 6
|
||||
, {40566, 1, -1, 0}, {40565, 2, -2, 0}, {40564, 2, -1, 0}// 7 8 9
|
||||
, {40563, -2, 0, 0}, {40562, -2, 1, 0}, {40561, -1, 0, 0}// 10 11 12
|
||||
, {40560, -2, 2, 0}, {40559, -1, 1, 0}, {40558, -1, 2, 0}// 13 14 15
|
||||
, {40557, 0, 0, 0}, {40556, 0, 1, 0}, {40555, 1, 0, 0}// 16 17 18
|
||||
, {40551, 1, 2, 0}, {40554, 0, 2, 0}, {40553, 1, 1, 0}// 19 20 21
|
||||
, {40552, 2, 0, 0}, {40550, 2, 1, 0}// 22 23
|
||||
};
|
||||
|
||||
public LargeWorldTreeRugAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LargeWorldTreeRugAddonDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new LargeWorldTreeRugAddon(m_South); } }
|
||||
public override int LabelNumber { get { return 1157207; } } // Large World Tree
|
||||
|
||||
private bool m_South;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool South
|
||||
{
|
||||
get { return m_South; }
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add(0, 1116332); // South
|
||||
list.Add(1, 1116333); // East
|
||||
}
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
m_South = choice == 0;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LargeWorldTreeRugAddonDeed()
|
||||
{
|
||||
}
|
||||
|
||||
public LargeWorldTreeRugAddonDeed(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user