示例#1
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!m.Hidden)
            {
                m.SendLocalizedMessage(502725); // You must hide first
            }
            else if (m.Skills[SkillName.Hiding].Base < HidingRequirement)
            {
                m.SendLocalizedMessage(502726); // You are not hidden well enough.  Become better at hiding.
                m.RevealingAction();
            }
            else if (!Hiding.CheckLighting(m))
            {
                m.SendMessage("You cannot stay hidden near so much light.");
                m.RevealingAction();
            }
            else
            {
                int           armorRating = GetArmorRating(m);
                DesignContext context     = DesignContext.Find(m);

                if (context != null)
                {
                }
                else if (armorRating >= (Core.AOS ? 42 : 26)) //I have a hunch '42' was chosen cause someone's a fan of DNA
                {
                    m.SendLocalizedMessage(502727);           // You could not hope to move quietly wearing this much armor.
                    m.RevealingAction();
                }
                else if (m.CheckSkill(SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2)))
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.SE ? 5.0 : 10.0));

                    if (steps < 1)
                    {
                        steps = 1;
                    }

                    m.AllowedStealthSteps = steps;
                    //PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
                    //pm.IsStealthing = true;

                    m.SendLocalizedMessage(502730); // You begin to move quietly.

                    return(TimeSpan.FromSeconds(10.0));
                }
                else
                {
                    m.SendLocalizedMessage(502731); // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                }
            }

            EventSink.InvokeSkillUsed(new SkillUsedEventArgs(m, m.Skills[SkillName.Stealth]));

            return(TimeSpan.FromSeconds(10.0));
        }
示例#2
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!m.Hidden)
            {
                Hiding.OnUse(m);

                if (!m.Hidden) // Si le jet est raté.
                {
                    return(TempsJetRate);
                }
                else
                {
                    return(OnUse(m));
                }
            }
            else if (!m.CanBeginAction(typeof(Stealth)))
            {
                m.SendLocalizedMessage(1063086);                   // You cannot use this skill right now.
            }
            else
            {
                if (m.CheckSkill(SkillName.Infiltration, (m.Skills[SkillName.Infiltration].Value * ScalMalusArmure(m))))
                {
                    int steps = (int)(m.Skills[SkillName.Infiltration].Value / Diviseur); // A 100, 20 steps, ou 4 steps en courrant.

                    // Malus de dex sur le nombre de pas possible.
                    int val = (int)(steps * ScalMalusArmure(m));
                    if (val != steps)
                    {
                        steps = val;
                        m.SendMessage("Vous n'êtes pas assez agile pour vous déplacer efficacement avec cette armure.");
                    }

                    if (steps < 1)
                    {
                        steps = 1;
                    }

                    m.AllowedStealthSteps = steps;

                    m.SendLocalizedMessage(502730);                       // You begin to move quietly.
                    return(TempsJetReussit);
                }
                else
                {
                    m.SendLocalizedMessage(502731);                       // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                    return(TempsJetRate);
                }
            }

            return(TempsJetImposs);
        }
示例#3
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (m is TeiravonMobile && ((TeiravonMobile)m).m_Revealed + TimeSpan.FromSeconds(3.0) > DateTime.Now)
            {
                m.SendMessage("You cannot find any cover so quickly after being revealed.");
                return(TimeSpan.FromSeconds(1.0));
            }

            if (!m.Hidden)
            {
                Hiding.OnUse(m);
            }

            /*
             * else if ( m.Skills[SkillName.Hiding].Base < ((Core.SE) ? 50.0 : 80.0) )
             * {
             *      m.SendLocalizedMessage( 502726 ); // You are not hidden well enough.  Become better at hiding.
             * }
             */
            /*else if ( CheckNear( m ) )
             * {
             *      m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
             *      m.RevealingAction();
             * }*/
            else
            {
//				int armorRating = (int) m.ArmorRating;

//				if ( armorRating > 25 )
//				{
//					m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
//					m.RevealingAction();
//				}
//				else if ( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), 80.0 + (armorRating * 2) ) )

                int       armorRating = 0;
                BaseArmor bam;
                Item      item;

                item = m.FindItemOnLayer(Layer.TwoHanded);
                if (item is BaseShield)
                {
                    if (item is Buckler)
                    {
                        armorRating++;
                    }
                    else if (item is HeaterShield)
                    {
                        armorRating += 5;
                    }
                    else
                    {
                        armorRating += 3;
                    }
                }

                item = m.FindItemOnLayer(Layer.InnerTorso);
                if (item is BaseArmor)
                {
                    bam = (BaseArmor)item;
                    if (bam is DrowChainChest || bam is ElvenChainChest)
                    {
                        armorRating += (((int)bam.MaterialType - 4) * 4);
                    }
                    else
                    {
                        armorRating += ((int)bam.MaterialType * 4);
                    }
                }

                item = m.FindItemOnLayer(Layer.Pants);
                if (item is BaseArmor)
                {
                    bam = (BaseArmor)item;
                    if (bam is DrowChainLegs || bam is ElvenChainLegs)
                    {
                        armorRating += (((int)bam.MaterialType - 4) * 4);
                    }
                    else
                    {
                        armorRating += ((int)bam.MaterialType * 3);
                    }
                }

                item = m.FindItemOnLayer(Layer.Arms);
                if (item is BaseArmor)
                {
                    bam          = (BaseArmor)item;
                    armorRating += ((int)bam.MaterialType * 2);
                }

                item = m.FindItemOnLayer(Layer.Helm);
                if (item is BaseArmor)
                {
                    bam = (BaseArmor)item;
                    if (bam is DrowChainCoif || bam is ElvenChainCoif)
                    {
                        armorRating += (((int)bam.MaterialType - 4) * 4);
                    }
                    else
                    {
                        armorRating += ((int)bam.MaterialType * 2);
                    }
                }

                item = m.FindItemOnLayer(Layer.Gloves);
                if (item is BaseArmor)
                {
                    bam          = (BaseArmor)item;
                    armorRating += ((int)bam.MaterialType * 1);
                }

                item = m.FindItemOnLayer(Layer.Neck);
                if (item is BaseArmor)
                {
                    bam          = (BaseArmor)item;
                    armorRating += ((int)bam.MaterialType * 1);
                }

//				m.SendMessage("{0} to {1}", -20.0 + armorRating, 80.0 + armorRating);

                if (m.CheckSkill(SkillName.Stealth, -30.0 + (armorRating), 80.0 + (armorRating)))
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));

                    if (steps < 1)
                    {
                        steps = 1;
                    }

                    if (m is TeiravonMobile)
                    {
                        TeiravonMobile m_Player = (TeiravonMobile)m;

                        if (m_Player.HasFeat(TeiravonMobile.Feats.AdvancedStealth))
                        {
                            steps += 15;
                        }
                    }

                    m.AllowedStealthSteps = steps;

                    m.SendLocalizedMessage(502730);                       // You begin to move quietly.

                    return(TimeSpan.FromSeconds(3.0));
                }
                else
                {
                    m.SendLocalizedMessage(502731);                       // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                }
            }

            return(TimeSpan.FromSeconds(3.0));
        }