ガチャポンメッセージシステム

Go down

ガチャポンメッセージシステム

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

MaplePacketCreater.java


Code:
public static MaplePacket gachaponMessage(MapleCharacter player,int channel,IItem item) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.SERVERMESSAGE.getValue());
mplew.write(8);
mplew.writeMapleAsciiString(player.getName() + " : おめでとうございます");
http://mplew.writeInt(0); //random?
mplew.write(channel - 1);
http://mplew.writeMapleAsciiString(town);
addItemInfo(mplew, item, false, false, true);
return mplew.getPacket();
}


NPCConversationManager.java

Code:
public void processGachapon(int[] id, boolean remote) {
int[] gacMap = {100000000, 101000000, 102000000, 103000000, 105040300, 800000000, 809000101, 809000201, 600000000, 120000000};
int itemid = id[Randomizer.getInstance().nextInt(id.length)];
addRandomItem(itemid);
if (!remote) {
gainItem(5220000, (short) -1);
}
sendNext("おめでとうございます。 #b#t" + itemid + "##k.");
getClient().getChannelServer().broadcastPacket(MaplePacketCreator.gachaponMessage(getPlayer(),c.getChannel(),getPlayer().getInventory(MapleInventoryType.getByType((byte) (itemid / 1000000))).findById(itemid)));
}
avatar
構築さん
Admin

Posts : 193
Join date : 2014/05/29

http://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


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