当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.AddStatMod方法代码示例

本文整理汇总了C#中Mobile.AddStatMod方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.AddStatMod方法的具体用法?C# Mobile.AddStatMod怎么用?C# Mobile.AddStatMod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile的用法示例。


在下文中一共展示了Mobile.AddStatMod方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyAgeStatMod

        private static TimeSpan AutoRenewDelay = TimeSpan.FromDays( 15 ); // How many Earth Days are equivalent to One Year for characters?

        #endregion Fields

        #region Methods

        public static void ApplyAgeStatMod( Mobile from )
        {
            try
            {
                double age = double.Parse( ((Account)from.Account).GetTag( "Age of " + (from.RawName) ) );

                double strBonus, dexBonus, intBonus;

                if ( age < topStrAge )
                    strBonus = age / topStrAge * maxBonus;
                else
                    strBonus = (topStrAge / age * maxBonus) + (topStrAge / age * maxBonus - maxBonus);

                if ( age < topDexAge )
                    dexBonus = age / topDexAge * maxBonus;
                else
                    dexBonus = (topDexAge / age * maxBonus) + (topDexAge / age * maxBonus - maxBonus);

                if ( age < topIntAge )
                    intBonus = age / topIntAge * maxBonus ;
                else
                    intBonus = (topIntAge / age * maxBonus) + (topIntAge / age * maxBonus - maxBonus);

                from.AddStatMod( new StatMod( StatType.Str, "AgeModStr", (int)strBonus, TimeSpan.Zero ) );
                from.AddStatMod( new StatMod( StatType.Dex, "AgeModDex", (int)dexBonus, TimeSpan.Zero ) );
                from.AddStatMod( new StatMod( StatType.Int, "AgeModInt", (int)intBonus, TimeSpan.Zero ) );
            }
            catch
            {
                from.SendMessage( 33, "Your age is not defined as a number! Report it to a staff member urgently!" );
            }
        }
开发者ID:Vorpalstar,项目名称:runuo-custom-scripts,代码行数:38,代码来源:AgeSystem.cs

示例2: OnEquip

        public override bool OnEquip( Mobile m ) 
		{ 
			string modName = this.Serial.ToString();
			m.AddStatMod( new StatMod( StatType.Int, modName + "Int", (int)(.5 * m.ManaMax ), TimeSpan.Zero ) );
			m.SendMessage( "You feel smarter now!" );
			return base.OnEquip( m );
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:7,代码来源:SpinalTapBandana.cs

示例3: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Neck ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Helm ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.ReflectPhysical, 25 ) );
            mods.Add( new AttributeMod( MagicalAttribute.Luck, 100 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            m.AddStatMod( new StatMod( StatType.Str, "DarkwoodSetStr", 10, TimeSpan.Zero ) );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:25,代码来源:DarkwoodSet.cs

示例4: SetMods

		private void SetMods( Mobile wearer )
		{			
			wearer.AddSkillMod( m_SkillMod0 ); 
			wearer.AddSkillMod( m_SkillMod1 ); 
			wearer.AddSkillMod( m_SkillMod2 ); 
			wearer.AddStatMod( m_StatMod0 ); 
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:7,代码来源:CloakOfTheNecromancer.cs

示例5: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );

            List<object> mods = new List<object>();

            mods.Add( new AttributeMod( MagicalAttribute.BonusInt, 6 ) );
            mods.Add( new AttributeMod( MagicalAttribute.RegenMana, 2 ) );
            mods.Add( new AttributeMod( MagicalAttribute.DefendChance, 10 ) );
            mods.Add( new AttributeMod( MagicalAttribute.LowerManaCost, 5 ) );
            mods.Add( new AttributeMod( MagicalAttribute.LowerRegCost, 40 ) );
            mods.Add( new ResistanceMod( ResistanceType.Physical, 28 ) );
            mods.Add( new ResistanceMod( ResistanceType.Fire, 28 ) );
            mods.Add( new ResistanceMod( ResistanceType.Cold, 28 ) );
            mods.Add( new ResistanceMod( ResistanceType.Poison, 28 ) );
            mods.Add( new ResistanceMod( ResistanceType.Energy, 28 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            m.AddStatMod( new StatMod( StatType.Int, "SorcerersSetInt", 6, TimeSpan.Zero ) );

            m.FindItemOnLayer( Layer.InnerTorso ).InvalidateProperties();
            m.FindItemOnLayer( Layer.Pants ).InvalidateProperties();
            m.FindItemOnLayer( Layer.Arms ).InvalidateProperties();
            m.FindItemOnLayer( Layer.Gloves ).InvalidateProperties();
            m.FindItemOnLayer( Layer.Helm ).InvalidateProperties();
            m.FindItemOnLayer( Layer.Neck ).InvalidateProperties();
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:33,代码来源:SorcerersSet.cs

示例6: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {

            if (Parent != from)
            {
                from.SendMessage("The Sword must be eqquiped to use.");
            }
            else if (from.Title != "Merlin's Apprentance")
            {
                from.Title = "Merlin's Apprentance";

                from.BoltEffect(0);
                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);

                m_StatMod0 = new StatMod(StatType.Str, "MOD0", 10, TimeSpan.Zero);
                m_StatMod1 = new StatMod(StatType.Int, "MOD1", 10, TimeSpan.Zero);

                from.AddStatMod(m_StatMod0);
                from.AddStatMod(m_StatMod1);

                this.WeaponAttributes.HitLeechHits = 65;
                this.WeaponAttributes.HitLeechMana = 45;
                this.Attributes.WeaponSpeed = 30;
            }
            else
            {
                from.BoltEffect(0);
                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);

                from.Title = null;

                from.RemoveStatMod("MOD0");
                from.RemoveStatMod("MOD1");

                this.WeaponAttributes.HitLeechHits = 25;
                this.WeaponAttributes.HitLeechMana = 25;
                this.Attributes.WeaponSpeed = 15;
            }
        }
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:39,代码来源:BladeofTorment.cs

示例7: Eat

        }// fruit bowl
        public override bool Eat(Mobile from)
        {
            if (FillHunger(from, this.FillFactor))
            {
                string modName = this.Serial.ToString();
				
                from.AddStatMod(new StatMod(StatType.Str, modName + "Str", (int)(from.RawStr * 0.08), TimeSpan.FromSeconds(75)));
				
                from.PlaySound(0x1EA);
                from.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
				
                this.Consume();		
				
                return true;
            }
			
            return false;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:19,代码来源:FruitBowl.cs

示例8: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            // +10 dex (total)
            m.AddStatMod( new StatMod( StatType.Dex, "AssassinSetDex", 12, TimeSpan.Zero ) );

            // +30 stealth (total)
            SkillMod skillmod = new DefaultSkillMod( SkillName.Stealth, true, 30.0 );
            skillmod.ObeyCap = true;
            m_Table.Add( m, skillmod );
            m.AddSkillMod( skillmod );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:21,代码来源:AssassinSet.cs

示例9: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon );
            ApplyBonus( m.FindItemOnLayer( Layer.TwoHanded ) as BaseShield );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.WeaponSpeed, 35 ) );
            mods.Add( new AttributeMod( MagicalAttribute.DefendChance, 10 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +10 str (total)
            m.AddStatMod( new StatMod( StatType.Str, "JuggernautSetStr", 10, TimeSpan.Zero ) );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:22,代码来源:JuggernautSet.cs

示例10: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Cloak ) as Feathernock );
            ApplyBonus( m.FindItemOnLayer( Layer.TwoHanded ) as Swiftflight );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.WeaponSpeed, 30 ) );
            mods.Add( new AttributeMod( MagicalAttribute.AttackChance, 15 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +8 dex (total)
            m.AddStatMod( new StatMod( StatType.Dex, "MarksmanSetStr", 8, TimeSpan.Zero ) );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:22,代码来源:MarksmanSet.cs

示例11: ApplyBonus

        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.SpellDamage, 15 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +10 int (total)
            m.AddStatMod( new StatMod( StatType.Int, "LeafweaveSetInt", 10, TimeSpan.Zero ) );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:23,代码来源:LeafweaveSet.cs

示例12: OnTarget

		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				if ( target.GetStatMod( "MindBlast" ) == null )
				{
					int offset = (int)(target.Skills[SkillName.Magery].Value / 2);
					offset += (int)(target.Skills[SkillName.Necromancy].Value / 2);
					offset += (int)(target.Skills[SkillName.EvalInt].Value / 4);
					offset += (int)(target.Skills[SkillName.SpiritSpeak].Value / 4);

					if ( target is PlayerMobile )
						offset /= 2;

					offset -= ((int)ScaleBySkill( target, SkillName.MagicResist )) -5;

					if ( offset < 15 )
						offset = 15;

					int duration = (int)(Caster.Skills[CastSkill].Value * 2);

					target.AddStatMod( new StatMod( StatType.Int, "MindBlast", -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Meditation, true, -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Focus, true, -offset, TimeSpan.FromSeconds( duration ) ) );

					target.SendMessage("Your mind has been blown!");

					SpellHelper.Damage( this, target, offset * 2, 0, 0, 100, 0, 0 );
				}

				target.FixedParticles( 0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head );
				target.PlaySound( 0x213 );
				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:37,代码来源:MindBlast.cs

示例13: SetMods

		private void SetMods( Mobile m )
		{
			m.AddStatMod( m_StatMod0 );
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:4,代码来源:Elixirs.cs

示例14: AddStatBonuses

		public virtual void AddStatBonuses( Mobile parent )
		{
			if ( parent == null )
				return;

			int strBonus = ComputeStatBonus( StatType.Str );
			int dexBonus = ComputeStatBonus( StatType.Dex );
			int intBonus = ComputeStatBonus( StatType.Int );

			if ( strBonus == 0 && dexBonus == 0 && intBonus == 0 )
				return;

			string modName = this.Serial.ToString();

			if ( strBonus != 0 )
				parent.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

			if ( dexBonus != 0 )
				parent.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

			if ( intBonus != 0 )
				parent.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:23,代码来源:BaseClothing.cs

示例15: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
            }
            else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
            {
                from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.
            }
            else
            {
                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));

                this.Consume();
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:18,代码来源:RoseOfTrinsic.cs


注:本文中的Mobile.AddStatMod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。