Attribute Stones DONT WORK for S84

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
rockkth
Posts: 196
Joined: Sat Jul 04, 2009 8:54 am

Attribute Stones DONT WORK for S84

Post by rockkth »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 6329
L2JDP Revision Number:

hi, i have a big problem, i cannot apply attributes to s84 weapons and i don`t know where i could set for wich grade the stones should work .

THey work for s and s80 grade tho.

i looked in the scripts/skills, in the sql for weapons (wherei changed the grade of vesper weapons to s80, so attributes work... but it s not ok, since s80 ppl on sub could use them ..)..

i rly need ur help, plz tell me what file modifies the grade of armors/weapons that can be enchanted with attributes stones...
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Attribute Stones DONT WORK for S84

Post by janiii »

what is your l2j gameserver revision?

but anyway, look here: http://www.l2jserver.com/trac/changeset ... ibute.java
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
rockkth
Posts: 196
Joined: Sat Jul 04, 2009 8:54 am

Re: Attribute Stones DONT WORK for S84

Post by rockkth »

ty very much, i bet this is the file, i decoded it, now i`m searching for the lines to modify it, so they include s84 grade weapons too...

can somebody tell me what lines to modify in the code below? it seams i cant figure it out...i`m reading it for 15 mins...

if(powerToAdd == 0)
{
player.sendPacket(new SystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_REQUIREMENT_NOT_SUFFICIENT));
this is the message i receive when i try to add attribute to s84 grades...i can t find the string that should add s84...i m new at java...somebody help plz. ty

Code: Select all

// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov  Date: 7/5/2009 01:44:36// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!// Decompiler options: packimports(3) // Source File Name:   RequestExEnchantItemAttribute.java package net.sf.l2j.gameserver.network.clientpackets; import net.sf.l2j.Config;import net.sf.l2j.gameserver.model.Elementals;import net.sf.l2j.gameserver.model.L2ItemInstance;import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;import net.sf.l2j.gameserver.model.itemcontainer.PcInventory;import net.sf.l2j.gameserver.network.L2GameClient;import net.sf.l2j.gameserver.network.SystemMessageId;import net.sf.l2j.gameserver.network.serverpackets.*;import net.sf.l2j.gameserver.templates.item.L2Item;import net.sf.l2j.gameserver.templates.item.L2WeaponType;import net.sf.l2j.gameserver.util.Util;import net.sf.l2j.util.Rnd; // Referenced classes of package net.sf.l2j.gameserver.network.clientpackets://            L2GameClientPacket public class RequestExEnchantItemAttribute extends L2GameClientPacket{     public RequestExEnchantItemAttribute()    {    }     protected void readImpl()    {        _objectId = readD();    }     protected void runImpl()    {        L2PcInstance player = ((L2GameClient)getClient()).getActiveChar();        if(player == null)            return;        if(_objectId == 65535)        {            player.setActiveEnchantAttrItem(null);            player.sendPacket(new SystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_CANCELED));            return;        }        if(player.isOnline() == 0)        {            player.setActiveEnchantAttrItem(null);            return;        }        if(player.getPrivateStoreType() != 0)        {            player.sendPacket(new SystemMessage(SystemMessageId.CANNOT_ADD_ELEMENTAL_POWER_WHILE_OPERATING_PRIVATE_STORE_OR_WORKSHOP));            return;        }        if(player.getActiveRequester() != null)        {            player.cancelActiveTrade();            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.getLocation() != net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.INVENTORY && item.getLocation() != net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.PAPERDOLL)            return;        if(item.isWear())        {            Util.handleIllegalPlayerAction(player, (new StringBuilder()).append("Player ").append(player.getName()).append(" tried to enchant a weared Item").toString(), 2);            return;        }        if(item.getItem().getItemType() == L2WeaponType.ROD || item.isShadowItem() || item.isHeroItem() || item.isTimeLimitedItem() || item.getItemId() >= 7816 && item.getItemId() <= 7831 || item.getItem().getItemType() == L2WeaponType.NONE || item.getItem().getCrystalType() != 5 && item.getItem().getCrystalType() != 6)        {            player.sendPacket(new SystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_REQUIREMENT_NOT_SUFFICIENT));            player.setActiveEnchantAttrItem(null);            return;        }    /* anonymous class not found */    class _anm1 {}         switch(_cls1..SwitchMap.net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation[item.getLocation().ordinal()])        {        case 1: // '\001'        case 2: // '\002'            if(item.getOwnerId() != player.getObjectId())            {                player.setActiveEnchantAttrItem(null);                return;            }            break;         default:            player.setActiveEnchantAttrItem(null);            Util.handleIllegalPlayerAction(player, (new StringBuilder()).append("Player ").append(player.getName()).append(" tried to use enchant Exploit!").toString(), 2);            return;        }        int stoneId = stone.getItemId();        Elementals oldElement = item.getElementals();        int elementValue = oldElement != null ? oldElement.getValue() : 0;        int limit = getLimit(stoneId, item);        int powerToAdd = getPowerToAdd(stoneId, elementValue, item);        byte elementToAdd = getElementFromItemId(stoneId);        if(item.isArmor())            elementToAdd = Elementals.getOppositeElement(elementToAdd);        int newPower = elementValue + powerToAdd;        if(newPower > limit)        {            newPower = limit;            powerToAdd = limit - elementValue;        }        if(oldElement != null && oldElement.getElement() != elementToAdd && oldElement.getElement() != -2)        {            player.sendPacket(new SystemMessage(SystemMessageId.ANOTHER_ELEMENTAL_POWER_ALREADY_ADDED));            player.setActiveEnchantAttrItem(null);            return;        }        if(powerToAdd == 0)        {            player.sendPacket(new SystemMessage(SystemMessageId.ELEMENTAL_ENHANCE_REQUIREMENT_NOT_SUFFICIENT));            player.setActiveEnchantAttrItem(null);            return;        }        if(!player.destroyItem("AttrEnchant", stone, 1L, player, true))        {            player.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));            Util.handleIllegalPlayerAction(player, (new StringBuilder()).append("Player ").append(player.getName()).append(" tried to attribute enchant with a stone he doesn't have").toString(), Config.DEFAULT_PUNISH);            player.setActiveEnchantAttrItem(null);            return;        }        if(Rnd.get(100) < 50)        {            SystemMessage sm;            if(item.getEnchantLevel() == 0)            {                sm = (new SystemMessage(SystemMessageId.ELEMENTAL_POWER_S2_SUCCESSFULLY_ADDED_TO_S1)).addItemName(item).addNumber(powerToAdd);            } else            {                sm = (new SystemMessage(SystemMessageId.ELEMENTAL_POWER_S3_SUCCESSFULLY_ADDED_TO_S1_S2)).addNumber(item.getEnchantLevel());                sm.addItemName(item).addNumber(powerToAdd);            }            player.sendPacket(sm);            item.setElementAttr(elementToAdd, newPower);            item.updateElementAttrBonus(player);            InventoryUpdate iu = new InventoryUpdate();            iu.addModifiedItem(item);            player.sendPacket(iu);        } else        {            player.sendPacket(new SystemMessage(SystemMessageId.FAILED_ADDING_ELEMENTAL_POWER));        }        player.sendPacket(new ExAttributeEnchantResult(powerToAdd));        player.sendPacket(new UserInfo(player));        player.sendPacket(new ExBrExtraUserInfo(player));        player.setActiveEnchantAttrItem(null);    }     public byte getElementFromItemId(int itemId)    {        byte element = 0;        int arr$[] = Elementals.STONES;        int len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                return element;            element++;        }         element = 0;        arr$ = Elementals.CRYSTALS;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                return element;            element++;        }         element = 0;        arr$ = Elementals.JEWELS;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                return element;            element++;        }         element = 0;        arr$ = Elementals.ENERGIES;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                return element;            element++;        }         return -1;    }     public int getLimit(int itemId, L2ItemInstance item)    {        int arr$[] = Elementals.STONES;        int len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                if(item.isWeapon())                    return Elementals.WEAPON_VALUES[3];                else                    return Elementals.ARMOR_VALUES[3];        }         arr$ = Elementals.CRYSTALS;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                if(item.isWeapon())                    return Elementals.WEAPON_VALUES[6];                else                    return Elementals.ARMOR_VALUES[6];        }         arr$ = Elementals.JEWELS;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                if(item.isWeapon())                    return Elementals.WEAPON_VALUES[9];                else                    return Elementals.ARMOR_VALUES[9];        }         arr$ = Elementals.ENERGIES;        len$ = arr$.length;        for(int i$ = 0; i$ < len$; i$++)        {            int id = arr$[i$];            if(id == itemId)                if(item.isWeapon())                    return Elementals.WEAPON_VALUES[10];                else                    return Elementals.ARMOR_VALUES[10];        }         return 0;    }     public int getPowerToAdd(int stoneId, int oldValue, L2ItemInstance item)    {        boolean stone = false;        boolean crystal = false;        int arr$[] = Elementals.STONES;        int len$ = arr$.length;        int i$ = 0;        do        {            if(i$ >= len$)                break;            int id = arr$[i$];            if(id == stoneId)            {                stone = true;                break;            }            i$++;        } while(true);        if(!stone)        {            arr$ = Elementals.CRYSTALS;            len$ = arr$.length;            i$ = 0;            do            {                if(i$ >= len$)                    break;                int id = arr$[i$];                if(id == stoneId)                {                    crystal = true;                    break;                }                i$++;            } while(true);            if(!crystal)            {                arr$ = Elementals.JEWELS;                len$ = arr$.length;                i$ = 0;                do                {                    if(i$ >= len$)                        break;                    int id = arr$[i$];                    if(id == stoneId)                        break;                    i$++;                } while(true);            }        }        if(item.isWeapon())        {            if(stone)                return oldValue != 0 ? 5 : 20;        } else        if(item.isArmor() && stone)            return 6;        return 0;    }     public String getType()    {        return "[C] D0 38 RequestExEnchantItemAttribute";    }     private static final String D0_38_REQUEST_EX_ENCHANT_ITEM_ATTRIBUTE = "[C] D0 38 RequestExEnchantItemAttribute";    private int _objectId;} 
PS: i can edit class files but i cannot save them as class...would be great if smbd could tip me about this toom, ty.
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Attribute Stones DONT WORK for S84

Post by janiii »

for editing core files, you need to download the source files from svn (you find the links on the main page). then you need to edit the java file with some editor. and then you need to build the jar file again with the ant builder. all this can be done with eclipse (a tool for development) and a svn client (subclipse as plugin for eclipse, or standalone tortoisesvn).

maybe read also here:
http://www.l2jserver.com/trac/wiki/Eclipse
http://www.l2jserver.com/trac/wiki/ApplyingPatches
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Post Reply