Пример #1
0
        public void DoMine(object obj)
        {
            object[] os   = (object[])obj;
            Mobile   from = (Mobile)os[0];
            Item     tool = (Item)os[1];

            if (from != null && from.CheckSkill(SkillName.Mining, 60.0, 100.0))
            {
                Container pack  = from.Backpack;
                int       count = 1;

                if (from.Skills[SkillName.Mining].Value > 100 && Utility.RandomBool())
                {
                    count++;
                }

                from.SendLocalizedMessage(1149924, count.ToString()); //You extract ~1_COUNT~ saltpeter from the niter deposit.
                Saltpeter sp = new Saltpeter(count);

                if (pack == null || !pack.TryDropItem(from, sp, false))
                {
                    sp.MoveToWorld(from.Location, from.Map);
                }

                Hits--;

                from.PlaySound(Utility.RandomMinMax(0x125, 0x126));
                CheckTool(tool);

                if (m_Hits <= 0)
                {
                    from.SendMessage("You have mined the last of the niter deposit.");
                    Delete();
                    return;
                }
            }
            else
            {
                from.SendLocalizedMessage(1149923);  //You mine the niter deposit but fail to produce any usable saltpeter.
            }
        }
Пример #2
0
        public void DoMine(object obj)
        {
            object[] os = (object[])obj;
            Mobile from = (Mobile)os[0];
            Item tool = (Item)os[1];

            if (from != null && from.CheckSkill(SkillName.Mining, 60.0, 100.0))
            {
                Container pack = from.Backpack;
                int count = 1;

                if (from.Skills[SkillName.Mining].Value > 100 && Utility.RandomBool())
                    count++;

                from.SendLocalizedMessage(1149924, count.ToString()); //You extract ~1_COUNT~ saltpeter from the niter deposit.
                Saltpeter sp = new Saltpeter(count);

                if (pack == null || !pack.TryDropItem(from, sp, false))
                    sp.MoveToWorld(from.Location, from.Map);

                Hits--;

                from.PlaySound(Utility.RandomMinMax(0x125, 0x126));
                CheckTool(tool);

                if (m_Hits <= 0)
                {
                    from.SendMessage("You have mined the last of the niter deposit.");
                    Delete();
                    return;
                }
            }
            else
                from.SendLocalizedMessage(1149923);  //You mine the niter deposit but fail to produce any usable saltpeter.
        }