Jump to content

Recommended Posts

Posted (edited)

Hello guysi m wonder how these numbers are working 

and how i could increase % of dmg per  attribute stat

 

i did some changes but nothing happend

 

Quote

    /**
     * Calculates the attribute bonus with the following formula: <BR>
     * diff > 0, so AttBonus = 1,025 + sqrt[(diff^3) / 2] * 0,0001, cannot be above 1,25! <BR>
     * diff < 0, so AttBonus = 0,975 - sqrt[(diff^3) / 2] * 0,0001, cannot be below 0,75! <BR>
     * diff == 0, so AttBonus = 1<br>
     * It has been tested that physical skills do get affected by attack attribute even<br>
     * if they don't have any attribute. In that case only the biggest attack attribute is taken.
     * @param attacker
     * @param target
     * @param skill Can be {@code null} if there is no skill used for the attack.
     * @return The attribute bonus
     */
    public static double calcAttributeBonus(L2Character attacker, L2Character target, Skill skill)
    {
        int attack_attribute;
        int defence_attribute;
        
        if ((skill != null) && (skill.getAttributeType() != AttributeType.NONE))
        {
            attack_attribute = attacker.getAttackElementValue(skill.getAttributeType()) + skill.getAttributeValue();
            defence_attribute = target.getDefenseElementValue(skill.getAttributeType());
        }
        else
        {
            attack_attribute = attacker.getAttackElementValue(attacker.getAttackElement());
            defence_attribute = target.getDefenseElementValue(attacker.getAttackElement());
        }
        
        final int diff = attack_attribute - defence_attribute;
        if (diff > 0)
        {
            return Math.min(1.025 + (Math.sqrt(Math.pow(diff, 3) / 2) * 0.0001), 1.25);
        }
        else if (diff < 0)
        {
            return Math.max(0.975 - (Math.sqrt(Math.pow(-diff, 3) / 2) * 0.0001), 0.75);
        }
        
        return 1;
    }
    

 

Edited by Pamela32
Posted

This probably calculate the bonus damage for each attack. Example if skill is fire and the player has Fire Attribute this probably does some check and return a number. 1 Is the default which mean no bonus.

The

if (diff > 0...

return something between 1.025 (+a square) and 1.25 which mean it multiply the attack dmg by that number

Let's say the dmg is 700 and it multiply by 1.025 which has a result of 717.25. Or if you multiply 700 with 1.25 has a result of 875

Posted
2 hours ago, Kara` said:

This probably calculate the bonus damage for each attack. Example if skill is fire and the player has Fire Attribute this probably does some check and return a number. 1 Is the default which mean no bonus.

The


if (diff > 0...

return something between 1.025 (+a square) and 1.25 which mean it multiply the attack dmg by that number

Let's say the dmg is 700 and it multiply by 1.025 which has a result of 717.25. Or if you multiply 700 with 1.25 has a result of 875

 

 

so  this is correct ?  

 

Quote

   return Math.min(1.075 + (Math.sqrt(Math.pow(diff, 3) / 2) * 0.0001), 1.75);

 

 

Quote

 {
            return Math.max(0.925 - (Math.sqrt(Math.pow(-diff, 3) / 2) * 0.0001), 0.25);
        }

 

Posted
2 minutes ago, Pamela32 said:

 

 

so  this is correct ?  

 

 

 

 

I don't know from which aspect you ask if is correct. As values? I dont know, as coding yes it's fine. You might no see difference because the damage addon is way too low. In 350 it add barely 5-50 bonus damage +/-

 

Do the maths. Ex. 350 Dmg * 1.075 and see the bonus.

Posted
1 minute ago, Kara` said:

I don't know from which aspect you ask if is correct. As values? I dont know, as coding yes it's fine. You might no see difference because the damage addon is way too low. In 350 it add barely 5-50 bonus damage +/-

 

Do the maths. Ex. 350 Dmg * 1.075 and see the bonus.

 

 

ok got it , thanks boy

Posted
On 12/22/2018 at 9:13 PM, Kara` said:

I don't know from which aspect you ask if is correct. As values? I dont know, as coding yes it's fine. You might no see difference because the damage addon is way too low. In 350 it add barely 5-50 bonus damage +/-

 

Do the maths. Ex. 350 Dmg * 1.075 and see the bonus.

 

 

solved , ty again can be locked

Guest
This topic is now closed to further replies.


  • Posts

    • I created a system of FAKES to improve my GeoEngine, but I'm having problems with blocks. I've tried everything to fix it, but a block going from the inside out bugs the player's movement and freezes them. However, the reverse doesn't cause this bug. If I'm outside and click inside, the path is traced normally, but if it's reversed, it bugs at the fence. I've created several debugs and read all kinds of GeoEngine versions, but I haven't had any success. Can someone give me some insight into graphical data?   When fakes spawn, they are given possible routes, but they don't follow them. If there's a target, instead of following the correctly drawn path, it simply uses a straight line.  
    • The legendary L2Elixir you remember from 2008 is officially back — remastered, refreshed, and reborn! Our x3 Interlude server launched on 28 November, and the community is growing every single day.   🔥 Fresh start 🔥 Active players joining daily 🔥 Long-term project — Licensed for over 5 years from PlayINERA. 🔥 True 2008 nostalgia with modern stability & polish   If you were part of the original Elixir family, this is your chance to relive the magic. If you’re new — welcome to a classic Lineage II experience built with passion, not profit.   Join the battles. Join the nostalgia. Join L2Elixir Reborn. Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • still available?  java version? client  salvation?  accept smarguart¡?
    • 🎉 L2NeverPain StuckSub - GRAND OPENING 12 December 2025🎉 After beta, testing, mistakes, laughs and a lot of PvP, the moment has finally come. L2NeverPain StuckSub is officially opening its gates on 12 December 2025.   ⚔️What to expect: ✦Main Class +2 Stuck Sub system ✦Balanced PvP & custom party farm areas ✦Custom events, bosses and strong rewards ✦Competitive clan scene with castle rewards   📌Until the opening: ✦Create your clans and register them in the Clan-Register channel ✦Invite your friends / old parties / CPs ✦Stay tuned for more information (rates, events, siege times, etc.)   Get your setups ready, prepare your macros and your Discord/voice. On 12 December 2025 20:00 GMT+2, we write the first chapter of NeverPain together. 🔥 https://l2neverpain.com/ https://discord.gg/kNP3UXgkmN
  • 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