Kamras
Member
I created a Robe that turns a Gargoyle into a Human using BodyMod, this enabled the user to ride human pets (without the graphic glitch). However I just noticed a problem..
So when the user equips the robe, they turn into the human bodymod with no issue, they can mount, no graphic glitches. However if they remove the robe, they body becomes invisible (like the graphic glitch). Now for other players, they see this glitch and it stays like that until the user logs off and back on again. As far as GM's are concerned, GMS see the glitch and can make the user visible only to the GM by toggling between player and staff...
Clearly something isn't switching back to default bodymod correctly. Anyone have any suggestions on how to make this work right? driving me mad. I posted the script below.
So when the user equips the robe, they turn into the human bodymod with no issue, they can mount, no graphic glitches. However if they remove the robe, they body becomes invisible (like the graphic glitch). Now for other players, they see this glitch and it stays like that until the user logs off and back on again. As far as GM's are concerned, GMS see the glitch and can make the user visible only to the GM by toggling between player and staff...
Clearly something isn't switching back to default bodymod correctly. Anyone have any suggestions on how to make this work right? driving me mad. I posted the script below.
Code:
using System;
using Server.Network;
using Server.Mobiles;
namespace Server.Items
{
[Flipable(0x4002, 0x4003)]
public class ShroudOfTheEternalSteed : BaseOuterTorso
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public ShroudOfTheEternalSteed()
: base(0x4002)
{
Name = "Shroud of the Eternal Steed";
Hue = 1967;
Weight = 0;
// LootType = LootType.Blessed;
}
public ShroudOfTheEternalSteed(Serial serial)
: base(serial)
{
}
public override bool NotWornByHumans
{
get
{
return true;
}
}
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.RevealingAction();
this.ItemID = 0x2684;
if ( from.Body == 0x29A )
{
from.BodyMod = 400; //male
}
else if ( from.Body == 0x29B )
{
from.BodyMod = 401; //Female
}
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);
this.ItemID = 0x4002;
IMount mount = m.Mount;
if ( mount != null )
mount.Rider = null;
if (m.BodyMod == 0x190 || m.BodyMod == 0x191)
{
m.BodyMod = 0;
m.RevealingAction();
}
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();
}
}
}