- // do normal attack
- void CCharacter::NormalAttack( CCharacter* Enemy )
- {
- //LMA: Sometimes it's fired several times, no need to kill several times ;)
- bool is_already_dead=Enemy->IsDead();
- Position->destiny = Position->current;
- //LMA: Log
- if(IsPlayer())
- Log(MSG_INFO,"Forcing destiny to current (%.2f,%.2f), (%.2f,%.2f)",Position->current.x,Position->current.y,Position->destiny .x,Position->destiny .y);
- reduceItemsLifeSpan( false );
- Enemy->OnBeAttacked( this );
- int attack = 0;
- int LvlDiff = 0;
- int LvlBonus = (Stats->Level / 10) - 1;
- Log(MSG_INFO,"Lvl Bonus %i,%i",LvlBonus,Stats->Level);
- if(LvlBonus < 0) {LvlBonus = 0;}
- else if(LvlBonus > 13) {LvlBonus = 13;}
- int Lvldiff = (Stats->Level - LvlBonus) - (LvlBonus + Enemy->Stats->Level) + 15;
- Log(MSG_INFO,"Lvl diff %i,%i,%i,%i",Lvldiff,Stats->Level,LvlBonus,Enemy->Stats->Level);
- if(Lvldiff > 15)
- {
- Lvldiff = 15;
- Log(MSG_INFO,"Lvl diff max %i",Lvldiff);
- }
- else if(Lvldiff < 2)
- {
- Lvldiff = 2;
- Log(MSG_INFO,"Lvl diff min %i",Lvldiff);
- }
- attack = Stats->Attack_Power - (Enemy->Stats->Defense / Lvldiff);
- Log(MSG_INFO,"NormalAtt %i,%i,%i,%i",attack,Stats->Attack_Power,Enemy->Stats->Defense,Lvldiff);
- if(attack<0) attack = 5;
- LvlDiff = (Stats->Level - Enemy->Stats->Level) / 4;
- if(LvlDiff<7) LvlDiff = 4;
- attack += GServer->RandNumber( 0, LvlDiff );
- long int hitpower = (long int)floor (attack);
- if(IsPlayer( )) //temp fix to find balance btw monster and player
- hitpower = (long int)floor(attack * (GServer->Config.PlayerDmg/100.00));
- if(IsMonster( )) //temp fix to find balance btw monster and player
- hitpower = (long int)floor(attack * (GServer->Config.MonsterDmg/100.00));
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