• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Maplestory v83 how to bypass the max HP value?

Newbie Spellweaver
Joined
Feb 22, 2014
Messages
17
Reaction score
1
OK so the thread title kinda sums it up. I'm helping a friend with a server and I saw somewhere a long time ago that someone had bypassed the built-in max HP cap of a mob of 2,147,483,647 by giving a snail 10,000,000,000 HP. I was wondering how this is done, or if it's just bs.
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
Look at Development v117 (or, I think any Lithium v100+ source actually?), and you'll see.

Think about it, if a mob's hp caps at 2.147b, what type of data is stored for it? Obviously Integer. We just made it a long so our hp is able to reach up to Long.MAX_VALUE (you could do even larger than long if you want, probably not necessary), and then you just do some checks when sending packets so if hp >= Integer.MAX_VALUE, send Integer.MAX_VALUE else write the (int) HP.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Nov 14, 2008
Messages
1,025
Reaction score
641
then you just do some checks when sending packets so if hp >= Integer.MAX_VALUE, send Integer.MAX_VALUE else write the (int) HP.

that's a dumb workaround, send

Code:
(int) (Long.MAX_VALUE / value)

instead
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
that's a dumb workaround, send

Code:
(int) (Long.MAX_VALUE / value)

instead

I'm not quite sure if I'm understanding the subject here.

So, "value" in here is the current HP of the monster?

If you're saying to make no validations and just send that as the packet to the monster HP, then I believe that isn't going to work properly.

You're casting from a long to integer, it will overflow.

I can only imagine a boss bar going all crazy because of that.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Nov 14, 2008
Messages
1,025
Reaction score
641
I'm not quite sure if I'm understanding the subject here.

So, "value" in here is the current HP of the monster?

If you're saying to make no validations and just send that as the packet to the monster HP, then I believe that isn't going to work properly.

You're casting from a long to integer, it will overflow.

I can only imagine a boss bar going all crazy because of that.

sorry I was tired as hell, what I posted makes no sense, not sure what went through my mind at that time. here is was I meant

Code:
(value / Long.MAX_VALUE) * Integer.MAX_VALUE

downcast the long to an int. I don't remember how the boss hp bar packet works but if it requires the max hp as well in its integer form, then you must downcast the maxhp as well.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
sorry I was tired as hell, what I posted makes no sense, not sure what went through my mind at that time. here is was I meant

Code:
(value / Long.MAX_VALUE) * Integer.MAX_VALUE

downcast the long to an int. I don't remember how the boss hp bar packet works but if it requires the max hp as well in its integer form, then you must downcast the maxhp as well.

Technically for MaxHP since it won't change, you could just write Integer.MAX_VALUE unless < max val (yes its also int). However for the HP portion, good idea. Better than having the bar constantly at max value until it drops under (always found that stupid, don't know why i never improved it).
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Nov 14, 2008
Messages
1,025
Reaction score
641
Technically for MaxHP since it won't change, you could just write Integer.MAX_VALUE unless < max val (yes its also int).

??

you have to give the client the hp and the maxhp of the monster so it knows how to show the bar. and if you like micro optimization, only downcast the maxhp to an int when creating the monster rather than for every packets
 
Upvote 0
Back
Top