Jump to content

Recommended Posts

  • 4 weeks later...
Posted

Please help me i dont no. I find files RequestExEnchantItemAttribute.java

and i dont lines i based on l2jserver High Five

 

- if (item.getItem().getItemType() == L2WeaponType.FISHINGROD || item.isShadowItem() || item.isCommonItem() || item.isPvp() || item.isHeroItem() || item.isTimeLimitedItem() ||

+ if (item.getItem().getItemType() == L2WeaponType.FISHINGROD || item.isShadowItem() || item.isCommonItem() || item.isHeroItem() || item.isTimeLimitedItem() ||

 

Mi files:

 

public class RequestExEnchantItemAttribute extends L2GameClientPacket
{
private static final String _C__D0_35_REQUESTEXENCHANTITEMATTRIBUTE = "[C] D0:35 RequestExEnchantItemAttribute";

private int _objectId;

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

@Override
protected void runImpl()
{
	L2PcInstance player = getClient().getActiveChar();
	if (player == null)
		return;

	if (_objectId == 0xFFFFFFFF)
	{
		// Player canceled enchant
		player.setActiveEnchantAttrItem(null);
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_CANCELED));
		return;
	}

	if (!player.isOnline())
	{
		player.setActiveEnchantAttrItem(null);
		return;
	}

	if (player.getPrivateStoreType() != 0)
	{
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_ADD_ELEMENTAL_POWER_WHILE_OPERATING_PRIVATE_STORE_OR_WORKSHOP));
		player.setActiveEnchantAttrItem(null);
		return;
	}

	// Restrict enchant during a trade (bug if enchant fails)
	if (player.getActiveRequester() != null)
	{
		// Cancel trade
		player.cancelActiveTrade();
		player.setActiveEnchantAttrItem(null);
		player.sendMessage("Enchanting items is not allowed during a trade.");
		return;
	}

	L2ItemInstance item = player.getInventory().getItemByObjectId(_objectId);
	L2ItemInstance stone = player.getActiveEnchantAttrItem();
	if (item == null || stone == null)
	{
		player.setActiveEnchantAttrItem(null);
		return;
	}

	if (!item.isElementable())
	{
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_REQUIREMENT_NOT_SUFFICIENT));
		player.setActiveEnchantAttrItem(null);
		return;
	}

	switch (item.getLocation())
	{
		case INVENTORY:
		case PAPERDOLL:
		{
			if (item.getOwnerId() != player.getObjectId())
			{
				player.setActiveEnchantAttrItem(null);
				return;
			}
			break;
		}
		default:
		{
			player.setActiveEnchantAttrItem(null);
			Util.handleIllegalPlayerAction(player, "Player "+player.getName()+" tried to use enchant Exploit!", Config.DEFAULT_PUNISH);
			return;
		}
	}

	int stoneId = stone.getItemId();
	byte elementToAdd = Elementals.getItemElement(stoneId);
	// Armors have the opposite element
	if (item.isArmor())
		elementToAdd = Elementals.getOppositeElement(elementToAdd);
	byte opositeElement = Elementals.getOppositeElement(elementToAdd);

	Elementals oldElement = item.getElemental(elementToAdd);
	int elementValue = oldElement == null ? 0 : oldElement.getValue();
	int limit = getLimit(item, stoneId);
	int powerToAdd = getPowerToAdd(stoneId, elementValue, item);

	if ((item.isWeapon() && oldElement != null && oldElement.getElement() != elementToAdd && oldElement.getElement() != -2)
			|| (item.isArmor() && item.getElemental(elementToAdd) == null && item.getElementals() != null && item.getElementals().length >= 3))
	{
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ANOTHER_ELEMENTAL_POWER_ALREADY_ADDED));
		player.setActiveEnchantAttrItem(null);
		return;
	}

	if (item.isArmor() && item.getElementals() != null)
	{
		//cant add opposite element
		for (Elementals elm : item.getElementals())
		{
			if (elm.getElement() == opositeElement)
			{
				player.setActiveEnchantAttrItem(null);
				Util.handleIllegalPlayerAction(player, "Player "+player.getName()+" tried to add oposite attribute to item!", Config.DEFAULT_PUNISH);
				return;
			}
		}
	}

	int newPower = elementValue + powerToAdd;
	if (newPower > limit)
	{
		newPower = limit;
		powerToAdd = limit - elementValue;
	}

	if (powerToAdd <= 0)
	{
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_CANCELED));
		player.setActiveEnchantAttrItem(null);
		return;
	}

	if(!player.destroyItem("AttrEnchant", stone, 1, player, true))
	{
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
		Util.handleIllegalPlayerAction(player, "Player "+player.getName()+" tried to attribute enchant with a stone he doesn't have", Config.DEFAULT_PUNISH);
		player.setActiveEnchantAttrItem(null);
		return;
	}
	boolean success = false;
	switch(Elementals.getItemElemental(stoneId)._type)
	{
		case Stone:
		case Roughore:
			success = Rnd.get(100) < Config.ENCHANT_CHANCE_ELEMENT_STONE;
			break;
		case Crystal:
			success = Rnd.get(100) < Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL;
			break;
		case Jewel:
			success = Rnd.get(100) < Config.ENCHANT_CHANCE_ELEMENT_JEWEL;
			break;
		case Energy:
			success = Rnd.get(100) < Config.ENCHANT_CHANCE_ELEMENT_ENERGY;
			break;
	}
	if (success)
	{
		byte realElement = item.isArmor() ? opositeElement : elementToAdd;

		SystemMessage sm;
		if (item.getEnchantLevel() == 0)
		{
			if (item.isArmor())
				sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S2_ATTRIBUTE_WAS_SUCCESSFULLY_BESTOWED_ON_S1_RES_TO_S3_INCREASED);
			else
				sm = SystemMessage.getSystemMessage(SystemMessageId.ELEMENTAL_POWER_S2_SUCCESSFULLY_ADDED_TO_S1);
			sm.addItemName(item);
			sm.addElemental(realElement);
			if (item.isArmor())
				sm.addElemental(Elementals.getOppositeElement(realElement));
		}
		else
		{
			if (item.isArmor())
				sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S3_ATTRIBUTE_BESTOWED_ON_S1_S2_RESISTANCE_TO_S4_INCREASED);
			else
				sm = SystemMessage.getSystemMessage(SystemMessageId.ELEMENTAL_POWER_S3_SUCCESSFULLY_ADDED_TO_S1_S2);
			sm.addNumber(item.getEnchantLevel());
			sm.addItemName(item);
			sm.addElemental(realElement);
			if (item.isArmor())
				sm.addElemental(Elementals.getOppositeElement(realElement));
		}
		player.sendPacket(sm);
		item.setElementAttr(elementToAdd, newPower);
		if (item.isEquipped())
			item.updateElementAttrBonus(player);

		// send packets
		InventoryUpdate iu = new InventoryUpdate();
		iu.addModifiedItem(item);
		player.sendPacket(iu);
	}
	else
		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FAILED_ADDING_ELEMENTAL_POWER));

	player.sendPacket(new ExAttributeEnchantResult(powerToAdd));
	player.sendPacket(new UserInfo(player));
	player.sendPacket(new ExBrExtraUserInfo(player));
	player.setActiveEnchantAttrItem(null);
}

public int getLimit(L2ItemInstance item, int sotneId)
{
	Elementals.ElementalItems elementItem = Elementals.getItemElemental(sotneId);
	if (elementItem == null)
		return 0;

	if (item.isWeapon())
		return Elementals.WEAPON_VALUES[elementItem._type._maxLevel];
	return Elementals.ARMOR_VALUES[elementItem._type._maxLevel];
}

public int getPowerToAdd(int stoneId, int oldValue, L2ItemInstance item)
{
	if (Elementals.getItemElement(stoneId) != Elementals.NONE)
	{
		if (item.isWeapon())
		{
			if (oldValue == 0)
				return Elementals.FIRST_WEAPON_BONUS;
			return Elementals.NEXT_WEAPON_BONUS;
		}
		else if (item.isArmor())
			return Elementals.ARMOR_BONUS;
	}
	return 0;
}

@Override
public String getType()
{
	return _C__D0_35_REQUESTEXENCHANTITEMATTRIBUTE;
}
}

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

    • TELEGRAM SEO TRAINING (Bot Ranking in Search) I teach a complete system for ranking Telegram bots at the top of search results by keywords and countries. The method works for services, shops, crypto projects, and any type of Telegram bot. You can also direct the traffic to your groups, channels, websites, or sales funnels. ⸻  Countries I work with USA, Israel, Russia, India, Turkey, China, Ukraine, Uzbekistan. If you need another country — message me, we’ll find a solution. ⸻ ️ Results First search results appear in 2–3 days. ⸻  What’s included in the training • how the Telegram search algorithm works and key ranking factors • keyword research for your country and niche • bot optimization: description, settings, greeting text • fixing and maintaining positions • specific promotion nuances for different countries ⸻  What you will receive • a complete system for ranking bots in search • understanding how to work with keywords, traffic, and positions • a skill you can use to promote your own projects or earn from clients ⸻  Who this training is for • beginners with zero experience — I explain everything from scratch • those who don’t have a bot — I provide a ready one for practice • anyone who wants to learn promotion and earn from this service ⸻  Why learn from me • doing Telegram SEO since 2021 • over 1000 successful orders • my own panel SMMTG.PRO and private databases • experience working with markets of Russia, Uzbekistan, Ukraine, Israel, USA, Turkey, China, India, Vietnam, Europe, and more ⸻  For pricing — message me t.me/smmtg_link
    • Hey everyone, I was wondering if anyone knows where the client loads all the .dat files. Is there some kind of manifest or list you can specify which dat files the client loads?
    • 🔥 Welcome to Lineage 2 Haruna x3 – True Classic Interlude Experience 🔥 At Haruna x3, we’re bringing back the true essence of Interlude – slow, meaningful progression where every level matters, every item has value, and PvP is real. We’re not about fast servers, pay-to-win advantages, or fake populations. Our goal is simple: create a fair, stable, and long-term server where players can enjoy real competition, strategic clan warfare, and the thrill of open-world PvP. 💎 What Makes Haruna x3 Special? x3 Rates – Perfect for steady, rewarding progression Classic Interlude Mechanics – Relive the nostalgia of Interlude Stable & Lag-Free Gameplay – Optimized for thousands of players online Fair & Balanced – No pay-to-win, every victory is earned PvP & Clan Warfare Focused – Every battle counts 🌟 Quality of Life Features to Enhance Your Experience We keep the classic feel while adding features that make the game more convenient and enjoyable, including: Shift + Click to view monster droplists Free item mail and buy/sell via Adena Daily login rewards & Stream Rewards ALT+K Skill Panel & Alt+Click buffs removal Offline shop system Captcha for security Donate Coins currency (cannot be traded, dropped, or destroyed) Classic P110 client – no custom interface 🏰 Our Philosophy We believe Lineage 2 is about the journey, not just the destination. Haruna x3 is designed for months and years of growth, not weeks. We provide a community-driven environment where honest gameplay, fair competition, and strategic teamwork are at the forefront. 🌍 Join Our Community Whether you’re a veteran of Interlude or a returning player seeking a true classic experience, Haruna x3 offers a place to fight, trade, and grow alongside dedicated players. Step into the world of Haruna x3 – where every decision matters, every fight counts, and every victory is yours to earn. Discord: https://discord.gg/7DDC9Dsxnh Website : www.l2haruna.com
    • No, the real purpose is cheating and custom  development for games.  I'm building a custom AI moderator specially for checking illegal activity and flag current topica.
  • 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