- Joined
- Jul 11, 2008
- Messages
- 322
- Reaction score
- 1
xotic has this missing commands .its quite easy to add though .
add this to ur commands
add this to MapleCharacterUtil.java
fuking flame shield on .
ps : i think i added some xtra function in .
add this to ur commands
Code:
} else if (splitted[0].equals("!notice") || splitted[0].equals("!n")) {
int joinmod = 1;
int range = -1;
if (splitted[1].equals("m")) {
range = 0;
} else if (splitted[1].equals("c")) {
range = 1;
} else if (splitted[1].equals("w")) {
range = 2;
}
int tfrom = 2;
if (range == -1) {
range = 2;
tfrom = 1;
}
int type = MapleCharacterUtil.getNoticeType(splitted[tfrom]);
if (type == -1) {
type = 0;
joinmod = 0;
}
String prefix = "";
if (splitted[tfrom].equals("nv")) {
prefix = "[Notice] ";
}
if (splitted[0].equals("!n") && type == 0)
{
type = 6;
prefix = "[" + player.getName() + "] ";
}
joinmod += tfrom;
MaplePacket packet = MaplePacketCreator.serverNotice(type, prefix +
StringUtil.joinStringFrom(splitted, joinmod));
if (range == 0) {
player.getMap().broadcastMessage(packet);
} else if (range == 1) {
c.getChannelServer().broadcastPacket(packet);
} else if (range == 2) {
try {
c.getChannelServer().getWorldInterface().broadcastMessage(
player.getName(), packet.getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
}
} else if (splitted[0].equals("!notice")) {
int joinmod = 1;
int range = -1;
if (splitted[1].equals("m")) {
range = 0;
} else if (splitted[1].equals("c")) {
range = 1;
} else if (splitted[1].equals("w")) {
range = 2;
}
int tfrom = 2;
if (range == -1) {
range = 2;
tfrom = 1;
}
int type = MapleCharacterUtil.getNoticeType(splitted[tfrom]);
if (type == -1) {
type = 0;
joinmod = 0;
}
String prefix = "";
if (splitted[tfrom].equals("nv")) {
prefix = "[Notice] ";
}
joinmod += tfrom;
MaplePacket packet = MaplePacketCreator.serverNotice(type, prefix +
StringUtil.joinStringFrom(splitted, joinmod));
if (range == 0) {
player.getMap().broadcastMessage(packet);
} else if (range == 1) {
c.getChannelServer().broadcastPacket(packet);
} else if (range == 2) {
try {
c.getChannelServer().getWorldInterface().broadcastMessage(
player.getName(), packet.getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
}
Code:
public static int getNoticeType(String typestring) {
if (typestring.equals("n")) {
return 0;
} else if (typestring.equals("p")) {
return 1;
} else if (typestring.equals("l")) {
return 2;
} else if (typestring.equals("nv")) {
return 5;
} else if (typestring.equals("v")) {
return 5;
} else if (typestring.equals("b")) {
return 6;
}
return -1;
}
public static String joinAfterString(String splitted[], String str) {
for (int i = 1; i < splitted.length; i++) {
if (splitted[i].equalsIgnoreCase(str) && i + 1 < splitted.length) {
return StringUtil.joinStringFrom(splitted, i+1);
}
}
return null;
}
fuking flame shield on .
ps : i think i added some xtra function in .