I needed code to put a Cap on Elemental resists. I want to cap them at 40.
What ive got so far done in CharStat.java is only visual in game, it does not really put a cap, only looks like it. I need help making code to actually cap it, I guess where formulas are done.
Heres what I got so far done in CharStat.java that is only visual:
/**ReturntheElementalAttributeCapForFire*/
publicdouble getElementAttributeFire()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.FIRE_VULN, _activeChar.getTemplate().baseFireVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
/**ReturntheElementalAttributeCapForWater*/
publicdouble getElementAttributeWater()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.WATER_VULN, _activeChar.getTemplate().baseWaterVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
/**ReturntheElementalAttributeCapForEarth*/
publicdouble getElementAttributeEarth()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.EARTH_VULN, _activeChar.getTemplate().baseEarthVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
/**ReturntheElementalAttributeCapForWind*/
publicdouble getElementAttributeWind()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.WIND_VULN, _activeChar.getTemplate().baseWindVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
/**ReturntheElementalAttributeCapForHoly*/
publicdouble getElementAttributeHoly()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.HOLY_VULN, _activeChar.getTemplate().baseHolyVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
/**ReturntheElementalAttributeCapForUnHoly*/
publicdouble getElementAttributeUnholy()
{
if (_activeChar == null)
return 1;
int val = (int) (100 - 100 * calcStat(Stats.DARK_VULN, _activeChar.getTemplate().baseDarkVuln, null, null));
if (val > Config.MAX_STAT && !_activeChar.isGM())
val = Config.MAX_STAT;
return val;
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Hello server will back again ,Let's gather everyone who remembers an interesting and unforgettable wonderful server.
https://l2-forever.com/
https://discord.gg/Zr5eGqDQ6V
Question
SilverDeath
I needed code to put a Cap on Elemental resists. I want to cap them at 40.
What ive got so far done in CharStat.java is only visual in game, it does not really put a cap, only looks like it. I need help making code to actually cap it, I guess where formulas are done.
Heres what I got so far done in CharStat.java that is only visual:
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.