RedBeard
Member
- ServUO Version
- Publish 57
- Ultima Expansion
- Endless Journey
I'm attempting to make a Magic Wand that reveals Hidden Items and Mobiles. The revealing part works as expected, however in the OnAdded method I am trying to passively detect hidden objects. This is what I have, which compiles, but doesn't passively detect.
Code:
public static void OnAdded(object parent, Mobile src)
{
int reqCharges = 1;
if (src == null || src.Map == null || src.Location == Point3D.Zero || src.IsStaff())
return;
IPooledEnumerable eable = src.Map.GetMobilesInRange(src.Location, 4);
if (eable == null)
return;
foreach (Mobile m in eable)
{
if (m == null || m == src || !CanRBDetect(src, m, false))
continue;
if (src.AccessLevel >= m.AccessLevel)
{
m.RevealingAction();
m.SendLocalizedMessage(500814); // You have been revealed!
}
}
eable.Free();
eable = src.Map.GetItemsInRange(src.Location, 8);
foreach (Item item in eable)
{
if (!item.Visible && item is RBRevealableItem)
{
src.SendMessage("You detect a hidden object nearby...");
}
}
eable.Free();
}