Jump to content
  • 0

Random chance pvp rewards?


Question

Posted

I'm looking for a guide that could help me add random chance a player can get an item reward for a pvp kill. Example would be something like

Player 1 Kills Player 2:

10% chance of getting gold bar.

25% chance of getting AA

 

I would like to have a few items that have a random chance to get or maybe add all those items to a custom compressed pack that has a random chance to open into 1 of those items.

8 answers to this question

Recommended Posts

  • 0
Posted
if (Rnd.get(100) > 50)

{

      //give reward

}

 

Chance - 50%

 

About reward after pvp, its already shared, use search.

  • 0
Posted

int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP;

addItem("Loot", 5139, itemReward, this, true);

                        if (Rnd.get(100) > 50)

                        {

                          //give reward

                        }

would that be correct?

  • 0
Posted

                        if (Rnd.get(100) > 50)

                        {

                          addItem("Loot", 5139, itemReward, this, true);

                        }

that would be probably correct(i dont remember all parameters of addItem method, so i am not sure about that)

  • 0
Posted

int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP;

addItem("Loot", 5139, itemReward, this, true);

                        if (Rnd.get(100) > 50)

                        {

                          //give reward

                        }

would that be correct?

 

Did that work id like to try to make something like this for my server?

  • 0
Posted

I added

int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP;

        if (Rnd.get(100) > 50)

        addItem("Loot", 5139, itemReward, this, true);

                       {

                        }

 

still gives me 5139 100%

  • 0
Posted

Using brain doesn't hurt.

 

         int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP;

         if (Rnd.get(100) > 50)
         {
                addItem("Loot", 5139, itemReward, this, true);
         }

  • 0
Posted

Using brain doesn't hurt.

 

        int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP;

        if (Rnd.get(100) > 50)
        {
               addItem("Loot", 5139, itemReward, this, true);
        }

I typed the code in my post wrong, The only thing different from what you posted and what I had was there was no space between

int itemReward = Config.MOD_GVE_AMOUNT_PACK_BY_PVP; and

if (Rnd.get(100) >50)

 

but adding the space between the 2 made it work, so thank you.

  • 0
Posted

Simply right method wasn't in if check body.

 

Anyway as I can see problem solved, so topic locked.

Guest
This topic is now closed to further replies.


  • Posts

    • "Just make your own game!" sounds simple until you’ve tried it. I did, with Epic Dragon World and learned the hard way that "open source" often means "free labor for resellers." The MIT license became a buffet for people to grab code, rebrand it and ghost the project. Even basic collaboration collapsed because everyone wanted their vision, not *a* vision. NCSoft’s lawyers aren’t theoretical. They’re a sword of Damocles. Even if you rebuild a client from scratch, if it feels like Lineage 2, they’ll come knocking. Ask the Chrono Trigger fangame corpses how that goes. MMOs are hospice care. The genre’s on life support, kept alive by whales and nostalgia. Look at Throne and Liberty, NCSoft’s own "successor" to L2, flopping harder than a 2004 PKer in ToI. Classic reboots (WoW, L2) are bandaids, not resurrections. This is the hobby. Optimizing old systems, reverse-engineering spaghetti code and preserving janky mechanics is the fun part. Monetizing it turns it into customer service hell. No thanks. Community? What community? The L2 scene is 90% resellers, 10% players who’ll quit the second they don’t get +16 on day one. Both asking how to install Java and why running the uncompiled server does not work.
    • Dear players, Open beta test for C3 begins today at 19:00 server time (GMT +2). 💰 All participants who find bugs during OBT will be rewarded with Coin of Luck (CoL): - 1 CoL for each staticmesh issue found — e.g., walking through textures, etc., - 2 CoL or more for server-side issues, depending on their severity., We strongly recommend reviewing the quest list - when switching to Chronicle 3, the total number of quests should match the number shown in the upper right corner of the window and correspond to the quest count from Chronicle 2. To log into the game, use the same data you use to access the Airin server. 📌 Download client: Google Drive
    • 🔥 Sale Alert! 🔥 Twitter Accounts with 50 Followers — now on SALE! Looking to launch a project or warm up your account base fast? We’ve got starter Twitter accounts with ~50 followers at a sweet price. 💰 Limited-time offer – while stock lasts! ✅ Organic-Looking ✅ Clean & Safe ✅ Perfect for boosting credibility 📦 Instant delivery
    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store  ➡ Our SMM-Boosting Panel: socnet.pro  ➡ Telegram Shop Bot: socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: 79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock