Page 1 of 1

steal succesrate shops

Posted: Thu Jan 25, 2018 5:08 pm
by Rodeobull
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)

Re: steal succesrate shops

Posted: Sat Feb 03, 2018 1:07 am
by KyleMassacre
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

$successRate = 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