Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all articles
Browse latest Browse all 27497

Java !reloadmap

$
0
0
Is there a way to make this used for both methods ie:
!reloadmap -reloads the current map
!reloadmap <ID> - reloads the map ID you've requested.

The reason I'm requesting this is because when I spawn an npc that doesn't - it breaks the map.
I'd have to cc in order to finish whatever I am doing on said map...
This would be extremely useful to have.

Obviously I did some digging and couldn't find this anywhere on here...
Maybe because it's simple to implement ??

I'm no vigorous coder so please do fill me in with tips!!


!reloadmap command

Spoiler:
package client.command.commands.gm3;

import client.command.Command;
import client.MapleClient;
import client.MapleCharacter;
import server.maps.MapleMap;

import java.util.Collection;

public class ReloadMapCommand extends Command {
{
setDescription("");
}

@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
MapleMap newMap = c.getChannelServer().getMapFactory().resetMap(player.getMapId());
int callerid = c.getPlayer().getId();

Collection<MapleCharacter> characters = player.getMap().getAllPlayers();

for (MapleCharacter chr : characters) {
chr.saveLocationOnWarp();
chr.changeMap(newMap);
if (chr.getId() != callerid)
chr.dropMessage("You have been relocated due to map reloading. Sorry for the inconvenience.");
}
newMap.respawn();
}
}


- - - Updated - - -

HeavenMS Source btw.
ANY help is much appreciated.

Viewing all articles
Browse latest Browse all 27497

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>