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

Help with damage formula

Lejjo

New Member
Joined
Sep 21, 2007
Messages
78
Reaction score
1
Code:
int32_t WeaponDistance::getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage /*= false*/) const
{
	int32_t attackSkill = player->getSkill(SKILL_DIST, SKILL_LEVEL);
	int32_t attackStrength = player->getAttackStrength();
	int32_t maxValue = Weapons::getMaxWeaponDamage(attackSkill, ammuAttackValue);
	if(random_range(1, 100) <= g_config.getNumber(ConfigManager::CRITICAL_HIT_CHANCE))
		maxValue <<= 1;
	Vocation* vocation = player->getVocation();
	if(vocation && vocation->distDamageMultipler != 1.0)
		maxValue = int32_t(maxValue * vocation->distDamageMultipler);
	if(maxDamage)
		return -maxValue;

	int32_t minValue = 0;
	if(target)
	{
		if(target->getPlayer())
			minValue = (int32_t)std::ceil(player->getLevel() * 0.1);
		else
			minValue = (int32_t)std::ceil(player->getLevel() * 0.2);
	}
	return -(random_range(minValue, maxValue, DISTRO_NORMAL) * attackStrength) / 100;
}


Can someone explain me every term? This is what I know so far:

attackStrenght = your attack stance (full atk/bal/full def)
minValue = lvl * 0.1 (if target is player) lvl * 0.2 (if target isn't player)
ammuAttackValue = atk on your ammo
attackSkill = dist level

The things I do not know is:
how the maxValue is calculated
DISTRO_NORMAL


And also, how the dmg formula is for distance weapons.

Thanks for your help everyone!
 
Last edited:
Back
Top