Formatting FIxes (#58)
This commit is contained in:
parent
57fb9fb525
commit
096d39609e
1318 changed files with 11633 additions and 22129 deletions
|
|
@ -6,10 +6,7 @@ namespace Server.Engines.BulkOrders
|
|||
{
|
||||
private BaseBOD m_Deed;
|
||||
|
||||
public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None)
|
||||
{
|
||||
m_Deed = deed;
|
||||
}
|
||||
public BODTarget(BaseBOD deed) : base(18, false, TargetFlags.None) => m_Deed = deed;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,61 +8,61 @@ using Server.Items;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class BulkOrderBook : Item, ISecurable
|
||||
{
|
||||
private string m_BookName;
|
||||
public class BulkOrderBook : Item, ISecurable
|
||||
{
|
||||
private string m_BookName;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string BookName
|
||||
{
|
||||
get => m_BookName;
|
||||
set{ m_BookName = value; InvalidateProperties(); }
|
||||
}
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public string BookName
|
||||
{
|
||||
get => m_BookName;
|
||||
set{ m_BookName = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level { get; set; }
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
public List<IBOBEntry> Entries { get; private set; }
|
||||
public List<IBOBEntry> Entries { get; private set; }
|
||||
|
||||
public BOBFilter Filter { get; private set; }
|
||||
public BOBFilter Filter { get; private set; }
|
||||
|
||||
public int ItemCount { get; set; }
|
||||
public int ItemCount { get; set; }
|
||||
|
||||
[Constructible]
|
||||
public BulkOrderBook() : base( 0x2259 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
[Constructible]
|
||||
public BulkOrderBook() : base( 0x2259 )
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Entries = new List<IBOBEntry>();
|
||||
Filter = new BOBFilter();
|
||||
Entries = new List<IBOBEntry>();
|
||||
Filter = new BOBFilter();
|
||||
|
||||
Level = SecureLevel.CoOwners;
|
||||
}
|
||||
Level = SecureLevel.CoOwners;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( Entries.Count == 0 )
|
||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
||||
else if ( from is PlayerMobile mobile )
|
||||
mobile.SendGump( new BOBGump( mobile, this ) );
|
||||
}
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
from.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( Entries.Count == 0 )
|
||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
||||
else if ( from is PlayerMobile mobile )
|
||||
mobile.SendGump( new BOBGump( mobile, this ) );
|
||||
}
|
||||
|
||||
public override void OnDoubleClickSecureTrade( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( Entries.Count == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
|
||||
public override void OnDoubleClickSecureTrade( Mobile from )
|
||||
{
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500446 ); // That is too far away.
|
||||
}
|
||||
else if ( Entries.Count == 0 )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062381 ); // The book is empty.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new BOBGump( (PlayerMobile)from, this ) );
|
||||
|
||||
SecureTrade trade = GetSecureTradeCont()?.Trade;
|
||||
|
||||
|
|
@ -70,239 +70,236 @@ namespace Server.Engines.BulkOrders
|
|||
trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.To.Mobile, this ) );
|
||||
else if (trade?.To.Mobile == from )
|
||||
trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.From.Mobile, this ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if ( dropped is BaseBOD )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
|
||||
return false;
|
||||
}
|
||||
if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
|
||||
return false;
|
||||
if ( Entries.Count < 500 )
|
||||
{
|
||||
if ( dropped is LargeBOD bod )
|
||||
Entries.Add( new BOBLargeEntry( bod ) );
|
||||
else
|
||||
Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
|
||||
public override bool OnDragDrop( Mobile from, Item dropped )
|
||||
{
|
||||
if ( dropped is BaseBOD )
|
||||
{
|
||||
if ( !IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
|
||||
return false;
|
||||
}
|
||||
if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
|
||||
return false;
|
||||
if ( Entries.Count < 500 )
|
||||
{
|
||||
if ( dropped is LargeBOD bod )
|
||||
Entries.Add( new BOBLargeEntry( bod ) );
|
||||
else
|
||||
Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
|
||||
|
||||
InvalidateProperties();
|
||||
InvalidateProperties();
|
||||
|
||||
if ( Entries.Count / 5 > ItemCount )
|
||||
{
|
||||
ItemCount++;
|
||||
InvalidateItems();
|
||||
}
|
||||
if ( Entries.Count / 5 > ItemCount )
|
||||
{
|
||||
ItemCount++;
|
||||
InvalidateItems();
|
||||
}
|
||||
|
||||
from.SendSound(0x42, GetWorldLocation());
|
||||
from.SendLocalizedMessage( 1062386 ); // Deed added to book.
|
||||
from.SendSound(0x42, GetWorldLocation());
|
||||
from.SendLocalizedMessage( 1062386 ); // Deed added to book.
|
||||
|
||||
if ( from is PlayerMobile pm )
|
||||
pm.SendGump( new BOBGump( pm, this ) );
|
||||
if ( from is PlayerMobile pm )
|
||||
pm.SendGump( new BOBGump( pm, this ) );
|
||||
|
||||
dropped.Delete();
|
||||
dropped.Delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
|
||||
return false;
|
||||
}
|
||||
from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
|
||||
return false;
|
||||
}
|
||||
|
||||
from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
|
||||
return false;
|
||||
}
|
||||
from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetTotal( TotalType type )
|
||||
{
|
||||
int total = base.GetTotal( type );
|
||||
public override int GetTotal( TotalType type )
|
||||
{
|
||||
int total = base.GetTotal( type );
|
||||
|
||||
if ( type == TotalType.Items )
|
||||
total = ItemCount;
|
||||
if ( type == TotalType.Items )
|
||||
total = ItemCount;
|
||||
|
||||
return total;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
public void InvalidateItems()
|
||||
{
|
||||
if ( RootParent is Mobile m )
|
||||
{
|
||||
m.UpdateTotals();
|
||||
InvalidateContainers( Parent );
|
||||
}
|
||||
}
|
||||
public void InvalidateItems()
|
||||
{
|
||||
if ( RootParent is Mobile m )
|
||||
{
|
||||
m.UpdateTotals();
|
||||
InvalidateContainers( Parent );
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateContainers(IEntity parent)
|
||||
{
|
||||
if ( parent is Container c )
|
||||
{
|
||||
c.InvalidateProperties();
|
||||
InvalidateContainers( c.Parent );
|
||||
}
|
||||
}
|
||||
public void InvalidateContainers(IEntity parent)
|
||||
{
|
||||
if ( parent is Container c )
|
||||
{
|
||||
c.InvalidateProperties();
|
||||
InvalidateContainers( c.Parent );
|
||||
}
|
||||
}
|
||||
|
||||
public BulkOrderBook( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public BulkOrderBook( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( 2 ); // version
|
||||
writer.Write( 2 ); // version
|
||||
|
||||
writer.Write( ItemCount );
|
||||
writer.Write( ItemCount );
|
||||
|
||||
writer.Write( (int) Level );
|
||||
writer.Write( (int) Level );
|
||||
|
||||
writer.Write( m_BookName );
|
||||
writer.Write( m_BookName );
|
||||
|
||||
Filter.Serialize( writer );
|
||||
Filter.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( Entries.Count );
|
||||
writer.WriteEncodedInt( Entries.Count );
|
||||
|
||||
for ( int i = 0; i < Entries.Count; ++i )
|
||||
{
|
||||
object obj = Entries[i];
|
||||
for ( int i = 0; i < Entries.Count; ++i )
|
||||
{
|
||||
object obj = Entries[i];
|
||||
|
||||
if ( obj is BOBLargeEntry entry )
|
||||
{
|
||||
writer.WriteEncodedInt( 0 );
|
||||
entry.Serialize( writer );
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteEncodedInt( 1 );
|
||||
((BOBSmallEntry)obj).Serialize( writer );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( obj is BOBLargeEntry entry )
|
||||
{
|
||||
writer.WriteEncodedInt( 0 );
|
||||
entry.Serialize( writer );
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteEncodedInt( 1 );
|
||||
((BOBSmallEntry)obj).Serialize( writer );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 2:
|
||||
{
|
||||
ItemCount = reader.ReadInt();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_BookName = reader.ReadString();
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
ItemCount = reader.ReadInt();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_BookName = reader.ReadString();
|
||||
|
||||
Filter = new BOBFilter( reader );
|
||||
Filter = new BOBFilter( reader );
|
||||
|
||||
int count = reader.ReadEncodedInt();
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
Entries = new List<IBOBEntry>( count );
|
||||
Entries = new List<IBOBEntry>( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
int v = reader.ReadEncodedInt();
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
int v = reader.ReadEncodedInt();
|
||||
|
||||
switch ( v )
|
||||
{
|
||||
case 0: Entries.Add( new BOBLargeEntry( reader ) ); break;
|
||||
case 1: Entries.Add( new BOBSmallEntry( reader ) ); break;
|
||||
}
|
||||
}
|
||||
switch ( v )
|
||||
{
|
||||
case 0: Entries.Add( new BOBLargeEntry( reader ) ); break;
|
||||
case 1: Entries.Add( new BOBSmallEntry( reader ) ); break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
list.Add( 1062344, Entries.Count.ToString() ); // Deeds in book: ~1_val~
|
||||
list.Add( 1062344, Entries.Count.ToString() ); // Deeds in book: ~1_val~
|
||||
|
||||
if ( !string.IsNullOrEmpty(m_BookName) )
|
||||
list.Add( 1062481, m_BookName ); // Book Name: ~1_val~
|
||||
}
|
||||
if ( !string.IsNullOrEmpty(m_BookName) )
|
||||
list.Add( 1062481, m_BookName ); // Book Name: ~1_val~
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
LabelTo(from, 1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~
|
||||
LabelTo(from, 1062344, Entries.Count.ToString()); // Deeds in book: ~1_val~
|
||||
|
||||
if (!string.IsNullOrEmpty(m_BookName))
|
||||
LabelTo(from, 1062481, m_BookName);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(m_BookName))
|
||||
LabelTo(from, 1062481, m_BookName);
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from.CheckAlive() && IsChildOf( from.Backpack ) )
|
||||
list.Add( new NameBookEntry( from, this ) );
|
||||
if ( from.CheckAlive() && IsChildOf( from.Backpack ) )
|
||||
list.Add( new NameBookEntry( from, this ) );
|
||||
|
||||
SetSecureLevelEntry.AddTo( from, this, list );
|
||||
}
|
||||
SetSecureLevelEntry.AddTo( from, this, list );
|
||||
}
|
||||
|
||||
private class NameBookEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BulkOrderBook m_Book;
|
||||
private class NameBookEntry : ContextMenuEntry
|
||||
{
|
||||
private Mobile m_From;
|
||||
private BulkOrderBook m_Book;
|
||||
|
||||
public NameBookEntry( Mobile from, BulkOrderBook book ) : base( 6216 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Book = book;
|
||||
}
|
||||
public NameBookEntry( Mobile from, BulkOrderBook book ) : base( 6216 )
|
||||
{
|
||||
m_From = from;
|
||||
m_Book = book;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( m_From.CheckAlive() && m_Book.IsChildOf( m_From.Backpack ) )
|
||||
{
|
||||
m_From.Prompt = new NameBookPrompt( m_Book );
|
||||
m_From.SendLocalizedMessage( 1062479 ); // Type in the new name of the book:
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnClick()
|
||||
{
|
||||
if ( m_From.CheckAlive() && m_Book.IsChildOf( m_From.Backpack ) )
|
||||
{
|
||||
m_From.Prompt = new NameBookPrompt( m_Book );
|
||||
m_From.SendLocalizedMessage( 1062479 ); // Type in the new name of the book:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class NameBookPrompt : Prompt
|
||||
{
|
||||
private BulkOrderBook m_Book;
|
||||
private class NameBookPrompt : Prompt
|
||||
{
|
||||
private BulkOrderBook m_Book;
|
||||
|
||||
public NameBookPrompt( BulkOrderBook book )
|
||||
{
|
||||
m_Book = book;
|
||||
}
|
||||
public NameBookPrompt( BulkOrderBook book ) => m_Book = book;
|
||||
|
||||
public override void OnResponse( Mobile from, string text )
|
||||
{
|
||||
if ( text.Length > 40 )
|
||||
text = text.Substring( 0, 40 );
|
||||
public override void OnResponse( Mobile from, string text )
|
||||
{
|
||||
if ( text.Length > 40 )
|
||||
text = text.Substring( 0, 40 );
|
||||
|
||||
if ( from.CheckAlive() && m_Book.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
m_Book.BookName = Utility.FixHtml( text.Trim() );
|
||||
if ( from.CheckAlive() && m_Book.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
m_Book.BookName = Utility.FixHtml( text.Trim() );
|
||||
|
||||
from.SendLocalizedMessage( 1062480 ); // The bulk order book's name has been changed.
|
||||
}
|
||||
}
|
||||
from.SendLocalizedMessage( 1062480 ); // The bulk order book's name has been changed.
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCancel( Mobile from )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void OnCancel( Mobile from )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,8 @@ namespace Server.Engines.BulkOrders
|
|||
public override int LabelNumber => 1045151; // a bulk order deed
|
||||
|
||||
public LargeBOD(int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries) :
|
||||
base(hue, amountMax, requireExeptional, material)
|
||||
{
|
||||
m_Entries = entries;
|
||||
}
|
||||
base(hue, amountMax, requireExeptional, material) =>
|
||||
m_Entries = entries;
|
||||
|
||||
public LargeBOD()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,118 +3,118 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class LargeBulkEntry
|
||||
{
|
||||
private int m_Amount;
|
||||
public class LargeBulkEntry
|
||||
{
|
||||
private int m_Amount;
|
||||
|
||||
public LargeBOD Owner { get; set; }
|
||||
public LargeBOD Owner { get; set; }
|
||||
|
||||
public int Amount
|
||||
public int Amount
|
||||
{
|
||||
get => m_Amount;
|
||||
set{ m_Amount = value; Owner?.InvalidateProperties(); }
|
||||
set{ m_Amount = value; Owner?.InvalidateProperties(); }
|
||||
}
|
||||
public SmallBulkEntry Details { get; }
|
||||
public SmallBulkEntry Details { get; }
|
||||
|
||||
public static SmallBulkEntry[] LargeRing => GetEntries( "Blacksmith", "largering" );
|
||||
public static SmallBulkEntry[] LargeRing => GetEntries( "Blacksmith", "largering" );
|
||||
|
||||
public static SmallBulkEntry[] LargePlate => GetEntries( "Blacksmith", "largeplate" );
|
||||
public static SmallBulkEntry[] LargePlate => GetEntries( "Blacksmith", "largeplate" );
|
||||
|
||||
public static SmallBulkEntry[] LargeChain => GetEntries( "Blacksmith", "largechain" );
|
||||
public static SmallBulkEntry[] LargeChain => GetEntries( "Blacksmith", "largechain" );
|
||||
|
||||
public static SmallBulkEntry[] LargeAxes => GetEntries( "Blacksmith", "largeaxes" );
|
||||
public static SmallBulkEntry[] LargeAxes => GetEntries( "Blacksmith", "largeaxes" );
|
||||
|
||||
public static SmallBulkEntry[] LargeFencing => GetEntries( "Blacksmith", "largefencing" );
|
||||
public static SmallBulkEntry[] LargeFencing => GetEntries( "Blacksmith", "largefencing" );
|
||||
|
||||
public static SmallBulkEntry[] LargeMaces => GetEntries( "Blacksmith", "largemaces" );
|
||||
public static SmallBulkEntry[] LargeMaces => GetEntries( "Blacksmith", "largemaces" );
|
||||
|
||||
public static SmallBulkEntry[] LargePolearms => GetEntries( "Blacksmith", "largepolearms" );
|
||||
public static SmallBulkEntry[] LargePolearms => GetEntries( "Blacksmith", "largepolearms" );
|
||||
|
||||
public static SmallBulkEntry[] LargeSwords => GetEntries( "Blacksmith", "largeswords" );
|
||||
public static SmallBulkEntry[] LargeSwords => GetEntries( "Blacksmith", "largeswords" );
|
||||
|
||||
|
||||
public static SmallBulkEntry[] BoneSet => GetEntries( "Tailoring", "boneset" );
|
||||
public static SmallBulkEntry[] BoneSet => GetEntries( "Tailoring", "boneset" );
|
||||
|
||||
public static SmallBulkEntry[] Farmer => GetEntries( "Tailoring", "farmer" );
|
||||
public static SmallBulkEntry[] Farmer => GetEntries( "Tailoring", "farmer" );
|
||||
|
||||
public static SmallBulkEntry[] FemaleLeatherSet => GetEntries( "Tailoring", "femaleleatherset" );
|
||||
public static SmallBulkEntry[] FemaleLeatherSet => GetEntries( "Tailoring", "femaleleatherset" );
|
||||
|
||||
public static SmallBulkEntry[] FisherGirl => GetEntries( "Tailoring", "fishergirl" );
|
||||
public static SmallBulkEntry[] FisherGirl => GetEntries( "Tailoring", "fishergirl" );
|
||||
|
||||
public static SmallBulkEntry[] Gypsy => GetEntries( "Tailoring", "gypsy" );
|
||||
public static SmallBulkEntry[] Gypsy => GetEntries( "Tailoring", "gypsy" );
|
||||
|
||||
public static SmallBulkEntry[] HatSet => GetEntries( "Tailoring", "hatset" );
|
||||
public static SmallBulkEntry[] HatSet => GetEntries( "Tailoring", "hatset" );
|
||||
|
||||
public static SmallBulkEntry[] Jester => GetEntries( "Tailoring", "jester" );
|
||||
public static SmallBulkEntry[] Jester => GetEntries( "Tailoring", "jester" );
|
||||
|
||||
public static SmallBulkEntry[] Lady => GetEntries( "Tailoring", "lady" );
|
||||
public static SmallBulkEntry[] Lady => GetEntries( "Tailoring", "lady" );
|
||||
|
||||
public static SmallBulkEntry[] MaleLeatherSet => GetEntries( "Tailoring", "maleleatherset" );
|
||||
public static SmallBulkEntry[] MaleLeatherSet => GetEntries( "Tailoring", "maleleatherset" );
|
||||
|
||||
public static SmallBulkEntry[] Pirate => GetEntries( "Tailoring", "pirate" );
|
||||
public static SmallBulkEntry[] Pirate => GetEntries( "Tailoring", "pirate" );
|
||||
|
||||
public static SmallBulkEntry[] ShoeSet => GetEntries( "Tailoring", "shoeset" );
|
||||
public static SmallBulkEntry[] ShoeSet => GetEntries( "Tailoring", "shoeset" );
|
||||
|
||||
public static SmallBulkEntry[] StuddedSet => GetEntries( "Tailoring", "studdedset" );
|
||||
public static SmallBulkEntry[] StuddedSet => GetEntries( "Tailoring", "studdedset" );
|
||||
|
||||
public static SmallBulkEntry[] TownCrier => GetEntries( "Tailoring", "towncrier" );
|
||||
public static SmallBulkEntry[] TownCrier => GetEntries( "Tailoring", "towncrier" );
|
||||
|
||||
public static SmallBulkEntry[] Wizard => GetEntries( "Tailoring", "wizard" );
|
||||
public static SmallBulkEntry[] Wizard => GetEntries( "Tailoring", "wizard" );
|
||||
|
||||
|
||||
private static Dictionary<string,Dictionary<string,SmallBulkEntry[]>> m_Cache;
|
||||
private static Dictionary<string,Dictionary<string,SmallBulkEntry[]>> m_Cache;
|
||||
|
||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
||||
{
|
||||
if (m_Cache == null)
|
||||
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
||||
{
|
||||
if (m_Cache == null)
|
||||
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||
|
||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||
|
||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
||||
table[name] = entries = SmallBulkEntry.LoadEntries(type, name);
|
||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
||||
table[name] = entries = SmallBulkEntry.LoadEntries(type, name);
|
||||
|
||||
return entries;
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small )
|
||||
{
|
||||
LargeBulkEntry[] large = new LargeBulkEntry[small.Length];
|
||||
public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small )
|
||||
{
|
||||
LargeBulkEntry[] large = new LargeBulkEntry[small.Length];
|
||||
|
||||
for ( int i = 0; i < small.Length; ++i )
|
||||
large[i] = new LargeBulkEntry( owner, small[i] );
|
||||
for ( int i = 0; i < small.Length; ++i )
|
||||
large[i] = new LargeBulkEntry( owner, small[i] );
|
||||
|
||||
return large;
|
||||
}
|
||||
return large;
|
||||
}
|
||||
|
||||
public LargeBulkEntry( LargeBOD owner, SmallBulkEntry details )
|
||||
{
|
||||
Owner = owner;
|
||||
Details = details;
|
||||
}
|
||||
public LargeBulkEntry( LargeBOD owner, SmallBulkEntry details )
|
||||
{
|
||||
Owner = owner;
|
||||
Details = details;
|
||||
}
|
||||
|
||||
public LargeBulkEntry( LargeBOD owner, GenericReader reader )
|
||||
{
|
||||
Owner = owner;
|
||||
m_Amount = reader.ReadInt();
|
||||
public LargeBulkEntry( LargeBOD owner, GenericReader reader )
|
||||
{
|
||||
Owner = owner;
|
||||
m_Amount = reader.ReadInt();
|
||||
|
||||
Type realType = null;
|
||||
Type realType = null;
|
||||
|
||||
string type = reader.ReadString();
|
||||
string type = reader.ReadString();
|
||||
|
||||
if ( type != null )
|
||||
realType = AssemblyHandler.FindTypeByFullName( type );
|
||||
if ( type != null )
|
||||
realType = AssemblyHandler.FindTypeByFullName( type );
|
||||
|
||||
Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() );
|
||||
}
|
||||
Details = new SmallBulkEntry( realType, reader.ReadInt(), reader.ReadInt() );
|
||||
}
|
||||
|
||||
public void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( m_Amount );
|
||||
writer.Write( Details.Type == null ? null : Details.Type.FullName );
|
||||
writer.Write( Details.Number );
|
||||
writer.Write( Details.Graphic );
|
||||
}
|
||||
}
|
||||
public void Serialize( GenericWriter writer )
|
||||
{
|
||||
writer.Write( m_Amount );
|
||||
writer.Write( Details.Type == null ? null : Details.Type.FullName );
|
||||
writer.Write( Details.Number );
|
||||
writer.Write( Details.Graphic );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,15 +91,9 @@ namespace Server.Engines.BulkOrders
|
|||
{
|
||||
}
|
||||
|
||||
public override int ComputeFame()
|
||||
{
|
||||
return TailorRewardCalculator.Instance.ComputeFame(this);
|
||||
}
|
||||
public override int ComputeFame() => TailorRewardCalculator.Instance.ComputeFame(this);
|
||||
|
||||
public override int ComputeGold()
|
||||
{
|
||||
return TailorRewardCalculator.Instance.ComputeGold(this);
|
||||
}
|
||||
public override int ComputeGold() => TailorRewardCalculator.Instance.ComputeGold(this);
|
||||
|
||||
public override RewardGroup GetRewardGroup() =>
|
||||
TailorRewardCalculator.Instance.LookupRewards(TailorRewardCalculator.Instance.ComputePoints(this));
|
||||
|
|
|
|||
|
|
@ -116,27 +116,17 @@ namespace Server.Engines.BulkOrders
|
|||
return points * points;
|
||||
}
|
||||
|
||||
public virtual int ComputePoints(SmallBOD bod)
|
||||
{
|
||||
return ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type);
|
||||
}
|
||||
public virtual int ComputePoints(SmallBOD bod) => ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type);
|
||||
|
||||
public virtual int ComputePoints(LargeBOD bod)
|
||||
{
|
||||
return ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length,
|
||||
public virtual int ComputePoints(LargeBOD bod) =>
|
||||
ComputePoints(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length,
|
||||
bod.Entries[0].Details.Type);
|
||||
}
|
||||
|
||||
public virtual int ComputeGold(SmallBOD bod)
|
||||
{
|
||||
return ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type);
|
||||
}
|
||||
public virtual int ComputeGold(SmallBOD bod) => ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, 1, bod.Type);
|
||||
|
||||
public virtual int ComputeGold(LargeBOD bod)
|
||||
{
|
||||
return ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length,
|
||||
public virtual int ComputeGold(LargeBOD bod) =>
|
||||
ComputeGold(bod.AmountMax, bod.RequireExceptional, bod.Material, bod.Entries.Length,
|
||||
bod.Entries[0].Details.Type);
|
||||
}
|
||||
|
||||
public virtual RewardGroup LookupRewards(int points)
|
||||
{
|
||||
|
|
@ -385,15 +375,9 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
#region Constructors
|
||||
|
||||
private static Item CreateSturdyShovel(int type)
|
||||
{
|
||||
return new SturdyShovel();
|
||||
}
|
||||
private static Item CreateSturdyShovel(int type) => new SturdyShovel();
|
||||
|
||||
private static Item CreateSturdyPickaxe(int type)
|
||||
{
|
||||
return new SturdyPickaxe();
|
||||
}
|
||||
private static Item CreateSturdyPickaxe(int type) => new SturdyPickaxe();
|
||||
|
||||
private static Item CreateMiningGloves(int type)
|
||||
{
|
||||
|
|
@ -410,20 +394,11 @@ namespace Server.Engines.BulkOrders
|
|||
}
|
||||
}
|
||||
|
||||
private static Item CreateGargoylesPickaxe(int type)
|
||||
{
|
||||
return new GargoylesPickaxe();
|
||||
}
|
||||
private static Item CreateGargoylesPickaxe(int type) => new GargoylesPickaxe();
|
||||
|
||||
private static Item CreateProspectorsTool(int type)
|
||||
{
|
||||
return new ProspectorsTool();
|
||||
}
|
||||
private static Item CreateProspectorsTool(int type) => new ProspectorsTool();
|
||||
|
||||
private static Item CreatePowderOfTemperament(int type)
|
||||
{
|
||||
return new PowderOfTemperament();
|
||||
}
|
||||
private static Item CreatePowderOfTemperament(int type) => new PowderOfTemperament();
|
||||
|
||||
private static Item CreateRunicHammer(int type)
|
||||
{
|
||||
|
|
@ -441,13 +416,7 @@ namespace Server.Engines.BulkOrders
|
|||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
private static Item CreateColoredAnvil(int type)
|
||||
{
|
||||
// Generate an anvil deed, not an actual anvil.
|
||||
//return new ColoredAnvilDeed();
|
||||
|
||||
return new ColoredAnvil();
|
||||
}
|
||||
private static Item CreateColoredAnvil(int type) => new ColoredAnvil();
|
||||
|
||||
private static Item CreateAncientHammer(int type)
|
||||
{
|
||||
|
|
@ -678,10 +647,7 @@ namespace Server.Engines.BulkOrders
|
|||
0x484, 0x497
|
||||
};
|
||||
|
||||
private static Item CreateSandals(int type)
|
||||
{
|
||||
return new Sandals(m_SandalHues[Utility.Random(m_SandalHues.Length)]);
|
||||
}
|
||||
private static Item CreateSandals(int type) => new Sandals(m_SandalHues[Utility.Random(m_SandalHues.Length)]);
|
||||
|
||||
private static Item CreateStretchedHide(int type)
|
||||
{
|
||||
|
|
@ -735,10 +701,7 @@ namespace Server.Engines.BulkOrders
|
|||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
private static Item CreateCBD(int type)
|
||||
{
|
||||
return new ClothingBlessDeed();
|
||||
}
|
||||
private static Item CreateCBD(int type) => new ClothingBlessDeed();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,89 +4,84 @@ using System.IO;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class SmallBulkEntry
|
||||
{
|
||||
public Type Type { get; }
|
||||
public class SmallBulkEntry
|
||||
{
|
||||
public Type Type { get; }
|
||||
|
||||
public int Number { get; }
|
||||
public int Number { get; }
|
||||
|
||||
public int Graphic { get; }
|
||||
public int Graphic { get; }
|
||||
|
||||
public SmallBulkEntry( Type type, int number, int graphic )
|
||||
{
|
||||
Type = type;
|
||||
Number = number;
|
||||
Graphic = graphic;
|
||||
}
|
||||
public SmallBulkEntry( Type type, int number, int graphic )
|
||||
{
|
||||
Type = type;
|
||||
Number = number;
|
||||
Graphic = graphic;
|
||||
}
|
||||
|
||||
public static SmallBulkEntry[] BlacksmithWeapons => GetEntries( "Blacksmith", "weapons" );
|
||||
public static SmallBulkEntry[] BlacksmithWeapons => GetEntries( "Blacksmith", "weapons" );
|
||||
|
||||
public static SmallBulkEntry[] BlacksmithArmor => GetEntries( "Blacksmith", "armor" );
|
||||
public static SmallBulkEntry[] BlacksmithArmor => GetEntries( "Blacksmith", "armor" );
|
||||
|
||||
public static SmallBulkEntry[] TailorCloth => GetEntries( "Tailoring", "cloth" );
|
||||
public static SmallBulkEntry[] TailorCloth => GetEntries( "Tailoring", "cloth" );
|
||||
|
||||
public static SmallBulkEntry[] TailorLeather => GetEntries( "Tailoring", "leather" );
|
||||
public static SmallBulkEntry[] TailorLeather => GetEntries( "Tailoring", "leather" );
|
||||
|
||||
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
|
||||
private static Dictionary<string, Dictionary<string, SmallBulkEntry[]>> m_Cache;
|
||||
|
||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
||||
{
|
||||
if ( m_Cache == null )
|
||||
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||
public static SmallBulkEntry[] GetEntries( string type, string name )
|
||||
{
|
||||
if ( m_Cache == null )
|
||||
m_Cache = new Dictionary<string, Dictionary<string, SmallBulkEntry[]>>();
|
||||
|
||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||
if (!m_Cache.TryGetValue( type, out Dictionary<string, SmallBulkEntry[]> table ))
|
||||
m_Cache[type] = table = new Dictionary<string, SmallBulkEntry[]>();
|
||||
|
||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
||||
table[name] = entries = LoadEntries(type, name);
|
||||
if (!table.TryGetValue( name, out SmallBulkEntry[] entries ))
|
||||
table[name] = entries = LoadEntries(type, name);
|
||||
|
||||
return entries;
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
|
||||
public static SmallBulkEntry[] LoadEntries( string type, string name )
|
||||
{
|
||||
return LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
|
||||
}
|
||||
public static SmallBulkEntry[] LoadEntries( string type, string name ) => LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
|
||||
|
||||
public static SmallBulkEntry[] LoadEntries( string path )
|
||||
{
|
||||
path = Path.Combine( Core.BaseDirectory, path );
|
||||
public static SmallBulkEntry[] LoadEntries( string path )
|
||||
{
|
||||
path = Path.Combine( Core.BaseDirectory, path );
|
||||
|
||||
List<SmallBulkEntry> list = new List<SmallBulkEntry>();
|
||||
List<SmallBulkEntry> list = new List<SmallBulkEntry>();
|
||||
|
||||
if ( File.Exists( path ) )
|
||||
{
|
||||
using ( StreamReader ip = new StreamReader( path ) )
|
||||
{
|
||||
string line;
|
||||
if ( File.Exists( path ) )
|
||||
{
|
||||
using StreamReader ip = new StreamReader( path );
|
||||
string line;
|
||||
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
if ( line.Length == 0 || line.StartsWith( "#" ) )
|
||||
continue;
|
||||
while ( (line = ip.ReadLine()) != null )
|
||||
{
|
||||
if ( line.Length == 0 || line.StartsWith( "#" ) )
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
string[] split = line.Split( '\t' );
|
||||
try
|
||||
{
|
||||
string[] split = line.Split( '\t' );
|
||||
|
||||
if ( split.Length >= 2 )
|
||||
{
|
||||
Type type = AssemblyHandler.FindTypeByName( split[0] );
|
||||
int graphic = Utility.ToInt32( split[split.Length - 1] );
|
||||
|
||||
if ( type != null && graphic > 0 )
|
||||
list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) );
|
||||
}
|
||||
}
|
||||
catch
|
||||
if ( split.Length >= 2 )
|
||||
{
|
||||
// ignored
|
||||
Type type = AssemblyHandler.FindTypeByName( split[0] );
|
||||
int graphic = Utility.ToInt32( split[split.Length - 1] );
|
||||
|
||||
if ( type != null && graphic > 0 )
|
||||
list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list.ToArray();
|
||||
}
|
||||
}
|
||||
return list.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
private ChampionSpawn m_Spawn;
|
||||
|
||||
public ChampionAltar(ChampionSpawn spawn)
|
||||
{
|
||||
m_Spawn = spawn;
|
||||
}
|
||||
public ChampionAltar(ChampionSpawn spawn) => m_Spawn = spawn;
|
||||
|
||||
public ChampionAltar(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -170,10 +170,7 @@ namespace Server.Engines.CannedEvil
|
|||
{
|
||||
private ChampionSkullBrazier m_Brazier;
|
||||
|
||||
public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None)
|
||||
{
|
||||
m_Brazier = brazier;
|
||||
}
|
||||
public SacrificeTarget(ChampionSkullBrazier brazier) : base(12, false, TargetFlags.None) => m_Brazier = brazier;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,10 +84,7 @@ namespace Server.Engines.CannedEvil
|
|||
}
|
||||
}
|
||||
|
||||
public bool Validate(ChampionSkullBrazier brazier)
|
||||
{
|
||||
return brazier?.Skull?.Deleted == false;
|
||||
}
|
||||
public bool Validate(ChampionSkullBrazier brazier) => brazier?.Skull?.Deleted == false;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -200,10 +200,7 @@ namespace Server.Engines.CannedEvil
|
|||
*/
|
||||
}
|
||||
|
||||
public bool IsChampionSpawn(Mobile m)
|
||||
{
|
||||
return m_Creatures.Contains(m);
|
||||
}
|
||||
public bool IsChampionSpawn(Mobile m) => m_Creatures.Contains(m);
|
||||
|
||||
public void SetWhiteSkullCount(int val)
|
||||
{
|
||||
|
|
@ -1008,11 +1005,9 @@ namespace Server.Engines.CannedEvil
|
|||
1062317); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
|
||||
}
|
||||
|
||||
public bool IsEligible(Mobile m, Item Artifact)
|
||||
{
|
||||
return m.Player && m.Alive && m.Region != null && m.Region == m_Region &&
|
||||
m.Backpack?.CheckHold(m, Artifact, false) == true;
|
||||
}
|
||||
public bool IsEligible(Mobile m, Item Artifact) =>
|
||||
m.Player && m.Alive && m.Region != null && m.Region == m_Region &&
|
||||
m.Backpack?.CheckHold(m, Artifact, false) == true;
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -1167,19 +1162,14 @@ namespace Server.Engines.CannedEvil
|
|||
public class ChampionSpawnRegion : BaseRegion
|
||||
{
|
||||
public ChampionSpawnRegion(ChampionSpawn spawn) : base(null, spawn.Map, Find(spawn.Location, spawn.Map),
|
||||
spawn.SpawnArea)
|
||||
{
|
||||
spawn.SpawnArea) =>
|
||||
ChampionSpawn = spawn;
|
||||
}
|
||||
|
||||
public override bool YoungProtected => false;
|
||||
|
||||
public ChampionSpawn ChampionSpawn{ get; }
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||
|
||||
public override void AlterLightLevel(Mobile m, ref int global, ref int personal)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,10 +85,7 @@ namespace Server.Items
|
|||
{
|
||||
private Item m_Item;
|
||||
|
||||
public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow)
|
||||
{
|
||||
m_Item = item;
|
||||
}
|
||||
public InternalTimer(Item item, DateTime end) : base(end - DateTime.UtcNow) => m_Item = item;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace Server.Engines.Chat
|
|||
m_Voices = new List<ChatUser>();
|
||||
}
|
||||
|
||||
public Channel(string name, string password) : this(name)
|
||||
{
|
||||
m_Password = password;
|
||||
}
|
||||
public Channel(string name, string password) : this(name) => m_Password = password;
|
||||
|
||||
public string Name
|
||||
{
|
||||
|
|
@ -73,35 +70,17 @@ namespace Server.Engines.Chat
|
|||
|
||||
public static List<Channel> Channels{ get; } = new List<Channel>();
|
||||
|
||||
public bool Contains(ChatUser user)
|
||||
{
|
||||
return m_Users.Contains(user);
|
||||
}
|
||||
public bool Contains(ChatUser user) => m_Users.Contains(user);
|
||||
|
||||
public bool IsBanned(ChatUser user)
|
||||
{
|
||||
return m_Banned.Contains(user);
|
||||
}
|
||||
public bool IsBanned(ChatUser user) => m_Banned.Contains(user);
|
||||
|
||||
public bool CanTalk(ChatUser user)
|
||||
{
|
||||
return !m_VoiceRestricted || m_Voices.Contains(user) || m_Moderators.Contains(user);
|
||||
}
|
||||
public bool CanTalk(ChatUser user) => !m_VoiceRestricted || m_Voices.Contains(user) || m_Moderators.Contains(user);
|
||||
|
||||
public bool IsModerator(ChatUser user)
|
||||
{
|
||||
return m_Moderators.Contains(user);
|
||||
}
|
||||
public bool IsModerator(ChatUser user) => m_Moderators.Contains(user);
|
||||
|
||||
public bool IsVoiced(ChatUser user)
|
||||
{
|
||||
return m_Voices.Contains(user);
|
||||
}
|
||||
public bool IsVoiced(ChatUser user) => m_Voices.Contains(user);
|
||||
|
||||
public bool ValidatePassword(string password)
|
||||
{
|
||||
return m_Password == null || Insensitive.Equals(m_Password, password);
|
||||
}
|
||||
public bool ValidatePassword(string password) => m_Password == null || Insensitive.Equals(m_Password, password);
|
||||
|
||||
public bool ValidateModerator(ChatUser user)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,11 +51,9 @@ namespace Server.Engines.Chat
|
|||
|
||||
public bool IsModerator => CurrentChannel?.IsModerator(this) == true;
|
||||
|
||||
public char GetColorCharacter()
|
||||
{
|
||||
return IsModerator ? ModeratorColorCharacter :
|
||||
CurrentChannel?.IsVoiced(this) == true ? VoicedColorCharacter : NormalColorCharacter;
|
||||
}
|
||||
public char GetColorCharacter() =>
|
||||
IsModerator ? ModeratorColorCharacter :
|
||||
CurrentChannel?.IsVoiced(this) == true ? VoicedColorCharacter : NormalColorCharacter;
|
||||
|
||||
public bool CheckOnline()
|
||||
{
|
||||
|
|
@ -78,10 +76,7 @@ namespace Server.Engines.Chat
|
|||
Mobile.Send(new ChatMessagePacket(from, number, param1, param2));
|
||||
}
|
||||
|
||||
public bool IsIgnored(ChatUser check)
|
||||
{
|
||||
return Ignored.Contains(check);
|
||||
}
|
||||
public bool IsIgnored(ChatUser check) => Ignored.Contains(check);
|
||||
|
||||
public void AddIgnored(ChatUser user)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -92,15 +92,9 @@ namespace Server.Engines.ConPVP
|
|||
Timer.DelayCall(TimeSpan.FromSeconds(15.0), AutoReject);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
public void AutoReject()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,10 +86,7 @@ namespace Server.Engines.ConPVP
|
|||
[PropertyObject]
|
||||
public class ArenaStartPoints
|
||||
{
|
||||
public ArenaStartPoints(Point3D[] points = null)
|
||||
{
|
||||
Points = points ?? new Point3D[8];
|
||||
}
|
||||
public ArenaStartPoints(Point3D[] points = null) => Points = points ?? new Point3D[8];
|
||||
|
||||
public ArenaStartPoints(GenericReader reader)
|
||||
{
|
||||
|
|
@ -157,10 +154,7 @@ namespace Server.Engines.ConPVP
|
|||
set => Points[7] = value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
public override string ToString() => "...";
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -471,10 +465,7 @@ namespace Server.Engines.ConPVP
|
|||
return a.CompareTo(b);
|
||||
}
|
||||
|
||||
public Ladder AcquireLadder()
|
||||
{
|
||||
return Ladder?.Ladder ?? ConPVP.Ladder.Instance;
|
||||
}
|
||||
public Ladder AcquireLadder() => Ladder?.Ladder ?? ConPVP.Ladder.Instance;
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
|
|
@ -483,10 +474,7 @@ namespace Server.Engines.ConPVP
|
|||
m_Region = null;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
public override string ToString() => "...";
|
||||
|
||||
public Point3D GetBaseStartPoint(int index)
|
||||
{
|
||||
|
|
@ -754,10 +742,7 @@ namespace Server.Engines.ConPVP
|
|||
public int m_VotesAgainst;
|
||||
public int m_VotesFor;
|
||||
|
||||
public ArenaEntry(Arena arena)
|
||||
{
|
||||
m_Arena = arena;
|
||||
}
|
||||
public ArenaEntry(Arena arena) => m_Arena = arena;
|
||||
|
||||
public int Value => m_VotesFor;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,11 +117,7 @@ namespace Server.Engines.ConPVP
|
|||
Timer.DelayCall(ts, () => DelayBounce_Callback(mob, corpse));
|
||||
}
|
||||
|
||||
public static bool AllowSpecialMove(Mobile from, string name, SpecialMove move)
|
||||
{
|
||||
// No DuelContext, or InstaAllowSpecialMove
|
||||
return (from as PlayerMobile)?.DuelContext?.InstAllowSpecialMove(from, name, move) != false;
|
||||
}
|
||||
public static bool AllowSpecialMove(Mobile from, string name, SpecialMove move) => (from as PlayerMobile)?.DuelContext?.InstAllowSpecialMove(from, name, move) != false;
|
||||
|
||||
public bool InstAllowSpecialMove(Mobile from, string name, SpecialMove move)
|
||||
{
|
||||
|
|
@ -958,10 +954,7 @@ namespace Server.Engines.ConPVP
|
|||
m_SDWarnTimer = null;
|
||||
}
|
||||
|
||||
public static bool CheckSuddenDeath(Mobile mob)
|
||||
{
|
||||
return mob is PlayerMobile pm && pm.DuelPlayer?.Eliminated == false && pm.DuelContext?.IsSuddenDeath == true;
|
||||
}
|
||||
public static bool CheckSuddenDeath(Mobile mob) => mob is PlayerMobile pm && pm.DuelPlayer?.Eliminated == false && pm.DuelContext?.IsSuddenDeath == true;
|
||||
|
||||
public void ActivateSuddenDeath()
|
||||
{
|
||||
|
|
@ -2204,10 +2197,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private class InternalWall : Item
|
||||
{
|
||||
public InternalWall() : base(0x80)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
public InternalWall() : base(0x80) => Movable = false;
|
||||
|
||||
public InternalWall(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -918,10 +918,8 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
[Constructible]
|
||||
public BRBoard()
|
||||
: base(7774)
|
||||
{
|
||||
: base(7774) =>
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public BRBoard(Serial serial)
|
||||
: base(serial)
|
||||
|
|
@ -1088,15 +1086,9 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(314, height - 42, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
@ -1362,15 +1354,9 @@ namespace Server.Engines.ConPVP
|
|||
public override string Title => "Bombing Run";
|
||||
public override string DefaultName => "Bombing Run Controller";
|
||||
|
||||
public override string GetTeamName(int teamID)
|
||||
{
|
||||
return TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
}
|
||||
public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
|
||||
public override EventGame Construct(DuelContext context)
|
||||
{
|
||||
return new BRGame(this, context);
|
||||
}
|
||||
public override EventGame Construct(DuelContext context) => new BRGame(this, context);
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -1421,10 +1407,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private TimerCallback m_UnhideCallback;
|
||||
|
||||
public BRGame(BRController controller, DuelContext context) : base(context)
|
||||
{
|
||||
Controller = controller;
|
||||
}
|
||||
public BRGame(BRController controller, DuelContext context) : base(context) => Controller = controller;
|
||||
|
||||
public BRController Controller{ get; }
|
||||
|
||||
|
|
@ -1439,10 +1422,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public override bool CantDoAnything(Mobile mob)
|
||||
{
|
||||
return mob.Backpack?.FindItemByType<BRBomb>() != null && GetTeamInfo(mob) != null;
|
||||
}
|
||||
public override bool CantDoAnything(Mobile mob) => mob.Backpack?.FindItemByType<BRBomb>() != null && GetTeamInfo(mob) != null;
|
||||
|
||||
public void ReturnBomb()
|
||||
{
|
||||
|
|
@ -1508,10 +1488,7 @@ namespace Server.Engines.ConPVP
|
|||
return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant);
|
||||
}
|
||||
|
||||
public int GetColor(Mobile mob)
|
||||
{
|
||||
return GetTeamInfo(mob)?.Color ?? -1;
|
||||
}
|
||||
public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1;
|
||||
|
||||
private void ApplyHues(Participant p, int hueOverride)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
[Constructible]
|
||||
public CTFBoard()
|
||||
: base(7774)
|
||||
{
|
||||
: base(7774) =>
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public CTFBoard(Serial serial)
|
||||
: base(serial)
|
||||
|
|
@ -181,15 +179,9 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(314, height - 42, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
@ -223,10 +215,8 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
[Constructible]
|
||||
public CTFFlag()
|
||||
: base(5643)
|
||||
{
|
||||
: base(5643) =>
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public CTFFlag(Serial serial)
|
||||
: base(serial)
|
||||
|
|
@ -684,10 +674,7 @@ namespace Server.Engines.ConPVP
|
|||
op.Write(Origin);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
public override string ToString() => "...";
|
||||
}
|
||||
|
||||
public sealed class CTFController : EventController
|
||||
|
|
@ -742,15 +729,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override string Title => "CTF";
|
||||
|
||||
public override string GetTeamName(int teamID)
|
||||
{
|
||||
return TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
}
|
||||
public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
|
||||
public override EventGame Construct(DuelContext context)
|
||||
{
|
||||
return new CTFGame(this, context);
|
||||
}
|
||||
public override EventGame Construct(DuelContext context) => new CTFGame(this, context);
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -809,10 +790,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
private Timer m_FinishTimer;
|
||||
|
||||
public CTFGame(CTFController controller, DuelContext context) : base(context)
|
||||
{
|
||||
Controller = controller;
|
||||
}
|
||||
public CTFGame(CTFController controller, DuelContext context) : base(context) => Controller = controller;
|
||||
|
||||
public CTFController Controller{ get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,8 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
[Constructible]
|
||||
public DDBoard()
|
||||
: base(7774)
|
||||
{
|
||||
: base(7774) =>
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public DDBoard(Serial serial)
|
||||
: base(serial)
|
||||
|
|
@ -177,15 +175,9 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(314, height - 42, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
@ -354,10 +346,7 @@ namespace Server.Engines.ConPVP
|
|||
op.Write(Origin);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "...";
|
||||
}
|
||||
public override string ToString() => "...";
|
||||
}
|
||||
|
||||
public sealed class DDController : EventController
|
||||
|
|
@ -402,15 +391,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override string DefaultName => "DD Controller";
|
||||
|
||||
public override string GetTeamName(int teamID)
|
||||
{
|
||||
return TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
}
|
||||
public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
|
||||
public override EventGame Construct(DuelContext context)
|
||||
{
|
||||
return new DDGame(this, context);
|
||||
}
|
||||
public override EventGame Construct(DuelContext context) => new DDGame(this, context);
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -464,10 +447,7 @@ namespace Server.Engines.ConPVP
|
|||
private Timer m_FinishTimer;
|
||||
private Timer m_UncaptureTimer;
|
||||
|
||||
public DDGame(DDController controller, DuelContext context) : base(context)
|
||||
{
|
||||
Controller = controller;
|
||||
}
|
||||
public DDGame(DDController controller, DuelContext context) : base(context) => Controller = controller;
|
||||
|
||||
public DDController Controller{ get; }
|
||||
|
||||
|
|
@ -525,10 +505,7 @@ namespace Server.Engines.ConPVP
|
|||
return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant);
|
||||
}
|
||||
|
||||
public int GetColor(Mobile mob)
|
||||
{
|
||||
return GetTeamInfo(mob)?.Color ?? -1;
|
||||
}
|
||||
public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1;
|
||||
|
||||
private void ApplyHues(Participant p, int hueOverride)
|
||||
{
|
||||
|
|
@ -1077,10 +1054,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public class DDStep : AddonComponent
|
||||
{
|
||||
public DDStep(int itemID) : base(itemID)
|
||||
{
|
||||
Visible = true;
|
||||
}
|
||||
public DDStep(int itemID) : base(itemID) => Visible = true;
|
||||
|
||||
public DDStep(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
@ -1100,10 +1074,7 @@ namespace Server.Engines.ConPVP
|
|||
writer.Write(0); //version
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
return Addon.OnMoveOver(m);
|
||||
}
|
||||
public override bool OnMoveOver(Mobile m) => Addon.OnMoveOver(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,24 +47,15 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
protected DuelContext m_Context;
|
||||
|
||||
public EventGame(DuelContext context)
|
||||
{
|
||||
m_Context = context;
|
||||
}
|
||||
public EventGame(DuelContext context) => m_Context = context;
|
||||
|
||||
public DuelContext Context => m_Context;
|
||||
|
||||
public virtual bool FreeConsume => true;
|
||||
|
||||
public virtual bool OnDeath(Mobile mob, Container corpse)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public virtual bool OnDeath(Mobile mob, Container corpse) => true;
|
||||
|
||||
public virtual bool CantDoAnything(Mobile mob)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public virtual bool CantDoAnything(Mobile mob) => false;
|
||||
|
||||
public virtual void OnStart()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -463,15 +463,9 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(314, height - 42, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
@ -650,10 +644,7 @@ namespace Server.Engines.ConPVP
|
|||
op.WriteEncodedInt(Color);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return TeamName != null ? $"({Name}) ..." : "...";
|
||||
}
|
||||
public override string ToString() => TeamName != null ? $"({Name}) ..." : "...";
|
||||
}
|
||||
|
||||
public sealed class KHController : EventController
|
||||
|
|
@ -745,15 +736,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public override string Title => "King of the Hill";
|
||||
|
||||
public override string GetTeamName(int teamID)
|
||||
{
|
||||
return TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
}
|
||||
public override string GetTeamName(int teamID) => TeamInfo[teamID % TeamInfo.Length].Name;
|
||||
|
||||
public override EventGame Construct(DuelContext context)
|
||||
{
|
||||
return new KHGame(this, context);
|
||||
}
|
||||
public override EventGame Construct(DuelContext context) => new KHGame(this, context);
|
||||
|
||||
public void RemoveBoard(KHBoard b)
|
||||
{
|
||||
|
|
@ -824,10 +809,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
private Timer m_FinishTimer;
|
||||
|
||||
public KHGame(KHController controller, DuelContext context) : base(context)
|
||||
{
|
||||
Controller = controller;
|
||||
}
|
||||
public KHGame(KHController controller, DuelContext context) : base(context) => Controller = controller;
|
||||
|
||||
public KHController Controller{ get; }
|
||||
|
||||
|
|
@ -895,10 +877,7 @@ namespace Server.Engines.ConPVP
|
|||
return pm.DuelContext.Participants.IndexOf(pm.DuelPlayer.Participant);
|
||||
}
|
||||
|
||||
public int GetColor(Mobile mob)
|
||||
{
|
||||
return GetTeamInfo(mob)?.Color ?? -1;
|
||||
}
|
||||
public int GetColor(Mobile mob) => GetTeamInfo(mob)?.Color ?? -1;
|
||||
|
||||
private void ApplyHues(Participant p, int hueOverride)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -248,15 +248,9 @@ namespace Server.Engines.ConPVP
|
|||
Timer.DelayCall(TimeSpan.FromSeconds(15.0), AutoReject);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,10 +67,7 @@ namespace Server.Engines.ConPVP
|
|||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
return !m.Player || UseGate(m);
|
||||
}
|
||||
public override bool OnMoveOver(Mobile m) => !m.Player || UseGate(m);
|
||||
}
|
||||
|
||||
public class ArenaGump : Gump
|
||||
|
|
@ -242,15 +239,9 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,14 +59,8 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(314 - 50, 157 - offset, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,15 +281,9 @@ public class ConfirmSignupGump : Gump
|
|||
AddButton(314, y, 247, 248, 1);
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,10 +56,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public DuelContext Context{ get; }
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public void AddGoldenButton(int x, int y, int bid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ namespace Server.Engines.ConPVP
|
|||
public class LadderItem : Item
|
||||
{
|
||||
[Constructible]
|
||||
public LadderItem() : base(0x117F)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
public LadderItem() : base(0x117F) => Movable = false;
|
||||
|
||||
public LadderItem(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
@ -207,15 +204,9 @@ namespace Server.Engines.ConPVP
|
|||
from.SendGump(new LadderGump(m_Ladder, m_Page + 1));
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,10 +64,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public Participant Participant{ get; }
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public void AddGoldenButton(int x, int y, int bid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -70,10 +70,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,10 +97,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -189,10 +189,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public void AddGoldenButton(int x, int y, int bid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,10 +73,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public void AddGoldenButton(int x, int y, int bid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -614,15 +614,9 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
@ -667,10 +661,7 @@ namespace Server.Engines.ConPVP
|
|||
AddLeftArrow(x, y, bid, null);
|
||||
}
|
||||
|
||||
public int ToButtonID(int type, int index)
|
||||
{
|
||||
return 1 + index * 7 + type;
|
||||
}
|
||||
public int ToButtonID(int type, int index) => 1 + index * 7 + type;
|
||||
|
||||
public bool FromButtonID(int bid, out int type, out int index)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -118,10 +118,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private Dictionary<Mobile, LadderEntry> m_Table;
|
||||
|
||||
public Ladder()
|
||||
{
|
||||
m_Table = new Dictionary<Mobile, LadderEntry>();
|
||||
}
|
||||
public Ladder() => m_Table = new Dictionary<Mobile, LadderEntry>();
|
||||
|
||||
public Ladder(GenericReader reader)
|
||||
{
|
||||
|
|
@ -350,10 +347,7 @@ namespace Server.Engines.ConPVP
|
|||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Rank => Index;
|
||||
|
||||
public int CompareTo(LadderEntry l)
|
||||
{
|
||||
return (l?.m_Experience ?? 0) - m_Experience;
|
||||
}
|
||||
public int CompareTo(LadderEntry l) => (l?.m_Experience ?? 0) - m_Experience;
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -102,10 +102,7 @@ namespace Server.Engines.ConPVP
|
|||
return null;
|
||||
}
|
||||
|
||||
public bool Contains(Mobile mob)
|
||||
{
|
||||
return Find(mob) != null;
|
||||
}
|
||||
public bool Contains(Mobile mob) => Find(mob) != null;
|
||||
|
||||
public void Broadcast(int hue, string message, string nonLocalOverhead, string localOverhead)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -240,15 +240,9 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, string text, int color, int borderColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -736,10 +736,7 @@ namespace Server.Engines.ConPVP
|
|||
return null;
|
||||
}
|
||||
|
||||
public int GetOptionIndex(string option)
|
||||
{
|
||||
return Array.IndexOf(Options, option);
|
||||
}
|
||||
public int GetOptionIndex(string option) => Array.IndexOf(Options, option);
|
||||
|
||||
public void ComputeOffsets()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace Server.Engines.ConPVP
|
|||
Register();
|
||||
}
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p)
|
||||
{
|
||||
return from.AccessLevel >= AccessLevel.GameMaster && base.AllowHousing(from, p);
|
||||
}
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => from.AccessLevel >= AccessLevel.GameMaster && base.AllowHousing(from, p);
|
||||
|
||||
public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
|
||||
{
|
||||
|
|
@ -58,9 +55,6 @@ namespace Server.Engines.ConPVP
|
|||
m.SendMessage("You have left a dueling safezone. Combat is now unrestricted.");
|
||||
}
|
||||
|
||||
public override bool CanUseStuckMenu(Mobile m)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CanUseStuckMenu(Mobile m) => false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -426,10 +426,7 @@ namespace Server.Engines.ConPVP
|
|||
Alert(arena, sb.ToString());
|
||||
}
|
||||
|
||||
private int ComputeCashAward()
|
||||
{
|
||||
return Participants.Count * m_PlayersPerParticipant * 2500;
|
||||
}
|
||||
private int ComputeCashAward() => Participants.Count * m_PlayersPerParticipant * 2500;
|
||||
|
||||
private void GiveAwards()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,65 +1,62 @@
|
|||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentBracketItem : Item
|
||||
{
|
||||
[Constructible]
|
||||
public TournamentBracketItem() : base(3774)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public TournamentBracketItem(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TournamentController Tournament{ get; set; }
|
||||
|
||||
public override string DefaultName => "tournament bracket";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
|
||||
}
|
||||
else
|
||||
{
|
||||
Tournament tourney = Tournament?.Tournament;
|
||||
|
||||
if (tourney != null)
|
||||
{
|
||||
from.CloseGump<TournamentBracketGump>();
|
||||
from.SendGump(new TournamentBracketGump(from, tourney, TourneyBracketGumpType.Index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Tournament);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = reader.ReadItem() as TournamentController;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentBracketItem : Item
|
||||
{
|
||||
[Constructible]
|
||||
public TournamentBracketItem() : base(3774) => Movable = false;
|
||||
|
||||
public TournamentBracketItem(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TournamentController Tournament{ get; set; }
|
||||
|
||||
public override string DefaultName => "tournament bracket";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
|
||||
}
|
||||
else
|
||||
{
|
||||
Tournament tourney = Tournament?.Tournament;
|
||||
|
||||
if (tourney != null)
|
||||
{
|
||||
from.CloseGump<TournamentBracketGump>();
|
||||
from.SendGump(new TournamentBracketGump(from, tourney, TourneyBracketGumpType.Index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Tournament);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = reader.ReadItem() as TournamentController;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +1,137 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentController : Item
|
||||
{
|
||||
private static List<TournamentController> m_Instances = new List<TournamentController>();
|
||||
|
||||
[Constructible]
|
||||
public TournamentController() : base(0x1B7A)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
|
||||
Tournament = new Tournament();
|
||||
m_Instances.Add(this);
|
||||
}
|
||||
|
||||
public TournamentController(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Tournament Tournament{ get; private set; }
|
||||
|
||||
public static bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < m_Instances.Count; ++i)
|
||||
{
|
||||
TournamentController controller = m_Instances[i];
|
||||
|
||||
if (controller?.Deleted == false && controller.Tournament != null &&
|
||||
controller.Tournament.Stage != TournamentStage.Inactive)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override string DefaultName => "tournament controller";
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null)
|
||||
{
|
||||
list.Add(new EditEntry(Tournament));
|
||||
|
||||
if (Tournament.CurrentStage == TournamentStage.Inactive)
|
||||
list.Add(new StartEntry(Tournament));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null)
|
||||
{
|
||||
from.CloseGump<PickRulesetGump>();
|
||||
from.CloseGump<RulesetGump>();
|
||||
from.SendGump(new PickRulesetGump(from, null, Tournament.Ruleset));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
Tournament.Serialize(writer);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = new Tournament(reader);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_Instances.Add(this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
m_Instances.Remove(this);
|
||||
}
|
||||
|
||||
private class EditEntry : ContextMenuEntry
|
||||
{
|
||||
private Tournament m_Tournament;
|
||||
|
||||
public EditEntry(Tournament tourney) : base(5101)
|
||||
{
|
||||
m_Tournament = tourney;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Owner.From.SendGump(new PropertiesGump(Owner.From, m_Tournament));
|
||||
}
|
||||
}
|
||||
|
||||
private class StartEntry : ContextMenuEntry
|
||||
{
|
||||
private Tournament m_Tournament;
|
||||
|
||||
public StartEntry(Tournament tourney) : base(5113)
|
||||
{
|
||||
m_Tournament = tourney;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Tournament.Stage == TournamentStage.Inactive)
|
||||
{
|
||||
m_Tournament.SignupStart = DateTime.UtcNow;
|
||||
m_Tournament.Stage = TournamentStage.Signup;
|
||||
m_Tournament.Participants.Clear();
|
||||
m_Tournament.Pyramid.Levels.Clear();
|
||||
m_Tournament.Alert("Hear ye! Hear ye!",
|
||||
"Tournament signup has opened. You can enter by signing up with the registrar.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.ContextMenus;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentController : Item
|
||||
{
|
||||
private static List<TournamentController> m_Instances = new List<TournamentController>();
|
||||
|
||||
[Constructible]
|
||||
public TournamentController() : base(0x1B7A)
|
||||
{
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
|
||||
Tournament = new Tournament();
|
||||
m_Instances.Add(this);
|
||||
}
|
||||
|
||||
public TournamentController(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Tournament Tournament{ get; private set; }
|
||||
|
||||
public static bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < m_Instances.Count; ++i)
|
||||
{
|
||||
TournamentController controller = m_Instances[i];
|
||||
|
||||
if (controller?.Deleted == false && controller.Tournament != null &&
|
||||
controller.Tournament.Stage != TournamentStage.Inactive)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override string DefaultName => "tournament controller";
|
||||
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null)
|
||||
{
|
||||
list.Add(new EditEntry(Tournament));
|
||||
|
||||
if (Tournament.CurrentStage == TournamentStage.Inactive)
|
||||
list.Add(new StartEntry(Tournament));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.AccessLevel >= AccessLevel.GameMaster && Tournament != null)
|
||||
{
|
||||
from.CloseGump<PickRulesetGump>();
|
||||
from.CloseGump<RulesetGump>();
|
||||
from.SendGump(new PickRulesetGump(from, null, Tournament.Ruleset));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
Tournament.Serialize(writer);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = new Tournament(reader);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_Instances.Add(this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
|
||||
m_Instances.Remove(this);
|
||||
}
|
||||
|
||||
private class EditEntry : ContextMenuEntry
|
||||
{
|
||||
private Tournament m_Tournament;
|
||||
|
||||
public EditEntry(Tournament tourney) : base(5101) => m_Tournament = tourney;
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
Owner.From.SendGump(new PropertiesGump(Owner.From, m_Tournament));
|
||||
}
|
||||
}
|
||||
|
||||
private class StartEntry : ContextMenuEntry
|
||||
{
|
||||
private Tournament m_Tournament;
|
||||
|
||||
public StartEntry(Tournament tourney) : base(5113) => m_Tournament = tourney;
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (m_Tournament.Stage == TournamentStage.Inactive)
|
||||
{
|
||||
m_Tournament.SignupStart = DateTime.UtcNow;
|
||||
m_Tournament.Stage = TournamentStage.Signup;
|
||||
m_Tournament.Participants.Clear();
|
||||
m_Tournament.Pyramid.Levels.Clear();
|
||||
m_Tournament.Alert("Hear ye! Hear ye!",
|
||||
"Tournament signup has opened. You can enter by signing up with the registrar.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,190 +1,187 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Ethics;
|
||||
using Server.Factions;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TourneyPyramid
|
||||
{
|
||||
public TourneyPyramid()
|
||||
{
|
||||
Levels = new List<PyramidLevel>();
|
||||
}
|
||||
|
||||
public List<PyramidLevel> Levels{ get; set; }
|
||||
|
||||
public void AddLevel(int partsPerMatch, List<TourneyParticipant> participants, GroupingType groupType, TourneyType tourneyType)
|
||||
{
|
||||
List<TourneyParticipant> copy = new List<TourneyParticipant>(participants);
|
||||
|
||||
if (groupType == GroupingType.Nearest || groupType == GroupingType.HighVsLow)
|
||||
copy.Sort();
|
||||
|
||||
PyramidLevel level = new PyramidLevel();
|
||||
|
||||
switch (tourneyType)
|
||||
{
|
||||
case TourneyType.RedVsBlue:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[2];
|
||||
|
||||
for (int i = 0; i < parts.Length; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
{
|
||||
List<Mobile> players = copy[i].Players;
|
||||
|
||||
for (int j = 0; j < players.Count; ++j)
|
||||
{
|
||||
Mobile mob = players[j];
|
||||
|
||||
if (mob.Kills >= 5)
|
||||
parts[0].Players.Add(mob);
|
||||
else
|
||||
parts[1].Players.Add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.Faction:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch];
|
||||
|
||||
for (int i = 0; i < parts.Length; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
{
|
||||
List<Mobile> players = copy[i].Players;
|
||||
|
||||
for (int j = 0; j < players.Count; ++j)
|
||||
{
|
||||
Mobile mob = players[j];
|
||||
|
||||
int index = -1;
|
||||
|
||||
if (partsPerMatch == 4)
|
||||
{
|
||||
Faction fac = Faction.Find(mob);
|
||||
|
||||
if (fac != null)
|
||||
index = fac.Definition.Sort;
|
||||
}
|
||||
else if (partsPerMatch == 2)
|
||||
{
|
||||
if (Ethic.Evil.IsEligible(mob))
|
||||
index = 0;
|
||||
else if (Ethic.Hero.IsEligible(mob)) index = 1;
|
||||
}
|
||||
|
||||
if (index < 0 || index >= partsPerMatch) index = i % partsPerMatch;
|
||||
|
||||
parts[index].Players.Add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.RandomTeam:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch];
|
||||
|
||||
for (int i = 0; i < partsPerMatch; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
parts[i % parts.Length].Players.AddRange(copy[i].Players);
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.FreeForAll:
|
||||
{
|
||||
level.Matches.Add(new TourneyMatch(copy));
|
||||
break;
|
||||
}
|
||||
case TourneyType.Standard:
|
||||
{
|
||||
if (partsPerMatch >= 2 && participants.Count % partsPerMatch == 1)
|
||||
{
|
||||
int lowAdvances = int.MaxValue;
|
||||
|
||||
for (int i = 0; i < participants.Count; ++i)
|
||||
{
|
||||
TourneyParticipant p = participants[i];
|
||||
|
||||
if (p.FreeAdvances < lowAdvances)
|
||||
lowAdvances = p.FreeAdvances;
|
||||
}
|
||||
|
||||
List<TourneyParticipant> toAdvance = new List<TourneyParticipant>();
|
||||
|
||||
for (int i = 0; i < participants.Count; ++i)
|
||||
{
|
||||
TourneyParticipant p = participants[i];
|
||||
|
||||
if (p.FreeAdvances == lowAdvances)
|
||||
toAdvance.Add(p);
|
||||
}
|
||||
|
||||
if (toAdvance.Count == 0)
|
||||
toAdvance = copy; // sanity
|
||||
|
||||
int idx = Utility.Random(toAdvance.Count);
|
||||
|
||||
toAdvance[idx].AddLog(
|
||||
"Advanced automatically due to an odd number of challengers.");
|
||||
level.FreeAdvance = toAdvance[idx];
|
||||
++level.FreeAdvance.FreeAdvances;
|
||||
copy.Remove(toAdvance[idx]);
|
||||
}
|
||||
|
||||
while (copy.Count >= partsPerMatch)
|
||||
{
|
||||
List<TourneyParticipant> thisMatch = new List<TourneyParticipant>();
|
||||
|
||||
for (int i = 0; i < partsPerMatch; ++i)
|
||||
{
|
||||
int idx = 0;
|
||||
|
||||
switch (groupType)
|
||||
{
|
||||
case GroupingType.HighVsLow:
|
||||
idx = i * (copy.Count - 1) / (partsPerMatch - 1);
|
||||
break;
|
||||
case GroupingType.Nearest:
|
||||
idx = 0;
|
||||
break;
|
||||
case GroupingType.Random:
|
||||
idx = Utility.Random(copy.Count);
|
||||
break;
|
||||
}
|
||||
|
||||
thisMatch.Add(copy[idx]);
|
||||
copy.RemoveAt(idx);
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(thisMatch));
|
||||
}
|
||||
|
||||
if (copy.Count > 1)
|
||||
level.Matches.Add(new TourneyMatch(copy));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Levels.Add(level);
|
||||
}
|
||||
}
|
||||
|
||||
public class PyramidLevel
|
||||
{
|
||||
public List<TourneyMatch> Matches{ get; set; } = new List<TourneyMatch>();
|
||||
public TourneyParticipant FreeAdvance{ get; set; }
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Server.Ethics;
|
||||
using Server.Factions;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TourneyPyramid
|
||||
{
|
||||
public TourneyPyramid() => Levels = new List<PyramidLevel>();
|
||||
|
||||
public List<PyramidLevel> Levels{ get; set; }
|
||||
|
||||
public void AddLevel(int partsPerMatch, List<TourneyParticipant> participants, GroupingType groupType, TourneyType tourneyType)
|
||||
{
|
||||
List<TourneyParticipant> copy = new List<TourneyParticipant>(participants);
|
||||
|
||||
if (groupType == GroupingType.Nearest || groupType == GroupingType.HighVsLow)
|
||||
copy.Sort();
|
||||
|
||||
PyramidLevel level = new PyramidLevel();
|
||||
|
||||
switch (tourneyType)
|
||||
{
|
||||
case TourneyType.RedVsBlue:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[2];
|
||||
|
||||
for (int i = 0; i < parts.Length; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
{
|
||||
List<Mobile> players = copy[i].Players;
|
||||
|
||||
for (int j = 0; j < players.Count; ++j)
|
||||
{
|
||||
Mobile mob = players[j];
|
||||
|
||||
if (mob.Kills >= 5)
|
||||
parts[0].Players.Add(mob);
|
||||
else
|
||||
parts[1].Players.Add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.Faction:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch];
|
||||
|
||||
for (int i = 0; i < parts.Length; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
{
|
||||
List<Mobile> players = copy[i].Players;
|
||||
|
||||
for (int j = 0; j < players.Count; ++j)
|
||||
{
|
||||
Mobile mob = players[j];
|
||||
|
||||
int index = -1;
|
||||
|
||||
if (partsPerMatch == 4)
|
||||
{
|
||||
Faction fac = Faction.Find(mob);
|
||||
|
||||
if (fac != null)
|
||||
index = fac.Definition.Sort;
|
||||
}
|
||||
else if (partsPerMatch == 2)
|
||||
{
|
||||
if (Ethic.Evil.IsEligible(mob))
|
||||
index = 0;
|
||||
else if (Ethic.Hero.IsEligible(mob)) index = 1;
|
||||
}
|
||||
|
||||
if (index < 0 || index >= partsPerMatch) index = i % partsPerMatch;
|
||||
|
||||
parts[index].Players.Add(mob);
|
||||
}
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.RandomTeam:
|
||||
{
|
||||
TourneyParticipant[] parts = new TourneyParticipant[partsPerMatch];
|
||||
|
||||
for (int i = 0; i < partsPerMatch; ++i)
|
||||
parts[i] = new TourneyParticipant(new List<Mobile>());
|
||||
|
||||
for (int i = 0; i < copy.Count; ++i)
|
||||
parts[i % parts.Length].Players.AddRange(copy[i].Players);
|
||||
|
||||
level.Matches.Add(new TourneyMatch(new List<TourneyParticipant>(parts)));
|
||||
break;
|
||||
}
|
||||
case TourneyType.FreeForAll:
|
||||
{
|
||||
level.Matches.Add(new TourneyMatch(copy));
|
||||
break;
|
||||
}
|
||||
case TourneyType.Standard:
|
||||
{
|
||||
if (partsPerMatch >= 2 && participants.Count % partsPerMatch == 1)
|
||||
{
|
||||
int lowAdvances = int.MaxValue;
|
||||
|
||||
for (int i = 0; i < participants.Count; ++i)
|
||||
{
|
||||
TourneyParticipant p = participants[i];
|
||||
|
||||
if (p.FreeAdvances < lowAdvances)
|
||||
lowAdvances = p.FreeAdvances;
|
||||
}
|
||||
|
||||
List<TourneyParticipant> toAdvance = new List<TourneyParticipant>();
|
||||
|
||||
for (int i = 0; i < participants.Count; ++i)
|
||||
{
|
||||
TourneyParticipant p = participants[i];
|
||||
|
||||
if (p.FreeAdvances == lowAdvances)
|
||||
toAdvance.Add(p);
|
||||
}
|
||||
|
||||
if (toAdvance.Count == 0)
|
||||
toAdvance = copy; // sanity
|
||||
|
||||
int idx = Utility.Random(toAdvance.Count);
|
||||
|
||||
toAdvance[idx].AddLog(
|
||||
"Advanced automatically due to an odd number of challengers.");
|
||||
level.FreeAdvance = toAdvance[idx];
|
||||
++level.FreeAdvance.FreeAdvances;
|
||||
copy.Remove(toAdvance[idx]);
|
||||
}
|
||||
|
||||
while (copy.Count >= partsPerMatch)
|
||||
{
|
||||
List<TourneyParticipant> thisMatch = new List<TourneyParticipant>();
|
||||
|
||||
for (int i = 0; i < partsPerMatch; ++i)
|
||||
{
|
||||
int idx = 0;
|
||||
|
||||
switch (groupType)
|
||||
{
|
||||
case GroupingType.HighVsLow:
|
||||
idx = i * (copy.Count - 1) / (partsPerMatch - 1);
|
||||
break;
|
||||
case GroupingType.Nearest:
|
||||
idx = 0;
|
||||
break;
|
||||
case GroupingType.Random:
|
||||
idx = Utility.Random(copy.Count);
|
||||
break;
|
||||
}
|
||||
|
||||
thisMatch.Add(copy[idx]);
|
||||
copy.RemoveAt(idx);
|
||||
}
|
||||
|
||||
level.Matches.Add(new TourneyMatch(thisMatch));
|
||||
}
|
||||
|
||||
if (copy.Count > 1)
|
||||
level.Matches.Add(new TourneyMatch(copy));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Levels.Add(level);
|
||||
}
|
||||
}
|
||||
|
||||
public class PyramidLevel
|
||||
{
|
||||
public List<TourneyMatch> Matches{ get; set; } = new List<TourneyMatch>();
|
||||
public TourneyParticipant FreeAdvance{ get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,149 +1,146 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Factions;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentSignupItem : Item
|
||||
{
|
||||
[Constructible]
|
||||
public TournamentSignupItem() : base(4029)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public TournamentSignupItem(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TournamentController Tournament{ get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Registrar{ get; set; }
|
||||
|
||||
public override string DefaultName => "tournament signup book";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
|
||||
}
|
||||
else
|
||||
{
|
||||
Tournament tourney = Tournament?.Tournament;
|
||||
|
||||
if (tourney == null)
|
||||
return;
|
||||
|
||||
if (Registrar != null)
|
||||
Registrar.Direction = Registrar.GetDirectionTo(this);
|
||||
|
||||
switch (tourney.Stage)
|
||||
{
|
||||
case TournamentStage.Fighting:
|
||||
{
|
||||
if (Registrar != null)
|
||||
{
|
||||
if (tourney.HasParticipant(from))
|
||||
Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Excuse me? You are already signed up.", from.NetState);
|
||||
else
|
||||
Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "The tournament has already begun. You are too late to signup now.",
|
||||
from.NetState);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Inactive:
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "The tournament is closed.", from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Signup:
|
||||
{
|
||||
Ladder ladder = Ladder.Instance;
|
||||
LadderEntry entry = ladder?.Find(from);
|
||||
|
||||
if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (tourney.IsFactionRestricted && Faction.Find(from) == null)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Only those who have declared their faction allegiance may participate.",
|
||||
from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (from.HasGump<AcceptTeamGump>())
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You must first respond to the offer I've given you.", from.NetState);
|
||||
}
|
||||
else if (from.HasGump<AcceptDuelGump>())
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You must first cancel your duel offer.", from.NetState);
|
||||
}
|
||||
else if (from is PlayerMobile mobile && mobile.DuelContext != null)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You are already participating in a duel.", mobile.NetState);
|
||||
}
|
||||
else if (!tourney.HasParticipant(from))
|
||||
{
|
||||
from.CloseGump<ConfirmSignupGump>();
|
||||
from.SendGump(new ConfirmSignupGump(from, Registrar, tourney, new List<Mobile> { from }));
|
||||
}
|
||||
else
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have already entered this tournament.", from.NetState);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Tournament);
|
||||
writer.Write(Registrar);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = reader.ReadItem() as TournamentController;
|
||||
Registrar = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Server.Factions;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.ConPVP
|
||||
{
|
||||
public class TournamentSignupItem : Item
|
||||
{
|
||||
[Constructible]
|
||||
public TournamentSignupItem() : base(4029) => Movable = false;
|
||||
|
||||
public TournamentSignupItem(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public TournamentController Tournament{ get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Registrar{ get; set; }
|
||||
|
||||
public override string DefaultName => "tournament signup book";
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
|
||||
}
|
||||
else
|
||||
{
|
||||
Tournament tourney = Tournament?.Tournament;
|
||||
|
||||
if (tourney == null)
|
||||
return;
|
||||
|
||||
if (Registrar != null)
|
||||
Registrar.Direction = Registrar.GetDirectionTo(this);
|
||||
|
||||
switch (tourney.Stage)
|
||||
{
|
||||
case TournamentStage.Fighting:
|
||||
{
|
||||
if (Registrar != null)
|
||||
{
|
||||
if (tourney.HasParticipant(from))
|
||||
Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Excuse me? You are already signed up.", from.NetState);
|
||||
else
|
||||
Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "The tournament has already begun. You are too late to signup now.",
|
||||
from.NetState);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Inactive:
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "The tournament is closed.", from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Signup:
|
||||
{
|
||||
Ladder ladder = Ladder.Instance;
|
||||
LadderEntry entry = ladder?.Find(from);
|
||||
|
||||
if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (tourney.IsFactionRestricted && Faction.Find(from) == null)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Only those who have declared their faction allegiance may participate.",
|
||||
from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (from.HasGump<AcceptTeamGump>())
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You must first respond to the offer I've given you.", from.NetState);
|
||||
}
|
||||
else if (from.HasGump<AcceptDuelGump>())
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You must first cancel your duel offer.", from.NetState);
|
||||
}
|
||||
else if (from is PlayerMobile mobile && mobile.DuelContext != null)
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "You are already participating in a duel.", mobile.NetState);
|
||||
}
|
||||
else if (!tourney.HasParticipant(from))
|
||||
{
|
||||
from.CloseGump<ConfirmSignupGump>();
|
||||
from.SendGump(new ConfirmSignupGump(from, Registrar, tourney, new List<Mobile> { from }));
|
||||
}
|
||||
else
|
||||
{
|
||||
Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have already entered this tournament.", from.NetState);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Tournament);
|
||||
writer.Write(Registrar);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Tournament = reader.ReadItem() as TournamentController;
|
||||
Registrar = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -81,10 +81,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public int CompareTo(TourneyParticipant p)
|
||||
{
|
||||
return p.TotalLadderXP - TotalLadderXP;
|
||||
}
|
||||
public int CompareTo(TourneyParticipant p) => p.TotalLadderXP - TotalLadderXP;
|
||||
|
||||
public void AddLog(string text)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,10 +4,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
public class CraftGroupCol : CollectionBase
|
||||
{
|
||||
public int Add(CraftGroup craftGroup)
|
||||
{
|
||||
return List.Add(craftGroup);
|
||||
}
|
||||
public int Add(CraftGroup craftGroup) => List.Add(craftGroup);
|
||||
|
||||
public void Remove(int index)
|
||||
{
|
||||
|
|
@ -20,10 +17,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public CraftGroup GetAt(int index)
|
||||
{
|
||||
return (CraftGroup)List[index];
|
||||
}
|
||||
public CraftGroup GetAt(int index) => (CraftGroup)List[index];
|
||||
|
||||
public int SearchFor(TextDefinition groupName)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -339,10 +339,7 @@ namespace Server.Engines.Craft
|
|||
return craftGroupCol.Count;
|
||||
}
|
||||
|
||||
public static int GetButtonID(int type, int index)
|
||||
{
|
||||
return 1 + type + index * 7;
|
||||
}
|
||||
public static int GetButtonID(int type, int index) => 1 + type + index * 7;
|
||||
|
||||
public void CraftItem(CraftItem item)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -424,10 +424,8 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
|
||||
public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount,
|
||||
ConsumeType consumeType, ref object message)
|
||||
{
|
||||
return ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false);
|
||||
}
|
||||
ConsumeType consumeType, ref object message) =>
|
||||
ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false);
|
||||
|
||||
public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount,
|
||||
ConsumeType consumeType, ref object message, bool isFailure)
|
||||
|
|
@ -639,10 +637,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
private int CheckHueGrouping(Item a, Item b)
|
||||
{
|
||||
return b.Hue.CompareTo(a.Hue);
|
||||
}
|
||||
private int CheckHueGrouping(Item a, Item b) => b.Hue.CompareTo(a.Hue);
|
||||
|
||||
public double GetExceptionalChance(CraftSystem system, double chance, Mobile from)
|
||||
{
|
||||
|
|
@ -686,10 +681,8 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
|
||||
public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality,
|
||||
ref bool allRequiredSkills)
|
||||
{
|
||||
return CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true);
|
||||
}
|
||||
ref bool allRequiredSkills) =>
|
||||
CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true);
|
||||
|
||||
public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality,
|
||||
ref bool allRequiredSkills, bool gainSkills)
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
public class CraftItemCol : CollectionBase
|
||||
{
|
||||
public int Add(CraftItem craftItem)
|
||||
{
|
||||
return List.Add(craftItem);
|
||||
}
|
||||
public int Add(CraftItem craftItem) => List.Add(craftItem);
|
||||
|
||||
public void Remove(int index)
|
||||
{
|
||||
|
|
@ -21,10 +18,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public CraftItem GetAt(int index)
|
||||
{
|
||||
return (CraftItem)List[index];
|
||||
}
|
||||
public CraftItem GetAt(int index) => (CraftItem)List[index];
|
||||
|
||||
public CraftItem SearchForSubclass(Type type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ namespace Server.Engines.Craft
|
|||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class CraftItemIDAttribute : Attribute
|
||||
{
|
||||
public CraftItemIDAttribute(int itemID)
|
||||
{
|
||||
ItemID = itemID;
|
||||
}
|
||||
public CraftItemIDAttribute(int itemID) => ItemID = itemID;
|
||||
|
||||
public int ItemID{ get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public CraftRes GetAt(int index)
|
||||
{
|
||||
return (CraftRes)List[index];
|
||||
}
|
||||
public CraftRes GetAt(int index) => (CraftRes)List[index];
|
||||
}
|
||||
}
|
||||
|
|
@ -20,9 +20,6 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public CraftSkill GetAt(int index)
|
||||
{
|
||||
return (CraftSkill)List[index];
|
||||
}
|
||||
public CraftSkill GetAt(int index) => (CraftSkill)List[index];
|
||||
}
|
||||
}
|
||||
|
|
@ -5,10 +5,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
public class CraftSubResCol : CollectionBase
|
||||
{
|
||||
public CraftSubResCol()
|
||||
{
|
||||
Init = false;
|
||||
}
|
||||
public CraftSubResCol() => Init = false;
|
||||
|
||||
public bool Init{ get; set; }
|
||||
|
||||
|
|
@ -34,10 +31,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public CraftSubRes GetAt(int index)
|
||||
{
|
||||
return (CraftSubRes)List[index];
|
||||
}
|
||||
public CraftSubRes GetAt(int index) => (CraftSubRes)List[index];
|
||||
|
||||
public CraftSubRes SearchFor(Type type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,10 +65,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public abstract double GetChanceAtMin(CraftItem item);
|
||||
|
||||
public virtual bool RetainsColorFrom(CraftItem item, Type type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public virtual bool RetainsColorFrom(CraftItem item, Type type) => false;
|
||||
|
||||
public CraftContext GetContext(Mobile m)
|
||||
{
|
||||
|
|
@ -92,10 +89,7 @@ namespace Server.Engines.Craft
|
|||
GetContext(m)?.OnMade(item);
|
||||
}
|
||||
|
||||
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem) => true;
|
||||
|
||||
public void CreateItem(Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem)
|
||||
{
|
||||
|
|
@ -122,22 +116,16 @@ namespace Server.Engines.Craft
|
|||
|
||||
|
||||
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
|
||||
Type typeRes, TextDefinition nameRes, int amount)
|
||||
{
|
||||
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
|
||||
}
|
||||
Type typeRes, TextDefinition nameRes, int amount) =>
|
||||
AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
|
||||
|
||||
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
|
||||
Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
|
||||
{
|
||||
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
|
||||
}
|
||||
Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) =>
|
||||
AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
|
||||
|
||||
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
|
||||
double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
|
||||
{
|
||||
return AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
|
||||
}
|
||||
double maxSkill, Type typeRes, TextDefinition nameRes, int amount) =>
|
||||
AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
|
||||
|
||||
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
|
||||
double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
|
||||
|
|
|
|||
|
|
@ -37,21 +37,11 @@ namespace Server.Engines.Craft
|
|||
m_Deed = deed;
|
||||
}
|
||||
|
||||
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits)
|
||||
{
|
||||
// 40% - (1% per hp lost) - (1% per 10 craft skill)
|
||||
return 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
|
||||
}
|
||||
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits) => 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
|
||||
|
||||
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits)
|
||||
{
|
||||
return GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100);
|
||||
}
|
||||
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits) => GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100);
|
||||
|
||||
private int GetRepairDifficulty(int curHits, int maxHits)
|
||||
{
|
||||
return (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250;
|
||||
}
|
||||
private int GetRepairDifficulty(int curHits, int maxHits) => (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250;
|
||||
|
||||
private bool CheckRepairDifficulty(Mobile mob, SkillName skill, int curHits, int maxHits)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefAlchemy());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
@ -40,10 +37,7 @@ namespace Server.Engines.Craft
|
|||
from.PlaySound(0x242);
|
||||
}
|
||||
|
||||
public static bool IsPotion(Type type)
|
||||
{
|
||||
return typeofPotion.IsAssignableFrom(type);
|
||||
}
|
||||
public static bool IsPotion(Type type) => typeofPotion.IsAssignableFrom(type);
|
||||
|
||||
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
|
||||
bool makersMark, CraftItem item)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public static void CheckAnvilAndForge(Mobile from, int range, out bool anvil, out bool forge)
|
||||
{
|
||||
|
|
@ -773,10 +770,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7))
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent;
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.5;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,10 +17,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefCarpentry());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.5;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,10 +17,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefCartography());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefGlassblowing());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return item.ItemType == typeof(HollowPrism) ? 0.5 : 0.0;
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => item.ItemType == typeof(HollowPrism) ? 0.5 : 0.0;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
@ -102,10 +99,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7))
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefInscription());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type typeItem)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,15 +18,9 @@ namespace Server.Engines.Craft
|
|||
|
||||
public static CraftSystem CraftSystem => m_CraftSystem ?? (m_CraftSystem = new DefMasonry());
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.0;
|
||||
|
||||
public override bool RetainsColorFrom(CraftItem item, Type type)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public override bool RetainsColorFrom(CraftItem item, Type type) => true;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
@ -119,10 +113,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7))
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7)) => m_From = from;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
|
||||
|
||||
public override double GetChanceAtMin(CraftItem item)
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
public override double GetChanceAtMin(CraftItem item) => 0.5;
|
||||
|
||||
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -473,10 +473,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
private TrapCraft m_TrapCraft;
|
||||
|
||||
public ContainerTarget(TrapCraft trapCraft) : base(-1, false, TargetFlags.None)
|
||||
{
|
||||
m_TrapCraft = trapCraft;
|
||||
}
|
||||
public ContainerTarget(TrapCraft trapCraft) : base(-1, false, TargetFlags.None) => m_TrapCraft = trapCraft;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -368,12 +368,10 @@ namespace Server.Engines.Doom
|
|||
}
|
||||
}
|
||||
|
||||
private static bool IsValidDamagable(Mobile m)
|
||||
{
|
||||
return m?.Deleted == false &&
|
||||
(m.Player && m.Alive ||
|
||||
m is BaseCreature bc && (bc.Controlled || bc.Summoned) && !bc.IsDeadBondedPet);
|
||||
}
|
||||
private static bool IsValidDamagable(Mobile m) =>
|
||||
m?.Deleted == false &&
|
||||
(m.Player && m.Alive ||
|
||||
m is BaseCreature bc && (bc.Controlled || bc.Summoned) && !bc.IsDeadBondedPet);
|
||||
|
||||
public static void MoveMobileOut(Mobile m)
|
||||
{
|
||||
|
|
@ -388,15 +386,9 @@ namespace Server.Engines.Doom
|
|||
}
|
||||
}
|
||||
|
||||
public static bool AniSafe(Mobile m)
|
||||
{
|
||||
return m?.BodyMod == 0 && m.Alive && !TransformationSpellHelper.UnderTransformation(m);
|
||||
}
|
||||
public static bool AniSafe(Mobile m) => m?.BodyMod == 0 && m.Alive && !TransformationSpellHelper.UnderTransformation(m);
|
||||
|
||||
public static IEntity ZAdjustedIEFromMobile(Mobile m, int ZDelta)
|
||||
{
|
||||
return new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + ZDelta), m.Map);
|
||||
}
|
||||
public static IEntity ZAdjustedIEFromMobile(Mobile m, int ZDelta) => new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + ZDelta), m.Map);
|
||||
|
||||
public static void DoDamage(Mobile m, int min, int max, bool poison)
|
||||
{
|
||||
|
|
@ -407,20 +399,11 @@ namespace Server.Engines.Doom
|
|||
}
|
||||
}
|
||||
|
||||
public static Point3D RandomPointIn(Point3D point, int range)
|
||||
{
|
||||
return RandomPointIn(point.X - range, point.Y - range, range * 2, range * 2, point.Z);
|
||||
}
|
||||
public static Point3D RandomPointIn(Point3D point, int range) => RandomPointIn(point.X - range, point.Y - range, range * 2, range * 2, point.Z);
|
||||
|
||||
public static Point3D RandomPointIn(Rectangle2D rect, int z)
|
||||
{
|
||||
return RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z);
|
||||
}
|
||||
public static Point3D RandomPointIn(Rectangle2D rect, int z) => RandomPointIn(rect.X, rect.Y, rect.Height, rect.Width, z);
|
||||
|
||||
public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z)
|
||||
{
|
||||
return new Point3D(Utility.Random(x, x2), Utility.Random(y, y2), z);
|
||||
}
|
||||
public static Point3D RandomPointIn(int x, int y, int x2, int y2, int z) => new Point3D(Utility.Random(x, x2), Utility.Random(y, y2), z);
|
||||
|
||||
public static void PlaySounds(Point3D location, int[] sounds)
|
||||
{
|
||||
|
|
@ -503,10 +486,7 @@ namespace Server.Engines.Doom
|
|||
m_Controller = Controller;
|
||||
}
|
||||
|
||||
private int Rock()
|
||||
{
|
||||
return 0x1363 + Utility.Random(0, 11);
|
||||
}
|
||||
private int Rock() => 0x1363 + Utility.Random(0, 11);
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
@ -571,10 +551,8 @@ namespace Server.Engines.Doom
|
|||
private Mobile m;
|
||||
|
||||
public LampRoomKickTimer(Mobile player)
|
||||
: base(TimeSpan.FromSeconds(.25))
|
||||
{
|
||||
: base(TimeSpan.FromSeconds(.25)) =>
|
||||
m = player;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,10 +69,7 @@ namespace Server.Engines.Doom
|
|||
kick.Start();
|
||||
}
|
||||
|
||||
public override bool OnSkillUse(Mobile m, int Skill) /* just in case */
|
||||
{
|
||||
return m_Controller.Successful != null && (m.AccessLevel != AccessLevel.Player || m == m_Controller.Successful);
|
||||
}
|
||||
public override bool OnSkillUse(Mobile m, int Skill) /* just in case */ => m_Controller.Successful != null && (m.AccessLevel != AccessLevel.Player || m == m_Controller.Successful);
|
||||
}
|
||||
|
||||
public class LeverPuzzleRegion : BaseRegion
|
||||
|
|
|
|||
|
|
@ -24,10 +24,7 @@ namespace Server.Ethics
|
|||
|
||||
protected PlayerCollection m_Players;
|
||||
|
||||
public Ethic()
|
||||
{
|
||||
m_Players = new PlayerCollection();
|
||||
}
|
||||
public Ethic() => m_Players = new PlayerCollection();
|
||||
|
||||
public EthicDefinition Definition => m_Definition;
|
||||
|
||||
|
|
@ -84,10 +81,7 @@ namespace Server.Ethics
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool IsImbued(Item item)
|
||||
{
|
||||
return IsImbued(item, false);
|
||||
}
|
||||
public static bool IsImbued(Item item) => IsImbued(item, false);
|
||||
|
||||
public static bool IsImbued(Item item, bool recurse)
|
||||
{
|
||||
|
|
@ -166,15 +160,9 @@ namespace Server.Ethics
|
|||
}
|
||||
}
|
||||
|
||||
public static Ethic Find(Mobile mob)
|
||||
{
|
||||
return Find(mob, false, false);
|
||||
}
|
||||
public static Ethic Find(Mobile mob) => Find(mob, false, false);
|
||||
|
||||
public static Ethic Find(Mobile mob, bool inherit)
|
||||
{
|
||||
return Find(mob, inherit, false);
|
||||
}
|
||||
public static Ethic Find(Mobile mob, bool inherit) => Find(mob, inherit, false);
|
||||
|
||||
public static Ethic Find(Mobile mob, bool inherit, bool allegiance)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@ namespace Server.Ethics
|
|||
}
|
||||
|
||||
public EthicsPersistance(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
: base(serial) =>
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static EthicsPersistance Instance{ get; private set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -79,10 +79,7 @@ namespace Server.Ethics
|
|||
}
|
||||
}
|
||||
|
||||
public static Player Find(Mobile mob)
|
||||
{
|
||||
return Find(mob, false);
|
||||
}
|
||||
public static Player Find(Mobile mob) => Find(mob, false);
|
||||
|
||||
public static Player Find(Mobile mob, bool inherit)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,15 +7,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class Blight : Power
|
||||
{
|
||||
public Blight()
|
||||
{
|
||||
public Blight() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
15,
|
||||
"Blight",
|
||||
"Velgo Ontawl",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class SummonFamiliar : Power
|
||||
{
|
||||
public SummonFamiliar()
|
||||
{
|
||||
public SummonFamiliar() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
5,
|
||||
"Summon Familiar",
|
||||
"Trubechs Vingir",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class UnholyItem : Power
|
||||
{
|
||||
public UnholyItem()
|
||||
{
|
||||
public UnholyItem() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
5,
|
||||
"Unholy Item",
|
||||
"Vidda K'balc",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class UnholySense : Power
|
||||
{
|
||||
public UnholySense()
|
||||
{
|
||||
public UnholySense() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
0,
|
||||
"Unholy Sense",
|
||||
"Drewrok Velgo",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,15 +4,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class UnholyShield : Power
|
||||
{
|
||||
public UnholyShield()
|
||||
{
|
||||
public UnholyShield() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
20,
|
||||
"Unholy Shield",
|
||||
"Velgo K'blac",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class UnholySteed : Power
|
||||
{
|
||||
public UnholySteed()
|
||||
{
|
||||
public UnholySteed() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
30,
|
||||
"Unholy Steed",
|
||||
"Trubechs Yeliab",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class UnholyWord : Power
|
||||
{
|
||||
public UnholyWord()
|
||||
{
|
||||
public UnholyWord() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
100,
|
||||
"Unholy Word",
|
||||
"Velgo Oostrac",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@ namespace Server.Ethics.Evil
|
|||
{
|
||||
public sealed class VileBlade : Power
|
||||
{
|
||||
public VileBlade()
|
||||
{
|
||||
public VileBlade() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
10,
|
||||
"Vile Blade",
|
||||
"Velgo Reyam",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,15 +7,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class Bless : Power
|
||||
{
|
||||
public Bless()
|
||||
{
|
||||
public Bless() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
15,
|
||||
"Bless",
|
||||
"Erstok Ontawl",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolyBlade : Power
|
||||
{
|
||||
public HolyBlade()
|
||||
{
|
||||
public HolyBlade() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
10,
|
||||
"Holy Blade",
|
||||
"Erstok Reyam",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolyItem : Power
|
||||
{
|
||||
public HolyItem()
|
||||
{
|
||||
public HolyItem() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
5,
|
||||
"Holy Item",
|
||||
"Vidda K'balc",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolySense : Power
|
||||
{
|
||||
public HolySense()
|
||||
{
|
||||
public HolySense() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
0,
|
||||
"Holy Sense",
|
||||
"Drewrok Erstok",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,15 +4,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolyShield : Power
|
||||
{
|
||||
public HolyShield()
|
||||
{
|
||||
public HolyShield() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
20,
|
||||
"Holy Shield",
|
||||
"Erstok K'blac",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolySteed : Power
|
||||
{
|
||||
public HolySteed()
|
||||
{
|
||||
public HolySteed() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
30,
|
||||
"Holy Steed",
|
||||
"Trubechs Yeliab",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class HolyWord : Power
|
||||
{
|
||||
public HolyWord()
|
||||
{
|
||||
public HolyWord() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
100,
|
||||
"Holy Word",
|
||||
"Erstok Oostrac",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@ namespace Server.Ethics.Hero
|
|||
{
|
||||
public sealed class SummonFamiliar : Power
|
||||
{
|
||||
public SummonFamiliar()
|
||||
{
|
||||
public SummonFamiliar() =>
|
||||
m_Definition = new PowerDefinition(
|
||||
5,
|
||||
"Summon Familiar",
|
||||
"Trubechs Vingir",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -216,20 +216,11 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsCandidate(Mobile mob)
|
||||
{
|
||||
return FindCandidate(mob) != null;
|
||||
}
|
||||
public bool IsCandidate(Mobile mob) => FindCandidate(mob) != null;
|
||||
|
||||
public bool CanVote(Mobile mob)
|
||||
{
|
||||
return CurrentState == ElectionState.Election && !HasVoted(mob);
|
||||
}
|
||||
public bool CanVote(Mobile mob) => CurrentState == ElectionState.Election && !HasVoted(mob);
|
||||
|
||||
public bool HasVoted(Mobile mob)
|
||||
{
|
||||
return FindVoter(mob) != null;
|
||||
}
|
||||
public bool HasVoted(Mobile mob) => FindVoter(mob) != null;
|
||||
|
||||
public Candidate FindCandidate(Mobile mob)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ namespace Server.Factions
|
|||
private FactionDefinition m_Definition;
|
||||
public int ZeroRankOffset;
|
||||
|
||||
public Faction()
|
||||
{
|
||||
State = new FactionState(this);
|
||||
}
|
||||
public Faction() => State = new FactionState(this);
|
||||
|
||||
public StrongholdRegion StrongholdRegion{ get; set; }
|
||||
|
||||
|
|
@ -88,10 +85,7 @@ namespace Server.Factions
|
|||
|
||||
public static List<Faction> Factions => Reflector.Factions;
|
||||
|
||||
public int CompareTo(Faction f)
|
||||
{
|
||||
return m_Definition.Sort - (f?.m_Definition.Sort ?? 0);
|
||||
}
|
||||
public int CompareTo(Faction f) => m_Definition.Sort - (f?.m_Definition.Sort ?? 0);
|
||||
|
||||
public void Broadcast(string text)
|
||||
{
|
||||
|
|
@ -505,10 +499,7 @@ namespace Server.Factions
|
|||
return mob.AccessLevel >= AccessLevel.GameMaster || mob == Commander;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return m_Definition.FriendlyName;
|
||||
}
|
||||
public override string ToString() => m_Definition.FriendlyName;
|
||||
|
||||
public static bool CheckLeaveTimer(Mobile mob)
|
||||
{
|
||||
|
|
@ -1160,10 +1151,7 @@ namespace Server.Factions
|
|||
{
|
||||
private Faction m_Faction;
|
||||
|
||||
public BroadcastPrompt(Faction faction)
|
||||
{
|
||||
m_Faction = faction;
|
||||
}
|
||||
public BroadcastPrompt(Faction faction) => m_Faction = faction;
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
|
|
@ -1184,10 +1172,7 @@ namespace Server.Factions
|
|||
public Timer m_Timer;
|
||||
}
|
||||
|
||||
public static bool InSkillLoss(Mobile mob)
|
||||
{
|
||||
return m_SkillLoss.ContainsKey(mob);
|
||||
}
|
||||
public static bool InSkillLoss(Mobile mob) => m_SkillLoss.ContainsKey(mob);
|
||||
|
||||
public static void ApplySkillLoss(Mobile mob)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,9 +67,6 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
private static bool CheckExistance(Point3D loc, Map facet, Type type)
|
||||
{
|
||||
return facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
|
||||
}
|
||||
private static bool CheckExistance(Point3D loc, Map facet, Type type) => facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
|
||||
}
|
||||
}
|
||||
|
|
@ -76,10 +76,7 @@ namespace Server.Factions
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool IsQualified(Mobile mob, MerchantTitle title)
|
||||
{
|
||||
return IsQualified(mob, GetInfo(title));
|
||||
}
|
||||
public static bool IsQualified(Mobile mob, MerchantTitle title) => IsQualified(mob, GetInfo(title));
|
||||
|
||||
public static bool IsQualified(Mobile mob, MerchantTitleInfo info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,10 +14,7 @@ namespace Server.Factions
|
|||
base.Delete();
|
||||
}
|
||||
|
||||
public FactionPersistance(Serial serial) : base(serial)
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
public FactionPersistance(Serial serial) : base(serial) => Instance = this;
|
||||
|
||||
public static FactionPersistance Instance{ get; private set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -241,10 +241,7 @@ namespace Server.Factions
|
|||
|
||||
public bool IsActive{ get; set; }
|
||||
|
||||
public int CompareTo(PlayerState ps)
|
||||
{
|
||||
return (ps?.m_KillPoints ?? 0) - m_KillPoints;
|
||||
}
|
||||
public int CompareTo(PlayerState ps) => (ps?.m_KillPoints ?? 0) - m_KillPoints;
|
||||
|
||||
public bool CanGiveSilverTo(Mobile mob)
|
||||
{
|
||||
|
|
@ -295,9 +292,6 @@ namespace Server.Factions
|
|||
writer.Write(Leaving);
|
||||
}
|
||||
|
||||
public static PlayerState Find(Mobile mob)
|
||||
{
|
||||
return mob is PlayerMobile mobile ? mobile.FactionPlayerState : null;
|
||||
}
|
||||
public static PlayerState Find(Mobile mob) => mob is PlayerMobile mobile ? mobile.FactionPlayerState : null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@ namespace Server.Factions
|
|||
return Faction.Find(m, true, true) != null;
|
||||
}
|
||||
|
||||
public override bool AllowHousing(Mobile from, Point3D p)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool AllowHousing(Mobile from, Point3D p) => false;
|
||||
}
|
||||
}
|
||||
|
|
@ -132,10 +132,7 @@ namespace Server.Factions
|
|||
|
||||
public static List<Town> Towns => Reflector.Towns;
|
||||
|
||||
public int CompareTo(Town other)
|
||||
{
|
||||
return Definition.Sort - (other?.Definition.Sort ?? 0);
|
||||
}
|
||||
public int CompareTo(Town other) => Definition.Sort - (other?.Definition.Sort ?? 0);
|
||||
|
||||
public static Town FromRegion(Region reg)
|
||||
{
|
||||
|
|
@ -379,17 +376,13 @@ namespace Server.Factions
|
|||
CommandSystem.Register("GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand);
|
||||
}
|
||||
|
||||
public bool IsSheriff(Mobile mob)
|
||||
{
|
||||
return mob?.Deleted == false &&
|
||||
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff);
|
||||
}
|
||||
public bool IsSheriff(Mobile mob) =>
|
||||
mob?.Deleted == false &&
|
||||
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff);
|
||||
|
||||
public bool IsFinance(Mobile mob)
|
||||
{
|
||||
return mob?.Deleted == false &&
|
||||
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance);
|
||||
}
|
||||
public bool IsFinance(Mobile mob) =>
|
||||
mob?.Deleted == false &&
|
||||
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance);
|
||||
|
||||
public void Capture(Faction f)
|
||||
{
|
||||
|
|
@ -445,10 +438,7 @@ namespace Server.Factions
|
|||
ConstructGuardLists();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Definition.FriendlyName;
|
||||
}
|
||||
public override string ToString() => Definition.FriendlyName;
|
||||
|
||||
public static void WriteReference(GenericWriter writer, Town town)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ namespace Server.Factions
|
|||
private Mobile m_Finance;
|
||||
private Mobile m_Sheriff;
|
||||
|
||||
public TownState(Town town)
|
||||
{
|
||||
Town = town;
|
||||
}
|
||||
public TownState(Town town) => Town = town;
|
||||
|
||||
public TownState(GenericReader reader)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -138,25 +138,13 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
public string Right(string text)
|
||||
{
|
||||
return $"<DIV ALIGN=RIGHT>{text}</DIV>";
|
||||
}
|
||||
public string Right(string text) => $"<DIV ALIGN=RIGHT>{text}</DIV>";
|
||||
|
||||
public string Center(string text)
|
||||
{
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
public string Color(string text, int color)
|
||||
{
|
||||
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
}
|
||||
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
|
||||
|
||||
public static string FormatTimeSpan(TimeSpan ts)
|
||||
{
|
||||
return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
|
||||
}
|
||||
public static string FormatTimeSpan(TimeSpan ts) => $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
|
||||
|
||||
public override void OnResponse(NetState sender, RelayInfo info)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ namespace Server.Factions
|
|||
|
||||
public virtual int ButtonTypes => 10;
|
||||
|
||||
public int ToButtonID(int type, int index)
|
||||
{
|
||||
return 1 + index * ButtonTypes + type;
|
||||
}
|
||||
public int ToButtonID(int type, int index) => 1 + index * ButtonTypes + type;
|
||||
|
||||
public bool FromButtonID(int buttonID, out int type, out int index)
|
||||
{
|
||||
|
|
@ -30,10 +27,7 @@ namespace Server.Factions
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool Exists(Mobile mob)
|
||||
{
|
||||
return mob.HasGump<FactionGump>();
|
||||
}
|
||||
public static bool Exists(Mobile mob) => mob.HasGump<FactionGump>();
|
||||
|
||||
public void AddHtmlText(int x, int y, int width, int height, TextDefinition text, bool back, bool scroll)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ namespace Server.Factions
|
|||
{
|
||||
public class Britain : Town
|
||||
{
|
||||
public Britain()
|
||||
{
|
||||
public Britain() =>
|
||||
Definition =
|
||||
new TownDefinition(
|
||||
0,
|
||||
|
|
@ -19,6 +18,5 @@ namespace Server.Factions
|
|||
new TextDefinition(1041386, "Corrupted Faction Town Sigil of Britain"),
|
||||
new Point3D(1592, 1680, 10),
|
||||
new Point3D(1588, 1676, 10));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,7 @@ namespace Server.Factions
|
|||
{
|
||||
public class Magincia : Town
|
||||
{
|
||||
public Magincia()
|
||||
{
|
||||
public Magincia() =>
|
||||
Definition =
|
||||
new TownDefinition(
|
||||
7,
|
||||
|
|
@ -19,6 +18,5 @@ namespace Server.Factions
|
|||
new TextDefinition(1041393, "Corrupted Faction Town Sigil of Magincia"),
|
||||
new Point3D(3714, 2235, 20),
|
||||
new Point3D(3712, 2230, 20));
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue