Hello all, Are there anyway to delete mobiles whose dont have spawn? For example, a player buy a horse and release It, the horse will stay forever, If you restart the server the horse continue staying :S

I think that there are a way to delete mobiles without spawn but I dont know what I should to put and where.
Can someone help me please?

Thank you.
 
I don't know if you would really want to open that can of worms. There are other ways to look at it. Let's just focus on animals that were tamed once but have been released. You could easily check for that using something like the following snippet:

Code:
foreach (Mobile mobile in World.Mobiles.Values)
{
	if (mobile is BaseCreature)
	{
		BaseCreature creature = (BaseCreature)mobile;
		if (creature.Tamable && creature.Owners != null && creature.Owners.Count > 0 && !creature.Controlled)
		{
			// then add it to a List<BaseCreature> that you will delete.
		}
	}
}
 
Back