Jump to content
  • Create New...
  • 0

Drop_Item DB Item_Proto



2 answers to this question

Recommended Posts

  • 0

etc_drop_item.txt - which is in game/share/locale/xx





If you want to change structure open item_manager_read_tables.cpp


bool ITEM_MANAGER::ReadEtcDropItemFile(const char * c_pszFileName)
	FILE * fp = fopen(c_pszFileName, "r");

	if (!fp)
		sys_err("Cannot open %s", c_pszFileName);
		return false;

	char buf[512];

	int lines = 0;

	while (fgets(buf, 512, fp))

		if (!*buf || *buf == '\n')

		char szItemName[256];
		float fProb = 0.0f;

		strlcpy(szItemName, buf, sizeof(szItemName));
		char * cpTab = strrchr(szItemName, '\t');

		if (!cpTab)

		*cpTab = '\0';
		fProb = atof(cpTab + 1);

		if (!*szItemName || fProb == 0.0f)

		DWORD dwItemVnum;

		if (!ITEM_MANAGER::instance().GetVnumByOriginalName(szItemName, dwItemVnum))
			sys_err("No such an item (name: %s)", szItemName);
			return false;

		m_map_dwEtcItemDropProb[dwItemVnum] = (DWORD) (fProb * 10000.0f);
		sys_log(0, "ETC_DROP_ITEM: %s prob %f", szItemName, fProb);

	return true;


  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.