Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,44 +1,44 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class DecorativeTopiary : Item
|
||||
{
|
||||
[Constructible]
|
||||
public DecorativeTopiary() : base( 0x2378 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public class DecorativeTopiary : Item
|
||||
{
|
||||
[Constructible]
|
||||
public DecorativeTopiary() : base(0x2378)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public DecorativeTopiary( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public DecorativeTopiary(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +1,44 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class FestiveCactus : Item
|
||||
{
|
||||
[Constructible]
|
||||
public FestiveCactus() : base( 0x2376 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public class FestiveCactus : Item
|
||||
{
|
||||
[Constructible]
|
||||
public FestiveCactus() : base(0x2376)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public FestiveCactus( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public FestiveCactus(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +1,98 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlippableAttribute( 0x236E, 0x2371 )]
|
||||
public class LightOfTheWinterSolstice : Item
|
||||
{
|
||||
private static string[] m_StaffNames = {
|
||||
"Aenima",
|
||||
"Alkiser",
|
||||
"ASayre",
|
||||
"David",
|
||||
"Krrios",
|
||||
"Mark",
|
||||
"Merlin",
|
||||
"Merlix", //LordMerlix
|
||||
"Phantom",
|
||||
"Phenos",
|
||||
"psz",
|
||||
"Ryan",
|
||||
"Quantos",
|
||||
"Outkast", //TheOutkastDev
|
||||
"V", //Admin_V
|
||||
"Zippy"
|
||||
};
|
||||
[Flippable(0x236E, 0x2371)]
|
||||
public class LightOfTheWinterSolstice : Item
|
||||
{
|
||||
private static string[] m_StaffNames =
|
||||
{
|
||||
"Aenima",
|
||||
"Alkiser",
|
||||
"ASayre",
|
||||
"David",
|
||||
"Krrios",
|
||||
"Mark",
|
||||
"Merlin",
|
||||
"Merlix", //LordMerlix
|
||||
"Phantom",
|
||||
"Phenos",
|
||||
"psz",
|
||||
"Ryan",
|
||||
"Quantos",
|
||||
"Outkast", //TheOutkastDev
|
||||
"V", //Admin_V
|
||||
"Zippy"
|
||||
};
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string Dipper { get; set; }
|
||||
[Constructible]
|
||||
public LightOfTheWinterSolstice() : this(m_StaffNames[Utility.Random(m_StaffNames.Length)])
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public LightOfTheWinterSolstice() : this( m_StaffNames[Utility.Random( m_StaffNames.Length )] )
|
||||
{
|
||||
}
|
||||
[Constructible]
|
||||
public LightOfTheWinterSolstice(string dipper) : base(0x236E)
|
||||
{
|
||||
Dipper = dipper;
|
||||
|
||||
[Constructible]
|
||||
public LightOfTheWinterSolstice( string dipper ) : base( 0x236E )
|
||||
{
|
||||
Dipper = dipper;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Hue = Utility.RandomDyedHue();
|
||||
}
|
||||
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
Light = LightType.Circle300;
|
||||
Hue = Utility.RandomDyedHue();
|
||||
}
|
||||
public LightOfTheWinterSolstice(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public LightOfTheWinterSolstice( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string Dipper{ get; set; }
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070881, Dipper ); // Hand Dipped by ~1_name~
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
LabelTo(from, 1070881, Dipper); // Hand Dipped by ~1_name~
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070881, Dipper ); // Hand Dipped by ~1_name~
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
list.Add(1070881, Dipper); // Hand Dipped by ~1_name~
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write( (string) Dipper );
|
||||
}
|
||||
writer.Write(Dipper);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Dipper = reader.ReadString();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Dipper = m_StaffNames[Utility.Random( m_StaffNames.Length )];
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Dipper = reader.ReadString();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Dipper = m_StaffNames[Utility.Random(m_StaffNames.Length)];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Dipper != null )
|
||||
Dipper = string.Intern( Dipper );
|
||||
}
|
||||
}
|
||||
if (Dipper != null)
|
||||
Dipper = string.Intern(Dipper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,325 +6,325 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class MistletoeAddon : Item, IDyable, IAddon
|
||||
{
|
||||
[Constructible]
|
||||
public MistletoeAddon() : this( Utility.RandomDyedHue() )
|
||||
{
|
||||
}
|
||||
public class MistletoeAddon : Item, IDyable, IAddon
|
||||
{
|
||||
[Constructible]
|
||||
public MistletoeAddon() : this(Utility.RandomDyedHue())
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public MistletoeAddon( int hue ) : base( 0x2375 )
|
||||
{
|
||||
Hue = hue;
|
||||
Movable = false;
|
||||
}
|
||||
[Constructible]
|
||||
public MistletoeAddon(int hue) : base(0x2375)
|
||||
{
|
||||
Hue = hue;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public MistletoeAddon( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public MistletoeAddon(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public bool CouldFit( IPoint3D p, Map map )
|
||||
{
|
||||
if ( !map.CanFit( p.X, p.Y, p.Z, ItemData.Height ) )
|
||||
return false;
|
||||
public bool CouldFit(IPoint3D p, Map map)
|
||||
{
|
||||
if (!map.CanFit(p.X, p.Y, p.Z, ItemData.Height))
|
||||
return false;
|
||||
|
||||
if ( ItemID == 0x2375 )
|
||||
return BaseAddon.IsWall( p.X, p.Y - 1, p.Z, map ); // North wall
|
||||
return BaseAddon.IsWall( p.X - 1, p.Y, p.Z, map ); // West wall
|
||||
}
|
||||
if (ItemID == 0x2375)
|
||||
return BaseAddon.IsWall(p.X, p.Y - 1, p.Z, map); // North wall
|
||||
return BaseAddon.IsWall(p.X - 1, p.Y, p.Z, map); // West wall
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public Item Deed => new MistletoeDeed(Hue);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
public virtual bool Dye(Mobile from, DyeTub sender)
|
||||
{
|
||||
if (Deleted)
|
||||
return false;
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 1))
|
||||
{
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, FixMovingCrate );
|
||||
}
|
||||
from.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
|
||||
private void FixMovingCrate()
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( Movable || IsLockedDown )
|
||||
{
|
||||
Item deed = Deed;
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
if ( Parent is Item item )
|
||||
{
|
||||
item.AddItem( deed );
|
||||
deed.Location = Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
deed.MoveToWorld( Location, Map );
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
public Item Deed => new MistletoeDeed( Hue );
|
||||
int version = reader.ReadInt();
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
Timer.DelayCall(TimeSpan.Zero, FixMovingCrate);
|
||||
}
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 3 ) )
|
||||
{
|
||||
from.CloseGump( typeof( MistletoeAddonGump ) );
|
||||
from.SendGump( new MistletoeAddonGump( from, this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
}
|
||||
}
|
||||
}
|
||||
private void FixMovingCrate()
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
public virtual bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
if (Movable || IsLockedDown)
|
||||
{
|
||||
Item deed = Deed;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( this );
|
||||
if (Parent is Item item)
|
||||
{
|
||||
item.AddItem(deed);
|
||||
deed.Location = Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
deed.MoveToWorld(Location, Map);
|
||||
}
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
if ( from.InRange( GetWorldLocation(), 1 ) )
|
||||
{
|
||||
Hue = sender.DyedHue;
|
||||
return true;
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
return false;
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
return false;
|
||||
}
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
if (from.InRange(GetWorldLocation(), 3))
|
||||
{
|
||||
from.CloseGump(typeof(MistletoeAddonGump));
|
||||
from.SendGump(new MistletoeAddonGump(from, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class MistletoeAddonGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private MistletoeAddon m_Addon;
|
||||
private class MistletoeAddonGump : Gump
|
||||
{
|
||||
private MistletoeAddon m_Addon;
|
||||
private Mobile m_From;
|
||||
|
||||
public MistletoeAddonGump( Mobile from, MistletoeAddon addon ) : base( 150, 50 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Addon = addon;
|
||||
public MistletoeAddonGump(Mobile from, MistletoeAddon addon) : base(150, 50)
|
||||
{
|
||||
m_From = from;
|
||||
m_Addon = addon;
|
||||
|
||||
AddPage( 0 );
|
||||
AddPage(0);
|
||||
|
||||
AddBackground( 0, 0, 220, 170, 0x13BE );
|
||||
AddBackground( 10, 10, 200, 150, 0xBB8 );
|
||||
AddHtmlLocalized( 20, 30, 180, 60, 1062839, false, false ); // Do you wish to re-deed this decoration?
|
||||
AddHtmlLocalized( 55, 100, 160, 25, 1011011, false, false ); // CONTINUE
|
||||
AddButton( 20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 55, 125, 160, 25, 1011012, false, false ); // CANCEL
|
||||
AddButton( 20, 125, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
AddBackground(0, 0, 220, 170, 0x13BE);
|
||||
AddBackground(10, 10, 200, 150, 0xBB8);
|
||||
AddHtmlLocalized(20, 30, 180, 60, 1062839, false, false); // Do you wish to re-deed this decoration?
|
||||
AddHtmlLocalized(55, 100, 160, 25, 1011011, false, false); // CONTINUE
|
||||
AddButton(20, 100, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(55, 125, 160, 25, 1011012, false, false); // CANCEL
|
||||
AddButton(20, 125, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Addon.Deleted )
|
||||
return;
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Addon.Deleted)
|
||||
return;
|
||||
|
||||
if ( info.ButtonID == 1 )
|
||||
{
|
||||
if ( m_From.InRange( m_Addon.GetWorldLocation(), 3 ) )
|
||||
{
|
||||
m_From.AddToBackpack( m_Addon.Deed );
|
||||
m_Addon.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage( 500295 ); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
if (m_From.InRange(m_Addon.GetWorldLocation(), 3))
|
||||
{
|
||||
m_From.AddToBackpack(m_Addon.Deed);
|
||||
m_Addon.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(500295); // You are too far away to do that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Flippable( 0x14F0, 0x14EF )]
|
||||
public class MistletoeDeed : Item
|
||||
{
|
||||
public override int LabelNumber => 1070882; // Mistletoe Deed
|
||||
[Flippable(0x14F0, 0x14EF)]
|
||||
public class MistletoeDeed : Item
|
||||
{
|
||||
[Constructible]
|
||||
public MistletoeDeed() : this(0)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public MistletoeDeed() : this( 0 )
|
||||
{
|
||||
}
|
||||
[Constructible]
|
||||
public MistletoeDeed(int hue) : base(0x14F0)
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public MistletoeDeed( int hue ) : base( 0x14F0 )
|
||||
{
|
||||
Hue = hue;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public MistletoeDeed(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public MistletoeDeed( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1070882; // Mistletoe Deed
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt( from );
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration?
|
||||
from.BeginTarget( -1, true, TargetFlags.None, Placement_OnTarget, null );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502092 ); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1062838); // Where would you like to place this decoration?
|
||||
from.BeginTarget(-1, true, TargetFlags.None, Placement_OnTarget, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void Placement_OnTarget( Mobile from, object targeted, object state )
|
||||
{
|
||||
if ( !(targeted is IPoint3D p) )
|
||||
return;
|
||||
public void Placement_OnTarget(Mobile from, object targeted, object state)
|
||||
{
|
||||
if (!(targeted is IPoint3D p))
|
||||
return;
|
||||
|
||||
Point3D loc = new Point3D( p );
|
||||
Point3D loc = new Point3D(p);
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 );
|
||||
BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16);
|
||||
|
||||
if ( house != null && house.IsCoOwner( from ) )
|
||||
{
|
||||
bool northWall = BaseAddon.IsWall( loc.X, loc.Y - 1, loc.Z, from.Map );
|
||||
bool westWall = BaseAddon.IsWall( loc.X - 1, loc.Y, loc.Z, from.Map );
|
||||
if (house != null && house.IsCoOwner(from))
|
||||
{
|
||||
bool northWall = BaseAddon.IsWall(loc.X, loc.Y - 1, loc.Z, from.Map);
|
||||
bool westWall = BaseAddon.IsWall(loc.X - 1, loc.Y, loc.Z, from.Map);
|
||||
|
||||
if ( northWall && westWall )
|
||||
from.SendGump( new MistletoeDeedGump( from, loc, this ) );
|
||||
else
|
||||
PlaceAddon( from, loc, northWall, westWall );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
}
|
||||
}
|
||||
if (northWall && westWall)
|
||||
from.SendGump(new MistletoeDeedGump(from, loc, this));
|
||||
else
|
||||
PlaceAddon(from, loc, northWall, westWall);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042036); // That location is not in your house.
|
||||
}
|
||||
}
|
||||
|
||||
private void PlaceAddon( Mobile from, Point3D loc, bool northWall, bool westWall )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall)
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
BaseHouse house = BaseHouse.FindHouseAt( loc, from.Map, 16 );
|
||||
BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16);
|
||||
|
||||
if ( house == null || !house.IsCoOwner( from ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042036 ); // That location is not in your house.
|
||||
return;
|
||||
}
|
||||
if (house == null || !house.IsCoOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1042036); // That location is not in your house.
|
||||
return;
|
||||
}
|
||||
|
||||
int itemID = 0;
|
||||
int itemID = 0;
|
||||
|
||||
if ( northWall )
|
||||
itemID = 0x2374;
|
||||
else if ( westWall )
|
||||
itemID = 0x2375;
|
||||
else
|
||||
from.SendLocalizedMessage( 1070883 ); // The mistletoe must be placed next to a wall.
|
||||
if (northWall)
|
||||
itemID = 0x2374;
|
||||
else if (westWall)
|
||||
itemID = 0x2375;
|
||||
else
|
||||
from.SendLocalizedMessage(1070883); // The mistletoe must be placed next to a wall.
|
||||
|
||||
if ( itemID > 0 )
|
||||
{
|
||||
Item addon = new MistletoeAddon( Hue );
|
||||
if (itemID > 0)
|
||||
{
|
||||
Item addon = new MistletoeAddon(Hue);
|
||||
|
||||
addon.ItemID = itemID;
|
||||
addon.MoveToWorld( loc, from.Map );
|
||||
addon.ItemID = itemID;
|
||||
addon.MoveToWorld(loc, from.Map);
|
||||
|
||||
house.Addons.Add( addon );
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
house.Addons.Add(addon);
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private class MistletoeDeedGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private Point3D m_Loc;
|
||||
private MistletoeDeed m_Deed;
|
||||
private class MistletoeDeedGump : Gump
|
||||
{
|
||||
private MistletoeDeed m_Deed;
|
||||
private Mobile m_From;
|
||||
private Point3D m_Loc;
|
||||
|
||||
public MistletoeDeedGump( Mobile from, Point3D loc, MistletoeDeed deed ) : base( 150, 50 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Loc = loc;
|
||||
m_Deed = deed;
|
||||
public MistletoeDeedGump(Mobile from, Point3D loc, MistletoeDeed deed) : base(150, 50)
|
||||
{
|
||||
m_From = from;
|
||||
m_Loc = loc;
|
||||
m_Deed = deed;
|
||||
|
||||
AddBackground( 0, 0, 300, 150, 0xA28 );
|
||||
AddBackground(0, 0, 300, 150, 0xA28);
|
||||
|
||||
AddPage( 0 );
|
||||
AddPage(0);
|
||||
|
||||
AddItem( 90, 30, 0x2375 );
|
||||
AddItem( 180, 30, 0x2374 );
|
||||
AddButton( 50, 35, 0x868, 0x869, 1, GumpButtonType.Reply, 0 );
|
||||
AddButton( 145, 35, 0x868, 0x869, 2, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
AddItem(90, 30, 0x2375);
|
||||
AddItem(180, 30, 0x2374);
|
||||
AddButton(50, 35, 0x868, 0x869, 1, GumpButtonType.Reply, 0);
|
||||
AddButton(145, 35, 0x868, 0x869, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( m_Deed.Deleted )
|
||||
return;
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
if (m_Deed.Deleted)
|
||||
return;
|
||||
|
||||
switch( info.ButtonID )
|
||||
{
|
||||
case 1:
|
||||
m_Deed.PlaceAddon( m_From, m_Loc, false, true );
|
||||
break;
|
||||
case 2:
|
||||
m_Deed.PlaceAddon( m_From, m_Loc, true, false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 1:
|
||||
m_Deed.PlaceAddon(m_From, m_Loc, false, true);
|
||||
break;
|
||||
case 2:
|
||||
m_Deed.PlaceAddon(m_From, m_Loc, true, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,148 +1,153 @@
|
|||
using System;
|
||||
using Server.Engines.ConPVP;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PileOfGlacialSnow : Item
|
||||
{
|
||||
[Constructible]
|
||||
public PileOfGlacialSnow() : base( 0x913 )
|
||||
{
|
||||
Hue = 0x480;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public class PileOfGlacialSnow : Item
|
||||
{
|
||||
[Constructible]
|
||||
public PileOfGlacialSnow() : base(0x913)
|
||||
{
|
||||
Hue = 0x480;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1070874; // a Pile of Glacial Snow
|
||||
public PileOfGlacialSnow(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public PileOfGlacialSnow( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1070874; // a Pile of Glacial Snow
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
writer.Write(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version == 0 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
if (version == 0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042010 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if ( from.Mounted )
|
||||
from.SendLocalizedMessage ( 1010097 ); // You cannot use this while mounted.
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042010); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (from.Mounted)
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted.
|
||||
}
|
||||
|
||||
else if ( from.CanBeginAction( typeof( SnowPile ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005575 ); // You carefully pack the snow into a ball...
|
||||
from.Target = new SnowTarget( from, this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else if (from.CanBeginAction(typeof(SnowPile)))
|
||||
{
|
||||
from.SendLocalizedMessage(1005575); // You carefully pack the snow into a ball...
|
||||
from.Target = new SnowTarget(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005574); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 5.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction( typeof( SnowPile ) );
|
||||
}
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction(typeof(SnowPile));
|
||||
}
|
||||
}
|
||||
|
||||
private class SnowTarget : Target
|
||||
{
|
||||
private Mobile m_Thrower;
|
||||
private Item m_Snow;
|
||||
private class SnowTarget : Target
|
||||
{
|
||||
private Item m_Snow;
|
||||
private Mobile m_Thrower;
|
||||
|
||||
public SnowTarget( Mobile thrower, Item snow ) : base ( 10, false, TargetFlags.None )
|
||||
{
|
||||
m_Thrower = thrower;
|
||||
m_Snow = snow;
|
||||
}
|
||||
public SnowTarget(Mobile thrower, Item snow) : base(10, false, TargetFlags.None)
|
||||
{
|
||||
m_Thrower = thrower;
|
||||
m_Snow = snow;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object target )
|
||||
{
|
||||
if ( target == from )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005576 ); // You can't throw this at yourself.
|
||||
}
|
||||
else if ( target is Mobile targ )
|
||||
{
|
||||
Container pack = targ.Backpack;
|
||||
protected override void OnTarget(Mobile from, object target)
|
||||
{
|
||||
if (target == from)
|
||||
{
|
||||
from.SendLocalizedMessage(1005576); // You can't throw this at yourself.
|
||||
}
|
||||
else if (target is Mobile targ)
|
||||
{
|
||||
Container pack = targ.Backpack;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) || targ.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
|
||||
{
|
||||
from.SendMessage( "You may not throw snow here." );
|
||||
}
|
||||
else if ( pack?.FindItemByType( new[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
|
||||
{
|
||||
if ( from.BeginAction( typeof( SnowPile ) ) )
|
||||
{
|
||||
new InternalTimer( from ).Start();
|
||||
if (from.Region.IsPartOf(typeof(SafeZone)) || targ.Region.IsPartOf(typeof(SafeZone)))
|
||||
{
|
||||
from.SendMessage("You may not throw snow here.");
|
||||
}
|
||||
else if (pack?.FindItemByType(new[] { typeof(SnowPile), typeof(PileOfGlacialSnow) }) != null)
|
||||
{
|
||||
if (from.BeginAction(typeof(SnowPile)))
|
||||
{
|
||||
new InternalTimer(from).Start();
|
||||
|
||||
from.PlaySound( 0x145 );
|
||||
from.PlaySound(0x145);
|
||||
|
||||
from.Animate( 9, 1, 1, true, false, 0 );
|
||||
from.Animate(9, 1, 1, true, false, 0);
|
||||
|
||||
targ.SendLocalizedMessage( 1010572 ); // You have just been hit by a snowball!
|
||||
from.SendLocalizedMessage( 1010573 ); // You throw the snowball and hit the target!
|
||||
targ.SendLocalizedMessage(1010572); // You have just been hit by a snowball!
|
||||
from.SendLocalizedMessage(1010573); // You throw the snowball and hit the target!
|
||||
|
||||
Effects.SendMovingEffect( from, targ, 0x36E4, 7, 0, false, true, 0x47F, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005577 ); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005577 ); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Effects.SendMovingEffect(from, targ, 0x36E4, 7, 0, false, true, 0x47F, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005574); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005577); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005577); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,134 +1,139 @@
|
|||
using System;
|
||||
using Server.Engines.ConPVP;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class SnowPile : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SnowPile() : base( 0x913 )
|
||||
{
|
||||
Hue = 0x481;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public class SnowPile : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SnowPile() : base(0x913)
|
||||
{
|
||||
Hue = 0x481;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1005578; // a pile of snow
|
||||
public SnowPile(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public SnowPile( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1005578; // a pile of snow
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
}
|
||||
writer.Write(1); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( version == 0 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
if (version == 0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042010 ); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if ( from.Mounted )
|
||||
from.SendLocalizedMessage ( 1010097 ); // You cannot use this while mounted.
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042010); // You must have the object in your backpack to use it.
|
||||
}
|
||||
else if (from.Mounted)
|
||||
{
|
||||
from.SendLocalizedMessage(1010097); // You cannot use this while mounted.
|
||||
}
|
||||
|
||||
else if ( from.CanBeginAction( typeof( SnowPile ) ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005575 ); // You carefully pack the snow into a ball...
|
||||
from.Target = new SnowTarget( from, this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else if (from.CanBeginAction(typeof(SnowPile)))
|
||||
{
|
||||
from.SendLocalizedMessage(1005575); // You carefully pack the snow into a ball...
|
||||
from.Target = new SnowTarget(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005574); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 5.0 ) )
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(5.0))
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction( typeof( SnowPile ) );
|
||||
}
|
||||
}
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.EndAction(typeof(SnowPile));
|
||||
}
|
||||
}
|
||||
|
||||
private class SnowTarget : Target
|
||||
{
|
||||
private Mobile m_Thrower;
|
||||
private Item m_Snow;
|
||||
private class SnowTarget : Target
|
||||
{
|
||||
private Item m_Snow;
|
||||
private Mobile m_Thrower;
|
||||
|
||||
public SnowTarget( Mobile thrower, Item snow ) : base ( 10, false, TargetFlags.None )
|
||||
{
|
||||
m_Thrower = thrower;
|
||||
m_Snow = snow;
|
||||
}
|
||||
public SnowTarget(Mobile thrower, Item snow) : base(10, false, TargetFlags.None)
|
||||
{
|
||||
m_Thrower = thrower;
|
||||
m_Snow = snow;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object target )
|
||||
{
|
||||
if ( target == from )
|
||||
{
|
||||
from.SendLocalizedMessage( 1005576 ); // You can't throw this at yourself.
|
||||
}
|
||||
else if ( target is Mobile targ )
|
||||
{
|
||||
Container pack = targ.Backpack;
|
||||
protected override void OnTarget(Mobile from, object target)
|
||||
{
|
||||
if (target == from)
|
||||
{
|
||||
from.SendLocalizedMessage(1005576); // You can't throw this at yourself.
|
||||
}
|
||||
else if (target is Mobile targ)
|
||||
{
|
||||
Container pack = targ.Backpack;
|
||||
|
||||
if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) || targ.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
|
||||
{
|
||||
from.SendMessage( "You may not throw snow here." );
|
||||
}
|
||||
else if ( pack?.FindItemByType( new[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
|
||||
{
|
||||
if ( from.BeginAction( typeof( SnowPile ) ) )
|
||||
{
|
||||
new InternalTimer( from ).Start();
|
||||
if (from.Region.IsPartOf(typeof(SafeZone)) || targ.Region.IsPartOf(typeof(SafeZone)))
|
||||
{
|
||||
from.SendMessage("You may not throw snow here.");
|
||||
}
|
||||
else if (pack?.FindItemByType(new[] { typeof(SnowPile), typeof(PileOfGlacialSnow) }) != null)
|
||||
{
|
||||
if (from.BeginAction(typeof(SnowPile)))
|
||||
{
|
||||
new InternalTimer(from).Start();
|
||||
|
||||
from.PlaySound( 0x145 );
|
||||
from.PlaySound(0x145);
|
||||
|
||||
from.Animate( 9, 1, 1, true, false, 0 );
|
||||
from.Animate(9, 1, 1, true, false, 0);
|
||||
|
||||
targ.SendLocalizedMessage( 1010572 ); // You have just been hit by a snowball!
|
||||
from.SendLocalizedMessage( 1010573 ); // You throw the snowball and hit the target!
|
||||
targ.SendLocalizedMessage(1010572); // You have just been hit by a snowball!
|
||||
from.SendLocalizedMessage(1010573); // You throw the snowball and hit the target!
|
||||
|
||||
Effects.SendMovingEffect( from, targ, 0x36E4, 7, 0, false, true, 0x480, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005577 ); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1005577 ); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Effects.SendMovingEffect(from, targ, 0x36E4, 7, 0, false, true, 0x480, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1005574); // The snow is not ready to be packed yet. Keep trying.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005577); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(
|
||||
1005577); // You can only throw a snowball at something that can throw one back.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,44 +1,44 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class SnowyTree : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SnowyTree() : base( 0x2377 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
public class SnowyTree : Item
|
||||
{
|
||||
[Constructible]
|
||||
public SnowyTree() : base(0x2377)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public SnowyTree( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public SnowyTree(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo( from, 1070880 ); // Winter 2004
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
LabelTo(from, 1070880); // Winter 2004
|
||||
}
|
||||
|
||||
list.Add( 1070880 ); // Winter 2004
|
||||
}
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
list.Add(1070880); // Winter 2004
|
||||
}
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,42 +3,42 @@ using Server.Items;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class WinterGiftGiver2004 : GiftGiver
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
GiftGiving.Register( new WinterGiftGiver2004() );
|
||||
}
|
||||
public class WinterGiftGiver2004 : GiftGiver
|
||||
{
|
||||
public override DateTime Start => new DateTime(2004, 12, 24);
|
||||
public override DateTime Finish => new DateTime(2005, 1, 1);
|
||||
|
||||
public override DateTime Start => new DateTime( 2004, 12, 24 );
|
||||
public override DateTime Finish => new DateTime( 2005, 1, 1 );
|
||||
public static void Initialize()
|
||||
{
|
||||
GiftGiving.Register(new WinterGiftGiver2004());
|
||||
}
|
||||
|
||||
public override void GiveGift( Mobile mob )
|
||||
{
|
||||
GiftBox box = new GiftBox();
|
||||
public override void GiveGift(Mobile mob)
|
||||
{
|
||||
GiftBox box = new GiftBox();
|
||||
|
||||
box.DropItem( new MistletoeDeed() );
|
||||
box.DropItem( new PileOfGlacialSnow() );
|
||||
box.DropItem( new LightOfTheWinterSolstice() );
|
||||
box.DropItem(new MistletoeDeed());
|
||||
box.DropItem(new PileOfGlacialSnow());
|
||||
box.DropItem(new LightOfTheWinterSolstice());
|
||||
|
||||
int random = Utility.Random( 100 );
|
||||
int random = Utility.Random(100);
|
||||
|
||||
if ( random < 60 )
|
||||
box.DropItem( new DecorativeTopiary() );
|
||||
else if ( random < 84 )
|
||||
box.DropItem( new FestiveCactus() );
|
||||
else
|
||||
box.DropItem( new SnowyTree() );
|
||||
if (random < 60)
|
||||
box.DropItem(new DecorativeTopiary());
|
||||
else if (random < 84)
|
||||
box.DropItem(new FestiveCactus());
|
||||
else
|
||||
box.DropItem(new SnowyTree());
|
||||
|
||||
switch ( GiveGift( mob, box ) )
|
||||
{
|
||||
case GiftResult.Backpack:
|
||||
mob.SendMessage( 0x482, "Happy Holidays from the team! Gift items have been placed in your backpack." );
|
||||
break;
|
||||
case GiftResult.BankBox:
|
||||
mob.SendMessage( 0x482, "Happy Holidays from the team! Gift items have been placed in your bank box." );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (GiveGift(mob, box))
|
||||
{
|
||||
case GiftResult.Backpack:
|
||||
mob.SendMessage(0x482, "Happy Holidays from the team! Gift items have been placed in your backpack.");
|
||||
break;
|
||||
case GiftResult.BankBox:
|
||||
mob.SendMessage(0x482, "Happy Holidays from the team! Gift items have been placed in your bank box.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue