diff --git a/Changelog.txt b/Changelog.txt index b87a946fc..03f2c846f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4120,3 +4120,7 @@ When setting a property like MORE to the a spell or skill defname, trying to rea - Fixed: Hit chance to paralyzed targets with sphere custom (0) formula is now 80-100% (was 0-10%). - Added: Implemented Hit chance increase / decrease to sphere custom formula (0). - Fixed: Equiping armor and weapon with spelleffect could crash the SphereServer (#1538) + +24-03-2026, canerksk + - Added: Optional third parameter to SKILLCHECK to control bell curve usage (true/false). + - Changed: SKILLCHECK now allows disabling bell curve for linear skill success checks. diff --git a/src/game/chars/CChar.cpp b/src/game/chars/CChar.cpp index cb55c579a..2b0f4d69e 100644 --- a/src/game/chars/CChar.cpp +++ b/src/game/chars/CChar.cpp @@ -2658,18 +2658,33 @@ bool CChar::r_WriteVal( lpctstr ptcKey, CSString & sVal, CTextConsole * pSrc, bo return true; } case CHC_SKILLCHECK: // odd way to get skills checking into the triggers. - ptcKey += 10; - SKIP_SEPARATORS(ptcKey); - { - tchar * ppArgs[2]; - if ( !Str_ParseCmds(const_cast(ptcKey), ppArgs, ARRAY_COUNT(ppArgs)) ) - return false; - SKILL_TYPE iSkill = g_Cfg.FindSkillKey( ppArgs[0] ); - if ( iSkill == SKILL_NONE ) - return false; - sVal.FormatVal( Skill_CheckSuccess( iSkill, Exp_GetVal( ppArgs[1] ))); - } - return true; + { + ptcKey += 10; + SKIP_SEPARATORS(ptcKey); + + tchar* ppArgs[3] = { nullptr }; + + if ( !Str_ParseCmds(const_cast(ptcKey), ppArgs, ARRAY_COUNT(ppArgs)) ) + return false; + + // skill + SKILL_TYPE iSkill = g_Cfg.FindSkillKey(ppArgs[0]); + if ( iSkill == SKILL_NONE ) + return false; + + // difficulty (safe) + int iDiff = 0; + if ( ppArgs[1] && *ppArgs[1] ) + iDiff = Exp_GetVal(ppArgs[1]); + + // bell curve (default = true) + bool fUseBellCurve = true; + if ( ppArgs[2] && *ppArgs[2] ) + fUseBellCurve = (Exp_GetVal(ppArgs[2]) != 0); + + sVal.FormatVal( Skill_CheckSuccess(iSkill, iDiff, fUseBellCurve) ); + return true; + } case CHC_SKILLADJUSTED: ptcKey += 13; SKIP_SEPARATORS(ptcKey);