示例#1
0
        public override int BaseMana => 20; // Not Sure what amount of mana a creature uses.

        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);
            Item toDisrobe = defender.FindItemOnLayer(Layer.InnerTorso);

            if (toDisrobe?.Movable == false)
            {
                toDisrobe = defender.FindItemOnLayer(Layer.OuterTorso);
            }

            Container pack = defender.Backpack;

            if (pack == null || toDisrobe?.Movable == false)
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (CheckMana(attacker, true))
            {
                //attacker.SendLocalizedMessage( 1060092 ); // You disarm their weapon!
                defender.SendLocalizedMessage(1062002); // You can no longer wear your ~1_ARMOR~

                defender.PlaySound(0x3B9);
                //defender.FixedParticles( 0x37BE, 232, 25, 9948, EffectLayer.InnerTorso );

                pack.DropItem(toDisrobe);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
示例#2
0
文件: Disarm.cs 项目: dpisanu/xrunuo
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001);                   // You cannot disarm your opponent.
            }
            else if (toDisarm == null)
            {
                attacker.SendLocalizedMessage(1060849);                   // Your target is already unarmed!
            }
            else if (toDisarm is BaseShield)
            {
                attacker.SendLocalizedMessage(1111822);                   // Your attempt to disarm your target has failed!
                defender.SendLocalizedMessage(1111823);                   // Your attacker's attempt to disarm you has failed!
            }
            else if (CheckMana(attacker, true))
            {
                if (!IsImmune(defender))
                {
                    attacker.SendLocalizedMessage(1060092);                       // You disarm their weapon!
                    defender.SendLocalizedMessage(1060093);                       // Your weapon has been disarmed!

                    defender.PlaySound(0x3B9);
                    defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                    pack.DropItem(toDisarm);

                    BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                    BaseWeapon.BlockEquip(defender, BlockEquipDuration);
                    if (!(attacker.Weapon is Fists))
                    {
                        BeginInmunity(defender, ImmunityDuration);
                    }
                }
                else
                {
                    attacker.SendLocalizedMessage(1154081);                       // your opponent cannot be disarmed at this time // 1060168: Your confusion has passed, you may now arm a weapon!
                }
            }
        }
示例#3
0
        protected override void OnTarget(Mobile from, object targ)
        {
            if (!(targ is TeiravonMobile))
            {
                from.SendMessage("You can only splint that!");
            }
            else
            {
                m_player = (TeiravonMobile)from;
                m_targ   = (TeiravonMobile)targ;
                if (m_targ == m_player)
                {
                    m_player.SendMessage("You cannot splint yourself!");
                }
                else if (!m_targ.Alive)
                {
                    m_player.SendMessage("That person is not alive!");
                }
                else if (!(m_player.InRange(m_targ.Location, 2)))
                {
                    m_player.SendMessage("You are too far away");
                }
                else
                {
                    Container pack = m_player.Backpack;
                    if (pack != null)
                    {
                        BaseWeapon wpn = (BaseWeapon)m_player.Weapon;
                        pack.DropItem(wpn);
                    }
                    BaseWeapon.BlockEquip(m_player, TimeSpan.FromSeconds(6.0));

                    int healmin = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 3);
                    int healmax = (int)((m_player.Skills.Healing.Value + m_player.Skills.Anatomy.Value) / 2);
                    int healamt = Utility.RandomMinMax(healmin, healmax);

                    m_player.Emote("Begins splinting {0}", m_targ.Name);

                    m_timer = new InternalTimer(m_player, m_targ, healamt, splint);
                    m_timer.Start();
                }
            }
        }
示例#4
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
示例#5
0
文件: Disarm.cs 项目: silky/ModernUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            var toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm?.Movable == false)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            var pack = defender.Backpack;

            if (pack == null || toDisarm?.Movable == false)
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (!Core.ML && toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);
            }
        }
示例#6
0
文件: Disarm.cs 项目: tflynt91/TrueUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (IsImmune(defender))
            {
                attacker.SendLocalizedMessage(1111827); // Your opponent is gripping their weapon too tightly to be disarmed.
                defender.SendLocalizedMessage(1111828); // You will not be caught off guard by another disarm attack for some time.
                return;
            }

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || toDisarm != null && !toDisarm.Movable)
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);

                if (defender is BaseCreature && _AutoRearms.Any(t => t == defender.GetType()))
                {
                    Timer.DelayCall(BlockEquipDuration + TimeSpan.FromSeconds(Utility.RandomMinMax(3, 10)), () =>
                    {
                        if (toDisarm != null && !toDisarm.Deleted && toDisarm.IsChildOf(defender.Backpack))
                        {
                            defender.EquipItem(toDisarm);
                        }
                    });
                }

                AddImmunity(defender, attacker.Weapon is Fists ? TimeSpan.FromSeconds(10) : TimeSpan.FromSeconds(15));
            }
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
            {
                attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
            }
            else if (this.CheckMana(attacker, true))
            {
                // Skill Masteries
                int saveChance = Server.Spells.SkillMasteries.MasteryInfo.SavingThrowChance(defender);

                if (saveChance > 0 && saveChance >= Utility.Random(100))
                {
                    attacker.SendLocalizedMessage(1156033); // Your disarm attempt was blocked!
                    defender.SendLocalizedMessage(1156034); // You blocked a disarm attempt!
                    return;
                }

                attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
                defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.NoRearm, 1075637, BlockEquipDuration, defender));

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);

                if (defender is BaseCreature && ((BaseCreature)defender).AutoRearms)
                {
                    Timer.DelayCall(BlockEquipDuration + TimeSpan.FromSeconds(Utility.RandomMinMax(3, 10)), () =>
                    {
                        if (toDisarm != null && !toDisarm.Deleted && toDisarm.IsChildOf(defender.Backpack))
                        {
                            defender.EquipItem(toDisarm);
                        }
                    });
                }
            }
        }
示例#8
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!(targeted is TeiravonMobile))
                {
                    from.SendMessage("You must target another player.");
                }
                else if (!(( TeiravonMobile )targeted).Alive || !from.Alive)
                {
                    from.SendMessage("You must target a living player.");
                }
                else if (( TeiravonMobile )targeted == ( TeiravonMobile )from)
                {
                    from.SendMessage("You must target another player.");
                }
                else if (from.Mounted)
                {
                    from.SendMessage("You must be on foot to initially grab a player.");
                }
                else if ((( TeiravonMobile )targeted).Mounted)
                {
                    from.SendMessage("Your target must be on foot to be grabbed.");
                }
                //else if ( ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.OneHanded ) != null || ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.TwoHanded ) != null )
                //	from.SendMessage( "You must first disarm your target." );
                else if (Grabbers.Contains(from))                               // Sanity check
                {
                    from.SendMessage("You can only grab one person at a time.");
                }
                else if (Grabbers.Contains((( TeiravonMobile )targeted)))
                {
                    from.SendMessage("You can't get a hold on {0} right now.", (( TeiravonMobile )targeted).Female ? "her" : "him");
                }
                else
                {
                    TeiravonMobile grabbed = ( TeiravonMobile )targeted;

                    foreach (GrabTimer timer in Grabbers.Values)
                    {
                        if (timer.Grabbed == grabbed)
                        {
                            from.SendMessage("{0} is already being held.", grabbed.Name);
                            return;
                        }
                    }

                    int grabvalue   = 0;
                    int defendvalue = 0;

                    GetValues(( TeiravonMobile )from, grabbed, out grabvalue, out defendvalue);

                    // We grabbed them.
                    if (grabvalue > defendvalue || (grabvalue == defendvalue && Utility.RandomBool()))
                    {
                        GrabTimer timer = new GrabTimer(( TeiravonMobile )from, grabbed);

                        Grabbers.Add(( TeiravonMobile )from, timer);
                        timer.Start();

                        from.Emote("*successfully grabs {0}!*", grabbed.Name);
                        BaseWeapon.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        grabbed.ClearHands();
                        BaseWeapon.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        grabbed.BeginAction(typeof(BaseMount));
                        grabbed.Freeze(TimeSpan.FromMinutes(10.0));

                        BaseMount.Dismount(grabbed);
                    }
                    else
                    {
                        from.Emote("*fails to grab {0}!*", grabbed.Name);
                    }
                }
            }
示例#9
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            if (attacker is TeiravonMobile && defender is TeiravonMobile)
            {
                TeiravonMobile tmd    = (TeiravonMobile)defender;
                TeiravonMobile tma    = (TeiravonMobile)attacker;
                int            dlevel = tmd.PlayerLevel;
                int            alevel = tma.PlayerLevel;
                int            adj    = (dlevel - alevel) * 3;
                if (Utility.Random(100) < 50 + adj)
                {
                    ClearCurrentAbility(attacker);
                    attacker.SendMessage("Your disarm attempt fails.");
                    return;
                }
            }
            else if (attacker is TeiravonMobile && defender is BaseCreature)
            {
                BaseCreature   tmd    = (BaseCreature)defender;
                TeiravonMobile tma    = (TeiravonMobile)attacker;
                int            dlevel = tmd.Level;
                int            alevel = tma.PlayerLevel;
                int            adj    = (dlevel - alevel) * 3;
                if (Utility.Random(100) < 50 + adj)
                {
                    ClearCurrentAbility(attacker);
                    defender.Say("Nice try, fiend!");
                    return;
                }
            }

            ClearCurrentAbility(attacker);

            Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);

            if (toDisarm == null || !toDisarm.Movable)
            {
                toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
            }

            Container pack = defender.Backpack;

            if (pack == null || (toDisarm != null && !toDisarm.Movable))
            {
                attacker.SendLocalizedMessage(1004001);                   // You cannot disarm your opponent.
            }
            else if (toDisarm == null || toDisarm is BaseShield)
            {
                attacker.SendLocalizedMessage(1060849);                   // Your target is already unarmed!
            }
            else if (CheckMana(attacker, true))
            {
                attacker.SendLocalizedMessage(1060092);                   // You disarm their weapon!
                defender.SendLocalizedMessage(1060093);                   // Your weapon has been disarmed!

                defender.PlaySound(0x3B9);
                defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);

                pack.DropItem(toDisarm);

                BaseWeapon.BlockEquip(defender, BlockEquipDuration);

                if (defender is BaseCreature)
                {
                    Timer timer = new RearmTimer(defender);
                    timer.Start();
                }
            }
        }
示例#10
0
        public void DoEffect(Mobile atk, Mobile def)
        {
            double chances = GetChances(atk, def);

            NextUse = DateTime.Now.AddSeconds(CooldownTime);
            Item weapon = Weapon(def);

            if (def.Spell != null)
            {
                if (def.Spell.IsCasting && (GetBonus(def.Skills[SkillName.ArtMagique].Value, 0.2, 5) + GetBonus(def.Skills[SkillName.Meditation].Value, 0.2, 5)) <= Utility.RandomDouble())
                {
                    //def.DisruptiveAction();
                }
            }

            if (chances >= Utility.RandomDouble())
            {
                new WaitTimer(def, TimeSpan.FromSeconds(2 * WaitTime)).Start();
                if (weapon != null)
                {
                    if (atk is ScriptMobile)
                    {
                        ScriptMobile mob = (ScriptMobile)atk;
                        if (mob.PVPInfo != null)
                        {
                            if (!mob.PVPInfo.CurrentEvent.mode.AllowLoot())
                            {
                                def.AddToBackpack(weapon);
                                DoAnimation(atk, def, Sounds.SuccessDrop);

                                BaseWeapon.BlockEquip(def, TimeSpan.FromSeconds(chances * BlockEquipDuration));
                                atk.Stam -= (int)((1 - chances) * 150);
                                def.Damage(15, atk);
                                atk.RevealingAction();
                                def.RevealingAction();
                                return;
                            }
                        }
                    }

                    double malus = (weapon.Layer == Layer.OneHanded) ? 0.5 : 0.3;
                    if (malus * chances >= Utility.RandomDouble() && !atk.Mounted) //Steal the weapon
                    {
                        atk.AddToBackpack(weapon);
                        DoAnimation(atk, def, Sounds.SuccessSteal);
                    }
                    else                                                           //Drop the weapon
                    {
                        weapon.MoveToWorld(weapon.GetWorldLocation(), weapon.Map);
                        DoAnimation(atk, def, Sounds.SuccessDrop);
                    }
                    BaseWeapon.BlockEquip(def, TimeSpan.FromSeconds(chances * BlockEquipDuration));
                }
                else                                                               //Fail
                {
                    DoAnimation(atk, def, Sounds.Whip);
                }
                atk.Stam -= (int)((1 - chances) * 150);
                def.Damage(15, atk);
            }
            else
            {
                new WaitTimer(def, TimeSpan.FromSeconds(WaitTime)).Start();
                DoAnimation(atk, def, Sounds.Miss);
            }

            atk.RevealingAction();
            def.RevealingAction();
            //atk.DisruptiveAction();
        }