Formatting FIxes (#58)
This commit is contained in:
parent
57fb9fb525
commit
096d39609e
1318 changed files with 11633 additions and 22129 deletions
|
|
@ -109,10 +109,7 @@ namespace Server.Engines.Events
|
|||
return loc;
|
||||
}
|
||||
|
||||
public static bool CheckMobile(Mobile mobile)
|
||||
{
|
||||
return mobile?.Map != null && !mobile.Deleted && mobile.Alive && mobile.Map != Map.Internal;
|
||||
}
|
||||
public static bool CheckMobile(Mobile mobile) => mobile?.Map != null && !mobile.Deleted && mobile.Alive && mobile.Map != Map.Internal;
|
||||
|
||||
private class TrickOrTreatTarget : Target
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,10 +3,7 @@
|
|||
public class TwilightLantern : Lantern
|
||||
{
|
||||
[Constructible]
|
||||
public TwilightLantern()
|
||||
{
|
||||
Hue = Utility.RandomBool() ? 244 : 997;
|
||||
}
|
||||
public TwilightLantern() => Hue = Utility.RandomBool() ? 244 : 997;
|
||||
|
||||
public TwilightLantern(Serial serial)
|
||||
: base(serial)
|
||||
|
|
@ -15,10 +12,7 @@
|
|||
|
||||
public override string DefaultName => "Twilight Lantern";
|
||||
|
||||
public override bool AllowEquippedCast(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool AllowEquippedCast(Mobile from) => true;
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@
|
|||
public class CreepyCake : Food
|
||||
{
|
||||
[Constructible]
|
||||
public CreepyCake() : base(0x9e9, 1)
|
||||
{
|
||||
Hue = 0x3E4;
|
||||
}
|
||||
public CreepyCake() : base(0x9e9, 1) => Hue = 0x3E4;
|
||||
|
||||
public CreepyCake(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@
|
|||
{
|
||||
[Constructible]
|
||||
public HarvestWine()
|
||||
: base(BeverageType.Wine)
|
||||
{
|
||||
: base(BeverageType.Wine) =>
|
||||
Hue = 0xe0;
|
||||
}
|
||||
|
||||
public HarvestWine(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@
|
|||
public class PumpkinPizza : CheesePizza
|
||||
{
|
||||
[Constructible]
|
||||
public PumpkinPizza()
|
||||
{
|
||||
Hue = 0xF3;
|
||||
}
|
||||
public PumpkinPizza() => Hue = 0xF3;
|
||||
|
||||
public PumpkinPizza(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ namespace Server.Items
|
|||
{
|
||||
[Constructible]
|
||||
public ColoredSmallWebs()
|
||||
: base(Utility.RandomBool() ? 0x10d6 : 0x10d7)
|
||||
{
|
||||
: base(Utility.RandomBool() ? 0x10d6 : 0x10d7) =>
|
||||
Hue = Utility.RandomBool() ? 0x455 : 0x4E9;
|
||||
}
|
||||
|
||||
public ColoredSmallWebs(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -35,13 +35,7 @@ namespace Server.Items.Holiday
|
|||
{
|
||||
}
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Staffer != null ? $"{MaskName} hand painted by {m_Staffer}" : MaskName;
|
||||
}
|
||||
}
|
||||
public override string DefaultName => m_Staffer != null ? $"{MaskName} hand painted by {m_Staffer}" : MaskName;
|
||||
|
||||
public virtual string MaskName => "A Mask";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,265 +6,265 @@ using Server.Events.Halloween;
|
|||
|
||||
namespace Server.Engines.Events
|
||||
{
|
||||
public class HalloweenHauntings
|
||||
{
|
||||
public static Dictionary<PlayerMobile, ZombieSkeleton> ReAnimated { get; set; }
|
||||
public class HalloweenHauntings
|
||||
{
|
||||
public static Dictionary<PlayerMobile, ZombieSkeleton> ReAnimated { get; set; }
|
||||
|
||||
private static Timer m_Timer;
|
||||
private static Timer m_ClearTimer;
|
||||
private static Timer m_Timer;
|
||||
private static Timer m_ClearTimer;
|
||||
|
||||
private static int m_TotalZombieLimit;
|
||||
private static int m_DeathQueueLimit;
|
||||
private static int m_QueueDelaySeconds;
|
||||
private static int m_QueueClearIntervalSeconds;
|
||||
private static int m_TotalZombieLimit;
|
||||
private static int m_DeathQueueLimit;
|
||||
private static int m_QueueDelaySeconds;
|
||||
private static int m_QueueClearIntervalSeconds;
|
||||
|
||||
private static List<PlayerMobile> m_DeathQueue;
|
||||
private static List<PlayerMobile> m_DeathQueue;
|
||||
|
||||
private static Rectangle2D[] m_Cemetaries = {
|
||||
new Rectangle2D(1272,3712,30,20), // Jhelom
|
||||
new Rectangle2D(1337,1444,48,52), // Britain
|
||||
new Rectangle2D(2424,1098,20,28), // Trinsic
|
||||
new Rectangle2D(2728,840,54,54), // Vesper
|
||||
new Rectangle2D(4528,1314,20,28), // Moonglow
|
||||
new Rectangle2D(712,1104,30,22), // Yew
|
||||
new Rectangle2D(5824,1464,22,6), // Fire Dungeon
|
||||
new Rectangle2D(5224,3655,14,5), // T2A
|
||||
private static Rectangle2D[] m_Cemetaries = {
|
||||
new Rectangle2D(1272,3712,30,20), // Jhelom
|
||||
new Rectangle2D(1337,1444,48,52), // Britain
|
||||
new Rectangle2D(2424,1098,20,28), // Trinsic
|
||||
new Rectangle2D(2728,840,54,54), // Vesper
|
||||
new Rectangle2D(4528,1314,20,28), // Moonglow
|
||||
new Rectangle2D(712,1104,30,22), // Yew
|
||||
new Rectangle2D(5824,1464,22,6), // Fire Dungeon
|
||||
new Rectangle2D(5224,3655,14,5), // T2A
|
||||
|
||||
new Rectangle2D(1272,3712,20,30), // Jhelom
|
||||
new Rectangle2D(1337,1444,52,48), // Britain
|
||||
new Rectangle2D(2424,1098,28,20), // Trinsic
|
||||
new Rectangle2D(2728,840,54,54), // Vesper
|
||||
new Rectangle2D(4528,1314,28,20), // Moonglow
|
||||
new Rectangle2D(712,1104,22,30), // Yew
|
||||
new Rectangle2D(5824,1464,6,22), // Fire Dungeon
|
||||
new Rectangle2D(5224,3655,5,14) // T2A
|
||||
};
|
||||
new Rectangle2D(1272,3712,20,30), // Jhelom
|
||||
new Rectangle2D(1337,1444,52,48), // Britain
|
||||
new Rectangle2D(2424,1098,28,20), // Trinsic
|
||||
new Rectangle2D(2728,840,54,54), // Vesper
|
||||
new Rectangle2D(4528,1314,28,20), // Moonglow
|
||||
new Rectangle2D(712,1104,22,30), // Yew
|
||||
new Rectangle2D(5824,1464,6,22), // Fire Dungeon
|
||||
new Rectangle2D(5224,3655,5,14) // T2A
|
||||
};
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
m_TotalZombieLimit = 200;
|
||||
m_DeathQueueLimit = 200;
|
||||
m_QueueDelaySeconds = 120;
|
||||
m_QueueClearIntervalSeconds = 1800;
|
||||
public static void Initialize()
|
||||
{
|
||||
m_TotalZombieLimit = 200;
|
||||
m_DeathQueueLimit = 200;
|
||||
m_QueueDelaySeconds = 120;
|
||||
m_QueueClearIntervalSeconds = 1800;
|
||||
|
||||
DateTime today = DateTime.UtcNow;
|
||||
TimeSpan tick = TimeSpan.FromSeconds( m_QueueDelaySeconds );
|
||||
TimeSpan clear = TimeSpan.FromSeconds( m_QueueClearIntervalSeconds );
|
||||
DateTime today = DateTime.UtcNow;
|
||||
TimeSpan tick = TimeSpan.FromSeconds( m_QueueDelaySeconds );
|
||||
TimeSpan clear = TimeSpan.FromSeconds( m_QueueClearIntervalSeconds );
|
||||
|
||||
ReAnimated = new Dictionary<PlayerMobile, ZombieSkeleton>();
|
||||
m_DeathQueue = new List<PlayerMobile>();
|
||||
ReAnimated = new Dictionary<PlayerMobile, ZombieSkeleton>();
|
||||
m_DeathQueue = new List<PlayerMobile>();
|
||||
|
||||
if ( today >= HolidaySettings.StartHalloween && today <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
m_Timer = Timer.DelayCall( tick, tick, Timer_Callback );
|
||||
if ( today >= HolidaySettings.StartHalloween && today <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
m_Timer = Timer.DelayCall( tick, tick, Timer_Callback );
|
||||
|
||||
m_ClearTimer = Timer.DelayCall( clear, clear, Clear_Callback );
|
||||
m_ClearTimer = Timer.DelayCall( clear, clear, Clear_Callback );
|
||||
|
||||
EventSink.PlayerDeath += EventSink_PlayerDeath;
|
||||
}
|
||||
}
|
||||
EventSink.PlayerDeath += EventSink_PlayerDeath;
|
||||
}
|
||||
}
|
||||
|
||||
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
|
||||
{
|
||||
if ( e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit )
|
||||
m_DeathQueue.Add( player );
|
||||
}
|
||||
public static void EventSink_PlayerDeath( PlayerDeathEventArgs e )
|
||||
{
|
||||
if ( e.Mobile is PlayerMobile player && !player.Deleted && m_Timer.Running && !m_DeathQueue.Contains( player ) && m_DeathQueue.Count < m_DeathQueueLimit )
|
||||
m_DeathQueue.Add( player );
|
||||
}
|
||||
|
||||
private static void Clear_Callback()
|
||||
{
|
||||
ReAnimated.Clear();
|
||||
private static void Clear_Callback()
|
||||
{
|
||||
ReAnimated.Clear();
|
||||
|
||||
m_DeathQueue.Clear();
|
||||
m_DeathQueue.Clear();
|
||||
|
||||
if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
m_ClearTimer.Stop();
|
||||
}
|
||||
}
|
||||
if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
m_ClearTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static void Timer_Callback()
|
||||
{
|
||||
PlayerMobile player = null;
|
||||
private static void Timer_Callback()
|
||||
{
|
||||
PlayerMobile player = null;
|
||||
|
||||
if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
for( int index = 0; m_DeathQueue.Count > 0 && index < m_DeathQueue.Count; index++ )
|
||||
{
|
||||
if ( !ReAnimated.ContainsKey( m_DeathQueue[ index ] ) )
|
||||
{
|
||||
player = m_DeathQueue[ index ];
|
||||
if ( DateTime.UtcNow <= HolidaySettings.FinishHalloween )
|
||||
{
|
||||
for( int index = 0; m_DeathQueue.Count > 0 && index < m_DeathQueue.Count; index++ )
|
||||
{
|
||||
if ( !ReAnimated.ContainsKey( m_DeathQueue[ index ] ) )
|
||||
{
|
||||
player = m_DeathQueue[ index ];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (player?.Deleted == false && ReAnimated.Count < m_TotalZombieLimit )
|
||||
{
|
||||
Map map = Utility.RandomBool() ? Map.Trammel : Map.Felucca;
|
||||
if (player?.Deleted == false && ReAnimated.Count < m_TotalZombieLimit )
|
||||
{
|
||||
Map map = Utility.RandomBool() ? Map.Trammel : Map.Felucca;
|
||||
|
||||
Point3D home = ( GetRandomPointInRect( m_Cemetaries[ Utility.Random( m_Cemetaries.Length ) ], map ));
|
||||
Point3D home = ( GetRandomPointInRect( m_Cemetaries[ Utility.Random( m_Cemetaries.Length ) ], map ));
|
||||
|
||||
if ( map.CanSpawnMobile( home ) )
|
||||
{
|
||||
ZombieSkeleton zombieskel = new ZombieSkeleton( player );
|
||||
if ( map.CanSpawnMobile( home ) )
|
||||
{
|
||||
ZombieSkeleton zombieskel = new ZombieSkeleton( player );
|
||||
|
||||
ReAnimated.Add( player, zombieskel );
|
||||
zombieskel.Home = home;
|
||||
zombieskel.RangeHome = 10;
|
||||
ReAnimated.Add( player, zombieskel );
|
||||
zombieskel.Home = home;
|
||||
zombieskel.RangeHome = 10;
|
||||
|
||||
zombieskel.MoveToWorld( home, map );
|
||||
zombieskel.MoveToWorld( home, map );
|
||||
|
||||
m_DeathQueue.Remove( player );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Timer.Stop();
|
||||
}
|
||||
}
|
||||
m_DeathQueue.Remove( player );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Timer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static Point3D GetRandomPointInRect( Rectangle2D rect, Map map )
|
||||
{
|
||||
int x = Utility.Random( rect.X, rect.Width );
|
||||
int y = Utility.Random( rect.Y, rect.Height );
|
||||
private static Point3D GetRandomPointInRect( Rectangle2D rect, Map map )
|
||||
{
|
||||
int x = Utility.Random( rect.X, rect.Width );
|
||||
int y = Utility.Random( rect.Y, rect.Height );
|
||||
|
||||
return new Point3D( x, y, map.GetAverageZ( x, y ) );
|
||||
}
|
||||
}
|
||||
return new Point3D( x, y, map.GetAverageZ( x, y ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerBones : BaseContainer
|
||||
{
|
||||
[Constructible]
|
||||
public PlayerBones( string name )
|
||||
: base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) )
|
||||
{
|
||||
Name = $"{name}'s bones";
|
||||
public class PlayerBones : BaseContainer
|
||||
{
|
||||
[Constructible]
|
||||
public PlayerBones( string name )
|
||||
: base( Utility.RandomMinMax( 0x0ECA, 0x0ED2 ) )
|
||||
{
|
||||
Name = $"{name}'s bones";
|
||||
|
||||
switch( Utility.Random( 10 ) )
|
||||
{
|
||||
case 0: Hue = 0xa09; break;
|
||||
case 1: Hue = 0xa93; break;
|
||||
case 2: Hue = 0xa47; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
switch( Utility.Random( 10 ) )
|
||||
{
|
||||
case 0: Hue = 0xa09; break;
|
||||
case 1: Hue = 0xa93; break;
|
||||
case 2: Hue = 0xa47; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerBones( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public PlayerBones( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 );
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ZombieSkeleton : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a rotting corpse";
|
||||
private static readonly string m_Name = "Zombie Skeleton";
|
||||
public class ZombieSkeleton : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a rotting corpse";
|
||||
private static readonly string m_Name = "Zombie Skeleton";
|
||||
|
||||
private PlayerMobile m_DeadPlayer;
|
||||
private PlayerMobile m_DeadPlayer;
|
||||
|
||||
public ZombieSkeleton(PlayerMobile player = null)
|
||||
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
m_DeadPlayer = player;
|
||||
public ZombieSkeleton(PlayerMobile player = null)
|
||||
: base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
m_DeadPlayer = player;
|
||||
|
||||
Name = player != null ? $"{player.Name}'s {m_Name}" : m_Name;
|
||||
Name = player != null ? $"{player.Name}'s {m_Name}" : m_Name;
|
||||
|
||||
Body = 0x93;
|
||||
BaseSoundID = 0x1c3;
|
||||
Body = 0x93;
|
||||
BaseSoundID = 0x1c3;
|
||||
|
||||
SetStr( 500 );
|
||||
SetDex( 500 );
|
||||
SetInt( 500 );
|
||||
SetStr( 500 );
|
||||
SetDex( 500 );
|
||||
SetInt( 500 );
|
||||
|
||||
SetHits( 2500 );
|
||||
SetMana( 500 );
|
||||
SetStam( 500 );
|
||||
SetHits( 2500 );
|
||||
SetMana( 500 );
|
||||
SetStam( 500 );
|
||||
|
||||
SetDamage( 8, 18 );
|
||||
SetDamage( 8, 18 );
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 40 );
|
||||
SetDamageType( ResistanceType.Cold, 60 );
|
||||
SetDamageType( ResistanceType.Physical, 40 );
|
||||
SetDamageType( ResistanceType.Cold, 60 );
|
||||
|
||||
SetResistance( ResistanceType.Fire, 50 );
|
||||
SetResistance( ResistanceType.Energy, 50 );
|
||||
SetResistance( ResistanceType.Physical, 50 );
|
||||
SetResistance( ResistanceType.Cold, 50 );
|
||||
SetResistance( ResistanceType.Poison, 50 );
|
||||
SetResistance( ResistanceType.Fire, 50 );
|
||||
SetResistance( ResistanceType.Energy, 50 );
|
||||
SetResistance( ResistanceType.Physical, 50 );
|
||||
SetResistance( ResistanceType.Cold, 50 );
|
||||
SetResistance( ResistanceType.Poison, 50 );
|
||||
|
||||
SetSkill( SkillName.MagicResist, 65.1, 80.0 );
|
||||
SetSkill( SkillName.Tactics, 95.1, 100 );
|
||||
SetSkill( SkillName.Wrestling, 85.1, 95 );
|
||||
SetSkill( SkillName.MagicResist, 65.1, 80.0 );
|
||||
SetSkill( SkillName.Tactics, 95.1, 100 );
|
||||
SetSkill( SkillName.Wrestling, 85.1, 95 );
|
||||
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
Fame = 1000;
|
||||
Karma = -1000;
|
||||
|
||||
VirtualArmor = 18;
|
||||
}
|
||||
VirtualArmor = 18;
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
switch( Utility.Random( 10 ) )
|
||||
{
|
||||
case 0: PackItem( new LeftArm() ); break;
|
||||
case 1: PackItem( new RightArm() ); break;
|
||||
case 2: PackItem( new Torso() ); break;
|
||||
case 3: PackItem( new Bone() ); break;
|
||||
case 4: PackItem( new RibCage() ); break;
|
||||
case 5: if (m_DeadPlayer?.Deleted == false) { PackItem( new PlayerBones( m_DeadPlayer.Name ) ); } break;
|
||||
default: break;
|
||||
}
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
switch( Utility.Random( 10 ) )
|
||||
{
|
||||
case 0: PackItem( new LeftArm() ); break;
|
||||
case 1: PackItem( new RightArm() ); break;
|
||||
case 2: PackItem( new Torso() ); break;
|
||||
case 3: PackItem( new Bone() ); break;
|
||||
case 4: PackItem( new RibCage() ); break;
|
||||
case 5: if (m_DeadPlayer?.Deleted == false) { PackItem( new PlayerBones( m_DeadPlayer.Name ) ); } break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
AddLoot( LootPack.Meager );
|
||||
}
|
||||
AddLoot( LootPack.Meager );
|
||||
}
|
||||
|
||||
public override bool BleedImmune => true;
|
||||
public override bool BleedImmune => true;
|
||||
|
||||
public override Poison PoisonImmune => Poison.Regular;
|
||||
public override Poison PoisonImmune => Poison.Regular;
|
||||
|
||||
public ZombieSkeleton( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public ZombieSkeleton( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
if ( HalloweenHauntings.ReAnimated != null )
|
||||
{
|
||||
if (m_DeadPlayer?.Deleted == false)
|
||||
{
|
||||
if ( HalloweenHauntings.ReAnimated.ContainsKey( m_DeadPlayer ) )
|
||||
HalloweenHauntings.ReAnimated.Remove( m_DeadPlayer );
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnDelete()
|
||||
{
|
||||
if ( HalloweenHauntings.ReAnimated != null )
|
||||
{
|
||||
if (m_DeadPlayer?.Deleted == false)
|
||||
{
|
||||
if ( HalloweenHauntings.ReAnimated.ContainsKey( m_DeadPlayer ) )
|
||||
HalloweenHauntings.ReAnimated.Remove( m_DeadPlayer );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 );
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
writer.Write( 0 );
|
||||
|
||||
writer.WriteMobile( m_DeadPlayer );
|
||||
}
|
||||
writer.WriteMobile( m_DeadPlayer );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
int version = reader.ReadInt();
|
||||
|
||||
m_DeadPlayer = reader.ReadMobile<PlayerMobile>();
|
||||
}
|
||||
}
|
||||
m_DeadPlayer = reader.ReadMobile<PlayerMobile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
public class JellyBeans : CandyCane
|
||||
{
|
||||
public JellyBeans(int amount = 1)
|
||||
: base(0x468C)
|
||||
{
|
||||
: base(0x468C) =>
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public JellyBeans(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@
|
|||
{
|
||||
[Constructible]
|
||||
public Lollipops(int amount = 1)
|
||||
: base(0x468D + Utility.Random(3))
|
||||
{
|
||||
: base(0x468D + Utility.Random(3)) =>
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public Lollipops(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
{
|
||||
[Constructible]
|
||||
public NougatSwirl(int amount = 1)
|
||||
: base(0x4690)
|
||||
{
|
||||
: base(0x4690) =>
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public NougatSwirl(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
public class Taffy : CandyCane
|
||||
{
|
||||
public Taffy(int amount = 1)
|
||||
: base(0x469D)
|
||||
{
|
||||
: base(0x469D) =>
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public Taffy(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
public class WrappedCandy : CandyCane
|
||||
{
|
||||
public WrappedCandy(int amount = 1)
|
||||
: base(0x469e)
|
||||
{
|
||||
: base(0x469e) =>
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public WrappedCandy(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -4,10 +4,7 @@ namespace Server.Items
|
|||
public class AnimatedHeartShapedBox : HeartShapedBox
|
||||
{
|
||||
[Constructible]
|
||||
public AnimatedHeartShapedBox()
|
||||
{
|
||||
ItemID = 0x49CC;
|
||||
}
|
||||
public AnimatedHeartShapedBox() => ItemID = 0x49CC;
|
||||
|
||||
public AnimatedHeartShapedBox(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ namespace Server.Items
|
|||
{
|
||||
[Constructible]
|
||||
public CupidStatue()
|
||||
: base(0x4F7D)
|
||||
{
|
||||
: base(0x4F7D) =>
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public CupidStatue(Serial serial)
|
||||
: base(serial)
|
||||
|
|
|
|||
|
|
@ -3,127 +3,125 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class CupidsArrow : Item
|
||||
{
|
||||
// TODO: Check messages
|
||||
public class CupidsArrow : Item
|
||||
{
|
||||
// TODO: Check messages
|
||||
|
||||
public override int LabelNumber => 1152270; // Cupid's Arrow 2012
|
||||
public override int LabelNumber => 1152270; // Cupid's Arrow 2012
|
||||
|
||||
private string m_From;
|
||||
private string m_To;
|
||||
private string m_From;
|
||||
private string m_To;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string From
|
||||
{
|
||||
get => m_From;
|
||||
set { m_From = value; InvalidateProperties(); }
|
||||
}
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string From
|
||||
{
|
||||
get => m_From;
|
||||
set { m_From = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string To
|
||||
{
|
||||
get => m_To;
|
||||
set { m_To = value; InvalidateProperties(); }
|
||||
}
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string To
|
||||
{
|
||||
get => m_To;
|
||||
set { m_To = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
public bool IsSigned => ( m_From != null && m_To != null );
|
||||
public bool IsSigned => ( m_From != null && m_To != null );
|
||||
|
||||
[Constructible]
|
||||
public CupidsArrow()
|
||||
: base( 0x4F7F )
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
[Constructible]
|
||||
public CupidsArrow()
|
||||
: base( 0x4F7F ) =>
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperty( list );
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
base.AddNameProperty( list );
|
||||
|
||||
if ( IsSigned )
|
||||
list.Add( 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
if ( IsSigned )
|
||||
list.Add( 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
|
||||
public static bool CheckSeason( Mobile from )
|
||||
{
|
||||
if ( DateTime.UtcNow.Month == 2 )
|
||||
return true;
|
||||
public static bool CheckSeason( Mobile from )
|
||||
{
|
||||
if ( DateTime.UtcNow.Month == 2 )
|
||||
return true;
|
||||
|
||||
from.SendLocalizedMessage( 1152318 ); // You may not use this item out of season.
|
||||
return false;
|
||||
}
|
||||
from.SendLocalizedMessage( 1152318 ); // You may not use this item out of season.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
|
||||
if ( IsSigned )
|
||||
LabelTo( from, 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
if ( IsSigned )
|
||||
LabelTo( from, 1152273, $"{m_From}\t{m_To}"); // ~1_val~ is madly in love with ~2_val~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsSigned || !CheckSeason( from ) )
|
||||
return;
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsSigned || !CheckSeason( from ) )
|
||||
return;
|
||||
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1080063 ); // This must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1080063 ); // This must be in your backpack to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
from.BeginTarget( 10, false, TargetFlags.None, OnTarget );
|
||||
from.SendMessage( "Who do you wish to use this on?" );
|
||||
}
|
||||
from.BeginTarget( 10, false, TargetFlags.None, OnTarget );
|
||||
from.SendMessage( "Who do you wish to use this on?" );
|
||||
}
|
||||
|
||||
private void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( IsSigned || !IsChildOf( from.Backpack ) )
|
||||
return;
|
||||
private void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( IsSigned || !IsChildOf( from.Backpack ) )
|
||||
return;
|
||||
|
||||
if ( targeted is Mobile m )
|
||||
{
|
||||
if ( !m.Alive )
|
||||
{
|
||||
from.SendLocalizedMessage( 1152269 ); // That target is dead and even Cupid's arrow won't make them love you.
|
||||
return;
|
||||
}
|
||||
if ( targeted is Mobile m )
|
||||
{
|
||||
if ( !m.Alive )
|
||||
{
|
||||
from.SendLocalizedMessage( 1152269 ); // That target is dead and even Cupid's arrow won't make them love you.
|
||||
return;
|
||||
}
|
||||
|
||||
m_From = from.Name;
|
||||
m_To = m.Name;
|
||||
m_From = from.Name;
|
||||
m_To = m.Name;
|
||||
|
||||
InvalidateProperties();
|
||||
InvalidateProperties();
|
||||
|
||||
from.SendMessage( "You inscribe the arrow." );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "That is not a person." );
|
||||
}
|
||||
}
|
||||
from.SendMessage( "You inscribe the arrow." );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "That is not a person." );
|
||||
}
|
||||
}
|
||||
|
||||
public CupidsArrow( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
public CupidsArrow( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( 0 );
|
||||
writer.Write( 0 );
|
||||
|
||||
writer.Write( m_From );
|
||||
writer.Write( m_To );
|
||||
}
|
||||
writer.Write( m_From );
|
||||
writer.Write( m_To );
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
m_From = Utility.Intern( reader.ReadString() );
|
||||
m_To = Utility.Intern( reader.ReadString() );
|
||||
}
|
||||
}
|
||||
m_From = Utility.Intern( reader.ReadString() );
|
||||
m_To = Utility.Intern( reader.ReadString() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue