[Mini Release] People that want !goto command for ThePack
Not sure if your going to get mad Moogra, but yeah...I hear this alot around xP!
Code:
package net.sf.odinms.client.messages;
import java.rmi.RemoteException;
import java.util.*;
import net.sf.odinms.net.MaplePacket;
import net.sf.odinms.net.channel.ChannelServer;
import net.sf.odinms.net.world.remote.*;
import net.sf.odinms.server.*;
import net.sf.odinms.server.life.*;
import net.sf.odinms.server.maps.*;
import net.sf.odinms.tools.*;
import org.slf4j.Logger;
import java.net.*;
import java.io.*;
import net.sf.odinms.client.*;
import net.sf.odinms.net.world.PlayerCoolDownValueHolder;
import net.sf.odinms.server.maps.FakeCharacter;
public class GMCommand {
public static int getOptionalIntArg(String splitted[], int position, int def) {
if (splitted.length > position) {
try {
return Integer.parseInt(splitted[position]);
} catch (NumberFormatException nfe) {
return def;
}
}
return def;
}
public static boolean executeGMCommand(MapleClient c, MessageCallback mc, String line, Logger log, List<Pair<MapleCharacter, String>> gmlog, Runnable persister) {
MapleCharacter player = c.getPlayer();
ChannelServer cserv = c.getChannelServer();
String[] splitted = line.split(" ");
if (splitted[0].equals("!chattype")) {
player.setGMChat(!player.getGMChat());
mc.dropMessage("Done.");
} else if (splitted[0].equals("!god")) {
player.setGodMode(!player.isGodMode());
mc.dropMessage("Done.");
} else if (splitted[0].equals("!warpmap")) {
for (MapleCharacter mch : player.getMap().getCharacters()) {
if (mch != null) {
int mapid = Integer.parseInt(splitted[1]);
MapleMap target = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(mapid);
mch.changeMap(target, target.getPortal(0));
}
}
} else if (splitted[0].equals("!goto")) {
HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();
gotomaps.put("gmmap", 180000000);
gotomaps.put("southperry", 60000);
gotomaps.put("amherst", 1010000);
gotomaps.put("henesys", 100000000);
gotomaps.put("ellinia", 101000000);
gotomaps.put("perion", 102000000);
gotomaps.put("kerning", 103000000);
gotomaps.put("lith", 104000000);
gotomaps.put("sleepywood", 105040300);
gotomaps.put("florina", 110000000);
gotomaps.put("orbis", 200000000);
gotomaps.put("happy", 209000000);
gotomaps.put("elnath", 211000000);
gotomaps.put("ludi", 220000000);
gotomaps.put("aqua", 230000000);
gotomaps.put("leafre", 240000000);
gotomaps.put("mulung", 250000000);
gotomaps.put("herb", 251000000);
gotomaps.put("omega", 221000000);
gotomaps.put("korean", 222000000);
gotomaps.put("nlc", 600000000);
gotomaps.put("excavation", 990000000);
gotomaps.put("pianus", 230040420);
gotomaps.put("horntail", 240060200);
gotomaps.put("mushmom", 100000005);
gotomaps.put("griffey", 240020101);
gotomaps.put("manon", 240020401);
gotomaps.put("horseman", 682000001);
gotomaps.put("balrog", 105090900);
gotomaps.put("zakum", 280030000);
gotomaps.put("papu", 220080001);
gotomaps.put("showa", 801000000);
gotomaps.put("guild", 200000301);
gotomaps.put("shrine", 800000000);
gotomaps.put("skelegon", 240040511);
if (gotomaps.containsKey(splitted[1])) {
MapleMap target = cserv.getMapFactory().getMap(gotomaps.get(splitted[1]));
MaplePortal targetPortal = target.getPortal(0);
player.changeMap(target, targetPortal);
}
} else if (splitted[0].equals("!lock")) {
int slot = Integer.parseInt(splitted[1]);
boolean lock = splitted[2].equalsIgnoreCase("true");
c.getPlayer().lockitem(slot, lock);
} else if (splitted[0].equals("!event")) {
if (c.getPlayer().getClient().getChannelServer().eventOn == false) {
int mapid = getOptionalIntArg(splitted, 1, c.getPlayer().getMapId());
c.getPlayer().getClient().getChannelServer().eventOn = true;
c.getPlayer().getClient().getChannelServer().eventMap = mapid;
try {
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, c.getChannel(), "[Event] The event has started in Channel " + c.getChannel() + " in " + c.getPlayer().getMap() + "!").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
} else {
c.getPlayer().getClient().getChannelServer().eventOn = false;
try {
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, c.getChannel(), "[Event] The event has ended. Thanks to all of those who participated.").getBytes());
} catch (RemoteException e) {
c.getChannelServer().reconnectWorld();
}
}
} else if (splitted[0].equals("!fakechar")) {
for (int i = 0; i < getOptionalIntArg(splitted, 1, 1); i++) {
FakeCharacter fc = new FakeCharacter(player, player.getId() + player.getFakeChars().size() + 1);
player.addFakeChar(fc);
}
mc.dropMessage("Please move around for it to take effect.");
} else if (splitted[0].equals("!resetcooldowns")) {
for (PlayerCoolDownValueHolder i : player.getAllCooldowns()) {
player.removeCooldown(i.skillId);
}
mc.dropMessage("Success.");
} else if (splitted[0].equals("!drop") || splitted[0].equals("!droprandomstatitem") || splitted[0].equals("!item")) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
int itemId = Integer.parseInt(splitted[1]);
short quantity = (short) getOptionalIntArg(splitted, 2, 1);
IItem toDrop;
if (splitted[0].equals("!drop")) {
if (ii.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
toDrop = ii.getEquipById(itemId);
} else {
toDrop = new Item(itemId, (byte) 0, quantity);
}
toDrop.setOwner(player.getName());
player.getMap().spawnItemDrop(player, player, toDrop, player.getPosition(), true, true);
} else if (splitted[0].equals("!item")) {
if (itemId >= 5000000 && itemId <= 5000045) {
MaplePet.createPet(itemId);
return true; //just in case
}
MapleInventoryManipulator.addById(c, itemId, quantity, "", player.getName());
} else {
if (!MapleItemInformationProvider.getInstance().getInventoryType(itemId).equals(MapleInventoryType.EQUIP)) {
mc.dropMessage("Command can only be used for equips.");
} else {
toDrop = MapleItemInformationProvider.getInstance().randomizeStats((Equip) MapleItemInformationProvider.getInstance().getEquipById(itemId));
player.getMap().spawnItemDrop(player, player, toDrop, player.getPosition(), true, true);
}
}
} else if (splitted[0].equals("!jail")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
int mapid = 200090300;
if (splitted.length > 2 && splitted[1].equals("2")) {
mapid = 980000404;
victim = cserv.getPlayerStorage().getCharacterByName(splitted[2]);
}
if (victim != null) {
MapleMap target = cserv.getMapFactory().getMap(mapid);
victim.changeMap(target, target.getPortal(0));
mc.dropMessage(victim.getName() + " was jailed!");
} else {
mc.dropMessage(splitted[1] + " not found!");
}
} else if (splitted[0].equals("!unjail")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
MapleMap target = cserv.getMapFactory().getMap(100000000);
victim.changeMap(target, target.getPortal(0));
mc.dropMessage(victim.getName() + " was un-jailed!");
} else if (splitted[0].equals("!maxall")) {
player.setStr(32767);
player.setDex(32767);
player.setInt(32767);
player.setLuk(32767);
player.setLevel(255);
player.setFame(13337);
player.setMaxHp(30000);
player.setMaxMp(30000);
player.updateSingleStat(MapleStat.STR, 32767);
player.updateSingleStat(MapleStat.DEX, 32767);
player.updateSingleStat(MapleStat.INT, 32767);
player.updateSingleStat(MapleStat.LUK, 32767);
player.updateSingleStat(MapleStat.LEVEL, 255);
player.updateSingleStat(MapleStat.FAME, 13337);
player.updateSingleStat(MapleStat.MAXHP, 30000);
player.updateSingleStat(MapleStat.MAXMP, 30000);
} else if (splitted[0].equals("!mesos")) {
player.gainMeso(Integer.parseInt(splitted[1]), true);
} else if (splitted[0].equals("!job")) {
player.changeJob(MapleJob.getById(Integer.parseInt(splitted[1])));
} else if (splitted[0].equals("!allocate")) {
int up = Integer.parseInt(splitted[2]);
if (splitted[1].equals("str")) {
player.setStr(player.getStr() + up);
player.updateSingleStat(MapleStat.STR, player.getStr());
} else if (splitted[1].equals("dex")) {
player.setDex(player.getDex() + up);
player.updateSingleStat(MapleStat.DEX, player.getDex());
} else if (splitted[1].equals("int")) {
player.setInt(player.getInt() + up);
player.updateSingleStat(MapleStat.INT, player.getInt());
} else if (splitted[1].equals("luk")) {
player.setLuk(player.getLuk() + up);
player.updateSingleStat(MapleStat.LUK, player.getLuk());
} else if (splitted[1].equals("hp")) {
player.setMaxHp(player.getMaxHp() + up);
player.updateSingleStat(MapleStat.MAXHP, player.getMaxHp());
} else if (splitted[1].equals("mp")) {
player.setMaxMp(player.getMaxMp() + up);
player.updateSingleStat(MapleStat.MAXMP, player.getMaxMp());
} else {
mc.dropMessage(splitted[1] + " is not a valid stat.");
}
} else if (splitted[0].equals("!healmap")) {
for (MapleCharacter mch : player.getMap().getCharacters()) {
if (mch != null) {
mch.setHp(mch.getMaxHp());
mch.updateSingleStat(MapleStat.HP, mch.getMaxHp());
mch.setMp(mch.getMaxMp());
mch.updateSingleStat(MapleStat.MP, mch.getMaxMp());
}
}
} else if (splitted[0].equals("!song")) {
player.getMap().broadcastMessage(MaplePacketCreator.musicChange(splitted[1]));
} else if (splitted[0].equals("!cancelbuffs")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim != null) {
victim.cancelAllBuffs();
}
} else if (splitted[0].equals("!pos")) {
mc.dropMessage("Your Pos: x = " + player.getPosition().x + ", y = " + player.getPosition().y + ", fh = " + player.getMap().getFootholds().findBelow(player.getPosition()).getId());
} else if (splitted[0].equals("!coke")) {
int[] ids = {9500144, 9500151, 9500152, 9500153, 9500154, 9500143, 9500145, 9500149, 9500147};
for (int a : ids) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
}
} else if (splitted[0].equals("!pap")) {
MapleMonster mob0 = MapleLifeFactory.getMonster(8500001);
player.getMap().spawnMonsterOnGroudBelow(mob0, player.getPosition());
} else if (splitted[0].equals("!ergoth")) {
MapleMonster mob0 = MapleLifeFactory.getMonster(9300028);
player.getMap().spawnMonsterOnGroudBelow(mob0, player.getPosition());
} else if (splitted[0].equals("!ludimini")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8160000), player.getPosition());
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8170000), c.getPlayer().getPosition());
} else if (splitted[0].equals("!cornian")) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8150201), c.getPlayer().getPosition());
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8150200), c.getPlayer().getPosition());
} else if (splitted[0].equals("!balrog")) {
int[] ids = {8130100, 8150000, 9400536};
for (int a : ids) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), c.getPlayer().getPosition());
}
} else if (splitted[0].equals("!mushmom")) {
int[] ids = {6130101, 6300005, 9400205};
for (int a : ids) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), c.getPlayer().getPosition());
}
} else if (splitted[0].equals("!dragon")) {
int[] ids = {8150300, 8150301, 8150302};
for (int a : ids) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), c.getPlayer().getPosition());
}
} else if (splitted[0].equals("!pirate")) {
int[] ids = {9300119, 9300107, 9300105, 9300106};
for (int a : ids) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), c.getPlayer().getPosition());
}
} else if (splitted[0].equals("!clone")) {
int[] ids = {9001002, 9001000, 9001003, 9001001};
for (int a : ids) {
c.getPlayer().getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), c.getPlayer().getPosition());
}
} else if (splitted[0].equals("!levelup")) {
c.getPlayer().levelUp();
int newexp = c.getPlayer().getExp();
if (newexp < 0) {
c.getPlayer().gainExp(-newexp, false, false);
}
if (ExpTable.getExpNeededForLevel(c.getPlayer().getLevel() + 1) < newexp) {
c.getPlayer().setExp(0);
c.getPlayer().updateSingleStat(MapleStat.EXP, 0);
}
} else if (splitted[0].equals("!fame")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
int fame = Integer.parseInt(splitted[2]);
victim.setFame(fame);
player.updateSingleStat(MapleStat.FAME, fame);
} else if (splitted[0].equals("!killmap")) {
for (MapleCharacter mch : c.getPlayer().getMap().getCharacters()) {
if (mch != null) {
mch.setHp(0);
mch.updateSingleStat(MapleStat.HP, 0);
}
}
} else if (splitted[0].equals("!killeveryone")) {
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch != null) {
mch.setHp(0);
mch.updateSingleStat(MapleStat.HP, 0);
}
}
} else if (splitted[0].equals("!giftnx")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
int points = Integer.parseInt(splitted[2]);
for (int i = 1; i < 4; i++) {
victim.modifyCSPoints(i, points);
}
mc.dropMessage("Done");
} else if (splitted[0].equals("!giveItemBuff")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
String enterItemId = splitted[2];
int itemId = Integer.parseInt(enterItemId);
victim.setItemEffect(itemId);
} else if (splitted[0].equals("!str") || splitted[0].equals("!dex") || splitted[0].equals("!int") || splitted[0].equals("!luk")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
int up = Integer.parseInt(splitted[2]);
if (splitted[0].equals("!str")) {
victim.setStr(up);
victim.updateSingleStat(MapleStat.STR, victim.getStr());
} else if (splitted[0].equals("!dex")) {
victim.setDex(up);
victim.updateSingleStat(MapleStat.DEX, victim.getDex());
} else if (splitted[0].equals("!luk")) {
victim.setLuk(up);
victim.updateSingleStat(MapleStat.LUK, victim.getLuk());
} else {
victim.setInt(up);
victim.updateSingleStat(MapleStat.INT, victim.getInt());
}
} else if (splitted[0].equals("!lolhaha")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
mc.dropMessage("You have switched the gender of " + victim + ".");
victim.setGender(1 - victim.getGender());
} else if (splitted[0].equals("!anego")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400121), player.getPosition());
} else if (splitted[0].equals("!theboss")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400300), player.getPosition());
} else if (splitted[0].equals("!snackbar")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9500179), player.getPosition());
} else if (splitted[0].equals("!papapixie")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300039), player.getPosition());
} else if (splitted[0].equals("!horseman")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400549), player.getPosition());
} else if (splitted[0].equals("!nx")) {
for (int x = 0; x < 10; x++) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400202), player.getPosition());
}
} else if (splitted[0].equals("!loki")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400567), player.getPosition());
} else if (splitted[0].equals("!blackcrow")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400014), player.getPosition());
} else if (splitted[0].equals("!leafreboss")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8180000), player.getPosition());
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8180001), player.getPosition());
} else if (splitted[0].equals("!shark")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8150101), player.getPosition());
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8150100), player.getPosition());
} else if (splitted[0].equals("!franken")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300139), player.getPosition());
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300140), player.getPosition());
} else if (splitted[0].equals("!bird")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300090), player.getPosition());
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300089), player.getPosition());
} else if (splitted[0].equals("!pianus")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
} else if (splitted[0].equals("!rock")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9300091), player.getPosition());
} else if (splitted[0].equals("!centipede")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9500177), player.getPosition());
} else if (splitted[0].equals("!slap")) {
int loss = Integer.parseInt(splitted[2]);
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setHp(victim.getHp() - loss);
victim.updateSingleStat(MapleStat.HP, victim.getHp() - loss);
mc.dropMessage("You slapped " + victim.getName() + ".");
} else if (splitted[0].equals("!exprate")) {
int exp = Integer.parseInt(splitted[1]);
cserv.setExpRate(exp);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Exp Rate has been changed to " + exp + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!petexprate")) {
int exp = Integer.parseInt(splitted[1]);
cserv.setPetExpRate(exp);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Pet Exp Rate has been changed to " + exp + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!mountexprate")) {
int exp = Integer.parseInt(splitted[1]);
cserv.setMountRate(exp);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Mount Exp Rate has been changed to " + exp + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!mesorate")) {
int meso = Integer.parseInt(splitted[1]);
cserv.setMesoRate(meso);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Meso Rate has been changed to " + meso + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!droprate")) {
int drop = Integer.parseInt(splitted[1]);
cserv.setDropRate(drop);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Drop Rate has been changed to " + drop + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!bossdroprate")) {
int bossdrop = Integer.parseInt(splitted[1]);
cserv.setBossDropRate(bossdrop);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Boss Drop Rate has been changed to " + bossdrop + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!shopmesorate")) {
int rate = Integer.parseInt(splitted[1]);
cserv.setShopMesoRate(rate);
MaplePacket packet = MaplePacketCreator.serverNotice(6, "Shop Meso Rate has been changed to " + rate + "x.");
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (splitted[0].equals("!warpallhere")) {
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch.getMapId() != player.getMapId()) {
mch.changeMap(player.getMap(), player.getPosition());
}
}
} else if (splitted[0].equals("!hurt")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setHp(1);
victim.updateSingleStat(MapleStat.HP, 1);
} else if (splitted[0].equals("!bob")) {
MapleMonster mob0 = MapleLifeFactory.getMonster(9400551);
player.getMap().spawnMonsterOnGroudBelow(mob0, player.getPosition());
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(0, "Bob the snail is back!"));
} else if (splitted[0].equals("!healperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setHp(victim.getMaxHp());
victim.updateSingleStat(MapleStat.HP, victim.getMaxHp());
victim.setMp(victim.getMaxMp());
victim.updateSingleStat(MapleStat.MP, victim.getMaxMp());
} else if (splitted[0].equals("!lolcastle")) {
MapleMap target = cserv.getEventSM().getEventManager("lolcastle").getInstance("lolcastle" + splitted[1]).getMapFactory().getMap(990000300, false, false);
player.changeMap(target, target.getPortal(0));
} else if (splitted[0].equals("!spawn")) {
for (int i = 0; i < Math.min(getOptionalIntArg(splitted, 2, 1), 500); i++) {
MapleMonster mob = MapleLifeFactory.getMonster(Integer.parseInt(splitted[1]));
player.getMap().spawnMonsterOnGroudBelow(mob, player.getPosition());
}
} else if (splitted[0].equals("!saveall")) {
for (ChannelServer chan : ChannelServer.getAllInstances()) {
for (MapleCharacter chr : chan.getPlayerStorage().getAllCharacters()) {
chr.saveToDB(true);
}
}
mc.dropMessage("save complete");
} else if (splitted[0].equals("!job")) {
player.changeJob(MapleJob.getById(Integer.parseInt(splitted[1])));
} else if (splitted[0].equals("!clock")) {
player.getMap().broadcastMessage(MaplePacketCreator.getClock(getOptionalIntArg(splitted, 1, 60)));
} else if (splitted[0].equals("!cleardrops")) {
MapleMap map = player.getMap();
double range = Double.POSITIVE_INFINITY;
List<MapleMapObject> items = map.getMapObjectsInRange(player.getPosition(), range, Arrays.asList(MapleMapObjectType.ITEM));
for (MapleMapObject itemmo : items) {
map.removeMapObject(itemmo);
map.broadcastMessage(MaplePacketCreator.removeItemFromMap(itemmo.getObjectId(), 0, player.getId()));
}
mc.dropMessage("You have destroyed " + items.size() + " items on the ground.");
} else if (splitted[0].equals("!levelperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setLevel(getOptionalIntArg(splitted, 2, 2) - 1);
victim.levelUp();
victim.setExp(0);
victim.updateSingleStat(MapleStat.EXP, 0);
} else if (splitted[0].equalsIgnoreCase("!showMonsterID")) {
MapleMap map = player.getMap();
double range = Double.POSITIVE_INFINITY;
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), range, Arrays.asList(MapleMapObjectType.MONSTER));
for (MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
String alive = "false";
if (monster.isAlive()) {
alive = "true";
}
mc.dropMessage("name=" + monster.getName() + " ID=" + monster.getId() + " isAlive=" + alive);
}
} else if (splitted[0].equals("!openshop")) {
int shopid = Integer.parseInt(splitted[1]);
MapleShopFactory sfact = MapleShopFactory.getInstance();
MapleShop shop = sfact.getShop(shopid);
shop.sendShop(c);
} else if (splitted[0].equals("!level")) {
player.setExp(0);
player.setLevel(getOptionalIntArg(splitted, 1, 1) - 1);
player.levelUp();
player.setExp(0);
player.updateSingleStat(MapleStat.EXP, 0);
} else if (splitted[0].equals("!reborn")) {
player.setReborns(getOptionalIntArg(splitted, 1, 1));
} else if (splitted[0].equals("!rebornperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setReborns(getOptionalIntArg(splitted, 2, 2));
mc.dropMessage("Done.");
} else if (splitted[0].equals("!mesoperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.gainMeso(Integer.parseInt(splitted[2]), true);
} else if (splitted[0].equals("!id") || splitted[0].equals("!search")) {
try {
URL url;
URLConnection urlConn;
BufferedReader dis;
url = new URL("http://www.mapletip.com/search_java.php?search_value=" + splitted[1] + "&check=true");
urlConn = url.openConnection();
urlConn.setDoInput(true);
urlConn.setUseCaches(false);
dis = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String s;
while ((s = dis.readLine()) != null) {
mc.dropMessage(s);
}
dis.close();
} catch (MalformedURLException mue) {
} catch (IOException ioe) {
}
} else if (splitted[0].equals("!warp")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim != null) {
if (splitted.length == 2) {
MapleMap target = victim.getMap();
player.changeMap(target, target.findClosestSpawnpoint(victim.getPosition()));
} else {
int mapid = Integer.parseInt(splitted[2]);
MapleMap target = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(mapid);
victim.changeMap(target, target.getPortal(0));
}
} else {
try {
victim = player;
WorldLocation loc = cserv.getWorldInterface().getLocation(splitted[1]);
if (loc != null) {
mc.dropMessage("You will be cross-channel warped. This may take a few seconds.");
MapleMap target = cserv.getMapFactory().getMap(loc.map);
victim.cancelAllBuffs();
String ip = cserv.getIP(loc.channel);
victim.getMap().removePlayer(victim);
victim.setMap(target);
String[] socket = ip.split(":");
if (victim.getTrade() != null) {
MapleTrade.cancelTrade(player);
}
victim.saveToDB(true);
if (victim.getCheatTracker() != null) {
victim.getCheatTracker().dispose();
}
ChannelServer.getInstance(c.getChannel()).removePlayer(player);
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
try {
MaplePacket packet = MaplePacketCreator.getChannelChange(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1]));
c.getSession().write(packet);
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
int map = Integer.parseInt(splitted[1]);
MapleMap target = cserv.getMapFactory().getMap(map);
player.changeMap(target, target.getPortal(0));
}
} catch (Exception e) {
}
}
} else if (splitted[0].equals("!exp")) {
int exp = Integer.parseInt(splitted[1]);
player.setExp(exp);
player.updateSingleStat(MapleStat.EXP, exp);
} else if (splitted[0].equals("!warphere")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.changeMap(player.getMap(), player.getMap().findClosestSpawnpoint(player.getPosition()));
} else if (splitted[0].equals("!servermessage")) {
Collection<ChannelServer> css = ChannelServer.getAllInstances();
for (int i = 1; i <= css.size(); ++i) {
ChannelServer.getInstance(i).setServerMessage(
StringUtil.joinStringFrom(splitted, 1));
}
} else if (splitted[0].equals("!notice") || (splitted[0].equals("!say"))) {
String type;
if (splitted[0].equals("!notice")) {
type = "[Notice] ";
} else {
type = "[" + player.getName() + "] ";
}
MaplePacket packet = MaplePacketCreator.serverNotice(6, type + StringUtil.joinStringFrom(splitted, 1));
try {
ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(player.getName(), packet.getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
} else if (splitted[0].equals("!gmsonline")) {
String list = "";
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch.gmLevel() > 2) {
list += mch.getName() + " ";
}
}
mc.dropMessage(list);
} else if (splitted[0].equals("!nearestPortal")) {
final MaplePortal portal = player.getMap().findClosestSpawnpoint(player.getPosition());
mc.dropMessage(portal.getName() + " id: " + portal.getId() + " script: " + portal.getScriptName() + "name: " + portal.getName());
} else if (splitted[0].equals("!sp")) {
player.setRemainingSp(getOptionalIntArg(splitted, 1, 1));
player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
} else if (splitted[0].equals("!ap")) {
player.setRemainingAp(getOptionalIntArg(splitted, 1, 1));
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else if (splitted[0].equals("!fakerelog")) {
c.getSession().write(MaplePacketCreator.getCharInfo(player));
player.getMap().removePlayer(player);
player.getMap().addPlayer(player);
} else if (splitted[0].equals("!charinfo")) {
StringBuilder builder = new StringBuilder();
MapleCharacter other = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
builder.append(MapleClient.getLogMessage(other, ""));
builder.append(" at ");
builder.append(other.getPosition().x);
builder.append("/");
builder.append(other.getPosition().y);
builder.append("/");
builder.append(other.getMap().getFootholds().findBelow(other.getPosition()).getId());
builder.append(" ");
builder.append(other.getHp());
builder.append("/");
builder.append(other.getCurrentMaxHp());
builder.append("hp ");
builder.append(other.getMp());
builder.append("/");
builder.append(other.getCurrentMaxMp());
builder.append("mp ");
builder.append(other.getExp());
builder.append("exp");
builder.append(" remoteAddress: ");
builder.append(other.getClient().getSession().getRemoteAddress());
mc.dropMessage(builder.toString());
other.getClient().dropDebugMessage(mc);
} else if (splitted[0].equals("!ban")) {
if (splitted.length < 3) {
new ServernoticeMapleClientMessageCallback(2, c).dropMessage("Syntax: !ban charname reason");
return true;
} else {
try {
String originalReason = StringUtil.joinStringFrom(splitted, 2);
String reason = player.getName() + " banned " + splitted[1] + ": " + originalReason;
MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (target != null) {
if (target.gmLevel() < 3 || player.gmLevel() > 4) {
String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
reason += " (IP: " + ip + ")";
target.ban(reason);
mc.dropMessage("Banned " + readableTargetName + " ipban for " + ip + " reason: " + originalReason);
MaplePacket packet = MaplePacketCreator.serverNotice(0, readableTargetName + " has been banned for " + originalReason + ".");
try {
ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(
player.getName(), packet.getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
} else {
mc.dropMessage("May not ban GMs.");
}
} else {
if (MapleCharacter.ban(splitted[1], reason, false)) {
mc.dropMessage("Offline Banned " + splitted[1]);
} else {
mc.dropMessage("Failed to ban " + splitted[1]);
}
}
} catch (NullPointerException e) {
mc.dropMessage("There was a problem banning " + splitted[1] + ".");
}
}
} else if (splitted[0].equals("!whereami")) {
new ServernoticeMapleClientMessageCallback(c).dropMessage("You are on map " +
player.getMap().getId());
} else if (splitted[0].equals("!connected")) {
try {
Map<Integer, Integer> connected = cserv.getWorldInterface().getConnected();
StringBuilder conStr = new StringBuilder("Connected Clients: ");
boolean first = true;
for (int i : connected.keySet()) {
if (!first) {
conStr.append(", ");
} else {
first = false;
}
if (i == 0) {
conStr.append("Total: ");
conStr.append(connected.get(i));
} else {
conStr.append("Ch");
conStr.append(i);
conStr.append(": ");
conStr.append(connected.get(i));
}
}
new ServernoticeMapleClientMessageCallback(c).dropMessage(conStr.toString());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
} else if (splitted[0].equals("!whosthere")) {
MessageCallback callback = new ServernoticeMapleClientMessageCallback(c);
StringBuilder builder = new StringBuilder("Players on Map: ");
for (MapleCharacter chr : player.getMap().getCharacters()) {
if (builder.length() > 150) {
builder.setLength(builder.length() - 2);
callback.dropMessage(builder.toString());
builder = new StringBuilder();
}
builder.append(MapleCharacterUtil.makeMapleReadable(chr.getName()));
builder.append(", ");
}
builder.setLength(builder.length() - 2);
c.getSession().write(MaplePacketCreator.serverNotice(6, builder.toString()));
} else if (splitted[0].equals("!killall") || splitted[0].equals("!monsterdebug")) {
MapleMap map = player.getMap();
double range = Double.POSITIVE_INFINITY;
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), range, Arrays.asList(MapleMapObjectType.MONSTER));
boolean kill = splitted[0].equals("!killall");
for (MapleMapObject monstermo : monsters) {
MapleMonster monster = (MapleMonster) monstermo;
if (kill) {
map.killMonster(monster, player, true);
monster.giveExpToCharacter(player, monster.getExp(), true, 1);
} else {
mc.dropMessage("Monster " + monster.toString());
}
}
if (kill) {
mc.dropMessage("Killed " + monsters.size() + " monsters.");
}
} else if (splitted[0].equals("!droprandomstatitem")) {
int id = Integer.parseInt(splitted[1]);
IItem toDrop;
if (!MapleItemInformationProvider.getInstance().getInventoryType(id).equals(MapleInventoryType.EQUIP)) {
mc.dropMessage("Command can only be used for equips.");
} else if (splitted.length != 2) {
mc.dropMessage("Check your parameters.");
} else {
toDrop = MapleItemInformationProvider.getInstance().randomizeStats((Equip) MapleItemInformationProvider.getInstance().getEquipById(id));
player.getMap().spawnItemDrop(player, player, toDrop, player.getPosition(), true, true);
}
} else if (splitted[0].equals("!setall")) {
int x = Integer.parseInt(splitted[1]);
player.setStr(x);
player.setDex(x);
player.setInt(x);
player.setLuk(x);
player.updateSingleStat(MapleStat.STR, player.getStr());
player.updateSingleStat(MapleStat.DEX, player.getStr());
player.updateSingleStat(MapleStat.INT, player.getStr());
player.updateSingleStat(MapleStat.LUK, player.getStr());
} else if (splitted[0].equals("!skill")) {
int skill = Integer.parseInt(splitted[1]);
int level = getOptionalIntArg(splitted, 2, 1);
int masterlevel = getOptionalIntArg(splitted, 3, 1);
player.changeSkillLevel(SkillFactory.getSkill(skill), level, masterlevel);
} else if (splitted[0].equals("!heal")) {
player.setHp(player.getMaxHp());
player.updateSingleStat(MapleStat.HP, player.getMaxHp());
player.setMp(player.getMaxMp());
player.updateSingleStat(MapleStat.MP, player.getMaxMp());
} else if (splitted[0].equals("!karma")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[2]);
if (splitted[1].equals("up")) {
if (victim.getKarma() < 25 || player.getGMLevel() > 3) {
victim.upKarma();
mc.dropMessage("You have raised " + victim + "'s karma. It is currently at " + victim.getKarma() + ".");
victim.getClient().getSession().write(MaplePacketCreator.serverNotice(6, "Your karma has been raised to " + victim.getKarma() + "."));
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch.gmLevel() > 2) {
mch.getClient().getSession().write(MaplePacketCreator.serverNotice(6, victim + "'s karma has been raised to " + victim.getKarma() + " by " + player + "."));
}
}
} else {
mc.dropMessage("You cannot raise victim's GM level more than 25 due to insufficient privelidges.");
}
} else if (splitted[1].equals("down")) {
if (victim.getKarma() > -25 || player.getGMLevel() > 3) {
victim.downKarma();
mc.dropMessage("You have dropped " + victim + "'s karma. It is currently at " + victim.getKarma() + ".");
victim.getClient().getSession().write(MaplePacketCreator.serverNotice(6, "Your karma has been dropped to " + victim.getKarma() + "."));
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch.gmLevel() >= 3) {
mch.getClient().getSession().write(MaplePacketCreator.serverNotice(6, victim + "'s karma has been raised to " + victim.getKarma() + " by " + player + "."));
}
}
} else {
mc.dropMessage("You cannot drop victim's GM level less than -25 due to insufficient privelidges.");
}
} else {
mc.dropMessage("Syntax: !karma [up/down] [victim]");
}
} else if (splitted[0].equals("!curse")) {
String debuffText = splitted[1];
MapleDisease debuff = MapleDisease.DARKNESS;
if (debuffText.equalsIgnoreCase("darkness")) {
debuff = MapleDisease.DARKNESS;
} else if (debuffText.equalsIgnoreCase("null")) {
debuff = MapleDisease.NULL;
} else if (debuffText.equalsIgnoreCase("poison")) {
debuff = MapleDisease.POISON;
} else if (debuffText.equalsIgnoreCase("seal")) {
debuff = MapleDisease.SEAL;
} else if (debuffText.equalsIgnoreCase("seduce")) {
debuff = MapleDisease.SEDUCE;
} else if (debuffText.equalsIgnoreCase("slow")) {
debuff = MapleDisease.SLOW;
} else if (debuffText.equalsIgnoreCase("stun")) {
debuff = MapleDisease.STUN;
} else if (debuffText.equalsIgnoreCase("weaken")) {
debuff = MapleDisease.WEAKEN;
}
player.giveDebuff(debuff, null);
} else if (splitted[0].equals("!jobperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.changeJob(MapleJob.getById(Integer.parseInt(splitted[2])));
} else if (splitted[0].equals("!dc")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.getClient().getSession().close();
victim.getClient().disconnect();
try {
victim.saveToDB(true);
cserv.removePlayer(victim);
} catch (Exception e) {
}
} else if (splitted[0].equals("!kill")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setHp(0);
victim.updateSingleStat(MapleStat.HP, 0);
} else {
if (player.gmLevel() == 3) {
mc.dropMessage("GM Command " + splitted[0] + " does not exist");
}
return false;
}
return true;
}
}
Replace this with your other GMcommand
Re: [Mini Release] People that want !goto command for ThePack
Re: [Mini Release] People that want !goto command for ThePack
I'm guessing it has, all The Pack's commands and you added the goto commands?
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
kojowolf510
I'm guessing it has, all The Pack's commands and you added the goto commands?
Yes, all the command from thepack are in here.
Re: [Mini Release] People that want !goto command for ThePack
So it's 100% like the other command file and all you did was add the !goto command?
ThePack has this thing where only a certain GM can use a certain command ( which sucks a bit )
So If I put this in who would be able to use this command?
And where is it?
thanks alot
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
kojowolf510
I'm guessing it has, all The Pack's commands and you added the goto commands?
yes, im pretty sure >o<
nice release anyway, helpful for those who cant do this stuff
Re: [Mini Release] People that want !goto command for ThePack
Ewww easier to just add this JS script....
Code:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.client.messages);
importPackage(net.sf.odinms.net.channel);
function getDefinition () {
var ret = java.lang.reflect.Array.newInstance(CommandDefinition, 1);
ret[0] = new CommandDefinition("goto", "<mapname>", "", "100");
return ret;
}
function execute (c, mc, splitted) {
var gotomapid = new Array(
180000000, //GmMap
60000, //Southperry
1010000, //Amherst
100000000, //henesys
101000000, //ellinia
102000000, //perion
103000000, //kerning
104000000, //lith
105040300, //sleepywood
110000000, //florina
200000000, //orbis
209000000, //happy
211000000, //elnath
220000000, //ludi
230000000, //aqua
240000000, //leafre
250000000, //mulung
251000000, //herb
221000000, //omega
222000000, //korean (Folk Town)
600000000, //nlc (New Leaf City)
990000000, //excavation (Sharenian/Excavation Site)
230040420, //Pianus cave
240060200, //Horned Tail's cave
100000005, //Mushmom
240020101, //Griffey
240020401, //Manon
682000001, //Headless Horseman
105090900, //Jr.Balrog
280030000, //Zakum's Altar
220080001, //Papulatus map
801000000, //showa Town
200000301, //Guild HeadQuarters
800000000, //Shrine (Mushroom Shrine)
910000000, //Free Market Entrance
240040511, //Skelegon map (Leafre)
260000100 //ariant
);
var gotomapname = new Array(
"gmmap",
"southperry",
"amherst",
"henesys",
"ellinia",
"perion",
"kerning",
"lith",
"sleepywood",
"florina",
"orbis",
"happy",
"elnath",
"ludi",
"aqua",
"leafre",
"mulung",
"herb",
"omega",
"korean",
"nlc",
"excavation",
"pianus",
"horntail",
"mushmom",
"griffey",
"manon",
"horseman",
"balrog",
"zakum",
"papu",
"showa",
"guild",
"shrine",
"fm",
"skelegon",
"ariant"
);
if (splitted.length < 2) { //If no arguments, list options.
mc.dropMessage("Syntax: !goto <mapname>, where mapname target is one of:");
mc.dropMessage("gmmap, southperry, amherst, henesys, ellinia, perion, kerning, lith, sleepywood, florina,");
mc.dropMessage("orbis, happy, elnath, ludi, aqua, leafre, mulung, herb, omega, korean, nlc, excavation, pianus,");
mc.dropMessage("horntail, mushmom, griffey, manon, horseman, balrog, zakum, papu, showa, guild, shrine, fm,");
mc.dropMessage("skelegon, ariant");
} else {
var cserv = c.getChannelServer();
for (var i = 0; i < gotomapid.length; ++i) {
if (splitted[1].toLowerCase() == gotomapname[i].toLowerCase()) {
var target = cserv.getMapFactory().getMap(gotomapid[i]);
var targetPortal = target.getPortal(0);
c.getPlayer().changeMap(target, targetPortal);
}
}
}
}
A lot more memory efficient..
Re: [Mini Release] People that want !goto command for ThePack
wheere do u put js script? not event folder or like any of those so yea
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
SkillzMS
wheere do u put js script? not event folder or like any of those so yea
you put it in the commands folder.
Re: [Mini Release] People that want !goto command for ThePack
Re: [Mini Release] People that want !goto command for ThePack
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
iamSTEVE
Ewww easier to just add this JS script....
Code:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
importPackage(net.sf.odinms.client);
importPackage(net.sf.odinms.client.messages);
importPackage(net.sf.odinms.net.channel);
function getDefinition () {
var ret = java.lang.reflect.Array.newInstance(CommandDefinition, 1);
ret[0] = new CommandDefinition("goto", "<mapname>", "", "100");
return ret;
}
function execute (c, mc, splitted) {
var gotomapid = new Array(
180000000, //GmMap
60000, //Southperry
1010000, //Amherst
100000000, //henesys
101000000, //ellinia
102000000, //perion
103000000, //kerning
104000000, //lith
105040300, //sleepywood
110000000, //florina
200000000, //orbis
209000000, //happy
211000000, //elnath
220000000, //ludi
230000000, //aqua
240000000, //leafre
250000000, //mulung
251000000, //herb
221000000, //omega
222000000, //korean (Folk Town)
600000000, //nlc (New Leaf City)
990000000, //excavation (Sharenian/Excavation Site)
230040420, //Pianus cave
240060200, //Horned Tail's cave
100000005, //Mushmom
240020**** //Griffey
240020401, //Manon
682000001, //Headless Horseman
105090900, //Jr.Balrog
280030000, //Zakum's Altar
220080001, //Papulatus map
801000000, //showa Town
200000301, //Guild HeadQuarters
800000000, //Shrine (Mushroom Shrine)
910000000, //Free Market Entrance
240040511, //Skelegon map (Leafre)
260000100 //ariant
);
var gotomapname = new Array(
"gmmap",
"southperry",
"amherst",
"henesys",
"ellinia",
"perion",
"kerning",
"lith",
"sleepywood",
"florina",
"orbis",
"happy",
"elnath",
"ludi",
"aqua",
"leafre",
"mulung",
"herb",
"omega",
"korean",
"nlc",
"excavation",
"pianus",
"horntail",
"mushmom",
"griffey",
"manon",
"horseman",
"balrog",
"zakum",
"papu",
"showa",
"guild",
"shrine",
"fm",
"skelegon",
"ariant"
);
if (splitted.length < 2) { //If no arguments, list options.
mc.dropMessage("Syntax: !goto <mapname>, where mapname target is one of:");
mc.dropMessage("gmmap, southperry, amherst, henesys, ellinia, perion, kerning, lith, sleepywood, florina,");
mc.dropMessage("orbis, happy, elnath, ludi, aqua, leafre, mulung, herb, omega, korean, nlc, excavation, pianus,");
mc.dropMessage("horntail, mushmom, griffey, manon, horseman, balrog, zakum, papu, showa, guild, shrine, fm,");
mc.dropMessage("skelegon, ariant");
} else {
var cserv = c.getChannelServer();
for (var i = 0; i < gotomapid.length; ++i) {
if (splitted[1].toLowerCase() == gotomapname[i].toLowerCase()) {
var target = cserv.getMapFactory().getMap(gotomapid[i]);
var targetPortal = target.getPortal(0);
c.getPlayer().changeMap(target, targetPortal);
}
}
}
}
A lot more memory efficient..
what do we name it as?
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
lmaoXitsXqtard
what do we name it as?
Sigh....k I'll provide a full guide to adding
1. Make a file called BLAHBLAH.js (Doesnt matter the name)
2. Put it in scripts/commands folder.
3. Use it, no need for restart or anything plus it's more memory efficient :)
Re: [Mini Release] People that want !goto command for ThePack
Quote:
Originally Posted by
iamSTEVE
Sigh....k I'll provide a full guide to adding
1. Make a file called BLAHBLAH.js (Doesnt matter the name)
2. Put it in scripts/commands folder.
3. Use it, no need for restart or anything plus it's more memory efficient :)
YOu nailed/OWned it XD
Re: [Mini Release] People that want !goto command for ThePack
lol nice but i did it manually i had thepack rev 17 and 29 so i merged with that command, talking about waiting other to release it -_-