that isn't really possible.
Every server version has slightly different code and formulas. Some even have different variable names so we can't just take one file and put it into a different server and expect it to compile properly.
As i don't know what exact server version you are using but we are in the OsRose Emulator sub-forum, I will show you how it works in dev rev 3
This code will be found near the top of function
void CCharacter::NormalAttack( CCharacter* Enemy )-
- float levelmult = (float) Stats->Level / Enemy->Stats->Level;
- if(levelmult > 2)levelmult = 2;
- float atkdefmult = 0;
- float attack = 0;
- float constant = 4;
- if(Stats->MagicAttack == 1)
- {
- atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Magic_Defense);
- }
- else
- {
- atkdefmult = (float) Stats->Attack_Power / (Enemy->Stats->Defense);
- }
- attack = Stats->Attack_Power * levelmult * atkdefmult / constant;
-
- if(attack < 5) attack = 5;
- float d_attack = attack / 100;
- float mod = GServer->RandNumber( 0, 10 ) * d_attack;
- attack += mod;
- 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));
-
- if(IsPlayer())//Add Dmg
- {
- if( Stats->ExtraDamage_add !=0 )
- {
- long int hitsave=hitpower;
- hitpower += ((hitpower * Stats->ExtraDamage_add) / 100);
- if(GServer->ServerDebug)
- Log(MSG_INFO,"ExtraDmg Normal atk: before %i, after %i (ED: %i)",hitsave,hitpower,Stats->ExtraDamage_add);
- }
- }
It should be fairly easy to follow the math.
hitpower is the variable in which we store the damage that will be done to the enemy
As you may notice, this code works for both monsters attacking players and for players attacking monsters. Both players and Monsters are part of the
CCharacter class so we can use it in either direction.
The simplest way (not necessarily the best way) of changing the amount of damage done by players and monsters is to adjust
GServer->Config.PlayerDmg and
GServer->Config.MonsterDmg. These can be set in the database table
list_configIf that doesn't work then you will have to look through the math and change a few things then recompile it and test. Getting it just right is quite tricky.