Jump to content

Dropar pedras nas metins


Figueiras
 Share

Recommended Posts

Source

No char.cpp, procura por:

void CHARACTER::DetermineDropMetinStone()

 

Substitui todo o código dele por isto (tirado da minha source):

void CHARACTER::DetermineDropMetinStone()
{
	const int METIN_STONE_NUM = 14;
	static DWORD c_adwMetin[METIN_STONE_NUM] = 
	{
		28030,
		28031,
		28032,
		28033,
		28034,
		28035,
		28036,
		28037,
		28038,
		28039,
		28040,
		28041,
		28042,
		28043,
	};
	DWORD stone_num = GetRaceNum();
	int idx = std::lower_bound(aStoneDrop, aStoneDrop+STONE_INFO_MAX_NUM, stone_num) - aStoneDrop;
	if (idx >= STONE_INFO_MAX_NUM || aStoneDrop[idx].dwMobVnum != stone_num)
	{
		m_dwDropMetinStone = 0;
	}
	else
	{
		const SStoneDropInfo & info = aStoneDrop[idx];
		m_bDropMetinStonePct = info.iDropPct;
		{
			m_dwDropMetinStone = c_adwMetin[number(0, METIN_STONE_NUM - 1)];
			int iGradePct = number(1, 100);
			for (int iStoneLevel = 0; iStoneLevel < STONE_LEVEL_MAX_NUM; iStoneLevel ++)
			{
				int iLevelGradePortion = info.iLevelPct[iStoneLevel];
				if (iGradePct <= iLevelGradePortion)
				{
					break;
				}
				else
				{
					iGradePct -= iLevelGradePortion;
					m_dwDropMetinStone += 100; // µ¹ +a -> +(a+1)ÀÌ µÉ¶§¸¶´Ù 100¾¿ Áõ°¡
				}
			}
		}
	}
}

 

Lua

Seguindo por esta função:

quest pedras begin
	state start begin
		function stones()
			local x = {
			-- ID das metins | Vai inserindo que eu não sei de cor
				8001,
				8002,
				8003
			}

			return true
		end

		when kill with pedras.stones() begin
			local items = {
				-- ID das pedras | Vai inserindo que eu não sei de cor
				28030,
				28031,
				28032
			}

			-- i representa a quantidade das pedras a serem dropados
			for i = 1, table.getn(items) do
				get_number(x,i,20)
			end
		end
	end
end
			

 

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
 Share

×
×
  • Create New...