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);
}
}
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();
}
Aggregations