• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

setCombatFormula?

Zisly

Intermediate OT User
Joined
Jun 9, 2008
Messages
7,338
Reaction score
120
Ex; setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)

Ex2;
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -90, 0.7, -50)

Whats the third,forth,fith and sixth parameters for exactly?
Could someone give me a example of a formula that is: level*2 ml*3 or something so I can get the idea :p

Sorry for my bad English, really tired :/
 
COME ON!
I can't convert the current scripts to revscriptsys if I don't know what this works :S
 
first is min magic power multiplier, second is is value added to minimal damage, third is max multiplier and fourth is for max dmg, all numbers should be negative to cause damage, hope you understand

edit: for skills numbers are working the same, but i dont know skill formula
 
I think you should understand from code, my english is not good enough to explain it.

Code:
setCombatFormula(combat, type, mina, minb, maxa, maxb)

Code:
			case FORMULA_LEVELMAGIC:
			{
				min = (int32_t)((player->getLevel() + player->getMagicLevel() * 4) * 1. * mina + minb);
				max = (int32_t)((player->getLevel() + player->getMagicLevel() * 4) * 1. * maxa + maxb);

				Vocation* vocation = player->getVocation();
				float multiplier = 1.0f;
				if(max > 0)
					multiplier = vocation->getMultiplier(MULTIPLIER_MAGICHEALING);
				else
					multiplier = vocation->getMultiplier(MULTIPLIER_MAGIC);

				min = (int32_t)(min * multiplier);
				max = (int32_t)(max * multiplier);

				return true;
			}

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

				return true;
			}
 
Ex; setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
lvl * -1.4
mininum
-1.9
maximun

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
Third and fourth numbers are 0, that means that this is based only on lvl and ml, if you are lvl 100 with ml 100 you will hit:
0 + 140 + 190 = 330 mininum damage and
0 + 140 + 190 = 330 max damage
This formula should always hit 330

Hope you can understand me :) or go to the link below for a more further explanation of spell formulas.

For more information read here
 
lvl * -1.4
mininum
-1.9
maximun

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.4, 0, -1.9, 0)
Third and fourth numbers are 0, that means that this is based only on lvl and ml, if you are lvl 100 with ml 100 you will hit:
0 + 140 + 190 = 330 mininum damage and
0 + 140 + 190 = 330 max damage
This formula should always hit 330

Hope you can understand me :) or go to the link below for a more further explanation of spell formulas.

For more information read here
Thanks for taking your time explaining :)
 
Back
Top