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

sila czaru

experienced

Intermediate OT User
Joined
Jan 13, 2011
Messages
418
Reaction score
102
Location
Poland
siemka
mam tu taka formule exori frigo
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
i sprawa wyglada tak
robilem se testy 350 lvl 105 mlvl i hity to 250-300 przecietnie a jak te cyferki podwiekszyc zeby hitac na tym lvl i z tym mlev 350-400 cxs takiego
ale z zachowaniem balansu tego czaru na nizszych levelach 30 150 200 itd
moglby ktos wytlumaczyc :P
 
sam nigdy tego nie rozumiałem, dlatego przeniosłem się na takie cuś

PHP:
function onGetFormulaValues(cid, level, maglevel)
min = (level * 1 + maglevel * 4) * 5
max = (level * 1 + maglevel * 4) * 5

return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")


dużo wygodniejsze, polecam
 
tutaj masz jakie dane oczekuje funkcja:
Code:
setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])
a tutaj masz formule jak jest obliczana sila czaru:
Code:
bool Combat::getMinMaxValues(Creature* creature, Creature* target, int32_t& min, int32_t& max) const
{
	if(creature)
	{
		if(creature->getCombatValues(min, max))
			return true;

		if(Player* player = creature->getPlayer())
		{
			if(params.valueCallback)
			{
				params.valueCallback->getMinMaxValues(player, min, max, params.useCharges);
				return true;
			}

			min = max = 0;
			switch(formulaType)
			{
				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;
				}

				case FORMULA_SKILL:
				{
					Item* item = player->getWeapon(false);
					if(const Weapon* weapon = g_weapons->getWeapon(item))
					{
						max = (int32_t)(weapon->getWeaponDamage(player, target, item, true) * maxa + maxb);
						if(params.useCharges && item->hasCharges() && g_config.getBool(ConfigManager::REMOVE_WEAPON_CHARGES))
							g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getCharges()) - 1));
					}
					else
						max = (int32_t)maxb;

					min = (int32_t)minb;
					if(maxc && std::abs(max) < std::abs(maxc))
						max = maxc;

					return true;
				}

				case FORMULA_VALUE:
				{
					min = (int32_t)minb;
					max = (int32_t)maxb;
					return true;
				}

				default:
					break;
			}

			return false;
		}
	}

	if(formulaType != FORMULA_VALUE)
		return false;

	min = (int32_t)mina;
	max = (int32_t)maxa;
	return true;
}

jesli nie podasz wszystkich to pobierane sa standardowe wielkosci z:
getGlobalDouble("formulaLevel", 5.0);
getGlobalDouble("formulaMagic", 1.0);

mozesz je w configu ustalic dla wszystkich twoich czarow.

milego rozkminiania :D
 
lol gupota
to to tez nie wiem co to ma byc

człowieku, nawet nie rozumiesz jak działa ta funkcja, a piszesz że jest głupia

ale ok, wytłumaczę ci jak małemu dziecku

PHP:
function onGetFormulaValues(cid, level, maglevel)
min = (level * 1 + maglevel * 4) * 5
max = (level * 1 + maglevel * 4) * 5

return min, max
end


min to minimalne obrażenia, max to obrażenia maksymalne
system wybiera jakąś liczbę pomiędzy tymi dwoma

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

min = (level * 1 + maglevel * 4) * 5

dajesz tu obliczenia

level - poziom gracza
maglevel - magiczny poziom gracza
* - mnożenie
/ - dzielenie
+ - dodawanie
- - odejmowanie


to samo z max


wklejasz to do czaru zamiast twojej formuły

przykład na heal friend:


PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
	min = level + 100
	max =level + 150
        
        return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
    if isPlayer(cid) == TRUE then
        if exhaustion.check(cid, 30030) then
            return FALSE
        else
            return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
        end
    else
        return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
    end
end

masz jeszcze jakieś pytania?
 
Back
Top