diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BaseStaffHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BaseStaffHide.cs new file mode 100644 index 000000000..cd95d5c53 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BaseStaffHide.cs @@ -0,0 +1,158 @@ +using System; +using Server.Spells; + +namespace Server.Items +{ + [Serializable(0)] + public abstract partial class BaseStaffHide : Item + { + public virtual bool CastHide => false; + public virtual bool CastArea => false; + + public BaseStaffHide(int hue, int itemID = 0x1ECD) : base(itemID) + { + Stackable = false; + Hue = hue; + Weight = 1.0; + LootType = LootType.Blessed; + Visible = false; + } + + public override void OnDoubleClick(Mobile from) + { + if (!IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(1042001); + } + else if (CastHide) + { + new HideSpell(this, from).Cast(); + } + else if (CastArea) + { + new CastAreaSpell(this, from).Cast(); + } + else if (from.CanBeginAction()) + { + HideEffects(from); + } + } + + public override void GetProperties(ObjectPropertyList list) + { + base.GetProperties(list); + + list.Add("(Staff Only)"); + } + + public virtual void HideEffects(Mobile from) + { + from.BeginAction(); + } + + public virtual void OnEndHideEffects(Mobile from) + { + from.EndAction(); + } + + public override bool IsAccessibleTo(Mobile from) => from.AccessLevel >= AccessLevel.GameMaster; + + public override void OnDoubleClickNotAccessible(Mobile from) + { + if (from.AccessLevel != AccessLevel.Player) + { + base.OnDoubleClickNotAccessible(from); + return; + } + + from.SendMessage("It vanishes without a trace."); + Delete(); + } + + private class HideSpell : Spell + { + private static readonly SpellInfo _spellInfo = new("Staff Hide", "", Type.EmptyTypes); + + private readonly Mobile _from; + private readonly BaseStaffHide _item; + + public HideSpell(BaseStaffHide item, Mobile from) : base(from, null, _spellInfo) + { + _from = from; + _item = item; + } + + public override bool ClearHandsOnCast => false; + public override bool RevealOnCast => false; + public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.0); + + public override TimeSpan GetCastRecovery() => TimeSpan.Zero; + + public override TimeSpan GetCastDelay() => TimeSpan.FromSeconds(1.0); + + public override int GetMana() => 0; + + public override bool ConsumeReagents() => false; + + public override bool CheckFizzle() => false; + + public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) => false; + + public override void OnDisturb(DisturbType type, bool message) + { + } + + public override void OnCast() + { + FinishSequence(); + if (_item is { Deleted: false }) + { + _item.HideEffects(_from); + } + } + } + + private class CastAreaSpell : Spell + { + private static readonly SpellInfo _spellInfo = new("Staff Hide", "", 263, Type.EmptyTypes); + + private readonly Mobile _from; + private readonly BaseStaffHide _item; + + public CastAreaSpell(BaseStaffHide item, Mobile from) : base(from, null, _spellInfo) + { + _from = from; + _item = item; + } + + public override bool ClearHandsOnCast => false; + public override bool RevealOnCast => false; + public override TimeSpan CastDelayBase => TimeSpan.FromSeconds(1.0); + + public override TimeSpan GetCastRecovery() => TimeSpan.Zero; + + public override TimeSpan GetCastDelay() => TimeSpan.FromSeconds(1.0); + + public override int GetMana() => 0; + + public override bool ConsumeReagents() => false; + + public override bool CheckFizzle() => false; + + public override bool CheckDisturb(DisturbType type, bool checkFirst, bool resistable) => false; + + public override void OnDisturb(DisturbType type, bool message) + { + } + + public override void OnCast() + { + FinishSequence(); + if (_item is { Deleted: false }) + { + _item.HideEffects(_from); + } + } + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BloodOathHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BloodOathHide.cs new file mode 100644 index 000000000..41f998da5 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/BloodOathHide.cs @@ -0,0 +1,34 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class BloodOathHide : BaseStaffHide + { + public override bool CastHide => false; + + public override string DefaultName => "Blood Oath Hide"; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x375A, 1, 17, 33, 7, 9919, 0); + Effects.SendLocationParticles(from, 0x3728, 1, 13, 33, 7, 9502, 0); + } + else + { + from.FixedParticles(0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist); + from.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255); + } + + Effects.PlaySound(from, 0x175); + OnEndHideEffects(from); + } + + [Constructible] + public BloodOathHide() : base(2117) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ExplosionHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ExplosionHide.cs new file mode 100644 index 000000000..53c49061c --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ExplosionHide.cs @@ -0,0 +1,31 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class ExplosionHide : BaseStaffHide + { + public override bool CastHide => false; + + public override string DefaultName => "Explosion Hide"; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x36BD, 20, 10, 5044); + } + else + { + from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist); + } + + Effects.PlaySound(from, 0x307); + OnEndHideEffects(from); + } + + [Constructible] + public ExplosionHide() : base(2113) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FireHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FireHide.cs new file mode 100644 index 000000000..14eed0bdd --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FireHide.cs @@ -0,0 +1,31 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class FireHide : BaseStaffHide + { + public override bool CastHide => false; + + public override string DefaultName => "Fire Hide"; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x3709, 1, 30, 0, 7, 9965, 0); + } + else + { + from.FixedParticles(0x3709, 1, 30, 9965, 0, 7, EffectLayer.Waist); + } + + Effects.PlaySound(from, 0x225); + OnEndHideEffects(from); + } + + [Constructible] + public FireHide() : base(1161) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FlameStormHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FlameStormHide.cs new file mode 100644 index 000000000..c84e5cc2b --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/FlameStormHide.cs @@ -0,0 +1,69 @@ +using System; + +namespace Server.Items +{ + [Serializable(0)] + public partial class FlamestormHide : BaseStaffHide + { + public override string DefaultName => "Firestorm Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + if (from is not { Deleted: false }) + { + return; + } + + if (from.Hidden) + { + from.HueMod = 0; + from.BodyMod = 15; + from.Hue = 0; + from.BodyValue = 15; + from.Hidden = false; + from.Animate(12, 10, 0, true, false, 0); + from.PlaySound(273); + Timer.StartTimer(TimeSpan.FromSeconds(1.5), () => AnimStop_Callback(from, false)); + } + else + { + from.Animate(17, 4, 1, true, false, 0); + Timer.StartTimer(TimeSpan.FromSeconds(0.75), () => CastStop_Callback(from)); + } + + } + + private void AnimStop_Callback(Mobile from, bool toHide) + { + from.HueMod = -1; + from.BodyMod = -1; + + if (toHide) + { + from.Hidden = true; + } + else + { + from.Animate(17, 4, 1, false, false, 0); + } + + OnEndHideEffects(from); + } + + private void CastStop_Callback(Mobile from) + { + from.HueMod = 0; + from.BodyValue = 15; + from.Animate(12, 8, 1, false, false, 0); + from.PlaySound(274); + Timer.StartTimer(TimeSpan.FromSeconds(1.5), () => AnimStop_Callback(from, true)); + } + + [Constructible] + public FlamestormHide() : base(1160) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/GateHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/GateHide.cs new file mode 100644 index 000000000..a83978b36 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/GateHide.cs @@ -0,0 +1,81 @@ +using System; + +namespace Server.Items +{ + [Serializable(0)] + public partial class GateHide : BaseStaffHide + { + [SerializableField(1)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private bool _redGate; + + [SerializableField(2)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _gateHue; + + [SerializableField(3)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _gateSound; + + public override string DefaultName => "Gate Hide"; + + public override bool CastArea => true; + + public override void HideEffects(Mobile from) + { + var worldLocation = new WorldLocation(from.Location, from.Map); + + var redGate = _redGate ? 0x1AE5 : 0x1AF3; + var gateHue = _gateHue > 0 ? _gateHue - 1 : 0; + Effects.SendLocationParticles(from, redGate, 8, 26, gateHue, 0, 0, 0); + Effects.PlaySound(from, _gateSound); + Timer.StartTimer(TimeSpan.FromSeconds(1.25), () => PlaceGate(from, worldLocation)); + } + + private void PlaceGate(Mobile from, WorldLocation worldLocation) + { + var itemId = _redGate ? 0xDDA : 0xF6C; + var hue = _gateHue > 0 ? _gateHue : 0; + + var moongate = new StaffHideMoongate(itemId, hue, worldLocation.Location, worldLocation.Map); + + Timer.StartTimer(TimeSpan.FromSeconds(1.0) , () => from.Hidden = !from.Hidden); + Timer.StartTimer(TimeSpan.FromSeconds(3.0), () => KillGate(moongate)); + } + + private void KillGate(Moongate moongate) + { + if (moongate is { Deleted: false }) + { + var effectItem = EffectItem.Create(moongate.Location, moongate.Map, EffectItem.DefaultDuration); + Effects.SendLocationParticles(effectItem, 0x376A, 9, 20, 5042); + Effects.PlaySound(moongate.Location, moongate.Map, 0x201); + moongate.Delete(); + } + } + + [Constructible] + public GateHide() : base(1154) + { + _gateSound = 496; + _gateHue = 0; + } + + [Serializable(0)] + private partial class StaffHideMoongate : Moongate + { + public StaffHideMoongate(int itemId, int hue, Point3D loc, Map map) : base(loc, map, false) + { + ItemID = itemId; + Hue = hue; + TargetMap = Map.Internal; + } + + [AfterDeserialization(false)] + private void AfterDeserialization() + { + Delete(); + } + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/LightningBoltHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/LightningBoltHide.cs new file mode 100644 index 000000000..d14f2129a --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/LightningBoltHide.cs @@ -0,0 +1,22 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class ThunderHide : BaseStaffHide + { + public override string DefaultName => "Lighting Bolt Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + var entity = new Entity(from.Serial, from.Location, from.Map); + Effects.SendBoltEffect(entity); + } + + [Constructible] + public ThunderHide() : base(1153) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MJHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MJHide.cs new file mode 100644 index 000000000..40f625ea2 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MJHide.cs @@ -0,0 +1,82 @@ +using System; + +namespace Server.Items +{ + [Serializable(0)] + public partial class MJHide : BaseStaffHide + { + private Timer _timer; + + public override string DefaultName => "Staff MJ Hide"; + + public override bool CastHide => false; + + [Constructible] + public MJHide() : base(2119) + { + } + + public override void HideEffects(Mobile from) + { + if (from.Hidden) + { + from.Hidden = false; + from.Animate(1, 5, 1, true, false, 0); + from.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist); + from.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist); + + from.PlaySound(0x244); + } + else + { + _timer = new Countdown(from, this); + _timer.Start(); + } + } + + public class Countdown: Timer + { + private int _count; + private readonly Mobile _mobile; + private readonly MJHide _item; + + public Countdown(Mobile mobile, MJHide item): base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0)) + { + _mobile = mobile; + _item = item; + _count = 2; + } + + private static void Emote(Mobile from) + { + from.BoltEffect(0); + from.Animate(22, 5, 1, true, false, 0); + } + + protected override void OnTick() + { + switch (_count) + { + case 2: + { + Emote(_mobile); + break; + } + case 1: + { + _mobile.Hidden = true; + break; + } + case 0: + { + Stop(); + _item._timer = null; + break; + } + } + + _count--; + } + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MoleHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MoleHide.cs new file mode 100644 index 000000000..b097267b1 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/MoleHide.cs @@ -0,0 +1,66 @@ +using System; + +namespace Server.Items +{ + [Serializable(0)] + public partial class MoleHide : BaseStaffHide + { + private class MoleInfo + { + public Mobile _from; + public int _count; + + public MoleInfo(Mobile from) => _from = from; + } + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + Action callback; + var moleInfo = new MoleInfo(from); + + if (from.Hidden) + { + from.Z -= 10; + from.Hidden = false; + callback = () => DoIncZ_Callback(moleInfo); + } + else + { + callback = () => DoDecZ_Callback(moleInfo); + } + + Timer.StartTimer(TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(100), 10, callback); + from.PlaySound(0x244); + } + + private void DoIncZ_Callback(MoleInfo info) + { + info._from.Z++; + info._count++; + if (info._count > 9) + { + info._from.EndAction(typeof(MoleHide)); + } + } + + private void DoDecZ_Callback(MoleInfo info) + { + + info._from.Z++; + info._count++; + if (info._count > 9) + { + info._from.Hidden = true; + info._from.Z += 10; + OnEndHideEffects(info._from); + } + } + + [Constructible] + public MoleHide() : base(1717) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/NobleHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/NobleHide.cs new file mode 100644 index 000000000..5f73ba4de --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/NobleHide.cs @@ -0,0 +1,41 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class NobleHide : BaseStaffHide + { + [SerializableField(0)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _effectHue = 5; + + [SerializableField(1)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _effectSound = 0x244; + + public override string DefaultName => "Noble Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x3709, 1, 30, _effectHue, 7, 9965, 0); + Effects.SendLocationParticles(from, 0x376A, 1, 30, _effectHue, 3, 9502, 0); + } + else + { + from.FixedParticles(0x3709, 1, 30, 9965, _effectHue, 7, EffectLayer.Waist); + from.FixedParticles(0x376A, 1, 30, 9502, _effectHue, 3, (EffectLayer)255); + } + + Effects.PlaySound(from, _effectSound); + } + + [Constructible] + public NobleHide() : base(2119) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/PoisonHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/PoisonHide.cs new file mode 100644 index 000000000..7ce935bfb --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/PoisonHide.cs @@ -0,0 +1,32 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class PoisonHide : BaseStaffHide + { + public override string DefaultName => "Poison Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x36CB, 1, 9, 67, 5, 9911, 0); + Effects.SendLocationParticles(from, 0x374A, 1, 17, 1108, 4, 9502, 0); + } + else + { + from.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Waist); + from.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255); + } + + Effects.PlaySound(from, 0x22F); + } + + [Constructible] + public PoisonHide() : base(1268) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ShinyHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ShinyHide.cs new file mode 100644 index 000000000..a43136e40 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/ShinyHide.cs @@ -0,0 +1,34 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class ShinyHide : BaseStaffHide + { + public override string DefaultName => "Shiny Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x375A, 1, 30, 33, 2, 9966, 0); + Effects.SendLocationParticles(from, 0x37B9, 1, 30, 43, 3, 9502, 0); + } + else + { + from.FixedParticles(0x375A, 1, 30, 9966, 33, 2, EffectLayer.Waist); + from.FixedParticles(0x37B9, 1, 30, 9502, 43, 3, (EffectLayer)255); + } + + Effects.PlaySound(from, 0x0F5); + Effects.PlaySound(from, 0x1ED); + } + + [Constructible] + public ShinyHide() : base(1150) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeBombHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeBombHide.cs new file mode 100644 index 000000000..1d0b10e1c --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeBombHide.cs @@ -0,0 +1,31 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class SmokeBombHide : BaseStaffHide + { + public override string DefaultName => "Smoke Bomb Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x3709, 1, 30, 1108, 6, 9904, 0); + } + else + { + from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot); + } + + Effects.PlaySound(from, 0x22F); + } + + [Constructible] + public SmokeBombHide() : base(1175) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeHide.cs new file mode 100644 index 000000000..504f1f099 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/SmokeHide.cs @@ -0,0 +1,46 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class SmokeHide : BaseStaffHide + { + [SerializableField(0)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _effectHue = 1149; + + [SerializableField(1)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _effectSound = 0x228; + + [SerializableField(1)] + [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")] + private int _effectId = 0x3728; + + public override string DefaultName => "Smoke Hide"; + + public override bool CastHide => true; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z + 4), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y, from.Z - 4), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z + 4), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X, from.Y + 1, from.Z - 4), from.Map, _effectId, 13, 1, _effectHue, 4); + + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 11), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 7), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z + 3), from.Map, _effectId, 13, 1, _effectHue, 4); + Effects.SendLocationEffect(new Point3D(from.X + 1, from.Y + 1, from.Z - 1), from.Map, _effectId, 13, 1, _effectHue, 4); + + Effects.PlaySound(from, _effectSound); + } + + [Constructible] + public SmokeHide() : base(2119) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/WitherHide.cs b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/WitherHide.cs new file mode 100644 index 000000000..77d113ca8 --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/Staff Hide Crystals/WitherHide.cs @@ -0,0 +1,33 @@ +namespace Server.Items +{ + [Serializable(0)] + public partial class WitherHide : BaseStaffHide + { + public override string DefaultName => "Gate Hide"; + + public override bool CastHide => false; + + public override void HideEffects(Mobile from) + { + from.Hidden = !from.Hidden; + + if (from.Hidden) + { + Effects.SendLocationParticles(from, 0x37CC, 1, 40, 3, 9917, 97, 0); + Effects.SendLocationParticles(from, 0x374A, 1, 15, 97, 3, 9502, 0); + } + else + { + from.FixedParticles(0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist); + from.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255); + } + + Effects.PlaySound(from, 0x10B); + } + + [Constructible] + public WitherHide() : base(1152) + { + } + } +} diff --git a/Projects/UOContent/Items/Staff Only/StaffEtherealMount.cs b/Projects/UOContent/Items/Staff Only/StaffEtherealMount.cs new file mode 100644 index 000000000..f964c090d --- /dev/null +++ b/Projects/UOContent/Items/Staff Only/StaffEtherealMount.cs @@ -0,0 +1,153 @@ +/* + * Original Author: snicker7 (GMEthereal.cs) + * Released: 03/26/2006 + * Updated for ModernUO by Kamron +*/ + +using System.Collections.Generic; + +namespace Server.Mobiles +{ + public enum EtherealType + { + Horse, + Llama, + Ostard, + DesertOstard, + FrenziedOstard, + Ridgeback, + Unicorn, + Beetle, + Kirin, + SwampDragon, + SkeletalHorse, + Hiryu, + ChargerOfTheFallen, + SeaHorse, + Chimera, + CuSidhe, + PolarBear, + Boura + } + + [Serializable(0)] + public partial class StaffEtherealMount : EtherealMount + { + public override int FollowerSlots => 0; + + private static readonly Dictionary EtherealTypes = new() { + { EtherealType.Horse, new EtherealInfo(0x20DD, 0x3EAA) }, + { EtherealType.Llama, new EtherealInfo(0x20F6, 0x3EAB) }, + { EtherealType.Ostard, new EtherealInfo(0x2135, 0x3EAC) }, + { EtherealType.DesertOstard, new EtherealInfo(8501, 16035) }, + { EtherealType.FrenziedOstard, new EtherealInfo(8502, 16036) }, + { EtherealType.Ridgeback, new EtherealInfo(0x2615, 0x3E9A) }, + { EtherealType.Unicorn, new EtherealInfo(0x25CE, 0x3E9B) }, + { EtherealType.Beetle, new EtherealInfo(0x260F, 0x3E97) }, + { EtherealType.Kirin, new EtherealInfo(0x25A0, 0x3E9C) }, + { EtherealType.SwampDragon, new EtherealInfo(0x2619, 0x3E98) }, + { EtherealType.SkeletalHorse, new EtherealInfo(9751, 16059) }, + { EtherealType.Hiryu, new EtherealInfo(10090, 16020) }, + { EtherealType.ChargerOfTheFallen, new EtherealInfo(11676, 16018) }, + { EtherealType.SeaHorse, new EtherealInfo(9658, 16051) }, + { EtherealType.Chimera, new EtherealInfo(11669, 16016) }, + { EtherealType.CuSidhe, new EtherealInfo(11670, 16017) }, + { EtherealType.PolarBear, new EtherealInfo(8417, 16069) }, + { EtherealType.Boura, new EtherealInfo(0x46f8, 0x3EC6) }, + }; + + [SerializableField(0)] + private EtherealType _etherealType; + + [Constructible] + public StaffEtherealMount() : this(EtherealType.Horse) + { + } + + [Constructible] + public StaffEtherealMount(EtherealType type) : base(0, 0) + { + EthyType = type; + LootType = LootType.Blessed; + Name = "Staff Ethereal"; + Visible = false; + } + + [CommandProperty(AccessLevel.Counselor)] + public EtherealType EthyType + { + get => _etherealType; + set + { + if (!EtherealTypes.TryGetValue(value, out var etherealInfo)) + { + return; + } + + EtherealType = value; + + MountedID = etherealInfo._mountedId; + RegularID = etherealInfo._regularId; + } + } + + public override bool IsAccessibleTo(Mobile from) => from.AccessLevel >= AccessLevel.GameMaster; + + public override void OnDoubleClickNotAccessible(Mobile from) + { + if (from.AccessLevel != AccessLevel.Player) + { + base.OnDoubleClickNotAccessible(from); + return; + } + + from.SendMessage("It vanishes without a trace."); + Delete(); + } + + public override void OnDoubleClick(Mobile from) + { + if (Deleted || Rider != null || !Multis.DesignContext.Check(from)) + { + return; + } + + if (from.Mounted) + { + from.SendLocalizedMessage(1005583); // Please dismount first. + } + else if (from.Race == Race.Gargoyle) + { + from.SendLocalizedMessage(1112281); // Gargoyles can't mount + } + else if (from.HasTrade) + { + from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time + } + else if (!IsChildOf(from.Backpack)) + { + from.SendLocalizedMessage(1080063); // This must be in your backpack to use it. + } + else + { + Rider = from; + + if (_etherealType == EtherealType.SeaHorse) + { + Rider.CanSwim = true; + } + } + } + + private struct EtherealInfo + { + public readonly int _regularId; + public readonly int _mountedId; + public EtherealInfo(int id, int mid) + { + _regularId = id; + _mountedId = mid; + } + } + } +} diff --git a/Projects/UOContent/Migrations/Server.Items.BaseStaffHide.v0.json b/Projects/UOContent/Migrations/Server.Items.BaseStaffHide.v0.json new file mode 100644 index 000000000..08a454fe9 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BaseStaffHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BaseStaffHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.BloodOathHide.v0.json b/Projects/UOContent/Migrations/Server.Items.BloodOathHide.v0.json new file mode 100644 index 000000000..bc0f7c1f4 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.BloodOathHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.BloodOathHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.ExplosionHide.v0.json b/Projects/UOContent/Migrations/Server.Items.ExplosionHide.v0.json new file mode 100644 index 000000000..6f6813c39 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.ExplosionHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.ExplosionHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.FireHide.v0.json b/Projects/UOContent/Migrations/Server.Items.FireHide.v0.json new file mode 100644 index 000000000..906cecd14 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.FireHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.FireHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.FlamestormHide.v0.json b/Projects/UOContent/Migrations/Server.Items.FlamestormHide.v0.json new file mode 100644 index 000000000..e9af4f58c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.FlamestormHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.FlamestormHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.GateHide.StaffHideMoongate.v0.json b/Projects/UOContent/Migrations/Server.Items.GateHide.StaffHideMoongate.v0.json new file mode 100644 index 000000000..f4c54af43 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GateHide.StaffHideMoongate.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.GateHide.StaffHideMoongate" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.GateHide.v0.json b/Projects/UOContent/Migrations/Server.Items.GateHide.v0.json new file mode 100644 index 000000000..33902e324 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GateHide.v0.json @@ -0,0 +1,30 @@ +{ + "version": 0, + "type": "Server.Items.GateHide", + "properties": [ + { + "name": "RedGate", + "type": "bool", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "GateHue", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "GateSound", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MJHide.v0.json b/Projects/UOContent/Migrations/Server.Items.MJHide.v0.json new file mode 100644 index 000000000..ea2fa82b8 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MJHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.MJHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.MoleHide.v0.json b/Projects/UOContent/Migrations/Server.Items.MoleHide.v0.json new file mode 100644 index 000000000..cda07d437 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.MoleHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.MoleHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.NobleHide.v0.json b/Projects/UOContent/Migrations/Server.Items.NobleHide.v0.json new file mode 100644 index 000000000..ba80ba291 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.NobleHide.v0.json @@ -0,0 +1,22 @@ +{ + "version": 0, + "type": "Server.Items.NobleHide", + "properties": [ + { + "name": "EffectHue", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "EffectSound", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.PoisonHide.v0.json b/Projects/UOContent/Migrations/Server.Items.PoisonHide.v0.json new file mode 100644 index 000000000..290920900 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.PoisonHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.PoisonHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.ShinyHide.v0.json b/Projects/UOContent/Migrations/Server.Items.ShinyHide.v0.json new file mode 100644 index 000000000..f1831a01a --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.ShinyHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.ShinyHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SmokeBombHide.v0.json b/Projects/UOContent/Migrations/Server.Items.SmokeBombHide.v0.json new file mode 100644 index 000000000..2865ea0a7 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SmokeBombHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.SmokeBombHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.SmokeHide.v0.json b/Projects/UOContent/Migrations/Server.Items.SmokeHide.v0.json new file mode 100644 index 000000000..f3c089e33 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.SmokeHide.v0.json @@ -0,0 +1,22 @@ +{ + "version": 0, + "type": "Server.Items.SmokeHide", + "properties": [ + { + "name": "EffectHue", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + }, + { + "name": "EffectSound", + "type": "int", + "rule": "PrimitiveTypeMigrationRule", + "ruleArguments": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.ThunderHide.v0.json b/Projects/UOContent/Migrations/Server.Items.ThunderHide.v0.json new file mode 100644 index 000000000..6b977490f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.ThunderHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.ThunderHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Items.WitherHide.v0.json b/Projects/UOContent/Migrations/Server.Items.WitherHide.v0.json new file mode 100644 index 000000000..b513b1dcc --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.WitherHide.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.WitherHide" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Mobiles.StaffEtherealMount.v0.json b/Projects/UOContent/Migrations/Server.Mobiles.StaffEtherealMount.v0.json new file mode 100644 index 000000000..1de5a5795 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Mobiles.StaffEtherealMount.v0.json @@ -0,0 +1,11 @@ +{ + "version": 0, + "type": "Server.Mobiles.StaffEtherealMount", + "properties": [ + { + "name": "EtherealType", + "type": "Server.Mobiles.EtherealType", + "rule": "EnumMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs b/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs index 98f8be9b1..5f2165faa 100644 --- a/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs +++ b/Projects/UOContent/Mobiles/Animals/Mounts/Ethereals.cs @@ -13,8 +13,7 @@ namespace Server.Mobiles private Mobile m_Rider; [Constructible] - public EtherealMount(int itemID, int mountID) - : base(itemID) + public EtherealMount(int itemID, int mountID) : base(itemID) { m_MountedID = mountID; m_RegularID = itemID;