dmg bug fixing attempt

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

dmg bug fixing attempt

Postby Aukemon0NL on Thu Jun 09, 2011 8:13 pm

It seems to be here for some time and nobody fixed it, yet,

I made some edits in the calculation and it seems to have effect, atleast it has on the lower levels.
If somebody can try it on higher levels.

The battle.ccp I use:
http://pastebin.com/imKEXac5
Image
User avatar
Aukemon0NL
Pomic
Pomic
 
Posts: 107
Joined: Fri May 16, 2008 8:53 pm
Location: The Netherlands

Re: dmg bug fixing attempt

Postby Circa on Sun Jun 12, 2011 2:47 am

What exactly did you change? might of wanted to point where the changes were made? or you probably did on the link :P
Circa
Clown
Clown
 
Posts: 404
Joined: Sun Aug 23, 2009 5:52 am
Location: CA

Re: dmg bug fixing attempt

Postby Aukemon0NL on Sun Jun 12, 2011 2:01 pm

I don't remember, did it some time ago...

I forgot to add tags what I changed...
I just went ahead and changed stuff, done this about 1 to 2 months ago (fail)
Image
User avatar
Aukemon0NL
Pomic
Pomic
 
Posts: 107
Joined: Fri May 16, 2008 8:53 pm
Location: The Netherlands

Re: dmg bug fixing attempt

Postby SherwinEly on Sun Jun 12, 2011 3:53 pm

this is a nice release but the attack is so low
SherwinEly
Pomic
Pomic
 
Posts: 123
Joined: Mon Nov 17, 2008 6:36 am

Re: dmg bug fixing attempt

Postby Aukemon0NL on Sun Jun 12, 2011 11:59 pm

what u mean? with the attack is so low?
You hit lower than u normally would?
Image
User avatar
Aukemon0NL
Pomic
Pomic
 
Posts: 107
Joined: Fri May 16, 2008 8:53 pm
Location: The Netherlands

Re: dmg bug fixing attempt

Postby SherwinEly on Mon Jun 13, 2011 12:01 am

hit the beans like less than 15
SherwinEly
Pomic
Pomic
 
Posts: 123
Joined: Mon Nov 17, 2008 6:36 am

Re: dmg bug fixing attempt

Postby Aukemon0NL on Mon Jun 13, 2011 12:29 am

that should be normal you hit on level 1 like 6 to 40

EDIT:
the previous code still didn't do the Job correctly so here is the new one:
http://pastebin.com/fqj3pek6

This one should really increase the randomness of your hits.
I would also use the following in MySQL list_config:
Player Damage: 146
Monster Damage: 73
Image
User avatar
Aukemon0NL
Pomic
Pomic
 
Posts: 107
Joined: Fri May 16, 2008 8:53 pm
Location: The Netherlands

Re: dmg bug fixing attempt

Postby Planetary_Myth on Wed Jun 29, 2011 7:31 pm

Link below for split damage and if you dont want to go through that much changes then use code below the link.

http://forum.dev-osrose.com/viewtopic.php?f=21&t=4510

Same file your editing.
Note: Magic will do odd damage that is why it was split in the link above.
  1. // do normal attack
  2.  
  3. void CCharacter::NormalAttack( CCharacter* Enemy )
  4.  
  5. {
  6.  
  7.     //LMA: Sometimes it's fired several times, no need to kill several times ;)
  8.  
  9.     bool is_already_dead=Enemy->IsDead();
  10.  
  11.  
  12.  
  13.     Position->destiny = Position->current;
  14.  
  15.  
  16.  
  17.     //LMA: Log
  18.  
  19.     if(IsPlayer())
  20.  
  21.         Log(MSG_INFO,"Forcing destiny to current (%.2f,%.2f), (%.2f,%.2f)",Position->current.x,Position->current.y,Position->destiny .x,Position->destiny .y);
  22.  
  23.  
  24.  
  25.     reduceItemsLifeSpan( false );
  26.  
  27.     Enemy->OnBeAttacked( this );
  28.  
  29.     int attack = 0;
  30.  
  31.     int LvlDiff = 0;
  32.  
  33.  
  34.  
  35.     int LvlBonus = (Stats->Level / 10) - 1;
  36.  
  37.     Log(MSG_INFO,"Lvl Bonus %i,%i",LvlBonus,Stats->Level);
  38.  
  39.     if(LvlBonus < 0) {LvlBonus = 0;}
  40.  
  41.     else if(LvlBonus > 13) {LvlBonus = 13;}
  42.  
  43.  
  44.  
  45.     int Lvldiff = (Stats->Level - LvlBonus) - (LvlBonus + Enemy->Stats->Level) + 15;
  46.  
  47.     Log(MSG_INFO,"Lvl diff %i,%i,%i,%i",Lvldiff,Stats->Level,LvlBonus,Enemy->Stats->Level);
  48.  
  49.    
  50.  
  51.     if(Lvldiff > 15)
  52.  
  53.     {
  54.  
  55.     Lvldiff = 15;
  56.  
  57.     Log(MSG_INFO,"Lvl diff max %i",Lvldiff);
  58.  
  59.     }
  60.  
  61.     else if(Lvldiff < 2)
  62.  
  63.     {
  64.  
  65.     Lvldiff = 2;
  66.  
  67.     Log(MSG_INFO,"Lvl diff min %i",Lvldiff);
  68.  
  69.     }
  70.  
  71.  
  72.     attack = Stats->Attack_Power - (Enemy->Stats->Defense / Lvldiff);
  73.  
  74.     Log(MSG_INFO,"NormalAtt %i,%i,%i,%i",attack,Stats->Attack_Power,Enemy->Stats->Defense,Lvldiff);
  75.  
  76.  
  77.  
  78.     if(attack<0) attack = 5;
  79.  
  80.     LvlDiff = (Stats->Level - Enemy->Stats->Level) / 4;
  81.  
  82.     if(LvlDiff<7) LvlDiff = 4;
  83.  
  84.     attack += GServer->RandNumber( 0, LvlDiff );
  85.  
  86.     long int hitpower = (long int)floor (attack);
  87.  
  88.     if(IsPlayer( )) //temp fix to find balance btw monster and player
  89.  
  90.         hitpower = (long int)floor(attack * (GServer->Config.PlayerDmg/100.00));
  91.  
  92.     if(IsMonster( )) //temp fix to find balance btw monster and player
  93.  
  94.         hitpower = (long int)floor(attack * (GServer->Config.MonsterDmg/100.00));
Planetary_Myth
Smoulie
Smoulie
 
Posts: 49
Joined: Sun Apr 18, 2010 2:50 pm

Re: dmg bug fixing attempt

Postby XxXshidoXxX on Fri May 10, 2013 9:22 pm

I think its still a bit shaky at higher levels but from 1 to 80 it looks ok from what i've tested.

Btw Aukemon0NL aren't you the one that used to have a weird cat as a ragezone avatar ? Dunno why but i still remember his face to this day.
My collection ( Tools, clients sources...)
https://mega.nz/#F!AdcFnQDL!sKp3O9tWGGdWvLEj_EYfwA
osrose mobile project
viewtopic.php?f=34&t=5787
OsRose Mobile development + Titan Rose redesign
https://github.com/shid0x
XxXshidoXxX
osiRose dev
osiRose dev
 
Posts: 445
Joined: Mon Aug 27, 2007 11:44 am


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 2 guests