Thanks i will take an further look into it.
The original is divided by 8.0f so that means that it will have this as an blockrate
for 50 dex you have 8.25% block rate Times the propjob blockrate of slayer is total of 9,375 Block rate per 50 dex. And i intend to run an Siege server so player will only have to have 450 dex to get Max Block Rate. Now if i do it may way then they must have 5000Dex to have 75% blockrate
Also i searched for both GetBlockFactor and IsBlocking
I noticed that the GetBlockFactor is used in this function
int CMover::PostCalcGeneric( int nATK, ATTACK_INFO* pInfo )
The IsBlocking function isnt used at all.
I will remove that function to see what the outcome is.
And about the interaction between blockrate and criticalrate
i find it interesting. Maybe i can also use the Hitrate function in it to.
So that if you have more hitrate then the player has blockrate it will bypass the blockrate and still hits.
What do you think of that.
Ok so i have tested it and just as i thought the IsBlocking Function is not in use.
So far this is my code of the GetBlockFactor
PHP Code:
float CMover::GetBlockFactor( CMover* pAttacker, ATTACK_INFO* pInfo )
{
if( IsPlayer() ) //Player Block Rate Calculation
{
//if( pInfo->pDefender->IsPlayer() )
//{
// Calculating the BlockRate of an player
// Block Rate is BLOCKING devided by 100 times the BLOCKING inside PropJob
// Example if an player has 50 dex it will be divided by 100 that is 0.5 that times 1.5 is the BlockRate of an Mercenary total Block rate = 0.75%
// Since the Minimum Block Rate is 10% we start of with that.
// Maximum Block Rate is set to 80% so you cant block everything
float fAdd = 0.0f;
int nBlockmelee;
int nBlockRange;
nBlockmelee = GetParam( DST_BLOCK_MELEE, 0 );
nBlockRange = GetParam( DST_BLOCK_RANGE, 0 );
int nBR = (int) ( ( GetDex() / 100.0f ) * GetJobPropFactor( JOB_PROP_BLOCKING ) + nBlockmelee + nBlockRange );
//If both players are in GuildSiege then reduce the Max Block Rate
if( pInfo->pAttacker->IsPlayer() && pInfo->pDefender->IsPlayer() && GetWorld()->GetID() == WI_WORLD_GUILDWAR )
{
if( nBR > 70 )
{
nBR = 70;
}
}
else
{
if( nBR < 0 )
{
nBR = 0;
}
if( nBR > 80 )
{
nBR = 80;
}
}
int block = xRandom( 100 );
if( nBR < block )
return 1.0f; //Dont Block the Attack
if( nBR > block )
return 0.0f; //Block the Attack
//}
}
return 1.0f;
}
This time i also included the DST_BLOCK_MELEE and DST_BLOCK_RANGE
I have tested this and its working as it should be. If an player has Max BlockRate (80%)
You will see an lot of blocking instead of hits. No matter what level you are and what your DEX/STR/ATK power is.
I find this more balanced. But maybe anyone of you will have different thoughts about it.