Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

¨[Help¨] V83 Set more than 2147b of hp to a mob/boss

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
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:
Newbie Spellweaver
Joined
May 11, 2021
Messages
59
Reaction score
2
Seems like a stackoverflow question, here is what I understand:



The issue is the limits set to the code itself, I'm sure you can do some research online on how to implement such changes to your code and make a value reach very very big numbers.
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
Seems like a stackoverflow question, here is what I understand:



The issue is the limits set to the code itself, I'm sure you can do some research online on how to implement such changes to your code and make a value reach very very big numbers.

Thanks but that didn't resolve my problem. What they do say there is the same thing i know what i need to do wich is switch the int to a long or into a string. But the big issue that i'm having is HOW i'm supposed to do that into my source to make it work the way it's supposed to work.

PD: i'm a Java noob so please go easy on me.
 
Upvote 0
Discord: .z41n
[VIP] Member
Joined
Aug 3, 2008
Messages
172
Reaction score
26
Hi,

You are correct that you need to convert the MAX VALUE from INT to LONG.
This must be done both on the server-side AND the client itself.

The server side is quite straight forward, especially when you check your logs when errors occur.
However, the client side has a learning curve: you will need to override every call of the MobHP.

You should use IDA, perhaps do a search for max int value. Then reverse-engineer the calls here.
Perhaps something along the lines of a Decode<LONG> / Decode4>Decode5.

This is a tough task however it is definitely possible. Perhaps you can also take a look at a higher version client which already have this limit surpassed.
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
Hello, thanks for your reply.
According with this post https://forum.ragezone.com/f566/maplestory-v83-bypass-max-hp-1096585/ they don't mention a client edit, seems like they convert it in the source so the client reads it but i'm not sure how to do it because Harepacker only allows the max int value (2147483647) on maxHP. So maybe i need to make it a Double or a String maybe? man i feel so confused doing this but if i want higher version bosses i need to implement this.. =/
 
Upvote 0
Discord: .z41n
[VIP] Member
Joined
Aug 3, 2008
Messages
172
Reaction score
26
Not a double or a string. And you will 100% have to edit this change on both the source and client.

If you change on the source but not the client, you may crash due to a number format exception (expects int, receives some long).
If you change on the client but not the source, you'll see the damage higher but the monster won't actually take that damage.

Your best bet is to find a client of a higher version (unsure which version they increased the Integer.MAX_VALUE limit) and reverse engineer from there. I'll look into this as well and post a video on my (as long as Nexon doesn't take it down again lol)
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
So what about a "Float"?

Maybe i'm wrong and feel free to correct me if i am, but in this part of the MaplePacketCreator.java:
Code:
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);
        }

Seems like if maxhp is less than max value it sends it as int but if else(wich i understand as if the value is over the int value) then it multiplies it as float? i don't get it at all but i think i got the basic of it but even cant make it work..

PD: sorry for being a pain in the butt
 
Upvote 0
Discord: .z41n
[VIP] Member
Joined
Aug 3, 2008
Messages
172
Reaction score
26
So what about a "Float"?

Maybe i'm wrong and feel free to correct me if i am, but in this part of the MaplePacketCreator.java:
Code:
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);
        }

Seems like if maxhp is less than max value it sends it as int but if else(wich i understand as if the value is over the int value) then it multiplies it as float? i don't get it at all but i think i got the basic of it but even cant make it work..

PD: sorry for being a pain in the butt

What this snippet is doing is that if the maxHP is less than 2.147B, then set the variables to the int value for sendHP and sendMapHP
Otherwise, if its greater than 2.147B, then sendHP is reduced by a percentage of current/max hp times 2.147B (meaning, less than 2.147B), then sendMax will be set to the max of 2.147B.

tl;dr: value never goes above the max value. It must be long to be above the max int value, and will require edits to the client itself.
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
OK understand how it works now, then i give up.. I guess i have to find some way to download visualstudio and learn some c+ to start from there. I apologizes for being such a pain in the butt.

Your best bet is to find a client of a higher version (unsure which version they increased the Integer.MAX_VALUE limit) and reverse engineer from there. I'll look into this as well and post a video on my (as long as Nexon doesn't take it down again lol)

if you find some way to do it maybe with a hex edit would be great and i hope you share it, due to my net limits would be hard to me to get VisualS. However thanks for helping me so far.
 
Upvote 0
Back
Top