Jump to content
MakeWebGames

Better Attack Formula Suggestion


josh2007

Recommended Posts

Hello,

This is my first time posting here so I apologize if this is in the incorrect area. But I am seeking some advice to see if I can get this corrected. We currently run the one-click attack modification on our game. Our players did not like the following equation because sometimes they win and sometimes they loose because it has a random divider. Here is the original equation:

 

$damage = (($pri['weapon']*$ir['strength']/($them['guard']/1.5))*(rand(8000,12000)/10000));
$theirdamage = (($enweps[$weptouse]['weapon']*$them['strength']/($ir['guard']/1.5))*(rand(8000,12000)/10000));

 

Since our players did not like this, I tried to code my own equation into it, which works fine, but the problem we are having is that people are loosing/winning to people they should not be winning to. I have tried to change the equation around several times with no success. Im only going to post the equation I coded in and not the entire script, cause its a paid mod on MCCodes and I know that would be unfair to the creator of the script. I thought about writing the developer of the script, but I am not quite for sure how to do that either. Thanks in advance for any suggestions.

 

// WEAPONS

$q4=$db->query("SELECT i.weapon FROM items i   WHERE itmid={$ir['equip_primary']}");
$r4=$db->fetch_row($q4);

$q6=$db->query("SELECT i.weapon FROM items i   WHERE itmid={$them['equip_primary']}");
$r6=$db->fetch_row($q6);

// END DO ARMOR

$q3=$db->query("SELECT i.armor FROM items i   WHERE itmid={$them['equip_armor']}");
$r2=$db->fetch_row($q3);

$q5=$db->query("SELECT i.armor FROM items i   WHERE itmid={$ir['equip_armor']}");
$r5=$db->fetch_row($q5);

// END ARMOR

$damage= ((($r4['weapon']+$ir['strength'])/10)/(($them['guard']+$r2['armor'])/10));
$theirdamage= ((($r6['weapon']+$them['strength'])/10)/(($ir['guard']+$r5['armor'])/10));

 

Just note its divided by 10 to lower the amount of damage that is actually being done so the fight isnt over as soon as someone attacks. Not quite for sure what to do in this case.

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...