Skip to content

Skill roll based on highest skill in party

philbophilbo Member Posts: 19
What is the most efficient way to roll a skill check from a conversation that automatically uses the skill level of the party member with the highest skill?

For example the player has 2 henchmen. Henchman A has a much higher Persuade skill than either the PC or Henchman B. From a conversation, the skill level of Henchman A is used during a skill check, as opposed to either PC or Henchman B.

Any guidance would be much appreciated!

Thank you!

Comments

  • DerpCityDerpCity Member, Moderator Posts: 303
    Alright, I'm not sure if this is the most efficient way of doing it, but this Starting Conditional I made gets the highest discipline skill of you and your henchmen and uses it on the following DC 15 Discipline check. Simply modify nDC to what you want and change the skill in the GetSkillRank calls to the one you want. Note that this doesn't check if the skill is supposed to be usable untrained, and also only checks for the speaking PC's henchmen and not other associates or player characters.
    int StartingConditional()
    {
        int nDC = 15;
    
        object oPC = GetPCSpeaker();
    
        int nSkill = GetSkillRank(SKILL_DISCIPLINE, oPC);
        SendMessageToPC(oPC, GetName(oPC) + "'s Skill Rank: " + IntToString(nSkill));
        int nSkillHen;
    
        int nHen = 1;
    
        object oHen = GetHenchman(oPC, nHen);
    
        while (oHen != OBJECT_INVALID)
        {
            nSkillHen = GetSkillRank(SKILL_DISCIPLINE, oHen);
            SendMessageToPC(oPC, GetName(oHen) + "'s Skill Rank: " + IntToString(nSkillHen));
    
            if (nSkillHen > nSkill)
            {
                nSkill = nSkillHen;
            }
    
            nHen = nHen + 1;
    
            oHen = GetHenchman(oPC, nHen);
        }
        SendMessageToPC(oPC, "Best Skill Rank: " + IntToString(nSkill));
    
        int nSkillRoll = d20();
    
        int nSkillCheck = nSkillRoll + nSkill;
        SendMessageToPC(oPC, IntToString(nSkillRoll) + " + " + IntToString(nSkill) + " = " + IntToString(nSkillCheck) + " vs DC " + IntToString(nDC));
    
        if (nSkillCheck >= nDC)
        {
            SendMessageToPC(oPC, "Success");
            return TRUE;
        }
        else
        {
            SendMessageToPC(oPC, "Failure");
        }
        return FALSE;
    }
    
Sign In or Register to comment.