Search in sources :

Example 1 with SummonAttackEntry

use of net.server.channel.handlers.SummonDamageHandler.SummonAttackEntry in project HeavenMS by ronancpl.

the class MaplePacketCreator method summonAttack.

/*
        public static byte[] moveMonster(int useskill, int skill, int skill_1, int skill_2, int skill_3, int skill_4, int oid, Point startPos, List<LifeMovementFragment> moves) {
                final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
                mplew.writeShort(SendOpcode.MOVE_MONSTER.getValue());
                mplew.writeInt(oid);
                mplew.write(0);
                mplew.write(useskill);
                mplew.write(skill);
                mplew.write(skill_1);
                mplew.write(skill_2);
                mplew.write(skill_3);
                mplew.write(skill_4);
                mplew.writePos(startPos);
                serializeMovementList(mplew, moves);
                return mplew.getPacket();
        }
        */
public static byte[] summonAttack(int cid, int summonOid, byte direction, List<SummonAttackEntry> allDamage) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    // b2 00 29 f7 00 00 9a a3 04 00 c8 04 01 94 a3 04 00 06 ff 2b 00
    mplew.writeShort(SendOpcode.SUMMON_ATTACK.getValue());
    mplew.writeInt(cid);
    mplew.writeInt(summonOid);
    // char level
    mplew.write(0);
    mplew.write(direction);
    mplew.write(allDamage.size());
    for (SummonAttackEntry attackEntry : allDamage) {
        // oid
        mplew.writeInt(attackEntry.getMonsterOid());
        // who knows
        mplew.write(6);
        // damage
        mplew.writeInt(attackEntry.getDamage());
    }
    return mplew.getPacket();
}
Also used : SummonAttackEntry(net.server.channel.handlers.SummonDamageHandler.SummonAttackEntry) MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

SummonAttackEntry (net.server.channel.handlers.SummonDamageHandler.SummonAttackEntry)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1