steal succesrate shops

General Chat, Comments
Post Reply
Rodeobull
Posts: 10
Joined: Thu Jan 09, 2014 7:49 pm

steal succesrate shops

Post 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)
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: steal succesrate shops

Post 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
Post Reply

Return to “General”