Jump to content
MakeWebGames

Recommended Posts

Posted

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 ****

Posted (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 by illusions
Posted

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

Posted

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?

Posted

*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:

Posted

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 :)

Posted

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...

Posted

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.

Posted

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.

Posted

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

  • 6 months later...
Posted

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?

Posted (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 by Smokey
  • 3 months later...
  • 8 months later...
Posted

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

image1.jpg.0502f00b6245635e24d87806391c88fb.jpg

donthaveenough.jpg.656a670b1230dfffe8d57deebf5e65bc.jpg

success.jpg.138f18e9991b5b08a721ee5c964d6823.jpg

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.

×
×
  • Create New...