示例#1
0
 public override void OnDoubleClick(Mobile from)
 {
     if (Check(from))
     {
         Repair.Do(from, RepairSkillInfo.GetInfo(m_Skill).System, this);
     }
 }
示例#2
0
        public bool VerifyRegion(Mobile m)
        {
            //TODO: When the entire region system data is in, convert to that instead of a proximity thing.
            if (!m.Region.IsPartOf <TownRegion>())
            {
                return(false);
            }

            return(Server.Factions.Faction.IsNearType(m, RepairSkillInfo.GetInfo(m_Skill).NearbyTypes, 6));
        }
示例#3
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add(1071345, string.Format("{0:F1}", m_SkillLevel)); // Skill: ~1_val~

            var desc = RepairSkillInfo.GetInfo(m_Skill).Description;

            if (desc != null)
            {
                list.Add(desc.ToString());
            }
        }
示例#4
0
        public override void OnSingleClick(Mobile from)
        {
            if (Deleted || !from.CanSee(this))
            {
                return;
            }

            LabelTo(from, 1061133,
                    $"{GetSkillTitle(m_SkillLevel).ToString()}\t{RepairSkillInfo.GetInfo(m_Skill).Name}");             // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.

            if (m_Crafter != null)
            {
                LabelTo(from, 1050043, m_Crafter.Name);                   // crafted by ~1_NAME~
            }
        }
示例#5
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_Crafter != null)
            {
                list.Add(1050043, m_Crafter.TitleName); // crafted by ~1_NAME~
            }
            var type = RepairSkillInfo.GetInfo(m_Skill);

            if (type.Description != null)
            {
                TextDefinition.AddTo(list, type.Description);
            }
        }
示例#6
0
        public bool Check(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1047012);                   // The contract must be in your backpack to use it.
            }
            else if (!VerifyRegion(from))
            {
                TextDefinition.SendMessageTo(from, RepairSkillInfo.GetInfo(m_Skill).NotNearbyMessage);
            }
            else
            {
                return(true);
            }

            return(false);
        }
示例#7
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;
                }
            }
        }
示例#8
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1061133, String.Format("{0}\t{1}", GetSkillTitle(m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(m_Skill).Name));                     // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
 }
示例#9
0
        public override void OnSingleClick(Mobile from)
        {
            string message = String.Empty;

            if (m_Crafter != null)
            {
                message = String.Format("{0}, {1}\t{2}", m_Crafter.RawName, GetSkillTitle(m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(m_Skill).Name);
            }
            else
            {
                message = String.Format("{0}\t{1}", GetSkillTitle(m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(m_Skill).Name);
            }

            LabelTo(from, 1061133, message);
        }
示例#10
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            string message = String.Empty;

            if (m_Crafter != null)
            {
                message = String.Format("{0}, {1}\t{2}", m_Crafter.RawName, GetSkillTitle(m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(m_Skill).Name);
            }
            else
            {
                message = String.Format("{0}\t{1}", GetSkillTitle(m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(m_Skill).Name);
            }

            list.Add(1061133, message);               // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.
        }
示例#11
0
 public string CrafterSkill()
 {
     return(CliLoc.LocToString(RepairSkillInfo.GetInfo(m_Skill).Name));
 }
示例#12
0
        public override void OnSingleClick(Mobile from)
        {
            if (this.Deleted || !from.CanSee(this))
            {
                return;
            }

            this.LabelTo(from, 1061133, String.Format("{0}\t{1}", GetSkillTitle(this.m_SkillLevel).ToString(), RepairSkillInfo.GetInfo(this.m_Skill).Name)); // A repair service contract from ~1_SKILL_TITLE~ ~2_SKILL_NAME~.

            if (this.m_Crafter != null)
            {
                this.LabelTo(from, 1050043, this.m_Crafter.Name); // crafted by ~1_NAME~
            }
        }