Lineage Justice

Spells & Skills

Lookup and validate skills and spells.

LesserHeal
MP: 4 HP: 0 Item: None Amount: N/A Duration: 0 Skill Type: Heal
Delay: 10 Cast Invis: Yes Ignores CM: Yes Element: Water Range: 20 Area: N/A
Dmg Value: 2.0 Dmg Dice: 4 Dice Count: 0 Prob Value: 0 Prob Dice: 0 Prob Max: N/A
L1SkillUse Execution:

if (_skill.getType() == L1Skill.TYPE_HEAL) {
	dmg = -1 * _magic.calcHealing(_skillId);
	if (cha.hasSkillEffect(WATER_LIFE)) {
		dmg *= 2;
		cha.killSkillEffectTimer(WATER_LIFE);
		if (cha instanceof L1PcInstance) {
			L1PcInstance pc = (L1PcInstance) cha;
			pc.sendPackets(new S_SkillIconWaterLife());
		}
	}
	if (cha.hasSkillEffect(POLLUTE_WATER)) {
		dmg /= 2;
	}
	if (cha.hasSkillEffect(FAFURION_REDUCE_HEAL)) { 
		dmg /= 2;
		if (cha instanceof L1PcInstance) {
			if (_player != null && _player.isInvisble()) {
				_player.delInvis();
			}
			if (cha instanceof L1SummonInstance || cha instanceof L1PetInstance) {
				final L1NpcInstance npc = (L1NpcInstance) cha;
				npc.broadcastPacket(new S_SkillSound(cha.getId(), 7782));
			}
		}
	}
}
                        
L1Magic Calculation:

public int calcHealing(int skillId) {
	L1Skill skill = SkillTable.getInstance().findBySkillId(skillId);
	int dice = skill.getDamageDice();
	int value = (int) skill.getDamageValue();
	int damage = 0;

	int magicBonus = Math.min(10, getMagicBonus());

	int diceCount = value + magicBonus;
	for (int i = 0; i < diceCount; i++) {
		damage += (_random.nextInt(dice) + 1);
	}

	double alignmentRevision = 1.0;
	if (getLawful() > 0) {
		alignmentRevision += (getLawful() / 32768.0);
	}

	damage *= alignmentRevision;
	damage = (damage * getLeverage()) / 10;
	return damage;
}