Prestiage tokens not working
-
so I put my token in and it said that item does not grant prestige and I took the token back out, I was using the justicar chest
-
@CrazyZleric now it's working again? maybe the poor chest fixed on reset?
-
@CrazyZleric could be a lag issue yes.
-
@Mr-Moloch can't rule it out, and it may have been a lag issue
-
I have also seen some prestige tokens that do not work. Importantly some do, some don't.
I think this is due to integer math operations producing tokens that have no prestige value.
consider prestige_close, line 56
56 | if (iPrestigeValueOfItem > 0)the prestige chests won't consider items with 0 or less prestige as adding to the characters contribution.
Now consider cs_area_enter, RemoveExcessXP, lines 403 through 413:
403 | if(oldXP > 50000)//half way through level 10 404 | { 405 | 406 | //iOldPrestigeReward = GetLocalInt(oXP_Sponge, "iPrestigeReward"); 407 | xp_surplus = GetXP(oPC) - 50000; 408 | xp_surplus = (xp_surplus * 15)/100; 409 | oXP_Sponge = CreateItemOnObject("pres_token", oPC); 410 | SetLocalInt(oXP_Sponge, "iPrestigeReward", xp_surplus); 411 | SendMessageToPC(oPC, "You cannot gain more than 50000 XP so it is being reduced and converted to prestige points."); 412 | SetXP(oPC, 50000); 413 | }Suppose the PC's surplus is 6 XP (or less). Because of integer arithmetic, xp_surplus in line 408 would evaluate to 0. The resulting token would therefore be unable to be used in a prestige chest. There should be a call to a ceiling function, or a comparison to take the max of 1 and (xp_surplus * 15)/100; (if xp_surplus = 0, xp_surplus = 1)
Or if you want a very minimal fix that inflates prestige a tiny amount globally but requires no new comparison or function evaluation, simply add 1.
408 | xp_surplus = (xp_surplus * 15)/100 + 1; -
@LeastWeasel Good catch, you're right.
-
Put in the fix for this, thanks again LeastWeasel for catching this. Another pair of eyes to look at scripts is incredibly helpful.
-
M Mr.Moloch moved this topic from Bug Reports