Lineage Justice

Spells & Skills

Lookup and validate skills and spells.

EnchantWeapon
MP: 20 HP: 0 Item: None Amount: N/A Duration: 1800 Skill Type: Change
Delay: 10 Cast Invis: Yes Ignores CM: Yes Element: Fire Range: N/A Area: N/A
Dmg Value: 0.0 Dmg Dice: 0 Dice Count: 0 Prob Value: 0 Prob Dice: 0 Prob Max: N/A
L1SkillUse Execution:

if (_skillId == ENCHANT_WEAPON) {
	L1PcInstance pc = (L1PcInstance) cha;
	L1ItemInstance item = pc.getInventory().getItem(
			_itemobjid);
	if (item != null && item.getItem().getType2() == 1) {
		pc.sendPackets(new S_ServerMessage(161, item
				.getLogName(), "$245", "$247")); // your 'item' glows 'blue' for a 'moment'.
		item.setSkillWeaponEnchant(pc, _skillId,
				_skill.getBuffDuration() * 1000);
	} else {
		pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
	}
}
L1ItemInstance Effect:

public void setSkillWeaponEnchant(L1PcInstance pc, int skillId,
		int skillTime) {
	if (getItem().getType2() != 1) {
		return;
	}
	if (_isRunning) {
		_timer.cancel();
		setDmgByMagic(0);
		setHolyDmgByMagic(0);
		setHitByMagic(0);
		_isRunning = false;
		_timer = null;
	}

	switch (skillId) {
	case HOLY_WEAPON:
		setHolyDmgByMagic(1);
		setHitByMagic(1);
		break;

	case ENCHANT_WEAPON:
		setDmgByMagic(2);
		break;

	case BLESS_WEAPON:
		setDmgByMagic(2);
		setHitByMagic(2);
		break;

	case SHADOW_FANG:
		setDmgByMagic(5);
		break;

	default:
		break;
	}

	_pc = pc;
	_timer = new EnchantTimer();
	(new Timer()).schedule(_timer, skillTime);
	_isRunning = true;
}