Search in sources :

Example 21 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method showGuildRanks.

public static byte[] showGuildRanks(int npcid, ResultSet rs) throws SQLException {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GUILD_OPERATION.getValue());
    mplew.write(0x49);
    mplew.writeInt(npcid);
    if (!rs.last()) {
        // no guilds o.o
        mplew.writeInt(0);
        return mplew.getPacket();
    }
    // number of entries
    mplew.writeInt(rs.getRow());
    rs.beforeFirst();
    while (rs.next()) {
        mplew.writeMapleAsciiString(rs.getString("name"));
        mplew.writeInt(rs.getInt("GP"));
        mplew.writeInt(rs.getInt("logo"));
        mplew.writeInt(rs.getInt("logoColor"));
        mplew.writeInt(rs.getInt("logoBG"));
        mplew.writeInt(rs.getInt("logoBGColor"));
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 22 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getMiniGameReady.

public static byte[] getMiniGameReady(MapleMiniGame game) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
    mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
    mplew.write(PlayerInteractionHandler.Action.READY.getCode());
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 23 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method guildQuestWaitingNotice.

public static byte[] guildQuestWaitingNotice(byte channel, int waitingPos) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GUILD_OPERATION.getValue());
    mplew.write(0x4C);
    mplew.write(channel - 1);
    mplew.write(waitingPos);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 24 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method updateAreaInfo.

public static byte[] updateAreaInfo(int area, String info) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SHOW_STATUS_INFO.getValue());
    // 0x0B in v95
    mplew.write(0x0A);
    // infoNumber
    mplew.writeShort(area);
    mplew.writeMapleAsciiString(info);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 25 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method startCPQ.

public static byte[] startCPQ(MapleCharacter chr, MonsterCarnivalParty enemy) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(25);
    mplew.writeShort(SendOpcode.MONSTER_CARNIVAL_START.getValue());
    // team
    mplew.write(chr.getTeam());
    // Obtained CP - Used CP
    mplew.writeShort(chr.getCP());
    // Total Obtained CP
    mplew.writeShort(chr.getObtainedCP());
    // Obtained CP - Used CP of the team
    mplew.writeShort(chr.getCarnivalParty().getAvailableCP());
    // Total Obtained CP of the team
    mplew.writeShort(chr.getCarnivalParty().getTotalCP());
    // Obtained CP - Used CP of the team
    mplew.writeShort(enemy.getAvailableCP());
    // Total Obtained CP of the team
    mplew.writeShort(enemy.getTotalCP());
    // Probably useless nexon shit
    mplew.writeShort(0);
    // Probably useless nexon shit
    mplew.writeLong(0);
    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