Jump to content
MakeWebGames

newttster

Members
  • Posts

    514
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by newttster

  1. I've tried that both ways and still end up with the same result either way.
  2.   The first screen shot shows the stats that are involved. I had everything print to the screen just to make sure that they were holding values.
  3. I understand that, and I have no idea why based on the code. It's not "stepping" the way it should. The health declarations are there, the damage declarations are there, the declaration to subtract the damage from the health is there, the hit ration is there ... no matter what I try I can not get them to hit instead of miss.
  4. Okay ... I have been working on this for over a week now, and I'll be damned if I can figure out why it is not working correctly. It is not deducting the damage from the health the way it should. I have made sure that the variables all are actually picking something up, there is no divide by zero errors. I am going to show you the one that is glaringly obvious that it is not working. I have chosen an NPC that has stats much larger than the ones I am testing with. I am including screenshots of the actual variables printing to the screen proving that they hold a value, and of the fight itself. It keeps "stalemating" when you can see by the stats printed that there is no way this should happen. It should be one shot and I am dead. Not happening. This also happens when attacking lesser NPCs as well. When they should be a one hit kill, it is taking 8-10 hits to do so.     And the code: //~~~~~~~~~~~~~~~~~~~~~~ Getting weapon information $themprimary=$db->query("SELECT * FROM items WHERE itmid=".$them['equip_primary'].""); $themfirst=$db->fetch_row($themprimary); $themsecondary=$db->query("SELECT * FROM items WHERE itmid=".$them['equip_secondary'].""); $themsecond=$db->fetch_row($themsecondary); $meprimary=$db->query("SELECT * FROM items WHERE itmid=".$me['equip_primary'].""); $mefirst=$db->fetch_row($meprimary); $mesecondary=$db->query("SELECT * FROM items WHERE itmid=".$me['equip_secondary'].""); $mesecond=$db->fetch_row($mesecondary); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Getting health and armor information $mehealth=$me['hp']; $themhealth=$them['hp']; $eq1=$db->query("SELECT i.head FROM items i WHERE itmid={$them['equip_head']} ORDER BY rand()"); $eq2=$db->query("SELECT i.neck FROM items i WHERE itmid={$them['equip_neck']} ORDER BY rand()"); $eq3=$db->query("SELECT i.arms FROM items i WHERE itmid={$them['equip_arms']} ORDER BY rand()"); $eq4=$db->query("SELECT i.torso FROM items i WHERE itmid={$them['equip_torso']} ORDER BY rand()"); $eq5=$db->query("SELECT i.legs FROM items i WHERE itmid={$them['equip_legs']} ORDER BY rand()"); $eq6=$db->query("SELECT i.feet FROM items i WHERE itmid={$them['equip_feet']} ORDER BY rand()"); $eq7=$db->query("SELECT i.special1 FROM items i WHERE itmid={$them['equip_special1']} ORDER BY rand()"); $eq8=$db->query("SELECT i.special2 FROM items i WHERE itmid={$them['equip_special2']} ORDER BY rand()"); $eq9=$db->query("SELECT i.special3 FROM items i WHERE itmid={$them['equip_special3']} ORDER BY rand()"); $themarmor=0; if($db->num_rows($eq1)) { $themarmor+=$db->fetch_single($eq1); } if($db->num_rows($eq2)) { $themarmor+=$db->fetch_single($eq2); } if($db->num_rows($eq3)) { $themarmor+=$db->fetch_single($eq3); } if($db->num_rows($eq4)) { $themarmor+=$db->fetch_single($eq4); } if($db->num_rows($eq5)) { $themarmor+=$db->fetch_single($eq5); } if($db->num_rows($eq6)) { $themarmor+=$db->fetch_single($eq6); } if($db->num_rows($eq7)) { $themarmor+=$db->fetch_single($eq7); } if($db->num_rows($eq8)) { $themarmor+=$db->fetch_single($eq8); } if($db->num_rows($eq9)) { $themarmor+=$db->fetch_single($eq9); } $eq1=$db->query("SELECT i.head FROM items i WHERE itmid={$me['equip_head']} ORDER BY rand()"); $eq2=$db->query("SELECT i.neck FROM items i WHERE itmid={$me['equip_neck']} ORDER BY rand()"); $eq3=$db->query("SELECT i.arms FROM items i WHERE itmid={$me['equip_arms']} ORDER BY rand()"); $eq4=$db->query("SELECT i.torso FROM items i WHERE itmid={$me['equip_torso']} ORDER BY rand()"); $eq5=$db->query("SELECT i.legs FROM items i WHERE itmid={$me['equip_legs']} ORDER BY rand()"); $eq6=$db->query("SELECT i.feet FROM items i WHERE itmid={$me['equip_feet']} ORDER BY rand()"); $eq7=$db->query("SELECT i.special1 FROM items i WHERE itmid={$me['equip_special1']} ORDER BY rand()"); $eq8=$db->query("SELECT i.special2 FROM items i WHERE itmid={$me['equip_special2']} ORDER BY rand()"); $eq9=$db->query("SELECT i.special3 FROM items i WHERE itmid={$me['equip_special3']} ORDER BY rand()"); $mearmor=0; if($db->num_rows($eq1)) { $mearmor+=$db->fetch_single($eq1); } if($db->num_rows($eq2)) { $mearmor+=$db->fetch_single($eq2); } if($db->num_rows($eq3)) { $mearmor+=$db->fetch_single($eq3); } if($db->num_rows($eq4)) { $mearmor+=$db->fetch_single($eq4); } if($db->num_rows($eq5)) { $mearmor+=$db->fetch_single($eq5); } if($db->num_rows($eq6)) { $mearmor+=$db->fetch_single($eq6); } if($db->num_rows($eq7)) { $mearmor+=$db->fetch_single($eq7); } if($db->num_rows($eq8)) { $mearmor+=$db->fetch_single($eq8); } if($db->num_rows($eq9)) { $mearmor+=$db->fetch_single($eq9); } //~~~~~~~~~~~~~~~~~~~~~~~~ Attack started $hits=1; while($mehealth>0 && $themhealth >0)// If the fight last 100+ rounds it's a stalemate { if ($hits>100) { echo"<center><h1><font color='red'><u>STALEMATE!</u></font></h1> You lasted 100 rounds with ".$them['username']."<br /> There is no winner here.<br /> Go do some more training.<br /> Maybe then you might be able to beat them.<br /> <a href='explore.php'>Back to town</a><br /> <br />{$_SESSION['attacklog']}</center>"; $h->endpage(); $_SESSION['attacking']=0; $me['attacking']=0; $db->query("UPDATE users SET attacking='0', hp='$mehealth' WHERE userid=$userid"); $db->query("UPDATE users SET hp = '$themhealth' WHERE userid={$_GET['ID']}"); exit; } $_SESSION['attacklog'].="<b>Round {$hits}:</b> $mehealth Health <b>VS</b> $themhealth Health<br />\n"; // Declaring attacking persons fighting stats, hit ratio and damage if($me['equip_primary']>0 && $me['equip_secondary']>0) { $mekill=(int)((($mefirst['weapon'] + $mesecond['weapon']) * $me['strength'] / ($them['defense']/.76)) * (rand(6000,7000)/1000)); } elseif($me['equip_primary']>0 && $me['equip_secondary']==0) { $mekill=(int)(( $mefirst['weapon'] * $me['strength'] / ($them['defense']/.76)) * (rand(6000,7000)/1000)); } elseif($me['equip_primary']==0 && $me['equip_secondary']>0) { $mekill=(int)(( $mesecond['weapon'] * $me['strength'] / ($them['defense']/.76)) * (rand(6000,7000)/1000)); } else { $mekill=(int)((((int)($me['strength'] / $them['defense'] / 100))+1) * (rand(6000,7000)/1000)); } $myhitratio=max(10,min(20*(($me['speed']/$them['agility'])),95)); $mydamage=($mekill-$themarmor); // Delcaring attacked persons fighting stats, hit ration and damage if($them['equip_primary']>0 && $them['equip_secondary']>0) { $themkill=(int)((($themfirst['weapon'] + $themsecond['weapon']) * $them['strength'] / ($me['defense']/.76)) * (rand(6000,7000)/1000)); } elseif($them['equip_primary']>0 && $them['equip_secondary']==0) { $themkill=(int)(( $themfirst['weapon'] * $them['strength'] / ($me['defense']/.76)) * (rand(6000,7000)/1000)); } elseif($them['equip_primary']==0 && $them['equip_secondary']>0) { $themkill=(int)(( $themsecond['weapon'] * $them['strength'] / ($me['defense']/.76)) * (rand(6000,7000)/1000)); } else { $themkill=(int)((((int)($them['strength'] / $me['defense'] / 100))+1) * (rand(6000,7000)/1000)); } $theirhitratio=max(10,min(20*(($them['speed']/$me['agility'])),95)); $theirdamage=($themkill-$mearmor); //If attackers or attackeds damage is less then 1 then damage = 1 $mydamage=($mydamage<1) ? 1 : $mydamage; $theirdamage=($theirdamage<1) ? 1 : $theirdamage; //Start the rounds of attack if($wait==0) { if(rand(1,100)<=$myhitratio) { $themhealth=$themhealth-$mydamage; $_SESSION['attacklog'].="<font color='green'> {$me['username']} hit {$them['username']} doing ".number_format($mydamage)." damage.</font><br />\n"; } else { $_SESSION['attacklog']."{$me['username']} tried to hit {$them['username']} but missed.<br />\n"; } } else { $wait=0; } if($themhealth>0) { if(rand(1,100)<=$themhitratio) { $mehealth=$mehealth-$theirdamage; $_SESSION['attacklog'].="<font color='red'>{$them['username']} hit {$me['username']} doing ".number_format($theirdamage)." damage.</font><br />\n"; } else { $_SESSION['attacklog'].="{$them['username']} tried to hit {$me['username']} but missed.<br />\n"; } $hits++; } }   If you have any suggestions at all ... anything that will help me to get this working correctly. Thanks.
  5. On one of the youtube php learning sites ... It says that using echo ' blah ' is faster than echo "blah" or print "blah". I don't know if anyone has ever tested this or not. *shrugs* As Seker said ... different strokes and all that.
  6. *facepalms* I see it and can't believe it. What are the odds of that happening?
  7. Hi folks. I have added a drop into my main menu. I have succeeded in getting it there ... and got it working so that it redirects players to the right page. What I can't figure out how to do is to get it to look something like this. (yes ... this is from RoB ... but it was the only example that I could find). And where I have to put the script once it is done. I have looked at css and the like, but when it comes to graphics ... I haven't a clue on how to get it to work and what file it needs to be placed in.
  8. Seker ... this looks excellent. Once I get my files back and up and running, this is something that I will definately be using. Thank you for the mention ... it is appreciated, though not necessary. It is inspiring watching you ... makes me realize that although it is taking me forever to get things done for myself ... and with help of others ... that eventually I will succeed. Then again ... with the supposed end of the world coming in December ... I may be just banging my head against the wall for nothing! :)
  9. If $energy + $food <= $full { update users energy =energy plus food } If $energy + $food >$full { update users energy =maxenergy }   Something along those lines.
  10. Your last point ... join me if you trust me. You have shown no reason for anyone to trust you at this point. Have you dealt with anyone in this forum at any time that they could provide proof that you are trustworthy? You say in another post that the profit will be shared ... what profit? You don't even have a full game yet to even bring in any money to share the profit therein. Most games (not all) won't even realize a profit for about 6 months after they are up and running ... and that's being extremely optimistic from what I have been told. I'm not really trying to shoot you down ... but you may seriously want to rethink how you have approached this.
  11. I would have to say that I am like Seker in this respect. I know nothing about css or any of that so that part has been done for me. When it comes to the mods and how I want them to look .. well ... I'm all over the place with it. I get easily frustrated so when something doesn't work for me after trying to get it to work after three tries ... then I move onto something else. It may seem like a huge waste of time for most ... but believe it or not ... for myself I accomplish more this way. When I am trying to solve something in one mod ... the answer may/does come to me for one I have put aside. It's like going to sleep with an unsolved problem ... the solution presents itself to you by the time you wake up.
  12. For myself ... I prefer to measure success in stages. I am basing my opinion on a game. I imagine non-gaming sites would rate it differently. Getting your first page to display you want it to. Getting your first mod to work exactly the way you want it to. Getting your first player to sign up. Getting that first player who stays to actually play, not just "check" things out. Your first donation. People passing on the word about your site. Obviously you can see where I am going with this. As you feel "successsful" and take pride in each stage of the project as it is accomplished ... that to me is the pinacle of success.
  13. Request sent. Thank you.
  14. My apologies. I did not mean to offend any one that is not on that list. If this is something that you would be interested in doing for me ... I'd love to talk to you about it.
  15. o.O 3 days and no takers? I did say that I will pay for this if you are interested. ;)
  16. I am looking for one of the trusted coders that are found on Danny's list to write a mod for me. I will assist with this as much as I can if needed to do so. My time for the next few months has been reduced drastically otherwise I would try and muddle through on my own. Of course I am more than willing to pay you for your time. I know that you will be wondering what I need done and I will be more than happy to discuss that with you in private. I'm not sure if what I have in mind is unique or not and until I do ... I'd just as soon not give anything away publicly just yet. If you are interested, please pm me. Thank you.
  17. How would you do something like that? Could you not do that with a function as well? If level=1 and exp =75 then level =2 etc. That kind of thing.
  18. What voting page are you talking about? The sites that your players will vote on for your game? If that's the case ... I believe you have to register your game with these sites first and then set up the link one your in game voting page. I assume that that is how it is done.
  19. I've sent you the new one so that it can be added to the database. The name was changed when changing the host site. Thank you.
  20. MCCodes license checker: This is probably the most awaited tool. MCCodes license checker - a web based application for you to check if a game URL is running on a valid mccode license or not. If it’s not, then you can one-click-report it. This tool will help us track down unlicensed mccode games out there. URL to MCCodes license checker: http://license.mccodes.com/   That’s all for now. Respectfully, The MCCodes team.   Really? That's funny. I type in the name of my game (granted it is not live, nor anywhere near being close to that), yet is says that my license is invalid???
  21. If it's a post-apocalyptic wasteland theme ... how about "Yesterday's Gone"
  22. Do they support all the crons? Do they use cpanel?
  23. I am in the same boat as you. I feel for Peter and the situation that this has put him in ... as well as those of us that hosted with him. Getting some good solid recommendations would be greatly appreciated. It's a sad state of affairs when others take great delight in causing havoc and hardship to those that work hard to create something for others' enjoyment. Crap like this recent DDOS attack really pisses me off. There is no excuse for it.
  24. If you are so confident in this service that blocked an attack ... don't you think it would be nice to share the name of that service with others. Let the community share in this winfall. If it truely works ... this could save lots of money in having others secure your site. C'mon ... share!!! *facepalms*
  25. Can you be more specific?
×
×
  • Create New...