Trying to hide FameTitle with an item.
This should be simple but for the life of me I cant make it work. I am simply trying to hide the FameTitles when this item is equipped. I thought I could do this with from.ShowFameTitle = false; but that just gives me an error below.
Now I have tried everything I can think of. I have case mobile to PlayerMobile and tried that. Any suggestions for the way to do this. I know there has to be a way...
Heres the script in case you need to see it.
This should be simple but for the life of me I cant make it work. I am simply trying to hide the FameTitles when this item is equipped. I thought I could do this with from.ShowFameTitle = false; but that just gives me an error below.
Code:
5) Property or indexer 'Server.Mobile.ShowFameTitle' cannot be assigned to -- i
t is read only
Now I have tried everything I can think of. I have case mobile to PlayerMobile and tried that. Any suggestions for the way to do this. I know there has to be a way...
Heres the script in case you need to see it.
Code:
///************************************************///*********************///
/// Script: Halloween Mask /// ,dP""dMb, ///
/// Version: 1.0 /// d" dMP"Tb ///
/// Designed by: Packer898 /// (M YMbodM) ///
/// For use with: RunUO 1.0.0 /// `M, o )MMMP ///
/// Please do NOT remove this header. /// "b,,aMMP" ///
///************************************************************************///
/// Intallation: Place into your Custom directory and restart the server. ///
///************************************************************************///
using System;
using Server.Mobiles;
namespace Server.Items
{
public class HalloweenMask : HornedTribalMask
{
[Constructable]
public HalloweenMask() : base( 0x1549)
{
Hue = 1358;
Name = "Trick or Treat";
LootType = LootType.Blessed;
Weight = 1.0;
}
public HalloweenMask( Serial serial ) : base( serial )
{
}
public override bool OnEquip( Mobile from )
{
if ( from.Mounted == true )
{
from.SendLocalizedMessage( 1042561 );
}
if ( from.BodyValue == 0x190 )
{
from.SendMessage("Trick! You are now a ghoul!");
from.NameMod = "a ghoul";
from.BodyMod = 153;
from.HueMod = 0x0;
from.DisplayGuildTitle = false;
from.Criminal = false;
from.PlaySound( 1343 );
new MaskTimer(from).Start();
}
if ( from.BodyValue == 0x191 )
{
from.SendMessage("Trick! You are now a ghoul!");
from.NameMod = "a ghoul";
from.BodyMod = 153;
from.HueMod = 0x0;
from.DisplayGuildTitle = false;
from.Criminal = false;
from.PlaySound( 1340 );
new MaskTimer(from).Start();
}
if (from is PlayerMobile)
{
PlayerMobile pm = (PlayerMobile)from;
pm.ShowFameTitle = false;
}
return base.OnEquip(from);
}
public override void OnRemoved( object parent )
{
if(parent is Mobile)
{
Mobile from = (Mobile)parent;
if ( from.BodyMod == 153 )
{
from.SendMessage("Treat - Happy Halloween 2005");
from.NameMod = null;
from.BodyMod = 0x0;
from.HueMod = -1;
from.PlaySound( 527 );
}
if(from.Kills >= 5)
{
from.Criminal = true;
}
if(from.GuildTitle != null )
{
from.DisplayGuildTitle = true;
}
}
}
private class MaskTimer : Timer
{
private Mobile m_Mobile;
public MaskTimer( Mobile m ) : base( TimeSpan.FromSeconds( 10.0 ) )
{
m_Mobile = m;
}
protected override void OnTick()
{
m_Mobile.SendMessage("Treat - Happy Halloween 2005");
m_Mobile.NameMod = null;
m_Mobile.BodyMod = 0x0;
m_Mobile.HueMod = -1;
m_Mobile.PlaySound( 527 );
if(m_Mobile.Kills >= 5)
{
m_Mobile.Criminal = true;
}
if(m_Mobile.GuildTitle != null )
{
m_Mobile.DisplayGuildTitle = true;
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}