NWScript:
void main()
{
object oChest = OBJECT_SELF;
object oPlayer = GetLastDisturbed();
object oMerchant = GetNearestObjectByTag("MERCHANT");
int iPPSkillCheck = d20(1) + 1 + GetSkillRank(SKILL_PICK_POCKET, oPlayer);
int iSpotCheck = d20(1) + 3 + GetSkillRank(SKILL_SPOT, oMerchant);
string sSkillCheck = "Pick Pocket " + IntToString(iPPSkillCheck) + " vs Spot " + IntToString(iSpotCheck);
if (iPPSkillCheck > iSpotCheck)
{
FloatingTextStringOnCreature(sSkillCheck + " - Success!", oPlayer);
AdjustReputation(oPlayer, oChest, -5);
return;
}
else
{
FloatingTextStringOnCreature(sSkillCheck + " - Failed!", oPlayer);
AdjustReputation(oPlayer, oChest, -20);
AssignCommand(oMerchant, ActionAttack(oPlayer));
}
}