GetSkillRank(int, object)

Determines a creature's rank in particular skill.

int GetSkillRank(
    int nSkill,
    object oTarget = OBJECT_SELF
);

Parameters

nSkill

SKILL_*

oTarget

The creature to check what rank they have in nSkill. (Default: OBJECT_SELF)


Description

Returns the number of ranks that oTarget has in nSkill.

If nSkill is untrained this function returns 0, and -1 if oTarget doesn't have nSkill.



Version

1.22

Example

// This script would be placed in a conversation
// where the player challenges the Master Bard to
// a performance duel.

// Initialize Objects
object oPlayer = GetPCSpeaker();
// Determine skill checks
int iPPerCheck = d20(1) + GetSkillRank(SKILL_PERFORM, oPlayer);
int iMPerCheck = d20(1) + GetSkillRank(SKILL_PERFORM, OBJECT_SELF);
// Compare the two skill checks
if (iPPerCheck > iMPerCheck)
{
     // Player wins perform duel
     // Place reward code here
}
else
{
     //Player looses perform duel
     //Place failure code here
}

See Also

functions: ActionUseSkill
categories: Talents/Skills/Feats Functions
constants: SKILL_* Constants


 author: Tom Cassiotis, editor: Jeremy Spilinek
 Send comments on this topic.