Alternatively. . .
Since this is happening during a conversation. . .
The logic could be thus:
[PC] Persuade check DC 20
[NPC] Success! "You have persuaded me." Give PC 20 xp and Set Variable on PC so that they can't repeat this convo node.
[NPC] Failure! "Sorry, I don't agree with you." Set Variable on PC so that they can't repeat this convo node (or to increase future DCs).
The Bioware convo/script wizard is an extremely easy way to create an Action Taken script that gives an XP reward to either the PC Speaker or the entire party. The same wizard can set a local variable and check for local variables.
And if you want to be fancy, you can set a variable on the PC for a failed persuade check so that either they can't persudade the NPC on the same topic or there is a penalty for each failed persuasion. Just create a Text Appears When script that checks for the variable value (0-N) and show the appropriate convo node with the increased DC or hide the convo node altogether.
For traps, create an OnDisarm and for doors & chests create an OnUnLock script:
void main()
{
object oSelf = OBJECT_SELF;
// Get the creature who triggered this event.
object oPC = GetLastOpenedBy();
// Give 20 experience to us.
GiveXPToCreature(oSelf, 20);
}
Name the script OnUnDC20 and create different versions by changing the XP reward and the name to reflect the different DC. The above script was created by Script Generator, not myself. It's a great tool for non-scripters like myself.
NOTE that is isn't exactly what you asked for. This assumes that XP = DC in all cases. Harder to unlock/untrap gives more expereince points but as characters increase in level the value of 20, 30, or 40 xp becomes negligible. The logic is much simpler than trying to figure out what the actual risk of failure is. The result is that a 1st level Rogue will get the same xp as a 1st level Fighter even though the Rogue has an easier time of it. I personally think that it falls in line with the fact that combat experience is paid based on how hard the creature is for anyone to kill rather than how difficult it is for that one PC.
Please feel free to ignore all of this as it is your game and not mine.
Modifié par Grymlorde, 09 novembre 2013 - 10:40 .