- PreventInaccess class, moves staff characters to jail or green acres in Felucca or Trammel randomly if they disconnect during the login process.

- Added a [TileAvg command, which tiles items/mobiles on the average Z of the map instead of a fixed Z.
- For all the tile commands ([Tile, [TileRXYZ, [TileXYZ, [TileZ, [TileAvg), added outline commands to only put items/mobiles on the outside of the area ([Outline, [OutlineRXYZ, [OutlineXYZ, [OutlineZ, [OutlineAvg).
- Removed the [OpenBrowser confirmation messages when using the command on multiple mobiles at the same time.
- Added a label showing the type of the object currently being viewed to the top of the properties gump.
- Added SA skills (Mysticism, Throwing and Imbuing) to the [Skills gump.
- Fixed DeathRobe decay when automatically dropped by self looting your corpse.
- Removed the (summoned) property on mouseover from clones summoned through Mirror Image.
- The Z of the Magincia destination of the public moongates is now calculated when the server starts, so both old and new maps will have the correct Z (34 and 31 respectively).
- KeywordTeleporters no longer teleport if you're not within the trigger range when the delay ends.
- Added WaitTeleporter, which is a KeywordTeleporter supporting adding messages when a character starts the process and showing the remaining time. When a character logs and times out, any running teleport timer is stopped.
- Fixed BaseWaterContainer single click behavior.
- Fixed MageAI reveal behavior.
- House placement will now return the correct message when targeting inside a TempNoHousingRegion.
- Tracking will no longer be able to track characters with higher access after they hide.
- Added CorpseNameOverride to BaseCreature to override the name used for the generated corpse.
- Pet ghosts will no longer be deleted when (auto)stabled.
This commit is contained in:
eos 2012-02-12 01:59:30 +00:00
parent 68922c1eeb
commit 72c4dc6018
15 changed files with 685 additions and 155 deletions

View file

@ -102,9 +102,9 @@ namespace Server.Items
{
private Timer m_DecayTimer;
private DateTime m_DecayTime;
private static TimeSpan m_DefaultDecayTime = TimeSpan.FromMinutes(1.0);
public override bool DisplayLootType
{
get{ return false; }
@ -123,25 +123,30 @@ namespace Server.Items
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
return false;
}
public void BeginDecay( TimeSpan delay )
public void BeginDecay()
{
BeginDecay( m_DefaultDecayTime );
}
private void BeginDecay( TimeSpan delay )
{
if ( m_DecayTimer != null )
m_DecayTimer.Stop();
m_DecayTime = DateTime.Now + delay;
m_DecayTimer = new InternalTimer( this, delay );
m_DecayTimer.Start();
}
public override bool OnDroppedToWorld( Mobile from, Point3D p )
{
BeginDecay( m_DefaultDecayTime );
return true;
}
public override bool OnDroppedToMobile( Mobile from, Mobile target )
{
if (m_DecayTimer != null )
@ -189,7 +194,7 @@ namespace Server.Items
base.Serialize( writer );
writer.Write( (int) 2 ); // version
writer.Write( m_DecayTimer != null );
if( m_DecayTimer != null )
@ -201,7 +206,7 @@ namespace Server.Items
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 2:
@ -603,7 +608,7 @@ namespace Server.Items
public MonkRobe() : this( 0x21E )
{
}
[Constructable]
public MonkRobe( int hue ) : base( 0x2687, hue )
{
@ -634,7 +639,7 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
[Flipable( 0x1f01, 0x1f02 )]
public class PlainDress : BaseOuterTorso
{

View file

@ -438,6 +438,14 @@ namespace Server.Items
public static string GetCorpseName( Mobile m )
{
if ( m is BaseCreature )
{
BaseCreature bc = (BaseCreature)m;
if ( bc.CorpseNameOverride != null )
return bc.CorpseNameOverride;
}
Type t = m.GetType();
object[] attrs = t.GetCustomAttributes( typeof( CorpseNameAttribute ), true );
@ -1040,7 +1048,10 @@ namespace Server.Items
Map map = from.Map;
if ( map != null && map != Map.Internal )
{
robe.MoveToWorld( from.Location, map );
robe.BeginDecay();
}
}
Container pack = from.Backpack;

View file

@ -237,7 +237,8 @@ namespace Server.Items
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry( new Point3D( 3563, 2139, Map.Trammel.GetAverageZ( 3563, 2139 ) ), 1012010 ), // (New) Magincia
new PMEntry( new Point3D( 3450, 2677, 25), 1078098 ) // New Haven
} );
@ -251,7 +252,8 @@ namespace Server.Items
new PMEntry( new Point3D( 2701, 692, 5 ), 1012007 ), // Minoc
new PMEntry( new Point3D( 1828, 2948,-20), 1012008 ), // Trinsic
new PMEntry( new Point3D( 643, 2067, 5 ), 1012009 ), // Skara Brae
new PMEntry( new Point3D( 3563, 2139, 34), 1012010 ), // Magincia
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry( new Point3D( 3563, 2139, Map.Felucca.GetAverageZ( 3563, 2139 ) ), 1012010 ), // (New) Magincia
new PMEntry( new Point3D( 2711, 2234, 0 ), 1019001 ) // Buccaneer's Den
} );

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Server;
using Server.Network;
using Server.Spells;
@ -147,12 +148,7 @@ namespace Server.Items
if ( m_Delay == TimeSpan.Zero )
DoTeleport( m );
else
Timer.DelayCall( m_Delay, new TimerStateCallback( DoTeleport_Callback ), m );
}
private void DoTeleport_Callback( object state )
{
DoTeleport( (Mobile) state );
Timer.DelayCall<Mobile>( m_Delay, DoTeleport, m );
}
public virtual void DoTeleport( Mobile m )
@ -192,7 +188,7 @@ namespace Server.Items
else if ( m_CombatCheck && SpellHelper.CheckCombat( m ) )
{
m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
return true;
return true;
}
StartTeleport( m );
@ -455,6 +451,14 @@ namespace Server.Items
}
}
public override void DoTeleport( Mobile m )
{
if ( !m.InRange( GetWorldLocation(), m_Range ) || m.Map != Map )
return;
base.DoTeleport( m );
}
public override bool OnMoveOver( Mobile m )
{
return true;
@ -514,4 +518,188 @@ namespace Server.Items
}
}
}
public class WaitTeleporter : KeywordTeleporter
{
private static Dictionary<Mobile, TeleportingInfo> m_Table;
public static void Initialize()
{
m_Table = new Dictionary<Mobile, TeleportingInfo>();
EventSink.Logout += new LogoutEventHandler( EventSink_Logout );
}
public static void EventSink_Logout( LogoutEventArgs e )
{
Mobile from = e.Mobile;
TeleportingInfo info;
if ( from == null || !m_Table.TryGetValue( from, out info ) )
return;
info.Timer.Stop();
m_Table.Remove( from );
}
private int m_StartNumber;
private string m_StartMessage;
private int m_ProgressNumber;
private string m_ProgressMessage;
private bool m_ShowTimeRemaining;
[CommandProperty( AccessLevel.GameMaster )]
public int StartNumber
{
get { return m_StartNumber; }
set { m_StartNumber = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public string StartMessage
{
get { return m_StartMessage; }
set { m_StartMessage = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public int ProgressNumber
{
get { return m_ProgressNumber; }
set { m_ProgressNumber = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public string ProgressMessage
{
get { return m_ProgressMessage; }
set { m_ProgressMessage = value; }
}
[CommandProperty( AccessLevel.GameMaster )]
public bool ShowTimeRemaining
{
get { return m_ShowTimeRemaining; }
set { m_ShowTimeRemaining = value; }
}
[Constructable]
public WaitTeleporter()
{
}
public static string FormatTime( TimeSpan ts )
{
if ( ts.TotalHours >= 1 )
{
int h = (int)ts.TotalHours;
return String.Format( "{0} hour{1}", h, ( h == 1 ) ? "" : "s" );
}
else if ( ts.TotalMinutes >= 1 )
{
int m = (int)ts.TotalMinutes;
return String.Format( "{0} minute{1}", m, ( m == 1 ) ? "" : "s" );
}
int s = Math.Max( (int)ts.TotalSeconds, 0 );
return String.Format( "{0} second{1}", s, ( s == 1 ) ? "" : "s" );
}
private void EndLock( Mobile m )
{
m.EndAction( this );
}
public override void StartTeleport( Mobile m )
{
TeleportingInfo info;
if ( m_Table.TryGetValue( m, out info ) )
{
if ( info.Teleporter == this )
{
if ( m.BeginAction( this ) )
{
if ( m_ProgressMessage != null )
m.SendMessage( m_ProgressMessage );
else if ( m_ProgressNumber != 0 )
m.SendLocalizedMessage( m_ProgressNumber );
if ( m_ShowTimeRemaining )
m.SendMessage( "Time remaining: {0}", FormatTime( m_Table[m].Timer.Next - DateTime.Now ) );
Timer.DelayCall<Mobile>( TimeSpan.FromSeconds( 5 ), EndLock, m );
}
return;
}
else
{
info.Timer.Stop();
}
}
if ( m_StartMessage != null )
m.SendMessage( m_StartMessage );
else if ( m_StartNumber != 0 )
m.SendLocalizedMessage( m_StartNumber );
if ( Delay == TimeSpan.Zero )
DoTeleport( m );
else
m_Table[m] = new TeleportingInfo( this, Timer.DelayCall<Mobile>( Delay, DoTeleport, m ) );
}
public override void DoTeleport( Mobile m )
{
m_Table.Remove( m );
base.DoTeleport( m );
}
public WaitTeleporter( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( m_StartNumber );
writer.Write( m_StartMessage );
writer.Write( m_ProgressNumber );
writer.Write( m_ProgressMessage );
writer.Write( m_ShowTimeRemaining );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
m_StartNumber = reader.ReadInt();
m_StartMessage = reader.ReadString();
m_ProgressNumber = reader.ReadInt();
m_ProgressMessage = reader.ReadString();
m_ShowTimeRemaining = reader.ReadBool();
}
private class TeleportingInfo
{
private WaitTeleporter m_Teleporter;
private Timer m_Timer;
public WaitTeleporter Teleporter { get { return m_Teleporter; } }
public Timer Timer { get { return m_Timer; } }
public TeleportingInfo( WaitTeleporter tele, Timer t )
{
m_Teleporter = tele;
m_Timer = t;
}
}
}
}

View file

@ -64,7 +64,29 @@
{
if( IsEmpty )
{
base.OnDoubleClick( from );
base.OnSingleClick( from );
}
else
{
if( Name == null )
LabelTo( from, LabelNumber );
else
LabelTo( from, Name );
}
}
public override void OnAosSingleClick( Mobile from )
{
if( IsEmpty )
{
base.OnAosSingleClick( from );
}
else
{
if( Name == null )
LabelTo( from, LabelNumber );
else
LabelTo( from, Name );
}
}