Files
abysmal-isle/Scripts/Items/Artifacts/Equipment/Jewelry/BarreraakRing.cs
Unstable Kitsune b918192e4e Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
2023-11-28 23:20:26 -05:00

97 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using Server.Mobiles;
namespace Server.Items
{
[TypeAlias("Server.Items.BarreraakRing")]
public class BarreraaksRing : GoldRing
{
public override bool IsArtifact { get { return true; } }
public override int LabelNumber { get { return 1095049; } } // Barreraaks Old Beat Up Ring
[Constructable]
public BarreraaksRing()
{
//TODO: Get Hue
LootType = LootType.Blessed;
}
public override bool CanEquip(Mobile from)
{
if (!base.CanEquip(from))
{
return false;
}
else if (from.Mounted)
{
from.SendLocalizedMessage(1010097); // You cannot use this while mounted.
return false;
}
else if (from.Flying)
{
from.SendLocalizedMessage(1113414); // You can't use this while flying!
return false;
}
else if (from.IsBodyMod)
{
from.SendLocalizedMessage(1111896); // You may only change forms while in your original body.
return false;
}
return true;
}
public override void OnAdded( object parent )
{
base.OnAdded(parent);
if(parent is Mobile)
((Mobile)parent).BodyMod = 334;
}
public override void OnRemoved( object parent )
{
base.OnRemoved(parent);
if(parent is Mobile)
((Mobile)parent).BodyMod = 0;
}
public BarreraaksRing(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 (Parent is Mobile)
{
var m = (Mobile)Parent;
Timer.DelayCall(() =>
{
if (!m.Mounted && !m.Flying && !m.IsBodyMod)
{
m.BodyMod = 334;
}
});
}
if (version == 0)
{
reader.ReadInt();
}
}
}
}