Kamras

Member
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!
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 134 Online
    • 273 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 86 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 79 Online
    • 190 Peak
  • Insane UO
    Endless Journey
    • Players
    • 77 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 27 Online
    • 85 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 22 Online
    • 48 Peak
  • Arth
    Custom (Modern)
    • Players
    • 22 Online
    • 34 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 21 Online
    • 172 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 17 Online
    • 30 Peak
  • Pandora
    Custom (Modern)
    • Players
    • 17 Online
    • 32 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back