Hey Kevin,
I'm trying to implement !warphere, and !warp, but I need to know how to get ChannelInstance, and etc.
Here's the original code from another source (Yes, I leech ;\)
PHP:
} else if (sub[0].equals("warp")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(sub[1]);
if (victim != null) {
if (sub.length == 2) {
MapleMap target = victim.getMap();
player.changeMap(target, target.findClosestSpawnpoint(victim.getPosition()));
} else {
MapleMap target = cserv.getInstance(c.getChannel()).getMapFactory().getMap(Integer.parseInt(sub[2]));
victim.changeMap(target, target.getPortal(0));
}
} else {
try {
victim = player;
WorldLocation loc = cserv.getWorldInterface().getLocation(sub[1]);
if (loc != null) {
player.msg("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, true);
Channel.getInstance(c.getChannel()).removePlayer(player);
c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
try {
c.getSession().write(MaplePacketCreator.getChannelChange(InetAddress.getByName(socket[0]), Integer.parseInt(socket[1])));
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
MapleMap target = cserv.getMapFactory().getMap(Integer.parseInt(sub[1]));
player.changeMap(target, target.getPortal(0));
}
} catch (Exception e) {
}
}
} else if (sub.equals("warphere")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(sub[1]);
MapleMap pmap = player.getMap();
if (victim != null) {
victim.changeMap(pmap, player.getPosition());
} else {
try {
String name = sub[1];
WorldChannelInterface wci = cserv.getWorldInterface();
int channel = wci.find(name);
if (channel > -1) {
Channel pserv = Channel.getInstance(channel);
MapleCharacter world_victim = pserv.getPlayerStorage().getCharacterByName(name);
if (world_victim != null) {
ChangeChannelHandler.changeChannel(c.getChannel(), world_victim.getClient());
world_victim.changeMap(pmap, player.getPosition());
}
} else {
player.msg("Player not online.");
}
} catch (RemoteException e) {
cserv.reconnectWorld();
}
}
Few problems are, that there's no WorldLocation (import net.world.remote.WorldLocation
or a
(import net.world.remote.WorldChannelInterface
Which leads me to not being able to finish the code.
The Channel.getInstance() and ChangeChannelHandler() I need to fix.
Well, if you could pour your insight on this, and maybe help a fellow out, it'd be greatly appreciated.
Although I don't like being spoonfed, do try to 'teach'.
THANKS IN ADVANCE!
EDIT: After reading most of the posts.. I'd like to say..
This Source Code works pretty well for me, I haven't had many problems. Here's some advice though, if you open NetBeans IDE 7.0 with the same dist files the server uses, the server will have issues receiving commands like portals, chat commands, portals, and npc's etc.
Next thing, if anyone gets that stupid Cipher error, close everything related to the server, restart NetBeans, and Clean + Compile.
As for the Job Advancer, you'll need to code your own. As you can see, Cody doesn't work, cause he's part of the WZ.
Uhm, I think that's all I've got to say [: