Cheat Engine

The Underground Site of Cheat Engine


    [Release] BattleShip HP

    Share

    Admin
    Admin

    Posts : 43
    Join date : 2009-05-18

    [Release] BattleShip HP

    Post  Admin on Mon May 18, 2009 11:58 am

    [php]
    MaplePacketCreator.java
    ------

    public static MaplePacket updateBattleShipHP(int chr, int hp) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendPacketOpcode.SHOW_MONSTER_HP.getValue());
    mplew.writeInt(chr);
    mplew.write(hp);
    return mplew.getPacket();
    }

    MapleCharacter.java
    ------
    public static int battleshipHP = 0;
    //public static int battleshipHP;
    //not sure which

    public void handleBattleShipLoss() {
    int HP = (int) Math.ceil((this.hp * 100.0) / getMaxHp());
    if (getBattleShipHP() < 0) {
    getClient().getSession().write(MaplePacketCreator.updateBattleShipHP(this.getId(), HP));
    dropMessage("Your [Battle Ship] has been destroyed by the monster with incredible force!");
    }
    getClient().getSession().write(MaplePacketCreator.updateBattleShipHP(this.getId(), HP));
    }

    public int getBattleShipHP() {
    return battleshipHP;
    }

    public int setBattleShipHP(int hpz) {
    return battleshipHP = hpz;
    }

    public int destroyBattleShipHP(int hp0) {
    return battleshipHP - hp0;
    }

    public int gainBattleShipHP(int hpl33t) {
    return battleshipHP + hpl33t;
    }

    TakeDamageHandler.java
    -------
    Find:
    if (player.getBuffedValue(MapleBuffStat.MORPH) != null) {
    player.cancelMorphs();
    }
    ----

    Paste Under
    if (player.getBuffedValue(MapleBuffStat.MONSTER_RIDING) != null) {
    boolean isBattleShip = c.getPlayer().getBuffSource(MapleBuffStat.MONSTER_RIDING) == 1932000;
    if (isBattleShip) {
    if (player.getBattleShipHP() <= 0) {
    player.dispelSkill(5221006);
    } else {
    player.destroyBattleShipHP(damage);
    player.handleBattleShipLoss();
    player.getMap().broadcastMessage(player, MaplePacketCreator.damagePlayer(damagefrom, monsteridfrom, player.getId(), damage, fake, direction, is_pgmr, pgmr, is_pg, oid, pos_x, pos_y), false);
    player.checkBerserk();
    return;
    }
    }
    }
    [/php]

      Current date/time is Tue Dec 11, 2018 6:41 pm