Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Minor add-on: HeavenMS player command to increase spawn

Newbie Spellweaver
Joined
May 31, 2008
Messages
28
Reaction score
5
Huge shout out to Ronan and his HeavenMS release, really made lock down period due to COVID-19 a heck lot more interesting. Thank you Ronan.

Back in the days of v83, players are expected to travel a fair bit of distance between mobs and players of modern MapleStory will find v83 spawn to be very sparse. Arans also have difficulty maintaining combos. Temple of time is an absolute test of patience. This user command is meant to give players limited capability to increase spawn of the map they are in without GM intervention, but without them spawning things totally out of context of the maps they are in.

This add on is a player (donor in context of HeavenMS but you can implement it anywhere along the GM ranks) command to multiply mob spawn in a player's map. By default, every alive mob is "cloned" once. With parameter, it can be cloned up to 5x the current map's spawn. Be aware that a player may use this command several times for exponential spawn increment. But HeavenMS source implements an upper limit of 500 mobs per map so the potential resource consumption of this feature is kept in check.

I've also implemented some rudimentary checks for end game bosses to make sure those aren't replicable through this command but I imagine there are many edge cases I haven't thought of.

aeronex - Minor add-on: HeavenMS player command to increase spawn - RaGEZONE Forums

Create a new Java Class file under client.command.commands.gm1 and fill in with below code.

PHP:
package client.command.commands.gm1;

import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.life.MapleMonster;
import server.maps.MapleMapObject;
import java.util.HashSet;
import server.life.MapleLifeFactory;

/**
 * @author aeronex
 */
public class XSpCommand extends Command {
    {
        setDescription("");
    }
    
    int[] bossIDs = new int[] {
        8810010, 8810011, 8810012, 8810013, 8810014, 8810015, 8810016, 8810017, 8810018, //dead horntail
        8810000, 8810001, 8810002, 8810003, 8810004, 8810005, 8810006, 8810007, 8810008, 8810009, //horntail
        8800000, 8800001, 8800002, 8800003, 8800004, 8800005, 8800006, 8800007, 8800008, 8800009, 8800010, //zakum
        8820000, 8820001, 8820002, 8820003, 8820004, 8820005, 8820006, 8820015, 8820016, 8820017, 8820018 //pink bean
    };
    
    @Override
    public void execute(MapleClient c, String[] params) {
        MapleCharacter player = c.getPlayer();
        HashSet<MapleMonster> mobs = new HashSet<>();
        
        for (MapleMapObject mmo : player.getMap().getMapObjects()) {
            if (mmo instanceof MapleMonster) {
                MapleMonster mob = (MapleMonster) mmo;
                if (mob.isAlive() && !isBoss(mob.getId())) {
                    mobs.add(mob);
                }
            }
        }
        
        int multiplier = 1;
        
        if (params.length > 0) {
            try { 
                multiplier = Integer.parseInt(params[0]);
                if (multiplier > 5) {
                    multiplier = 5;
                }
            }
            catch (NumberFormatException ex) {
                player.yellowMessage("Syntax: !xsp or !xsp <multiplier between 1 and 5>");
                multiplier = 1;
            }
        }
        else {
            multiplier = 1;
        }
        
        for (MapleMonster mob : mobs) {
            for (int i = 0; i < multiplier; i++) {
                player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mob.getId()), mob.getPosition());
            }
        }
    }

    private boolean isBoss(int id) {
        boolean is_boss = false;

        for (int i = 0; i < bossIDs.length; i++) {
            if (id == bossIDs[i]) {
                is_boss = true;
                break;
            }
        }
        
        return is_boss;
    }
}

Make sure you remember to add xsp as a player command under the right level in client.command.CommandsExecutor.java.
aeronex - Minor add-on: HeavenMS player command to increase spawn - RaGEZONE Forums


It's a small thing but it would make me as a player quite happy. Hope someone finds this useful. Thanks for reading!
 
Last edited:
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
some cc for your next release:
VluMXe7 - Minor add-on: HeavenMS player command to increase spawn - RaGEZONE Forums


but nice release regardless
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
Cool! works pretty fine! Good job back there, i hope it doesnt works on bosses like Targa/Scar, ToT bosses, Anego etc. In that case would be a easy fix however i liked it too much. Thank you keep the good work!
 
Newbie Spellweaver
Joined
May 31, 2008
Messages
28
Reaction score
5
Thanks Lichtmager, I actually haven't blocked out all the bosses yet, only the main ones under this array:

int[] bossIDs = new int[] {
8810010, 8810011, 8810012, 8810013, 8810014, 8810015, 8810016, 8810017, 8810018, //dead horntail
8810000, 8810001, 8810002, 8810003, 8810004, 8810005, 8810006, 8810007, 8810008, 8810009, //horntail
8800000, 8800001, 8800002, 8800003, 8800004, 8800005, 8800006, 8800007, 8800008, 8800009, 8800010, //zakum
8820000, 8820001, 8820002, 8820003, 8820004, 8820005, 8820006, 8820015, 8820016, 8820017, 8820018 //pink bean
};
 
Joined
Apr 13, 2009
Messages
592
Reaction score
141
Thanks Lichtmager, I actually haven't blocked out all the bosses yet, only the main ones under this array:

int[] bossIDs = new int[] {
8810010, 8810011, 8810012, 8810013, 8810014, 8810015, 8810016, 8810017, 8810018, //dead horntail
8810000, 8810001, 8810002, 8810003, 8810004, 8810005, 8810006, 8810007, 8810008, 8810009, //horntail
8800000, 8800001, 8800002, 8800003, 8800004, 8800005, 8800006, 8800007, 8800008, 8800009, 8800010, //zakum
8820000, 8820001, 8820002, 8820003, 8820004, 8820005, 8820006, 8820015, 8820016, 8820017, 8820018 //pink bean
};

Quick question, but couldn't you just do mob.isBoss instead of using an array?
 
Newbie Spellweaver
Joined
May 31, 2008
Messages
28
Reaction score
5
You're probably right, I'm not familiar with the APIs available in the source XD Thanks for letting me know!
 
Back
Top