ServUO Version
Publish 58
Ultima Expansion
None
I'm actually stuck on this, so I need a script to check the world for an item that doesn't just search for all items in the world, i need it to look at a specific spot (coord) then check that spot for the item, if the item exist then send a message, if the item does not exist, add it and send a message. As for the code to do this, I'm completely lost.
 


C#:
public static bool FindItem(int x, int y, int z, Map map, Item test)
        {
            return FindItem(new Point3D(x, y, z), map, test);
        }

        public static bool FindItem(Point3D p, Map map, Item test)
        {
            IPooledEnumerable eable = map.GetItemsInRange(p);

            foreach (Item item in eable)
            {
                if (item.Z == p.Z && item.ItemID == test.ItemID)
                {
                    eable.Free();
                    return true;
                }
            }

            eable.Free();
            return false;
        }

using Server;

if( TimeOfLegends.FindItem(x, y, z, map item) )
 
So I lack the TOL stuff, ahahah. I found it strange I could not find any references to this. Thanks for pointing this out, I really really really appreciate your assist!
 
Back