v75 v83 メガホンをv62で使えるようにするシステム

Go down

v75 v83 メガホンをv62で使えるようにするシステム

投稿 by 構築さん on 2014-05-30, 09:37

これで3連拡声器やアイテム拡声器が使えるようになるはずです

MaplePacketCreater.java

Code:
public static MaplePacket itemMegaphone(String msg, boolean whisper, int channel, IItem item) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.SERVERMESSAGE.getValue());
mplew.write(8);
mplew.writeMapleAsciiString(msg);
mplew.write(channel - 1);
mplew.write(whisper ? 1 : 0);
if (item == null) {
mplew.write(0);
} else {
addItemInfo(mplew, item);
}
return mplew.getPacket();
}


UseCashItemHandler.java

boolean whisper;

case 507:

Code:
case 6: //item megaphone
String msg = c.getPlayer().getName() + " : " + slea.readMapleAsciiString();
whisper = slea.readByte() == 1;
IItem item = null;
if (slea.readByte() == 1) { //item
item = c.getPlayer().getInventory(MapleInventoryType.getByType((byte) slea.readInt())).getItem((byte) slea.readInt());
if (item == null) //hack
{
return;
} else if (ii.isDropRestricted(item.getItemId())) {
player.dropMessage("You cannot trade this item.");
c.getSession().write(MaplePacketCreator.enableActions());
return;
}
}
c.getChannelServer().getWorldInterface().broadcastMessage(null, MaplePacketCreator.itemMegaphone(msg, whisper, c.getChannel(), item).getBytes());
break;

Code:
} else {
player.dropMessage(1, "The Maple TV is already in use.");
}
break;
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可