All pastes #4755 Raw Edit

Anonymous

public text v1 · immutable
#4755 ·published 2005-01-26 12:30 UTC
rendered paste body
	public void updateCriticalChance()
	{
		L2Modifiers modifier = this.getModifiers();
		L2Weapon weaponItem = this.getActiveWeapon();
		L2CharTemplate template = CharTemplateTable.getInstance().getTemplate(modifier.getClassid());
		double crit = 0;
		if (weaponItem != null) 
		{
			crit = (100.0 + modifier.getModdex()) / 100.0 * weaponItem.getCritical();
		}
		if (template != null) 
		{
			crit += template.getCrit();
		}
		crit = calculateBuffDebuff(L2Skill.STAT_CRITRATE, crit);
		setCriticalHit( (int) crit);
		_log.fine(getObjectId() + ": new crit: " + crit);
	}