Pre-AOS compatibility for Valentine's items.

This commit is contained in:
eos 2013-02-10 20:14:38 +00:00
parent cb6e0910fe
commit cdc2ea44da
3 changed files with 43 additions and 0 deletions

View file

@ -7,6 +7,17 @@ namespace Server.Items
{
public abstract class StValentinesBear : Item
{
public override string DefaultName
{
get
{
if ( m_Owner != null )
return String.Format( "{0}'s St. Valentine Bear", m_Owner );
else
return "St. Valentine Bear";
}
}
private string m_Owner;
private string m_Line1;
private string m_Line2;
@ -84,6 +95,21 @@ namespace Server.Items
list.Add( cliloc, line );
}
public override void OnSingleClick( Mobile from )
{
base.OnSingleClick( from );
ShowLine( from, 1150301, m_Line1 ); // [ ~1_LINE0~ ]
ShowLine( from, 1150302, m_Line2 ); // [ ~1_LINE1~ ]
ShowLine( from, 1150303, m_Line3 ); // [ ~1_LINE2~ ]
}
private void ShowLine( Mobile from, int cliloc, string line )
{
if ( line != null )
LabelTo( from, cliloc, line );
}
public override void OnDoubleClick( Mobile from )
{
if ( !CupidsArrow.CheckSeason( from ) || !CanSign )

View file

@ -56,6 +56,14 @@ namespace Server.Items
return false;
}
public override void OnSingleClick( Mobile from )
{
base.OnSingleClick( from );
if ( IsSigned )
LabelTo( from, 1152273, String.Format( "{0}\t{1}", m_From, m_To ) ); // ~1_val~ is madly in love with ~2_val~
}
public override void OnDoubleClick( Mobile from )
{
if ( IsSigned || !CheckSeason( from ) )

View file

@ -6,6 +6,8 @@ namespace Server.Items
{
public class ValentinesCard : Item
{
public override string DefaultName { get { return "a Valentine's card"; } }
[CommandProperty(AccessLevel.GameMaster)]
public virtual string From { get { return m_From; } set { m_From = value; } }
@ -43,6 +45,13 @@ namespace Server.Items
list.Add(m_LabelNumber, String.Format("{0}\t{1}", (m_To != null) ? m_To : Unsigned, (m_From != null) ? m_From : Unsigned));
}
public override void OnSingleClick( Mobile from )
{
base.OnSingleClick( from );
LabelTo( from, m_LabelNumber, String.Format( "{0}\t{1}", ( m_To != null ) ? m_To : Unsigned, ( m_From != null ) ? m_From : Unsigned ) );
}
public override void OnDoubleClick(Mobile from)
{
if (m_To == null)