From cdc2ea44daf216aa1d8ec2328ca49d79bdd27ea2 Mon Sep 17 00:00:00 2001 From: eos Date: Sun, 10 Feb 2013 20:14:38 +0000 Subject: [PATCH] Pre-AOS compatibility for Valentine's items. --- .../Valentine/2011/Items/StValentinesBears.cs | 26 +++++++++++++++++++ .../Valentine/2012/Items/CupidsArrow.cs | 8 ++++++ .../Special/Valentines/2007/ValentinesCard.cs | 9 +++++++ 3 files changed, 43 insertions(+) diff --git a/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs b/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs index b56e1371c..6efa59b33 100644 --- a/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs +++ b/Scripts/Holiday Stuff/Valentine/2011/Items/StValentinesBears.cs @@ -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 ) diff --git a/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs b/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs index 9ee320486..b5e5d7ecb 100644 --- a/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs +++ b/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs @@ -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 ) ) diff --git a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs index 55a558200..0483a9451 100644 --- a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs +++ b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs @@ -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)