(I'm reffering to MoopleDEV here, some stuff may change if you're using a different source.
Go to MapleMap.java. At the top, at the variables, add this:
Code:
private int eventSpawnTime = 45000;
private boolean eventSpawn = false;
Find this:
Code:
if (mapid == 923010000 && getMonsterById(9300102) == null) { // Kenta's Mount Quest
spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300102), new Point(77, 426));
After this, add this:
Code:
} else if (mapid == ID_HERE) { // Spawn monster event.
if (!eventSpawn) {
chr.dropMessage(6, "[Event] The event has started! A group of monsters will spawn every 45 seconds and will increase overtime!");
startEventSpawn();
eventSpawn = true;
}
To remove the event, we will just remove it when the player exists the map through a portal, so, find this:
Code:
characters.remove(chr);
Add this, after:
Code:
if (chr.getMap() == ID_HERE)
TimerManager.getInstance().stop();
eventSpawn = false;
After that, add this function to that same file. This function will spawn any monster you want every (time you set, 45 seconds) and will increase that time after every execution.
Code:
public void startSpawnEvent() {
TimerManager.getInstance().register(new Runnable() {
public void run() {
spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300102), new Point(CHANGE_X, CHANGE_Y)); // The monster that it will spawn on x, y that you choose. You can also use array and for loop for some monsters.
if (spawnTime != 45000)
spawnTime += 5000; // Change here for the increment each spawn. It will increase it by 5 every spawn.
}
}, spawnTime);
}
Have fun..