Jump to content
  • 0

Limit MaxHp gained by vit points


EvilPuncker

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

I want that somehow the max hp gained by raising your vit points will be always MaxHp - 1000000, so there is a "gap" left to bonuses, like Tao Gunka Card and buffs

PS: thanks in advance to anyone willing to help me biggrin.png

bump since it got into 2nd page, btw at least the first one is really needed right now :C

malufett tried to help me with this code but it didn't worked :( I hope anyone can help me

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  67
  • Reputation:   23
  • Joined:  11/14/11
  • Last Seen:  

should be:

+vitgain = val * status->vit/100;
+if( (val + vitgain) >= battle_config.max_hp - 1000000 ) vitgap = 1;

val += val * status->vit/100; // +1% per each point of VIT

+if( vitgap ) val = battle_config.max_hp - 1000000;

or you can also try:

static unsigned int status_base_pc_maxhp(struct map_session_data* sd, struct status_data* status)
{
   ...

   return cap_value(val, 0, battle_config.max_hp - 1000000);
}

but it will also "gap" trans/baby class hp bonus/penalty..

Edited by FatalEror
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

thanks FatalEror but none of them worked :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

i think this line would probably answer your problem.

basically it calculates the base HP

then subtracts 1,000,000 hp

checks if it is within the min and max hp supported by the emulator.

all the bonuses will be checked afterwards.

my suggestion is that instead of subtracting a raw 1000000 hp, why not lessen it by %?

for example 20% of max hp

i = sd->status.max_hp + (int)status->max_hp;
+ i = i - i*20/100
status->max_hp = cap_value(i, 0, INT_MAX);

Edited by clydelion
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

not working as intended :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

status.c.patch

try this one. tested it with tao gunka card.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

thanks, works like a charm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

anyway, why not make it by percent of hp? low level characters would most likely have a max HP of 1 most probably with that code.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...