private static void MakeEventItems(Item[] itemList, int hue, string teamName, bool allNewbied, bool stayEquipped, bool consumeItems) { for (int i = 0; i < itemList.Length; ++i) { Item item = itemList[i]; //Jump to next item if this item was flagged to be an event item somewhere else. if (item.EventItem) { continue; } //Make the items newbied if we have selected them to be so if (allNewbied) { item.LootType = LootType.Newbied; } //Flag the event item item.EventItem = true; //If the eventitem consume flag is not set, set it to whatever the eventsupplier ConsumeItems is set to. if (!item.EventItemConsume) { item.EventItemConsume = consumeItems; } //Tag the item with the event tag. if (string.IsNullOrEmpty(item.Name)) { item.Name = string.Format(m_NameFormat, CliLoc.LocToString(item.LabelNumber)); } else { item.Name = string.Format(m_NameFormat, item.Name); } //Tag the item with the team name if (!string.IsNullOrEmpty(teamName)) { if (item is BaseWeapon) { ((BaseWeapon)item).IsRenamed = true; } item.Name = string.Format("{0} {1}", teamName, item.Name); } //Color the event item if (hue > 0) { item.Hue = hue; } //Flag all the items in the containers if (item is BaseContainer) { MakeEventItems(item.Items.ToArray(), hue, teamName, allNewbied, stayEquipped, consumeItems); } } }
public static string ComputeName(RepairDeed rd) { string name = string.Format("Repair service contract from {0} {1} crafted by {2}", CliLoc.LocToString(rd.GetSkillTitle(rd.SkillLevel)).ToLower(), rd.CrafterSkill().ToLower(), rd.Crafter != null ? rd.Crafter.Name : "unknown"); return(name); }
public static string GenericComputeName(Item i) { string name; if (i.Name == null) { name = CliLoc.LocToString(i.LabelNumber); } else { name = i.Name; } return(name); }
//generate the full object property list public static List <string> GetPropertiesList(object obj) { if (obj is Type) { try { //create the object object typeobj = Activator.CreateInstance((Type)obj); //find its name using the instanced object List <string> recurseproperties = GetPropertiesList(typeobj); //clean up by removing this object if (typeobj is Item) { ((Item)typeobj).Delete(); } else if (typeobj is Mobile) { ((Mobile)typeobj).Delete(); } return(recurseproperties); } catch (Exception e) { //if there was a problem with this process, just return the type name return(new List <string>(new string[] { e.Message })); } } DirectObjectPropertyList dopl = GetDirectPropertyList(obj); if (dopl == null) { return(new List <string>(new string[] { "null" }));; } List <string> properties = new List <string>(); foreach (DOPLEntry doplentry in dopl) { properties.Add(CliLoc.LocToString(doplentry.Index, doplentry.Arguments)); } return(properties); }
public static string ComputeName(BaseInstrument bi) { string name; if (bi.Name == null) { name = CliLoc.LocToString(bi.LabelNumber); } else { name = bi.Name; } if (bi.Crafter != null) { name = string.Format("{0} crafted by {1}", name, bi.Crafter.Name); } return(name); }
public static string ComputeName(SpellScroll ss) { string name = string.IsNullOrEmpty(ss.Name) ? CliLoc.LocToString(ss.LabelNumber) : ss.Name; return(name + " scroll"); }
public static string ComputeName(BaseClothing bc) { if (bc.IsRenamed && !string.IsNullOrEmpty(bc.Name)) { return(bc.Name); } string name; if (bc.Name == null) { name = CliLoc.LocToString(bc.LabelNumber); } else { name = bc.Name; } if (bc.Amount > 1) { name = name + "s"; } var resource = string.Empty; if (bc.Resource != CraftResource.None && bc.Resource != CraftResource.Iron) { resource = CraftResources.GetName(bc.Resource); } if (bc.Crafter != null) { if (bc.Quality == ClothingQuality.Exceptional) { if (bc.Resource != CraftResource.None) { name = string.Format("{0} {1} {2} crafted by {3}", "Exceptional", resource.ToLower(), name.ToLower(), bc.Crafter.Name); } else { name = string.Format("{0} {1} crafted by {2}", "Exceptional", name.ToLower(), bc.Crafter.Name); } } else if (bc.Resource != CraftResource.None) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} crafted by {2}", resource, name.ToLower(), bc.Crafter.Name); } else { name = string.Format("{0} crafted by {1}", name, bc.Crafter.Name); } } else { name = string.Format("{0} crafted by {1}", name.ToLower(), bc.Crafter.Name); } } else if (bc.Resource != CraftResource.None) { if (bc.Quality == ClothingQuality.Exceptional) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} {2}", "Exceptional", resource.ToLower(), name.ToLower()); } else { name = string.Format(" {0} {1}", "Exceptional", name.ToLower()); } } else if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1}", resource, name.ToLower()); } else { name = string.Format(name); } } else if (bc.Resource == CraftResource.None) { if (bc.Quality == ClothingQuality.Exceptional) { name = string.Format("{0} {1}", "Exceptional", name.ToLower()); } } if (bc.Amount > 1) { name = bc.Amount + " " + name; } return(name); }
public static string ComputeName(BaseWeapon bw) { if (bw.IsRenamed && !string.IsNullOrEmpty(bw.Name)) { return(bw.Name); } string name; if (bw.Name == null) { name = CliLoc.LocToString(bw.LabelNumber); } else { name = bw.Name; } if (bw.Amount > 1) { name = name + "s"; } var resource = string.Empty; if (bw.Slayer != SlayerName.None) { SlayerEntry entry = SlayerGroup.GetEntryByName(bw.Slayer); if (entry != null) { string slayername = CliLoc.LocToString(entry.Title); name = slayername + " " + name.ToLower(); } } if (bw.Resource != CraftResource.None && bw.Resource != CraftResource.Iron) { resource = CraftResources.GetName(bw.Resource); } if ((bw.DamageLevel != WeaponDamageLevel.Regular || bw.AccuracyLevel != WeaponAccuracyLevel.Regular) && bw.Resource == CraftResource.Iron) { //If the weapon is accurate or magical if (bw.DamageLevel != WeaponDamageLevel.Regular && bw.AccuracyLevel != WeaponAccuracyLevel.Regular) { name = string.Format("{0} {1} of {2}", ComputeAccuracyLevel(bw), name.ToLower(), CliLoc.LocToString((1038015 + (int)bw.DamageLevel)).ToLower()); } else if (bw.AccuracyLevel != WeaponAccuracyLevel.Regular) { name = string.Format("{0} {1}", ComputeAccuracyLevel(bw), name.ToLower()); } else { name = string.Format("{0} of {1}", name, CliLoc.LocToString((1038015 + (int)bw.DamageLevel)).ToLower()); } if (bw.Quality == WeaponQuality.Exceptional) { name = "Exceptional " + name.ToLower(); } } else if (bw.Resource != CraftResource.None) { //If it's crafted by a player if (bw.Crafter != null) { if (bw.Quality == WeaponQuality.Exceptional) { if (bw.Resource != CraftResource.Iron) { name = string.Format("{0} {1} {2} crafted by {3}", "Exceptional", resource.ToLower(), name.ToLower(), bw.Crafter.Name); } else { name = string.Format("{0} {1} crafted by {2}", "Exceptional", name.ToLower(), bw.Crafter.Name); } } else if (bw.Resource != CraftResource.Iron) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} crafted by {2}", resource, name.ToLower(), bw.Crafter.Name); } else { name = string.Format("{0} crafted by {1}", name, bw.Crafter.Name); } } else { name = string.Format("{0} crafted by {1}", name, bw.Crafter.Name); } } else if (bw.Resource != CraftResource.Iron) { if (bw.Quality == WeaponQuality.Exceptional) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} {2}", "Exceptional", resource.ToLower(), name.ToLower()); } else { name = string.Format("{0}, {1}", "Exceptional", name.ToLower()); } } else if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1}", resource, name.ToLower()); } else { name = string.Format(name); } } else if (bw.Resource == CraftResource.Iron) { if (bw.Quality == WeaponQuality.Exceptional) { name = string.Format("{0} {1}", "Exceptional", name.ToLower()); } } } if (bw.Amount > 1) { name = bw.Amount + " " + name; } return(name); }
public static string ComputeName(BaseArmor ba) { if (ba.IsRenamed && !string.IsNullOrEmpty(ba.Name)) { return(ba.Name); } string name; if (ba.Name == null) { name = CliLoc.LocToString(ba.LabelNumber); } else { name = ba.Name; } if (ba.Amount > 1) { name = name + "s"; } var resource = string.Empty; if (ba.Resource != CraftResource.None && ba.Resource != CraftResource.Iron) { resource = CraftResources.GetName(ba.Resource); } if ((ba.ProtectionLevel != ArmorProtectionLevel.Regular))// && ba.Resource == CraftResource.Iron ) //If the armor is magical { if (ba.Quality == ArmorQuality.Exceptional) { name = string.Format("{0} {1} of {2}", "Exceptional", name.ToLower(), CliLoc.LocToString((1038005 + (int)ba.ProtectionLevel)).ToLower()); } else { name = string.Format("{0} of {1}", name, CliLoc.LocToString((1038005 + (int)ba.ProtectionLevel)).ToLower()); } } else if (ba.Resource == CraftResource.None && ba.ProtectionLevel == ArmorProtectionLevel.Regular) //If the armor is not magical and not crafted { if (ba.Quality == ArmorQuality.Exceptional) { name = string.Format("{0} {1}", "Exceptional", name); } } else if (ba.Resource != CraftResource.None) { //If it's crafted by a player if (ba.Crafter != null) { if (ba.Quality == ArmorQuality.Exceptional) { if (ba.Resource != CraftResource.Iron) { name = string.Format("{0} {1} {2} crafted by {3}", "Exceptional", resource.ToLower(), name.ToLower(), ba.Crafter.Name); } else { name = string.Format("{0} {1} crafted by {2}", "Exceptional", name.ToLower(), ba.Crafter.Name); } } else if (ba.Resource != CraftResource.Iron) { name = string.Format("{0} {1}", resource, name.ToLower()); } else { name = string.Format("{0}", name); } } else if (ba.Quality == ArmorQuality.Exceptional) { if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1} {2}", "Exceptional", resource.ToLower(), name.ToLower()); } else { name = string.Format("{0} {1}", "Exceptional", name.ToLower()); } } else if (!string.IsNullOrEmpty(resource)) { name = string.Format("{0} {1}", resource, name.ToLower()); } else { name = string.Format(name); } } if (ba.Amount > 1) { name = ba.Amount + " " + name; } return(name); }