using System;
using System.Linq;
using Server.Mobiles;
namespace Server.Items
{
public class WhisperingRose1 : Item
{
[Constructable]
public WhisperingRose1()
: base(0x18EA)
{
this.Name = "A Whispering Rose From " + World.Mobiles.Values.OfType<PlayerMobile>().Select(pm=>pm.Name).Where(name=> name != null).ToList();
this.LootType = LootType.Blessed;
}
var names = World.Mobiles.Values.OfType<PlayerMobile>().Select(pm=>pm.Name).Where(name=> name != null).ToList();
names[Random(0,names.Count)];
var names = World.Mobiles.Values.OfType<PlayerMobile>().Select(pm=>pm.Name).Where(name=> name != null).ToList();
Name = "A Whispering Rose From " + (names.Count >= 1 ? names[Random(0,names.Count) : "No One");
CS0118: Line 14: 'System.Random' is a 'type' but is used like a 'variable'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
var names = World.Mobiles.Values.OfType<PlayerMobile>().Select(pm=>pm.Name).Where(name=> name != null).ToList();
this.Name = "A Whispering Rose From " + names[Random(0,names.Count)];
Errors:
+ CUSTOM/TEST/WhisperingRose1.cs:
CS0234: Line 14: The type or namespace name 'Random' does not exist in the namespace 'Server' (are you missing an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
[Constructable]
public WhisperingRose1()
: base(0x18EA)
{
var names = World.Mobiles.Values.OfType<PlayerMobile>().Select(pm=>pm.Name).Where(name=> name != null).ToList();
this.Name = "A Whispering Rose From " + names[Utility.Random(0, names.Count)];
this.LootType = LootType.Blessed;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.