Creates random element extension (#196)
This commit is contained in:
parent
0926b5abaa
commit
4403d6c1c7
84 changed files with 226 additions and 330 deletions
|
|
@ -82,8 +82,7 @@ namespace Server.Items
|
|||
if (list.Count == 0)
|
||||
return Point3D.Zero;
|
||||
|
||||
int idx = Utility.Random(list.Count);
|
||||
return list[idx];
|
||||
return list.RandomElement();
|
||||
}
|
||||
|
||||
private void AddOffsetLocation(Mobile from, int offsetX, int offsetY, List<Point3D> list)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ namespace Server.Items
|
|||
|
||||
for (int i = 0; i < 50; ++i)
|
||||
{
|
||||
Rectangle2D reg = regions[Utility.Random(regions.Length)];
|
||||
Rectangle2D reg = regions.RandomElement();
|
||||
int x = Utility.Random(reg.X, reg.Width);
|
||||
int y = Utility.Random(reg.Y, reg.Height);
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace Server.Items
|
|||
maxIntensity = 15;
|
||||
}
|
||||
|
||||
int propertyCount = propertyCounts[Utility.Random(propertyCounts.Length)];
|
||||
int propertyCount = propertyCounts.RandomElement();
|
||||
|
||||
BaseRunicTool.ApplyAttributesTo(this, true, 0, propertyCount, minIntensity, maxIntensity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,8 +439,8 @@ namespace Server.Items
|
|||
if (randomizeOrder)
|
||||
for (int i = 0; i < attrs.Length; i++)
|
||||
{
|
||||
int rand = Utility.Random(attrs.Length);
|
||||
AosElementAttribute temp = attrs[i];
|
||||
int rand = Utility.Random(attrs.Length);
|
||||
|
||||
attrs[i] = attrs[rand];
|
||||
attrs[rand] = temp;
|
||||
|
|
@ -501,7 +501,7 @@ namespace Server.Items
|
|||
if (entries.Length == 0)
|
||||
return SlayerName.None;
|
||||
|
||||
entry = entries[Utility.Random(entries.Length)];
|
||||
entry = entries.RandomElement();
|
||||
}
|
||||
|
||||
return entry.Name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue