Author Topic: Faking skill check roll feedback  (Read 305 times)

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Faking skill check roll feedback
« on: June 08, 2015, 09:36:27 am »


               

I want to make a skill check with d10 dice. But I want the same feedback to player, matching with format and colors with how it looks like when used vanilla function.


 


I assume lots of you guys surely did this kind of stuff. Could spare me some time if you would share the code with me, anyone?



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Faking skill check roll feedback
« Reply #1 on: June 08, 2015, 03:43:16 pm »


               

I was going to link you here but it appears that skill is missing. It is slightly darker than the color for cold damage.



               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Faking skill check roll feedback
« Reply #2 on: June 08, 2015, 10:29:05 pm »


               

My hr base has it just change it to d10 instead of d20 look in the x3_inc_string for colors to the function. The custom function is called HR_SkillCheckSuccessful in hr_inc_master. There a lot of custom stuff related to custom skills you can just rip out.
http://neverwinterva...her/hr-base-975



               
               

               
            

Legacy_an ominous cow herd

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Faking skill check roll feedback
« Reply #3 on: June 13, 2015, 07:26:17 pm »


               

I made a function for doing ability score checks with combat log feedback similar to skill checks. The colors might not be exact, but they are close.



//------------------------------------------------------------------------------
// Ability Check Roll vs. DC
//------------------------------------------------------------------------------

int GetIsAbilitySuccessful(object oTarget, int nAbility, int nDifficulty, int nHideRoll = FALSE)
{
    int nRoll = d20();
    int nMod = GetAbilityModifier(nAbility, oTarget);
    int nTotal = nRoll + nMod;


    // determine if check succeeds
    int nResult;
    // 1 is automatic fail, 20 is automatic success
    if (nRoll == 1) nResult = FALSE;
    else if (nRoll == 20) nResult = TRUE;
    else nResult = nTotal >= nDifficulty;

    // display the roll in combat log if PC
    if (GetIsPC(oTarget) && !nHideRoll)
    {
        string sAbility;
        switch (nAbility)
        {
            case ABILITY_STRENGTH: sAbility = "Strength"; break;
            case ABILITY_DEXTERITY: sAbility = "Dexterity"; break;
            case ABILITY_CONSTITUTION: sAbility = "Constitution"; break;
            case ABILITY_INTELLIGENCE: sAbility = "Intelligence"; break;
            case ABILITY_WISDOM: sAbility = "Wisdom"; break;
            case ABILITY_CHARISMA: sAbility = "Charisma"; break;
        }

        string sMsg = StringToRGBString(GetName(oTarget), "477") + StringToRGBString(" : " + sAbility + " : *" + (nResult ? "success" : "failure") + "* : (" + IntToString(nRoll) + " " + ((nMod > 0) ? "+" : "") + IntToString(nMod) + " = " + IntToString(nTotal) + " vs. DC: " + IntToString(nDifficulty) + ")", "026");

        SendMessageToPC(oTarget, sMsg);
    }
   
    return nResult;
}