RarityItem.inc

04/03/2018 17:18 xToffer#1
how to i write this in rarityitem.inc?

Code:
BOOL CProject::LoadRarityProp()
{
	CScript s;
	if (!s.Load("RarityItem.inc"))
		return FALSE;

	for (int i = 0; i < 4; i++)
	{
		s.GetToken();
		int nMax = s.GetNumber();
		s.GetToken();	// {
		for (int y = 0; y < nMax; y++)
		{
			int nDestParam = s.GetNumber();
			int nRarity = s.GetNumber();
			//Error("[%d]: nDestParam: %d, nRarity: %d", i, nDestParam, nRarity);
			switch (i)
			{
			case 0:
				m_map_Rarity1.insert(MAP_RARITY1::value_type(nDestParam, nRarity)); break;
			case 1:
				m_map_Rarity2.insert(MAP_RARITY2::value_type(nDestParam, nRarity)); break;
			case 2:
				m_map_Rarity3.insert(MAP_RARITY3::value_type(nDestParam, nRarity)); break;
			case 3:
				m_map_Rarity4.insert(MAP_RARITY4::value_type(nDestParam, nRarity)); break;
			}
		}
		s.GetToken();
	}
	return TRUE;
}

BOOL CProject::LoadSkillUp()
{
	CScript s;
	if (!s.Load("propSkillLvlup.txt"))
	{
		WRITE_ERROR();
		return FALSE;
	}

	SkillUpProp prop;
	ZeroMemory(&prop, sizeof(prop));

	int nMax = s.GetNumber();
	for (int i = 0; i < nMax; i++)
	{
		prop.dwSkillID = s.GetNumber();
		prop.dwItemID = s.GetNumber();
		prop.nCash = s.GetNumber();
		
		m_map_SkillUp.insert(MAP_SKILLUP::value_type(prop.dwSkillID, prop.dwItemID));
		m_map_SkillUp2.insert(MAP_SKILLUP2::value_type(prop.dwSkillID, prop.nCash));
		//Error("%d, %d, %d", prop.dwSkillID, prop.dwItemID, prop.nCash);
	}
	return TRUE;
}
thanks youuu so much
04/10/2018 10:52 xToffer#2
bump
04/10/2018 20:57 Avalion#3
loop 4 times.

Get the first string or number until it ends with a whitespace.
Get the next number and set it to nMax variable.

Loop over nMax
Get the next string or number until it ends with a whitespace, and not use it at all
Get a number and set it to a variable.
Get another number and set it to a variable.
switch through i to insert the last two grabbed numbers in to a different map
Get another number or string and ignore it once again.

Code:
wew 2 imba 1 1 1 2 BoboItimPuta

repeat 3 more times.
04/10/2018 21:26 xToffer#4
Quote:
Originally Posted by Avalion View Post
loop 4 times.

Get the first string or number until it ends with a whitespace.
Get the next number and set it to nMax variable.

Loop over nMax
Get the next string or number until it ends with a whitespace, and not use it at all
Get a number and set it to a variable.
Get another number and set it to a variable.
switch through i to insert the last two grabbed numbers in to a different map
Get another number or string and ignore it once again.

Code:
wew 2 imba 1 1 1 2 BoboItimPuta

repeat 3 more times.
this?
Code:
	RandomOptItem	2	IDS_RARITY_000001	60	90000000
	{
		DST_STAT_ALLUP		8
		DST_SPELL_RATE		5
		DST_MP_MAX_RATE		5
	}