[Dev Rev II] Level Bug Fix

If you want to help us or give some corrections / codes, put it here ;)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Dev Rev II] Level Bug Fix

Postby will1023631 on Fri Nov 12, 2010 4:42 pm

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
Last edited by will1023631 on Fri Nov 12, 2010 6:56 pm, edited 1 time in total.
User avatar
will1023631
Jelly Bean
Jelly Bean
 
Posts: 30
Joined: Thu Jul 01, 2010 7:17 pm

Re: [Dev Rev II] Level Bug Fix

Postby Choseal on Fri Nov 12, 2010 5:51 pm

That's great!

I'll mark my report as solved if this works:
viewtopic.php?f=30&t=4486
Choseal
Electric Ghost
Electric Ghost
 
Posts: 837
Joined: Fri Jan 09, 2009 6:40 pm

Re: [Dev Rev II] Level Bug Fix

Postby will1023631 on Fri Nov 12, 2010 6:54 pm

Lol thanks forgot to add that the segment of code that needs replacing can be found in battle.cpp :-P
User avatar
will1023631
Jelly Bean
Jelly Bean
 
Posts: 30
Joined: Thu Jul 01, 2010 7:17 pm

Re: [Dev Rev II] Level Bug Fix

Postby lmame on Sat Nov 13, 2010 12:07 pm

Added to dev rev II-303 if someones want to test ;)

Thanks for sharing :)
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 7 guests

cron