Also, the code for this system would be something that could be added in under a day, something like in the combine function (written in PHP because I'm not sure what language 14 is written in, and PHP is the easiest one to illustrate the idea in):
At the end, if $offer_item_combine is 1, then the item ids of all items in the synth box are identical, and an additional recipe is added to the recipes list -> an "upgrade" to the items in the box. From there, everything else should work properly; that is to say, the qualities of the items added in this way are added up, multiplied by some factor, and averaged out.Code:$item_ids = array(); for($i=0; $i<8; $i++) if( $in_synthbox_item->id > 0 ) array_push($item_ids, $in_synthbox_item->id ); if(count($item_ids) < 2) $offer_item_combine=0 else { $offer_item_combine=1 for($i=1; $i<count($item_ids); $i++) if($item_ids[$i] != $item_ids[$i-1]) $offer_item_combine=0; } OR: $total_combines=0; $combine_test=0; $offer_item_combine=1; for($i=0; $i<8; $i++) if( ( $curid = $in_synthbox_item->id[$i] ) > 0 ) { $total_combines++; if( $combine_test > 0 ) $offer_item_combine = ( $offer_item_combine > 0 && $combine_test == $curid ? 1 : 0 ); else $combine_test=$curid; } if($total_combines < 2) $offer_item_combine=0;
An easy way to figure out the result is just to do an instant combine, sort of like hasty hand. On success you upgrade the average quality of the items by 1, on failure you've damaged the components of all of the items trying to pull them apart and end up with a bunch of junk.
Less items combined = higher failure chance since you have less items to take apart and less room for error, so:
Success chance = 32 + ( 8 * number of items ) - The highest success chance is 96%, there should always be a chance of failure.
The total quality level value is, for each item, add the following: 0 for NQ, 1 for +1, 2 for +2, 3 for +3 (Only viable if ancient items are added).
So for a synth with 6 +2 items and 2 +1 items, we would get a value of 1.75 for total quality level.
If the synth is a success, +1 is added to this number, bringing us up to 2.75.
If the result is a decimal, we figure out:
$quality_increase_chance = ( ( $total_quality - rounddown($total_quality) ) * 100 )
In this case:
$quality_increase_chance = ( ( 2.75 - 2 ) * 100 )
$quality_increase_chance = ( .75 * 100 )
$quality_increase_chance = 75
if ( random(100) <= $quality_increase_chance ) you increase the quality by 1 HQ tier. If not, you get the lower tier. So in the case above, we have a 75% chance to get a +3 item and a 25% chance to get a +2 item.
Again, this may seem easy to get a +3 weapon, but you'd have to do 512 synths (more +1's made lowers this number, but a failure in a higher tier combine would set you back a hundred or more synths).