Lineage Justice

Spells & Skills

Lookup and validate skills and spells.

EnchantArmor
MP: 20 HP: 0 Item: None Amount: N/A Duration: 1800 Skill Type: Change
Delay: 10 Cast Invis: Yes Ignores CM: Yes Element: None 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 == BLESSED_ARMOR) {
	L1PcInstance pc = (L1PcInstance) cha;
	L1ItemInstance item = pc.getInventory().getItem(
			_itemobjid);
	if (item != null && item.getItem().getType2() == 2
			&& item.getItem().getType() == 2) {
		pc.sendPackets(new S_ServerMessage(161, item
				.getLogName(), "$245", "$247")); // your 'item' glows 'blue' for a 'moment'.
		item.setSkillArmorEnchant(pc, _skillId,
				_skill.getBuffDuration() * 1000);
	} else {
		pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
	}
}
L1ItemInstance Effect:

public void setSkillArmorEnchant(L1PcInstance pc, int skillId, int skillTime) {
	int type = getItem().getType();
	int type2 = getItem().getType2();
		
	if (_isRunning) {
		_timer.cancel();
		int itemId = getItem().getItemId();
		if (pc != null && pc.getInventory().checkItem(itemId)) {
			if (type == 2 && type2 == 2 && isEquipped()) {
				pc.addAc(3);
				pc.sendPackets(new S_OwnCharStatus(pc));
			}
		}
		setAcByMagic(0);
		_isRunning = false;
		_timer = null;
	}

	if (type == 2 && type2 == 2 && isEquipped()) {
		pc.addAc(-3);
		pc.sendPackets(new S_OwnCharStatus(pc));
	}
	setAcByMagic(3);
	_pc = pc;
	_timer = new EnchantTimer();
	(new Timer("EnchantTimer-"+_pc.getName())).schedule(_timer, skillTime);
	_isRunning = true;
}