All pastes #256202 Raw Edit

Untitled

public text v1 · immutable
#256202 ·published 2006-11-23 21:19 UTC
rendered paste body
		public override void OnSingleClick( Mobile from )
		{
            DisableHiddenSelfClick = true;

			if ( Map == Faction.Facet )
			{
				PlayerState pl = PlayerState.Find( this );

				if ( pl != null )
				{
					string text;
					bool ascii = false;

					Faction faction = pl.Faction;

					if ( faction.Commander == this )
						text = String.Concat( this.Female ? "(Commanding Lady of the " : "(Commanding Lord of the ", faction.Definition.FriendlyName, ")" );
					else if ( pl.Sheriff != null )
						text = String.Concat( "(The Sheriff of ", pl.Sheriff.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" );
					else if ( pl.Finance != null )
						text = String.Concat( "(The Finance Minister of ", pl.Finance.Definition.FriendlyName, ", ", faction.Definition.FriendlyName, ")" );
					else
					{
						ascii = true;

						if ( pl.MerchantTitle != MerchantTitle.None )
							text = String.Concat( "(", MerchantTitles.GetInfo( pl.MerchantTitle ).Title.String, ", ", faction.Definition.FriendlyName, ")" );
						else
							text = String.Concat( "(", pl.Rank.Title.String, ", ", faction.Definition.FriendlyName, ")" );
					}

					int hue = ( Faction.Find( from ) == faction ? 98 : 38 );

					PrivateOverheadMessage( MessageType.Label, hue, ascii, text, from.NetState );
				}
			}

            //base.OnSingleClick( from );
            #region base.OnSingleClick

            string abbreviation = string.Empty;

            if (Deleted)
                return;
            
            if (GuildClickMessage)
            {
                BaseGuild guild = Guild;
                if (guild != null && (DisplayGuildTitle))
                {
                    abbreviation = String.Format("[{0}]", Guild.Abbreviation.ToString());
                }
                else
                    abbreviation = string.Empty;
            }

            int playerNameHue = 0x000;

            if (from == this)
            {
                if (NameHue != -1)
                    playerNameHue = NameHue;
                else if (AccessLevel > AccessLevel.Player)
                    playerNameHue = 11;
                else if (from.Kills >= 5)
                    playerNameHue = 33;
                else if (from.Criminal)
                    playerNameHue = 0x3B2;
                else if (from.Kills <= 4)
                    playerNameHue = 0x063;
            }
            else
            {
                if (NameHue != -1)
                    playerNameHue = NameHue;
                else if (AccessLevel > AccessLevel.Player)
                    playerNameHue = 11;
                else
                    playerNameHue = Notoriety.GetHue(Notoriety.Compute(from, this));
            }


            string name = Name;
            if (name == null)
                name = String.Empty;


            string prefix = "";
            if (ShowFameTitle && (Player || Body.IsHuman) && Fame >= 10000)
                prefix = (Female ? "Lady" : "Lord");

            string suffix = "";
            if (ClickTitle && Title != null && Title.Length > 0)
                suffix = Title;

            suffix = ApplyNameSuffix(suffix);

            suffix = "" +abbreviation + suffix;

            if (from == this && from.Criminal)
                suffix = suffix + "[criminal]";

            string playerName;

            if (prefix.Length > 0 && suffix.Length > 0)
                playerName = String.Concat(prefix, " ", name, " ", suffix);
            else if (prefix.Length > 0)
                playerName = String.Concat(prefix, " ", name);
            else if (suffix.Length > 0)
                playerName = String.Concat(name, " ", suffix);
            else
                playerName = name;

            PrivateOverheadMessage(MessageType.Label, playerNameHue, AsciiClickMessage, playerName, from.NetState);           

            #endregion
        }