void main() { object oPC = GetPCSpeaker(); // Determine the static amount of GP reward for a quest. int iGP = GetLocalInt(OBJECT_SELF,"GP"); // Determine the static amount of XP reward for a quest. int iXP = GetLocalInt(OBJECT_SELF,"XP"); // Determine the multiple for GP randomization of a d10(). int iGPRanMult = GetLocalInt(OBJECT_SELF,"GPRanMult"); // Determine the multiple for XP randomization of a d20(). int iXPRanMult = GetLocalInt(OBJECT_SELF,"XPRanMult"); // Determine the total amount of random gold by multiplying the d10() int iRandomGold = d10()*iGPRanMult; // Determine the total amount of random XP by multiplying the d20() int iRandomXP = d20()*iXPRanMult; // Determine the total gold piece reward by adding random amount to the static amount int iGPTotal = iGP+iRandomGold; // Determine the total XP reward by adding the random amount to the static amount int iXPTotal = iXP+iRandomXP; // Reward gold to PC GiveGoldToCreature(oPC,iGPTotal); // Reward XP to PC GiveXPToCreature(oPC,iXPTotal); }