Inheritance: BaseMeleeWeapon
        public void ThrowKnife(Mobile from)
        {
            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751);                   // Try holding a knife...
                return;
            }

            from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
            from.MovingEffect(this, knife.ItemID, 7, 1, false, false);
            from.PlaySound(0x238);

            double rand = Utility.RandomDouble();

            if (rand < 0.05)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Right between the eyes! 50 Points!");
                Effects.PlaySound(Location, Map, 426);
                OnMongbatHit(from);
            }
            else if (rand < 0.20)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "A Shot to the neck! 20 points.");
                Effects.PlaySound(Location, Map, Utility.RandomList(424, 425));
                OnMongbatHit(from);
            }
            else if (rand < 0.45)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "A shot to the body, 10 points.");
                Effects.PlaySound(Location, Map, Utility.RandomList(424, 425));
                OnMongbatHit(from);
            }
            else if (rand < 0.70)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Clipped its wing, 5 pointer.");
                Effects.PlaySound(Location, Map, Utility.RandomList(424, 425));
                OnMongbatHit(from);
            }
            else if (rand < 0.85)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "Bounced off him..  1 point.");
                Effects.PlaySound(Location, Map, Utility.RandomList(424, 425));
                OnMongbatHit(from);
            }
            else
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, 500757);                    // Missed.
                Effects.PlaySound(Location, Map, Utility.RandomList(422, 423));
            }
        }
Exemplo n.º 2
0
        public void Throw(Mobile from)
        {
            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751); // Try holding a knife...
                return;
            }

            if (Core.SA)
            {
                from.Animate(AnimationType.Attack, 4);
            }
            else
            {
                from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
            }

            from.MovingEffect(this, knife.ItemID, 7, 1, false, false);
            from.PlaySound(0x238);

            double rand = Utility.RandomDouble();

            int message;

            if (rand < 0.05)
            {
                message = 500752; // BULLSEYE! 50 Points!
            }
            else if (rand < 0.20)
            {
                message = 500753; // Just missed the center! 20 points.
            }
            else if (rand < 0.45)
            {
                message = 500754; // 10 point shot.
            }
            else if (rand < 0.70)
            {
                message = 500755; // 5 pointer.
            }
            else if (rand < 0.85)
            {
                message = 500756; // 1 point.  Bad throw.
            }
            else
            {
                message = 500757; // Missed.
            }
            this.PublicOverheadMessage(MessageType.Regular, 0x3B2, message);
        }
Exemplo n.º 3
0
        public void Throw(Mobile from)
        {
            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Try holding a knife...");                   // Try holding a knife...
                return;
            }

            from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
            from.MovingEffect(this, knife.ItemID, 7, 1, false, false);
            from.PlaySound(0x238);

            double rand = Utility.RandomDouble();

            string message;

            if (rand < 0.05)
            {
                message = "BULLSEYE! 50 Points!";
            }
            else if (rand < 0.20)
            {
                message = "Just missed the center! 20 points.";
            }
            else if (rand < 0.45)
            {
                message = "10 point shot.";
            }
            else if (rand < 0.70)
            {
                message = "5 pointer.";
            }
            else if (rand < 0.85)
            {
                message = "1 point.  Bad throw.";
            }
            else
            {
                message = "Missed.";
            }

            PublicOverheadMessage(MessageType.Regular, 0x3B2, true, message);
        }
Exemplo n.º 4
0
        public void Throw(Mobile from)
        {
            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751);                   // Try holding a knife...
                return;
            }

            from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
            from.MovingEffect(this, knife.ItemID, 7, 1, false, false);
            from.PlaySound(0x238);

            double rand = Utility.RandomDouble();

            int message;
            int nAnimate = 0;


            if (rand < 0.05)
            {
                nAnimate = 1;
                message  = 500752;                // BULLSEYE! 50 Points!
            }
            else if (rand < 0.20)
            {
                nAnimate = 1;
                message  = 500753;                // Just missed the center! 20 points.
            }
            else if (rand < 0.45)
            {
                nAnimate = 1;
                message  = 500754;                // 10 point shot.
            }
            else if (rand < 0.70)
            {
                message = 500755;                 // 5 pointer.
            }
            else if (rand < 0.85)
            {
                message = 500756;                 // 1 point.  Bad throw.
            }
            else
            {
                message = 500757;                 // Missed.
            }
            if ((nAnimate == 1) && ((this.ItemID == 0x1953) || (this.ItemID == 0x1954)))
            {
                ItemID = 0x1954;
            }
            else if ((nAnimate == 1) && ((this.ItemID == 0x1951) || (this.ItemID == 0x1950)))
            {
                ItemID = 0x1951;
            }

            if (nAnimate == 1)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(0.7), new TimerCallback(OnMongbatReset));
            }

            PublicOverheadMessage(MessageType.Regular, 0x3B2, message);
        }
Exemplo n.º 5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (!IsLockedDown)
            {
                from.SendLocalizedMessage(502692); // This must be in a house and be locked down to work.
                return;
            }

            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751); // Try holding a knife...
                return;
            }

            from.Animate(AnimationType.Attack, 4);
            Point3D loc = new Point3D(from.X + 1, from.Y, from.Z + 103);

            Effects.SendPacket(from.Location, from.Map, new GraphicalEffect(EffectType.Moving, from.Serial, Serial.Zero, knife.ItemID, from.Location, loc, 10, 0, true, true));

            double rand = Utility.RandomDouble();

            int message;

            if (rand < 0.05)
            {
                message = 500752; // BULLSEYE! 50 Points!
            }
            else if (rand < 0.20)
            {
                message = 500753; // Just missed the center! 20 points.
            }
            else if (rand < 0.45)
            {
                message = 500754; // 10 point shot.
            }
            else if (rand < 0.70)
            {
                message = 500755; // 5 pointer.
            }
            else if (rand < 0.85)
            {
                message = 500756; // 1 point.  Bad throw.
            }
            else
            {
                message = 500757; // Missed.
            }
            PublicOverheadMessage(MessageType.Regular, 0x3B2, message);

            if (message != 500757)
            {
                AnimateMongbat();
            }
        }
 public void Sharpening(Mobile from, object o)
 {
     if (o is Item)
     {
         if (!((Item)o).IsChildOf(from.Backpack))
         {
             from.SendMessage(32, "This must be in your backpack to sharpen");
         }
         else if (o is BaseSword && ((BaseSword)o).IsChildOf(from.Backpack))
         {
             BaseSword weap = o as BaseSword;
             int       i_DI = weap.Attributes.WeaponDamage;
             if (weap.Quality == WeaponQuality.Exceptional)
             {
                 i_DI += 15;
             }
             if (i_DI >= 60)
             {
                 from.SendMessage(32, "This weapon cannot be sharpened any further");
                 return;
             }
             else if (from.Skills[SkillName.Blacksmith].Value < 60.0)
             {
                 from.SendMessage(32, "You need at least 60.0 blacksmith to sharpen weapons with this stone");
             }
             else if (!Deleted)
             {
                 int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 20));
                 if (bonus > 0)
                 {
                     if (60 < i_DI + bonus)
                     {
                         bonus = 60 - i_DI;
                     }
                     weap.Attributes.WeaponDamage += bonus;
                     from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                 }
                 else
                 {
                     from.SendMessage(32, "You fail to sharpen the weapon");
                 }
                 if (Uses <= 1)
                 {
                     from.SendMessage(32, "You used up the sharpening stone");
                     Delete();
                 }
                 else
                 {
                     --Uses;
                     from.SendMessage(32, "You have {0} uses left", Uses);
                 }
             }
         }
         else if (o is BaseKnife && ((BaseKnife)o).IsChildOf(from.Backpack))
         {
             BaseKnife weap = o as BaseKnife;
             int       i_DI = weap.Attributes.WeaponDamage;
             if (weap.Quality == WeaponQuality.Exceptional)
             {
                 i_DI += 15;
             }
             if (i_DI >= 60)
             {
                 from.SendMessage(32, "This weapon cannot be sharpened any further");
                 return;
             }
             else if (from.Skills[SkillName.Blacksmith].Value < 60.0)
             {
                 from.SendMessage(32, "You need at least 60.0 blacksmith to sharpen weapons with this stone");
             }
             else if (!Deleted)
             {
                 int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 20));
                 if (bonus > 0)
                 {
                     if (60 < i_DI + bonus)
                     {
                         bonus = 60 - i_DI;
                     }
                     weap.Attributes.WeaponDamage += bonus;
                     from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                 }
                 else
                 {
                     from.SendMessage(32, "You fail to sharpen the weapon");
                 }
                 if (Uses <= 1)
                 {
                     from.SendMessage(32, "You used up the sharpening stone");
                     Delete();
                 }
                 else
                 {
                     --Uses;
                     from.SendMessage(32, "You have {0} uses left", Uses);
                 }
             }
         }
         else if (o is BaseAxe && ((BaseAxe)o).IsChildOf(from.Backpack))
         {
             BaseAxe weap = o as BaseAxe;
             int     i_DI = weap.Attributes.WeaponDamage;
             if (weap.Quality == WeaponQuality.Exceptional)
             {
                 i_DI += 15;
             }
             if (i_DI >= 60)
             {
                 from.SendMessage(32, "This weapon cannot be sharpened any further");
                 return;
             }
             else if (from.Skills[SkillName.Blacksmith].Value < 60.0)
             {
                 from.SendMessage(32, "You need at least 60.0 blacksmith to sharpen weapons with this stone");
             }
             else if (!Deleted)
             {
                 int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 20));
                 if (bonus > 0)
                 {
                     if (60 < i_DI + bonus)
                     {
                         bonus = 60 - i_DI;
                     }
                     weap.Attributes.WeaponDamage += bonus;
                     from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                 }
                 else
                 {
                     from.SendMessage(32, "You fail to sharpen the weapon");
                 }
                 if (Uses <= 1)
                 {
                     from.SendMessage(32, "You used up the sharpening stone");
                     Delete();
                 }
                 else
                 {
                     --Uses;
                     from.SendMessage(32, "You have {0} uses left", Uses);
                 }
             }
         }
         else
         {
             from.SendMessage(32, "You can only enhance edged weapons");
         }
     }
     else
     {
         from.SendMessage(32, "You can only enhance edged weapons");
     }
 }
Exemplo n.º 7
0
        public void Sharpening(Mobile from, object o)
        {
            if (o is Item)
            {
                if (!((Item)o).IsChildOf(from.Backpack))
                {
                    from.SendMessage(32, "This must be in your backpack to sharpen");
                }
                else if (o is BaseSword && ((BaseSword)o).IsChildOf(from.Backpack))
                {
                    BaseSword weap = o as BaseSword;
                    int       i_DI = weap.Attributes.WeaponDamage;
                    //if (weap.Quality == WeaponQuality.Exceptional)
                    i_DI += 15;
                    if (i_DI >= 70)
                    {
                        from.SendMessage(32, "This weapon cannot be sharpened any further");
                        return;
                    }
                    else if (from.Skills[SkillName.Blacksmith].Value < 100.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80.0 chivalry to sharpen weapons with this stone");
                    }
                    else if (from.Skills[SkillName.Chivalry].Value < 80.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80 chivalry to sharpen weapons with this stone");
                    }
                    else if (!Deleted)
                    {
                        int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 10));
                        if (bonus > 0)
                        {
                            if (70 < i_DI + bonus)
                            {
                                bonus = 70 - i_DI;
                            }
                            weap.Attributes.WeaponDamage += bonus;
                            weap.Consecrated              = true;
                            weap.LootType = LootType.Blessed;
                            from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                            this.Amount = this.Amount - 1;
                        }
                        else
                        {
                            from.SendMessage(32, "You fail to sharpen the weapon");
                        }
                        if (this.Amount == 0)
                        {
                            from.SendMessage(32, "You used up a sharpening stone");


                            Delete();
                        }
                        else
                        {
                            //--Uses;
                            from.SendMessage(32, "You were scared you'd cut your finger.");
                        }
                    }
                }
                else if (o is BaseKnife && ((BaseKnife)o).IsChildOf(from.Backpack))
                {
                    BaseKnife weap = o as BaseKnife;
                    int       i_DI = weap.Attributes.WeaponDamage;
                    if (weap.Quality == WeaponQuality.Exceptional)
                    {
                        i_DI += 15;
                    }
                    if (i_DI >= 70)
                    {
                        from.SendMessage(32, "This weapon cannot be sharpened any further");
                        return;
                    }
                    else if (from.Skills[SkillName.Blacksmith].Value < 100.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80.0 chivalry to sharpen weapons with this stone");
                    }
                    else if (from.Skills[SkillName.Chivalry].Value < 80.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80 chivalry to sharpen weapons with this stone");
                    }
                    else if (!Deleted)
                    {
                        int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 10));
                        if (bonus > 0)
                        {
                            if (70 < i_DI + bonus)
                            {
                                bonus = 70 - i_DI;
                            }
                            weap.Attributes.WeaponDamage += bonus;
                            weap.Consecrated              = true;
                            weap.LootType = LootType.Blessed;
                            from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                        }
                        else
                        {
                            from.SendMessage(32, "You fail to sharpen the weapon");
                        }
                        if (Uses <= 1)
                        {
                            from.SendMessage(32, "You used up the sharpening stone");
                            Delete();
                        }
                        else
                        {
                            --Uses;
                            from.SendMessage(32, "You have {0} uses left", Uses);
                        }
                    }
                }
                else if (o is BaseAxe && ((BaseAxe)o).IsChildOf(from.Backpack))
                {
                    BaseAxe weap = o as BaseAxe;
                    int     i_DI = weap.Attributes.WeaponDamage;
                    if (weap.Quality == WeaponQuality.Exceptional)
                    {
                        i_DI += 15;
                    }
                    if (i_DI >= 70)
                    {
                        from.SendMessage(32, "This weapon cannot be sharpened any further");
                        return;
                    }
                    else if (from.Skills[SkillName.Blacksmith].Value < 100.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80.0 chivalry to sharpen weapons with this stone");
                    }
                    else if (from.Skills[SkillName.Chivalry].Value < 80.0)
                    {
                        from.SendMessage(32, "You need at least 100.0 blacksmith and 80 chivalry to sharpen weapons with this stone");
                    }
                    else if (!Deleted)
                    {
                        int bonus = Utility.Random((int)(from.Skills[SkillName.Blacksmith].Value / 10));
                        if (bonus > 0)
                        {
                            if (70 < i_DI + bonus)
                            {
                                bonus = 70 - i_DI;
                            }
                            weap.Attributes.WeaponDamage += bonus;
                            weap.Consecrated              = true;
                            weap.LootType = LootType.Blessed;
                            from.SendMessage(88, "You sharpened the weapon with {0} damange increase", bonus);
                        }
                        else
                        {
                            from.SendMessage(32, "You fail to sharpen the weapon");
                        }
                        if (Uses <= 1)
                        {
                            from.SendMessage(32, "You used up the sharpening stone");
                            Delete();
                        }
                        else
                        {
                            --Uses;
                            from.SendMessage(32, "You have {0} uses left", Uses);
                        }
                    }
                }
                else
                {
                    from.SendMessage(32, "You can only enhance edged weapons");
                }
            }
            else
            {
                from.SendMessage(32, "You can only enhance edged weapons");
            }
        }
        public void Throw(Mobile from)
        {
            BaseKnife knife = from.Weapon as BaseKnife;

            if (knife == null)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751);                   // Try holding a knife...
                return;
            }

            from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
            from.MovingEffect(this, knife.ItemID, 7, 1, false, false);
            from.PlaySound(0x238);

            double rand = Utility.RandomDouble();

            int message;

            if (rand < 0.05)
            {
                message = 500752;                 // BULLSEYE! 50 Points!
            }
            else if (rand < 0.20)
            {
                message = 500753;                 // Just missed the center! 20 points.
            }
            else if (rand < 0.45)
            {
                message = 500754;                 // 10 point shot.
            }
            else if (rand < 0.70)
            {
                message = 500755;                 // 5 pointer.
            }
            else if (rand < 0.85)
            {
                message = 500756;                 // 1 point.  Bad throw.
            }
            else
            {
                message = 500757;                 // Missed.
            }
            PublicOverheadMessage(MessageType.Regular, 0x3B2, message);
            if (m_NextSound < DateTime.Now && message != 500757)
            {
                if (message == 500752)
                {
                    Effects.PlaySound(Location, Map, 426);
                }
                else
                {
                    Effects.PlaySound(Location, Map, 425);
                }

                if (message < 500756)
                {
                    AnimateMongbat();
                }

                m_NextSound = DateTime.Now + TimeSpan.FromSeconds(2);
            }
        }