- 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

@ -496,7 +496,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
writer.Write( (int) 1 ); // version
}
public override void Deserialize( GenericReader reader )

View file

@ -17,6 +17,7 @@ namespace Server.Items
int ICommodity.DescriptionNumber { get { return CraftResources.IsStandard( m_Resource ) ? LabelNumber : 1075062 + ( (int)m_Resource - (int)CraftResource.RegularWood ); } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Log() : this( 1 )
{

View file

@ -222,7 +222,6 @@ namespace Server.Items
BasePotion pot = (BasePotion)item;
int toHold = Math.Min( 100 - m_Held, pot.Amount );
if ( toHold <= 0 )
{
from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!

View file

@ -50,7 +50,8 @@ namespace Server.Items
{
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
}
}

View file

@ -173,7 +173,10 @@ namespace Server.Items
m.PlaySound( 0x2D6 );
m.AddToBackpack( new Bottle() );
#region Dueling
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( m ) )
m.AddToBackpack( new Bottle() );
#endregion
if ( m.Body.IsHuman && !m.Mounted )
m.Animate( 34, 5, 1, true, false, 0 );

View file

@ -97,7 +97,8 @@ namespace Server.Items
from.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
from.PlaySound( 0x1E0 );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
else
{

View file

@ -56,7 +56,8 @@ namespace Server.Items
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from );
}

View file

@ -40,7 +40,8 @@ namespace Server.Items
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
else
{

View file

@ -43,7 +43,8 @@ namespace Server.Items
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
}
}

View file

@ -37,7 +37,8 @@ namespace Server.Items
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
else
{

View file

@ -50,7 +50,8 @@ namespace Server.Items
{
BasePotion.PlayDrinkEffect( from );
this.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
this.Consume();
}
}
}

View file

@ -94,7 +94,8 @@ namespace Server.Items
{
if ( BandageContext.BeginHeal( from, (Mobile)targeted ) != null )
{
m_Bandage.Consume();
if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
m_Bandage.Consume();
}
}
else
@ -509,7 +510,6 @@ namespace Server.Items
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}

View file

@ -256,7 +256,7 @@ namespace Server.Items
{
MessageHelper.SendLocalizedMessageTo( this, from, 1054127, 0x22 ); // The Crystal Ball fills with a red mist. You appear to have let your bond to your pet deteriorate.
}
else if ( from.Map == Map.Ilshenar || from.Region.IsPartOf( typeof( DungeonRegion ) ) || from.Region.IsPartOf( typeof( Jail ) ) )
else if ( from.Map == Map.Ilshenar || from.Region.IsPartOf( typeof( DungeonRegion ) ) || from.Region.IsPartOf( typeof( Jail ) ) || from.Region.IsPartOf( typeof( Server.Engines.ConPVP.SafeZone ) ) )
{
from.Send( new AsciiMessage( this.Serial, this.ItemID, MessageType.Regular, 0x22, 3, "", "You cannot summon your pet to this location." ) );
}
@ -464,4 +464,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -471,4 +471,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -189,6 +189,61 @@ namespace Server.Items
return false;
}
#region Dueling
string option = null;
if ( this is ArmorIgnore )
option = "Armor Ignore";
else if ( this is BleedAttack )
option = "Bleed Attack";
else if ( this is ConcussionBlow )
option = "Concussion Blow";
else if ( this is CrushingBlow )
option = "Crushing Blow";
else if ( this is Disarm )
option = "Disarm";
else if ( this is Dismount )
option = "Dismount";
else if ( this is DoubleStrike )
option = "Double Strike";
else if ( this is InfectiousStrike )
option = "Infectious Strike";
else if ( this is MortalStrike )
option = "Mortal Strike";
else if ( this is MovingShot )
option = "Moving Shot";
else if ( this is ParalyzingBlow )
option = "Paralyzing Blow";
else if ( this is ShadowStrike )
option = "Shadow Strike";
else if ( this is WhirlwindAttack )
option = "Whirlwind Attack";
else if ( this is RidingSwipe )
option = "Riding Swipe";
else if ( this is FrenziedWhirlwind )
option = "Frenzied Whirlwind";
else if ( this is Block )
option = "Block";
else if ( this is DefenseMastery )
option = "Defense Mastery";
else if ( this is NerveStrike )
option = "Nerve Strike";
else if ( this is TalonStrike )
option = "Talon Strike";
else if ( this is Feint )
option = "Feint";
else if ( this is DualWield )
option = "Dual Wield";
else if ( this is DoubleShot )
option = "Double Shot";
else if ( this is ArmorPierce )
option = "Armor Pierce";
if ( option != null && !Engines.ConPVP.DuelContext.AllowSpecialAbility( from, option, true ) )
return false;
#endregion
return CheckSkills( from ) && CheckMana( from, false );
}

View file

@ -153,7 +153,7 @@ namespace Server.Items
{
base.OnHit( attacker, defender, damageBonus );
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Concussion Blow", false ) )
{
StatMod mod = defender.GetStatMod( "Concussion" );

View file

@ -1019,8 +1019,18 @@ namespace Server.Items
PlayerMobile p = attacker as PlayerMobile;
canSwing = ( p == null || p.PeacedUntil <= DateTime.Now );
}
}
#region Dueling
if ( attacker is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)attacker;
if ( pm.DuelContext != null && !pm.DuelContext.CheckItemEquip( attacker, this ) )
canSwing = false;
}
#endregion
if ( canSwing && attacker.HarmfulCheck( defender ) )
{

View file

@ -217,6 +217,11 @@ namespace Server.Items
{
Mobile m = e.Mobile;
#region Dueling
if ( !Engines.ConPVP.DuelContext.AllowSpecialAbility( m, "Disarm", true ) )
return;
#endregion
double armsValue = m.Skills[SkillName.ArmsLore].Value;
double wresValue = m.Skills[SkillName.Wrestling].Value;
@ -242,6 +247,11 @@ namespace Server.Items
{
Mobile m = e.Mobile;
#region Dueling
if ( !Engines.ConPVP.DuelContext.AllowSpecialAbility( m, "Stun", true ) )
return;
#endregion
double anatValue = m.Skills[SkillName.Anatomy].Value;
double wresValue = m.Skills[SkillName.Wrestling].Value;

View file

@ -46,7 +46,7 @@ namespace Server.Items
{
double damage = base.GetBaseDamage( attacker );
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Crushing Blow", false ) )
{
damage *= 1.5;

View file

@ -107,7 +107,7 @@ namespace Server.Items
{
base.OnHit( attacker, defender, damageBonus );
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
if ( !Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Concussion Blow", false ) )
{
StatMod mod = defender.GetStatMod( "Concussion" );

View file

@ -68,6 +68,16 @@ namespace Server.Items
}
}
#region Dueling
if ( attacker is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)attacker;
if ( pm.DuelContext != null && !pm.DuelContext.CheckItemEquip( attacker, this ) )
canSwing = false;
}
#endregion
if ( canSwing && attacker.HarmfulCheck( defender ) )
{
attacker.DisruptiveAction();

View file

@ -39,7 +39,7 @@ namespace Server.Items
{
base.OnHit( attacker, defender, damageBonus );
if ( !Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
if ( !Core.AOS && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility( attacker, "Paralyzing Blow", false ) )
{
defender.SendMessage( "You receive a paralyzing blow!" ); // Is this not localized?
defender.Freeze( TimeSpan.FromSeconds( 2.0 ) );