Cheat Engine

The Underground Site of Cheat Engine


    [Release] MaplePacketCreator for CPQ

    Share

    Admin
    Admin

    Posts : 43
    Join date : 2009-05-18

    [Release] MaplePacketCreator for CPQ

    Post  Admin on Mon May 18, 2009 12:00 pm

    [php]
    Add this
    public static MaplePacket mobDamageMob(MapleMonster mob, int damage, int direction) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendPacketOpcode.DAMAGE_MONSTER.getValue());
    mplew.writeInt(mob.getObjectId());
    mplew.write(direction); // direction
    mplew.writeInt(damage);
    int remainingHp = mob.getHp() - damage;
    if (remainingHp < 0) {
    remainingHp = 0;
    }
    mob.setHp(remainingHp);
    mplew.writeInt(remainingHp);
    mplew.writeInt(mob.getMaxHp());
    return mplew.getPacket();
    }

    public static MaplePacket CPUpdate(boolean party, int curCP, int totalCP, int team) { //CPQ
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    if (!party) {
    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_OBTAINED_CP.getValue());
    } else {
    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_PARTY_CP.getValue());
    mplew.write(team); //team?
    }
    mplew.writeShort(curCP);
    mplew.writeShort(totalCP);
    return mplew.getPacket();
    }
    public static MaplePacket startCPQ() {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_START.getValue());
    mplew.writeLong(0);
    mplew.writeLong(0);
    mplew.writeInt(0);
    mplew.writeShort(0);
    mplew.write(0);
    return mplew.getPacket();
    }

    public static MaplePacket startMonsterCarnival(int team) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_START.getValue());
    mplew.write(team);
    mplew.write(HexTool.getByteArrayFromHexString("00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"));
    return mplew.getPacket();
    }

    public static MaplePacket obtainCP(int unused, int total) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_OBTAINED_CP.getValue());
    mplew.writeShort(unused);
    mplew.writeShort(total);
    return mplew.getPacket();
    }

    public static MaplePacket updateCP(int team, int unused, int total) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendPacketOpcode.MONSTER_CARNIVAL_PARTY_CP.getValue());
    mplew.write(team);
    mplew.writeShort(unused);
    mplew.writeShort(total);
    return mplew.getPacket();
    }[/php]

      Current date/time is Tue Dec 11, 2018 5:48 pm