Two solutions I can offer.
Solution A) Add a variable to mob spawners to count how many mobs it has spawned. Remove it after 10 mobs has spawned.
I DO NOT SUGGEST USING THIS
Solution B) Instead of using mob spawners, go to NPCConversationManager, and add the function "spawnTenSnails" (or whatever you want to call it). Put this in the function:
Code:
List<MapleMonster> tempSpawn = new ArrayList<MapleMonster>();
for (int i = 0; i < 10; i++) {
MapleMonster tempMob = MapleLifeFactory.getMonster(100100);
tempSpawn.add(tempMob);
}
final List<MapleMonster> toSpawn = tempSpawn;
for (int i = 0; i < (toSpawn.size() - 1); i++) {
final int nextIndex = i + 1;
toSpawn.get(i).addListener(
new MonsterListener() {
public void monsterKilled() {
pqMap.spawnMonsterOnGroudBelow(toSpawn.get(nextIndex), new Point(X, Y));
}
}
);
}
Change 100100 to the monster ID of your choice.
If you want to change the number of monsters spawned, just find the line "for (int i = 0; i < 10; i++) {" and change 10 to whatever you want.
Change X, Y as the location of the spawnPoint.
Here's a more generalized version you can use:
Code:
public void tempSpawnPoint(int mobId, int spawnAmt, int respawnTime, int x, int y)
List<MapleMonster> tempSpawn = new ArrayList<MapleMonster>();
for (int i = 0; i < spawnAmt; i++) {
MapleMonster tempMob = MapleLifeFactory.getMonster(mobId);
tempSpawn.add(tempMob);
}
final List<MapleMonster> toSpawn = tempSpawn;
final Point spawnPoint = new Point(x, y);
for (int i = 0; i < (toSpawn.size() - 1); i++) {
final int nextIndex = i + 1;
toSpawn.get(i).addListener(
new MonsterListener() {
public void monsterKilled() {
Timer.EventTimer.getInstance().schedule(new Runnable() {
@Override
public void run() {
pqMap.spawnMonsterOnGroudBelow(toSpawn.get(nextIndex), spawnPoint);
}
}, respawnTime);
}
);
}
}
}
So just call cm.tempSpawnPoint(<mobId>, <how many times to spawn>, <respawn time>, <x position>, <y position); to start it.
For example:
Code:
cm.tempSpawnPoint(100100, 5, 1000, cm.getPlayer().getPosition().x, cm.getPlayer().getPosition().y);
will spawn 5 snails. Each one will spawn 1 second (1000 milliseconds) after the previous one dies. Spawn point is set to player's location.
DISCLAIMER: Code not tested. But it should work. Should.