My friends and I found night elves evasion working in not appropriate way...
First shot is always not evaded, so do shots from pistols.
So now it works for every shot and only glowing/messaging now depends on last shot time.
We tested it on home server only, but tommorow we are testing this on professional one so ill post here results.
You can do same.
Here is code which we change to make evasion work better:
race_elf.inl:
Code: Select all
NE_Evasion( id, iHitZone )
{
static iSkillLevel;
// Check to see if they should evade this shot?
iSkillLevel = SM_GetSkillLevel( id, SKILL_EVASION );
//Some random mechanism a bit changed when experimenting;
//This doesnt matter values are like always
if (!p_data_b[id][PB_HEXED] && iSkillLevel > 0 && random_num( 1, 100 ) <= p_evasion[iSkillLevel-1] * 100 )
{
// HERE
// I dont know where def for this proc stored so
// i made global var in constants.inl
// Ofcource its much better to take this (NE_lastshot) as parameter of proc;
// look events.inl code below
if (NE_lastshot[id] < 0.1 && NE_lastshot[id] > 0.0)
{
//Message player about evasion
//This came from events.inl
WC3_StatusText( id, TXT_SKILL, "You have evaded a shot!" );
new iGlowIntensity = random_num( 20, 50 );
// Head shot
if ( iHitZone & (1 << HITGROUP_HEAD) )
{
iGlowIntensity += 250;
}
// Chest
else if ( iHitZone & (1 << HITGROUP_CHEST) )
{
iGlowIntensity += 75;
}
// Make the user glow!
SHARED_Glow( id, 0, 0, iGlowIntensity, 0 );
Create_ScreenFade( id, (1<<10), (1<<10), (1<<12), 0, 0, 255, g_GlowLevel[id][2] );
}
return 1;
}
return 0;
Code: Select all
//This var is new and must go away when proc param tweaked
new Float: NE_lastshot[33];
in TRIGGER_TraceLine proc:
Code: Select all
// Check to see if this user has night elf's evasion
if ( SM_GetSkillLevel( iVictim, SKILL_EVASION ) > 0 )
{
// Do the check to see if we should "evade" this shot
new Float:fTime = halflife_time();
new Float:fDifference = fTime - fLastShotFired[iAttacker];
//Here we save this value into var; but better would be to give it to NE_Evasion later
NE_lastshot[iVictim] = fDifference;
//Here we make to check every time now
if ( SHARED_ValidPlayer( iAttacker ))// && fDifference < 0.1 && fDifference > 0.0 )
{
// Friendly fire is off! - This means we shouldn't evade since no damage will be done!
if ( !get_pcvar_num( CVAR_mp_friendlyfire ) )
{
if ( g_iPlayerTeam[iAttacker] == g_iPlayerTeam[iVictim] )
{
return FMRES_IGNORED;
}
}
// Then we should evade this shot!
// Here to modify param
if ( NE_Evasion( iVictim, iHitZone ) )
{
set_tr( TR_flFraction, 1.0 );
//WC3_StatusText( iVictim, TXT_SKILL, "You have evaded a shot!");
//This gone to race_elf.inl
return FMRES_SUPERCEDE;
}
}
}
Regards.
UPD:
I found that as a partially solving problem of bug #117
As i understand, evasion must depend on aiming cause after shot done its too late.
So knives shots can be done without aiming on enemy thats a problem.
And HE damage is more harder to do with...
And we increased evasion values a bit, yes

