Search in sources :

Example 1 with SkillMacro

use of client.SkillMacro in project HeavenMS by ronancpl.

the class SkillMacroHandler method handlePacket.

public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    int num = slea.readByte();
    for (int i = 0; i < num; i++) {
        String name = slea.readMapleAsciiString();
        int shout = slea.readByte();
        int skill1 = slea.readInt();
        int skill2 = slea.readInt();
        int skill3 = slea.readInt();
        SkillMacro macro = new SkillMacro(skill1, skill2, skill3, name, shout, i);
        c.getPlayer().updateMacros(i, macro);
    }
}
Also used : SkillMacro(client.SkillMacro)

Example 2 with SkillMacro

use of client.SkillMacro in project HeavenMS by ronancpl.

the class MaplePacketCreator method getMacros.

public static byte[] getMacros(SkillMacro[] macros) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.MACRO_SYS_DATA_INIT.getValue());
    int count = 0;
    for (int i = 0; i < 5; i++) {
        if (macros[i] != null) {
            count++;
        }
    }
    mplew.write(count);
    for (int i = 0; i < 5; i++) {
        SkillMacro macro = macros[i];
        if (macro != null) {
            mplew.writeMapleAsciiString(macro.getName());
            mplew.write(macro.getShout());
            mplew.writeInt(macro.getSkill1());
            mplew.writeInt(macro.getSkill2());
            mplew.writeInt(macro.getSkill3());
        }
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) SkillMacro(client.SkillMacro) Point(java.awt.Point)

Aggregations

SkillMacro (client.SkillMacro)2 Point (java.awt.Point)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1