Jump to content

Monkuar

Members
  • Posts

    987
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Monkuar

  1. Would never, EVER use a framework ontop of PHP, just simply stupid and you would need to learn more code. This about the same logic as a human having to learn Arabic just to visit Iraq or whatnot. I heard FluxBB software is going to try to convert their code to laravel or whatever that crap is, lol going to be bloated as crap, aint gonna be lightweight anymore, it's a dam shame really. Old fashion php with properly casted variables and session handling is fine in my book, no need extra garbage ontop of code. Have a nice day
  2. Nice I just spent 10 minutes accidentally writing in tags and clicked to add my post and all my data was gone, lovely ipb 3.1 sht.
  3. example: //Calculate monster damage... $monsterdamage = rand($monsterdata['damage']/2, $monsterdata['damage']); if ($monsterdamage == $monsterdata['damage']/2){ $monstertext = ' missed <i>part of</i> his attack, dealing '.($monsterdata['damage']/2).' damage!'; }else{ $monstertext = ' hit you with '.$monsterdamage.' damage!'; } Example if $monsterdata['damage'] = 10 or 20, it works fine, but if it's like 500 or 200, the chance for it to equal the same is very LOW. I'm looking for something like: -> 10% chance to deal Critical strike (*2) regardless of the $monsterdata['damage'] variable, even if it's over 9000. -> 20% chance to deal a finishing blow(*2.3) damage, or whatever, you get the idea? Any help? Thanks! I'm just confused because if the $monsterdata['damage'] is like 5000, how would I calculate of this number having a 10% chance to do a critical strike as in-compared to $monsterdata['damage'] mob being just 250 damage? LOL I'm lost
  4. topic title says it all: $rpgdata['max_dmg'] = 15; $rpgdata['min_dmg'] = 3; $maindamage = ($rpgdata['max_dmg'] / $rpgdata['min_dmg']); $maindamage will be output of 3. But this is not correct, a user having 3 to 15 min damage, needs to output atleast 10 damage per swing.... how to increase the value of 3 to atleast 7 or more as in this case? or wouldn't it be better to do something like? $maindamage = rand($rpgdata['min_dmg'], $rpgdata['max_dmg']); ? Not sure ty
  5. return array('equiplist'=>$equipitems,'equiptooltip'=>$tooltipequiparray); BOOM!! EPIC! Thank u so much @Irate, Marked ur reply as best answer, ty sir
  6. array would work then? ima try it
  7. function test(){ return .= "test1"; return .= "test2"; } gives error, I need to return 2 things, to call on other functions, how?
  8. I'm doing this so people cannot spam attacks vs mob. session_start(); if(isset($_SESSION['last_visit']) && time() - $_SESSION['last_visit'] < 2.5) { echo '<script>createToast("How can you swing your sword so fast?","danger",2500);</script>';exit; } $_SESSION['last_visit'] = time(); Also everything is serverside, and the mob will eventually die, or your character will die again.. Once that happens, how would I make it so the user revives? Do a small number verification captcha to have your character revive? (Seems like it would help mitigate automated refreshes?)
  9. Would a more simplier idea be, just give users 150 "Stamina" per day? Each mob or XX amount of mobs killed, they lose X amount of stamina? Then they can either buy extra stamina through in-game cash shop/points/gold/etc? The token system, is like a column name in their character row, with a timestamp being updated? Or a table called character_tokens, with all the game mechanics and then fill that with their user_id, character_id, timestamp/etc?
  10. like I don't want people to beable to use tamper data and just send in requests "ATTACKMOnster" "health/etc".... I need to setup some type of button or $_POST that can only be clicked/etc (Serverside too) if a user is actually killing a monster or clicking "Attack"....... Any idea? Hard to explain, but I need some type of mini captcha system in-game while people are attacking/killing mobs, so they just cant macro or refresh crap. (It's possible I guess to set a row in their column with a timestamp) via MYSQL and don't let them spam attacks/etc ( Kind of like a speedhack check? ) thx EDIT: TLDR.. Think of a hack in a MMORPG that sucks all the mobs and autoattacks, same thing here, but with PHP, how to stop that?
  11. use htmlspecialchars to stop that crap dont let users EVER allow to use html
  12. $getequip = $db->query("SELECT max(min_dmg) as min,max(max_dmg) as max from items_equip where name = 'Sword' "); while($equipdata = $db->fetch_assoc($getequip)){ $mindamage = rand(1, $equipdata['min']); $maxdamage = rand(1, $equipdata['max']); } echo ' Min Dmg Possibilites: '.$mindamage.' || MAX Damage: '.$maxdamage.''; I think this works right? If so I marked as solved for now ty
  13. I have a row in items_equip table: short sword | 3 | 10 3 is min_dmg 10 is max_dmg Let's a say a person kills a mob (to get exp), I need mysql to select a random row in my items_equip table and insert it into items_user_equip. But while doing the insertion function i need MYSQL to randomize the values of min_dmg and max_dmg no higher than 3, 10 respectively. So, maybe it could do 2 | 7 or something (2min, 7max) possible? 3 | 10 are fixed values in the row column already....
  14. Yes move.php would be the update function part.... I'm looking for an output. Sword is in 1 Iron Helmet is in 7. I have a Grid with CSS/html displayed, how to show the items in the correct box? :PPPP (I get data from mysql, but how to show)
  15. Okay, so for each user's item that the person owns, it has to have a row/column name "gridnumber" or something. (The position). So let's say: Long sword is 1 Iron Helmet is 7 Then I need to update these if a user drags them or presses a button. I can do ajax/js later. But that would right? Now I have Long Sword 1 and Iron Helmet 7. how would I show these in that grid via output? I'm getting closer to this ty all but please pitch in any more help ty
  16. Because if a user moves it , it needs to remember the location xD
  17. Well the items will be in users_user_items or whatever, if a user has Long Sword, it will be unique to him, and have it's own id to that player. I also will have a main items table to keep track of items/etc I'm still completely lost... So let's say user a finds a Long sword, how would i sychronise that unique item name to a position in his inventory? I just don't get it :/
  18. would each slot need to be a row in the database then? im a bit confused, sorry
  19. I need some help/idea on how to store user's items in their inventory. Like you see on mmorpg's/etc. The inventory page looks like this: Let's say I have 5 items in my mysql row. Long Sword Baseball Cap Magic Primer Magic Seal Scrolls Iron Belt All stores in my mysql row. Taking up 5 rows. How would I spit out these items into the users inventory page based on location? (Order/Sort) and which box they moved it to? Let's say, they want to put Iron Belt to the bottom right box, how would I store that in mysql? Would I need a new table like users_inventoryslots or something to store what each items location is on each user's inventory? It's really confusing, hope u can help, thanks! Again, so if the Iron Belt is moved to the buttom right box. Let's say they move the Magic Primer item to the bottom left box, how to store information like this? (for each individual item must be stored server side.. not sure how with mysql) I know the mysql functions to update/insert and php code, but not sure how to actually have the items show up on each boxes in people's inventory, this is where my brain is stuck at.
  20. Could careless if it's a myth, web 2.0 means fancy and this forum looks 100x better than the old phpfreaks board? I'm not ranting, im stating fact, using twitter w/o a qualified/huge business is worthless. Don't know why you cant see that. Anyone using twitter for social media for "personal" reasons should be ashamed of themselves, that site is a joke, twitter is the new myspace, it's dying. I'd rather see ceo's and admin's use their own site for communication then some 3rd party site. A bloke? Give me one reason why you as a consumer user would use twitter? Only people that benefit from twitter is when they have hundreds of thousands of followers, kid you not, over 30% of them are bots anyways. But please, move along and keep telling me why Twitter is so good, lols I havn't heard one argument, bunch of semantics.
  21. My cat issues are irrelevant, lol (It was a mistake, you don't understand) Anyways, yes that's great you met your husband on twitter and got some coupon codes, but the majority of developers/coders hate twitter with a passion. What's next a PHPFreaks FB group? Lol I mean comon Twitter should only be used by LARGE companies or celebrities. Not indie small companies sites. But, phpfreaks has grown into a larger site than 2-3 years ago, most likely because of the forum software upgrade, it makes it look very web 2.0 and fancy. But I just don't think having a twitter would do any help at all, just more work for the admin and what does the phpfreaks admin need to tweet? "Hey everyone, site will be down tomorrow 3-5pm/blah/blah", lol everyone would of checked/saw that on the forum announcements anyways. just my 2 cents
  22. Vouch 100%, Chrome >all. Chrome dev tools are so much easier to familiarize yourself with, when doing it on firefox, feels like a bloated system with to much tabs/content/etc. IMO ....
  23. Not to be rude, but twitter is a joke and the most worthless type of way to advertise a company. Maybe unless PHPFreaks had 20,000 more users online, sure. but now? I dont think it's worth it
  24. I disagree, it doesn't look anything wordpress/generic like. (From what I've seen..) It just looks plain, a logo and a navigation bar and a couple boxes... It looks decent and it looks fluid, it just doesn't look professional. (my critique)
  25. I Like the background image, menu and the dark theme, it looks good imo. Only thing I don't think looks good is your user photo gradient background image layer. Image on the top left almost looks borderline nazi logo, lol change that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.