Lineage Justice

Spells & Skills

Lookup and validate skills and spells.

CreateMagicalWeapon
MP: 200 HP: 0 Item: 40318 Amount: 10 Duration: 0 Skill Type: 0
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 == CREATE_MAGICAL_WEAPON) {
	L1PcInstance pc = (L1PcInstance) cha;
	L1ItemInstance item = pc.getInventory().getItem(
			_itemobjid);
	if (item != null && item.getItem().getType2() == 1) {
		int item_type = item.getItem().getType2();
		int safe_enchant = item.getItem().getSafeEnchant();
		int enchant_level = item.getEnchantLevel();
		String item_name = item.getName();
		if (safe_enchant < 0) {
			pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
		} else if (safe_enchant == 0) {
			pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
		} else if (item_type == 1 && enchant_level == 0) {
			if (!item.isIdentified()) {
				pc.sendPackets(new S_ServerMessage(161,
						item_name, "$245", "$247")); 
			} else {
				item_name = "+0 " + item_name;
				pc.sendPackets(new S_ServerMessage(161,
						"+0 " + item_name, "$245", "$247")); 
			}
			item.setEnchantLevel(1);
			pc.getInventory().updateItem(item,
					L1PcInventory.COL_ENCHANTLVL);
		} else {
			pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
		}
	} else {
		pc.sendPackets(new S_ServerMessage(79)); // Nothing happened.
	}
}