This commit is contained in:
parent
cd7c2becf7
commit
5cf819b644
5 changed files with 385 additions and 1 deletions
|
|
@ -264,7 +264,8 @@ namespace Server.Items
|
|||
break;
|
||||
}
|
||||
}
|
||||
ValidatePlacement();
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, ValidatePlacement );
|
||||
}
|
||||
|
||||
public void ValidatePlacement()
|
||||
|
|
|
|||
66
Scripts/Items/Special/Holiday/GingerBreadHouseDeed.cs
Normal file
66
Scripts/Items/Special/Holiday/GingerBreadHouseDeed.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class GingerBreadHouseAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed{ get{ return new GingerBreadHouseDeed(); } }
|
||||
|
||||
public GingerBreadHouseAddon()
|
||||
{
|
||||
for( int i=0x2be5; i<0x2be8; i++ )
|
||||
{
|
||||
LocalizedAddonComponent laoc = new LocalizedAddonComponent( i, 1077395 ); // Gingerbread House
|
||||
laoc.Light = LightType.SouthSmall;
|
||||
AddComponent( laoc, (i==0x2be5) ? -1 : 0, (i==0x2be7) ? -1 : 0, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public GingerBreadHouseAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class GingerBreadHouseDeed : BaseAddonDeed
|
||||
{
|
||||
public override int LabelNumber{ get{ return 1077394; } } //a Gingerbread House Deed
|
||||
public override BaseAddon Addon{ get{ return new GingerBreadHouseAddon(); } }
|
||||
|
||||
[Constructable]
|
||||
public GingerBreadHouseDeed()
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public GingerBreadHouseDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
166
Scripts/Items/Special/Holiday/HolidayFoods.cs
Normal file
166
Scripts/Items/Special/Holiday/HolidayFoods.cs
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CandyCane : Food
|
||||
{
|
||||
private static Dictionary<Mobile, CandyCaneTimer> m_ToothAches;
|
||||
|
||||
public static Dictionary<Mobile, CandyCaneTimer> ToothAches
|
||||
{
|
||||
get { return m_ToothAches; }
|
||||
set { m_ToothAches = value; }
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_ToothAches = new Dictionary<Mobile, CandyCaneTimer>();
|
||||
}
|
||||
|
||||
public class CandyCaneTimer : Timer
|
||||
{
|
||||
private int m_Eaten;
|
||||
private Mobile m_Eater;
|
||||
|
||||
public Mobile Eater { get { return m_Eater; } }
|
||||
public int Eaten { get { return m_Eaten; } set { m_Eaten = value; } }
|
||||
|
||||
public CandyCaneTimer( Mobile eater )
|
||||
: base( TimeSpan.FromSeconds( 30 ), TimeSpan.FromSeconds( 30 ) )
|
||||
{
|
||||
m_Eater = eater;
|
||||
Priority = TimerPriority.FiveSeconds;
|
||||
Start();
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
Eaten--;
|
||||
|
||||
if ( Eater == null || Eater.Deleted || Eaten <= 0 )
|
||||
{
|
||||
Stop();
|
||||
ToothAches.Remove( Eater );
|
||||
}
|
||||
else if ( Eater.Map != Map.Internal && Eater.Alive )
|
||||
{
|
||||
if( Eaten > 60 )
|
||||
{
|
||||
Eater.Say( 1077388 + Utility.Random(5) ); // ARRGH! My tooth hurts sooo much!, etc.
|
||||
|
||||
if( Utility.RandomBool() )
|
||||
{
|
||||
Eater.Animate( 32, 5, 1, true, false, 0 );
|
||||
}
|
||||
}
|
||||
else if ( Eaten == 60 )
|
||||
{
|
||||
Eater.SendLocalizedMessage( 1077393 ); // The extreme pain in your teeth subsides.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CandyCane() : base( 0x2bdd )
|
||||
{
|
||||
ItemID = 0x2bdd + Utility.Random(4);
|
||||
Stackable = false;
|
||||
LootType=LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsChildOf( from.Backpack ) || from.InRange(this, 1) )
|
||||
{
|
||||
from.PlaySound( 0x3b + Utility.Random(3) );
|
||||
from.Animate( 34, 5, 1, true, false, 0 );
|
||||
|
||||
if ( !ToothAches.ContainsKey( from ) )
|
||||
{
|
||||
ToothAches.Add( from, new CandyCaneTimer( from ) );
|
||||
}
|
||||
|
||||
ToothAches[from].Eaten += 32;
|
||||
|
||||
from.SendLocalizedMessage( 1077387 ); // You feel as if you could eat as much as you wanted!
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public CandyCane( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class GingerBreadCookie : Food
|
||||
{
|
||||
private readonly int[] m_Messages =
|
||||
{
|
||||
0,
|
||||
1077396, // Noooo!
|
||||
1077397, // Please don't eat me... *whimper*
|
||||
1077405, // etc etc etc ..
|
||||
1077406,
|
||||
1077407,
|
||||
1077408,
|
||||
1077409
|
||||
};
|
||||
|
||||
[Constructable]
|
||||
public GingerBreadCookie() : base( 0x2be1 )
|
||||
{
|
||||
ItemID = Utility.RandomBool() ? 0x2be1 : 0x2be2;
|
||||
Stackable = false;
|
||||
LootType=LootType.Blessed;
|
||||
}
|
||||
|
||||
public GingerBreadCookie( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsChildOf( from.Backpack ) || from.InRange(this, 1) )
|
||||
{
|
||||
int result;
|
||||
if( ( result = m_Messages[Utility.Random( 0, m_Messages.Length )]) == 0 )
|
||||
{
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SendLocalizedMessageTo( from, result );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
93
Scripts/Items/Special/Holiday/PKHolidayStuff.cs
Normal file
93
Scripts/Items/Special/Holiday/PKHolidayStuff.cs
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Coal : Item
|
||||
{
|
||||
public override string DefaultName{ get { return "Coal"; }}
|
||||
|
||||
[Constructable]
|
||||
public Coal() : base( 0x19b9 )
|
||||
{
|
||||
Stackable = false;
|
||||
LootType=LootType.Blessed;
|
||||
Hue = 0x965;
|
||||
}
|
||||
|
||||
public Coal( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class BadCard : Item
|
||||
{
|
||||
public override int LabelNumber{ get { return 1041428; }} // Maybe next year youll get a better...
|
||||
|
||||
[Constructable]
|
||||
public BadCard() : base( 0x14ef )
|
||||
{
|
||||
int[] m_CardHues=new int[]{ 0x45, 0x27, 0x3d0 };
|
||||
Hue = m_CardHues[Utility.Random(m_CardHues.Length)];
|
||||
Stackable = false;
|
||||
LootType=LootType.Blessed;
|
||||
Movable=true;
|
||||
}
|
||||
|
||||
public BadCard( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class Spam : Food
|
||||
{
|
||||
[Constructable]
|
||||
public Spam() : base( 0x1044 )
|
||||
{
|
||||
Stackable = false;
|
||||
LootType=LootType.Blessed;
|
||||
}
|
||||
|
||||
public Spam( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Scripts/Items/Special/Holiday/Stockings.cs
Normal file
58
Scripts/Items/Special/Holiday/Stockings.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x2bd9, 0x2bda )]
|
||||
public class GreenStocking : BaseContainer
|
||||
{
|
||||
[Constructable]
|
||||
public GreenStocking() : base ( 0x2bd9 )
|
||||
{
|
||||
GumpID = 0x103;
|
||||
}
|
||||
|
||||
public GreenStocking( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x2bdb, 0x2bdc )]
|
||||
public class RedStocking : BaseContainer
|
||||
{
|
||||
[Constructable]
|
||||
public RedStocking() : base ( 0x2bdb )
|
||||
{
|
||||
GumpID = 0x103;
|
||||
}
|
||||
|
||||
public RedStocking( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue