• 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!

[0.3.6] The same hits after reborn

wesoly136

Member
Joined
Jul 30, 2009
Messages
562
Reaction score
8
I have made reborns on my server. And now I want to make something like for example

reborn is on 100lvl,
then(after reborn) when we have 8 lvl and 1 reborn he should have hits like 100 lvl.

So with 8lvl and 2 reborns we should have hits like 200lvl.

Do you understand ? :)

And I don't have idea how to do it :/.

LOL triple posts :/ I edited first not adding one more :((Should be 2)
 
Last edited:
Add some new variable (resets?) or use storage to store how many times he/she resetted the character, and then edit the following parts in source (make them use the variable):

combat.cpp

In Combat::getMinMaxValues:
Code:
				case FORMULA_LEVELMAGIC:
				{
					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;

					player->increaseCombatValues(min, max, params.useCharges, true);
					return true;
				}
In ValueCallback::getMinMaxValues:
Code:
		case FORMULA_LEVELMAGIC:
		{
			//"onGetPlayerMinMaxValues"(cid, level, magLevel)
			lua_pushnumber(L, player->getLevel());
			lua_pushnumber(L, player->getMagicLevel());

			parameters += 2;
			break;
		}

		case FORMULA_SKILL:
		{
			//"onGetPlayerMinMaxValues"(cid, level, skill, attack, factor)
			Item* tool = player->getWeapon();
			lua_pushnumber(L, player->getLevel());
			lua_pushnumber(L, player->getWeaponSkill(tool));

			int32_t attack = 7;
			if(tool)
			{
				attack = tool->getAttack();
				if(useCharges && tool->hasCharges() && g_config.getBool(ConfigManager::REMOVE_WEAPON_CHARGES))
					g_game.transformItem(tool, tool->getID(), std::max(0, tool->getCharges() - 1));
			}

			lua_pushnumber(L, attack);
			lua_pushnumber(L, player->getAttackFactor());

			parameters += 4;
			break;
		}
weapons.cpp:

In Weapons::getMaxWeaponDamage:
Code:
	return (int32_t)std::ceil((2 * (attackValue * (attackSkill + 5.8) / 25 + (level - 1) / 10.)) / attackFactor);
In WeaponDistance::getWeaponDamage:
Code:
		if(target->getPlayer())
			minValue = (int32_t)std::ceil(player->getLevel() * 0.1);
		else
			minValue = (int32_t)std::ceil(player->getLevel() * 0.2);
 
Yea I already use a storage. In LUA I know how to do such thing but I don't have idea for sources :(
I'm still learing :p
I was tryin to use a formula in spells(I know it is max noobish :p) for example (level+(getstorage*100))+(mlvl*2)
100 means how many lvls hit will be stronger per reset


Can you say what exatcly have I to change? :S
Will write if works
EDIT
Whats the function for getstorage ? GetStorage ? xD I have to find a tutorial ;p
 
Last edited:
@Up: In LUA getPlayerStorageValue(cid,storage)
In Sources I think its player->getStorage
 
Back
Top