Jump to content
  • 0

Enchant scrolls!


0flee

Question

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!

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • So excited to announce 3x Telegram Premium (6 months)   Join our official TG and participate to win!   Asocks.com - trusted proxy service providing mobile and residential proxies with a single price of $3 per 1GB   A huge locations pool and high speed will help complete all tasks    
    • Well, sorry not sorry for resurrecting old topic, but I believe it's ultimately stupid to implement license checks like Vilmis did 🙂   private static String url = "jdbc:mysql://185.80.128.233/" + getData("Zm9ydW1fZGI="); private static String username = getData("bXJjb3B5cmlnaHQ="); private static String password = getData("Y29weXJpZ2h0XzEyMw=="); con = GlobalDB.getInstance().getConnection(); PreparedStatement statement; statement = con.prepareStatement("SELECT field_6 from core_pfields_content WHERE member_id = ?"); statement.setInt(1, Config.FORUM_USER_ID); ResultSet rset = statement.executeQuery();   This awesome way of coding things leaves us with base64-encoded credentials and DB exposed and accessible globally 😉 Btw he checks his licensing data from some plugin generated table his forum uses. Vilmis took action and ensured that mrcopyright user would have only needed accesses and rights for this operation. But he forgot to ensure that his INFORMATION_SCHEMA database would not be exposed and readable... That leads us to fully readable server variables like version used (10.1.26-MariaDB-0+deb9u1 - pretty ancient DB and OS, I'd assume). From here you can go south and do some kinky stuff, if you want and have knowledge for that. But who cares, right?   Ooh, table core_pfields_content field_6 is IP address which is checked by FORUM_USER_ID. Yep, you can query all IP addresses there (124 of them right now) and also do whatever you want with them! 🙂  The most fun part? Files source has been shared what, more than 2 years ago?  Vilmis still uses very same credentials and never changed it after sources exposure - who cares. Although, "sources" may be way too strong word here. If anyone still use paid Orion versions, I'd suggest packing your shit and leaving immediately, or at least fix this incompetent fool caused problems. It's obvious Vilmis don't care or maybe doesn't even know from the first place how to solve this problem (hint hint - tiny PHP Rest API microservice which would do absolutely the same but without exposing sensitive data?). By doing that, he exposes his infrastructure and YOUR data, and he does that for more than 2 years now 🙂 Developer of century!    
    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...