Lots of fixes, changes, rewrites of various things, including but not limited to:

Logging of staff crafting items,
Fixes for the OSI client changes
The potion stacking stuff
BaseWeapon fix, so that damage increase things don't multiply themselves.
admin gump fixes for Firewall
Various display tweaks for weight
SoS no longer spawn in Tokuno
Hiryu hues happified to OSI standards
staff now see alliance chat correctly
Play barkeeper text increased per OSI
Various other OSI skill requirement changes
Various unimplemented features of the SE moves
EventSink for when the client version is received from client.
Client validation moved out of the core.
Client version validation now has options to ignore/kick/warn/annoy.  Automagically tries to detect current client.
Reverted the delayeddamagecontext back to OSI standards.
Can no longer use bags of sending in jail.

MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em.
TransformationSpellHelper now implemented.  Things moved around for this.
Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle.  Circle doesn't make sense for non-Magery spells!
Alot of the spellweaving spells added to OSI standards.
This commit is contained in:
asayre 2007-05-26 03:12:41 +00:00
parent f12e9745c6
commit 2ad37d54aa
214 changed files with 4881 additions and 1243 deletions

View file

@ -1569,6 +1569,7 @@ namespace Server.Items
from.Send( new DisplayEquipmentInfo( this, eqInfo ) );
}
#region ICraftable Members
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
@ -1591,9 +1592,30 @@ namespace Server.Items
if ( context != null && context.DoNotColor )
Hue = 0;
if ( quality == 2 )
if( Quality == ArmorQuality.Exceptional )
{
DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14.
if( Core.ML && !(this is BaseShield) )
{
int bonus = (int)(from.Skills.ArmsLore.Value / 20);
for( int i = 0; i < bonus; i++ )
{
switch( Utility.Random( 5 ) )
{
case 0: m_PhysicalBonus++; break;
case 1: m_FireBonus++; break;
case 2: m_ColdBonus++; break;
case 3: m_EnergyBonus++; break;
case 4: m_PoisonBonus++; break;
}
}
from.CheckSkill( SkillName.ArmsLore, 0, 100 );
}
}
if ( Core.AOS && tool is BaseRunicTool )
((BaseRunicTool)tool).ApplyAttributesTo( this );

View file

@ -249,7 +249,7 @@ namespace Server.Items
if ( m.Backpack == null )
return false;
Item[] items = m.Backpack.FindItemsByType( typeof( BaseHarvestTool ) );
List<BaseHarvestTool> items = m.Backpack.FindItemsByType<BaseHarvestTool>();
foreach ( BaseHarvestTool tool in items )
{

View file

@ -55,6 +55,8 @@ namespace Server.Items
set{ m_TimeOfDeath = value; }
}
public override bool DisplayWeight { get { return false; } }
public HairInfo Hair { get { return m_Hair; } }
public FacialHairInfo FacialHair { get { return m_FacialHair; } }

View file

@ -237,7 +237,7 @@ namespace Server.Items
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
new PMEntry( new Point3D( 3763, 2771, 50), 1046259 ) // Haven
new PMEntry( new Point3D( 3763, 2771, 50), 1078098 ) // New Haven
} );
public static readonly PMList Felucca =

View file

@ -1,6 +1,7 @@
using System;
using Server;
using Server.Mobiles;
using Server.Spells;
namespace Server.Items
{
@ -35,7 +36,7 @@ namespace Server.Items
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
else if( TransformationSpellHelper.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}

View file

@ -58,7 +58,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 2 ); // version
writer.Write( (int) 3 ); // version
writer.Write( (int) m_Level );
@ -73,6 +73,7 @@ namespace Server.Items
switch ( version )
{
case 3:
case 2:
{
m_Level = reader.ReadInt();
@ -92,6 +93,9 @@ namespace Server.Items
if ( version < 2 )
m_Level = GetRandomLevel();
if( version < 3 && m_TargetMap == Map.Tokuno )
m_TargetMap = Map.Trammel;
}
public override void OnDoubleClick( Mobile from )

View file

@ -100,7 +100,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 3 ); // version
writer.Write( (int) 4 ); // version
writer.Write( m_Level );
@ -117,6 +117,7 @@ namespace Server.Items
switch ( version )
{
case 4:
case 3:
case 2:
{
@ -150,6 +151,9 @@ namespace Server.Items
if ( version < 3 )
UpdateHue();
if( version < 4 && m_TargetMap == Map.Tokuno )
m_TargetMap = Map.Trammel;
}
public override void OnDoubleClick( Mobile from )

View file

@ -209,19 +209,30 @@ namespace Server.Items
if ( item is BasePotion )
{
BasePotion pot = (BasePotion)item;
int toHold = Math.Min( 100 - m_Held, pot.Amount );
if ( m_Held == 0 )
if ( toHold <= 0 )
{
if ( GiveBottle( from ) )
from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!
return false;
}
else if ( m_Held == 0 )
{
if ( GiveBottle( from, toHold ) )
{
m_Type = pot.PotionEffect;
Held = 1;
Held = toHold;
from.PlaySound( 0x240 );
from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.
item.Delete();
item.Consume( toHold );
if( !item.Deleted )
item.Bounce( from );
return true;
}
else
@ -235,23 +246,21 @@ namespace Server.Items
from.SendLocalizedMessage( 502236 ); // You decide that it would be a bad idea to mix different types of potions.
return false;
}
else if ( m_Held >= 100 )
{
from.SendLocalizedMessage( 502233 ); // The keg will not hold any more!
return false;
}
else
{
if ( GiveBottle( from ) )
if ( GiveBottle( from, toHold ) )
{
++Held;
item.Delete();
Held += toHold;
from.PlaySound( 0x240 );
from.SendLocalizedMessage( 502237 ); // You place the empty bottle in your backpack.
item.Delete();
item.Consume( toHold );
if( !item.Deleted )
item.Bounce( from );
return true;
}
else
@ -268,11 +277,11 @@ namespace Server.Items
}
}
public bool GiveBottle( Mobile m )
public bool GiveBottle( Mobile m, int amount )
{
Container pack = m.Backpack;
Bottle bottle = new Bottle();
Bottle bottle = new Bottle( amount );
if ( pack == null || !pack.TryDropItem( m, bottle, false ) )
{

View file

@ -1,6 +1,7 @@
using System;
using Server;
using Server.Engines.Craft;
using System.Collections.Generic;
namespace Server.Items
{
@ -51,7 +52,7 @@ namespace Server.Items
{
m_PotionEffect = effect;
Stackable = false;
Stackable = Core.ML;
Weight = 1.0;
}
@ -94,7 +95,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) 1 ); // version
writer.Write( (int) m_PotionEffect );
}
@ -107,12 +108,16 @@ namespace Server.Items
switch ( version )
{
case 1:
case 0:
{
m_PotionEffect = (PotionEffect)reader.ReadInt();
break;
}
}
if( version == 0 )
Stackable = Core.ML;
}
public abstract void Drink( Mobile from );
@ -156,6 +161,15 @@ namespace Server.Items
return AOS.Scale( v, 100 + AosAttributes.GetValue( m, AosAttribute.EnhancePotions ) );
}
public override bool StackWith( Mobile from, Item dropped, bool playSound )
{
if( dropped is BasePotion && ((BasePotion)dropped).m_PotionEffect == m_PotionEffect )
return base.StackWith( from, dropped, playSound );
return false;
}
#region ICraftable Members
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
@ -166,11 +180,11 @@ namespace Server.Items
if ( pack != null )
{
Item[] kegs = pack.FindItemsByType( typeof( PotionKeg ), true );
List<PotionKeg> kegs = pack.FindItemsByType<PotionKeg>();
for ( int i = 0; i < kegs.Length; ++i )
for ( int i = 0; i < kegs.Count; ++i )
{
PotionKeg keg = kegs[i] as PotionKeg;
PotionKeg keg = kegs[i];
if ( keg == null )
continue;
@ -183,7 +197,7 @@ namespace Server.Items
++keg.Held;
Delete();
Consume();
from.AddToBackpack( new Bottle() );
return -1; // signal placed in keg

View file

@ -1,5 +1,6 @@
using System;
using Server;
using Server.Spells;
namespace Server.Items
{
@ -83,7 +84,7 @@ namespace Server.Items
public override void Drink( Mobile from )
{
if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from, typeof( Spells.Necromancy.VampiricEmbraceSpell ) ) )
if ( TransformationSpellHelper.UnderTransformation( from, typeof( Spells.Necromancy.VampiricEmbraceSpell ) ) )
{
from.SendLocalizedMessage( 1061652 ); // The garlic in the potion would surely kill you.
}

View file

@ -200,6 +200,11 @@ namespace Server.Items
Effects.SendMovingEffect( from, to, m_Potion.ItemID & 0x3FFF, 7, 0, false, false, m_Potion.Hue, 0 );
if( m_Potion.Amount > 1 )
{
Mobile.LiftItemDupe( m_Potion, 1 );
}
m_Potion.Internalize();
Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
}
@ -210,7 +215,7 @@ namespace Server.Items
if ( Deleted )
return;
Delete();
Consume();
for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
{

View file

@ -0,0 +1,550 @@
using System;
using Server;
using Server.Items;
namespace Server.Items
{
public class ArcaneCircleScroll : SpellScroll
{
[Constructable]
public ArcaneCircleScroll()
: this( 1 )
{
}
[Constructable]
public ArcaneCircleScroll( int amount )
: base( 600, 0x2D51, amount )
{
}
public ArcaneCircleScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class GiftOfRenewalScroll : SpellScroll
{
[Constructable]
public GiftOfRenewalScroll()
: this( 1 )
{
}
[Constructable]
public GiftOfRenewalScroll( int amount )
: base( 601, 0x2D52, amount )
{
}
public GiftOfRenewalScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class ImmolatingWeaponScroll : SpellScroll
{
[Constructable]
public ImmolatingWeaponScroll()
: this( 1 )
{
}
[Constructable]
public ImmolatingWeaponScroll( int amount )
: base( 602, 0x2D53, amount )
{
}
public ImmolatingWeaponScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class AttuneWeaponScroll : SpellScroll
{
[Constructable]
public AttuneWeaponScroll()
: this( 1 )
{
}
[Constructable]
public AttuneWeaponScroll( int amount )
: base( 603, 0x2D54, amount )
{
}
public AttuneWeaponScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class ThunderstormScroll : SpellScroll
{
[Constructable]
public ThunderstormScroll()
: this( 1 )
{
}
[Constructable]
public ThunderstormScroll( int amount )
: base( 604, 0x2D55, amount )
{
}
public ThunderstormScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class NatureFuryScroll : SpellScroll
{
[Constructable]
public NatureFuryScroll()
: this( 1 )
{
}
[Constructable]
public NatureFuryScroll( int amount )
: base( 605, 0x2D56, amount )
{
}
public NatureFuryScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class SummonFeyScroll : SpellScroll
{
[Constructable]
public SummonFeyScroll()
: this( 1 )
{
}
[Constructable]
public SummonFeyScroll( int amount )
: base( 606, 0x2D57, amount )
{
}
public SummonFeyScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class SummonFiendScroll : SpellScroll
{
[Constructable]
public SummonFiendScroll()
: this( 1 )
{
}
[Constructable]
public SummonFiendScroll( int amount )
: base( 606, 0x2D57, amount )
{
}
public SummonFiendScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class ReaperFormScroll : SpellScroll
{
[Constructable]
public ReaperFormScroll()
: this( 1 )
{
}
[Constructable]
public ReaperFormScroll( int amount )
: base( 608, 0x2D59, amount )
{
}
public ReaperFormScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class WildfireScroll : SpellScroll
{
[Constructable]
public WildfireScroll()
: this( 1 )
{
}
[Constructable]
public WildfireScroll( int amount )
: base( 609, 0x2D5A, amount )
{
}
public WildfireScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class EssenceOfWindScroll : SpellScroll
{
[Constructable]
public EssenceOfWindScroll()
: this( 1 )
{
}
[Constructable]
public EssenceOfWindScroll( int amount )
: base( 610, 0x2D5B, amount )
{
}
public EssenceOfWindScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class DryadAllureScroll : SpellScroll
{
[Constructable]
public DryadAllureScroll()
: this( 1 )
{
}
[Constructable]
public DryadAllureScroll( int amount )
: base( 611, 0x2D5C, amount )
{
}
public DryadAllureScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class EtherealVoyageScroll : SpellScroll
{
[Constructable]
public EtherealVoyageScroll()
: this( 1 )
{
}
[Constructable]
public EtherealVoyageScroll( int amount )
: base( 612, 0x2D5D, amount )
{
}
public EtherealVoyageScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class WordOfDeathScroll : SpellScroll
{
[Constructable]
public WordOfDeathScroll()
: this( 1 )
{
}
[Constructable]
public WordOfDeathScroll( int amount )
: base( 613, 0x2D5E, amount )
{
}
public WordOfDeathScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class GiftOfLifeScroll : SpellScroll
{
[Constructable]
public GiftOfLifeScroll()
: this( 1 )
{
}
[Constructable]
public GiftOfLifeScroll( int amount )
: base( 614, 0x2D5F, amount )
{
}
public GiftOfLifeScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class ArcaneEmpowermentScroll : SpellScroll
{
[Constructable]
public ArcaneEmpowermentScroll()
: this( 1 )
{
}
[Constructable]
public ArcaneEmpowermentScroll( int amount )
: base( 615, 0x2D60, amount )
{
}
public ArcaneEmpowermentScroll( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}

View file

@ -265,6 +265,8 @@ namespace Server.Items
return ( book.SpellbookType == type && ( spellID == -1 || book.HasSpell( spellID ) ) );
}
public override bool DisplayWeight { get { return false; } }
private AosAttributes m_AosAttributes;
private AosSkillBonuses m_AosSkillBonuses;

View file

@ -310,7 +310,7 @@ namespace Server.Items
healerNumber = 1060088; // You bind the wound and stop the bleeding
patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!
BleedAttack.EndBleed( m_Patient, true );
BleedAttack.EndBleed( m_Patient, false );
}
else if ( MortalStrike.IsWounded( m_Patient ) )
{
@ -365,7 +365,7 @@ namespace Server.Items
healerNumber = 500968; // You apply the bandages, but they barely help.
}
m_Patient.Heal( (int) toHeal, false );
m_Patient.Heal( (int) toHeal, m_Healer, false );
}
else
{

View file

@ -68,7 +68,7 @@ namespace Server.Items
{
from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil
}
else if ( TransformationSpell.UnderTransformation( from ) )
else if ( TransformationSpellHelper.UnderTransformation( from ) )
{
// You cannot disguise yourself while in that form.
from.SendLocalizedMessage( 1061634 );

View file

@ -155,11 +155,15 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
if ( !this.IsChildOf( from.Backpack ) )
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendMessage( "You may not do that in jail." );
}
else if( !this.IsChildOf( from.Backpack ) )
{
MessageHelper.SendLocalizedMessageTo( this, from, 1054107, 0x59 ); // The bag of sending must be in your backpack.
}
else if ( this.Charges == 0 )
else if( this.Charges == 0 )
{
MessageHelper.SendLocalizedMessageTo( this, from, 1042544, 0x59 ); // This item is out of charges.
}
@ -183,7 +187,11 @@ namespace Server.Items
if ( m_Bag.Deleted )
return;
if ( !m_Bag.IsChildOf( from.Backpack ) )
if( from.Region.IsPartOf( typeof( Regions.Jail ) ) )
{
from.SendMessage( "You may not do that in jail." );
}
else if( !m_Bag.IsChildOf( from.Backpack ) )
{
MessageHelper.SendLocalizedMessageTo( m_Bag, from, 1054107, 0x59 ); // The bag of sending must be in your backpack.
}

View file

@ -102,7 +102,42 @@ namespace Server.Items
SkillName.Bushido
};
public static SkillName[] Skills{ get{ return ( Core.SE ? m_SESkills : Core.AOS ? m_AOSSkills : m_Skills ); } }
private static SkillName[] m_MLSkills = new SkillName[]
{
SkillName.Blacksmith,
SkillName.Tailoring,
SkillName.Swords,
SkillName.Fencing,
SkillName.Macing,
SkillName.Archery,
SkillName.Wrestling,
SkillName.Parry,
SkillName.Tactics,
SkillName.Anatomy,
SkillName.Healing,
SkillName.Magery,
SkillName.Meditation,
SkillName.EvalInt,
SkillName.MagicResist,
SkillName.AnimalTaming,
SkillName.AnimalLore,
SkillName.Veterinary,
SkillName.Musicianship,
SkillName.Provocation,
SkillName.Discordance,
SkillName.Peacemaking,
SkillName.Chivalry,
SkillName.Focus,
SkillName.Necromancy,
SkillName.Stealing,
SkillName.Stealth,
SkillName.SpiritSpeak,
SkillName.Ninjitsu,
SkillName.Bushido,
SkillName.Spellweaving
};
public static SkillName[] Skills{ get{ return ( Core.ML ? m_MLSkills : Core.SE ? m_SESkills : Core.AOS ? m_AOSSkills : m_Skills ); } }
public static PowerScroll CreateRandom( int min, int max )
{

View file

@ -3,6 +3,7 @@ using System.Collections;
using Server.Mobiles;
using Server.Spells.Necromancy;
using Server.Network;
using Server.Spells;
namespace Server.Items
{
@ -27,7 +28,7 @@ namespace Server.Items
ClearCurrentAbility( attacker );
// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
TransformContext context = TransformationSpell.GetContext( defender );
TransformContext context = TransformationSpellHelper.GetContext( defender );
if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )

View file

@ -1,5 +1,6 @@
using System;
using Server;
using Server.Spells.Spellweaving;
namespace Server.Items
{
@ -17,9 +18,11 @@ namespace Server.Items
{
damage = base.AbsorbDamage( attacker, defender, damage );
AttuneWeaponSpell.TryAbsorb( defender, ref damage );
if ( Core.AOS )
return damage;
int absorb = defender.MeleeDamageAbsorb;
if ( absorb > 0 )

View file

@ -11,6 +11,7 @@ using Server.Spells.Ninjitsu;
using Server.Factions;
using Server.Engines.Craft;
using System.Collections.Generic;
using Server.Spells.Spellweaving;
namespace Server.Items
{
@ -865,12 +866,20 @@ namespace Server.Items
if( Feint.Registry.Contains( m ) )
bonus -= ((Feint.FeintTimer)Feint.Registry[m]).SwingSpeedReduction;
TransformContext context = TransformationSpellHelper.GetContext( m );
if( context != null && context.Spell is ReaperFormSpell )
bonus += ((ReaperFormSpell)context.Spell).SwingSpeedBonus;
int discordanceEffect = 0;
// Discordance gives a malus of -0/-28% to swing speed.
if ( SkillHandlers.Discordance.GetEffect( m, ref discordanceEffect ) )
bonus -= discordanceEffect;
if( EssenceOfWindSpell.IsDebuffed( m ) )
bonus -= EssenceOfWindSpell.GetSSIMalus( m );
if ( bonus > 60 )
bonus = 60;
@ -1323,18 +1332,26 @@ namespace Server.Items
* The following damage bonuses multiply damage by a factor.
* Capped at x3 (300%).
*/
double factor = 1.0;
//double factor = 1.0;
int percentageBonus = 0;
WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );
SpecialMove move = SpecialMove.GetCurrentMove( attacker );
if ( a != null )
factor *= a.DamageScalar;
if( a != null )
{
//factor *= a.DamageScalar;
percentageBonus += (int)(a.DamageScalar * 100) - 100;
}
if ( move != null )
factor *= move.GetDamageScalar( attacker, defender );
if( move != null )
{
//factor *= move.GetDamageScalar( attacker, defender );
percentageBonus += (int)(move.GetDamageScalar( attacker, defender ) * 100) - 100;
}
factor *= damageBonus;
//factor *= damageBonus;
percentageBonus += (int)(damageBonus * 100) - 100;
CheckSlayerResult cs = CheckSlayers( attacker, defender );
@ -1343,7 +1360,8 @@ namespace Server.Items
if ( cs == CheckSlayerResult.Slayer )
defender.FixedEffect( 0x37B9, 10, 5 );
factor *= 2.0;
//factor *= 2.0;
percentageBonus += 100;
}
if ( !attacker.Player )
@ -1352,8 +1370,11 @@ namespace Server.Items
{
PlayerMobile pm = (PlayerMobile)defender;
if ( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
factor *= 2.0;
if( pm.EnemyOfOneType != null && pm.EnemyOfOneType != attacker.GetType() )
{
//factor *= 2.0;
percentageBonus += 100;
}
}
}
else if ( !defender.Player )
@ -1371,39 +1392,58 @@ namespace Server.Items
if ( pm.EnemyOfOneType == defender.GetType() )
{
defender.FixedEffect( 0x37B9, 10, 5, 1160, 0 );
factor *= 1.5;
//factor *= 1.5;
percentageBonus += 50;
}
}
}
int packInstinctBonus = GetPackInstinctBonus( attacker, defender );
if ( packInstinctBonus != 0 )
factor *= 1.0 + (double)packInstinctBonus / 100.0;
if( packInstinctBonus != 0 )
{
//factor *= 1.0 + (double)packInstinctBonus / 100.0;
percentageBonus += packInstinctBonus;
}
if ( m_InDoubleStrike )
factor *= 0.9; // 10% loss when attacking with double-strike
if( m_InDoubleStrike )
{
//factor *= 0.9; // 10% loss when attacking with double-strike
percentageBonus -= 10;
}
TransformContext context = TransformationSpell.GetContext( defender );
TransformContext context = TransformationSpellHelper.GetContext( defender );
if ( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Type != typeof( HorrificBeastSpell ) )
factor *= 1.25; // Every necromancer transformation other than horrific beast takes an additional 25% damage
if( (m_Slayer == SlayerName.Silver || m_Slayer2 == SlayerName.Silver) && context != null && context.Spell is NecromancerSpell && context.Type != typeof( HorrificBeastSpell ) )
{
//factor *= 1.25; // Every necromancer transformation other than horrific beast takes an additional 25% damage
percentageBonus += 25;
}
if ( attacker is PlayerMobile && !(Core.ML && defender is PlayerMobile ))
{
PlayerMobile pmAttacker = (PlayerMobile) attacker;
PlayerMobile pmAttacker = (PlayerMobile) attacker;
if ( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
factor *= 1.25;
if( pmAttacker.HonorActive && pmAttacker.InRange( defender, 1 ) )
{
//factor *= 1.25;
percentageBonus += 25;
}
if ( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
pmAttacker.SentHonorContext.ApplyPerfectionDamageBonus( ref factor );
if( pmAttacker.SentHonorContext != null && pmAttacker.SentHonorContext.Target == defender )
{
//pmAttacker.SentHonorContext.ApplyPerfectionDamageBonus( ref factor );
percentageBonus += pmAttacker.SentHonorContext.PerfectionDamageBonus;
}
}
if ( factor > 3.0 )
factor = 3.0;
//if ( factor > 3.0 )
// factor = 3.0;
damage = (int)(damage * factor);
percentageBonus = Math.Min( percentageBonus, 300 );
//damage = (int)(damage * factor);
damage = AOS.Scale( damage, 100 + percentageBonus );
#endregion
if ( attacker is BaseCreature )
@ -1496,7 +1536,7 @@ namespace Server.Items
if ( m_Cursed )
lifeLeech += 50; // Additional 50% life leech for cursed weapons (necro spell)
context = TransformationSpell.GetContext( attacker );
context = TransformationSpellHelper.GetContext( attacker );
if ( context != null && context.Type == typeof( VampiricEmbraceSpell ) )
lifeLeech += 20; // Vampiric embrace gives an additional 20% life leech
@ -1666,6 +1706,11 @@ namespace Server.Items
// SDI bonus
damageBonus += AosAttributes.GetValue( attacker, AosAttribute.SpellDamage );
TransformContext context = TransformationSpellHelper.GetContext( attacker );
if( context != null && context.Spell is ReaperFormSpell )
damageBonus += ((ReaperFormSpell)context.Spell).SpellDamageBonus;
}
damage = AOS.Scale( damage, 100 + damageBonus );
@ -1753,7 +1798,7 @@ namespace Server.Items
attacker.DoHarmful( defender );
Spells.Spell sp = new Spells.Sixth.DispelSpell( attacker, null );
Spells.MagerySpell sp = new Spells.Sixth.DispelSpell( attacker, null );
if ( sp.CheckResisted( defender ) )
{
@ -2092,7 +2137,7 @@ namespace Server.Items
int damageBonus = AosAttributes.GetValue( attacker, AosAttribute.WeaponDamage );
// Horrific Beast transformation gives a +25% bonus to damage.
if ( TransformationSpell.UnderTransformation( attacker, typeof( HorrificBeastSpell ) ) )
if( TransformationSpellHelper.UnderTransformation( attacker, typeof( HorrificBeastSpell ) ) )
damageBonus += 25;
// Divine Fury gives a +10% bonus to damage.
@ -3296,12 +3341,18 @@ namespace Server.Items
if ( tool is BaseRunicTool )
((BaseRunicTool)tool).ApplyAttributesTo( this );
if ( quality == 2 )
if ( Quality == WeaponQuality.Exceptional )
{
if ( Attributes.WeaponDamage > 35 )
Attributes.WeaponDamage -= 20;
else
Attributes.WeaponDamage = 15;
if( Core.ML )
{
Attributes.WeaponDamage += (int)(from.Skills.ArmsLore.Value / 20);
from.CheckSkill( SkillName.ArmsLore, 0, 100 );
}
}
}
else if ( tool is BaseRunicTool )

View file

@ -21,6 +21,7 @@ namespace Server.Items
public override int OldSpeed{ get{ return 50; } }
public override int DefMissSound{ get{ return 0x239; } }
public override SkillName DefSkill { get { return SkillName.Fencing; } }
public override int InitMinHits{ get{ return 30; } } // TODO
public override int InitMaxHits{ get{ return 60; } } // TODO