So I have those shroud that permits gargoyles to ride mounts, it temporarily through bodymod makes you kind of human so the graphic doesn't get messed up, and life is good. Now when the player removes the shroud they return to their usual self, this is good. But the problem is.. If the player logs out while wearing this shroud, the system removes the bodymod upon login and they are glitched (no graphic for mounted gargoyle).

So the solution Im looking for is to force the shroud to be unequipped upon login if detected on layer. However I've never seen any code like that and im kind of stumped of where to start. Here is my working script, please let me know what you guys think on this..


Code:
using System;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
    [Flipable(0x2684, 0x2683)]
    public class ShroudOfTheEternalSteed : BaseOuterTorso
    {
        public override bool IsArtifact { get { return true; } }
        [Constructable]
        public ShroudOfTheEternalSteed()
            : base(0x2684)
        {
            Name = "Shroud of the Eternal Steed";
            Hue = 1967;
            Weight = 0;
            LootType = LootType.Blessed;
        }

        public ShroudOfTheEternalSteed(Serial serial)
            : base(serial)
        {
        }

        public override bool OnEquip( Mobile from )
        {
            Effects.SendTargetEffect(from, 0x3709, 32);
            Effects.SendTargetEffect(from, 0x376A, 32);
            from.LocalOverheadMessage(MessageType.Regular, 0x59, true, "You feel like you could ride anything..");
            from.PlaySound(0x208);
            from.BodyMod = 400;   

            return base.OnEquip( from );
        }
               
        public override void OnRemoved(object parent)
        {
            if (parent is Mobile)
            {
                Mobile m = (Mobile)parent;
                Effects.SendTargetEffect(m, 0x3709, 32);
                m.LocalOverheadMessage(MessageType.Regular, 0x59, true, "You spread your wings..");
                m.PlaySound(0x208);
               
                IMount mount = m.Mount;

                if ( mount != null )
                    mount.Rider = null;
           
               
                if (m.BodyMod == 0x190)
                {
                    m.BodyMod = 0;
                }
                else
                {
                    base.OnRemoved(parent);
                }
            }
        }

        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();
        }
    }
}
 
Nevermind.... As soon as I typed that I thought about it again.. Though not exactly ideal it gets the job done.

In login stats I just added this with the appropriate references.

Code:
                    Item pads = m.FindItemOnLayer(Layer.OuterTorso);

                    if (pads is ShroudOfTheEternalSteed)
                        m.AddToBackpack(pads);
                        m.SendMessage("Your shroud was moved to your pack.");
 
Glad you figured it out... but what about this shroud? I did a google search and did not find anything. It sounds cool. Where did you get it?
 
I made it ;) I was considering releasing my script. Obviously not OSI but it's cool regardless, the shroud will let a gargoyle ride any mount as if they were human without disappearing through a bodymod change. Then fix base mount and remove the racial requirement and make it an item requirement similar to cusidhe and presto lol
[doublepost=1464418959][/doublepost]I went ahead and made it public, in case anyone felt like using/tinkering with it.

https://www.servuo.com/archive/allow-gargoyle-to-ride-mounts.672/
 
Back