PDA

View Full Version : If anyone is interested, I changed 'Thief' to account for rep...


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.

CMX_CMGSCCC
03-07-2006, 08:44 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.

1 Issue I can see with that is, what if the user has more than 100 reputation, the number will be negative, so once a user gets more than 100 they can steal all of the time. I would like to see it done differently, I would like it so the more reputation u have the HARDER it is to steal from that individual or something.

-CMX

lordnex
03-07-2006, 09:06 PM
the problem is that everyones forums are different. 100 points may be major for one person, but on another the users may start off that high. i've seen forums where users had reps in excess of 40000.

fly
03-07-2006, 09:57 PM
1 Issue I can see with that is, what if the user has more than 100 reputation, the number will be negative, so once a user gets more than 100 they can steal all of the time. I would like to see it done differently, I would like it so the more reputation u have the HARDER it is to steal from that individual or something.

-CMX
It was the best I could come up with, rather than totally random. :D

And yeah, good rep would allow one to steal all the time, which is why I use the rep reduce option for Thief...

Checking the rep of the theftee would be a neat idea. Maybe take the difference of the two reps and add that into the random.

CMX_CMGSCCC
03-07-2006, 11:54 PM
There is a way to fetch_reppower or something from one of the functions inside functions.php that should be able to be used in this manner I think to help find out the "scale" of people's forums.

-CMX

HHU
03-22-2006, 07:33 PM
the problem is that everyones forums are different. 100 points may be major for one person, but on another the users may start off that high. i've seen forums where users had reps in excess of 40000.

Mine are now anywhere from 500 000 to 2 000 000..........