- 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:
parent
8818ffdc80
commit
030ad1db5b
8 changed files with 193 additions and 55 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue