コード例 #1
0
 public override void OnDoubleClick(Mobile from)
 {
     if (Check(from))
     {
         Repair.Do(from, RepairSkillInfo.GetInfo(m_Skill).System, this);
     }
 }
コード例 #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack) || Parent == from)
            {
                CraftSystem system = CraftSystem;

                if (Core.TOL && m_RepairMode)
                {
                    Repair.Do(from, system, this);
                }
                else
                {
                    int num = system.CanCraft(from, this, null);

                    if (num > 0 && (num != 1044267 || !Core.SE)) // Blacksmithing shows the gump regardless of proximity of an anvil and forge after SE
                    {
                        from.SendLocalizedMessage(num);
                    }
                    else
                    {
                        from.SendGump(new CraftGump(from, system, this, null));
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
コード例 #3
0
    void RepairComplate(Repair item)
    {
        Repair repairItem = mRepairItem.ItemObj.GetCmpt <Repair>();

        if (repairItem == item)
        {
            repairItem.Do();
            GameUI.Instance.mItemPackageCtrl.ResetItem();
            UpdateItem(repairItem);
        }
    }
コード例 #4
0
ファイル: CSRepair.cs プロジェクト: shrubba/planetexplorers
    public void Repairing()
    {
        if (m_Item == null)
        {
            return;
        }

        m_Item.Do();
        //		if (m_Item.mItemData.mRepairEnable)
        //		{
        //			if (m_Item.mItemID < CreationData.s_ObjectStartID)
        //				m_Item.Durability = m_Item.GetProperty(ItemProperty.DurabilityMax);
        //			else
        //			{
        //				CreationData cdata = CreationMgr.GetCreation(m_Item.mObjectID);
        //
        //				cdata.m_Hp = cdata.m_Attribute.m_Durability;
        //			}
        //		}
    }
コード例 #5
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            int index = info.ButtonID;

            if (index == 0)
            {
                // m_Addon.Using = false;
                m_Addon.User = null;
            }
            else if (index == 1)
            {
                StopTimer(from);
                from.SendLocalizedMessage(1158871); // Which repair deed or container of repair deeds do you wish to add to the repair bench?
                from.Target = new InternalTarget(from, this, m_Addon);
            }
            else if (index >= 10 && index < 20)
            {
                StopTimer(from);
                int skillindex = index - 10;
                Repair.Do(from, RepairSkillInfo.GetInfo((RepairSkillType)skillindex).System, m_Addon);
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(m_Addon);

                if (house != null && house.IsOwner(from))
                {
                    StopTimer(from);
                    int skillindex = index - 20;
                    from.SendGump(new ConfirmRemoveGump(m_Addon, (RepairSkillType)skillindex));
                }
                else
                {
                    from.SendLocalizedMessage(1005213); // You can't do that
                    // m_Addon.Using = false;
                    m_Addon.User = null;
                }
            }
        }
コード例 #6
0
ファイル: RepairContracts.cs プロジェクト: nogu3ira/xrunuo
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                bool IsFound = GetVendor(from);

                if (IsFound)
                {
                    CraftSystem cs = GetCraftSystem();

                    Repair.Do(from, cs, m_Level, this);
                }
                else
                {
                    GetVendorMessage(from);
                }
            }
            else
            {
                from.SendLocalizedMessage(1047012);                   // The contract must be in your backpack to use it.
            }
        }
コード例 #7
0
        public override void OnResponse(NetState state, int index)
        {
            switch (SelectedGumpLevel)
            {
            case GumpLevel.SelectGroup:
            {
                SpecialOptions();

                //
                if (isFiltered && localGroupIndexList.ContainsKey(Entries[index]))
                {
                    index = localGroupIndexList[Entries[index]];
                }

                SelectedGroupIndex = index;
                if (index == m_CustomResources)
                {
                    SelectedGumpLevel = GumpLevel.SelectResource;
                    GumpOwner.SendMenu(new CustomCraftMenu(m_CurrentCraftMenu));
                }
                else if (index == m_RepairIndex)
                {
                    Repair.Do(GumpOwner, CurrentCraftSystem, ToolUsed);
                }
                else if (index == m_SmeltIndex)
                {
                    Resmelt.Do(GumpOwner, CurrentCraftSystem, ToolUsed);
                }
                else if (index == m_EnhanceIndex)
                {
                    GumpOwner.SendAsciiMessage("Enhancing disabled.");
                }
                else
                {
                    SelectedGumpLevel = GumpLevel.SelectItem;
                    GumpOwner.SendMenu(new CustomCraftMenu(m_CurrentCraftMenu));
                }
                break;
            }

            case GumpLevel.SelectItem:
                if (index == 0)    //Go back
                {
                    SelectedGumpLevel = GumpLevel.SelectGroup;
                    GumpOwner.SendMenu(new CustomCraftMenu(m_CurrentCraftMenu));
                }
                else
                {
                    CreateItem(index - 1);  //Cause of the "back button"
                }
                break;

            case GumpLevel.SelectResource:
            {
                SelectedResourceIndex = (index);
                SelectedResType       = CurrentCraftSystem.CraftSubRes.GetAt(SelectedResourceIndex).ItemType;
                SelectedGumpLevel     = GumpLevel.SelectGroup;

                GumpOwner.SendMenu(new CustomCraftMenu(m_CurrentCraftMenu));
                break;
            }
            }
        }
コード例 #8
0
        /*private static ItemListEntry[] Test()
         * {
         *  Type type;
         *  int itemid;
         *  string name;
         *  Item item;
         *
         *  ItemListEntry[] entries = new ItemListEntry[DefBlacksmithy.CraftSystem.CraftItems.Count];
         *
         *  for (int i = 0; i < DefBlacksmithy.CraftSystem.CraftItems.Count; ++i)
         *  {
         *      type = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i).ItemType;
         *
         *      item = null;
         *      try { item = Activator.CreateInstance(type) as Item; }
         *      catch { }
         *      name = item.Name;
         *      itemid = item.ItemID;
         *
         *      entries[i-missing] = new ItemListEntry(name, itemid, 0, i);
         *
         *      if (item != null)
         *          item.Delete();
         *  }
         *
         *  return entries;
         * }*/

        public override void OnResponse(NetState state, int index)
        {
            if (IsFrom == "Main")
            {
                if (m_Entries[index].craftIndex == 0)
                {
                    Repair.Do(m_Mobile, DefBlacksmithy.CraftSystem, m_Tool);
                }
                if (m_Entries[index].craftIndex == 1)
                {
                    IsFrom = "Shields";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Shields(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 2)
                {
                    IsFrom = "Armor";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Armor(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 3)
                {
                    IsFrom = "Weapons";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Weapons(m_Mobile), IsFrom, m_Tool));
                }
            }
            else if (IsFrom == "Shields")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 18).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 18).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 18).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 18));
            }
            else if (IsFrom == "Weapons")
            {
                if (m_Entries[index].craftIndex == 0)
                {
                    IsFrom = "Blades";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Blades(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 1)
                {
                    IsFrom = "Axes";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Axes(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 2)
                {
                    IsFrom = "Maces";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Maces(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 3)
                {
                    IsFrom = "Polearms";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Polearms(m_Mobile), IsFrom, m_Tool));
                }
            }
            else if (IsFrom == "Blades")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 24).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 24).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 24).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 24));
            }
            else if (IsFrom == "Axes")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 32).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 32).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 32).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 32));
            }
            else if (IsFrom == "Maces")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 43).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 43).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 43).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 43));
            }
            else if (IsFrom == "Polearms")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 39).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 39).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 39).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 39));
            }
            else if (IsFrom == "Armor")
            {
                if (m_Entries[index].craftIndex == 0)
                {
                    IsFrom = "Platemail";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Platemail(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 1)
                {
                    IsFrom = "Chainmail";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Chainmail(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 2)
                {
                    IsFrom = "Ringmail";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Ringmail(m_Mobile), IsFrom, m_Tool));
                }
                else if (m_Entries[index].craftIndex == 3)
                {
                    IsFrom = "Helmets";
                    m_Mobile.SendMenu(new BlacksmithMenu(m_Mobile, Helmets(m_Mobile), IsFrom, m_Tool));
                }
            }
            else if (IsFrom == "Platemail")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 7).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 7).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 7).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 7));
            }
            else if (IsFrom == "Chainmail")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 5).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 5).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 5).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 5));
            }
            else if (IsFrom == "Ringmail")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex)).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex)).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex)).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex)));
            }
            else if (IsFrom == "Helmets")
            {
                Type type = null;

                CraftContext   context  = DefBlacksmithy.CraftSystem.GetContext(m_Mobile);
                CraftSubResCol res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 12).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                int            resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 12).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                //chainmail coif
                if (index == 0)
                {
                    res      = (DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).UseSubRes2 ? DefBlacksmithy.CraftSystem.CraftSubRes2 : DefBlacksmithy.CraftSystem.CraftSubRes);
                    resIndex = (DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
                }

                if (resIndex > -1)
                {
                    type = res.GetAt(resIndex).ItemType;
                }

                //chainmail coif
                if (index == 0)
                {
                    DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt(4));
                }
                //the rest
                else
                {
                    DefBlacksmithy.CraftSystem.CreateItem(m_Mobile, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 12).ItemType, type, m_Tool, DefBlacksmithy.CraftSystem.CraftItems.GetAt((m_Entries[index].craftIndex) + 12));
                }
            }
        }