How to incorporate Appraise skill in script?

I have an NPC that will buy an item for 100g. Is there a standard formula to incorporate the players Appraise skill?

Do you want to make an in-dialogue skill roll so the NPC buys for more or have shop opened by this NPC to change its prices on sold/bought items depending on the skill?

There are inbox scripts for both. See: x2_appraise_easy (and _med, _hard) and x2_am_store.

It is from a conversation. The NPC dialog currently shows “100g for the Fur”. Not sure how to adjust that value in the dialog or in the script. the x2_appraise_easy looks as though it just checks to see if they would sell it for more, but doesn’t really show a ‘formula’ for increasing the buy price based on their skill level. Do I have that right?

edit to add.

Yes, this script facilitates a binary choice. PC needs for it a line where she offers – say – 125 instead of 100. Then rolls to see if NPC agrees. Or there can be few lines, for 125, 150, 200, etc. You can use the _med and _hard script versions for those.

Or do you want the NPC to offer one price already calculated based on the raw skill value / roll?

One price and calculate a change based on their skill level. That’s why I’m asking about a standard formula for something like that.

There is no standard formula. You need to make your own. For example:

// put as action script before NPC's line
void main()
{
    object oPC = GetPCSpeaker();
    int iSkill = GetSkillRank(SKILL_APPRAISE, oPC, FALSE);
    int iPrice = iSkill + 100; // your formula

    SetCustomToken(5555, IntToString(iPrice));
    // in NPC's line:
    // "I can offer <CUSTOM5555> GP for it."
}
1 Like

Perfect NWShacker. I’ll go from there. Thank you!

1 Like