Jump to content
  • 0

fixing hp/sp/hit/flee bonuses


mediodia

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  1
  • Reputation:   0
  • Joined:  11/12/13
  • Last Seen:  

hi guys, i want to change my server's src so the users wont gain hp/sp/hit/flee bonuses when they go over lvl 99 (my server's max lvl is 150)

 

i know this was possible to do in eathena emulators, but ive switched to rathena and i dont know well how to do it now, im sure its in this part of status.c:

void status_calc_misc(struct block_list *bl, struct status_data *status, int level)
{
   int stat;
   // Non players get the value set, players need to stack with previous bonuses.
   if( bl->type != BL_PC )
      status->batk =
      status->hit = status->flee =
      status->def2 = status->mdef2 =
      status->cri = status->flee2 = 0;

#ifdef RENEWAL // Renewal formulas
   if (bl->type == BL_MOB) {
      //Hit
      stat = status->hit;
      stat += level + status->dex + 175;
      status->hit = cap_value(stat,1,SHRT_MAX);
      //Flee
      stat = status->flee;
      stat += level + status->agi + 100;
      status->flee = cap_value(stat,1,SHRT_MAX);
   } else if (bl->type == BL_HOM) {
      status->hit = cap_value(level + status->dex + 150,1,SHRT_MAX); // base level + dex + 150
      status->flee = cap_value(level + status->agi + level/10,1,SHRT_MAX); // base level + agi + base level/10
   } else {
      //Hit
      stat = status->hit;
      stat += level + status->dex + status->luk/3 + 175; // base level + ( every 1 dex = +1 hit ) + (every 3 luk = +1 hit) + 175
      status->hit = cap_value(stat,1,SHRT_MAX);
      //Flee
      stat = status->flee;
      stat += level + status->agi + status->luk/5 + 100; // base level + ( every 1 agi = +1 flee ) + (every 5 luk = +1 flee) + 100
      status->flee = cap_value(stat,1,SHRT_MAX);
   }

this part in eathena was really easy, but now i dont understand it, hope you guys can help me :)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

add level checking before executing those lines. /heh

 

btw, the code you posted is incomplete.

Edited by Eat Sleep Dota
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...