Delta already has
Code:
public void spawnANPC(int npcID, int absX, int absY, int height)
{
server.npcHandler.newNPC(npcID, (absX), (absY), height, absX + 3, absY + 3, absX - 3, absY - 3, 0, server.npcHandler.GetNpcListHP(npcID), false);
}
in NPCHandler.java
You could also add this method (sort of pseudo code, I'm writing on the spot)
Code:
public void spawnMultipleNpcs(int npcID, int absX, int absY, int height, int walkarea, int amount)
{
for(int i = 0; i < amount; i++)
{
int[] xrange = { (absX-3), (absX-2), (absX-1), absX, (absX+1), (absX+2), (absX+3) }; //X precision
int[] yrange = { (absY-3), (absY-2), (absY-1), absY, (absY+1), (absY+2), (absY+3) };// Y precision
int x = xrange[misc.random(xrange.length)];//pick random x from xrange
int y = yrange[misc.random(yrange.length)];//pick random y from yrange
server.npcHandler.newNPC(npcID, x, y, height, (x + walkarea), (y + walkarea), (x - walkarea), (y - walkarea), 0, server.npcHandler.GetNpcListHP(npcID), false);
}
}
public void spawnManyDifNpcs(npcsToSpawn, X, Y, height, area, amount)
{
/*
where:
X is the original X, the center.
Y is the original Y, the center.
height is the height level on which to spawn
area is how far the npc can walk in any direction
amount is the number you want to spawn per each npcid
*/
for(int i = 0; i < npcsToSpawn.length; i++)
{
spawnMultipleNpcs(npcsToSpawn[i], X, Y, height, area, amount);
}
}
//and call it like this
int[] npcs = { 1, 7, 700, 4034, 2103 };//Different IDs of NPCs
spawnManyDifNpcs(npcs, 3024, 2114, 1, 3, 2);
Hope that helps, if only a little