HasFreeHand() public static méthode

public static HasFreeHand ( Server.Mobile m ) : bool
m Server.Mobile
Résultat bool
Exemple #1
0
 private static bool CanUseWeapon(PlayerMobile from, INinjaWeapon weapon)
 {
     if (WeaponIsValid(weapon, from))
     {
         if (weapon.UsesRemaining > 0)
         {
             if (!from.NinjaWepCooldown)
             {
                 if (BasePotion.HasFreeHand(from))
                 {
                     return(true);
                 }
                 else
                 {
                     from.SendLocalizedMessage(weapon.NoFreeHandMessage);
                 }
             }
             else
             {
                 from.SendLocalizedMessage(weapon.RecentlyUsedMessage);
             }
         }
         else
         {
             from.SendLocalizedMessage(weapon.EmptyWeaponMessage);
         }
     }
     return(false);
 }
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019);                   // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624);                   // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631);                   // This bola is already being used.
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                from.SendMessage("You need a free hand to throw this.");
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016);                   // You cannot use this while riding a mount
            }
            else
            {
                EtherealMount.StopMounting(from);

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Exemple #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from))
            {
                return;
            }

            if (m_UsesRemaining < 1)
            {
                // You have no fukiya darts!
                from.SendLocalizedMessage(1063325);
            }
            else if (m_Using)
            {
                // You are already using that fukiya.
                from.SendLocalizedMessage(1063326);
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                // You must have a free hand to use a fukiya.
                from.SendLocalizedMessage(1063327);
            }
            else
            {
                from.BeginTarget(5, false, TargetFlags.Harmful, new TargetCallback(OnTarget));
            }
        }
Exemple #4
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from))
            {
                return;
            }

            if (m_UsesRemaining < 1)
            {
                // You have no shuriken in your ninja belt!
                from.SendLocalizedMessage(1063297);
            }
            else if (m_Using)
            {
                // You cannot throw another shuriken yet.
                from.SendLocalizedMessage(1063298);
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                // You must have a free hand to throw shuriken.
                from.SendLocalizedMessage(1063299);
            }
            else
            {
                from.BeginTarget(10, false, TargetFlags.Harmful, new TargetCallback(OnTarget));
            }
        }
Exemple #5
0
 public static bool CheckUse(LocksmithTools tool, Mobile from)
 {
     if (!BasePotion.HasFreeHand(from))
     {
         from.SendMessage("You need a free hand to use these tools.");
         return(false);
     }
     return(true);
 }
Exemple #6
0
        public void Shoot(Mobile from, Mobile target)
        {
            if (from == target)
            {
                return;
            }

            if (m_UsesRemaining < 1)
            {
                // You have no shuriken in your ninja belt!
                from.SendLocalizedMessage(1063297);
            }
            else if (m_Using)
            {
                // You cannot throw another shuriken yet.
                from.SendLocalizedMessage(1063298);
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                // You must have a free hand to throw shuriken.
                from.SendLocalizedMessage(1063299);
            }
            else if (from.InRange(target, 2))
            {
                from.SendLocalizedMessage(1063303);                   // Your target is too close!
            }
            else if (from.CanBeHarmful(target))
            {
                m_Using = true;

                from.Direction = from.GetDirectionTo(target);

                from.RevealingAction();

                if (from.Body.IsHuman)
                {
                    from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
                }

                from.PlaySound(0x23A);
                from.MovingEffect(target, 0x27AC, 1, 0, false, false);

                if (from.CheckSkill(SkillName.Ninjitsu, -10.0, 65.0))
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(OnShurikenHit), new object[] { from, target });
                }
                else
                {
                    ConsumeUse();
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerCallback(ResetUsing));
            }
        }
Exemple #7
0
        public void Shoot(Mobile from, Mobile target)
        {
            double ninja = from.Skills[SkillName.Ninjitsu].Value;

            if (from == target)
            {
                return;
            }

            if (m_UsesRemaining < 1)
            {
                // You have no fukiya darts!
                from.SendLocalizedMessage(1063325);
            }
            else if (m_Using)
            {
                // You are already using that fukiya.
                from.SendLocalizedMessage(1063326);
            }
            else if ((ninja < 100) && (!BasePotion.HasFreeHand(from)))
            {
                // You must have a free hand to use a fukiya.
                from.SendLocalizedMessage(1063327);
            }
            else if (from.CanBeHarmful(target))
            {
                m_Using = true;

                from.Direction = from.GetDirectionTo(target);

                from.RevealingAction();

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(33, 2, 1, true, true, 0);
                }

                from.PlaySound(0x223);
                from.MovingEffect(target, 0x2804, 5, 0, false, false);

                if (from.CheckSkill(SkillName.Ninjitsu, -10.0, 50.0))
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(OnDartHit), new object[] { from, target });
                }
                else
                {
                    ConsumeUse();
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerCallback(ResetUsing));
            }
        }
Exemple #8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
            {
                from.SendLocalizedMessage(1063299);                   // You must have a free hand to throw shuriken.
                return;
            }

            if (UsesRemaining > 0)
            {
                InternalTarget t = new InternalTarget(this);
                from.Target = t;
            }
            else
            {
                from.SendLocalizedMessage(1063297);                   // You have no shuriken in your ninja belt!
            }
        }
Exemple #9
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_belt.Deleted)
                {
                    return;
                }
                else if (targeted is Mobile)
                {
                    if (!BasePotion.HasFreeHand(from) && !BasePotion.HasBalancedWeapon(from))
                    {
                        from.SendLocalizedMessage(1063299);                           // You must have a free hand to throw shuriken.
                        return;
                    }

                    Mobile m = (Mobile)targeted;

                    double dist = from.GetDistanceToSqrt(m.Location);

                    if (m.Map != from.Map || dist > 11)
                    {
                        from.SendLocalizedMessage(500446);                           // That is too far away.
                        return;
                    }
                    else if (from.InRange(m, 2))
                    {
                        from.SendLocalizedMessage(1063303);                           // Your target is too close!
                        return;
                    }

                    if (m != from && from.HarmfulCheck(m))
                    {
                        Direction to = from.GetDirectionTo(m);

                        from.Direction = to;

                        from.RevealingAction();

                        from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);

                        if (Fukiya.CheckHitChance(from, m))
                        {
                            from.MovingEffect(m, 0x27AC, 7, 1, false, false, 0x23A, 0);

                            AOS.Damage(m, from, Utility.Random(3, 5), 100, 0, 0, 0, 0);

                            if (m_belt.Poison != null && m_belt.PoisonCharges > 0)
                            {
                                --m_belt.PoisonCharges;

                                Poison poison   = m_belt.Poison;
                                int    maxLevel = from.Skills[SkillName.Poisoning].Fixed / 200;
                                if (poison.Level > maxLevel)
                                {
                                    poison = Poison.GetPoison(maxLevel);
                                }

                                m.ApplyPoison(from, poison);
                            }
                        }
                        else
                        {
                            from.MovingEffect(new Shuriken(), 0x27AC, 7, 1, false, false, 0x23A, 0);

                            from.SendMessage("You miss.");
                        }

                        // Throwing a shuriken restarts you weapon's swing delay
                        from.NextCombatTime = DateTime.UtcNow + from.Weapon.GetDelay(from);

                        m_belt.UsesRemaining--;
                    }
                }
            }
Exemple #10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 1))
            {
                from.SendLocalizedMessage(502138); // That is too far away for you to use
                return;
            }
            else if (from != m_Caster)
            {
            }
            else if (!BasePotion.HasFreeHand(from))
            {
                from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone.
            }
            else if (from.Hits >= from.HitsMax && !from.Poisoned)
            {
                from.SendLocalizedMessage(1049547); //You are already at full health.
            }
            else if (from.CanBeginAction(typeof(HealingStone)))
            {
                from.BeginAction(typeof(HealingStone));

                if (m_MaxHeal > m_LifeForce)
                {
                    m_MaxHeal = m_LifeForce;
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2), m => m.EndAction(typeof(HealingStone)), from);

                if (from.Poisoned)
                {
                    int toUse = Math.Min(120, from.Poison.RealLevel * 25);

                    if (m_MaxLifeForce < toUse)
                    {
                        from.SendLocalizedMessage(1115265); //Your Mysticism, Focus, or Imbuing Skills are not enough to use the heal stone to cure yourself.
                    }
                    else if (m_LifeForce < toUse)
                    {
                        from.SendLocalizedMessage(1115264); //Your healing stone does not have enough energy to remove the poison.
                        LifeForce -= toUse / 3;
                    }
                    else
                    {
                        from.CurePoison(from);

                        from.SendLocalizedMessage(500231); // You feel cured of poison!

                        from.FixedEffect(0x373A, 10, 15);
                        from.PlaySound(0x1E0);

                        LifeForce -= toUse;
                    }

                    if (m_LifeForce <= 0)
                    {
                        Consume();
                    }

                    return;
                }
                else
                {
                    int toHeal = Math.Min(m_MaxHeal, from.HitsMax - from.Hits);
                    from.Heal(toHeal);

                    from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                    from.PlaySound(0x202);

                    LifeForce -= toHeal;
                    m_MaxHeal  = 1;
                }

                if (m_LifeForce <= 0)
                {
                    from.SendLocalizedMessage(1115266); //The healing stone has used up all its energy and has been destroyed.
                    Consume();
                }
                else
                {
                    if (m_Timer != null)
                    {
                        m_Timer.Stop();
                    }

                    m_Timer = new InternalTimer(this);
                }
            }
            else
            {
                from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone.
            }
        }