Jump to content
MakeWebGames

attack problem


adivirus
 Share

Recommended Posts

Hello, i have an attack problem.. very low players in stats and weapons are beating top players with very high stats and weapons, also sometimes if a top player is attacking with armor equipped he might lose.. and if he attack with armor unequipped he may win.. all it`s very strange.

So, the problem is in my attack.php .. i`m using that one with skeletons :)

I need someone to analyze the file and make the needed adjustments.

If someone is interested in helping me, mail me or reply here how much will you take to fix the file for me and i will send it to you via email.

Thanks allot ;-)

Link to comment
Share on other sites

here it goes:

 

<?php
$menuhide=1;
$atkpage=1;
include "globals.php";
include "travellingglobals.php";
include "clubbing.php";
echo '
<style type="text/css">
.attack {
padding-top: 69px;
padding-left: 11px;
padding-right: 9px;
padding-bottom: 52px;
background: url(defaultlb.png);
}
.text {
font-family: Tahoma;
font-size: 12px;
}
.weaponback {
width: 89px;
height: 89px;
background: url(weaponback.png);
padding-top: 10px;
padding-left: 9px;
padding-right: 12px;
padding-bottom: 11px;
}
</style>'; //CSS For the attack box.




//get player data
   $youdata=$ir;
       $q = $db->query(sprintf("SELECT 
                                u.userid,username,energy,hp,location,hospital,jail,fedjail,gender,attacking,equip_primary,equip_secondary,equip_armor,
                                us.userid,strength,agility,guard,labour,IQ,maxhp,protection,stealth,laston,onlineattacks,trap,antitrap,gang,fighting
                                FROM users u 
                                LEFT JOIN userstats us 
                                ON u.userid=us.userid 
                                WHERE u.userid=('%d')",
                                (int)$_GET['ID']
                                ));
       $odata=$db->fetch_row($q);

                   $myabbr=($ir['gender']=="Male") ? "his" : "her";
                   $oabbr=($ir['gender']=="Male") ? "his" : "her";






$_GET['ID']  = (isset($_GET['ID']) AND !ereg('[^0-9]', $_GET['ID'])) ? abs(@intval($_GET['ID'])) : FALSE ;   

if(!$_GET['ID'])
{
print "WTF you doing, bro?";
$h->endpage();
             $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}


else if($_GET['ID'] == $userid)
{
print "Only the crazy attack themselves.";
$h->endpage();
              $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if($odata['fighting'] != $ir['userid'] && $ir['fighting'] != $odata['userid'] && $odata['fighting'] > 0)
{
echo "This user is already attacked by someone else..try again later.<br />
      <a href='index.php'>> Back</a>";
      $h->endpage();
      $_SESSION['attacking']=0;
      $ir['attacking']=0;
      $db->query(sprintf("UPDATE users SET attacking = 0 WHERE userid =%d", $userid));
exit;
}




else if ($ir['hp'] <= 1)
{
print "Only the crazy attack when their unconscious.<br />
<a href='index.php'>Back</a>";
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if ($_SESSION['attacklost'] == 1)
{
print "Only the losers of all their EXP attack when they've already lost.<br />
<a href='index.php'>Back</a>";
$_SESSION['attacklost']=0;
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}



if($ir['attacking'] && $ir['attacking'] != $_GET['ID'])
   {
       echo "You cant attack more the one person at a time, if you are not attacking anyone else, mail Admin <br />
       <a href='index.php'>Back</a>";
       $_SESSION['attacklost']=0;
       $h->endpage();
       exit;
   }


$check_it = sprintf("SELECT * FROM gangwars WHERE warDECLARER = %u AND warDECLARED = %u OR warDECLARED = %u AND warDECLARER = %u",
($ir['gang']),($odata['gang']),
($ir['gang']),($odata['gang']));

$do_it = $db->query($check_it);

if($db->num_rows($do_it) == 0)
{
if($odata['laston'] > time()-30*60 && $odata['onlineattacks'] >= 12)
{
	echo "No more than 12 online attacks. This player was attacked 12 times.";
	echo "<br /><br />";
	echo "<a href='index.php'>> Back</a>";
	         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}
}




if($odata['hp'] == 1)
   {
       echo "This player is unconscious.<br />
       <a href='index.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
   }

else if($odata['hospital'])
   {
       echo "This player is in hospital.<br />
       <a href='index.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));    
       exit;
   }

if($ir['attack_ban'] > 0)
{
echo "It seems you are attack banned. This means you can not fight.<br />";
echo "You are attack banned for ".$ir['attack_ban']." more days.";
echo "<br /><br />";
echo "<a href='index.php'>> Back</a>";
 $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}


if($ir['stealth'] > 0)
{
       echo "<center><font face=verdana color=white>You can not attack while using stealth suite.</font><br /><br />
       <a href='index.php'>> Back</a></center>";
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

if($odata['stealth'] > 0)
{
       echo "<center><font face=verdana color=white>You can not attack while using stealth suite.</font><br /><br />
       <a href='index.php'>> Back</a></center>";
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

if($ir['itmdamage'] > 99)
{
die("<font face=verdana color=white>Your weapon is broken</font><br /><a href='index.php'>> Back</a>");
}
//RIGHT HERE I ADD FED JAIL

//else if($odata['fedjail'] > 0)
//    {
//        echo "Cannot attack users who are in federal jail.";
//                 $h->endpage();
//            $_SESSION['attacking']=0;
//           $ir['attacking']=0;
//            $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
//        exit;
//}

else if($ir['hospital'] && !$odata['hospital'])
   {
       echo "You can only attack other users in hospital.<br />
       <a href='hospital.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid)); 
       exit;
   }

else if($odata['jail'])
   {
       echo "This player is in jail.<br />
       <a href='index.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid)); 
       exit;
   }

else if($ir['jail'])
   {
       echo "While in jail you can't attack.<br />
       <a href='jail.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid)); 
       exit;
   }



else if($odata['trap'] && $ir['antitrap'] == 0)
{

$_SESSION['attacking']=0;
$ir['attacking']=0;
$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");
$expperc=(int) ($ir['exp_needed']*10/100);
event_add($odata['userid'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> was trying to attack you, but LOL .. he got caught in your trap and lost 10% exp.. muhahahahahaha",$c);

if ($ir['exp'] - $expperc >= 0)
{
echo "<center><font face=verdana color=white>WOHOOOO, while trying to attack him you got caught into his trap and lost 10% of your experience.</font><br />";
echo "	<a href='index.php'>> Back</a></center>";
$db->query("UPDATE users SET exp=exp-$expperc WHERE userid=$userid");
exit;
   }
}
else if ($ir['exp'] - $expperc < 0)
{
echo "HUH, this player tried to get u in trap but u have less than 10% experience, and the action can`t go on...<br /><br />";
echo "<a href='index.php'>> Go Home</a>";	
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if($odata['trap'] && $odata['laston'] > time()-30*60 && $ir['antitrap'])
{

$_SESSION['attacking']=0;
$ir['attacking']=0;
$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");
$expperc=(int) ($ir['exp_needed']*10/100);
event_add($odata['userid'],"<a href='viewuser.php?u=$userid'>{$ir['username']}</a> was trying to attack you, but LOL .. he got caught in your trap and lost 10% exp.. muhahahahahaha",$c);

if ($ir['exp'] - $expperc >= 0)
{
echo "<center><font face=verdana color=white>WOHOOOO, while trying to attack him you got caught into his trap and lost 10% of your experience.</font><br />";
echo "	<a href='index.php'>> Back</a></center>";
$db->query("UPDATE users SET exp=exp-$expperc WHERE userid=$userid");
exit;
   }
}

else if ($ir['exp'] - $expperc < 0)
{
echo "HUH, this player tried to get u in trap but u have less than 10% experience, and the action can`t go on...<br /><br />";
echo "<a href='index.php'>> Go Home</a>";	
exit;
}

else if($odata['userid'] == 1)
{
print "<font face=verdana color=white>You can not attack Admin!<br />
<a href='index.php'>> Back</a></center>";
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}
else if($odata['userid'] == 2)
{
print "<font face=verdana color=white>You can not attack Admin!<br />
<a href='index.php'>> Back</a></center>";
        $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}
else if($odata['userid'] == 34)
{
print "<font face=verdana color=white>You can not attack skarred!</font><br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}


else if($odata['userid'] == 129)
{
print "<font face=verdana color=white>You can not attack Zakotah!<br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}
else if($odata['userid'] == 65)
{
print "<font face=verdana color=white>You can not attack Lestat!<br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if($odata['userid'] == 2540)
{
print "<font face=verdana color=white>You can not attack Money Keeper!<br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if($odata['userid'] == 534)
{
print "<font face=verdana color=white>You can not attack Alabama!<br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}


else if($odata['protection'] > 0)
{
print "You can not attack <font color=lime>{$odata['username']}</font> he`s protected for <font color=lime>{$odata['protection']} days!</font><br />
<a href='index.php'>> Back</a></center>";
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}
else if($ir['gang'] == $odata['gang'] && $ir['gang'] > 0)
{
die ("<font face=verdana color=white>You are in the same clan as {$odata['username']}!</font><br />
<a href='index.php'>> Back</a></center>");
         $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid));
       exit;
}

else if($odata['travelling'])
   {
       echo "That player is travelling.<br />
       <a href='index.php'>> Back</a>";
       $h->endpage();
           $_SESSION['attacking']=0;
           $ir['attacking']=0;
           $db->query(sprintf("UPDATE users SET attacking = %d WHERE userid = %d",0,$userid)); 
$h->endpage();
       exit;
   }



print "<table width=100%><tr><td colspan=2 align=center>";
if($_GET['wepid'])
{
if($_SESSION['attacking']==0 && $ir['attacking'] == 0)
{
if ($youdata['energy'] >= $youdata['maxenergy']/2)
{
$youdata['energy']-= floor($youdata['maxenergy']/2);
$me=floor($youdata['maxenergy']/2);
$db->query("UPDATE users SET energy=energy- {$me} WHERE userid=$userid");
$_SESSION['attacklog']="";
$_SESSION['attackdmg']=0;

}
else
{
print "You can only attack someone when you have 50% energy";
$h->endpage();
exit;
}
}
$_SESSION['attacking']=1;
$ir['attacking']=$odata['userid'];
$sql = sprintf("UPDATE users SET attacking=%d WHERE userid=%d", $ir['attacking'], $userid);
$db->query($sql);
$_GET['wepid'] = abs((int) $_GET['wepid']);
$_GET['nextstep'] = abs((int) $_GET['nextstep']);
//damage


if($_GET['wepid'] != $ir['equip_primary'] && $_GET['wepid'] != $ir['equip_secondary'])
{
print "Stop trying to abuse a game bug. You can lose all your EXP for that.<br />
<a href='index.php'>> Home</a>";
$db->query("UPDATE users SET exp=0 where userid=$userid",$c);
die("");
}
$sql = sprintf("SELECT i.* FROM items i   WHERE i.itmid=%d", $_GET['wepid']);
$qo=$db->query($sql);
$r1=$db->fetch_row($qo);
$mydamage=(float) (($r1['weapon']*$youdata['strength']/($odata['guard'])));
$hitratio= max(10,min(60*$ir['agility']/$odata['agility'],95));

//iamwickeds attack mod main modifaction.
$query = sprintf("SELECT * FROM attack ORDER BY id");
$run = mysql_query($query);

$ohitarea = rand(1,mysql_num_rows($run));
$uhitarea = rand(1,mysql_num_rows($run));
$count = 0;
while($a = mysql_fetch_array($run))
{
$count +=1;
if($ohitarea == $count) { $oarea=$a['name']; $oaimage=$a['image']; }
if($uhitarea == $count) { $area=$a['name']; $aimage=$a['image']; }
}
//iamwickeds attack mod main modifaction.

if(rand(1,100) <= $hitratio )
{
$sql = sprintf("SELECT i.armor FROM items i WHERE itmid='%d' ORDER BY rand()", $odata['equip_armor']);
$q3=$db->query($sql);
if($db->num_rows($q3))
{
$mydamage-=$db->fetch_single($q3);
}
if($mydamage < -100000) { $mydamage=abs($mydamage); }
else if($mydamage < 1) { $mydamage=1; }
$crit=rand(1,40);
if($crit==17) { $mydamage*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $mydamage/=(rand(20,40)/10); } 
$mydamage=round($mydamage);
$odata['hp']-=$mydamage;
if($odata['hp']==1) { $odata['hp']=0;$mydamage+=1; }

$sql = sprintf("UPDATE users SET hp=hp-'%d' WHERE userid='%s'", $mydamage, $_GET['ID']);
$db->query($sql);
$utext = "<font color=red>{$_GET['nextstep']}. Using your {$r1['itmname']} you hit {$odata['username']} in the {$oarea} doing $mydamage damage ({$odata['hp']})</font><br />\n";
$_SESSION['attackdmg']+=$mydamage;
$_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. Using {$myabbr} {$r1['itmname']} {$ir['username']} hit {$odata['username']} doing $mydamage damage ({$odata['hp']})</font><br />\n";
}
else
{
$utext = "<font color=red>{$_GET['nextstep']}. You tried to hit {$odata['username']} but missed ({$odata['hp']})</font><br />\n";
$_SESSION['attacklog'].="<font color=red>{$_GET['nextstep']}. {$ir['username']} tried to hit {$odata['username']} but missed ({$odata['hp']})</font><br />\n";
$youmiss=1;
}
if($odata['hp'] <= 0)
{
$odata['hp']=0;
$_SESSION['attackwon']=$_GET['ID'];
$sql = sprintf("UPDATE users SET hp=0, fighting=0, onetimeattack=0 WHERE userid=%d", $_GET['ID']);
$db->query($sql);
$res=sprintf("UPDATE users SET fighting = 0, onetimeattack=0 WHERE userid=%d", $ir['userid']);
$db->query($res);
$_GET['bounty'] = abs(@intval($_GET['bounty']));
echo '<center><table width="800" height="300" cellpadding="0" cellspacing="0" border="0" class="attack">
<tr><td>

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$youdata['username'].'</center></td></tr>
<tr><td><center><image src="'.$aimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$youdata['hp'].'/'.$youdata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars['hpopp'].'" height="7"></center></td></tr></table>

</td><td width="540">

<table width="100%" height="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr><td><center>'.$utext.'</td></tr>
<tr><td><center>'.$otext.'</td></tr>
<tr><td><center><font color="yellow"><b>What do you want to do with '.$odata['username'].' now?</b></font><br />
<form action="attackwon.php?ID='.$_GET['ID'].'&bounty='.$_GET['bounty'].'" method="post"><input type="submit" value="Suck them Dry" /></form><br />
<form action="attackbeat.php?ID='.$_GET['ID'].'&bounty='.$_GET['bounty'].'" method="post"><input type="submit" value="BITE Them" /></form><br />
<form action="attacktake.php?ID='.$_GET['ID'].'&bounty='.$_GET['bounty'].'" method="post"><input type="submit" value="Steal their Soul" /></form><br />
<form action="attackdtag.php?ID='.$_GET['ID'].'" method="post"> <input type="submit" value="Take Dog Tag" /></form></center>
</tr></td></table>


</td><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$odata['username'].'</center></td></tr>
<tr><td><center><image src="'.$oaimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$odata['hp'].'/'.$odata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars2['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars2['hpopp'].'" height="7"></center></td></tr></table>

</td></tr></table>

</td></tr>
</table>';

}
else {
//choose opp gun
$sql = sprintf("SELECT i.* FROM  items i  WHERE i.itmid IN(%d, %d)", $odata['equip_primary'], $odata['equip_secondary']);
$eq=$db->query($sql);
if(mysql_num_rows($eq) == 0)
{
$wep="Fists";
$dam=(float)((((float) ($odata['strength']/$ir['guard']/100)) +1)*(rand(8000,12000)/10000));
}
else
{
$cnt=0;
while($r=$db->fetch_row($eq))
{
$enweps[]=$r;
$cnt++;
}
$weptouse=rand(0,$cnt-1);
$wep=$enweps[$weptouse]['itmname'];
$dam=(float) (($enweps[$weptouse]['weapon']*$odata['strength']/($youdata['guard']/1.5))*(rand(8000,12000)/10000));
}
$hitratio= max(10,min(60*$odata['agility']/$ir['agility'],95));
if(rand(1,100) <= $hitratio)
{
$sql = sprintf("SELECT i.armor FROM items i WHERE itmid=%d ORDER BY rand()", $ir['equip_armor']);
$q3=$db->query($sql);
if($db->num_rows($q3))
{
$dam-=$db->fetch_single($q3);
}
if($dam < -100000) { $dam=abs($dam); }
else if($dam < 1) { $dam=1; }
$crit=rand(1,40);
if($crit==17) { $dam*=rand(20,40)/10; } else if($crit==25 or $crit == 8) { $dam/=(rand(20,40)/10); } 
$dam=round($dam);
$youdata['hp']-=$dam;
if ($youdata['hp']==1) { $dam+=1; $youdata['hp']=0; }
$sql = sprintf("UPDATE users SET hp=hp-%d WHERE userid=%d", $dam, $userid);
$db->query($sql);
$ns=$_GET['nextstep']+1;
$otext = "<font color=blue>{$ns}. Using $oabbr $wep {$odata['username']} hit you in the {$area} doing $dam damage ({$youdata['hp']})</font><br />\n";
$_SESSION['attacklog'].="<font color=blue>{$ns}. Using $oabbr $wep {$odata['username']} hit {$ir['username']} doing $dam damage ({$youdata['hp']})</font><br />\n";
}
else
{
$ns=$_GET['nextstep']+1;
$otext = "<font color=red>{$ns}. {$odata['username']} tried to hit you but missed ({$youdata['hp']})</font><br />\n";
$_SESSION['attacklog'].="<font color=blue>{$ns}. {$odata['username']} tried to hit {$ir['username']} but missed ({$youdata['hp']})</font><br />\n";
$oppmiss=1;
}
if($youdata['hp'] <= 0)
{
$youdata['hp']=0;
$_SESSION['attacklost']=1;
$sql = sprintf("UPDATE users SET hp=0, fighting=0, onetimeattack=0 WHERE userid=%d", $userid);
$db->query($sql);
$res=sprintf("UPDATE users SET fighting = 0, onetimeattack=0 WHERE userid=%d", $odata['userid']);
$db->query($res);
echo '<center><table width="800" height="300" cellpadding="0" cellspacing="0" border="0" class="attack">
<tr><td>

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$youdata['username'].'</center></td></tr>
<tr><td><center><image src="'.$aimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$youdata['hp'].'/'.$youdata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars['hpopp'].'" height="7"></center></td></tr></table>

</td><td width="540">

<table width="100%" height="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr><td><center>'.$utext.'</td></tr>
<tr><td><center>'.$otext.'</td></tr>
<tr><td><center><font color="red">Your dead!</font><br /><form action="attacklost.php?ID='.$_GET['ID'].'" method="post"><input type="submit" value="Continue" /></tr></td></table>


</td><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$odata['username'].'</center></td></tr>
<tr><td><center><image src="'.$oaimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$odata['hp'].'/'.$odata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars2['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars2['hpopp'].'" height="7"></center></td></tr></table>

</td></tr></table>

</td></tr>
</table>';
}
}
}
else if ($odata['hp'] < 5)
{
print "You can only attack those who have health";
$h->endpage();
exit;
}


else if ($ir['gang'] == $odata['gang'] && $ir['gang'] > 0)
{
print "You are in the same gang as {$odata['username']}! What are you smoking today dude!";
$h->endpage();
exit;
}
else if ($youdata['energy'] < $youdata['maxenergy']/2)
{
print "You can only attack someone when you have 50% energy";
$h->endpage();
exit;
}
else if ($youdata['location'] != $odata['location'])
{
print "You can only attack someone in the same location!";
$h->endpage();
exit;
}
else
{
}
print "</td></tr>";
if($youdata['hp'] <= 0 || $odata['hp'] <= 0)
{
print "</table>";
}
else
{


$sql = sprintf("SELECT i.* FROM  items i  WHERE i.itmid IN(%d, %d)", $ir['equip_primary'], $ir['equip_secondary']);
$mw=$db->query($sql);
if($db->num_rows($mw) > 0)
{
while($r=$db->fetch_row($mw))

{
$_SESSION['attacking']=2;
$sql2 = sprintf("UPDATE users SET fighting=%d, onetimeattack=10 WHERE userid=%d", $ir['userid'], $odata['userid']);
$db->query($sql2);
$sql3 = sprintf("UPDATE users SET fighting=%d, onetimeattack=10 WHERE userid=%d", $odata['userid'], $ir['userid']);
$db->query($sql3);
if(!$_GET['nextstep']) { $ns=1; } else { $ns=$_GET['nextstep']+2; }
if($r['itmid']==$ir['equip_primary'])
{
if(!$r['itmpic']) { $prim = "<a href='attack.php?nextstep=$ns&ID={$_GET['ID']}&wepid={$r['itmid']}&bounty={$_GET['bounty']}'><br /><br />{$r['itmname']}</a><br />"; } else {
$prim = "<a href='attack.php?nextstep=$ns&ID={$_GET['ID']}&wepid={$r['itmid']}&bounty={$_GET['bounty']}'><image src='/itmpics/{$r['itmpic']}' width='90' height='90'></a><br />";
}
}
if($r['itmid']==$ir['equip_secondary'])
{

if(!$r['itmpic']) { $sec = "<a href='attack.php?nextstep=$ns&ID={$_GET['ID']}&wepid={$r['itmid']}&bounty={$_GET['bounty']}'><br /><br />{$r['itmname']}</a><br />"; } else {
$sec = "<a href='attack.php?nextstep=$ns&ID={$_GET['ID']}&wepid={$r['itmid']}&bounty={$_GET['bounty']}'><image src='/itmpics/{$r['itmpic']}' width='90' height='90'></a><br />";
}

}
}
}
else
{
print "You have nothing to fight with.";
}
print "</table>";
$vars['hpperc']=round($youdata['hp']/$youdata['maxhp']*100);
$vars['hpopp']=100-$vars['hpperc'];
$vars2['hpperc']=round($odata['hp']/$odata['maxhp']*100);
$vars2['hpopp']=100-$vars2['hpperc'];
print "";

//iamwickeds attack mod main modifaction.

global $oarea, $area, $oaimage, $aimage, $button;

//iamwickeds attack mod main modifaction.

if(!$oaimage) { $oaimage="attack/none.jpg"; }
if(!$aimage) { $aimage="attack/none.jpg"; }
if($oppmiss == 1) { $missgraphics = rand(1,5); $oarea=""; $aimage="attack/miss{$missgraphics}.jpg"; }
if($youmiss == 1) { $missgraphics = rand(1,5); $uarea=""; $oaimage="attack/miss{$missgraphics}.jpg"; }

if(strlen($youdata['username']) > 12) { $youdata['username'] = "<marquee scrollamount='2'>".$youdata['username']."</marquee>"; }
if(strlen($odata['username']) > 12) { $odata['username'] = "<marquee scrollamount='2'>".$odata['username']."</marquee>"; }

echo '<center><table width="800" height="300" cellpadding="0" cellspacing="0" border="0" class="attack">
<tr><td>

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$youdata['username'].'</center></td></tr>
<tr><td><center><image src="'.$aimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$youdata['hp'].'/'.$youdata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars['hpopp'].'" height="7"></center></td></tr></table>

</td><td width="540">';
if($button) {
echo $button;
}
else
{
echo '<table width="100%" height="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr><td colspan=2><center>'.$utext.'</td></tr>
<tr><td colspan=2><center>'.$otext.'</td></tr>
<tr><td><center><div class="weaponback">'.$prim.'</div></td><td><center><div class="weaponback">'.$sec.'</div></td></tr></table>';
}
echo '</td><td width="120">

<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" class="text">
<tr valign="top"><td><center>'.$odata['username'].'</center></td></tr>
<tr><td><center><image src="'.$oaimage.'"></center></td></tr>
<tr valign="top"><td><center><font color="white">'.$odata['hp'].'/'.$odata['maxhp'].'</font><br /><image src="greenbar.png" width="'.$vars2['hpperc'].'" height="7"><image src="redbar.png" width="'.$vars2['hpopp'].'" height="7"></center></td></tr></table>

</td></tr></table>

</td></tr>
</table>';
}
$h->endpage();
?>
Link to comment
Share on other sites

It has its reasons as to why your not getting that much help I suppose, can't really blame the community for it. But for the right price, you'll always find someone that can solve your issue, however it might be more than a dollar :) That being said..

 

mydamage=(float) (($r1['weapon']*$youdata['strength']/($odata['guard'])));

This is one of the calculations done for the damage of the attacker.. You might want to change that.

Apart from that, your users/weapons stats are important as well. It's not that easy to analyze a problem that has no error, but it just bad design or programming

  • Like 1
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.

 Share

×
×
  • Create New...