public override void OnResponse(UltimaOnline.Network.NetState sender, RelayInfo info)
        {
            bool makersMark = (info.ButtonID == 1);

            if (makersMark)
            {
                m_From.SendLocalizedMessage(501808); // You mark the item.
            }
            else
            {
                m_From.SendLocalizedMessage(501809); // Cancelled mark.
            }
            m_CraftItem.CompleteCraft(m_Quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null);
        }
Example #2
0
            protected override void OnTick()
            {
                m_iCount++;

                m_From.DisruptiveAction();

                if (m_iCount < m_iCountMax)
                {
                    m_CraftSystem.PlayCraftEffect(m_From);
                }
                else
                {
                    m_From.EndAction <CraftSystem>();

                    var badCraft = m_CraftSystem.CanCraft(m_From, m_Tool, m_CraftItem.ItemType);

                    if (badCraft > 0)
                    {
                        if (m_Tool?.Deleted == false && m_Tool.UsesRemaining > 0)
                        {
                            m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, badCraft));
                        }
                        else
                        {
                            m_From.SendLocalizedMessage(badCraft);
                        }

                        return;
                    }

                    var quality = 1;

                    m_CraftItem.CheckSkills(m_From, m_TypeRes, m_CraftSystem, ref quality, out _, false);

                    var context = m_CraftSystem.GetContext(m_From);

                    if (context == null)
                    {
                        return;
                    }

                    if (typeof(CustomCraft).IsAssignableFrom(m_CraftItem.ItemType))
                    {
                        try
                        {
                            m_CraftItem.ItemType.CreateInstance <CustomCraft>(
                                m_From,
                                m_CraftItem,
                                m_CraftSystem,
                                m_TypeRes,
                                m_Tool,
                                quality
                                )?.EndCraftAction();
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e);
                        }

                        return;
                    }

                    var makersMark = false;

                    if (quality == 2 && m_From.Skills[m_CraftSystem.MainSkill].Base >= 100.0)
                    {
                        makersMark = m_CraftItem.IsMarkable(m_CraftItem.ItemType);
                    }

                    if (makersMark && context.MarkOption == CraftMarkOption.PromptForMark)
                    {
                        m_From.SendGump(
                            new QueryMakersMarkGump(
                                quality,
                                m_From,
                                m_CraftItem,
                                m_CraftSystem,
                                m_TypeRes,
                                m_Tool
                                )
                            );
                    }
                    else
                    {
                        if (context.MarkOption == CraftMarkOption.DoNotMark)
                        {
                            makersMark = false;
                        }

                        m_CraftItem.CompleteCraft(quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null);
                    }
                }
            }