Search in sources :

Example 51 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method moveMonster.

public static byte[] moveMonster(int oid, boolean skillPossible, int skill, int skillId, int skillLevel, int pOption, Point startPos, List<LifeMovementFragment> moves) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.MOVE_MONSTER.getValue());
    mplew.writeInt(oid);
    mplew.write(0);
    mplew.writeBool(skillPossible);
    mplew.write(skill);
    mplew.write(skillId);
    mplew.write(skillLevel);
    mplew.writeShort(pOption);
    mplew.writePos(startPos);
    serializeMovementList(mplew, moves);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 52 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method partyStatusMessage.

/**
 * 23: 'Char' have denied request to the party.
 *
 * @param message
 * @param charname
 * @return
 */
public static byte[] partyStatusMessage(int message, String charname) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.PARTY_OPERATION.getValue());
    mplew.write(message);
    mplew.writeMapleAsciiString(charname);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 53 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method MTSConfirmBuy.

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

Example 54 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getScrollEffect.

public static byte[] getScrollEffect(int chr, ScrollResult scrollSuccess, boolean legendarySpirit) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SHOW_SCROLL_EFFECT.getValue());
    mplew.writeInt(chr);
    switch(scrollSuccess) {
        case SUCCESS:
            mplew.writeShort(1);
            mplew.writeShort(legendarySpirit ? 1 : 0);
            break;
        case FAIL:
            mplew.writeShort(0);
            mplew.writeShort(legendarySpirit ? 1 : 0);
            break;
        case CURSE:
            mplew.write(0);
            mplew.write(1);
            mplew.writeShort(legendarySpirit ? 1 : 0);
            break;
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 55 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method showPet.

public static byte[] showPet(MapleCharacter chr, MaplePet pet, boolean remove, boolean hunger) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SPAWN_PET.getValue());
    mplew.writeInt(chr.getId());
    mplew.write(chr.getPetIndex(pet));
    if (remove) {
        mplew.write(0);
        mplew.write(hunger ? 1 : 0);
    } else {
        addPetInfo(mplew, pet, true);
    }
    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