fix: Codegens gifts (#1363)
This commit is contained in:
parent
551f6cca9d
commit
82b5fa6af3
16 changed files with 414 additions and 503 deletions
|
|
@ -1,129 +1,94 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class HearthOfHomeFire : BaseAddon
|
||||
{
|
||||
public class HearthOfHomeFire : BaseAddon
|
||||
[Constructible]
|
||||
public HearthOfHomeFire(bool east)
|
||||
{
|
||||
[Constructible]
|
||||
public HearthOfHomeFire(bool east)
|
||||
if (east)
|
||||
{
|
||||
if (east)
|
||||
{
|
||||
AddLightComponent(new AddonComponent(0x2352), 0, 0, 0);
|
||||
AddLightComponent(new AddonComponent(0x2358), 0, -1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddLightComponent(new AddonComponent(0x2360), 0, 0, 0);
|
||||
AddLightComponent(new AddonComponent(0x2366), -1, 0, 0);
|
||||
}
|
||||
AddLightComponent(new AddonComponent(0x2352), 0, 0, 0);
|
||||
AddLightComponent(new AddonComponent(0x2358), 0, -1, 0);
|
||||
}
|
||||
|
||||
public HearthOfHomeFire(Serial serial) : base(serial)
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
public override BaseAddonDeed Deed => new HearthOfHomeFireDeed();
|
||||
|
||||
private void AddLightComponent(AddonComponent component, int x, int y, int z)
|
||||
{
|
||||
component.Light = LightType.Circle150;
|
||||
|
||||
AddComponent(component, x, y, z);
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
AddLightComponent(new AddonComponent(0x2360), 0, 0, 0);
|
||||
AddLightComponent(new AddonComponent(0x2366), -1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public class HearthOfHomeFireDeed : BaseAddonDeed
|
||||
public override BaseAddonDeed Deed => new HearthOfHomeFireDeed();
|
||||
|
||||
private void AddLightComponent(AddonComponent component, int x, int y, int z)
|
||||
{
|
||||
private bool m_East;
|
||||
component.Light = LightType.Circle150;
|
||||
AddComponent(component, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public HearthOfHomeFireDeed() => LootType = LootType.Blessed;
|
||||
[SerializationGenerator(0)]
|
||||
public partial class HearthOfHomeFireDeed : BaseAddonDeed
|
||||
{
|
||||
private bool m_East;
|
||||
|
||||
public HearthOfHomeFireDeed(Serial serial) : base(serial)
|
||||
[Constructible]
|
||||
public HearthOfHomeFireDeed() => LootType = LootType.Blessed;
|
||||
|
||||
public override BaseAddon Addon => new HearthOfHomeFire(m_East);
|
||||
|
||||
public override int LabelNumber => 1062919; // Hearth of the Home Fire
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump<InternalGump>();
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly HearthOfHomeFireDeed _deed;
|
||||
|
||||
public InternalGump(HearthOfHomeFireDeed deed) : base(150, 50)
|
||||
{
|
||||
_deed = deed;
|
||||
|
||||
AddBackground(0, 0, 350, 250, 0xA28);
|
||||
|
||||
AddItem(90, 52, 0x2367);
|
||||
AddItem(112, 35, 0x2360);
|
||||
AddButton(70, 35, 0x868, 0x869, 1); // South
|
||||
|
||||
AddItem(220, 35, 0x2352);
|
||||
AddItem(242, 52, 0x2358);
|
||||
AddButton(185, 35, 0x868, 0x869, 2); // East
|
||||
}
|
||||
|
||||
public override BaseAddon Addon => new HearthOfHomeFire(m_East);
|
||||
|
||||
public override int LabelNumber => 1062919; // Hearth of the Home Fire
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
if (_deed.Deleted || info.ButtonID == 0)
|
||||
{
|
||||
from.CloseGump<InternalGump>();
|
||||
from.SendGump(new InternalGump(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private void SendTarget(Mobile m)
|
||||
{
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
private readonly HearthOfHomeFireDeed m_Deed;
|
||||
|
||||
public InternalGump(HearthOfHomeFireDeed deed) : base(150, 50)
|
||||
{
|
||||
m_Deed = deed;
|
||||
|
||||
AddBackground(0, 0, 350, 250, 0xA28);
|
||||
|
||||
AddItem(90, 52, 0x2367);
|
||||
AddItem(112, 35, 0x2360);
|
||||
AddButton(70, 35, 0x868, 0x869, 1); // South
|
||||
|
||||
AddItem(220, 35, 0x2352);
|
||||
AddItem(242, 52, 0x2358);
|
||||
AddButton(185, 35, 0x868, 0x869, 2); // East
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Deed.Deleted || info.ButtonID == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_Deed.m_East = info.ButtonID != 1;
|
||||
m_Deed.SendTarget(sender.Mobile);
|
||||
}
|
||||
_deed.m_East = info.ButtonID != 1;
|
||||
_deed.SendTarget(sender.Mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,26 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class HolySword : Longsword
|
||||
{
|
||||
public class HolySword : Longsword
|
||||
[Constructible]
|
||||
public HolySword()
|
||||
{
|
||||
[Constructible]
|
||||
public HolySword()
|
||||
{
|
||||
Hue = 0x482;
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x482;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Slayer = SlayerName.Silver;
|
||||
Slayer = SlayerName.Silver;
|
||||
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public HolySword(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062921; // The Holy Sword
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062921; // The Holy Sword
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,45 +1,29 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class LeggingsOfEmbers : PlateLegs
|
||||
{
|
||||
public class LeggingsOfEmbers : PlateLegs
|
||||
[Constructible]
|
||||
public LeggingsOfEmbers()
|
||||
{
|
||||
[Constructible]
|
||||
public LeggingsOfEmbers()
|
||||
{
|
||||
Hue = 0x2C;
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x2C;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public LeggingsOfEmbers(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062911; // Royal Leggings of Embers
|
||||
|
||||
public override int BasePhysicalResistance => 15;
|
||||
public override int BaseFireResistance => 25;
|
||||
public override int BaseColdResistance => 0;
|
||||
public override int BasePoisonResistance => 15;
|
||||
public override int BaseEnergyResistance => 15;
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062911; // Royal Leggings of Embers
|
||||
|
||||
public override int BasePhysicalResistance => 15;
|
||||
public override int BaseFireResistance => 25;
|
||||
public override int BaseColdResistance => 0;
|
||||
public override int BasePoisonResistance => 15;
|
||||
public override int BaseEnergyResistance => 15;
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,215 +1,174 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ModernUO.Serialization;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[Flippable(0x234C, 0x234D)]
|
||||
[SerializationGenerator(1)]
|
||||
public partial class RoseOfTrinsic : Item, ISecurable
|
||||
{
|
||||
[Flippable(0x234C, 0x234D)]
|
||||
public class RoseOfTrinsic : Item, ISecurable
|
||||
private static readonly TimeSpan m_SpawnTime = TimeSpan.FromHours(4.0);
|
||||
|
||||
private SpawnTimer _spawnTimer;
|
||||
|
||||
[SerializableField(1, setter: "private")]
|
||||
private DateTime _nextSpawnTime;
|
||||
|
||||
[SerializableField(2)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private SecureLevel _level;
|
||||
|
||||
[Constructible]
|
||||
public RoseOfTrinsic() : base(0x234D)
|
||||
{
|
||||
private static readonly TimeSpan m_SpawnTime = TimeSpan.FromHours(4.0);
|
||||
private DateTime m_NextSpawnTime;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
private int m_Petals;
|
||||
private SpawnTimer m_SpawnTimer;
|
||||
|
||||
[Constructible]
|
||||
public RoseOfTrinsic() : base(0x234D)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Petals = 0;
|
||||
StartSpawnTimer(TimeSpan.FromMinutes(1.0));
|
||||
}
|
||||
|
||||
public RoseOfTrinsic(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062913; // Rose of Trinsic
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Petals
|
||||
{
|
||||
get => m_Petals;
|
||||
set
|
||||
{
|
||||
if (value >= 10)
|
||||
{
|
||||
m_Petals = 10;
|
||||
|
||||
StopSpawnTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value <= 0)
|
||||
{
|
||||
m_Petals = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Petals = value;
|
||||
}
|
||||
|
||||
StartSpawnTimer(m_SpawnTime);
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1062925, Petals); // Petals: ~1_COUNT~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
private void StartSpawnTimer(TimeSpan delay)
|
||||
{
|
||||
StopSpawnTimer();
|
||||
|
||||
m_SpawnTimer = new SpawnTimer(this, delay);
|
||||
m_SpawnTimer.Start();
|
||||
|
||||
m_NextSpawnTime = Core.Now + delay;
|
||||
}
|
||||
|
||||
private void StopSpawnTimer()
|
||||
{
|
||||
if (m_SpawnTimer != null)
|
||||
{
|
||||
m_SpawnTimer.Stop();
|
||||
m_SpawnTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
else if (Petals > 0)
|
||||
{
|
||||
from.AddToBackpack(new RoseOfTrinsicPetal(Petals));
|
||||
Petals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteEncodedInt(m_Petals);
|
||||
writer.WriteDeltaTime(m_NextSpawnTime);
|
||||
writer.WriteEncodedInt((int)Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
|
||||
m_Petals = reader.ReadEncodedInt();
|
||||
m_NextSpawnTime = reader.ReadDeltaTime();
|
||||
Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
|
||||
if (m_Petals < 10)
|
||||
{
|
||||
StartSpawnTimer(m_NextSpawnTime - Core.Now);
|
||||
}
|
||||
}
|
||||
|
||||
private class SpawnTimer : Timer
|
||||
{
|
||||
private readonly RoseOfTrinsic m_Rose;
|
||||
|
||||
public SpawnTimer(RoseOfTrinsic rose, TimeSpan delay) : base(delay)
|
||||
{
|
||||
m_Rose = rose;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (m_Rose.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_Rose.m_SpawnTimer = null;
|
||||
m_Rose.Petals++;
|
||||
}
|
||||
}
|
||||
_petals = 0;
|
||||
StartSpawnTimer(TimeSpan.FromMinutes(1.0));
|
||||
}
|
||||
|
||||
public class RoseOfTrinsicPetal : Item
|
||||
public override int LabelNumber => 1062913; // Rose of Trinsic
|
||||
|
||||
[SerializableProperty(0)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Petals
|
||||
{
|
||||
[Constructible]
|
||||
public RoseOfTrinsicPetal(int amount = 1) : base(0x1021)
|
||||
get => _petals;
|
||||
set
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
|
||||
Weight = 1.0;
|
||||
Hue = 0xE;
|
||||
}
|
||||
|
||||
public RoseOfTrinsicPetal(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062926; // Petal of the Rose of Trinsic
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
if (value >= 10)
|
||||
{
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1062927
|
||||
); // You have eaten one of these recently and eating another would provide no benefit.
|
||||
_petals = 10;
|
||||
|
||||
StopSpawnTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(0x1EE);
|
||||
from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));
|
||||
_petals = value <= 0 ? 0 : value;
|
||||
|
||||
Consume();
|
||||
StartSpawnTimer(m_SpawnTime);
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
this.MarkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1062925, Petals); // Petals: ~1_COUNT~
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
private void StartSpawnTimer(TimeSpan delay)
|
||||
{
|
||||
StopSpawnTimer();
|
||||
|
||||
_spawnTimer = new SpawnTimer(this, delay);
|
||||
_spawnTimer.Start();
|
||||
|
||||
NextSpawnTime = Core.Now + delay;
|
||||
}
|
||||
|
||||
private void StopSpawnTimer()
|
||||
{
|
||||
_spawnTimer?.Stop();
|
||||
_spawnTimer = null;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
else if (_petals > 0)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
from.AddToBackpack(new RoseOfTrinsicPetal(_petals));
|
||||
Petals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
_petals = reader.ReadEncodedInt();
|
||||
_nextSpawnTime = reader.ReadDeltaTime();
|
||||
_level = (SecureLevel)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
[AfterDeserialization]
|
||||
private void AfterDeserialization()
|
||||
{
|
||||
if (_petals < 10)
|
||||
{
|
||||
StartSpawnTimer(_nextSpawnTime - Core.Now);
|
||||
}
|
||||
}
|
||||
|
||||
private class SpawnTimer : Timer
|
||||
{
|
||||
private readonly RoseOfTrinsic _rose;
|
||||
|
||||
public SpawnTimer(RoseOfTrinsic rose, TimeSpan delay) : base(delay) => _rose = rose;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (_rose.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_rose._spawnTimer = null;
|
||||
_rose.Petals++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class RoseOfTrinsicPetal : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RoseOfTrinsicPetal(int amount = 1) : base(0x1021)
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
|
||||
Weight = 1.0;
|
||||
Hue = 0xE;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062926; // Petal of the Rose of Trinsic
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
|
||||
{
|
||||
// You have eaten one of these recently and eating another would provide no benefit.
|
||||
from.SendLocalizedMessage(1062927);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.PlaySound(0x1EE);
|
||||
from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));
|
||||
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,33 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[Flippable(0x236C, 0x236D)]
|
||||
[SerializationGenerator(0)]
|
||||
public partial class SamuraiHelm : BaseArmor
|
||||
{
|
||||
[Flippable(0x236C, 0x236D)]
|
||||
public class SamuraiHelm : BaseArmor
|
||||
[Constructible]
|
||||
public SamuraiHelm() : base(0x236C)
|
||||
{
|
||||
[Constructible]
|
||||
public SamuraiHelm() : base(0x236C)
|
||||
{
|
||||
Weight = 5.0;
|
||||
LootType = LootType.Blessed;
|
||||
Weight = 5.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Attributes.DefendChance = 15;
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
}
|
||||
|
||||
public SamuraiHelm(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062923; // Ancient Samurai Helm
|
||||
|
||||
public override int BasePhysicalResistance => 15;
|
||||
public override int BaseFireResistance => 10;
|
||||
public override int BaseColdResistance => 10;
|
||||
public override int BasePoisonResistance => 15;
|
||||
public override int BaseEnergyResistance => 10;
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
|
||||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Plate;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Attributes.DefendChance = 15;
|
||||
ArmorAttributes.SelfRepair = 10;
|
||||
ArmorAttributes.LowerStatReq = 100;
|
||||
ArmorAttributes.MageArmor = 1;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062923; // Ancient Samurai Helm
|
||||
|
||||
public override int BasePhysicalResistance => 15;
|
||||
public override int BaseFireResistance => 10;
|
||||
public override int BaseColdResistance => 10;
|
||||
public override int BasePoisonResistance => 15;
|
||||
public override int BaseEnergyResistance => 10;
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
|
||||
public override ArmorMaterialType MaterialType => ArmorMaterialType.Plate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,24 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class ShaminoCrossbow : RepeatingCrossbow
|
||||
{
|
||||
public class ShaminoCrossbow : RepeatingCrossbow
|
||||
[Constructible]
|
||||
public ShaminoCrossbow()
|
||||
{
|
||||
[Constructible]
|
||||
public ShaminoCrossbow()
|
||||
{
|
||||
Hue = 0x504;
|
||||
LootType = LootType.Blessed;
|
||||
Hue = 0x504;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Attributes.AttackChance = 15;
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public ShaminoCrossbow(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062915; // Shamino's Best Crossbow
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Attributes.AttackChance = 15;
|
||||
Attributes.WeaponDamage = 40;
|
||||
WeaponAttributes.SelfRepair = 10;
|
||||
WeaponAttributes.LowerStatReq = 100;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062915; // Shamino's Best Crossbow
|
||||
|
||||
public override int InitMinHits => 255;
|
||||
public override int InitMaxHits => 255;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,73 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using ModernUO.Serialization;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[Flippable(0x234E, 0x234F)]
|
||||
[SerializationGenerator(1)]
|
||||
public partial class TapestryOfSosaria : Item, ISecurable
|
||||
{
|
||||
[Flippable(0x234E, 0x234F)]
|
||||
public class TapestryOfSosaria : Item, ISecurable
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private SecureLevel _level;
|
||||
|
||||
[Constructible]
|
||||
public TapestryOfSosaria() : base(0x234E)
|
||||
{
|
||||
[Constructible]
|
||||
public TapestryOfSosaria() : base(0x234E)
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062917; // The Tapestry of Sosaria
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
from.CloseGump<InternalGump>();
|
||||
from.SendGump(new InternalGump());
|
||||
}
|
||||
|
||||
public TapestryOfSosaria(Serial serial) : base(serial)
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1062917; // The Tapestry of Sosaria
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public InternalGump() : base(50, 50)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
SetSecureLevelEntry.AddTo(from, this, list);
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.CloseGump<InternalGump>();
|
||||
from.SendGump(new InternalGump());
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.WriteEncodedInt((int)Level);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
|
||||
Level = (SecureLevel)reader.ReadEncodedInt();
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
{
|
||||
public InternalGump() : base(50, 50)
|
||||
{
|
||||
AddImage(0, 0, 0x2C95);
|
||||
}
|
||||
AddImage(0, 0, 0x2C95);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
Projects/UOContent/Migrations/Server.Items.HearthOfHomeFire.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.HearthOfHomeFire.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.HearthOfHomeFire"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.HearthOfHomeFireDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.HearthOfHomeFireDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.HearthOfHomeFireDeed"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.HolySword.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.HolySword.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.HolySword"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.LeggingsOfEmbers.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.LeggingsOfEmbers.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.LeggingsOfEmbers"
|
||||
}
|
||||
27
Projects/UOContent/Migrations/Server.Items.RoseOfTrinsic.v1.json
generated
Normal file
27
Projects/UOContent/Migrations/Server.Items.RoseOfTrinsic.v1.json
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"version": 1,
|
||||
"type": "Server.Items.RoseOfTrinsic",
|
||||
"properties": [
|
||||
{
|
||||
"name": "Petals",
|
||||
"type": "int",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NextSpawnTime",
|
||||
"type": "System.DateTime",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Level",
|
||||
"type": "Server.Multis.SecureLevel",
|
||||
"rule": "EnumMigrationRule"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.RoseOfTrinsicPetal.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.RoseOfTrinsicPetal.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.RoseOfTrinsicPetal"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.SamuraiHelm.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.SamuraiHelm.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SamuraiHelm"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.ShaminoCrossbow.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Items.ShaminoCrossbow.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.ShaminoCrossbow"
|
||||
}
|
||||
11
Projects/UOContent/Migrations/Server.Items.TapestryOfSosaria.v1.json
generated
Normal file
11
Projects/UOContent/Migrations/Server.Items.TapestryOfSosaria.v1.json
generated
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": 1,
|
||||
"type": "Server.Items.TapestryOfSosaria",
|
||||
"properties": [
|
||||
{
|
||||
"name": "Level",
|
||||
"type": "Server.Multis.SecureLevel",
|
||||
"rule": "EnumMigrationRule"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue