Dark_Force9999
New Adventurer
- Joined
- Jul 3, 2007
- Messages
- 267
- Reaction score
- 0
Character - 2 Awareness, level 1 Parry, x2 Large Iron Shield. I'm guessing this other char has 11.4% of parrying?
CBaseEntity *pAttacker = Damage.pAttacker;
if( IsAlive( ) && pAttacker && pAttacker->IsMSMonster() )
{
CMSMonster *pMonster = (CMSMonster *)pAttacker;
int ParryValue = GetSkillStat( "parry", STATPROP_SKILL );
int AccRoll = RANDOM_LONG(Damage.AccuracyRoll,100), ParryRoll = RANDOM_LONG(0,ParryValue);
//Using a weapon that can parry (shield, some swords) gives a parry bonus
int iAttackNum = 0, iHand = 0;;
CGenericItem *pHandItem = FindParryWeapon( this, iHand, iAttackNum );
if( pHandItem )
{
attackdata_t *pAttack = &pHandItem->m_Attacks[iAttackNum];
ParryRoll *= 1 + (pAttack->flAccuracyDefault / 100.f); //If 100% bonus, the roll gets multiplied by 2
}
//Awareness gives a small parry bonus
ParryRoll += GetNatStat( NATURAL_AWR );
//Thothie - do not parry certain damage types
msstring thoth_dmgtype = Damage.sDamageType;
if ( thoth_dmgtype.starts_with("target") ) ParryRoll = 0;
if ( thoth_dmgtype.starts_with("fire") ) ParryRoll = 0;
if ( thoth_dmgtype.starts_with("poison") ) ParryRoll = 0;
if ( thoth_dmgtype.starts_with("lightning") ) ParryRoll = 0;
if ( thoth_dmgtype.starts_with("cold") ) ParryRoll = 0;
if ( thoth_dmgtype.starts_with("magic") ) ParryRoll = 0;
if ( Damage.flDamage == 0 ) ParryRoll = 0; //do not parry 0 damage atks
if ( ParryRoll > 90 ) ParryRoll = 90; //always allow at least 10% chance to be hit
if( ParryRoll > AccRoll )
{
//thothie attemptig to pass parry vars
msstringlist ParametersB;
ParametersB.add( pAttacker ? EntToString( pAttacker ) : "none" );
ParametersB.add( UTIL_VarArgs("%f",Damage.flDamage) );
ParametersB.add( Damage.sDamageType );
ParametersB.add( UTIL_VarArgs("%i",ParryRoll) );
ParametersB.add( UTIL_VarArgs("%i",AccRoll) );
CallScriptEvent( "game_parry", &ParametersB );
if( pHandItem ) pHandItem->CallScriptEvent( "game_parry", &ParametersB );
Damage.flDamage = -1; // -1 means the monster dodged the attack
ClearMultiDamage( );
//Learn parry skill from a successful parry
if( !pAttacker->IsPlayer() ) //Can't learn from being attacked by players
if (pMonster->m_SkillLevel * 2 > 0)
LearnSkill (SKILL_PARRY, STATPROP_SKILL, pMonster->m_SkillLevel * 2 );
else
LearnSkill (SKILL_PARRY, STATPROP_SKILL, 0 );
//LearnSkill( SKILL_PARRY, STATPROP_SKILL, max(pAttacker->m_SkillLevel * 2,0) );
}
}
Thothie said:Skeletons tend to work well, simply because they swing so fast and come in such a wide range of flavors.
ITS'aME'aMARIO!!!! said:so having a shield equipped gives a better parry roll?
Er - it's a shield, you parry with it, tis what it is for, it is very intentional - it's the only real function the shields ever had before I added damage reduct - although there was an attempt to make them bash on a secondary charge that never worked right.Evaan said:ITS'aME'aMARIO!!!! said:so having a shield equipped gives a better parry roll?
Think of it as entering a defensive stance.
If it was intentional or not, I do not know.
Thothie said:Riposté would be something exclusive to weapons and not done by shields, is mayhaps what you are thinking.