Отрывок из БейсДжевел:
Код
{
None,
StarSapphire,
Emerald,
Sapphire,
Ruby,
Citrine,
Amethyst,
Tourmaline,
Amber,
Diamond
}
public abstract class BaseJewel : Item, ICraftable
{
private int m_MaxHitPoints;
private int m_HitPoints;
private AosAttributes m_AosAttributes;
private AosElementAttributes m_AosResistances;
private AosSkillBonuses m_AosSkillBonuses;
private CraftResource m_Resource;
private GemType m_GemType;
private AosWeaponAttributes m_AosWeaponAttributes;
[CommandProperty( AccessLevel.GameMaster )]
public AosWeaponAttributes WeaponAttributes
{
get{ return m_AosWeaponAttributes; }
set{}
}
[CommandProperty( AccessLevel.GameMaster )]
public int MaxHitPoints
{
get{ return m_MaxHitPoints; }
set{ m_MaxHitPoints = value; InvalidateProperties(); }
}
[CommandProperty( AccessLevel.GameMaster )]
public int HitPoints
{
get
{
return m_HitPoints;
}
set
{
if ( value != m_HitPoints && MaxHitPoints > 0 )
{
m_HitPoints = value;
Отрывок из АОС:
Код
public AosWeaponAttributes( Item owner, GenericReader reader )
: base( owner, reader )
{
}
public static int GetValue( Mobile m, AosWeaponAttribute attribute )
{
if( !Core.AOS )
return 0;
List<Item> items = m.Items;
int value = 0;
for( int i = 0; i < items.Count; ++i )
{
Item obj = items[i];
if( obj is BaseWeapon )
{
AosWeaponAttributes attrs = ((BaseWeapon)obj).WeaponAttributes;
if( attrs != null )
value += attrs[attribute];
}
else if( obj is BaseJewel )
{
AosWeaponAttributes attrs = ((BaseJewel)obj).WeaponAttributes;
if( attrs != null )
value += attrs[attribute];
}
}
return value;
}
public int this[AosWeaponAttribute attribute]
{
get { return GetValue( (int)attribute ); }
set { SetValue( (int)attribute, value ); }
}
Есть тестовый скрипт ювы:
Код
using System;
using Server;
namespace Server.Items
{
public class Qqq : GoldBracelet
{
public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }
[Constructable]
public Qqq()
{
Name = "QQQ";
Hue = 1157;
WeaponAttributes.HitLightning = 30;
}
public Qqq( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
При попытке добавить этот браслет, он не добавляется и ранка выдает сообщение, что я привел выше. Краша при этом нету, все продолжает работать. Просто не добавляется.
Собственно вот.