Page 1 of 1
Element_enabled value
Posted: Mon Jun 18, 2012 1:57 pm
by Asmodaius
L2J Revision 5376:
L2JDP Revision 8841:
Hi to everyone.
I would like to ask :
Option value element_enabled, which is used in xml files, in order to enable, attribute addition on specific items, can it be overrided through a specific java class file in repository?
If yes, which is this file?
Thanks for your time.
Re: Element_enabled value
Posted: Thu Jul 05, 2012 3:35 pm
by nonom
Depending what do you mean with "attribute addition".
Take a look into the L2Item class
com.l2jserver.gameserver.model.items.L2Item.java
com.l2jserver.gameserver.model.items.instance.L2ItemInstance.java
Code: Select all
_elementable = set.getBool("element_enabled", false);
The elements are added when the following packet is requested:
com.l2jserver.gameserver.network.clientpackets.RequestExEnchantItemAttribute.java the element is added
Code: Select all
L2ItemInstance item = player.getInventory().getItemByObjectId(_objectId);L2ItemInstance stone = player.getActiveEnchantAttrItem();if (item == null || stone == null){ player.setActiveEnchantAttrItem(null); return;}if (!item.isElementable()){ player.sendPacket(SystemMessageId.ELEMENTAL_ENHANCE_REQUIREMENT_NOT_SUFFICIENT); player.setActiveEnchantAttrItem(null); return;} [...] item.setElementAttr(elementToAdd, newPower);if (item.isEquipped()) item.updateElementAttrBonus(player); // send packetsInventoryUpdate iu = new InventoryUpdate();iu.addModifiedItem(item);player.sendPacket(iu);
Maybe could define a new attribute to decrease/increase whatever you want
