Apply Augment doesn't apply skill, only stats

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
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

Apply Augment doesn't apply skill, only stats

Post by HappyLDE »

Hello, i want to add specified augment to weapon by giving skill_id (from augmentation_skillmap.xml) but it doesn't apply the skill, only the stats:

Code: Select all

final String aug_type = rset.getString("type");                        final int skill_level = rset.getInt("skill_level");                                                int stat12 = 0;                        int stat34 = rset.getInt("skill_id"); // comes from augmentation_skillmap.xml                                                // Second: decide which grade the augmentation result is going to have:                        // 0:yellow, 1:blue, 2:purple, 3:red                        // The chances used here are most likely custom,                        // what's known is: you can't have yellow with skill(or baseStatModifier)                        // noGrade stone can not have glow, mid only with skill, high has a chance(custom), top allways glow                        int resultColor = 1;                         switch(aug_type)                        {                            default: resultColor = 1; break;                            case "red": resultColor = 3; break;                            case "purple": resultColor = 2; break;                        }                            // life stone level is used for stat Id and skill level, but here the max level is 9                        int lifeStoneLevel = 9;                        int lifeStoneGrade = AbstractRefinePacket.GRADE_TOP;                        int temp = Rnd.get(2, 3);                                                // is neither a skill nor basestat used for stat34? then generate a normal stat                        int offset = 0; //(lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + (((lifeStoneGrade + resultColor) / 2) * (10 * STAT_SUBBLOCKSIZE)) + 1;//                      offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (lifeStoneGrade * (10 * STAT_SUBBLOCKSIZE)) + 1;//                      offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + 1;                        int colorOffset = (resultColor * (10 * STAT_SUBBLOCKSIZE)) + (temp * STAT_BLOCKSIZE) + 1;                        offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + colorOffset;                            player.sendMessage("offset " + offset);                                                stat12 = Rnd.get(offset, (offset + STAT_SUBBLOCKSIZE) - 1);                                                final L2Augmentation aug = new L2Augmentation(((stat34 << 16) + stat12));                        item.removeAugmentation();                        item.setAugmentation(aug);                         // Update player client                        stat12 = 0x0000FFFF & aug.getAugmentationId();                        stat34 = aug.getAugmentationId() >> 16;                        player.sendPacket(new ExVariationResult(stat12, stat34, 1));                         L2ItemInstance[] unequiped = player.getInventory().equipItemAndRecord(item);                                                StatusUpdate su = new StatusUpdate(player);                        su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad());                        player.sendPacket(su);                         InventoryUpdate iu = new InventoryUpdate();                        for (L2ItemInstance itm : unequiped)                        {                            iu.addModifiedItem(itm);                        }                        player.sendPacket(iu);                        player.broadcastUserInfo();
What is wrong? 8)
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
User avatar
HappyLDE
Posts: 123
Joined: Tue Sep 10, 2013 6:22 pm
Location: Belgium
Contact:

Re: Apply Augment doesn't apply skill, only stats

Post by HappyLDE »

Any help? :mrgreen:

Here is a screenshot of the result:
Image
Thank you for making L2JServer happen! :D
"If you believe you will fail or succeed, in both ways you are right." - Henry Ford
Post Reply