Page 1 of 1

[Dev Rev II] Level Bug Fix

PostPosted: Fri Nov 12, 2010 4:42 pm
by will1023631
Good day. The level bug has been a huge nuisance for some time Though we have resolved the issue completely. Just to recap the level bug caused a player to do reduced skill damage when attacking a mob that was within a specific range above a player. But below is a simple fix :-P. Just added in an extra check and attack formula adjustment

This code:

  1.  
  2. if(Enemy->IsMonster() && skill->formula !=0)
  3.      {
  4.          if(level_diff >= 1)
  5.          {
  6.              skillpower += Stats->Attack_Power * (level_diff / 5) + (level_diff*2);
  7.          }
  8.          else
  9.          {
  10.              skillpower += Stats->Attack_Power - (level_diff / 2);
  11.          }
  12.      }
  13.  


Should be replaced with this:

  1.  
  2. if(Enemy->IsMonster() && skill->formula !=0)
  3. {
  4.         if(level_diff >= 5)
  5.          {
  6.              skillpower += Stats->Attack_Power * (level_diff / 5) + (level_diff*2);
  7.          }
  8.          else if (level_diff < 5 && level_diff > 0)
  9.      {
  10.          skillpower += Stats->Attack_Power - Stats->Attack_Power*(level_diff / 5);
  11.      }
  12.      else if (level_diff <= 0)
  13.          {
  14.              skillpower += Stats->Attack_Power - (level_diff / 2);
  15.          }
  16.      }
  17.  


As you may notice we added

  1.  
  2. else if (level_diff < 5 && level_diff > 0)
  3.      {
  4.          skillpower += Stats->Attack_Power - Stats->Attack_Power*(level_diff / 5);
  5.      }
  6.  


This is because in the original code if the level diff was less than 5 you would do a fraction of your damage. Eg if you have a level diff of 1 you would do 1/5 th your original damage

Re: [Dev Rev II] Level Bug Fix

PostPosted: Fri Nov 12, 2010 5:51 pm
by Choseal
That's great!

I'll mark my report as solved if this works:
viewtopic.php?f=30&t=4486

Re: [Dev Rev II] Level Bug Fix

PostPosted: Fri Nov 12, 2010 6:54 pm
by will1023631
Lol thanks forgot to add that the segment of code that needs replacing can be found in battle.cpp :-P

Re: [Dev Rev II] Level Bug Fix

PostPosted: Sat Nov 13, 2010 12:07 pm
by lmame
Added to dev rev II-303 if someones want to test ;)

Thanks for sharing :)