Closed silent-rock closed 4 years ago
While not technically the same as a crit multiplier - the nwnx_damage plugin could adjust the damage to your hearts content, based on the same criteria.
/// @struct NWNX_Damage_AttackEventData /// @brief Attack Event Data struct NWNX_Damage_AttackEventData { object oTarget; ///< The target who took the damage int iBludgeoning; ///< Bludgeoning damage int iPierce; ///< Piercing damage int iSlash; ///< Slashing damage int iMagical; ///< Magical damage int iAcid; ///< Acid damage int iCold; ///< Cold damage int iDivine; ///< Divine damage int iElectrical; ///< Electrical damage int iFire; ///< Fire damage int iNegative; ///< Negative damage int iPositive; ///< Positive damage int iSonic; ///< Sonic damage int iBase; ///< Base damage int iAttackNumber; ///< 1-based index of the attack in current combat round int iAttackResult; ///< 1=hit, 3=critical hit, 4=miss, 8=concealed int iAttackType; ///< 1=main hand, 2=offhand, 3-5=creature, 6=haste int iSneakAttack; ///< 0=neither, 1=sneak attack, 2=death attack, 3=both };
You could catch the attack data, see if it is a critical hit, see if you have the required feat and then adjust the damage to match whatever you want.
Eg: If the players has the FIRE_WEAPON_FEAT (I just made that up) The weapon has fire damage + it is a critical hit, then you double the fire damage etc.
Should be easy. Just an exclusive hook on CNWSCreatureStats::GetCriticalHitMultiplier
, call original, then read additional modifier from POS.
There's also CNWSCreatureStats::GetCriticalHitRoll
for the threat range.
Anyone interested in implementing something like this might well look at how Acaos did it https://github.com/NWNX/nwnx2-linux/tree/master/plugins/weapons approx. 12 years ago.
Maybe a Lua implementation could help as well: https://github.com/jd28/Solstice/blob/develop/src/solstice/rules/weapons.lua#L522-L633
I believe this issue may be closed.
I'm not sure if it's possible, but it would be an awesome feature to have to be able to modify weapon's critical hit multiplier via nwnx_weapon plugin like the Weapon Master's Increased multiplier feat does.