All pastes #13408 Raw Edit

tobz

public text v1 · immutable
#13408 ·published 2005-06-05 00:38 UTC
rendered paste body
public virtual string SecondaryTitle
		{
			set
			{
				if (value.Length > 20)
				{
					m_secondaryTitle = value.Substring(0, 20);
				}
				else
				{
					m_secondaryTitle = value;
				}
				
				if (ObjectState == eObjectState.Active)
				{
					Out.SendUpdatePlayer();

					if (value == "None")
					{
						m_secondaryTitle = "";
						Out.SendVisualEffect(eVisualEffectType.TitleSetCleared);
					}
					else
					{
						Out.SendVisualEffect(eVisualEffectType.TitleSet);
						Out.SendMessage(
							string.Format("Your title has been set to {0}.", value),
							eChatType.CT_System,
							eChatLoc.CL_SystemWindow
						);
					}

					Out.SendUpdatePlayer();

					foreach (GamePlayer player in GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
					{
						if (player != this)
						{
							player.Out.SendRemoveObject(this);
							player.Out.SendPlayerCreate(this);
							player.Out.SendLivingEquipementUpdate(this);
						}
					}
				}
			}
			get
			{
				if (m_secondaryTitle == String.Empty || m_secondaryTitle == "")
				{
					return "Master Soldier";
				}
				else
				{
					return m_secondaryTitle;
				}
			}
		}