Jump to content
  • 0

Help In Adapting Status Limiter For Acis 354


Question

Posted
Hello, I'm looking for an update on triskell but I found a very important mod a status limiter wanted help to improve the code following what it has in the code works 100% but I lose many lines that have on the acis and I do not know What these lines represent
 
Like this here
 
Return (int) calcStat (Stats.POWER_ATTACK_SPEED, base, null, null);
 
I do not know how to code
 
Int val = super.getPAtkSpd ();
 
If ((val> Config.MAX_PATK_SPEED) && (! GetActiveChar (). IsGM ()))
{
Return Config.MAX_PATK_SPEED;
}
Return val;
 
 
 
Codigo :
 
### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java (revision 104)
+++ java/net/sf/l2j/gameserver/model/actor/stat/CharStat.java (working copy)
@@ -153,10 +153,20 @@
   * @param skill
   * @return the Critical Hit rate (base+modifier) of the L2Character.
   */
- public int getCriticalHit(L2Character target, L2Skill skill)
- {
- return Math.min((int) calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill), 500);
- }
+         public int getCriticalHit(L2Character target, L2Skill skill)
+         {
+           if (_activeChar == null)
+           {
+             return 1;
+           }
+
+           int criticalHit = Math.min((int)calcStat(Stats.CRITICAL_RATE, _activeChar.getTemplate().getBaseCritRate(), target, skill), 500);
+
+           if (criticalHit > Config.MAX_PCRIT_RATE) {
+             criticalHit = Config.MAX_PCRIT_RATE;
+           }
+           return criticalHit;
+         }
  
  /**
   * @param target
@@ -163,19 +173,39 @@
   * @param skill
   * @return the Magic Critical Hit rate (base+modifier) of the L2Character.
   */
- public final int getMCriticalHit(L2Character target, L2Skill skill)
- {
- return (int) calcStat(Stats.MCRITICAL_RATE, 8, target, skill);
- }
+       public final int getMCriticalHit(L2Character target, L2Skill skill)
+       {
+        if (_activeChar == null)
+           {
+             return 1;
+               }
+        
+           double mrate = calcStat(Stats.MCRITICAL_RATE, 8.0D, target, skill);
+
+               if (mrate > Config.MAX_MCRIT_RATE) {
+                 mrate = Config.MAX_MCRIT_RATE;
+           }
+                 return (int)mrate;
+        }
  
  /**
   * @param target
   * @return the Attack Evasion rate (base+modifier) of the L2Character.
   */
- public int getEvasionRate(L2Character target)
- {
- return (int) calcStat(Stats.EVASION_RATE, 0, target, null);
- }
+       public int getEvasionRate(L2Character target)
+       {
+         if (_activeChar == null)
+         {
+           return 1;
+         }
+         int val = (int)Math.round(calcStat(Stats.EVASION_RATE, 0.0D, target, null));
+
+         if ((val > Config.MAX_EVASION) && (!_activeChar.isGM()))
+         {
+           val = Config.MAX_EVASION;
+         }
+         return val;
+       }
  
  /**
   * @return the Accuracy (base+modifier) of the L2Character in function of the Weapon Expertise Penalty.
@@ -182,7 +212,17 @@
   */
  public int getAccuracy()
  {
- return (int) calcStat(Stats.ACCURACY_COMBAT, 0, null, null);
+        if (_activeChar == null)
+        {
+          return 1;
+        }
+        int val = (int)Math.round(calcStat(Stats.ACCURACY_COMBAT, 0.0D, null, null));
+
+        if ((val > Config.MAX_ACCURACY) && (!_activeChar.isGM()))
+        {
+          val = Config.MAX_ACCURACY;
+        }
+        return val;
  }
  
  public int getMaxHp()
Index: config/aCis.properties
===================================================================
--- config/aCis.properties (revision 104)
+++ config/aCis.properties (working copy)
@@ -82,3 +82,40 @@
 # Players can see in the upper chat who dies in pvp and pk
 # Default : False
 AnnounceKillPLayers = true
+
+#=============================================================
+#                            Limits
+#=============================================================
+
+# Run speed modifier. Example: Setting this to 5 will 
+# give players +5 to their running speed.
+# Default: 0
+RunSpeedBoost = 0
+
+# Maximum character running speed.
+# Default: 250
+MaxRunSpeed = 250
+
+# Maximum character Physical Critical Rate. (10 = 1%)
+# Default: 500
+MaxPCritRate = 500
+
+# Maximum character Magic Critical Rate. (10 = 1%)
+# Default: 200
+MaxMCritRate = 200
+
+# Maximum character Attack Speed.
+# Default: 1500
+MaxPAtkSpeed = 1500
+
+# Maximum character Cast Speed.
+# Default: 1999
+MaxMAtkSpeed = 1999
+
+# Maximum character Evasion.
+# Default: 250
+MaxEvasion = 250
+
+# Maxmum character Accuracy
+# Default: 300
+MaxAccuracy = 300
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 104)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -401,6 +401,15 @@
     public static boolean ENABLE_MODIFY_SKILL_DURATION;
     public static Map<Integer, Integer> SKILL_DURATION_LIST;
     public static boolean ANNOUNCE_KILL;
+    /** Limits */
+    public static int RUN_SPD_BOOST;
+    public static int MAX_RUN_SPEED;
+    public static int MAX_PCRIT_RATE;
+    public static int MAX_MCRIT_RATE;
+    public static int MAX_PATK_SPEED;
+    public static int MAX_MATK_SPEED;
+    public static int MAX_EVASION;
+    public static int MAX_ACCURACY;
 
  // --------------------------------------------------
  // Players
@@ -947,8 +956,15 @@
  }
  }
  ANNOUNCE_KILL = aCis.getProperty("AnnounceKillPLayers", false);
+            RUN_SPD_BOOST = aCis.getProperty("RunSpeedBoost", 0);
+            MAX_RUN_SPEED = aCis.getProperty("MaxRunSpeed", 250);
+            MAX_PCRIT_RATE = aCis.getProperty("MaxPCritRate", 500);
+            MAX_MCRIT_RATE = aCis.getProperty("MaxMCritRate", 200);
+            MAX_PATK_SPEED = aCis.getProperty("MaxPAtkSpeed", 1500);
+            MAX_MATK_SPEED = aCis.getProperty("MaxMAtkSpeed", 1999);
+            MAX_EVASION = aCis.getProperty("MaxEvasion", 250);
+            MAX_ACCURACY = aCis.getProperty("MaxAccuracy", 300);
  
- 
  // NPCs / Monsters
  ExProperties npcs = load(NPCS_FILE);
  CHAMPION_FREQUENCY = npcs.getProperty("ChampionFrequency", 0);
Index: java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (revision 104)
+++ java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (working copy)
@@ -330,46 +330,61 @@
  else
  val = super.getRunSpeed();
  
- final int penalty = getActiveChar().getExpertiseArmorPenalty();
- if (penalty > 0)
- val *= Math.pow(0.84, penalty);
- 
- return val;
+        val += Config.RUN_SPD_BOOST;
+
+        if ((val > Config.MAX_RUN_SPEED) && (!getActiveChar().isGM()))
+        {
+          return Config.MAX_RUN_SPEED;
+        }
+        return val;
  }
  
  @Override
- public int getMAtkSpd()
- {
- int val = super.getMAtkSpd();
- 
- final int penalty = getActiveChar().getExpertiseArmorPenalty();
- if (penalty > 0)
- val *= Math.pow(0.84, penalty);
- 
- return val;
- }
+    public int getMAtkSpd()
+    {
+      int val = super.getMAtkSpd();
+
+      if ((val > Config.MAX_MATK_SPEED) && (!getActiveChar().isGM()))
+      {
+        return Config.MAX_MATK_SPEED;
+      }
+      return val;
+    }
  
+    @Override
+ public int getPAtkSpd()
+    {
+      int val = super.getPAtkSpd();
+
+      if ((val > Config.MAX_PATK_SPEED) && (!getActiveChar().isGM()))
+      {
+        return Config.MAX_PATK_SPEED;
+      }
+      return val;
+    }
+    
  @Override
- public int getEvasionRate(L2Character target)
- {
- int val = super.getEvasionRate(target);
- 
- final int penalty = getActiveChar().getExpertiseArmorPenalty();
- if (penalty > 0)
- val -= (2 * penalty);
- 
- return val;
- }
+    public int getEvasionRate(L2Character target)
+    {
+      int val = super.getEvasionRate(target);
+
+      if ((val > Config.MAX_EVASION) && (!getActiveChar().isGM()))
+      {
+        return Config.MAX_EVASION;
+      }
+      return val;
+    }
  
  @Override
  public int getAccuracy()
  {
- int val = super.getAccuracy();
- 
- if (getActiveChar().getExpertiseWeaponPenalty())
- val -= 20;
- 
- return val;
+        int val = super.getAccuracy();
+
+        if ((val > Config.MAX_ACCURACY) && (!getActiveChar().isGM()))
+        {
+          return Config.MAX_ACCURACY;
+        }
+        return val;
  }
  
  @Override

 

1 answer to this question

Recommended Posts

  • 0
Posted
int val = super.getPAtkSpd ();
 
If ((val> Config.MAX_PATK_SPEED) && (! GetActiveChar (). IsGM ()))
{
Return Config.MAX_PATK_SPEED;
}
Return val;
 

Its not hard to make a "guess",even if u arent familiar with L2J or anything at all.Its not ASM lol..

 

The code works like "limiter" for non GM chars.

No char will have higher attspeed than this one Config.MAX_PATK_SPEED; 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends, we are pleased to announce great news — we are launching our new bot for purchasing and renting virtual numbers for receiving SMS from any services! Are you tired of reused or resold numbers from other platforms? Try our solution! Our service allows you to receive SMS from any major popular services. The list includes more than 200 services! SMS receiving country: USA (+1). Real physical US numbers are used — never previously used on other platforms! Currently, only short-term rental is available. The rental duration for each phone number is shown when purchasing. The cost of each number is also shown next to the service before purchase. You can also receive an additional SMS for your number for the selected service (no extra charge for receiving one more SMS). To quickly find the service you need, you can use the convenient search — just type the name of the service you need and get a number for activation. Available payment methods: cryptocurrencies, bank cards, and balance transfer from our other bots. Thank you for your trust! Active links: Virtual Number Service: Go Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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