City of Arabel
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Prestiage tokens not working

    Scheduled Pinned Locked Moved Closed Bugs
    7 Posts 3 Posters 99 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • CrazyZlericC
      CrazyZleric
      last edited by

      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

      CrazyZlericC 1 Reply Last reply Reply Quote
      • CrazyZlericC
        CrazyZleric @CrazyZleric
        last edited by

        @CrazyZleric now it's working again? maybe the poor chest fixed on reset?

        Mr.MolochM 1 Reply Last reply Reply Quote
        • Mr.MolochM
          Mr.Moloch @CrazyZleric
          last edited by

          @CrazyZleric could be a lag issue yes.

          In the future, there are two simple rules to remember:

          NO SPITTING.

          DO NOT CROSS MISTER MOLOCH.

          https://youtu.be/dQw4w9WgXcQ?si=uHdfqTMS7FMTWREf

          CrazyZlericC 1 Reply Last reply Reply Quote
          • CrazyZlericC
            CrazyZleric @Mr.Moloch
            last edited by

            @Mr-Moloch can't rule it out, and it may have been a lag issue

            1 Reply Last reply Reply Quote
            • L
              LeastWeasel The Justiciars
              last edited by

              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;
              
              Mr.MolochM 1 Reply Last reply Reply Quote
              • Mr.MolochM
                Mr.Moloch @LeastWeasel
                last edited by

                @LeastWeasel Good catch, you're right.

                In the future, there are two simple rules to remember:

                NO SPITTING.

                DO NOT CROSS MISTER MOLOCH.

                https://youtu.be/dQw4w9WgXcQ?si=uHdfqTMS7FMTWREf

                Mr.MolochM 1 Reply Last reply Reply Quote
                • Mr.MolochM
                  Mr.Moloch @Mr.Moloch
                  last edited by

                  Put in the fix for this, thanks again LeastWeasel for catching this. Another pair of eyes to look at scripts is incredibly helpful.

                  In the future, there are two simple rules to remember:

                  NO SPITTING.

                  DO NOT CROSS MISTER MOLOCH.

                  https://youtu.be/dQw4w9WgXcQ?si=uHdfqTMS7FMTWREf

                  1 Reply Last reply Reply Quote
                  • Mr.MolochM Mr.Moloch moved this topic from Bug Reports
                  • 1 / 1
                  • First post
                    Last post