Reloadmap that reloads XML
iirc there were reloadmap commands that could reload the xml. Meaning if I added a NPC in the XML and do !reloadmap <map id> , the NPC will appear instead of needing to restart the server.
Seems like v83 reloadmap doesn't work that way & how can I change it ?
Quote:
else if (sub[0].equals("reloadmap")) { MapleMap oldMap = c.getPlayer().getMap();
MapleMap newMap = c.getChannelServer().getMapFactory().getMap(player.getMapId());
for (MapleCharacter ch : oldMap.getCharacters()) {
ch.changeMap(newMap);
}
oldMap = null;
newMap.respawn();
}
Re: Reloadmap that reloads XML
You would have to reload the data it loads during startup. If I recall correctly, data is stored in the MapleData file, but I'm not sure where it's loaded from
Re: Reloadmap that reloads XML
Alright I'll figure a way. Another thing ( I dont wanna create another thread ) ,
"this.expRate = worldz.getExpRate();" default exp rate is 10x , I want it 11x. When I do this.expRate = 1 + worldz.getExpRate(); , nothing happens. There isnt a change in-game.
Re: Reloadmap that reloads XML
Isn't it easier to just edit the worldz.getExpRate() value?
Re: Reloadmap that reloads XML
I'm just messing around with custom exp cards xD
Re: Reloadmap that reloads XML
i know for a fact that mapleblade sources have !reloadmap in them (without map id) that reloads the map including the xml data, if you remove an npc in xml and do !reloadmap. the npc will be gone.
Re: Reloadmap that reloads XML
Yea I just noticed cause EricMs v83 was based off mapleblade too and the reloadmap function were similar but the source I'm using is based off MoopleDEV and by adding the way mapleblade reloadmap , gives me HEAPS of errors.
Was wondering if anyone has the function working for moopledev .
Re: Reloadmap that reloads XML
Quote:
Originally Posted by
qqwcty
Yea I just noticed cause EricMs v83 was based off mapleblade too and the reloadmap function were similar but the source I'm using is based off MoopleDEV and by adding the way mapleblade reloadmap , gives me HEAPS of errors.
Was wondering if anyone has the function working for moopledev .
This is because I fixed the function to do what your asking (I used it on Development as well). Mine won't just "reload" the map, it will remove the key from the MapleMapFactory so that it's null, and re-iterate that id to get all the modified data from XML. I did this for the same reason when I XML edited back in the day. You need to add the fixed reloadmap command to your commands, and then in MapleMapFactory you'll have to change/add a reloadMap function.
In fact, I recall seeing a release here on RZ a while ago that did this. Not sure if you can find it though..