Jump to content
  • 0

Enchant scrolls!


Question

Posted

Hello, today i test my enchant system from server, and with retail settings, i can't enchant my items. When i try to enchant, i don't get any error on gameserver. I get just a shortly message on chat like unknown.png. Someone can explain me what's happend?

L2j-Mobius-High Five!

11 answers to this question

Recommended Posts

  • 0
Posted

Check the conditions here.

 

public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
{
	private int _objectId;
	
	@Override
	public boolean read(GameClient client, PacketReader packet)
	{
		_objectId = packet.readD();
		return true;
	}
	
	@Override
	public void run(GameClient client)
	{
		final PlayerInstance player = client.getPlayer();
		if ((_objectId == 0) || (player == null))
		{
			return;
		}
		
		if (player.isEnchanting())
		{
			return;
		}
		
		final ItemInstance item = player.getInventory().getItemByObjectId(_objectId);
		final ItemInstance scroll = player.getInventory().getItemByObjectId(player.getActiveEnchantItemId());
		if ((item == null) || (scroll == null))
		{
			return;
		}
		
		final EnchantScroll scrollTemplate = EnchantItemData.getInstance().getEnchantScroll(scroll);
		if ((scrollTemplate == null) || !scrollTemplate.isValid(item, null))
		{
			player.sendPacket(SystemMessageId.DOES_NOT_FIT_STRENGTHENING_CONDITIONS_OF_THE_SCROLL);
			player.setActiveEnchantItemId(PlayerInstance.ID_NONE);
			player.sendPacket(new ExPutEnchantTargetItemResult(0));
			if (scrollTemplate == null)
			{
				LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Undefined scroll have been used id: " + scroll.getId());
			}
			return;
		}
		player.setEnchanting(true);
		player.setActiveEnchantTimestamp(Chronos.currentTimeMillis());
		player.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
	}
}

 

Validation method.

 

	public boolean isValid(ItemInstance itemToEnchant, EnchantSupportItem supportItem)
	{
		if ((_items != null) && !_items.contains(itemToEnchant.getId()))
		{
			return false;
		}
		else if ((supportItem != null))
		{
			if (_isBlessed)
			{
				return false;
			}
			else if (!supportItem.isValid(itemToEnchant, supportItem))
			{
				return false;
			}
			else if (supportItem.isWeapon() != isWeapon())
			{
				return false;
			}
		}
		if (_items == null)
		{
			for (EnchantScroll scroll : EnchantItemData.getInstance().getScrolls())
			{
				if (scroll.getId() == getId())
				{
					continue;
				}
				final Set<Integer> scrollItems = scroll.getItems();
				if ((scrollItems != null) && scrollItems.contains(itemToEnchant.getId()))
				{
					return false;
				}
			}
		}
		return super.isValid(itemToEnchant, supportItem);
	}

 

The general problem is Enchant scroll isn't defined in EnchantItemData, i guess.

  • 0
Posted

I can post here EnchantItemData if this may help.
 

<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/enchantItemData.xsd">
	<!-- Scrolls: Enchant Weapon -->
	<enchant id="729" targetGrade="A" maxEnchant="16" />
	<enchant id="947" targetGrade="B" maxEnchant="16" />
	<enchant id="951" targetGrade="C" maxEnchant="16" />
	<enchant id="955" targetGrade="D" maxEnchant="16" />
	<enchant id="959" targetGrade="S" maxEnchant="16" />

	<!-- Scrolls: Enchant Armor -->
	<enchant id="730" targetGrade="A" maxEnchant="16" />
	<enchant id="948" targetGrade="B" maxEnchant="16" />
	<enchant id="952" targetGrade="C" maxEnchant="16" />
	<enchant id="956" targetGrade="D" maxEnchant="16" scrollGroupId="0" /> <!-- Default scroll groups binding. -->
	<enchant id="960" targetGrade="S" maxEnchant="16" />

	<!-- Blessed Scrolls: Enchant Weapon -->
	<enchant id="6569" targetGrade="A" maxEnchant="16" />
	<enchant id="6571" targetGrade="B" maxEnchant="16" />
	<enchant id="6573" targetGrade="C" maxEnchant="16" />
	<enchant id="6575" targetGrade="D" maxEnchant="16" />
	<enchant id="6577" targetGrade="S" maxEnchant="16" />
	<!-- Blessed Scrolls: Enchant Armor -->
	<enchant id="6570" targetGrade="A" maxEnchant="16" />
	<enchant id="6572" targetGrade="B" maxEnchant="16" />
	<enchant id="6574" targetGrade="C" maxEnchant="16" />
	<enchant id="6576" targetGrade="D" maxEnchant="16" />
	<enchant id="6578" targetGrade="S" maxEnchant="16" />

	<!-- Weapon Enchant Scrolls -->
	<enchant id="22006" targetGrade="D" bonusRate="10" maxEnchant="16" />
	<enchant id="22007" targetGrade="C" bonusRate="10" maxEnchant="16" />
	<enchant id="22008" targetGrade="B" bonusRate="10" maxEnchant="16" />
	<enchant id="22009" targetGrade="A" bonusRate="10" maxEnchant="16" />
	<enchant id="20517" targetGrade="S" bonusRate="10" maxEnchant="16" />
	<!-- Armor Enchant Scrolls -->
	<enchant id="22010" targetGrade="D" bonusRate="10" maxEnchant="16" />
	<enchant id="22011" targetGrade="C" bonusRate="10" maxEnchant="16" />
	<enchant id="22012" targetGrade="B" bonusRate="10" maxEnchant="16" />
	<enchant id="22013" targetGrade="A" bonusRate="10" maxEnchant="16" />
	<enchant id="20518" targetGrade="S" bonusRate="10" maxEnchant="16" />

	<!-- Ancient Weapon Enchant Crystal -->
	<enchant id="22014" targetGrade="B" maxEnchant="16" bonusRate="10" />
	<enchant id="22015" targetGrade="A" maxEnchant="16" bonusRate="10" />
	<enchant id="20519" targetGrade="S" maxEnchant="16" bonusRate="10" />
	<!-- Ancient Armor Enchant Crystal -->
	<enchant id="22016" targetGrade="B" maxEnchant="16" bonusRate="10" />
	<enchant id="22017" targetGrade="A" maxEnchant="16" bonusRate="10" />
	<enchant id="20520" targetGrade="S" maxEnchant="16" bonusRate="10" />

	<!-- Divine Weapon Enchant Crystal -->
	<enchant id="22018" targetGrade="B" bonusRate="100" />
	<enchant id="22019" targetGrade="A" bonusRate="100" />
	<enchant id="20521" targetGrade="S" bonusRate="100" />
	<!-- Divine Armor Enchant Crystal -->
	<enchant id="22020" targetGrade="B" bonusRate="100" />
	<enchant id="22021" targetGrade="A" bonusRate="100" />
	<enchant id="20522" targetGrade="S" bonusRate="100" />

	<!-- Scroll: Enchant Weapon of Destruction -->
	<enchant id="22221" targetGrade="S" maxEnchant="15" />
	<enchant id="22223" targetGrade="A" maxEnchant="15" />
	<enchant id="22225" targetGrade="B" maxEnchant="15" />
	<enchant id="22227" targetGrade="C" maxEnchant="15" />
	<enchant id="22229" targetGrade="D" maxEnchant="15" />
	<!-- Scroll: Enchant Armor of Destruction -->
	<enchant id="22222" targetGrade="S" maxEnchant="6" />
	<enchant id="22224" targetGrade="A" maxEnchant="6" />
	<enchant id="22226" targetGrade="B" maxEnchant="6" />
	<enchant id="22228" targetGrade="C" maxEnchant="6" />
	<enchant id="22230" targetGrade="D" maxEnchant="6" />

	<!-- Master Yogi's Scroll: Enchant Weapon -->
	<enchant id="13540" maxEnchant="23">
		<item id="13539" /> <!-- Staff of Master Yogi -->
	</enchant>

	<!-- Olf's T-shirt Enchant Scroll -->
	<enchant id="21581" maxEnchant="10">
		<item id="21580" /> <!-- Olf's T-shirt -->
		<item id="21706" /> <!-- Olf's T-shirt (Event) -->
	</enchant>

	<!-- Blessed Olf's T-shirt Enchant Scroll -->
	<enchant id="21582" maxEnchant="10">
		<item id="21580" /> <!-- Olf's T-shirt -->
		<item id="21706" /> <!-- Olf's T-shirt (Event) -->
	</enchant>

	<!-- Blessed Olf's T-shirt Enchant Scroll - Event -->
	<enchant id="21707" maxEnchant="10">
		<item id="21580" /> <!-- Olf's T-shirt -->
		<item id="21706" /> <!-- Olf's T-shirt (Event) -->
	</enchant>

	<!-- Event - Herdsman's Love Scroll Event -->
	<enchant id="15381" maxEnchant="16">
		<item id="15383" /> <!-- Weaver's Multi-colored Clothes (7-day limited period) -->
		<item id="15384" /> <!-- Weaver's Multi-colored Clothes (30-day limited period) -->
		<item id="15385" /> <!-- Weaver's Multi-colored Clothes (60-day limited period) -->
		<item id="15386" /> <!-- Weaver's Multi-colored Clothes (90-day limited period) -->
		<item id="15387" /> <!-- Weaver's Multi-colored Clothes (Permanent Use) -->
		<item id="15388" /> <!-- Weaver's Multi-colored Clothes (Event) (7-day limited period) -->
		<item id="15389" /> <!-- Weaver's Multi-colored Clothes (Event) (30-day limited period) -->
		<item id="15390" /> <!-- Weaver's Multi-colored Clothes (Event) (60-day limited period) -->
		<item id="15391" /> <!-- Weaver's Multi-colored Clothes (Event) (90-day limited period) -->
		<item id="15392" /> <!-- Weaver's Multi-colored Clothes (Event) (Permanent Use) -->
	</enchant>

	<!-- Event - Vitality Belt Enchant Scroll -->
	<enchant id="15382" maxEnchant="50">
		<item id="15393" /> <!-- Vitality Belt (7-day limited period) -->
		<item id="15394" /> <!-- Vitality Belt (30-day limited period) -->
		<item id="15395" /> <!-- Vitality Belt (60-day limited period) -->
		<item id="15396" /> <!-- Vitality Belt (90-day limited period) -->
		<item id="15397" /> <!-- Vitality Belt (Permanent Use) -->
		<item id="15398" /> <!-- Vitality Belt (Event) (7-day limited period) -->
		<item id="15399" /> <!-- Vitality Belt (Event) (30-day limited period) -->
		<item id="15400" /> <!-- Vitality Belt (Event) (60-day limited period) -->
		<item id="15401" /> <!-- Vitality Belt (Event) (90-day limited period) -->
		<item id="15402" /> <!-- Vitality Belt (Event) (Permanent Use) -->
	</enchant>

	<!-- Weapon enhancing scroll exclusive for PC cafe -->
	<enchant id="15346" targetGrade="S">
		<item id="15313" /> <!-- Player Commendation - Forgotten Blade (Player Recommendation Weapon) -->
		<item id="15314" /> <!-- Player Commendation - Basalt Battlehammer (Player Recommendation Weapon) -->
		<item id="15315" /> <!-- Player Commendation - Imperial Staff (Player Recommendation Weapon) -->
		<item id="15316" /> <!-- Player Commendation - Angel Slayer (Player Recommendation Weapon) -->
		<item id="15317" /> <!-- Player Commendation - Dragon Hunter Axe (Player Recommendation Weapon) -->
		<item id="15318" /> <!-- Player Commendation - Saint Spear (Player Recommendation Weapon) -->
		<item id="15319" /> <!-- Player Commendation - Demon Splinter (Player Recommendation Weapon) -->
		<item id="15320" /> <!-- Player Commendation - Heaven's Divider (Player Recommendation Weapon) -->
		<item id="15321" /> <!-- Player Commendation - Arcana Macw (Player Recommendation Weapon) -->
		<item id="15322" /> <!-- Player Commendation - Draconic Bow (Player Recommendation Weapon) -->
		<item id="15323" /> <!-- Player Commendation - Laevateinn (Player Recommendation Weapon) -->
		<item id="15324" /> <!-- Player Commendation - Gram (Player Recommendation Weapon) -->
		<item id="15325" /> <!-- Player Commendation - Sarunga (Player Recommendation Weapon) -->
		<item id="15326" /> <!-- Player Commendation - Tallum Blade *Dark Legion's Edge (Player Recommendation Weapon) -->
	</enchant>
	<enchant id="15347" targetGrade="A">
		<item id="13210" /> <!-- Player Commendation - Sirra's Blade (Player Commendation Weapon) -->
		<item id="13211" /> <!-- Player Commendation - Sword of Ipos (Player Commendation Weapon) -->
		<item id="13212" /> <!-- Player Commendation - Barakiel's Axe (Player Commendation Weapon) -->
		<item id="13213" /> <!-- Player Commendation - Behemoth Tuning Fork (Player Commendation Weapon) -->
		<item id="13214" /> <!-- Player Commendation - Naga Storm (Player Commendation Weapon) -->
		<item id="13215" /> <!-- Player Commendation - Tiphon's Spear (Player Commendation Weapon) -->
		<item id="13216" /> <!-- Player Commendation - Shyeed's Bow (Player Commendation Weapon) -->
		<item id="13217" /> <!-- Player Commendation - Sobekk's Hurricane (Player Commendation Weapon) -->
		<item id="13218" /> <!-- Player Commendation - Themis' Tongue (Player Commendation Weapon) -->
		<item id="13219" /> <!-- Player Commendation - Cabrio's Hand (Player Commendation Weapon) -->
		<item id="13220" /> <!-- Player Commendation - Daimon Crystal (Player Commendation Weapon) -->
		<item id="13221" /> <!-- Player Commendation - Tallum Blade*Damascus (Player Commendation Weapon) -->
		<item id="13222" /> <!-- Player Commendation - Eclair Bijou (Player Commendation Weapon) -->
		<item id="13223" /> <!-- Player Commendation - Durendal (Player Commendation Weapon) -->
		<item id="13224" /> <!-- Player Commendation - Screaming Vengeance (Player Commendation Weapon) -->
	</enchant>
	<enchant id="15348" targetGrade="B">
		<item id="13194" /> <!-- Player Commendation - Damascus Sword (Player Commendation Weapon) -->
		<item id="13195" /> <!-- Player Commendation - Lance (Player Commendation Weapon) -->
		<item id="13196" /> <!-- Player Commendation - Deadman's Glory (Player Commendation Weapon) -->
		<item id="13197" /> <!-- Player Commendation - Art of Battle Axe (Player Commendation Weapon) -->
		<item id="13198" /> <!-- Player Commendation - Staff of Evil Spirits (Player Commendation Weapon) -->
		<item id="13199" /> <!-- Player Commendation - Devil's Dagger (Player Commendation Weapon) -->
		<item id="13200" /> <!-- Player Commendation - Bellion Cestus (Player Commendation Weapon) -->
		<item id="13201" /> <!-- Player Commendation - Bow of Peril (Player Commendation Weapon) -->
		<item id="13202" /> <!-- Player Commendation - Samurai*Samurai (Player Commendation Weapon) -->
		<item id="13203" /> <!-- Player Commendation - Guardian's Sword (Player Commendation Weapon) -->
		<item id="13204" /> <!-- Player Commendation - Wizard's Tear (Player Commendation Weapon) -->
		<item id="13205" /> <!-- Player Commendation - Kaim Vanul's Bones (Player Commendation Weapon) -->
		<item id="13206" /> <!-- Player Commendation - Star Buster (Player Commendation Weapon) -->
		<item id="13207" /> <!-- Player Commendation - Colichemarde (Player Commendation Weapon) -->
		<item id="13208" /> <!-- Player Commendation - Dismantler (Player Commendation Weapon) -->
		<item id="13209" /> <!-- Player Commendation - Hell Hound (Player Commendation Weapon) -->
	</enchant>
	<enchant id="15349" targetGrade="C">
		<item id="13178" /> <!-- Player Commendation - Samurai Long Sword (Player Commendation Weapon) -->
		<item id="13179" /> <!-- Player Commendation - Ghost's Wand (Player Commendation Weapon) -->
		<item id="13180" /> <!-- Player Commendation - Ghoul's Wand (Player Commendation Weapon) -->
		<item id="13181" /> <!-- Player Commendation - Devil's Wand (Player Commendation Weapon) -->
		<item id="13182" /> <!-- Player Commendation - Crystal Dagger (Player Commendation Weapon) -->
		<item id="13183" /> <!-- Player Commendation - Great Pata (Player Commendation Weapon) -->
		<item id="13184" /> <!-- Player Commendation - Eminence Bow (Player Commendation Weapon) -->
		<item id="13185" /> <!-- Player Commendation - Orcish Poleaxe (Player Commendation Weapon) -->
		<item id="13186" /> <!-- Player Commendation - Yaksa Mace (Player Commendation Weapon) -->
		<item id="13187" /> <!-- Player Commendation - Shamshir*Shamshir (Player Commendation Weapon) -->
		<item id="13188" /> <!-- Player Commendation - Admiral's Estoc (Player Commendation Weapon) -->
		<item id="13189" /> <!-- Player Commendation - Saber Tooth (Player Commendation Weapon) -->
		<item id="13190" /> <!-- Player Commendation - Sharpshooter (Player Commendation Weapon) -->
		<item id="13191" /> <!-- Player Commendation - Ecliptic Sword (Player Commendation Weapon) -->
		<item id="13192" /> <!-- Player Commendation - Ecliptic Axe (Player Commendation Weapon) -->
		<item id="13193" /> <!-- Player Commendation - Dwarven Hammer (Player Commendation Weapon) -->
	</enchant>
	<enchant id="15350" targetGrade="D">
		<item id="13163" /> <!-- Player Commendation - Bastard*Crimson Sword (Player Commendation Weapon) -->
		<item id="13164" /> <!-- Player Commendation - Claymore (Player Commendation Weapon) -->
		<item id="13165" /> <!-- Player Commendation - Bonebreaker (Player Commendation Weapon) -->
		<item id="13166" /> <!-- Player Commendation - Atuba Hammer (Player Commendation Weapon) -->
		<item id="13167" /> <!-- Player Commendation - Ghost's Wand (Player Commendation Weapon) -->
		<item id="13168" /> <!-- Player Commendation - Hall of Life (Player Commendation Weapon) -->
		<item id="13169" /> <!-- Player Commendation - Atuba Mace (Player Commendation Weapon) -->
		<item id="13170" /> <!-- Player Commendation - Mithril Dagger (Player Commendation Weapon) -->
		<item id="13171" /> <!-- Player Commendation - Scallop Jamadhr (Player Commendation Weapon) -->
		<item id="13172" /> <!-- Player Commendation - Crossbow (Player Commendation Weapon) -->
		<item id="13173" /> <!-- Player Commendation - Glaive (Player Commendation Weapon) -->
		<item id="13174" /> <!-- Player Commendation - Elven Long Sword (Player Commendation Weapon) -->
		<item id="13175" /> <!-- Player Commendation - Grand Epee (Player Commendation Weapon) -->
		<item id="13176" /> <!-- Player Commendation - General Katzbalger (Player Commendation Weapon) -->
		<item id="13177" /> <!-- Player Commendation - Cranequin (Player Commendation Weapon) -->
	</enchant>

	<!-- Weapon-Type Enhance Backup Stone -->
	<support id="12362" targetGrade="D" maxEnchant="9" bonusRate="20" />
	<support id="12363" targetGrade="C" maxEnchant="9" bonusRate="18" />
	<support id="12364" targetGrade="B" maxEnchant="9" bonusRate="15" />
	<support id="12365" targetGrade="A" maxEnchant="9" bonusRate="12" />
	<support id="12366" targetGrade="S" maxEnchant="9" bonusRate="10" />

	<!-- Armor-Type Enhance Backup Stone -->
	<support id="12367" targetGrade="D" maxEnchant="9" bonusRate="35" />
	<support id="12368" targetGrade="C" maxEnchant="9" bonusRate="27" />
	<support id="12369" targetGrade="B" maxEnchant="9" bonusRate="23" />
	<support id="12370" targetGrade="A" maxEnchant="9" bonusRate="18" />
	<support id="12371" targetGrade="S" maxEnchant="9" bonusRate="15" />

	<!-- Agathion Auxiliary Stone: Enchant Weapon -->
	<support id="14702" targetGrade="D" maxEnchant="9" bonusRate="20" />
	<support id="14703" targetGrade="C" maxEnchant="9" bonusRate="18" />
	<support id="14704" targetGrade="B" maxEnchant="9" bonusRate="15" />
	<support id="14705" targetGrade="A" maxEnchant="9" bonusRate="12" />
	<support id="14706" targetGrade="S" maxEnchant="9" bonusRate="10" />

	<!-- Agathion Auxiliary Stone: Enchant Armor -->
	<support id="14707" targetGrade="D" maxEnchant="9" bonusRate="35" />
	<support id="14708" targetGrade="C" maxEnchant="9" bonusRate="27" />
	<support id="14709" targetGrade="B" maxEnchant="9" bonusRate="23" />
	<support id="14710" targetGrade="A" maxEnchant="9" bonusRate="18" />
	<support id="14711" targetGrade="S" maxEnchant="9" bonusRate="15" />
</list>

 

And about what java code you send me, i have the same. No changes. I don;t touch that class

  • 0
Posted

Scroll ID 730 ( Enchant Armor A )

The thinkg is. I do custom stuff on core. But nothing what i do wasn't with enchant or any class about this.

  • 0
Posted

Look on this video i created now. And how work for A grade, work for all scrolls/items.
Nothing happend 

 

I thin it's from edits what i maked on core. I don;t know yet

  • 0
Posted

Add debug messages into RequestExTryToPutEnchantTargetItem packet for known what missed.

 

/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.l2jmobius.gameserver.network.clientpackets;

import java.util.logging.Level;

import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.gameserver.data.xml.EnchantItemData;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.items.enchant.EnchantScroll;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExPutEnchantTargetItemResult;

/**
 * @author KenM
 */
public class RequestExTryToPutEnchantTargetItem implements IClientIncomingPacket
{
	private int _objectId;
	
	@Override
	public boolean read(GameClient client, PacketReader packet)
	{
		_objectId = packet.readD();
		return true;
	}
	
	@Override
	public void run(GameClient client)
	{
		final PlayerInstance player = client.getPlayer();
		if ((_objectId == 0) || (player == null))
		{
			return;
		}
		
		if (player.isEnchanting())
		{
			return;
		}
		
		final ItemInstance item = player.getInventory().getItemByObjectId(_objectId);
		final ItemInstance scroll = player.getInventory().getItemByObjectId(player.getActiveEnchantItemId());
		if ((item == null) || (scroll == null))
		{
			return;
		}
		
		final EnchantScroll scrollTemplate = EnchantItemData.getInstance().getEnchantScroll(scroll);
		if ((scrollTemplate == null) || !scrollTemplate.isValid(item, null))
		{
			player.sendMessage("Scrol template is " + (scrollTemplate == null ? "null" : "not noll"));
			player.sendMessage("Item is " + (scrollTemplate.isValid(item, null) ? "valid" : "not valid") + " for this scroll template.");
			player.sendPacket(SystemMessageId.DOES_NOT_FIT_STRENGTHENING_CONDITIONS_OF_THE_SCROLL);
			player.setActiveEnchantItemId(PlayerInstance.ID_NONE);
			player.sendPacket(new ExPutEnchantTargetItemResult(0));
			if (scrollTemplate == null)
			{
				LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Undefined scroll have been used id: " + scroll.getId());
			}
			return;
		}
		player.setEnchanting(true);
		player.setActiveEnchantTimestamp(Chronos.currentTimeMillis());
		player.sendPacket(new ExPutEnchantTargetItemResult(_objectId));
	}
}

 

I guess you broken something with your customs and reconfig.

  • 0
Posted

Assume, what this item isn't registered for this scroll or crystal type mismatches. Anyway you need debug isValid() method in EnchantScroll and AbstractEnchantItem classes.

 

By the way. I didn't understood a logic in this validation.

	public boolean isValid(ItemInstance itemToEnchant, EnchantSupportItem supportItem)
	{
		if ((_items != null) && !_items.contains(itemToEnchant.getId()))
		{
			// If _items isn't null check registered Item Id.
			return false;
		}
		else if ((supportItem != null))
		{
			if (_isBlessed)
			{
				return false;
			}
			else if (!supportItem.isValid(itemToEnchant, supportItem))
			{
				return false;
			}
			else if (supportItem.isWeapon() != isWeapon())
			{
				return false;
			}
		}
		if (_items == null)
		{
			// If _items Set is null get all scrolls.
			for (EnchantScroll scroll : EnchantItemData.getInstance().getScrolls())
			{
				if (scroll.getId() == getId())
				{
					continue;
				}

				final Set<Integer> scrollItems = scroll.getItems(); 
				// here we get the Set from _items field via local getter method (already checked before). LMAO.
				if ((scrollItems != null) && scrollItems.contains(itemToEnchant.getId()))
				{
					// If scroll exists and item for enchanting isn't registered then fault.
					return false;
				}
			}
		}

		// Calls here super class with checking Grade and etc.
		return super.isValid(itemToEnchant, supportItem);
	}

 

Correct me if i'm wrong.

Guest
This topic is now closed to further replies.


×
×
  • Create New...