Armor And Un Armored Same Damage

Welcome in the osRose emulator Project.

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

Armor And Un Armored Same Damage

Postby rave on Fri Apr 27, 2012 5:34 am

Hi I Just Noticed ( Example )

If I Wear My Armor +15 And Def 11k
i receive damage 5k

If I Unequipped The Armor And Def Is 6k
i receive damage 5k also

stats are same and others

question how come i still receive same damage if i dont wear and wear armors this effects to all sets even on a visitor set.. will do exactly same visitor on and off gives same damage BUT not same 5k anymore but still same damage...

any fix with this?
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Armor And Un Armored Same Damage

Postby Vetyst on Fri Apr 27, 2012 8:31 am

a possible solution for this is, when you unequip any Def based item, the server won't send any packets of the user damage, i will take a check on it my self :P
User avatar
Vetyst
osRose dev
osRose dev
 
Posts: 146
Joined: Sat Jun 18, 2011 10:56 am
Location: The Netherlands

Re: Armor And Un Armored Same Damage

Postby Vetyst on Sat Apr 28, 2012 9:27 pm

Haha, i forgot..

The battle formulas are messed up :), its a common bug in all the private servers which have non skilled Developers.

Just try and kill a Jelly bean at level 1. you keep hitting it around the 5-7 and with critical a maximum of 10 damage..

And so the Magic power of everyone is over powered. you can try and make some new formulas in the battle.cpp - CCharacter::UseAtkSkill - function

-Vetyst
User avatar
Vetyst
osRose dev
osRose dev
 
Posts: 146
Joined: Sat Jun 18, 2011 10:56 am
Location: The Netherlands

Re: Armor And Un Armored Same Damage

Postby rave on Wed May 02, 2012 12:47 am

oh i already fixed this thanks lol :)
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Armor And Un Armored Same Damage

Postby IamLegend on Fri Apr 18, 2014 6:45 am

anybody knows how to fix this?
IamLegend
Jelly Bean
Jelly Bean
 
Posts: 10
Joined: Tue Mar 11, 2014 3:04 am

Re: Armor And Un Armored Same Damage

Postby PurpleYouko on Fri Apr 18, 2014 2:20 pm

yup

Rewrite the combat formulas in battle.cpp.
I'm betting that they don't correctly account for armor.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Armor And Un Armored Same Damage

Postby hoegarden31 on Fri Apr 18, 2014 6:35 pm

Vetyst wrote:Haha, i forgot..

The battle formulas are messed up :), its a common bug in all the private servers which have non skilled Developers.

Just try and kill a Jelly bean at level 1. you keep hitting it around the 5-7 and with critical a maximum of 10 damage..

And so the Magic power of everyone is over powered. you can try and make some new formulas in the battle.cpp - CCharacter::UseAtkSkill - function

-Vetyst


So you just basically tell that every other developer must re-invent the wheel instead of sharing once and for all the fix for that bug ?
If you have a solution then just give it to the people who need it. If it is that common, why isn't there a fix for that in the Submit code section ?
Or maybe you expect 5$ in order to give it to one person :p
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: Armor And Un Armored Same Damage

Postby IamLegend on Wed May 07, 2014 4:31 am

sir what part in battle.cpp will i edit? i tried editing this part

attack = Stats->Attack_Power * levelmult * atkdefmult / constant;
if(Enemy->IsPlayer());
{
if (attack >1400);

i changed 1400 to 1600 to 1800 still not working >.<
Attachments
battle (1).cpp
(67.17 KiB) Downloaded 380 times
IamLegend
Jelly Bean
Jelly Bean
 
Posts: 10
Joined: Tue Mar 11, 2014 3:04 am

Re: Armor And Un Armored Same Damage

Postby PurpleYouko on Wed May 07, 2014 2:41 pm

First of all, what server does that come from?
I don't recognize any of that code.

here's the bit of code that you were messing with
  1. attack = Stats->Attack_Power * levelmult * atkdefmult / constant;
  2.     if(Enemy->IsPlayer());
  3.     {
  4.      if (attack >1400);
  5.      {
  6.         attack *= 0.50;
  7.      }
  8.     }

looks completely different when you include the whole thing doesn't it? ;)
Anyway this is not the right place to be messing with.
This bit of code checks if enemy is a player and if it is AND your current attack is greater than 1400 it ADDs another 50% so your 1400 becomes 2100.
I don't quite see the point in this at all. Seems a bit of a weird thing to do.

look at the bit of code just before that
  1.  
  2. if(Stats->MagicAttack == 1)
  3.     {
  4.       atkdefmult = (float) (Stats->Attack_Power) / (Enemy->Stats->Magic_Defense+Enemy->Stats->Defense);
  5.       atkdefmult -= 3.2;
  6.     }
  7.     else
  8.     {
  9.       atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Defense);
  10.     }
  11.     attack = Stats->Attack_Power * levelmult * atkdefmult / constant;
  12.  

That's where it actually applies armor to the attack formula
As far as I can see though it is all kinds of wrong.....
for one thing it's giving magic defence PLUS ordinary defense if the attack is magic. That is utter crap. It should be ONLY magic defense
then it arbitrarily subtracts 3.2. WTF??? :?
the line of code that calculates normal defense is this one
  1. atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Defense);

so your multiplier is your attack DIVIDED by enemy defense.
Trouble is that if your attack is greater than his defense then atkdefmult becomes greater than 1 which is utter bollocks.
Example:
your attack = 100
enemy defense = 50
atkdefmult = 100/50 = 2
therefore damage done is 200. Double your attack power. Yes it will be moderated by dividing by that constant (defined as 5.5) but still...... What a shitty formula :(

atkdefmult needs to be returned as a percentage, not as a free running number with no limits

try replacing that chunk of code with this
  1. //calculate damage
  2.         if(Stats->magicattack == 1) //magic attacks such as wands and some monsters
  3.         {
  4.             unsigned int totalpower = Stats->Attack_Power + Enemy->Stats->Magic_Defense;
  5.             double hitmod = Stats->Attack_Power * 100 / totalpower + Stats->Level; //percentage of hitpower to use * 100
  6.             hitpower = (unsigned int)floor((double)(hitmod * Stats->Attack_Power / 100));
  7.         }
  8.         else
  9.         {
  10.             unsigned int totalpower = Stats->Attack_Power + Enemy->Stats->Defense;
  11.             double hitmod = Stats->Attack_Power * 100 / totalpower + Stats->Level; //percentage of hitpower to use * 100
  12.             hitpower = (unsigned int)floor((double)(Stats->Attack_Power * hitmod / 100));
  13.             //Log(MSG_DEBUG,"Normal Attack: AP %i DEF %i",Stats->Attack_Power,Enemy->Stats->Defense);
  14.             //Log(MSG_DEBUG,"Normal Attack: hit total %i hitmod %f hit power %i",totalpower,hitmod,hitpower);
  15.         }
  16.         //add some randomness. + or - 5% of hitpower
  17.         int min = (int)floor((double)(hitpower * 0.85));
  18.         int max = (int)floor((double)(hitpower * 1.15));
  19.         int dif = max - min;
  20.         int mod = GServer->RandNumber( 0, dif );
  21.         hitpower = min + mod;

That will give you a percentage formula that can never result in hitpower ending up stronger than it started.
Even better, just grab the KTRose server (that's where this snippet came from) and steal code that actually works from it then just tweak it a little to get precisely what you want. :lol:
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm


Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 10 guests