Junior Spellweaver
- Joined
- Sep 20, 2019
- Messages
- 108
- Reaction score
- 8
I'm using Heavenms v83, any noob friendly guide on what to change in my source pretty please? i want to add Cygnus boss with more than 2147b of hp and i can't find how to.
So far i have figure that i have to switch somehow the maxHP from "Int" to "Long" in the source wich i suppose has to be around here.
MaplePacketCreator.java
Please i need help
So far i have figure that i have to switch somehow the maxHP from "Int" to "Long" in the source wich i suppose has to be around here.
MaplePacketCreator.java
Code:
public static byte[] showMonsterHP(int oid, int remhppercentage) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.SHOW_MONSTER_HP.getValue());
mplew.writeInt(oid);
mplew.write(remhppercentage);
return mplew.getPacket();
}
public static byte[] showBossHP(int oid, int currHP, int maxHP, byte tagColor, byte tagBgColor) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.FIELD_EFFECT.getValue());
mplew.write(5);
mplew.writeInt(oid);
mplew.writeInt(currHP);
mplew.writeInt(maxHP);
mplew.write(tagColor);
mplew.write(tagBgColor);
return mplew.getPacket();
}
private static Pair<Integer, Integer> normalizedCustomMaxHP(long currHP, long maxHP) {
int sendHP, sendMaxHP;
if(maxHP <= Integer.MAX_VALUE) {
sendHP = (int) currHP;
sendMaxHP = (int) maxHP;
} else {
float f = ((float) currHP) / maxHP;
sendHP = (int) (Integer.MAX_VALUE * f);
sendMaxHP = Integer.MAX_VALUE;
}
return new Pair<>(sendHP, sendMaxHP);
}
public static byte[] customShowBossHP(byte call, int oid, long currHP, long maxHP, byte tagColor, byte tagBgColor) {
Pair<Integer, Integer> customHP = normalizedCustomMaxHP(currHP, maxHP);
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.FIELD_EFFECT.getValue());
mplew.write(call);
mplew.writeInt(oid);
mplew.writeInt(customHP.left);
mplew.writeInt(customHP.right);
mplew.write(tagColor);
mplew.write(tagBgColor);
return mplew.getPacket();
}
Please i need help
Last edited: