- Fixed Bola item drop bug for Core.SE.

- Added 'dead only' and 'no ethereals in pack' to ConditionTeleporter.
- Fixed tournaments discarding leftover participants for participant numbers greater than 2.
- Added support for the extended status packet.
- Fixed items not being placeable on tiles occupied by hidden staff mobiles.
This commit is contained in:
eos@runuo.com 2013-08-20 16:17:01 +00:00
parent 8818ffdc80
commit 030ad1db5b
8 changed files with 193 additions and 55 deletions

View file

@ -2217,7 +2217,7 @@ namespace Server.Engines.ConPVP
}
case TournyType.Standard:
{
if ( partsPerMatch == 2 && (participants.Count % 2) == 1 )
if ( partsPerMatch >= 2 && participants.Count % partsPerMatch == 1 )
{
int lowAdvances = int.MaxValue;

View file

@ -36,7 +36,7 @@ namespace Server.Items
{
from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
}
else if ( !Core.AOS && (from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null) )
else if ( !HasFreeHands( from ) )
{
from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
}
@ -52,17 +52,6 @@ namespace Server.Items
{
EtherealMount.StopMounting( from );
if ( Core.AOS ) {
Item one = from.FindItemOnLayer( Layer.OneHanded );
Item two = from.FindItemOnLayer( Layer.TwoHanded );
if ( one != null )
from.AddToBackpack( one );
if ( two != null )
from.AddToBackpack( two );
}
from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
@ -115,6 +104,48 @@ namespace Server.Items
Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( ReleaseBolaLock ), from );
}
private static bool HasFreeHands( Mobile from )
{
Item one = from.FindItemOnLayer( Layer.OneHanded );
Item two = from.FindItemOnLayer( Layer.TwoHanded );
if ( Core.SE )
{
Container pack = from.Backpack;
if ( pack != null )
{
if ( one != null && one.Movable )
{
pack.DropItem( one );
one = null;
}
if ( two != null && two.Movable )
{
pack.DropItem( two );
two = null;
}
}
}
else if ( Core.AOS )
{
if ( one != null && one.Movable )
{
from.AddToBackpack( one );
one = null;
}
if ( two != null && two.Movable )
{
from.AddToBackpack( two );
two = null;
}
}
return ( one == null && two == null );
}
public class BolaTarget : Target
{
private Bola m_Bola;
@ -137,7 +168,7 @@ namespace Server.Items
{
from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
}
else if ( !Core.AOS && (from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null) )
else if ( !HasFreeHands( from ) )
{
from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
}
@ -160,17 +191,6 @@ namespace Server.Items
{
EtherealMount.StopMounting( from );
if ( Core.AOS ) {
Item one = from.FindItemOnLayer( Layer.OneHanded );
Item two = from.FindItemOnLayer( Layer.TwoHanded );
if ( one != null )
from.AddToBackpack( one );
if ( two != null )
from.AddToBackpack( two );
}
from.DoHarmful( to );
m_Bola.Consume();

View file

@ -910,14 +910,16 @@ namespace Server.Items
[Flags]
protected enum ConditionFlag
{
None = 0x00,
DenyMounted = 0x01,
DenyFollowers = 0x02,
DenyPackContents = 0x04,
DenyHolding = 0x08,
DenyEquipment = 0x10,
DenyTransformed = 0x20,
StaffOnly = 0x40
None = 0x000,
DenyMounted = 0x001,
DenyFollowers = 0x002,
DenyPackContents = 0x004,
DenyHolding = 0x008,
DenyEquipment = 0x010,
DenyTransformed = 0x020,
StaffOnly = 0x040,
DenyPackEthereals = 0x080,
DeadOnly = 0x100
}
private ConditionFlag m_Flags;
@ -971,6 +973,20 @@ namespace Server.Items
set { SetFlag(ConditionFlag.StaffOnly, value); InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public bool DenyPackEthereals
{
get { return GetFlag(ConditionFlag.DenyPackEthereals); }
set { SetFlag(ConditionFlag.DenyPackEthereals, value); InvalidateProperties(); }
}
[CommandProperty(AccessLevel.GameMaster)]
public bool DeadOnly
{
get { return GetFlag(ConditionFlag.DeadOnly); }
set { SetFlag(ConditionFlag.DeadOnly, value); InvalidateProperties(); }
}
public override bool CanTeleport(Mobile m)
{
if (!base.CanTeleport(m))
@ -991,12 +1007,21 @@ namespace Server.Items
return false;
}
Container pack;
Container pack = m.Backpack;
if (GetFlag(ConditionFlag.DenyPackContents) && (pack = m.Backpack) != null && pack.TotalItems != 0)
if (pack != null)
{
m.SendMessage("You must empty your backpack before proceeding.");
return false;
if (GetFlag(ConditionFlag.DenyPackContents) && pack.TotalItems != 0)
{
m.SendMessage("You must empty your backpack before proceeding.");
return false;
}
if (GetFlag(ConditionFlag.DenyPackEthereals) && (pack.FindItemByType(typeof(EtherealMount)) != null || pack.FindItemByType(typeof(BaseImprisonedMobile)) != null))
{
m.SendMessage("You must empty your backpack of ethereal mounts before proceeding.");
return false;
}
}
if (GetFlag(ConditionFlag.DenyHolding) && m.Holding != null)
@ -1034,6 +1059,12 @@ namespace Server.Items
return false;
}
if (GetFlag(ConditionFlag.DeadOnly) && m.Alive)
{
m.SendLocalizedMessage(1060014); // Only the dead may pass.
return false;
}
return true;
}
@ -1057,6 +1088,9 @@ namespace Server.Items
if (GetFlag(ConditionFlag.DenyPackContents))
props.Append("<BR>Deny Pack Contents");
if (GetFlag(ConditionFlag.DenyPackEthereals))
props.Append("<BR>Deny Pack Ethereals");
if (GetFlag(ConditionFlag.DenyHolding))
props.Append("<BR>Deny Holding");
@ -1069,6 +1103,9 @@ namespace Server.Items
if (GetFlag(ConditionFlag.StaffOnly))
props.Append("<BR>Staff Only");
if (GetFlag(ConditionFlag.DeadOnly))
props.Append("<BR>Dead Only");
if (props.Length != 0)
{
props.Remove(0, 4);

View file

@ -205,6 +205,30 @@ namespace Server
{
return (input * percent) / 100;
}
public static int GetStatus( Mobile from, int index )
{
switch ( index )
{
// TODO: Account for buffs/debuffs
case 0: return from.GetMaxResistance( ResistanceType.Physical );
case 1: return from.GetMaxResistance( ResistanceType.Fire );
case 2: return from.GetMaxResistance( ResistanceType.Cold );
case 3: return from.GetMaxResistance( ResistanceType.Poison );
case 4: return from.GetMaxResistance( ResistanceType.Energy );
case 5: return AosAttributes.GetValue( from, AosAttribute.DefendChance );
case 6: return 45;
case 7: return AosAttributes.GetValue( from, AosAttribute.AttackChance );
case 8: return AosAttributes.GetValue( from, AosAttribute.WeaponSpeed );
case 9: return AosAttributes.GetValue( from, AosAttribute.WeaponDamage );
case 10: return AosAttributes.GetValue( from, AosAttribute.LowerRegCost );
case 11: return AosAttributes.GetValue( from, AosAttribute.SpellDamage );
case 12: return AosAttributes.GetValue( from, AosAttribute.CastRecovery );
case 13: return AosAttributes.GetValue( from, AosAttribute.CastSpeed );
case 14: return AosAttributes.GetValue( from, AosAttribute.LowerManaCost );
default: return 0;
}
}
}
[Flags]

View file

@ -27,6 +27,7 @@ namespace Server
PacketHandlers.SingleClickProps = true; // single click for everything is overriden to check object property list
Mobile.ActionDelay = TimeSpan.FromSeconds( 1.0 );
Mobile.AOSStatusHandler = new AOSStatusHandler( AOS.GetStatus );
}
}
}

View file

@ -539,7 +539,7 @@ namespace Server.Mobiles
foreach ( Mobile m in mobiles )
{
if ( m.Z >= location.Z && m.Z < location.Z + 16 )
if ( m.Z >= location.Z && m.Z < location.Z + 16 && ( !m.Hidden || m.AccessLevel == AccessLevel.Player ) )
{
mobiles.Free();
return false;
@ -737,7 +737,7 @@ namespace Server.Mobiles
public override int GetMaxResistance( ResistanceType type )
{
if ( AccessLevel > AccessLevel.Player )
return int.MaxValue;
return 100;
int max = base.GetMaxResistance( type );

View file

@ -495,6 +495,8 @@ namespace Server
public delegate Container CreateCorpseHandler( Mobile from, HairInfo hair, FacialHairInfo facialhair, List<Item> initialContent, List<Item> equipedItems );
public delegate int AOSStatusHandler( Mobile from, int index );
#endregion
/// <summary>
@ -579,6 +581,14 @@ namespace Server
set { m_SkillCheckDirectLocationHandler = value; }
}
private static AOSStatusHandler m_AOSStatusHandler;
public static AOSStatusHandler AOSStatusHandler
{
get { return m_AOSStatusHandler; }
set { m_AOSStatusHandler = value; }
}
#endregion
#region Regeneration
@ -1015,6 +1025,11 @@ namespace Server
return int.MaxValue;
}
public int GetAOSStatus( int index )
{
return ( m_AOSStatusHandler == null ) ? 0 : m_AOSStatusHandler( this, index );
}
public virtual void SendPropertiesTo( Mobile from )
{
from.Send( PropertyList );

View file

@ -3051,9 +3051,23 @@ namespace Server.Network
string name = m.Name;
if ( name == null ) name = "";
bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
int type;
this.EnsureCapacity( sendMLExtended ? 91 : 88 );
if ( Core.HS && ns != null && ns.ExtendedStatus )
{
type = 6;
EnsureCapacity( 121 );
}
else if ( Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ) )
{
type = 5;
EnsureCapacity( 91 );
}
else
{
type = Core.AOS ? 4 : 3;
EnsureCapacity( 88 );
}
m_Stream.Write( (int) m.Serial );
m_Stream.WriteAsciiFixed( name, 30 );
@ -3063,7 +3077,7 @@ namespace Server.Network
m_Stream.Write( m.CanBeRenamedBy( m ) );
m_Stream.Write( (byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
m_Stream.Write( (byte) type );
m_Stream.Write( m.Female );
@ -3081,7 +3095,7 @@ namespace Server.Network
m_Stream.Write( (short) (Core.AOS ? m.PhysicalResistance : (int)(m.ArmorRating + 0.5)) );
m_Stream.Write( (short) (Mobile.BodyWeight + m.TotalWeight) );
if( sendMLExtended )
if ( type >= 5 )
{
m_Stream.Write( (short)m.MaxWeight );
m_Stream.Write( (byte)(m.Race.RaceID + 1)); // Would be 0x00 if it's a non-ML enabled account but...
@ -3092,7 +3106,7 @@ namespace Server.Network
m_Stream.Write( (byte) m.Followers );
m_Stream.Write( (byte) m.FollowersMax );
if ( Core.AOS )
if ( type >= 4 )
{
m_Stream.Write( (short) m.FireResistance ); // Fire
m_Stream.Write( (short) m.ColdResistance ); // Cold
@ -3112,6 +3126,12 @@ namespace Server.Network
m_Stream.Write( (int) m.TithingPoints );
}
if ( type >= 6 )
{
for ( int i = 0; i < 15; ++i )
m_Stream.Write( (short) m.GetAOSStatus( i ) );
}
}
}
@ -3126,9 +3146,28 @@ namespace Server.Network
string name = beheld.Name;
if ( name == null ) name = "";
bool sendMLExtended = (Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ));
int type;
this.EnsureCapacity( 43 + (beholder == beheld ? (sendMLExtended ? 48 : 45) : 0) );
if ( beholder != beheld )
{
type = 0;
EnsureCapacity( 43 );
}
else if ( Core.HS && ns != null && ns.ExtendedStatus )
{
type = 6;
EnsureCapacity( 121 );
}
else if ( Core.ML && ns != null && ns.SupportsExpansion( Expansion.ML ) )
{
type = 5;
EnsureCapacity( 91 );
}
else
{
type = Core.AOS ? 4 : 3;
EnsureCapacity( 88 );
}
m_Stream.Write( beheld.Serial );
@ -3141,10 +3180,10 @@ namespace Server.Network
m_Stream.Write( beheld.CanBeRenamedBy( beholder ) );
if ( beholder == beheld )
{
m_Stream.Write( (byte)(sendMLExtended ? 0x05 : Core.AOS ? 0x04 : 0x03) ); // type
m_Stream.Write( (byte) type );
if ( type > 0 )
{
m_Stream.Write( beheld.Female );
m_Stream.Write( (short) beheld.Str );
@ -3158,7 +3197,7 @@ namespace Server.Network
m_Stream.Write( (short) (Core.AOS ? beheld.PhysicalResistance : (int)(beheld.ArmorRating + 0.5)) );
m_Stream.Write( (short) (Mobile.BodyWeight + beheld.TotalWeight) );
if( sendMLExtended )
if ( type >= 5 )
{
m_Stream.Write( (short)beheld.MaxWeight );
m_Stream.Write( (byte)(beheld.Race.RaceID + 1) ); // Would be 0x00 if it's a non-ML enabled account but...
@ -3169,7 +3208,7 @@ namespace Server.Network
m_Stream.Write( (byte) beheld.Followers );
m_Stream.Write( (byte) beheld.FollowersMax );
if ( Core.AOS )
if ( type >= 4 )
{
m_Stream.Write( (short) beheld.FireResistance ); // Fire
m_Stream.Write( (short) beheld.ColdResistance ); // Cold
@ -3189,10 +3228,12 @@ namespace Server.Network
m_Stream.Write( (int) beheld.TithingPoints );
}
}
else
{
m_Stream.Write( (byte) 0x00 );
if ( type >= 6 )
{
for ( int i = 0; i < 15; ++i )
m_Stream.Write( (short) beheld.GetAOSStatus( i ) );
}
}
}