Jump to content
  • 0

Elemental Resistance Cap


Question

Posted

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;
}
}

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Posts

    • [GR]se trollari o giannakis agorina moy ? sto paizei admin k psaronis ?[GR]
    • Introducing the Payment System Script for Your Lineage 2 Gaming Website This script provides automated integration of popular payment systems (PayPal, Stripe, Morune, Freekassa, Betatransfer, Primepayments) with the Lineage 2 server to process in-game purchases. Its primary features include secure payment processing, user data verification, fraud protection, and automatic allocation of in-game items. Key Features: Support for Popular Payment Systems: The script supports integration with PayPal, Stripe, Morune, Freekassa, Betatransfer, and Primepayments, offering flexibility in choosing a provider. Server Configuration: Multi-Server Support: Users can select the target server from the list of available servers (e.g., Server 1, Server 2) to ensure the transaction is routed to the correct destination. Transaction Personalization: A character name input field allows identifying the recipient of the items in the game, reducing the risk of allocation errors. Flexible Amount Input: The amount input field lets users specify the desired quantity of items within set limits (e.g., from 1 to 10,000). Item Allocation to items_delayed: Upon successful payment processing, items are credited to the items_delayed table, from which players can retrieve them via the game interface. (Customization available for servers using character_items, items, or item_delivery tables.) Universal Webhook URL: To configure webhooks in the payment system, specify the path to the webhook.php file on your site. This path is universal for all payment systems. Example: https://yoursite.com/webhook.php The script will automatically process data received from the payment system. Security and Fraud Protection: Built-in protection against SQL injections through secure data handling. Validation of payment data via the selected payment system's API. Logging of operations to monitor suspicious activities. Customizable Design: The script can be easily tailored to fit your website's design. Price: $120 Note: The list of supported payment systems will be expanded based on demand and feedback. Feedback:  Telegram Discord This script is your all-in-one solution for integrating payment systems seamlessly into your Lineage 2 gaming website.  
    • Introducing the Payment System Script for Your Lineage 2 Gaming Website This script provides automated integration of popular payment systems (PayPal, Stripe, Morune, Freekassa, Betatransfer, Primepayments) with the Lineage 2 server to process in-game purchases. Its primary features include secure payment processing, user data verification, fraud protection, and automatic allocation of in-game items. Key Features: Support for Popular Payment Systems: The script supports integration with PayPal, Stripe, Morune, Freekassa, Betatransfer, and Primepayments, offering flexibility in choosing a provider. Server Configuration: Multi-Server Support: Users can select the target server from the list of available servers (e.g., Server 1, Server 2) to ensure the transaction is routed to the correct destination. Transaction Personalization: A character name input field allows identifying the recipient of the items in the game, reducing the risk of allocation errors. Flexible Amount Input: The amount input field lets users specify the desired quantity of items within set limits (e.g., from 1 to 10,000). Item Allocation to items_delayed: Upon successful payment processing, items are credited to the items_delayed table, from which players can retrieve them via the game interface. (Customization available for servers using character_items, items, or item_delivery tables.) Universal Webhook URL: To configure webhooks in the payment system, specify the path to the webhook.php file on your site. This path is universal for all payment systems. Example: https://yoursite.com/webhook.php The script will automatically process data received from the payment system. Security and Fraud Protection: Built-in protection against SQL injections through secure data handling. Validation of payment data via the selected payment system's API. Logging of operations to monitor suspicious activities. Customizable Design: The script can be easily tailored to fit your website's design. Price: $120 Note: The list of supported payment systems will be expanded based on demand and feedback. Feedback:  Telegram Discord This script is your all-in-one solution for integrating payment systems seamlessly into your Lineage 2 gaming website.  
  • Topics

×
×
  • Create New...