How do i increase the Monster HP beyond 2b?

05/11/2016 01:56 jeromerz#1
Hello everyone,

i wanted to know how to increase the monster life beyond 2,147,483,647 like double it. i managed to look it up on the source:

Code:
	DWORD	dwAddHp;		
	DWORD	dwAddMp;
if i change DWORD to UINT or Unsigned Long it would make the max hp like 4,294,967,295 is this correct?

i wonder if im doing it right.

Thanks in advance
05/11/2016 03:22 ZeroTwo02#2
MoverParam.cpp

Change
Code:
return int( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
to
Code:
return uint( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
ProjectCmn.h

Change
Code:
DWORD	dwAddHp;
to
Code:
UINT	dwAddHp;
05/11/2016 05:15 jeromerz#3
Quote:
Originally Posted by naruto66620 View Post
MoverParam.cpp

Change
Code:
return int( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
to
Code:
return uint( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
ProjectCmn.h

Change
Code:
DWORD	dwAddHp;
to
Code:
UINT	dwAddHp;
Done that but when i see the monster ingame the HP is 1/1 only :/

[Only registered and activated users can see links. Click Here To Register...]
05/11/2016 08:33 alfredico#4
Quote:
Originally Posted by naruto66620 View Post
MoverParam.cpp

Change
Code:
return int( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
to
Code:
return uint( pMoverProp->dwAddHp * prj.m_fMonsterHitpointRate * pMoverProp->m_fHitPoint_Rate );
ProjectCmn.h

Change
Code:
DWORD	dwAddHp;
to
Code:
UINT	dwAddHp;
Unsigned int is still 32bits, you need to change to __int64
05/11/2016 08:37 Mognakor#5
First of all:

Ask yourself if you really need mob Hp beyond 2.14b. You've probably fucked up in your design somewhere in the process.

Second:

If you've bothered to search your sourcecode or even google you'd have found out that DWORD is defined as unsigned long so it's already 32 bits. Which means you have 4.28b as maximum value.

This may be limited by casts etc. in other functions and thus you have the same issue as mentionend in:

Third:

Changing it too even more would mean using a 64bit variable (for example DWORD64). But thats alot more work than just changing the type of 1 variable.
05/11/2016 09:18 jeromerz#6
Quote:
Originally Posted by Mognakor View Post
First of all:

Ask yourself if you really need mob Hp beyond 2.14b. You've probably fucked up in your design somewhere in the process.

Second:

If you've bothered to search your sourcecode or even google you'd have found out that DWORD is defined as unsigned long so it's already 32 bits. Which means you have 4.28b as maximum value.

This may be limited by casts etc. in other functions and thus you have the same issue as mentionend in:

Third:

Changing it too even more would mean using a 64bit variable (for example DWORD64). But thats alot more work than just changing the type of 1 variable.
Thanks already searched it on google but the value given DWORD has a 2.1b max value. And unsigned int is 4.2b i just tried it making the hp of monster beyond 2.1b for some personal purposes :)

Ill try __int64 as sir alfredico suggested.

Thanks for your replies.
05/11/2016 12:46 jeromerz#7
Quote:
Originally Posted by Avalion View Post
Dword is unsigned long which is 32bit unsigned integer on x86 compiles. Aka unsigned int size. To increase hp you'll need to check the casts and change instances of the variables used to _Int64. Casts and other things probably check to see if the monster or player actually dies and goes below that hp threshold

Also why not trying to balance your server without requiring a monster with that much hp. Lower hp fields and damage outputs. You don't really need to increase the storage type.

Sent from my SGH-I337M using Tapatalk
Thank you sir i was just trying that :) i wonder what are the other functions on propmover.txt like purpose of abrasion, hardness and etc.
05/11/2016 13:11 Mognakor#8
Quote:
Originally Posted by jeromerz View Post
Thank you sir i was just trying that :) i wonder what are the other functions on propmover.txt like purpose of abrasion, hardness and etc.
Flyff is full of attributes that don't do anything.

Maybe the biggest example is items being skills and viceversa (they use the same struct to be stored).

IIRC skills use 1/3 or less of item attributes. And even though propSkill and prop/SpecItem are loaded via 2 different function, propSkill has 2/3 unused columns and 1/3 used ones.


P.S:

You can use those columns to implement lots of new features without adding new columns to your resource files.
05/11/2016 14:00 jeromerz#9
Quote:
Originally Posted by Mognakor View Post
Flyff is full of attributes that don't do anything.

Maybe the biggest example is items being skills and viceversa (they use the same struct to be stored).

IIRC skills use 1/3 or less of item attributes. And even though propSkill and prop/SpecItem are loaded via 2 different function, propSkill has 2/3 unused columns and 1/3 used ones.


P.S:

You can use those columns to implement lots of new features without adding new columns to your resource files.
Ok sir :D thank you for all your tips and guide :)