コード例 #1
0
        public override void OnResponse(Server.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_BuildItem.CompleteBuild(m_Quality, makersMark, m_From, m_BuildSystem, m_TypeRes, m_Tool, null);
        }
コード例 #2
0
            protected override void OnTick()
            {
                m_iCount++;

                m_From.DisruptiveAction();

                if (m_iCount < m_iCountMax)
                {
                    m_BuildSystem.PlayBuildEffect(m_From);
                }
                else
                {
                    m_From.EndAction(typeof(BuildSystem));

                    int badBuild = m_BuildSystem.CanBuild(m_From, m_Tool, m_BuildItem.m_Type);

                    if (badBuild > 0)
                    {
                        if (m_Tool != null && !m_Tool.Deleted && m_Tool.UsesRemaining > 0)
                        {
                            m_From.SendGump(new BuildGump(m_From, m_BuildSystem, m_Tool, badBuild));
                        }
                        else
                        {
                            m_From.SendLocalizedMessage(badBuild);
                        }

                        return;
                    }

                    int  quality = 1;
                    bool allRequiredLokaiSkills = true;

                    m_BuildItem.CheckLokaiSkills(m_From, m_TypeRes, m_BuildSystem, ref quality, ref allRequiredLokaiSkills, false);

                    BuildContext context = m_BuildSystem.GetContext(m_From);

                    if (context == null)
                    {
                        return;
                    }

                    if (typeof(CustomBuild).IsAssignableFrom(m_BuildItem.ItemType))
                    {
                        CustomBuild cc = null;

                        try{ cc = Activator.CreateInstance(m_BuildItem.ItemType, new object[] { m_From, m_BuildItem, m_BuildSystem, m_TypeRes, m_Tool, quality }) as CustomBuild; }
                        catch {}

                        if (cc != null)
                        {
                            cc.EndBuildAction();
                        }

                        return;
                    }

                    bool makersMark = false;

                    if (quality == 2 && LokaiSkillUtilities.XMLGetSkills(m_From)[m_BuildSystem.MainLokaiSkill].Base >= 100.0)
                    {
                        makersMark = m_BuildItem.IsMarkable(m_BuildItem.ItemType);
                    }

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

                        m_BuildItem.CompleteBuild(quality, makersMark, m_From, m_BuildSystem, m_TypeRes, m_Tool, null);
                    }
                }
            }