Buddy find (#311)
This commit is contained in:
@@ -128,7 +128,18 @@ public final class WhisperHandler extends AbstractMaplePacketHandler {
|
|||||||
c.announce(MaplePacketCreator.getWhisperReply(recipient, (byte) 0));
|
c.announce(MaplePacketCreator.getWhisperReply(recipient, (byte) 0));
|
||||||
}
|
}
|
||||||
} else if (mode == 0x44) {
|
} else if (mode == 0x44) {
|
||||||
//Buddy find?
|
//Buddy find
|
||||||
|
String recipient = slea.readMapleAsciiString();
|
||||||
|
MapleCharacter player = c.getWorldServer().getPlayerStorage().getCharacterByName(recipient);
|
||||||
|
if (player != null && c.getPlayer().gmLevel() >= player.gmLevel()) {
|
||||||
|
if (player.getCashShop().isOpened()) { // in CashShop
|
||||||
|
c.getSession().write(MaplePacketCreator.getFindReplyWithCS(recipient));
|
||||||
|
} else if (player.isAwayFromWorld()) { // in MTS
|
||||||
|
c.getSession().write(MaplePacketCreator.getFindReplyWithMTS(recipient));
|
||||||
|
} else {
|
||||||
|
c.getSession().write(MaplePacketCreator.getFindReplyWithMap(player.getName(), player.getMap().getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6067,6 +6067,37 @@ public class MaplePacketCreator {
|
|||||||
return mplew.getPacket();
|
return mplew.getPacket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static byte[] getFindReplyWithMap(String target, int mapid) {
|
||||||
|
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
|
mplew.writeShort(SendOpcode.WHISPER.getValue());
|
||||||
|
mplew.write(72);
|
||||||
|
mplew.writeMapleAsciiString(target);
|
||||||
|
mplew.write(1);
|
||||||
|
mplew.writeInt(mapid);
|
||||||
|
mplew.write(new byte[8]);
|
||||||
|
return mplew.getPacket();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getFindReplyWithCS(String target) {
|
||||||
|
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
|
mplew.writeShort(SendOpcode.WHISPER.getValue());
|
||||||
|
mplew.write(72);
|
||||||
|
mplew.writeMapleAsciiString(target);
|
||||||
|
mplew.write(2);
|
||||||
|
mplew.writeInt(-1);
|
||||||
|
return mplew.getPacket();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] getFindReplyWithMTS(String target) {
|
||||||
|
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
|
mplew.writeShort(SendOpcode.WHISPER.getValue());
|
||||||
|
mplew.write(72);
|
||||||
|
mplew.writeMapleAsciiString(target);
|
||||||
|
mplew.write(0);
|
||||||
|
mplew.writeInt(-1);
|
||||||
|
return mplew.getPacket();
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] sendAutoHpPot(int itemId) {
|
public static byte[] sendAutoHpPot(int itemId) {
|
||||||
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
mplew.writeShort(SendOpcode.AUTO_HP_POT.getValue());
|
mplew.writeShort(SendOpcode.AUTO_HP_POT.getValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user