- extensive framework for dueling, tournaments, and events

- IP address command implementor
- miscellaneous minor fixes
This commit is contained in:
mark 2012-04-22 05:37:16 +00:00
parent c52504151b
commit 599b2af6d5
82 changed files with 11920 additions and 63 deletions

View file

@ -112,7 +112,11 @@ namespace Server.Items
Mobile targ = (Mobile) target;
Container pack = targ.Backpack;
if ( pack != null && pack.FindItemByType( new Type[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) || targ.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
{
from.SendMessage( "You may not throw snow here." );
}
else if ( pack != null && pack.FindItemByType( new Type[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
{
if ( from.BeginAction( typeof( SnowPile ) ) )
{

View file

@ -98,7 +98,11 @@ namespace Server.Items
Mobile targ = (Mobile) target;
Container pack = targ.Backpack;
if ( pack != null && pack.FindItemByType( new Type[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
if ( from.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) || targ.Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) )
{
from.SendMessage( "You may not throw snow here." );
}
else if ( pack != null && pack.FindItemByType( new Type[]{ typeof( SnowPile ), typeof( PileOfGlacialSnow ) } ) != null )
{
if ( from.BeginAction( typeof( SnowPile ) ) )
{

View file

@ -1779,8 +1779,6 @@ namespace Server.Guilds
}
}
[CommandProperty( AccessLevel.GameMaster )]
public DateTime LastFealty
{
@ -1803,7 +1801,6 @@ namespace Server.Guilds
}
}
public List<Guild> Allies
{
get
@ -1877,6 +1874,5 @@ namespace Server.Guilds
}
#endregion
}
}

View file

@ -65,6 +65,58 @@ namespace Server.Misc
if( from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
return true;
#region Dueling
PlayerMobile pmFrom = from as PlayerMobile;
PlayerMobile pmTarg = target as PlayerMobile;
if( pmFrom == null && from is BaseCreature )
{
BaseCreature bcFrom = (BaseCreature)from;
if( bcFrom.Summoned )
pmFrom = bcFrom.SummonMaster as PlayerMobile;
}
if( pmTarg == null && target is BaseCreature )
{
BaseCreature bcTarg = (BaseCreature)target;
if( bcTarg.Summoned )
pmTarg = bcTarg.SummonMaster as PlayerMobile;
}
if( pmFrom!= null && pmTarg != null )
{
if( pmFrom.DuelContext != pmTarg.DuelContext && ((pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg.DuelContext != null && pmTarg.DuelContext.Started)) )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && ((pmFrom.DuelContext.StartedReadyCountdown && !pmFrom.DuelContext.Started) || pmFrom.DuelContext.Tied || pmFrom.DuelPlayer.Eliminated || pmTarg.DuelPlayer.Eliminated) )
return false;
if( pmFrom.DuelPlayer != null && !pmFrom.DuelPlayer.Eliminated && pmFrom.DuelContext != null && pmFrom.DuelContext.IsSuddenDeath )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.m_Tournament != null && pmFrom.DuelContext.m_Tournament.IsNotoRestricted && pmFrom.DuelPlayer != null && pmTarg.DuelPlayer != null && pmFrom.DuelPlayer.Participant != pmTarg.DuelPlayer.Participant )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.Started )
return true;
}
if( (pmFrom != null && pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg != null && pmTarg.DuelContext != null && pmTarg.DuelContext.Started) )
return false;
Engines.ConPVP.SafeZone sz = from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
if( sz != null /*&& sz.IsDisabled()*/ )
return false;
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
if( sz != null /*&& sz.IsDisabled()*/ )
return false;
#endregion
Map map = from.Map;
#region Factions
@ -104,6 +156,55 @@ namespace Server.Misc
if( from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
return true;
#region Dueling
PlayerMobile pmFrom = from as PlayerMobile;
PlayerMobile pmTarg = target as PlayerMobile;
if( pmFrom == null && from is BaseCreature )
{
BaseCreature bcFrom = (BaseCreature)from;
if( bcFrom.Summoned )
pmFrom = bcFrom.SummonMaster as PlayerMobile;
}
if( pmTarg == null && target is BaseCreature )
{
BaseCreature bcTarg = (BaseCreature)target;
if( bcTarg.Summoned )
pmTarg = bcTarg.SummonMaster as PlayerMobile;
}
if( pmFrom!= null && pmTarg != null )
{
if( pmFrom.DuelContext != pmTarg.DuelContext && ((pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg.DuelContext != null && pmTarg.DuelContext.Started)) )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && ((pmFrom.DuelContext.StartedReadyCountdown && !pmFrom.DuelContext.Started) || pmFrom.DuelContext.Tied || pmFrom.DuelPlayer.Eliminated || pmTarg.DuelPlayer.Eliminated) )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.m_Tournament != null && pmFrom.DuelContext.m_Tournament.IsNotoRestricted && pmFrom.DuelPlayer != null && pmTarg.DuelPlayer != null && pmFrom.DuelPlayer.Participant == pmTarg.DuelPlayer.Participant )
return false;
if( pmFrom.DuelContext != null && pmFrom.DuelContext == pmTarg.DuelContext && pmFrom.DuelContext.Started )
return true;
}
if( (pmFrom != null && pmFrom.DuelContext != null && pmFrom.DuelContext.Started) || (pmTarg != null && pmTarg.DuelContext != null && pmTarg.DuelContext.Started) )
return false;
Engines.ConPVP.SafeZone sz = from.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
if( sz != null /*&& sz.IsDisabled()*/ )
return false;
sz = target.Region.GetRegion( typeof( Engines.ConPVP.SafeZone ) ) as Engines.ConPVP.SafeZone;
if( sz != null /*&& sz.IsDisabled()*/ )
return false;
#endregion
Map map = from.Map;
if( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
@ -269,6 +370,17 @@ namespace Server.Misc
if( Core.AOS && (target.Blessed || (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) )
return Notoriety.Invulnerable;
#region Dueling
if( source is PlayerMobile && target is PlayerMobile )
{
PlayerMobile pmFrom = (PlayerMobile)source;
PlayerMobile pmTarg = (PlayerMobile)target;
if( pmFrom.DuelContext != null && pmFrom.DuelContext.StartedBeginCountdown && !pmFrom.DuelContext.Finished && pmFrom.DuelContext == pmTarg.DuelContext )
return pmFrom.DuelContext.IsAlly( pmFrom, pmTarg ) ? Notoriety.Ally : Notoriety.Enemy;
}
#endregion
if( target.AccessLevel > AccessLevel.Player )
return Notoriety.CanBeAttacked;