Uridium Posted March 1, 2011 Posted March 1, 2011 Yes its been a while since i posted a decent mod but iv'e been busy on other things.. So decided to dust off the old MCC and think up a new Idea This Idea is quite simple make an Item Combinable to create another Item Im still writing the script which is going pretty well but what this does is For example if a user has a potion in their inventory that can be combined a new link appears to combine with another item, The combined item is then placed into the users Inventory to make the first potion more powerful. I'll post script once ive tested it... ***** THIS IS NOT A QUANTIFYING SCRIPT **** Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 (edited) Redone a bit of this so now you can combine both Items and Weapons to create something else. SQL [mysql]ALTER TABLE `items` ADD `combine` INT( 11 ) NOT NULL DEFAULT '0' AFTER `itmbuyable` ; [/mysql] Now open up inventory.php look for You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and underneath add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. now open up staff_items.php in the adding new item part look for You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then Add underneath You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in the INSERT query for adding an item add ,{$_POST['combine']} After the ,{$_POST['itemsellprice']} Now goto the edit Item find You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And underneath add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in the edit item part for the INSERT find ,$itmbuy, and next to it put '{$_POST['combine']}', now call this file combine.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now when your created or editing an Item in the combine part put the ID number of the item you want it to be combined with from the staff_items.php file Edited September 15, 2012 by illusions Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 This script may come in handy for those who wish to add something like BROKEN AXE as an Item and when Combined Creates a New Axe in replace of the old one or a Rusty Jail Key into a Usable Jail Key Quote
Paul Evans Posted March 1, 2011 Posted March 1, 2011 I like it illusions it's quite a good little script for a newb :) lol Quote
newttster Posted March 1, 2011 Posted March 1, 2011 Illusions ... you must be a mind reader ... I was looking for something like this yesterday and couldn't find it!! Woot!!! Thanks. I have a quick question though ... is there a way of combining multiple items to create one. Say you need 50 of item a combined with 1 of item b to make item c. Can this be done without tons of additional coding? Or do you think that I should keep creating new items till I get the final product that I want? Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 The probably is matey but this script doesnt support multiple items Had a nightmare just getting 1 item to work :) Quote
newttster Posted March 1, 2011 Posted March 1, 2011 *laughs* Fair enough. I hope you don't mind but I am going to try and see if I can get it to suit my needs after much hair pulling, screaming and kicking my feet. And months later I might succeed. :whistling: Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 Its a free mod do with it as you wish just leave the copright intact and your fine :) Quote
newttster Posted March 1, 2011 Posted March 1, 2011 Sweet. Thanks. I certainly will. :thumbsup: Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 Infact newttster your question before it is actually possible use the same principal as a bove BUT when deleting a item make it delete the amount you want then create a new combine for B and when thats combined it produces C :) Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 For those that are Interested in how this script was made. I used the orig V2 itemuse.php took out what was not needed and replaced with the new code.. inventory.php i just renamed the use link to combine and staff.php just added 4 new lines and edited the sql to insert the new one... All in all this mod took about 30 mins to complete using waht was already in the scripts... Quote
Uridium Posted March 1, 2011 Author Posted March 1, 2011 Update this is the same but with additional amount of items needed to create a new one which was mentioned by newttster You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
newttster Posted March 1, 2011 Posted March 1, 2011 Thank you, Illusions. This will be an amazing addition for what I have planned. I'll also be using your idea about removing some of the code to better suit my needs. You da man!!!! You must be psychic!!! Thank you for all of your work. Quote
iseeyou94056 Posted March 6, 2011 Posted March 6, 2011 how do i make it so that i have to combine two different items indtead of two of the same items Quote
Uridium Posted March 6, 2011 Author Posted March 6, 2011 youd need to create 2 new items bith that can be combined so example ID 11 and ID 12 so ID 11 Creates ID 12 then ID 12 creates the final outcome ID 13 Just to NOTE ABOVE you dont need to create NEW ITEMS to make the combine feature woirk you could just Edit any exsisting items to make them combinable Quote
Smokey Posted September 22, 2011 Posted September 22, 2011 Ok, say you want to combine 2 different items to make one, lets say itemid's 10 and 12...getting it to do this is easy enough, but, the problem im having is combining items that arent there. Say i have itemid 10 but i dont have any itemid 12, and i click combine next to itemid 10 it will create the new item anyway, so how would you keep from making the new item unless you have BOTH the original items? Quote
lucky3809 Posted September 23, 2011 Posted September 23, 2011 (edited) make an IF statement such as example... if ($r['itemid'] == 12 && $r['itemid'] == 10){ //combine } else { //Can't Combine } Edited September 23, 2011 by lucky3809 Quote
Smokey Posted September 25, 2011 Posted September 25, 2011 (edited) This is what I have and for some reason it just gives me the else message all the time, no matter if i have the items or not You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It works fine if its just if($r['itmid'] == 168) so its only checking to see if its the itemid i click to make the item, not whether i have them both in my inventory. Edited September 25, 2011 by Smokey Quote
Uridium Posted September 15, 2012 Author Posted September 15, 2012 This script has been rewritten you no longer need to add anything to the script as before you had to add the ID numbers of the newly created item to be given it will now also allow you to add how many of the same item is needed to create the new item Image1 shows items that can be created donthaveenough shows if you have enough of the items required success shows that all has gone well and to give you your new item 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.