Chucl
Member
- ServUO Version
- Publish Unknown
- Ultima Expansion
- None
Hello so i have this method:
What it does:
it looks in a range of 300 for Corpses then attach an XmlValue attachment to ALL of them
What i would like it to do;
Look in a range of 300 for Corpses then attach the XmlValue attachment to ONE corpse randomly, not all of them
What it does:
it looks in a range of 300 for Corpses then attach an XmlValue attachment to ALL of them
What i would like it to do;
Look in a range of 300 for Corpses then attach the XmlValue attachment to ONE corpse randomly, not all of them
Method:
Point3D location2 = this.Location;
Map map = this.Map;
List<Item> itemsFound = new List<Item>();
foreach (Item item in this.Map.GetItemsInRange(location2, 300))
{
if (item is Corpse)
itemsFound.Add(item);
}
for (int j = itemsFound.Count - 1; j >= 0; --j)
{
XmlAttach.AttachTo(itemsFound[j], new XmlValue("test",100));
}
}
Last edited: