steal succesrate shops

General Chat, Comments

steal succesrate shops

Postby Rodeobull » Thu Jan 25, 2018 12:08 pm

stealing from a shop is to easy and i want to change that

anyone who could help me ?

Code: Select all
  // The risk and jail time depends on the total value of what's stealed.
        $successRate = ceil($userStats["Dexterity"]->value * $userStats["Dexterity"]->value) / ($total / 3);
        $res = rand(0, 100);
        // Player is lucky and got it
        if ($res < $successRate)
Posts: 10
Joined: Thu Jan 09, 2014 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: steal succesrate shops

Postby KyleMassacre » Fri Feb 02, 2018 8:07 pm

One thing to note is that the lower the price of the item being stolen the easier it is to get away with it. Maybe what you can do is something like:
Code: Select all

= ceil($userStats[‘Dexterity’]->value * $userStats[‘Dexterity’]->value) /($total / rand(3,5));

Just to put things into perspective:
Dexterity = 10
total = 100
ceil(10*10) / (100/3) = 3
ceil(10*10) / (100/5) = 5

The chance ($res variable) is a random value between 0 and 100. Now I’m not good at odds but I think the odds of the chance being greater than 5 are pretty high
Skype: KyleMassacre
My NWE Modules
User avatar
Posts: 571
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 36 times

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest