Search in sources :

Example 6 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method setExtraPendantSlot.

public static byte[] setExtraPendantSlot(boolean toggleExtraSlot) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SET_EXTRA_PENDANT_SLOT.getValue());
    mplew.writeBool(toggleExtraSlot);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 7 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method guildInvite.

public static byte[] guildInvite(int gid, String charName) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.GUILD_OPERATION.getValue());
    mplew.write(0x05);
    mplew.writeInt(gid);
    mplew.writeMapleAsciiString(charName);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 8 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getChannelChange.

/**
 * Gets a packet telling the client the IP of the new channel.
 *
 * @param inetAddr The InetAddress of the requested channel server.
 * @param port The port the channel is on.
 * @return The server IP packet.
 */
public static byte[] getChannelChange(InetAddress inetAddr, int port) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.CHANGE_CHANNEL.getValue());
    mplew.write(1);
    byte[] addr = inetAddr.getAddress();
    mplew.write(addr);
    mplew.writeShort(port);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 9 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method triggerReactor.

// is there a way to trigger reactors without performing the hit animation?
public static byte[] triggerReactor(MapleReactor reactor, int stance) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    Point pos = reactor.getPosition();
    mplew.writeShort(SendOpcode.REACTOR_HIT.getValue());
    mplew.writeInt(reactor.getObjectId());
    mplew.write(reactor.getState());
    mplew.writePos(pos);
    mplew.writeShort(stance);
    mplew.write(0);
    // frame delay, set to 5 since there doesn't appear to be a fixed formula for it
    mplew.write(5);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) Point(java.awt.Point)

Example 10 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method incubatorResult.

public static byte[] incubatorResult() {
    // lol
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(8);
    mplew.writeShort(SendOpcode.INCUBATOR_RESULT.getValue());
    mplew.skip(6);
    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