コード例 #1
0
 public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
     {
         return(1044038);                // You have worn out your tool!
     }
     else if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263);                // The tool must be on your person to use.
     }
     else if (itemType != null && (itemType.IsSubclassOf(typeof(BaseFactionTrapDeed)) || itemType == typeof(FactionTrapRemovalKit)) && Faction.Find(from) == null)
     {
         return(1044573);                // You have to be in a faction to do that.
     }
     return(0);
 }
コード例 #2
0
 public override object CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
     {
         return(1044038);                // You have worn out your tool!
     }
     else if (!(from is PlayerMobile && from.Skills[SkillName.Magery].Base >= 114.0))
     {
         return(1044153);                // You don't have the required skill
     }
     else if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263);                // The tool must be on your person to use.
     }
     return(0);
 }
コード例 #3
0
 public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool.Deleted || tool.UsesRemaining < 0)
     {
         return(1044038);                // You have worn out your tool!
     }
     else if (!(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Mining].Base >= 50.0))
     {
         return(1044633);                // You havent learned stonecraft.
     }
     else if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263);                // The tool must be on your person to use.
     }
     return(0);
 }
コード例 #4
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038); // You have worn out your tool!
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263); // The tool must be on your person to use.
            }
            if (CheckAnvil(from, 1))
            {
                return(0);
            }

            return(1044266); // You must be near an anvil
        }
コード例 #5
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038);                // You have worn out your tool!
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263);                // The tool must be on your person to use.
            }
            if (from.Map == Map.SavagedEmpire && from.X > 1104 && from.X < 1125 && from.Y > 1960 && from.Y < 1978)
            {
                return(0);
            }

            return(501816);
        }
コード例 #6
0
        public override object CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038);                // You have worn out your tool!
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263);                // The tool must be on your person to use.
            }
            if (from.Map == Map.TerMur && from.X > 1098 && from.X < 1121 && from.Y > 1908 && from.Y < 1931)
            {
                return(0);
            }

            return(501816);
        }
コード例 #7
0
        public override int CanCraft(
            Mobile m,
            //Compatibility with UOF fix
            IBaseTool tool,
            Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038);                // You have worn out your tool!
            }

            if (!BaseTool.CheckAccessible(tool, m))
            {
                return(1044263);                // The tool must be on your person to use.
            }

            return(base.CanCraft(m, tool, itemType));
        }
コード例 #8
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038); // You have worn out your tool!
            }

            if (!BaseTool.CheckTool(tool, from))
            {
                return(1048146); // If you have a tool equipped, you must use that tool.
            }

            if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263); // The tool must be on your person to use.
            }
            return(0);
        }
コード例 #9
0
        public override int CanCraft(Mobile from, BaseTool tool, Type typeItem)
        {
            int num = 0;

            if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
            {
                return(1044038); // You have worn out your tool!
            }
            else if (!tool.CheckAccessible(from, ref num))
            {
                return(num); // The tool must be on your person to use.
            }
            if (typeItem != null && typeItem.IsSubclassOf(typeof(SpellScroll)))
            {
                if (!_Buffer.ContainsKey(typeItem))
                {
                    object o = Activator.CreateInstance(typeItem);

                    if (o is SpellScroll)
                    {
                        SpellScroll scroll = (SpellScroll)o;
                        _Buffer[typeItem] = scroll.SpellID;
                        scroll.Delete();
                    }
                    else if (o is IEntity)
                    {
                        ((IEntity)o).Delete();
                        return(1042404); // You don't have that spell!
                    }
                }

                int       id   = _Buffer[typeItem];
                Spellbook book = Spellbook.Find(from, id);

                if (book == null || !book.HasSpell(id))
                {
                    return(1042404); // You don't have that spell!
                }
            }

            return(0);
        }
コード例 #10
0
 public override object CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
     {
         return(1044038);                // You have worn out your tool!
     }
     else if (!BaseTool.CheckTool(tool, from))
     {
         return(1048146);                // If you have a tool equipped, you must use that tool.
     }
     else if (!(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Carpentry].Base >= 100.0))
     {
         return(1044633);                // You havent learned stonecraft.
     }
     else if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263);                // The tool must be on your person to use.
     }
     return(0);
 }
コード例 #11
0
 public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
     {
         return(1044038); // You have worn out your tool!
     }
     else if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263); // The tool must be on your person to use.
     }
     else if (itemType != null && (itemType.IsSubclassOf(typeof(BaseFactionTrapDeed)) || itemType == typeof(FactionTrapRemovalKit)) && Faction.Find(from) == null)
     {
         return(1044573); // You have to be in a faction to do that.
     }
     else if (itemType == typeof(ModifiedClockworkAssembly) && !(from is PlayerMobile && ((PlayerMobile)from).MechanicalLife))
     {
         return(1113034); // You haven't read the Mechanical Life Manual. Talking to Sutek might help!
     }
     return(0);
 }
コード例 #12
0
 public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
 {
     if (tool?.Deleted != false || tool.UsesRemaining < 0)
     {
         return(1044038); // You have worn out your tool!
     }
     if (!BaseTool.CheckTool(tool, from))
     {
         return(1048146); // If you have a tool equipped, you must use that tool.
     }
     if (!(from is PlayerMobile mobile && mobile.Masonry && mobile.Skills.Carpentry.Base >= 100.0))
     {
         return(1044633); // You havent learned stonecraft.
     }
     if (!BaseTool.CheckAccessible(tool, from))
     {
         return(1044263); // The tool must be on your person to use.
     }
     return(0);
 }
コード例 #13
0
        public override string CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool.Deleted || tool.UsesRemaining < 0)
            {
                return("You have worn out your tool!");
            }
            else if (!BaseTool.CheckTool(tool, from))
            {
                return("If you have a tool equipped, you must use that tool.");
            }
            else if (!(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Carpentry].Base >= 100.0))
            {
                return("You havent learned stonecraft.");
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return("The tool must be on your person to use.");
            }

            return("");
        }
コード例 #14
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038);                // You have worn out your tool!
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263);                // The tool must be on your person to use.
            }
            bool anvil, forge;

            CheckAnvilAndForge(from, 2, out anvil, out forge);

            if (anvil && forge)
            {
                return(0);
            }

            return(1044267);            // You must be near an anvil and a forge to smith items.
        }
コード例 #15
0
ファイル: DefRunescribing.cs プロジェクト: nydehi/imagine-uo
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
            {
                return(1044038);                // You have worn out your tool!
            }
            else if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263);                // The tool must be on your person to use.
            }
            bool forge;

            CheckForge(from, 2, out forge);

            if (forge)
            {
                return(0);
            }

            return(1079787);            // You must be near a soulforge to imbue an item.
        }
コード例 #16
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool?.Deleted != false || tool.UsesRemaining < 0)
            {
                return(1044038); // You have worn out your tool!
            }
            if (!BaseTool.CheckTool(tool, from))
            {
                return(1048146); // If you have a tool equipped, you must use that tool.
            }
            if (!(from is PlayerMobile mobile && mobile.Glassblowing && mobile.Skills.Alchemy.Base >= 100.0))
            {
                return(1044634); // You havent learned glassblowing.
            }
            if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263); // The tool must be on your person to use.
            }
            DefBlacksmithy.CheckAnvilAndForge(from, 2, out _, out var forge);

            return(forge ? 0 : 1044628); // You must be near a forge to blow glass.
        }
コード例 #17
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            //if ( tool.Deleted || tool.UsesRemaining < 0 )
            //return 1044038; // You have worn out your tool!
            /*else*/ if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263);                // The tool must be on your person to use.
            }
            return(0);

            /*bool stump;
             *
             * CheckStump( from, 2, out stump );
             *
             * if ( stump )
             * return 0;
             *
             * //from.SendMessage( "You must be near a dishing stump to make these potions!" );
             * //return 600000; // You must be near an anvil and a forge to smith items.
             *
             * //from.SendMessage( "You must be near a dishing stump to make these potions!" );*/
        }
コード例 #18
0
        public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
        {
            if (tool?.Deleted != false || tool.UsesRemaining < 0)
            {
                return(1044038); // You have worn out your tool!
            }
            if (!BaseTool.CheckTool(tool, from))
            {
                return(1048146); // If you have a tool equipped, you must use that tool.
            }
            if (!BaseTool.CheckAccessible(tool, from))
            {
                return(1044263); // The tool must be on your person to use.
            }
            CheckAnvilAndForge(from, 2, out bool anvil, out bool forge);

            if (anvil && forge)
            {
                return(0);
            }

            return(1044267); // You must be near an anvil and a forge to smith items.
        }
コード例 #19
0
ファイル: Gumps.cs プロジェクト: Evad-lab/ServUOX
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (!BaseTool.CheckAccessible(m_Tool, from, true))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0: break;

            case 1:     // prefix
                from.SendGump(new ItemNameGump(m_ToReforge, m_Tool, m_Options, m_Prefix, m_Suffix, true));
                break;

            case 2:     // suffix
                from.SendGump(new ItemNameGump(m_ToReforge, m_Tool, m_Options, m_Prefix, m_Suffix, false));
                break;

            case 3:     // Reforge Item
            {
                if (!RunicReforging.CanReforge(from, m_ToReforge, m_Tool.CraftSystem))
                {
                    return;
                }

                int totalCharges = GetTotalCharges();

                if (m_Tool.UsesRemaining >= totalCharges)
                {
                    CraftResourceInfo resInfo = CraftResources.GetInfo(m_Tool.Resource);

                    if (resInfo == null)
                    {
                        return;
                    }

                    CraftAttributeInfo attrs = resInfo.AttributeInfo;

                    int min = 10;
                    int max = 80;

                    if (min < 10)
                    {
                        min = 10;
                    }
                    if (max > 100)
                    {
                        max = 100;
                    }

                    int budget = GetBudget();

                    ReforgedPrefix prefix = ReforgedPrefix.None;
                    ReforgedSuffix suffix = ReforgedSuffix.None;

                    if ((m_Options & ReforgingOption.GrandArtifice) != 0)
                    {
                        // choosing name 1
                        if ((m_Options & ReforgingOption.InspiredArtifice) != 0)
                        {
                            prefix = m_Prefix;

                            if (prefix == ReforgedPrefix.None)
                            {
                                from.SendLocalizedMessage(1152287);         // Re-forging failed. You did not choose a name! Please try again.
                                return;
                            }
                        }
                        else
                        {
                            // Not choosing name 1 or 2
                            if ((m_Options & ReforgingOption.SublimeArtifice) == 0)
                            {
                                // random prefix AND suffix
                                if ((m_Options & ReforgingOption.ExaltedArtifice) != 0)
                                {
                                    prefix = RunicReforging.ChooseRandomPrefix(m_ToReforge, budget);
                                    suffix = RunicReforging.ChooseRandomSuffix(m_ToReforge, budget, m_Prefix);
                                }
                                else         // random prefix OR suffix
                                {
                                    if (0.5 > Utility.RandomDouble())
                                    {
                                        prefix = RunicReforging.ChooseRandomPrefix(m_ToReforge, budget);
                                    }
                                    else
                                    {
                                        suffix = RunicReforging.ChooseRandomSuffix(m_ToReforge, budget, m_Prefix);
                                    }
                                }
                            }
                        }
                    }

                    if ((m_Options & ReforgingOption.ExaltedArtifice) != 0)
                    {
                        if ((m_Options & ReforgingOption.SublimeArtifice) != 0)
                        {
                            suffix = m_Suffix;

                            if (suffix == ReforgedSuffix.None)
                            {
                                from.SendLocalizedMessage(1152287);         // Re-forging failed. You did not choose a name! Please try again.
                                return;
                            }
                        }
                        else
                        {
                            suffix = RunicReforging.ChooseRandomSuffix(m_ToReforge, budget, m_Prefix);
                            budget = Math.Min(800, budget + 50);
                        }
                    }

                    // 50% chance to switch prefix/suffix around
                    if ((prefix != ReforgedPrefix.None || suffix != ReforgedSuffix.None) && 0.5 > Utility.RandomDouble())
                    {
                        int pre = (int)prefix;
                        int suf = (int)suffix;

                        prefix = (ReforgedPrefix)suf;
                        suffix = (ReforgedSuffix)pre;
                    }

                    RunicReforging.ApplyReforgedProperties(m_ToReforge, prefix, suffix, budget, min, max, RunicReforging.GetPropertyCount(m_Tool), 0, m_Tool, m_Options);

                    OnAfterReforged(m_ToReforge);
                    from.SendLocalizedMessage(1152286);         // You re-forge the item!

                    from.PlaySound(0x665);

                    m_Tool.UsesRemaining -= totalCharges;

                    if (m_Tool.UsesRemaining <= 0)
                    {
                        m_Tool.Delete();
                        from.SendLocalizedMessage(1044038);         // You have worn out your tool!
                    }
                }

                break;
            }

            case 4:
                from.SendGump(new ReforgingHelpGump());
                break;

            default:     // Option
            {
                ReforgingOption option = Options[info.ButtonID - 100];

                if (HasMetPrerequisite(option))
                {
                    if ((m_Options & option) == 0)
                    {
                        m_Options |= option;

                        if (m_Prefix != ReforgedPrefix.None && !RunicReforging.HasSelection((int)m_Prefix, m_ToReforge, m_Tool, m_Options, -1, -1))
                        {
                            m_Prefix         = ReforgedPrefix.None;
                            m_Context.Prefix = ReforgedPrefix.None;
                        }

                        if (m_Suffix != ReforgedSuffix.None && !RunicReforging.HasSelection((int)m_Suffix, m_ToReforge, m_Tool, m_Options, -1, -1))
                        {
                            m_Suffix         = ReforgedSuffix.None;
                            m_Context.Suffix = ReforgedSuffix.None;
                        }
                    }
                    else
                    {
                        m_Options ^= option;
                        InvalidatePrerequisite(option);
                    }

                    m_Context.Contexts[m_Tool] = m_Options;
                }

                from.SendGump(new RunicReforgingGump(from, m_ToReforge, m_Tool));
                break;
            }
            }
        }