
the below code allowed for the posibility that the player could bargin with the quest giver for a higher pay out (trying to get the persuade skill to be relivant as much as possible) should be easy to chop it out if not needed. The successful check gave set a variable on the characer of 1, a failure set a 0
Code: Select all
#include "nw_i0_tool"
void main()
{
int nQuestObjectCount = 0;
object oPC = GetPCSpeaker ();
object oItem = GetFirstItemInInventory (oPC);
while (GetIsObjectValid (oItem)) {
if (GetTag (oItem) == "[insert quest object tag]") {
nQuestObjectCount++;
DestroyObject (oItem);
}
oItem = GetNextItemInInventory (oPC);
}
if (GetLocalInt(oPC, "[Insert Quest Variable name") == 1) {
GiveGoldToCreature (oPC, (15 * nQuestObjectCount));
GiveXPToCreature (oPC, 15 * nQuestObjectCount);
}
else {
GiveGoldToCreature (oPC, (10 * nQuestObjectCount));
GiveXPToCreature (oPC, 10 * nQuestObjectCount);
}
}