Search in sources :

Example 16 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method levelUpMessage.

/**
 * Sends a "levelup" packet to the guild or family.
 *
 * Possible values for <code>type</code>:<br> 0: <Family> ? has reached Lv.
 * ?.<br> - The Reps you have received from ? will be reduced in half. 1:
 * <Family> ? has reached Lv. ?.<br> 2: <Guild> ? has reached Lv. ?.<br>
 *
 * @param type The type
 * @return The "levelup" packet.
 */
public static byte[] levelUpMessage(int type, int level, String charname) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.NOTIFY_LEVELUP.getValue());
    mplew.write(type);
    mplew.writeInt(level);
    mplew.writeMapleAsciiString(charname);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 17 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method pinRegistered.

public static byte[] pinRegistered() {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
    mplew.writeShort(SendOpcode.UPDATE_PINCODE.getValue());
    mplew.write(0);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 18 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method addQuestTimeLimit.

public static byte[] addQuestTimeLimit(final short quest, final int time) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.UPDATE_QUEST_INFO.getValue());
    mplew.write(6);
    // Size but meh, when will there be 2 at the same time? And it won't even replace the old one :)
    mplew.writeShort(1);
    mplew.writeShort(quest);
    mplew.writeInt(time);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 19 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method cancelForeignBuff.

public static byte[] cancelForeignBuff(int cid, List<MapleBuffStat> statups) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.CANCEL_FOREIGN_BUFF.getValue());
    mplew.writeInt(cid);
    writeLongMaskFromList(mplew, statups);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 20 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method getTempBan.

public static byte[] getTempBan(long timestampTill, byte reason) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(17);
    mplew.writeShort(SendOpcode.LOGIN_STATUS.getValue());
    mplew.write(2);
    mplew.write(0);
    mplew.writeInt(0);
    mplew.write(reason);
    // Tempban date is handled as a 64-bit long, number of 100NS intervals since 1/1/1601. Lulz.
    mplew.writeLong(getTime(timestampTill));
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)431 Point (java.awt.Point)44 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)15 Item (client.inventory.Item)11 SpecialCashItem (server.CashShop.SpecialCashItem)11 MapleShopItem (server.MapleShopItem)11 MapleMapItem (server.maps.MapleMapItem)11 CashItem (server.CashShop.CashItem)10 MapleCharacter (client.MapleCharacter)8 MapleBuffStat (client.MapleBuffStat)4 MaplePet (client.inventory.MaplePet)3 MTSItemInfo (server.MTSItemInfo)3 MapleDisease (client.MapleDisease)2 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 Channel (net.server.channel.Channel)2 MapleGuild (net.server.guild.MapleGuild)2 MapleMonster (server.life.MapleMonster)2 BuddylistEntry (client.BuddylistEntry)1