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


C# DefaultSkillMod类代码示例

本文整理汇总了C#中DefaultSkillMod的典型用法代码示例。如果您正苦于以下问题:C# DefaultSkillMod类的具体用法?C# DefaultSkillMod怎么用?C# DefaultSkillMod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: 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 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +10 chivalry (total)
            SkillMod skillmod = new DefaultSkillMod( SkillName.Chivalry, true, 10.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,代码行数:28,代码来源:PaladinSet.cs

示例2: Target

		public void Target( Mobile m )
		{
			if ( !(m is BaseCreature || m is PlayerMobile) )
			{
				Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Curses the target so that the next harmful event that affects them is magnified.
				 * Damage to the target's hit points is increased 25%,
				 * the poison level of the attack will be 1 higher
				 * and the Resist Magic skill of the target will be fixed on 50.
				 * 
				 * The effect lasts for one harmful event only.
				 */

				if ( m.Spell != null )
					m.Spell.OnCasterHurt();

				m.PlaySound( 0xFC );
				m.FixedParticles( 0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head );
				m.FixedParticles( 0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head );

				if ( !m_Table.Contains( m ) )
				{
					SkillMod mod = new DefaultSkillMod( SkillName.MagicResist, false, 50.0 );

					if ( m.Skills[SkillName.MagicResist].Base > 50.0 )
						m.AddSkillMod( mod );

					m_Table[m] = mod;
				}

				TimeSpan duration = TimeSpan.FromSeconds( (Caster.Skills[SkillName.SpiritSpeak].Value / 12) + 1.0 );

				Timer.DelayCall( duration, new TimerStateCallback( EffectExpire_Callback ), m );

				HarmfulSpell( m );

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EvilOmen, 1075647, 1075648, duration, m));

			}

			FinishSequence();
		}
开发者ID:suiy187,项目名称:runuocustom,代码行数:47,代码来源:EvilOmen.cs

示例3: 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

示例4: OnEquip

		public override bool OnEquip(Mobile from)
		{
			int strBonus = m_AosAttributes.BonusStr;
			int dexBonus = m_AosAttributes.BonusDex;
			int intBonus = m_AosAttributes.BonusInt;

			if ((strBonus != 0 || dexBonus != 0 || intBonus != 0))
			{
				Mobile m = from;

				string modName = Serial.ToString();

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

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

				if (intBonus != 0)
				{
					m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
				}
			}

			from.NextCombatTime = Core.TickCount + (int)GetDelay(from).TotalMilliseconds;

			if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular)
			{
				if (m_SkillMod != null)
				{
					m_SkillMod.Remove();
				}

				m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int)m_AccuracyLevel * 5);
				from.AddSkillMod(m_SkillMod);
			}

			if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30)
			{
				if (m_MageMod != null)
				{
					m_MageMod.Remove();
				}

				m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
				from.AddSkillMod(m_MageMod);
			}

			XmlAttach.CheckOnEquip(this, from);

			return true;
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:56,代码来源:BaseWeapon.cs

示例5: Deserialize


//.........这里部分代码省略.........
						{
							m_Animation = (WeaponAnimation)(-1);
						}

						if (GetSaveFlag(flags, SaveFlag.Resource))
						{
							m_Resource = (CraftResource)reader.ReadInt();
						}
						else
						{
							m_Resource = CraftResource.Iron;
						}

						if (GetSaveFlag(flags, SaveFlag.xAttributes))
						{
							m_AosAttributes = new AosAttributes(this, reader);
						}
						else
						{
							m_AosAttributes = new AosAttributes(this);
						}

						if (GetSaveFlag(flags, SaveFlag.xWeaponAttributes))
						{
							m_AosWeaponAttributes = new AosWeaponAttributes(this, reader);
						}
						else
						{
							m_AosWeaponAttributes = new AosWeaponAttributes(this);
						}

						if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile)
						{
							m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int)m_AccuracyLevel * 5);
							((Mobile)Parent).AddSkillMod(m_SkillMod);
						}

						if (version < 7 && m_AosWeaponAttributes.MageWeapon != 0)
						{
							m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;
						}

						if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 &&
							Parent is Mobile)
						{
							m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
							((Mobile)Parent).AddSkillMod(m_MageMod);
						}

						if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
						{
							m_PlayerConstructed = true;
						}

						if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
						{
							m_AosSkillBonuses = new AosSkillBonuses(this, reader);
						}
						else
						{
							m_AosSkillBonuses = new AosSkillBonuses(this);
						}

						if (GetSaveFlag(flags, SaveFlag.Slayer2))
						{
							m_Slayer2 = (SlayerName)reader.ReadInt();
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:67,代码来源:BaseWeapon.cs

示例6: Deserialize


//.........这里部分代码省略.........

                        if( GetSaveFlag(flags, SaveFlag.Skill) )
                            m_Skill = (SkillName)reader.ReadInt();
                        else
                            m_Skill = (SkillName)(-1);

                        if( GetSaveFlag(flags, SaveFlag.Type) )
                            m_Type = (WeaponType)reader.ReadInt();
                        else
                            m_Type = (WeaponType)(-1);

                        if( GetSaveFlag(flags, SaveFlag.Animation) )
                            m_Animation = (WeaponAnimation)reader.ReadInt();
                        else
                            m_Animation = (WeaponAnimation)(-1);

                        if( GetSaveFlag(flags, SaveFlag.Resource) )
                            m_Resource = (CraftResource)reader.ReadInt();
                        else
                            m_Resource = CraftResource.Iron;

                        if( GetSaveFlag(flags, SaveFlag.xAttributes) )
                            m_AosAttributes = new AosAttributes(this, reader);
                        else
                            m_AosAttributes = new AosAttributes(this);

                        if( GetSaveFlag(flags, SaveFlag.xWeaponAttributes) )
                            m_AosWeaponAttributes = new AosWeaponAttributes(this, reader);
                        else
                            m_AosWeaponAttributes = new AosWeaponAttributes(this);

                        if( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
                        {
                            m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int)m_AccuracyLevel * 5);
                            ((Mobile)Parent).AddSkillMod(m_SkillMod);
                        }

                        if( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
                            m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;

                        if( Core.SE && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
                        {
                            m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
                            ((Mobile)Parent).AddSkillMod(m_MageMod);
                        }

                        if( GetSaveFlag(flags, SaveFlag.PlayerConstructed) )
                            m_PlayerConstructed = true;

                        if( GetSaveFlag(flags, SaveFlag.SkillBonuses) )
                            m_AosSkillBonuses = new AosSkillBonuses(this, reader);
                        else
                            m_AosSkillBonuses = new AosSkillBonuses(this);

                        if( GetSaveFlag(flags, SaveFlag.Slayer2) )
                            m_Slayer2 = (SlayerName)reader.ReadInt();

                        break;
                    }
                case 4:
                    {
                        m_Slayer = (SlayerName)reader.ReadInt();

                        goto case 3;
                    }
                case 3:
开发者ID:greeduomacro,项目名称:hubroot,代码行数:67,代码来源:BaseWeapon.cs

示例7: ApplySkillLoss

        public static void ApplySkillLoss(Mobile mob)
        {
            if (InSkillLoss(mob))
                return;

            SkillLossContext context = new SkillLossContext();
            m_SkillLoss[mob] = context;

            List<SkillMod> mods = context.m_Mods = new List<SkillMod>();

            for (int i = 0; i < mob.Skills.Length; ++i)
            {
                Skill sk = mob.Skills[i];
                double baseValue = sk.Base;

                if (baseValue > 0)
                {
                    SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * SkillLossFactor));

                    mods.Add(mod);
                    mob.AddSkillMod(mod);
                }
            }

            context.m_Timer = Timer.DelayCall(SkillLossPeriod, new TimerStateCallback(ClearSkillLoss_Callback), mob);
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:26,代码来源:Faction.cs

示例8: OnEquip

		public override bool OnEquip( Mobile from )
		{
			int strBonus = m_AosAttributes.BonusStr;
			int dexBonus = m_AosAttributes.BonusDex;
			int intBonus = m_AosAttributes.BonusInt;

			if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
			{
				Mobile m = from;

				string modName = this.Serial.ToString();

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

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

				if ( intBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
			}

			from.NextCombatTime = DateTime.Now + GetDelay( from );

			if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
			{
				if ( m_SkillMod != null )
					m_SkillMod.Remove();

				m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
				from.AddSkillMod( m_SkillMod );
			}

			if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 )
			{
				if ( m_MageMod != null )
					m_MageMod.Remove();

				m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
				from.AddSkillMod( m_MageMod );
			}

				// XmlAttachment check for OnEquip
	Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, from);

	return true;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:47,代码来源:BaseWeapon.cs

示例9: Deserialize


//.........这里部分代码省略.........

					if ( GetSaveFlag( flags, SaveFlag.Skill ) )
						m_Skill = (SkillName)reader.ReadInt();
					else
						m_Skill = (SkillName)(-1);

					if ( GetSaveFlag( flags, SaveFlag.Type ) )
						m_Type = (WeaponType)reader.ReadInt();
					else
						m_Type = (WeaponType)(-1);

					if ( GetSaveFlag( flags, SaveFlag.Animation ) )
						m_Animation = (WeaponAnimation)reader.ReadInt();
					else
						m_Animation = (WeaponAnimation)(-1);

					if ( GetSaveFlag( flags, SaveFlag.Resource ) )
						m_Resource = (CraftResource)reader.ReadInt();
					else
						m_Resource = CraftResource.Iron;

					if ( GetSaveFlag( flags, SaveFlag.xAttributes ) )
						m_AosAttributes = new AosAttributes( this, reader );
					else
						m_AosAttributes = new AosAttributes( this );

					if ( GetSaveFlag( flags, SaveFlag.xWeaponAttributes ) )
						m_AosWeaponAttributes = new AosWeaponAttributes( this, reader );
					else
						m_AosWeaponAttributes = new AosWeaponAttributes( this );

					if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
					{
						m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
						((Mobile)Parent).AddSkillMod( m_SkillMod );
					}

					if ( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
						m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;

					if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
					{
						m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
						((Mobile)Parent).AddSkillMod( m_MageMod );
					}

					if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
						m_PlayerConstructed = true;

					if( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
						m_AosSkillBonuses = new AosSkillBonuses( this, reader );
					else
                        m_AosSkillBonuses = new AosSkillBonuses(this);

                    // mod to randomly add sockets and socketability features to weapons. These settings will yield
                    // 2% drop rate of socketed/socketable items
                    // 0.1% chance of 5 sockets
                    // 0.5% of 4 sockets
                    // 3% chance of 3 sockets
                    // 15% chance of 2 sockets
                    // 50% chance of 1 socket
                    // the remainder will be 0 socket (31.4% in this case)
                    // uncomment the next line to prevent artifacts from being socketed
                    // if(ArtifactRarity == 0)
                    XmlSockets.ConfigureRandom(this, 2.0, 0.1, 0.5, 3.0, 15.0, 50.0);
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:66,代码来源:BaseWeapon.cs

示例10: ApplySkillLoss

		public static void ApplySkillLoss(Mobile mob)
		{
			SkillLossContext context;

			if (!m_SkillLoss.TryGetValue(mob, out context))
			{
				m_SkillLoss.Add(mob, context = new SkillLossContext());
			}
			else if (context == null)
			{
				m_SkillLoss[mob] = context = new SkillLossContext();
			}
			else
			{
				return;
			}

			List<SkillMod> mods = context.m_Mods = new List<SkillMod>();

			foreach (Skill sk in mob.Skills)
			{
				double baseValue = sk.Base;

				if (baseValue <= 0)
				{
					continue;
				}

				SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * SkillLossFactor));

				mods.Add(mod);
				mob.AddSkillMod(mod);
			}

			//PlayerState ps = PlayerState.Find( mob );

		    context.m_Timer = Timer.DelayCall(SkillLossPeriod, ClearSkillLoss_Callback, mob);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:38,代码来源:Faction.cs

示例11: OnEquip

        public override bool OnEquip( Mobile from )
        {
            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
            {
                Mobile m = from;

                string modName = this.Serial.ToString();

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

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

                if ( intBonus != 0 )
                    m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
            }

            from.NextCombatTime = DateTime.Now + GetDelay( from );

            if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
            {
                if ( m_SkillMod != null )
                    m_SkillMod.Remove();

                m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
                from.AddSkillMod( m_SkillMod );
            }

            if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 )
            {
                if ( m_MageMod != null )
                    m_MageMod.Remove();

                m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
                from.AddSkillMod( m_MageMod );
            }

            if( from is PlayerMobile )
            {
                PlayerMobile attacker = from as PlayerMobile;

                if( attacker.HealingTimer != null )
                {
                    attacker.SendMessage( "You have stopped your attempt to heal someone." );
                    attacker.HealingTimer.Stop();
                    attacker.HealingTimer = null;
                }
            }

            return true;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:56,代码来源:BaseWeapon.cs

示例12: Deserialize


//.........这里部分代码省略.........

                    if ( GetSaveFlag( flags, SaveFlag.Skill ) )
                        m_Skill = (SkillName)reader.ReadInt();
                    else
                        m_Skill = (SkillName)(-1);

                    if ( GetSaveFlag( flags, SaveFlag.Type ) )
                        m_Type = (WeaponType)reader.ReadInt();
                    else
                        m_Type = (WeaponType)(-1);

                    if ( GetSaveFlag( flags, SaveFlag.Animation ) )
                        m_Animation = (WeaponAnimation)reader.ReadInt();
                    else
                        m_Animation = (WeaponAnimation)(-1);

                    if ( GetSaveFlag( flags, SaveFlag.Resource ) )
                        m_Resource = (CraftResource)reader.ReadInt();
                    else
                        m_Resource = CraftResource.Iron;

                    if ( GetSaveFlag( flags, SaveFlag.xAttributes ) )
                        m_AosAttributes = new AosAttributes( this, reader );
                    else
                        m_AosAttributes = new AosAttributes( this );

                    if ( GetSaveFlag( flags, SaveFlag.xWeaponAttributes ) )
                        m_AosWeaponAttributes = new AosWeaponAttributes( this, reader );
                    else
                        m_AosWeaponAttributes = new AosWeaponAttributes( this );

                    if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular && Parent is Mobile )
                    {
                        m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
                        ((Mobile)Parent).AddSkillMod( m_SkillMod );
                    }

                    if ( version < 7 && m_AosWeaponAttributes.MageWeapon != 0 )
                        m_AosWeaponAttributes.MageWeapon = 30 - m_AosWeaponAttributes.MageWeapon;

                    if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 && Parent is Mobile )
                    {
                        m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
                        ((Mobile)Parent).AddSkillMod( m_MageMod );
                    }

                    if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) )
                        m_PlayerConstructed = true;

                    if( GetSaveFlag( flags, SaveFlag.SkillBonuses ) )
                        m_AosSkillBonuses = new AosSkillBonuses( this, reader );
                    else
                        m_AosSkillBonuses = new AosSkillBonuses( this );

                    if( GetSaveFlag( flags, SaveFlag.Slayer2 ) )
                        m_Slayer2 = (SlayerName)reader.ReadInt();

                    if( GetSaveFlag( flags, SaveFlag.ElementalDamages ) )
                        m_AosElementDamages = new AosElementAttributes( this, reader );
                    else
                        m_AosElementDamages = new AosElementAttributes( this );

                    break;
                }
                case 4:
                {
开发者ID:justdanofficial,项目名称:khaeros,代码行数:67,代码来源:BaseWeapon.cs

示例13: OnEquip

        public override bool OnEquip( Mobile from )
        {
            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            BaseWeapon oldWeapon = from.Weapon as BaseWeapon;

            if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
            {
                Mobile m = from;

                string modName = this.Serial.ToString();

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

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

                if ( intBonus != 0 )
                    m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
            }

            TimeSpan oldDelay = oldWeapon.GetDelay(from);
            if ( from.NextCombatTime >= (DateTime.MinValue+oldDelay) && oldWeapon != null )
                from.NextCombatTime -= oldDelay; // forget the delay for their old weapon
            from.NextCombatTime += GetDelay( from ); // use the delay for their new weapon (this weapon)

            if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
            {
                if ( m_SkillMod != null )
                    m_SkillMod.Remove();

                m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
                from.AddSkillMod( m_SkillMod );
            }

            if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 )
            {
                if ( m_MageMod != null )
                    m_MageMod.Remove();

                m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
                from.AddSkillMod( m_MageMod );
            }

            return true;
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:49,代码来源:BaseWeapon.cs

示例14: OnEquip

        public override bool OnEquip( Mobile from )
		{
            if (Amount > 1)
            {
                from.SendAsciiMessage("You can only equip one weapon at a time");
                return false;
            }

			int strBonus = m_AosAttributes.BonusStr;
			int dexBonus = m_AosAttributes.BonusDex;
			int intBonus = m_AosAttributes.BonusInt;

			if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
			{
				Mobile m = from;

				string modName = Serial.ToString();

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

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

				if ( intBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
			}

            //Maka
            if (from is PlayerMobile)
                (from as PlayerMobile).WeaponTimerCheck();

            if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
			{
				if ( m_SkillMod != null )
					m_SkillMod.Remove();

				m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 3 );
				from.AddSkillMod( m_SkillMod );
			}

			if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 )
			{
				if ( m_MageMod != null )
					m_MageMod.Remove();

				m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
				from.AddSkillMod( m_MageMod );
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:52,代码来源:BaseWeapon.cs

示例15: AddMods

		public bool AddMods()
		{
			if ( Owner == null )
				return false;

			BonusNumber++;

			if ( BonusNumber > 5 )
				return false;

			// @100.0 Forensics bonus's value is 10.
			double bonus = (BlueSpell.ScaleBySkill( Owner, SkillName.Forensics ) / 2.0);
			StatMod stat = null;
			DefaultSkillMod skill = null;
			ResistanceMod resist = null;
			int intdiff = 0;
			double doublediff = 0.0;

			// Str (+10 @ GM)
			intdiff = (int)( m_StrCap - (Owner.RawStr + bonus) );

			if ( intdiff > 0 )
			{
				stat = new StatMod( StatType.Str, ("DragonForceStr" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) );
				Owner.AddStatMod( stat );
				StatMods.Add( stat );
			}

			// Dex (+10 @ GM)
			intdiff = (int)( m_DexCap - (Owner.RawDex + bonus) );

			if ( intdiff > 0 )
			{
				stat = new StatMod( StatType.Dex, ("DragonForceDex" + BonusNumber.ToString()), intdiff, TimeSpan.FromHours( 24 ) );
				Owner.AddStatMod( stat );
				StatMods.Add( stat );
			}

			// Tactics (+5.0 @ GM)
			doublediff = m_TacticsCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

			if ( doublediff > 0.0 )
			{
				skill = new DefaultSkillMod( SkillName.Tactics, true, (bonus / 2) );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			// Wrestling (+5.0 @ GM)
			doublediff = m_WrestlingCap - (Owner.Skills[SkillName.Tactics].Value + bonus);

			if ( doublediff > 0.0 )
			{
				skill = new DefaultSkillMod( SkillName.Wrestling, true, bonus );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			// Lose all Magic Resist in preparation of negative resistances.
			if ( Owner.Skills[SkillName.MagicResist].Value > 0 )
			{
				skill = new DefaultSkillMod( SkillName.MagicResist, true, -Owner.Skills[SkillName.MagicResist].Value );
				Owner.AddSkillMod( skill );
				SkillMods.Add( skill );
			}

			if ( !Status.Enabled )
			{
				// Lower Magery (-30 @ GM)
				if ( Owner.Skills[SkillName.Magery].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Magery, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Necromancy (-30 @ GM)
				if ( Owner.Skills[SkillName.Necromancy].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Necromancy, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Chivalry (-30 @ GM)
				if ( Owner.Skills[SkillName.Chivalry].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Chivalry, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

				// Lower Bushido (-30 @ GM)
				if ( Owner.Skills[SkillName.Bushido].Value > 0 )
				{
					skill = new DefaultSkillMod( SkillName.Bushido, true, -(bonus * 3) );
					Owner.AddSkillMod( skill );
					SkillMods.Add( skill );
				}

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:101,代码来源:DragonForce.cs


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