Jump to content
  • 0

Question regarding the "produce" script command


Bahmut

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  382
  • Reputation:   38
  • Joined:  01/17/12
  • Last Seen:  

Hello,

when using the produce script command there is a chance that it fails and no item is produced, but what is the exact success chance or how is it calculated?

There is no documentation on this. Atleast I found none. From script_commands.txt:

*produce <item level>;

This command will open a crafting window on the client connected to the invoking
character. The 'item level' is a number which determines what kind of a crafting
window will pop-up. You can see the full list of such item levels in
'db/produce_db.txt' which determines what can actually be produced.
The window will not be empty only if the invoking character can actually produce
the items of that type and has the appropriate raw materials in their inventory.

Valid item levels are:
1   - Level 1 Weapons
2   - Level 2 Weapons
3   - Level 3 Weapons
21  - Blacksmith's Stones and Metals
22  - Alchemist's Potions, Holy Water, Assassin Cross's Deadly Poison
23  - Elemental Converters

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  382
  • Reputation:   38
  • Joined:  01/17/12
  • Last Seen:  

I created a new entry with a new item level in the produce_db.txt and so there is no skill to relate to:

7060,50,0,0,29101,1

EDIT:

Found it by searching the source and I have to say the skill_produce_mix function is very ugly. Default it's 50% success rate.

If you want to change it find this block in skill.c:

	   default:
			if (sd->menuskill_id ==	AM_PHARMACY &&
				sd->menuskill_val > 10 && sd->menuskill_val <= 20)
			{	//Assume Cooking Dish
				if (sd->menuskill_val >= 15) //Legendary Cooking Set.
					make_per = 10000; //100% Success
				else
					make_per = 1200 * (sd->menuskill_val - 10)
						+ 20  * (sd->status.base_level + 1)
						+ 20  * (status->dex + 1)
						+ 100 * (rnd()%(30+5*(sd->cook_mastery/400) - (6+sd->cook_mastery/80)) + (6+sd->cook_mastery/80))
						- 400 * (skill_produce_db[idx].itemlv - 11 + 1)
						- 10  * (100 - status->luk + 1)
						- 500 * (num - 1)
						- 100 * (rnd()%4 + 1);
				break;
			}
			make_per = 5000;
			break;

and change the last

make_per = 5000;

to

make_per = 10000;

for 100%

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

the same formula used by the skill "needed" for the desired item

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

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