Quote:
|
Originally Posted by Yen
The 'exp' portion of the code is adding the string twice..
PHP Code:
function CompleteQuest(acc) {
temp.reference = findplayer(acc);
for (temp.a = 0; temp.a < this.questinfo.reward.size(); temp.a++) {
if (this.questinfo.reward[temp.a] == "gold") {
temp.reference.rupees += this.questinfo.reward[temp.a+1];
temp.reference.client.temp_addmessages.add("You gain" SPC this.questinfo.reward[temp.a+1] SPC "gold.");
}
else if (this.questinfo.reward[temp.a] == "item") {
temp.ivars.loadvars("levels/archetype/" @ this.questinfo.reward[temp.a+1] @ ".arc");
temp.reference.AddItem(temp.ivars.wname,this.questinfo.reward[temp.a+1],this.questinfo.reward[temp.a+2]);
temp.reference.client.temp_addmessages.add("You gain" SPC temp.ivars.wname SPC "x" @ this.questinfo.reward[temp.a+2] @ ".");
}
else if (this.questinfo.reward[temp.a] == "exp") {
temp.reference.client.temp_addmessages.add("You gain" SPC this.questinfo.reward[temp.a+1] SPC "EXP.");
temp.reference.AddEXP(this.questinfo.reward[temp.a+1]);
}
}
}
|
Did you try to debug it?
Try echoing this.questinfo.reward.size() at the top of the script.
If it returns it twice, that means two things are triggering to it - if thats > 1 that can also be why (just a thought)