All pastes #167297 Raw Edit

Anonymous

public java v1 · immutable
·published 2006-09-11 21:18 UTC
rendered paste body
       if (!isBow) // Do not reflect or absorb if weapon is of type bow                {                    // Reduce HP of the target and calculate reflection damage to reduce HP of attacker if necessary                    double reflectPercent = target.getStat().calcStat(Stats.REFLECT_DAMAGE_PERCENT,0,null,null);                    /** New code */                    if (reflectPercent > 45) {                    	reflectPercent = 45;                    }                    /** End new code */                    if (reflectPercent > 0 && target.getTarget()==this)                    {                        int reflectedDamage = (int)(reflectPercent / 100. * damage);                        damage -= reflectedDamage;                        getStatus().reduceHp(reflectedDamage, null, true);                                                if (target instanceof L2PcInstance)                             ((L2PcInstance)target).sendMessage("You reflected " + reflectedDamage + " damage.");                    }