Search in sources :

Example 96 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method magicAttack.

public static byte[] magicAttack(MapleCharacter chr, int skill, int skilllevel, int stance, int numAttackedAndDamage, Map<Integer, List<Integer>> damage, int charge, int speed, int direction, int display) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.MAGIC_ATTACK.getValue());
    addAttackBody(mplew, chr, skill, skilllevel, stance, numAttackedAndDamage, 0, damage, speed, direction, display);
    if (charge != -1) {
        mplew.writeInt(charge);
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 97 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method memberLeft.

// someone leaving, mode == 0x2c for leaving, 0x2f for expelled
public static byte[] memberLeft(MapleGuildCharacter mgc, boolean bExpelled) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GUILD_OPERATION.getValue());
    mplew.write(bExpelled ? 0x2f : 0x2c);
    mplew.writeInt(mgc.getGuildId());
    mplew.writeInt(mgc.getId());
    mplew.writeMapleAsciiString(mgc.getName());
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 98 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getFredrick.

public static byte[] getFredrick(byte op) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.FREDRICK.getValue());
    mplew.write(op);
    switch(op) {
        case 0x24:
            mplew.skip(8);
            break;
        default:
            mplew.write(0);
            break;
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 99 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method showBoughtCashPackage.

public static byte[] showBoughtCashPackage(List<Item> cashPackage, int accountId) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.CASHSHOP_OPERATION.getValue());
    mplew.write(0x89);
    mplew.write(cashPackage.size());
    for (Item item : cashPackage) {
        addCashItemInformation(mplew, item, accountId);
    }
    mplew.writeShort(0);
    return mplew.getPacket();
}
Also used : MapleMapItem(server.maps.MapleMapItem) SpecialCashItem(server.CashShop.SpecialCashItem) CashItem(server.CashShop.CashItem) Item(client.inventory.Item) MaplePlayerShopItem(server.maps.MaplePlayerShopItem) MapleShopItem(server.MapleShopItem) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 100 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getTradePartnerAdd.

public static byte[] getTradePartnerAdd(MapleCharacter c) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
    mplew.write(PlayerInteractionHandler.Action.VISIT.getCode());
    mplew.write(1);
    addCharLook(mplew, c, false);
    mplew.writeMapleAsciiString(c.getName());
    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