benlakaz Posted August 17, 2009 Posted August 17, 2009 Hello to All, Is there any mod that when a user equip weapon there will be additional stat bonus. For example when you equip a sword you get 100 agility. Thanks in advance.. Quote
Adil Posted August 17, 2009 Posted August 17, 2009 Re: Weapon with stats Erm thats quite easy to do but wouldnt it be a bit stupid. As people can just equip then equip a million times and get thier agility very high. Unless you do something like you can only do it once. Quote
Haunted Dawg Posted August 17, 2009 Posted August 17, 2009 Re: Weapon with stats Simple, when equiping, you give them the agility. when un equiping, you take it away. Quote
benlakaz Posted August 21, 2009 Author Posted August 21, 2009 Re: Weapon with stats What code should i add here to make the item when equip add stats.. thanks in advance <?php include "globals.php"; $_GET['ID'] = abs((int) $_GET['ID']); $id=$db->query("SELECT iv.*,it.* FROM inventory iv LEFT JOIN items it ON iv.inv_itemid=it.itmid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid LIMIT 1"); if($db->num_rows($id)==0) { print "Invalid item ID"; $h->endpage(); exit; } else { $r=$db->fetch_row($id); } if(!$r['weapon']) { print "This item cannot be equipped to this slot."; $h->endpage(); exit; } if($_GET['type']) { if(!in_array($_GET['type'], array("equip_primary", "equip_secondary"))) { print "This slot ID is not valid."; $h->endpage(); exit; } if($ir[$_GET['type']]) { item_add($userid, $ir[$_GET['type']], 1); } item_remove($userid, $r['itmid'], 1); $db->query("UPDATE users SET {$_GET['type']} = {$r['itmid']} WHERE userid={$userid}"); print "Item {$r['itmname']} equipped successfully."; } else { print "<h3>Equip Weapon</h3><hr /> <form action='equip_weapon.php' method='get'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Please choose the slot to equip {$r['itmname']} to, if there is already a weapon in that slot, it will be removed back to your inventory. <input type='radio' name='type' value='equip_primary' checked='checked' /> Primary <input type='radio' name='type' value='equip_secondary' /> Secondary <input type='submit' value='Equip Weapon' /></form>"; } $h->endpage(); ?> Quote
glg216 Posted August 24, 2009 Posted August 24, 2009 Re: Weapon with stats the way i did it on my game, is to add the extra stats on the item table. in the attack page you query for the weapon info and just add the extra stats to the $mydamage Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.