Server.Items.BaseRunicTool.ApplyAttributesTo C# (CSharp) Method

ApplyAttributesTo() public static method

public static ApplyAttributesTo ( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount ) : void
armor BaseArmor
isRunicTool bool
luckChance int
attributeCount int
return void
		public static void ApplyAttributesTo( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount )
		{
			m_IsRunicTool = isRunicTool;
			m_LuckChance = luckChance;

			m_Props.SetAll( false );

			bool isShield = ( armor is BaseShield );
			int baseCount = ( isShield ? 7 : 20 );
			int baseOffset = ( isShield ? 0 : 4 );

			if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All )
				m_Props.Set( 3, true ); // remove mage armor from possible properties
			if ( armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather )
			{
				m_Props.Set( 0, true ); // remove lower requirements from possible properties for leather armor
				m_Props.Set( 2, true ); // remove durability bonus from possible properties
			}
			if ( armor.RequiredRace == Race.Elf )
				m_Props.Set( 7, true ); // elves inherently have night sight and elf only armor doesn't get night sight as a mod

			for ( int i = 0; i < attributeCount; ++i )
			{
				int random = GetUniqueRandom( baseCount );

				if ( random == -1 )
					break;

				random += baseOffset;
			}
		}

Same methods

BaseRunicTool::ApplyAttributesTo ( BaseArmor armor, int attributeCount ) : void
BaseRunicTool::ApplyAttributesTo ( BaseWeapon weapon, bool isRunicTool, int luckChance, int attributeCount ) : void
BaseRunicTool::ApplyAttributesTo ( BaseWeapon weapon, int attributeCount ) : void
BaseRunicTool::ApplyAttributesTo ( Spellbook spellbook, bool isRunicTool, int luckChance, int attributeCount ) : void
BaseRunicTool::ApplyAttributesTo ( bool isRunicTool, int luckChance, int attributeCount ) : void
BaseRunicTool::ApplyAttributesTo ( int attributeCount ) : void

Usage Example

Exemplo n.º 1
0
        public TurqouiseRing() : base()
        {
            Weight = 1.0;

            BaseRunicTool.ApplyAttributesTo(this, Utility.RandomMinMax(1, 3), 0, 100);

            if (Utility.Random(100) < 10)
            {
                Attributes.WeaponSpeed += 5;
            }
            else
            {
                Attributes.WeaponDamage += 15;
            }
        }
All Usage Examples Of Server.Items.BaseRunicTool::ApplyAttributesTo