• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

wzór na max i min dmg

Status
Not open for further replies.

Retired

New Member
Joined
Apr 19, 2009
Messages
233
Reaction score
1
Witam jak obliczyć max i min dmg czaru poniżej ?

setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 4.5, 9)

min = (int32_t)((player->getLevel() / minl + player->getMagicLevel() * minm) * 1. * mina + minb);
max = (int32_t)((player->getLevel() / maxl + player->getMagicLevel() * maxm) * 1. * maxa + maxb);

W silniku znalazłem wzór,ale nie do końca go rozumiem
 
Last edited:
Moze bys laskawie podal co to minl, minm, mina, minb i max (analogicznie)?

Zreszta, tak ciezko jest rozwiazac sobie proste rownanie matematyczne?
 
Nie dostałem jeszcze odpowiedzi,za to Ty potrafisz tlyko anbijać posty

Przeciez Ci kurwa napisal, ze to czysta matematyka, masz olsnie Cie kurwa:
Code:
function setAttackFormula(combat, type, minl, maxl, minm, maxm, min, max)
	local min, max = min or 0, max or 0
	return setCombatFormula(combat, type, -1, 0, -1, 0, minl, maxl, minm, maxm, -min, -max)
end

+

Code:
//setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])

+

Code:
int32_t LuaInterface::luaSetCombatFormula(lua_State* L)
{
	//setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])
	ScriptEnviroment* env = getEnv();
	if(env->getScriptId() != EVENT_ID_LOADING)
	{
		errorEx("This function can only be used while loading the script.");
		lua_pushboolean(L, false);
		return 1;
	}

	int32_t params = lua_gettop(L), minc = 0, maxc = 0;
	if(params > 11)
		maxc = popNumber(L);

	if(params > 10)
		minc = popNumber(L);

	double minm = g_config.getDouble(ConfigManager::FORMULA_MAGIC), maxm = minm,
		minl = g_config.getDouble(ConfigManager::FORMULA_LEVEL), maxl = minl;
	if(params > 8)
	{
		maxm = popFloatNumber(L);
		minm = popFloatNumber(L);
	}

	if(params > 6)
	{
		maxl = popFloatNumber(L);
		minl = popFloatNumber(L);
	}

	double maxb = popFloatNumber(L), maxa = popFloatNumber(L),
		minb = popFloatNumber(L), mina = popFloatNumber(L);
	formulaType_t type = (formulaType_t)popNumber(L);
	if(Combat* combat = env->getCombatObject(popNumber(L)))
	{
		combat->setPlayerCombatValues(type, mina, minb, maxa, maxb, minl, maxl, minm, maxm, minc, maxc);
		lua_pushboolean(L, true);
	}
	else
	{
		errorEx(getError(LUA_ERROR_COMBAT_NOT_FOUND));
		lua_pushboolean(L, false);
	}

	return 1;
}

+

Code:
					min = (int32_t)((player->getLevel() / minl + player->getMagicLevel() * minm) * 1. * mina + minb);
					max = (int32_t)((player->getLevel() / maxl + player->getMagicLevel() * maxm) * 1. * maxa + maxb);
					if(minc && std::abs(min) < std::abs(minc))
						min = minc;

					if(maxc && std::abs(max) < std::abs(maxc))
						max = maxc;
 
Status
Not open for further replies.
Back
Top