fly
03-07-2006, 07:26 PM
It's kinda crude, but works. You may need to adjust the variables on your forum if you have very high/low reps...
Find:// simple calculation for now to check whether or not the thief was successful
$randnum = rand(0, 100);
$thiefsuccessful = false;
if ($randnum < $action['estore_thiefsuccessrate'])
{
// set this flag that Thief was successful
$thiefsuccessful = true;
}
Replace it with:// simple calculation for now to check whether or not the thief was successful
$randnum = rand(0, 100);
$thiefsuccessful = false;
// added to check rep
$rep = $vbulletin->userinfo['reputation'];
$randnum = $randnum - $rep;
if ($randnum < $action['estore_thiefsuccessrate'])
{
// set this flag that Thief was successful
$thiefsuccessful = true;
}
If the person's rep is really high, the theft will always work, so make sure to set it so that the person loses rep for attempting to steal. At the other side, if the person's rep is really low, it will always fail. Right around neutral rep = pretty much random.
So that it doesn't get overwritten during an upgrade, I renamed the thief action file and pointed the thief option to that new file in the admincp.
Find:// simple calculation for now to check whether or not the thief was successful
$randnum = rand(0, 100);
$thiefsuccessful = false;
if ($randnum < $action['estore_thiefsuccessrate'])
{
// set this flag that Thief was successful
$thiefsuccessful = true;
}
Replace it with:// simple calculation for now to check whether or not the thief was successful
$randnum = rand(0, 100);
$thiefsuccessful = false;
// added to check rep
$rep = $vbulletin->userinfo['reputation'];
$randnum = $randnum - $rep;
if ($randnum < $action['estore_thiefsuccessrate'])
{
// set this flag that Thief was successful
$thiefsuccessful = true;
}
If the person's rep is really high, the theft will always work, so make sure to set it so that the person loses rep for attempting to steal. At the other side, if the person's rep is really low, it will always fail. Right around neutral rep = pretty much random.
So that it doesn't get overwritten during an upgrade, I renamed the thief action file and pointed the thief option to that new file in the admincp.