Jump to content
MakeWebGames

Mccodes V2 crime formula help


Dazza

Recommended Posts

Hello,

Could someone please explain how to work out the crime formula and/or copy me a list of their crime/formulas?

I have this in a help file:

Example 1a.

((WILL*0.7)/17)

User's will: 100

You start by running the functions in the parentheses.

So it would end up being:

((70)/17)

After that you just run the formula

70/17

Which Equals:

4.1176470588235294117647058823529

So using that formula on a user with 100 will would give them a 4.1176470588235294117647058823529% chance of the user succeeding.

 

Confusing me as math isnt my strong point!

Link to comment
Share on other sites

Re: Mccodes V2 crime formula help

There are some good topics on CE that explain this, but I'll explain here anyway. ;)

OK, here is one formula:

((WILL*3.5)/3)+(LEVEL/3)

Now, this formula produces a HIGH chance of success. At will 100 and level 1, this comes out with: 117. This is a 117% chance of succeeding.

Now, to make it harder, decrease the number the will is multiplied (3.5), increase the division number (3,3).

A low success formula would be:

((WILL*1.2)/10)+(LEVEL/8)

This produces 12.125% chance of succeeding. (Level and will the same as before).

To make the crime easier, apply the same change, but vice versa. Therefore the multiplication is increase and division numbers decreased.

Easy crime:

((WILL*15)/2)+(LEVEL/2)

This produces a 750.5% chance of success.

Hope this helps ya. :) Mail me if you need any further help. :D

Link to comment
Share on other sites

  • 5 months later...

Re: Mccodes V2 crime formula help

In docrime.php you have an array that tells you which attributes you can use for crimes.(you can edit these to the userstats... that you want to be used for crimes)

lines 18-21

 

else
{
$ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";";
eval($ec);

This says you can use LEVEL CRIMEXP EXP WILL and IQ for crimes.

If you want to add strength agility and guard just add them lol.

Example:(including STR, AGI, GRD)

(array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM'])
Link to comment
Share on other sites

  • 4 weeks later...

Re: Mccodes V2 crime formula help

i get this error

Parse error: syntax error, unexpected T_STRING in /home/benan/public_html/docrime.php(22) : eval()'d code on line 1

this is my docrime.php after the edit

 

<?php
$macropage="docrime.php?c={$_GET['c']}";
include "globals.php";
if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }
$_GET['c']=abs((int) $_GET['c']);
if(!$_GET['c'])
{
print "Invalid crime";
}
else
{
$q=$db->query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c);
$r=$db->fetch_row($q);
if($ir['brave'] < $r['crimeBRAVE'])
{
print "You do not have enough Brave to perform this crime.";
}
else
{
$ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM'])
.";";
eval($ec);
print $r['crimeITEXT'];
$ir['brave']-=$r['crimeBRAVE'];
$db->query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);
if(rand(1,100) <= $sucrate)
{
print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']);
$ir['money']+=$r['crimeSUCCESSMUNY'];
$ir['crystals']+=$r['crimeSUCCESSCRYS'];
$ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);
$db->query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp=exp+{$r['crimeXP']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c);
$db->query("UPDATE users SET crimesdone=crimesdone+1 WHERE userid=$userid",$c);

if($r['crimeSUCCESSITEM'])
{
 item_add($userid, $r['crimeSUCCESSITEM'], 1);
}
}
else
{
if(rand(1, 2) == 1)
{
print $r['crimeFTEXT'];
}
else
{
 print $r['crimeJTEXT'];
 $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");

}
}

print "
[url='docrime.php?c={$_GET[']Try Again[/url]

[url='criminal.php']Crimes[/url]";
}
}


$h->endpage();
?>

 

any ideas why im getting this error?

Link to comment
Share on other sites

Re: Mccodes V2 crime formula help

yup your str_replace() statement is one string shorter than it should be

array("LEVEL","CRIMEXP","EXP","WILL","IQ","STR","AGI","GRD") -8

array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ'], $ir['strength'], $ir['agility'], $ir['guard']),$r['crimePERCFORM']) - 9

Link to comment
Share on other sites

Re: Mccodes V2 crime formula help

Having trouble with my crimes, no one can do them

I adjusted my lvl to 200

with the max will in my game = 220000

I set the lowest crime formula to:

((WILL*50)/2)+(LEVEL/1) = about a 5,500,200 % success rate

 

(I started with ((WILL*0.8)/1)+(LEVEL/1) and adjusted to make it easier)

 

Results: Failed

Is there anything else that would change the outcome ?

My crimes.php

<?php
include "globals.php";
print "<center><font face='Arial' size='4'>Criminal Centre</font><hr width='80%'>";
if($ir['jail'] or $ir['hospital']) { die("You cannot access this page while in Hospital or Jail."); }
$_POST['ID'] = abs((int) $_POST['ID']);
if(!$_POST['ID'])
{
$sql = sprintf("SELECT * FROM crimegroups ORDER BY cgID ASC");
$q = $db->query($sql);
print "<form action='crimes.php' method='post'>
<table width='40%' cellspacing='1'> <tr bgcolor='gray'> <th width='90%'>Crime</th> <th width='10%'>Do</th></tr>";
while($r = $db->fetch_row($q))
{
print "<tr><td>{$r['cgNAME']}</td><td align='center'><input type='radio' name='ID' value='{$r['cgID']}' /></td></tr>";
}
print "<tr bgcolor='gray'>
<td colspan='2' align='center'><input type='submit' value='Next Step'></td>
</tr></table></form><hr width='80%'>> [url='index.php']Back[/url]<hr width=80%>";
}
else
{
$sql = sprintf("SELECT * FROM crimes WHERE (crimeGROUP = %u)", $_POST['ID']);
$q = $db->query($sql);
if (!$db->num_rows($q))
{
print "This crime group does not exist.";
}
else
{
print "<form action='docrime.php' method='get'>
<table width='80%' cellspacing='1'> <tr bgcolor='gray'> <th>Crime</th> <th>Brave Cost</th> <th>Do</th></tr>";
while($r=$db->fetch_row($q))
{
print "<tr><td>{$r['crimeNAME']}</td><td><font color='red'>-{$r['crimeBRAVE']} Brave</font></td><td align='center'><input type='radio' name='c' value='{$r['crimeID']}' /></td></tr>";
}
print "<tr bgcolor='gray'>
<td colspan='3' align='center'><input type='submit' value='Do Crime'></td>
</tr></table></form><hr width='80%'>> [url='crimes.php']Back[/url]<hr width=80%>";
}
}
$h->endpage();
?>

 

and my docrime.php

<?php
$macropage="docrime.php?c={$_GET['c']}";
include "globals.php";
if($ir['jail'] or $ir['hospital']) { die("This page cannot be accessed while in jail or hospital."); }
$_GET['c']=abs((int) $_GET['c']);
if(!$_GET['c'])
{
print "Invalid crime";
}
else
{
$q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c);
$r=mysql_fetch_array($q);
if($ir['brave'] < $r['crimeBRAVE'])
{
print "You do not have enough Brave to perform this crime.";
}
else
{
$ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";";

print $r['crimeITEXT'];
$ir['brave']-=$r['crimeBRAVE'];
mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c);
if(rand(1,100) <= $sucrate)
{
print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']);
$ir['money']+=$r['crimeSUCCESSMUNY'];
$ir['crystals']+=$r['crimeSUCCESSCRYS'];
$ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8);
mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c);
if($r['crimeSUCCESSITEM'])
{
 item_add($userid, $r['crimeSUCCESSITEM'], 1);
}
}
else
{
if(rand(1, 2) == 1)
{
print $r['crimeFTEXT'];
}
else
{
 print $r['crimeJTEXT'];
 $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'");
}
}

print "
[url='docrime.php?c={$_GET[']Try Again[/url]

[url='criminal.php']Crimes[/url]";
}
}


$h->endpage();
?>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...