Jump to content
  • 0

[Help/Question]Scrolls


Question

Posted

Can i make S Grade Scrolls enchant all grade items?

example i use an Blessed S Grade Weapon and can enchant a Grade A Weapon...

for normal s grade crystal and blessed...i just wanna make then enchant all grade items...

 

and other thing...make soulshots auto active...just equip the weapon and soulshot automatic active...

11 answers to this question

Recommended Posts

  • 0
Posted

Can i make S Grade Scrolls enchant all grade items?

example i use an Blessed S Grade Weapon and can enchant a Grade A Weapon...

for normal s grade crystal and blessed...i just wanna make then enchant all grade items...

 

and other thing...make soulshots auto active...just equip the weapon and soulshot automatic active...

 

net.sf.l2j.gameserver.network.clientpackets and open RequestEnchantItem.java and find that:

        switch (item.getItem().getCrystalType())
        {
            case L2Item.CRYSTAL_A:
                crystalId = 1461;
                switch(scroll.getItemId())
                {
                    case 729: case 731: case 6569:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 730: case 732: case 6570:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_B:
                crystalId = 1460;
                switch(scroll.getItemId())
                {
                    case 947: case 949: case 6571:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 948: case 950: case 6572:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_C:
                crystalId = 1459;
                switch(scroll.getItemId())
                {
                    case 951: case 953: case 6573:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 952: case 954: case 6574:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_D:
                crystalId = 1458;
                switch(scroll.getItemId())
                {
                    case 955: case 957: case 6575:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 956: case 958: case 6576:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_S:
                crystalId = 1462;
                switch(scroll.getItemId())
                {
                    case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
        }

 

and replace with that:

 


switch (item.getItem().getCrystalType())
        {
            case L2Item.CRYSTAL_A:
                crystalId = 1461;
                switch(scroll.getItemId())
                {
                case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_B:
                crystalId = 1460;
                switch(scroll.getItemId())
                {
                case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_C:
                crystalId = 1459;
                switch(scroll.getItemId())
                {
                case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_D:
                crystalId = 1458;
                switch(scroll.getItemId())
                {
                case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_S:
                crystalId = 1462;
                switch(scroll.getItemId())
                {
                    case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
        }

with that code all your items can enchant with Only S grade Items..

 

and with this code can S grade scolls enchant all items and other scrolls work normal...

 


switch (item.getItem().getCrystalType())
        {
            case L2Item.CRYSTAL_A:
                crystalId = 1461;
                switch(scroll.getItemId())
                {
                    case 729: case 731: case 6569: case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 730: case 732: case 6570: case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_B:
                crystalId = 1460;
                switch(scroll.getItemId())
                {
                    case 947: case 949: case 6571: case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 948: case 950: case 6572: case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_C:
                crystalId = 1459;
                switch(scroll.getItemId())
                {
                    case 951: case 953: case 6573: case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 952: case 954: case 6574: case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_D:
                crystalId = 1458;
                switch(scroll.getItemId())
                {
                    case 955: case 957: case 6575: case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 956: case 958: case 6576: case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
            case L2Item.CRYSTAL_S:
                crystalId = 1462;
                switch(scroll.getItemId())
                {
                    case 959: case 961: case 6577:
                        if(itemType2 == L2Item.TYPE2_WEAPON)
                            enchantItem = true;
                        break;
                    case 960: case 962: case 6578:
                        if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
                            enchantItem = true;
                        break;
                }
                break;
        }

  • 0
Posted

i cant found these lines at requestenchantitem.java ;s

 

Then post your java file and then we can work on it to help u.

  • 0
Posted

/*
* 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 net.sf.l2j.gameserver.network.clientpackets;

import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.EnchantResult;
import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
import net.sf.l2j.gameserver.network.serverpackets.ItemList;
import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;

public final class RequestEnchantItem extends AbstractEnchantPacket
{
protected static final Logger _log = Logger.getLogger(RequestEnchantItem.class.getName());
protected static final Logger _logEnchant = Logger.getLogger("enchant");

private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";

private int _objectId = 0;

@Override
protected void readImpl()
{
	_objectId = readD();
}

@Override
protected void runImpl()
{
	L2PcInstance activeChar = getClient().getActiveChar();

	if (activeChar == null || _objectId == 0)
		return;

	if (activeChar.isOnline() == 0 || getClient().isDetached())
	{
		activeChar.setActiveEnchantItem(null);
		return;
	}

	if (activeChar.isProcessingTransaction() || activeChar.isInStoreMode())
	{
		activeChar.sendPacket(new SystemMessage(SystemMessageId.CANNOT_ENCHANT_WHILE_STORE));
		activeChar.setActiveEnchantItem(null);
		return;
	}

	L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
	L2ItemInstance scroll = activeChar.getActiveEnchantItem();
	L2ItemInstance support = activeChar.getActiveEnchantSupportItem();

	if (item == null || scroll == null)
	{
		activeChar.setActiveEnchantItem(null);
		return;
	}

	// template for scroll
	EnchantScroll scrollTemplate = getEnchantScroll(scroll);

	// scroll not found in list
	if (scrollTemplate == null)
		return;

	// template for support item, if exist
	EnchantItem supportTemplate = null;
	if (support != null)
		supportTemplate = getSupportItem(support);

	// first validation check
	if (!scrollTemplate.isValid(item, supportTemplate) || !isEnchantable(item))
	{
		activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
		activeChar.setActiveEnchantItem(null);
		activeChar.sendPacket(new EnchantResult(2, 0, 0));
		return;
	}

	// fast auto-enchant cheat check
	if (activeChar.getActiveEnchantTimestamp() == 0 || System.currentTimeMillis() - activeChar.getActiveEnchantTimestamp() < 2000)
	{
		Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " use autoenchant program ", Config.DEFAULT_PUNISH);
		activeChar.setActiveEnchantItem(null);
		activeChar.sendPacket(new EnchantResult(2, 0, 0));
		return;
	}

	// attempting to destroy scroll
	scroll = activeChar.getInventory().destroyItem("Enchant", scroll.getObjectId(), 1, activeChar, item);
	if (scroll == null)
	{
		activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
		Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " tried to enchant with a scroll he doesn't have", Config.DEFAULT_PUNISH);
		activeChar.setActiveEnchantItem(null);
		activeChar.sendPacket(new EnchantResult(2, 0, 0));
		return;
	}

	// attempting to destroy support if exist
	if (support != null)
	{
		support = activeChar.getInventory().destroyItem("Enchant", support.getObjectId(), 1, activeChar, item);
		if (support == null)
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
			Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " tried to enchant with a support item he doesn't have", Config.DEFAULT_PUNISH);
			activeChar.setActiveEnchantItem(null);
			activeChar.sendPacket(new EnchantResult(2, 0, 0));
			return;
		}
	}

	SystemMessage sm;

	synchronized (item)
	{
		int chance = scrollTemplate.getChance(item, supportTemplate);

		// last validation check
		if (item.getOwnerId() != activeChar.getObjectId()
				|| !isEnchantable(item)
				|| chance < 0)
		{
			activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
			activeChar.setActiveEnchantItem(null);
			activeChar.sendPacket(new EnchantResult(2, 0, 0));
			return;
		}

		if (Rnd.get(100) < chance)
		{
			// success
			item.setEnchantLevel(item.getEnchantLevel() + 1);
			item.updateDatabase();
			activeChar.sendPacket(new EnchantResult(0, 0, 0));

			if (Config.LOG_ITEM_ENCHANTS)
			{
				LogRecord record = new LogRecord(Level.INFO, "Success");
				record.setParameters(new Object[]{activeChar, item, scroll, support, chance});
				record.setLoggerName("item");
				_logEnchant.log(record);
			}
		}
		else
		{
			if (scrollTemplate.isSafe())
			{
				// safe enchant - remain old value
				// need retail message
				activeChar.sendPacket(new EnchantResult(5, 0, 0));

				if (Config.LOG_ITEM_ENCHANTS)
				{
					LogRecord record = new LogRecord(Level.INFO, "Safe Fail");
					record.setParameters(new Object[]{activeChar, item, scroll, support, chance});
					record.setLoggerName("item");
					_logEnchant.log(record);
				}
			}
			else
			{
				// unequip item on enchant failure to avoid item skills stack
				if (item.isEquipped())
				{
					if (item.getEnchantLevel() > 0)
					{
						sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
						sm.addNumber(item.getEnchantLevel());
						sm.addItemName(item);
						activeChar.sendPacket(sm);
					}
					else
					{
						sm = new SystemMessage(SystemMessageId.S1_DISARMED);
						sm.addItemName(item);
						activeChar.sendPacket(sm);
					}

					L2ItemInstance[] unequiped = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getLocationSlot());
					InventoryUpdate iu = new InventoryUpdate();
					for (L2ItemInstance itm : unequiped)
					{
						iu.addModifiedItem(itm);
					}
					activeChar.sendPacket(iu);
					activeChar.broadcastUserInfo();
				}

				if (scrollTemplate.isBlessed())
				{
					// blessed enchant - clear enchant value
					sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
					activeChar.sendPacket(sm);

					item.setEnchantLevel(0);
					item.updateDatabase();
					activeChar.sendPacket(new EnchantResult(3, 0, 0));

					if (Config.LOG_ITEM_ENCHANTS)
					{
						LogRecord record = new LogRecord(Level.INFO, "Blessed Fail");
						record.setParameters(new Object[]{activeChar, item, scroll, support, chance});
						record.setLoggerName("item");
						_logEnchant.log(record);
					}
				}
				else 
				{
					// enchant failed, destroy item
					int crystalId = item.getItem().getCrystalItemId();
					int count = item.getCrystalCount() - (item.getItem().getCrystalCount() + 1) / 2;
					if (count < 1)
						count = 1;

					L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
					if (destroyItem == null)
					{
						// unable to destroy item, cheater ?
						Util.handleIllegalPlayerAction(activeChar, "Unable to delete item on enchant failure from player " + activeChar.getName() + ", possible cheater !", Config.DEFAULT_PUNISH);
						activeChar.setActiveEnchantItem(null);
						activeChar.sendPacket(new EnchantResult(2, 0, 0));

						if (Config.LOG_ITEM_ENCHANTS)
						{
							LogRecord record = new LogRecord(Level.INFO, "Unable to destroy");
							record.setParameters(new Object[]{activeChar, item, scroll, support, chance});
							record.setLoggerName("item");
							_logEnchant.log(record);
						}
						return;
					}

					L2ItemInstance crystals = null;
					if (crystalId != 0)
					{
						crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);

						sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
						sm.addItemName(crystals);
						sm.addItemNumber(count);
						activeChar.sendPacket(sm);
					}

					if (!Config.FORCE_INVENTORY_UPDATE)
					{
						InventoryUpdate iu = new InventoryUpdate();
						if (destroyItem.getCount() == 0)
							iu.addRemovedItem(destroyItem);
						else
							iu.addModifiedItem(destroyItem);
						if (crystals != null)
							iu.addItem(crystals);

						activeChar.sendPacket(iu);
					}
					else
						activeChar.sendPacket(new ItemList(activeChar, true));

					L2World world = L2World.getInstance();
					world.removeObject(destroyItem);
					if (crystalId == 0)
						activeChar.sendPacket(new EnchantResult(4, 0, 0));
					else
						activeChar.sendPacket(new EnchantResult(1, crystalId, count));

					if (Config.LOG_ITEM_ENCHANTS)
					{
						LogRecord record = new LogRecord(Level.INFO, "Fail");
						record.setParameters(new Object[]{activeChar, item, scroll, support, chance});
						record.setLoggerName("item");
						_logEnchant.log(record);
					}
				}
			}
		}
		sm = null;

		StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
		su.addAttribute(StatusUpdate.CUR_LOAD, activeChar.getCurrentLoad());
		activeChar.sendPacket(su);
		su = null;

		activeChar.sendPacket(new ItemList(activeChar, false));
		activeChar.broadcastUserInfo();
		activeChar.setActiveEnchantItem(null);
	}
}

/*
 * (non-Javadoc)
 * 
 * @see net.sf.l2j.gameserver.clientpackets.ClientBasePacket#getType()
 */
@Override
public String getType()
{
	return _C__58_REQUESTENCHANTITEM;
}
}

 

and..any1 know about soulshots?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • This update resaves 25_25 from the original (with sounds) (without the cave below) Some emitter fixes (removed waterfalls with high-poly meshes) The geodata is old, but it works Everything else is unchanged Download P.S. The effect files are taken from the high client for Interlude, so if you're experiencing critical skills, use the default ones for your Version.  
    • GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock