public void TryPutStone(L2Player player, L2Item stone) { if (!_supports.ContainsKey(stone.Template.ItemId)) { player.SendSystemMessage(SystemMessage.SystemMessageId.IncorrectSupportEnhancementSpellbook); player.SendActionFailed(); return; } EnchantScroll dat = _supports[stone.Template.ItemId]; bool next = false; switch (dat.Crystall) { case (CrystalTypeId)1: next = player.EnchantItem.Template.CrystalType == CrystalType.D; break; case (CrystalTypeId)2: next = player.EnchantItem.Template.CrystalType == CrystalType.C; break; case (CrystalTypeId)3: next = player.EnchantItem.Template.CrystalType == CrystalType.B; break; case (CrystalTypeId)4: next = player.EnchantItem.Template.CrystalType == CrystalType.A; break; case (CrystalTypeId)5: next = player.EnchantItem.Template.CrystalType == CrystalType.S; break; } if (!next) { player.SendPacket(new ExPutEnchantSupportItemResult()); player.EnchantStone = null; player.SendSystemMessage(SystemMessage.SystemMessageId.ItemDoesNotMeetRequirementsForSupportEnhancementSpellbook); } else { player.EnchantStone = stone; player.SendPacket(new ExPutEnchantSupportItemResult(stone.ObjId)); } }
public void TryPutItem(L2Player player, L2Item item) { L2Item scroll = player.EnchantScroll; EnchantScroll dat = _items[scroll.Template.ItemId]; bool next = false; switch (dat.Crystall) { case (CrystalTypeId)1: next = player.EnchantItem.Template.CrystalType == CrystalType.D; break; case (CrystalTypeId)2: next = player.EnchantItem.Template.CrystalType == CrystalType.C; break; case (CrystalTypeId)3: next = player.EnchantItem.Template.CrystalType == CrystalType.B; break; case (CrystalTypeId)4: next = player.EnchantItem.Template.CrystalType == CrystalType.A; break; case (CrystalTypeId)5: next = player.EnchantItem.Template.CrystalType == CrystalType.S; break; } if (!next) { player.SendPacket(new ExPutEnchantTargetItemResult()); player.EnchantScroll = null; player.EnchantState = 0; player.SendSystemMessage(SystemMessage.SystemMessageId.DoesNotFitScrollConditions); } else { player.EnchantState = StateEnchantStart; player.EnchantItem = item; player.SendPacket(new ExPutEnchantTargetItemResult(item.ObjId)); } }