Added the ability to specify a custom rebirth npc id, which is automatically added to the list of scriptable npcs for overriding. Changed scriptable npcs to use config instead of a constants file, so that users can easily modify them without digging into the code and requiring a rebuild.

This commit is contained in:
James McDowell
2021-05-16 14:46:38 +10:00
parent 45ca7009c8
commit cff3d3df56
5 changed files with 49 additions and 50 deletions

View File

@@ -26,7 +26,6 @@ import client.inventory.*;
import client.keybind.MapleKeyBinding;
import config.YamlConfig;
import constants.game.GameConstants;
import constants.game.ScriptableNPCConstants;
import net.AbstractMaplePacketHandler;
import net.server.PlayerBuffValueHolder;
import net.server.Server;
@@ -409,7 +408,14 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
}
if (YamlConfig.config.server.USE_NPCS_SCRIPTABLE) {
c.announce(MaplePacketCreator.setNPCScriptable(ScriptableNPCConstants.SCRIPTABLE_NPCS));
List<Integer> npcsIds = YamlConfig.config.server.NPCS_SCRIPTABLE;
// Any npc be specified as the rebirth npc. Allow the npc to use custom scripts explicitly.
if (YamlConfig.config.server.USE_REBIRTH_SYSTEM) {
npcsIds.add(YamlConfig.config.server.REBIRTH_NPC_ID);
}
c.announce(MaplePacketCreator.setNPCScriptable(YamlConfig.config.server.NPCS_SCRIPTABLE));
}
if(newcomer) player.setLoginTime(System.currentTimeMillis());