RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Scripting Attributes - A guide

Hammerhand

Knight
I'm sure this isnt a complete list, but it definetly isnt basic either.. ;) Just a "simple" guide on the various attributes for scripting weapons, armor, jewelry, clothing & mobs. Includes through Stygian Abyss.

---------------------------------------------


WeaponAttributes.LowerStatReq =
WeaponAttributes.SelfRepair =
WeaponAttributes.HitLeechHits =
WeaponAttributes.HitLeechStam =
WeaponAttributes.HitLeechMana =
WeaponAttributes.HitLowerAttack =
WeaponAttributes.HitLowerDefend =
WeaponAttributes.HitMagicArrow =
WeaponAttributes.HitHarm =
WeaponAttributes.HitFireball =
WeaponAttributes.HitLightning =
WeaponAttributes.HitDispel =
WeaponAttributes.HitColdArea =
WeaponAttributes.HitFireArea =
WeaponAttributes.HitPoisonArea =
WeaponAttributes.HitEnergyArea =
WeaponAttributes.HitPhysicalArea =
WeaponAttributes.ResistPhysicalBonus =
WeaponAttributes.ResistFireBonus =
WeaponAttributes.ResistColdBonus =
WeaponAttributes.ResistPoisonBonus =
WeaponAttributes.ResistEnergyBonus =
WeaponAttributes.UseBestSkill =
WeaponAttributes.MageWeapon =
WeaponAttributes.DurabilityBonus =
WeaponAttributes.BloodDrinker =
WeaponAttributes.HitCurse =
WeaponAttributes.HitFatigue =
WeaponAttributes.ManaDrain =
------------------------
Armor attributes
ArmorAttributes.LowerStatReq =
ArmorAttributes.SelfRepair =
ArmorAttributes.MageArmor =
ArmorAttributes.DurabilityBonus =
ArmorAttributes.SoulCharge =
--------------------------
Weapon & Armor misc attributes
Attributes.RegenHits =
Attributes.RegenStam =
Attributes.RegenStam =
Attributes.DefendChance =
Attributes.AttackChance =
Attributes.BonusStr =
Attributes.BonusDex =
Attributes.BonusInt =
Attributes.BonusHits =
Attributes.BonusStam =
Attributes.BonusMana =
Attributes.WeaponDamage =
Attributes.WeaponSpeed =
Attributes.SpellDamage =
Attributes.CastRecovery =
Attributes.CastSpeed =
Attributes.LowerManaCost =
Attributes.LowerRegCost =
Attributes.ReflectPhysical =
Attributes.EnhancePotions =
Attributes.Luck =
Attributes.SpellChanneling =
Attributes.NightSight =
Attributes.IncreasedKarmaLoss =
----------------------------------
Stygian Abyss Absorption attributes
AbsorptionAttribute.EaterFire =
AbsorptionAttribute.EaterCold =
AbsorptionAttribute.EaterPoison =
AbsorptionAttribute.EaterEnergy =
AbsorptionAttribute.EaterKinetic =
AbsorptionAttribute.EaterDamage =
AbsorptionAttribute.ResonanceFire =
AbsorptionAttribute.ResonanceCold =
AbsorptionAttribute.ResonancePoison =
AbsorptionAttribute.ResonanceEnergy =
AbsorptionAttribute.ResonanceKinetic =
AbsorptionAttribute.SoulChargeFire =
AbsorptionAttribute.SoulChargeCold =
AbsorptionAttribute.SoulChargePoison =
AbsorptionAttribute.SoulChargeEnergy =
AbsorptionAttribute.SoulChargeKinetic =
AbsorptionAttribute.CastingFocus =
-----------------------------
SA Weapon attributes
WeaponAttributes.BattleLust = 1;
WeaponAttributes.BloodDrinker = 1;
WeaponAttributes.DamageEater = 1;
WeaponAttributes.CastingFocus = 1;
WeaponAttributes.SlinteringWeapon = 1;

Velocity = **; // Thrown weapons
------------------------------------
SA Armor Attributes
ArmorAttributes.ReactiveParalyze = 1;
----------------------------------
Item rarity
public override int ArtifactRarity { get { return Utility.RandomMinMax(20, 1000); } } // gives random number in this range for each one
public override int ArtifactRarity { get { return Utility(1500); } } //same number shows on all
------------------------------
Loot types
LootType = LootType.Blessed; // cant be stolen, always lands in pack on death
LootType = LootType.Cursed;
-----------------------------
Race Requirement
public override bool CanBeWornByRaceHere{ get{ return true; } }
public override Race RequiredRace { get { return Race.RaceHere; } }
------------------------
Naming the item

Name = "YourItemNameHere";

--------------------------------------------

Slayers
Slayer = SlayerName.Silver; // undead slayer
Slayer = SlayerName.OrcSlaying;
Slayer = SlayerName.TrollSlaughter;
Slayer = SlayerName.OgreThrashing;
Slayer = SlayerName.Repond; // repond slayer
Slayer = SlayerName.DragonSlaying;
Slayer = SlayerName.Terathan;
Slayer = SlayerName.SnakesBane;
Slayer = SlayerName.LizardmanSlaughter;
Slayer = SlayerName.ReptilianDeath;
Slayer = SlayerName.DaemonDismissal;
Slayer = SlayerName.GargoylesFoe;
Slayer = SlayerName.BalronDamnation;
Slayer = SlayerName.Exorcism;
Slayer = SlayerName.Ophidian;
Slayer = SlayerName.SpidersDeath;
Slayer = SlayerName.ScorpiansBane;
Slayer = SlayerName.ArachnidDoom;
Slayer = SlayerName.FlameDousing; // fire elemental slayer
Slayer = SlayerName.WaterDissipation; // water elemental slayer
Slayer = SlayerName.Vacuum; // air elemental slayer
Slayer = SlayerName.ElementalHealth; // poison elemental slayer
Slayer = SlayerName.EarthShatter;
Slayer = SlayerName.BloodDrinking;
Slayer = SlayerName.SummerWind; // snow elemental slayer
Slayer = SlayerName.ElementalBan; // elemental slayer
Slayer = SlayerName.Fey;
--------------------------
Jewelry & Clothing Attributes
Attributes.Luck = **;
Resistances.Fire = **;
Resistances.Cold = **;
Resistances.Poison = **;
Resistances.Energy = **;
--------------------------
Mob "attributes"
SetStr(***, ***);
SetDex(***, ***);
SetInt(***, ***);
SetDamage(**, **);
SetHits(****, *****);
SetDamageType(ResistanceType.Physical, **);
SetDamageType( ResistanceType.Cold, ** );
SetDamageType( ResistanceType.Fire, ** );
SetDamageType( ResistanceType.Energy, ** );
SetDamageType( ResistanceType.Poison, ** );
SetResistance(ResistanceType.Physical, *, **); << min & max
SetResistance(ResistanceType.Fire, **, **);
SetResistance(ResistanceType.Cold, **, **);
SetResistance(ResistanceType.Poison, **, **);
SetResistance(ResistanceType.Energy, **, **);
SetSkill(SkillName.MagicResist, **.*, **.*); << min & max
SetSkill(SkillName.Swords, **.*, **.*);
SetSkill(SkillName.Tactics, **.*, **.*);
SetSkill(SkillName.Wrestling, **.*, **.*);
SetSkill(SkillName.Healing, **.*);
----------------------------
ElementAttributes.Physical =
ElementAttributes.Fire =
ElementAttributes.Cold =
ElementAttributes.Poison =
ElementAttributes.Energy =
ElementAttributes.Chaos =
ElementAttributes.Direct =
Example: This will give damage of 50 in both poison & energy
public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
{
phys = fire = cold = chaos = direct = 0;
pois = nrgy = 50;
}
-----------------------------
Skill Bonus additions
SkillBonuses.SetValues(0, SkillName.SkillNameHere, **.*);
----------------------------------
Loot types for drops
PacKItem (drops everytime, can be stolen)
VirtualArmor = 56; // placement indicator
PackItem(new YourItemHere());
PackItem (random drop, can be stolen)
VirtualArmor = 60; //placement indicator
switch (Utility.Random(5))
{
case 0: PackItem(new YourItemHere()); break;
}
OnBeforeDeath (random chance)
public override bool OnBeforeDeath()
{
switch (Utility.Random(3))
{
case 0: PackItem(new YourItemHere()); break;
}
return base.OnBeforeDeath();
OnBeforeDeath (drops everytime)
public override bool OnBeforeDeath()
{
case 0: PackItem(new YourItemHere()); break;
return base.OnBeforeDeath();

OnDeath (Container c) (random chance)
public override void OnDeath(Container c)
{
base.OnDeath(c);
if (0.50 > Utility.RandomDouble()) // 50% chance to drop
{

c.DropItem(new YourItemHere());

}
OnDeath (Container c) (drops everytime)
public override void OnDeath(Container c)
{
base.OnDeath(c);
{

c.DropItem(new YourItemHere());

}
 

Vorspire

Knight
BaseClothing.cs

C#:
		[CommandProperty( AccessLevel.GameMaster )]
		public AosAttributes Attributes
		{
			get{ return m_AosAttributes; }
			set{}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosArmorAttributes ClothingAttributes
		{
			get{ return m_AosClothingAttributes; }
			set{}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosSkillBonuses SkillBonuses
		{
			get{ return m_AosSkillBonuses; }
			set{}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public AosElementAttributes Resistances
		{
			get{ return m_AosResistances; }
			set{}
		}
 

Hammerhand

Knight
Yes, I know about that, but the AosClothing part isnt needed to work.
ie:
Code:
    public class CrimsonCincture : HalfApron, ITokunoDyable
    {
        public override int LabelNumber{ get{ return 1075043; } } // Crimson Cincture
   
        [Constructable]
        public CrimsonCincture() : base()
        {
            Hue = 0x485;
           
            Attributes.BonusDex = 5;
            Attributes.BonusHits = 10;
            Attributes.RegenHits = 2;
        }
HalfApron - BaseWaist - BaseClothing
Not trying to pick a fight, I just posted them as I have found them to work.
 

Vorspire

Knight
I think you misunderstand my intention; I'm pointing out that on BaseArmor, one would access ArmorAttributes for the AosArmorAttributes, but on clothing, the naming is different and you must access ClothingAttributes for the AosArmorAttributes. Nothing of what I have said has been about the standard AosAttributes, which is accessed on all supported items via the Attributes property, as you covered.
 
Top