GetName() public static method

Returns the CraftResourceInfo.Name property of 'resource' -or- an empty string if the resource specified was invalid.
public static GetName ( CraftResource resource ) : string
resource CraftResource
return string
示例#1
0
        public override void OnSingleClick(Mobile from)
        {
            LabelToExpansion(from);

            string v = " ";

            if (!CraftResources.IsStandard(Resource))
            {
                int num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    v = String.Format("#{0}", num);
                }
                else
                {
                    v = CraftResources.GetName(Resource);
                }
            }

            LabelTo(from, 1061119, v);               // ~1_LEATHER_TYPE~ runic sewing kit

            if (ShowUsesRemaining)
            {
                DisplayDurabilityTo(from);
            }
        }
示例#2
0
        public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

            int index = CraftResources.GetIndex(Resource);

            if (index >= 1 && index <= 8)
            {
                return;
            }

            if (!CraftResources.IsStandard(Resource))
            {
                int num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    list.Add(num);
                }
                else
                {
                    list.Add(CraftResources.GetName(Resource));
                }
            }
        }
示例#3
0
        public override void AddNameProperties(ObjectPropertyList list)
        {
            base.AddNameProperties(list);

            if (!CraftResources.IsStandard(Resource))
            {
                list.Add(1060662, "{0}\t{1}", "Resource", CraftResources.GetName(Resource));
            }
        }
示例#4
0
 public override void OnSingleClick(Mobile from)
 {
     if (CraftResources.IsStandard(m_Resource))
     {
         LabelTo(from, string.Format(Amount == 1 ? "{0} log" : "{0} logs", Amount));
     }
     else
     {
         LabelTo(from, string.Format("{0} {1} log{2}", Amount, CraftResources.GetName(m_Resource).ToLower(), Amount > 1 ? "s" : ""));
     }
 }
示例#5
0
        public BaseLog(CraftResource resource, int amount)
            : base(0x1BDD)
        {
            Stackable = true;
            Weight    = 0.3;
            Amount    = amount;

            m_Resource = resource;
            Name       = CraftResources.GetName(resource) + " log";
            Hue        = CraftResources.GetHue(resource);
        }
示例#6
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (!CraftResources.IsStandard(m_Resource))
            {
                /*int num = CraftResources.GetLocalizationNumber( m_Resource );
                 *
                 * if ( num > 0 )
                 *      list.Add( num );
                 * else*/
                list.Add(CraftResources.GetName(m_Resource));
            }
        }
示例#7
0
        public override void GetProperties(ObjectPropertyList list)
        {
            int oldUses = m_UsesRemaining;

            CheckReplenishUses(false);

            base.GetProperties(list);

            if (m_ReplenishesCharges)
            {
                list.Add(1070928); // Replenish Charges
            }
            if (m_Slayer != SlayerName.None)
            {
                SlayerEntry entry = SlayerGroup.GetEntryByName(m_Slayer);
                if (entry != null)
                {
                    list.Add(entry.Title);
                }
            }

            if (m_Slayer2 != SlayerName.None)
            {
                SlayerEntry entry = SlayerGroup.GetEntryByName(m_Slayer2);
                if (entry != null)
                {
                    list.Add(entry.Title);
                }
            }

            if (!CraftResources.IsStandard(m_Resource))
            {
                int num = CraftResources.GetLocalizationNumber(m_Resource);

                if (num > 0)
                {
                    list.Add(num);
                }
                else
                {
                    list.Add(CraftResources.GetName(m_Resource));
                }
            }

            if (m_UsesRemaining != oldUses)
            {
                Timer.DelayCall(TimeSpan.Zero, new TimerCallback(InvalidateProperties));
            }
        }
示例#8
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (!CraftResources.IsStandard(this.m_Resource))
            {
                int num = CraftResources.GetLocalizationNumber(this.m_Resource);

                if (num > 0)
                {
                    list.Add(num);
                }
                else
                {
                    list.Add(CraftResources.GetName(this.m_Resource));
                }
            }
        }
示例#9
0
        public override void GetProperties(IPropertyList list)
        {
            base.GetProperties(list);

            if (!CraftResources.IsStandard(_resource))
            {
                var num = CraftResources.GetLocalizationNumber(_resource);

                if (num > 0)
                {
                    list.Add(num);
                }
                else
                {
                    list.Add(CraftResources.GetName(_resource));
                }
            }
        }
示例#10
0
        public override void OnSingleClick(Mobile from)
        {
            string v = " ";

            if (!CraftResources.IsStandard(Resource))
            {
                int num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    v = String.Format("#{0}", num);
                }
                else
                {
                    v = CraftResources.GetName(Resource);
                }
            }

            LabelTo(from, 1061119, v);               // ~1_LEATHER_TYPE~ runic sewing kit
        }
示例#11
0
        public override LocalizedText GetNameProperty()
        {
            string v = " ";

            if (!CraftResources.IsStandard(Resource))
            {
                int num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    v = String.Format("#{0}", num);
                }
                else
                {
                    v = CraftResources.GetName(Resource);
                }
            }

            return(new LocalizedText(1061119, v));              // ~1_LEATHER_TYPE~ runic sewing kit
        }
示例#12
0
        public override void AddNameProperty(ObjectPropertyList list)
        {
            string v = " ";

            if (!CraftResources.IsStandard(this.Resource))
            {
                int num = CraftResources.GetLocalizationNumber(this.Resource);

                if (num > 0)
                {
                    v = String.Format("#{0}", num);
                }
                else
                {
                    v = CraftResources.GetName(this.Resource);
                }
            }

            list.Add(1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
        }
示例#13
0
        public override void OnSingleClick(Mobile from)
        {
            var v = " ";

            if (!CraftResources.IsStandard(Resource))
            {
                var num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    v = $"#{num}";
                }
                else
                {
                    v = CraftResources.GetName(Resource);
                }
            }

            LabelTo(from, 1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
        }
示例#14
0
        public override void AddNameProperty(IPropertyList list)
        {
            var v = " ";

            if (!CraftResources.IsStandard(Resource))
            {
                var num = CraftResources.GetLocalizationNumber(Resource);

                if (num > 0)
                {
                    v = $"#{num}";
                }
                else
                {
                    v = CraftResources.GetName(Resource);
                }
            }

            list.Add(1061119, v); // ~1_LEATHER_TYPE~ runic sewing kit
        }
示例#15
0
        public override void AddNameProperty(IPropertyList list)
        {
            if (CraftResources.IsStandard(Resource))
            {
                list.Add(1061119, " "); // ~1_LEATHER_TYPE~ runic sewing kit
                return;
            }

            var num = CraftResources.GetLocalizationNumber(Resource);

            if (num > 0)
            {
                // ~1_LEATHER_TYPE~ runic sewing kit
                list.Add(1061119, $"#{num}");
            }
            else
            {
                // ~1_LEATHER_TYPE~ runic sewing kit
                list.Add(1061119, CraftResources.GetName(Resource));
            }
        }
示例#16
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_AosAttributes.Brittle != 0)
            {
                list.Add(1116209); // Brittle
            }
            if (m_AosSkillBonuses != null)
            {
                m_AosSkillBonuses.GetProperties(list);
            }

            base.AddResistanceProperties(list);

            int prop = 0;

            if ((prop = (m_AosAttributes.WeaponDamage)) != 0)
            {
                list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = (m_AosAttributes.AttackChance)) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = m_LowerStatReq) != 0)
            {
                list.Add(1060435, m_LowerStatReq.ToString()); // lower requirements ~1_val~%
            }
            if ((prop = m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482); // spell channeling
            }
            if (!CraftResources.IsStandard(m_Resource))
            {
                list.Add(CraftResources.GetName(m_Resource));
            }

            if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            //if ( (prop = m_AosAttributes.WeaponSpeed) != 0 )
            //	list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%

            int hookCliloc = BaseFishingHook.GetHookType(m_HookType);

            if (m_HookType > HookType.None && hookCliloc > 0)
            {
                list.Add(1150885, String.Format("#{0}", hookCliloc));                               //special hook: ~1_token~
                list.Add(1150889, String.Format("#{0}", BaseFishingHook.GetCondition(m_HookUses))); //Hook condition: ~1_val~
            }

            if (m_BaitType != null)
            {
                object label = FishInfo.GetFishLabel(m_BaitType);
                if (label is int)
                {
                    list.Add(1116468, String.Format("#{0}", (int)label)); //baited to attract: ~1_val~
                }
                else if (label is string)
                {
                    list.Add(1116468, (string)label);
                }

                list.Add(1116466, m_BaitUses.ToString()); // amount: ~1_val~
            }

            list.Add(1061170, GetStrRequirement().ToString()); // strength requirement ~1_val~
        }
示例#17
0
 public override void OnSingleClick(Mobile from)
 {
     LabelTo(from, string.Format("{0} {1} ore{2}", Amount, CraftResources.GetName(m_Resource).ToLower(), Amount != 1 ? "s" : ""));
 }
示例#18
0
 public override void OnSingleClick(Mobile from)
 {
     LabelTo(from, string.Format("{0} {1} ingot{2}", Amount > 1 ? Amount.ToString() : "", CraftResources.GetName(m_Resource).ToLower(), Amount > 1 ? "s" : ""));
 }
示例#19
0
        public void GetNameProperty()
        {
            if (!PlayerConstructed)
            {
                return;
            }

            string metaltype = "";
            string gemtype   = "";

            if (Resource != CraftResource.None)
            {
                metaltype = CraftResources.GetName(m_Resource);
            }

            if (Resource == CraftResource.MIron)
            {
                Hue = 2105;
            }
            if (Resource == CraftResource.MGold)
            {
                Hue = 0;
            }


            switch (GemType)
            {
            case GemType.Amber: gemtype = "d'ambres"; break;

            case GemType.Amethyst: gemtype = "d'améthystes"; break;

            case GemType.Citrine: gemtype = "de citrines"; break;

            case GemType.Diamond: gemtype = "de diamants"; break;

            case GemType.Emerald: gemtype = "d'émeraudes"; break;

            case GemType.Ruby: gemtype = "de rubis"; break;

            case GemType.Sapphire: gemtype = "de saphirs"; break;

            case GemType.StarSapphire: gemtype = "de saphirs étoilés"; break;

            case GemType.Tourmaline: gemtype = "de tourmalines"; break;
            }

            if (this is GoldBracelet)
            {
                Name = string.Format("Un bracelet{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serti " + gemtype : "");
            }
            else if (this is GoldRing)
            {
                Name = string.Format("Une bague{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " sertie " + gemtype : "");
            }
            else if (this is GoldBeadNecklace)
            {
                Name = string.Format("Un collier de perle{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serti " + gemtype : "");
            }
            else if (this is GoldNecklace)
            {
                Name = string.Format("Un collier{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serti " + gemtype : "");
            }
            else if (this is GoldEarrings)
            {
                Name = string.Format("Des boucles d'oreille{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serties " + gemtype : "");
            }
            else if (this is Diademe)
            {
                Name = string.Format("Un diadème{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serti " + gemtype : "");
            }
            else if (this is DiademeDecore)
            {
                Name = string.Format("Un diadème{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " richement serti " + gemtype : "");
            }
            else
            {
                Name = string.Format("Un bijou{0}{1}", Resource != CraftResource.None ? " en " + metaltype : "", GemType != GemType.None ? " serti " + gemtype : "");
            }
        }
示例#20
0
        public RunicHouseGump(Mobile from, RunicHouse house) : base(25, 25)
        {
            m_From   = from;
            rh_House = house;

            from.CloseGump(typeof(RunicHouseGump));

            AddPage(0);

            AddBackground(50, 10, 600, 360, 5170);
            AddPage(0);
            AddLabel(280, 30, 25, "Runic Box");

            for (int line = 0; line < 13; line++)
            {
                AddLabel(80, 70 + line * 20, 0x486, (CraftResources.GetName(((CraftResource)line + 2))).ToString());

                AddLabel(160, 50, 1164, "Tinker");
                if (rh_House.Tinker.ContainsKey(((CraftResource)line + 2)))
                {
                    AddButton(155, 68 + line * 20, 4015, 4016, 52 + line, GumpButtonType.Reply, 0);
                    AddLabel(190, 70 + line * 20, 0x480, rh_House.Tinker[((CraftResource)line + 2)].ToString());
                }
                else
                {
                    AddButton(155, 68 + line * 20, 4006, 4007, 52 + line, GumpButtonType.Reply, 0);
                    AddLabel(190, 70 + line * 20, 0x480, "0");
                }

                AddLabel(240, 50, 1164, "Blacksmith");
                if (rh_House.Rest.ContainsKey(((CraftResource)line + 2)))
                {
                    AddButton(235, 68 + line * 20, 4015, 4016, 2 + line, GumpButtonType.Reply, 0);
                    AddLabel(270, 70 + line * 20, 0x480, rh_House.Rest[((CraftResource)line + 2)].ToString());
                }
                else
                {
                    AddButton(235, 68 + line * 20, 4006, 4007, 2 + line, GumpButtonType.Reply, 0);
                    AddLabel(270, 70 + line * 20, 0x480, "0");
                }

                AddLabel(390, 50, 1164, "Tailor");
                if (line < 10)
                {
                    AddLabel(320, 70 + line * 20, 0x486, (CraftResources.GetName(((CraftResource)line + 102))).ToString());
                    if (rh_House.Tailor.ContainsKey(((CraftResource)line + 102)))
                    {
                        AddButton(385, 68 + line * 20, 4015, 4016, 102 + line, GumpButtonType.Reply, 0);
                        AddLabel(420, 70 + line * 20, 0x480, rh_House.Tailor[((CraftResource)line + 102)].ToString());
                    }
                    else
                    {
                        AddButton(385, 68 + line * 20, 4006, 4007, 102 + line, GumpButtonType.Reply, 0);
                        AddLabel(420, 70 + line * 20, 0x480, "0");
                    }
                }

                AddLabel(550, 50, 1164, "Fletcher");
                if (line < 11)
                {
                    AddLabel(470, 70 + line * 20, 0x486, (CraftResources.GetName(((CraftResource)line + 301))).ToString());
                    if (rh_House.Rest.ContainsKey(((CraftResource)line + 301)))
                    {
                        AddButton(545, 68 + line * 20, 4015, 4016, 301 + line, GumpButtonType.Reply, 0);
                        AddLabel(580, 70 + line * 20, 0x480, rh_House.Rest[((CraftResource)line + 301)].ToString());
                    }
                    else
                    {
                        AddButton(545, 68 + line * 20, 4006, 4007, 301 + line, GumpButtonType.Reply, 0);
                        AddLabel(580, 70 + line * 20, 0x480, "0");
                    }
                }
                AddLabel(470, 310, 0x486, "Add");
                AddButton(545, 308, 4015, 4016, 999, GumpButtonType.Reply, 0);
            }
        }