Make a new server thread and then perform some simple AI calculations on your spawn.
For example...
while(running)
{
foreach(Spawn spawn in Dictionary.Spawns.Values);//make sure you are adding to this db when loading a new spawn from db or command
{
//optional check to see if the map the spawn is on has active players (if not do not perform ai checks... no players to see it!
foreach(Mob monster in spawn.Members.Values);//select each mob inside the spawn!)
{
//check if mob is alive: If so perform these other things, if not check if valid time for re spawn, if so re spawn it somewhere inside the spawn (pull new random coords, etc)
//Check for players near monster
//Check distance to player: if < attack range && last attack was at least attack speed ago, try attack (you need to code a monster>player attack calculation as well)
//Else, calculate direction monster needs to walk to move towards player (if last walk > walk speed ago)
//Walk in that direction (send walk packet, update the map so mob moves in the map objects)
}
}
}
That would be a POOR system to use but it gives you some general concept of how you'd go about it.
Personally I'd do a foreach player in server, then check for spawns within say... 2 screens of them and then perform AI checks only on those spawns (saves you cpu time because you only operate on spawns with players near'ish to them)
I'd also add in all sorts of other helper methods and checks to make sure say a monster doesn't wander too far away from the spawn and such... but you get the idea.