Jump to content
  • 0

Attack Speed problem with ultra status server [aCis]


Question

Posted

I'm developing an ultra status server using an L2jAcis revision, but after a certain amount of attack speed, it becomes possible to bug your attacks, and you start attacking at an exponential speed. I would like to know if anyone has already developed a mod that resolves this situation, something similar to what was developed for l2jfrozen.

 

 

Heres the frozen code example. I tryed to migrate this code to aCis, but didint work.

 

Quote
### Eclipse Workspace Patch 1.0
#P L2jFrozen_GameServer_831

Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revisão 957)
+++ head-src/com/l2jfrozen/Config.java (cópia de trabalho)
@@ -2299,6 +2299,17 @@
public static boolean CUSTOM_MERCHANT_TABLES = true;
public static boolean ALLOW_SIMPLE_STATS_VIEW;
public static boolean ALLOW_DETAILED_STATS_VIEW;
+ //By Jonas
+ public static long ALT_STOP_MOVE_DELAY;
+ public static long ALT_ATTACK_DELAY_BOW;
+ public static long ALT_ATTACK_DELAY_OTHER;
+ public static long ALT_ATTACK_DELAY_MAGIC;
+ public static long ALT_STOP_MOVE_DELAY_MAGIC;
+ public static long ALT_ATTACK_DELAY_WITH_ATKSPD;

public static boolean ALLOW_ONLINE_VIEW;
public static boolean WELCOME_HTM;
public static String ALLOWED_SKILLS;
@@ -2432,6 +2443,19 @@
ALLOW_DETAILED_STATS_VIEW = Boolean.valueOf(L2JFrozenSettings.getProperty("AllowDetailedStatsView", "False"));
ALLOW_ONLINE_VIEW = Boolean.valueOf(L2JFrozenSettings.getProperty("AllowOnlineView", "False"));

+ //BY JONAS
+ ALT_STOP_MOVE_DELAY = Long.parseLong(L2JFrozenSettings.getProperty("AltStopMoveDelay", "50"));
+ ALT_ATTACK_DELAY_BOW = Long.parseLong(L2JFrozenSettings.getProperty("AltAttackDelayBow", "50"));
+ ALT_ATTACK_DELAY_OTHER = Long.parseLong(L2JFrozenSettings.getProperty("AltAttackDelayOther", "50"));
+ ALT_ATTACK_DELAY_WITH_ATKSPD = Long.parseLong(L2JFrozenSettings.getProperty("AltAttackDelayWithAtkSpd", "50"));
+ ALT_ATTACK_DELAY_MAGIC = Long.parseLong(L2JFrozenSettings.getProperty("AltAttackDelayMagic", "50"));
+ ALT_STOP_MOVE_DELAY_MAGIC = Long.parseLong(L2JFrozenSettings.getProperty("AltStopMoveDelayMagic", "50"));
+
KEEP_SUBCLASS_SKILLS = Boolean.parseBoolean(L2JFrozenSettings.getProperty("KeepSubClassSkills", "False"));

ALLOWED_SKILLS = L2JFrozenSettings.getProperty("AllowedSkills", "541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,617,618,619");
@@ -5465,6 +5489,55 @@
{
DM_REVIVE_DELAY = Long.parseLong(pValue);
}
+
+ //By jonas
+ else if(pName.equalsIgnoreCase("AltStopMoveDelay"))
+ {
+ ALT_STOP_MOVE_DELAY = Long.parseLong(pValue);
+ }
+
+ else if(pName.equalsIgnoreCase("AltAttackDelayBow"))
+ {
+ ALT_ATTACK_DELAY_BOW = Long.parseLong(pValue);
+ }
+
+ else if(pName.equalsIgnoreCase("AltAttackDelayOther"))
+ {
+ ALT_ATTACK_DELAY_OTHER = Long.parseLong(pValue);
+ }
+
+ else if(pName.equalsIgnoreCase("AltAttackDelayWithAtkSpd"))
+ {
+ ALT_ATTACK_DELAY_WITH_ATKSPD = Long.parseLong(pValue);
+ }
+
+ else if(pName.equalsIgnoreCase("AltAttackDelayMagic"))
+ {
+ ALT_STOP_MOVE_DELAY_MAGIC = Long.parseLong(pValue);
+ }
+
+ else if(pName.equalsIgnoreCase("AltStopMoveDelayMagic"))
+ {
+ ALT_ATTACK_DELAY_MAGIC = Long.parseLong(pValue);
+ }
+
+
+
+
else
return false;
return true;

Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revisão 957)
+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (cópia de trabalho)
@@ -294,6 +294,11 @@

/** The _meditated. */
private boolean _meditated;
+
+ /**By Jonas*/
+ private boolean moved = false;
+ private boolean movedMagic = false;
+ private boolean movedDelay = true;

/** Zone system<br> x^2 or x*x. */
public static final int ZONE_PVP = 1;
@@ -1102,9 +1107,85 @@
_log.fine(getName() + " doAttack: target=" + target);
}

+ // Get the active weapon item corresponding to the active weapon instance (always equiped in the right hand)
+ L2Weapon weaponItem = getActiveWeaponItem();
+
+ //By jonas
+
+
+ if(isMoving() || getMoved() && weaponItem != null && weaponItem.getItemType() == L2WeaponType.BOW)
+ {
+ try
+ {
+ Thread.sleep(Config.ALT_STOP_MOVE_DELAY);
+ stopMove(null);
+ }
+ catch (InterruptedException e)
+ {
+ System.out.println("Houve uma falha com bow");
+ }
+
+ try
+ {
+ //Parou de atacar com bow
+ Thread.sleep(Config.ALT_ATTACK_DELAY_BOW);
+ }
+ catch (InterruptedException ex)
+ {
+ System.out.println("Houve uma falha com bow");
+ }
+ //Voltou a atacar com bow
+ setMoved(false);
+
+
+
+ }
+
+ if(isMoving() || getMoved() && weaponItem != null && weaponItem.getItemType() != L2WeaponType.BOW)
+ {
+ try
+ {
+ Thread.sleep(Config.ALT_STOP_MOVE_DELAY);
+ stopMove(null);
+ }
+ catch (InterruptedException e)
+ {
+ System.out.println("Houve uma falha sem bow");
+ }
+
+ try
+ {
+ //Parou de atacar sem bow
+ Thread.sleep(Config.ALT_ATTACK_DELAY_OTHER);
+ }
+ catch (InterruptedException ex)
+ {
+ System.out.println("Houve uma falha sem bow");
+ }
+ //Voltou a atacar sem bow
+ setMoved(false);
+
+
+ }
+
+ if(getPAtkSpd() > 500)
+ {
+ try
+ {
+ //Parou de atacar
+ Thread.sleep(Config.ALT_ATTACK_DELAY_WITH_ATKSPD);
+
+ }
+ catch (InterruptedException e)
+ {
+ System.out.println("Houve um erro (atkspd)");
+ }
+ }
+
if(target == null)
return;

+
if(isAlikeDead())
{
// If L2PcInstance is dead or the target is dead, the action is stoped
@@ -1217,9 +1298,7 @@
// Get the active weapon instance (always equiped in the right hand)
L2ItemInstance weaponInst = getActiveWeaponInstance();

- // Get the active weapon item corresponding to the active weapon instance (always equiped in the right hand)
- L2Weapon weaponItem = getActiveWeaponItem();
-
+
if(weaponItem != null && weaponItem.getItemType() == L2WeaponType.ROD)
{
// You can't make an attack with a fishing pole.
@@ -1790,6 +1869,31 @@
return;
}

+ //by j
+ if(isMoving() || getMovedMagic())
+ {
+ try
+ {
+ Thread.sleep(Config.ALT_ATTACK_DELAY_MAGIC);
+ stopMove(null);
+ }
+ catch (InterruptedException e)
+ {
+ System.out.println("Houve uma falha com bow");
+ }
+
+ try
+ {
+ //Parou de atacar com bow
+ Thread.sleep(Config.ALT_STOP_MOVE_DELAY_MAGIC);
+ }
+ catch (InterruptedException ex)
+ {
+ System.out.println("Houve uma falha com bow");
+ }
+ setMovedMagic(false);
+ }
+
if(isSkillDisabled(skill.getId()))
{
if(activeChar instanceof L2PcInstance && !(skill.getId() == 2166))
@@ -11256,4 +11360,25 @@
{
return _triggeredSkills;
}
+
+ public void setMoved(boolean x)
+ {
+ moved = x;
+ }
+
+ public boolean getMoved()
+ {
+ return moved;
+ }
+
+ public void setMovedMagic(boolean x)
+ {
+ movedMagic = x;
+ }
+
+ public boolean getMovedMagic()
+ {
+ return movedMagic;
+ }
+
}
Index: config/functions/l2jfrozen.properties
===================================================================
--- config/functions/l2jfrozen.properties (revisão 957)
+++ config/functions/l2jfrozen.properties (cópia de trabalho)
@@ -280,4 +280,38 @@
ProtectorSkillLevel = 13
ProtectorSkillTime = 600
# Npc Protector Message
-ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
\ No newline at end of file
+ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+
+##############################################
+# CONFIGS FOR CRAZYWAR PVP #
+##############################################
+
+# Delay com bow
+AltAttackDelayBow = 50
+
+# Delay sem bow
+AltAttackDelayOther = 400
+
+# Delay magic
+AltAttackDelayMagic = 50
+
+# Delay for AtkSpd
+AltAttackDelayWithAtkSpd = 50
+
+# Delay For stopMove in attack
+AltStopMoveDelay = 300
+
+# Delay For stopMove in attack
+AltStopMoveDelayMagic = 500
+

Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (revisão 957)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (cópia de trabalho)
@@ -125,6 +125,9 @@
double dx = _targetX - _curX;
double dy = _targetY - _curY;

+ //DELAY PARA ATACAR OU USAR SKILL NOVAMENTE DEPOIS DE ARDAR
+ activeChar.setMoved(true);
+ activeChar.setMovedMagic(true);
// Can't -ni
if (activeChar.isOutOfControl() || dx * dx + dy * dy > 98010000) // 9900*9900
{


if(isMoving() || getMovedMagic())
+ {
+ try
+ {
+ Thread.sleep(Config.ALT_ATTACK_DELAY_MAGIC);
- stopMove(null);
+ }
Ou remove o método stopMove(null)

 

 

8 answers to this question

Recommended Posts

  • 0
Posted
13 hours ago, Williams said:

I corrected this but the way you took the Frozen example is not the best way to correct it in PlayerAI, good luck.

I tried a lot of things and in my case nothing work as expected. The problem is walk and hit a lot of times, thats make an multiply of your attack speed. Seens like an easy problem, but i work on this for months and cant solve yet.

  • 0
Posted
Thread.sleep should never been used like that, it's the worst you can do.

Dig into lack of synchronization, maybe. Set _isAttackingNow/_isCastingNow to AtomicBoolean, add synchronized over _moveTask if there's not.

Normally, setIntention is synchronized and it's impossible to override it. Another explanation is maybe your atkspd is too big than it generates very, very little tasks timers. Lower than 40ms (depends about your CPU cycle), timers got no guarantee to be properly managed if it uses System.currentTimeInMillis.
  • Upvote 1
  • 0
Posted (edited)
On 1/7/2024 at 6:26 PM, Tryskell said:

Thread.sleep should never been used like that, it's the worst you can do.

Dig into lack of synchronization, maybe. Set _isAttackingNow/_isCastingNow to AtomicBoolean, add synchronized over _moveTask if there's not.

Normally, setIntention is synchronized and it's impossible to override it. Another explanation is maybe your atkspd is too big than it generates very, very little tasks timers. Lower than 40ms (depends about your CPU cycle), timers got no guarantee to be properly managed if it uses System.currentTimeInMillis.

My version of aCis is 382, so I don't have these variables in my review. However, I changed the intentions to synchronized, which already improved part of the process, but unfortunately it didn't fix it. I also checked version 401 to see if it contained the _isAttackingNow variable, but it doesn't either, and moveTask is a complete class, meaning it's not possible to change just one method, unless you're talking about the moment the task was created. I really need help with this, I've been dealing with this for months and haven't been able to resolve it, and it has a huge impact on the gameplay on my servers. This way, if anyone is interested in helping me, I am willing to resolve it.

 

@edit

If i have to change my aCis version, that is not an problem.

Edited by Hash
  • 0
Posted (edited)

sounds like there are two different attack intentions, try to find the usages of the intention, keep in mind that isAttacking doesnt return the correct value in most cases so a quick approach for that is to get the AI of the attacker first 

Edited by Katara512
  • 0
Posted (edited)
On 1/7/2024 at 3:11 AM, Hash said:

Я разрабатываю сервер ультрастатуса, используя ревизию L2jAcis, но после определенной скорости атаки становится возможным прослушивать ваши атаки, и вы начинаете атаковать с экспоненциальной скоростью. Хотелось бы узнать, разработал ли кто-нибудь уже мод, разрешающий эту ситуацию, что-то похожее на то, что было разработано для l2jfrozen.

 

 

Вот пример замороженного кода. Я пытался перенести этот код в aCis, но ничего не вышло.

 

 

The problem is the reuse bow attack in this code. You must rewrite this point.
For servers with large stats, you need to rewrite the function with attack reuse. For correct operation

_disableBowAttackEndTime
Edited by Psygrammator
  • 0
Posted

I tested on version 398 of aCis and the problem does not occur. From what I verified, the attack process and intentions were modified in version 389 of aCis, but I cannot find the diff with this modification to apply in my review. I believe that really the only way to adjust this is to change the way intentions are generated and the way attacks and conjurations happen.

  • 0
Posted
On 1/26/2024 at 5:25 PM, Hash said:

I tested on version 398 of aCis and the problem does not occur. From what I verified, the attack process and intentions were modified in version 389 of aCis, but I cannot find the diff with this modification to apply in my review. I believe that really the only way to adjust this is to change the way intentions are generated and the way attacks and conjurations happen.

I also need help with this, did you manage to solve it?

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

    • Facebook-Ins-X-Pin-Proxy - 150M+ Fresh Residential Proxies    MoMoProxy Official Site: MoMoProxy.com   1. Features ------------------------------------------ 1. 190+ Countries And Millions of City Targeting”; 2. 80M+ Rotating Residential Proxies”; 3. 5M+ 240 Minutes Lasting Sticky Residential Proxies”; 4. 99.64% Request Success Rate.” 5. High Anonymous Clean Residential Proxies. 6. 50M-1GB/S Download and Upload Speed. 7. IP Whitelist Or User Pass Authentication. 8. Convenient IP Abstracting On User Panel, No APP Download. 9. IP Pool Covers 190+ Countries. 10. API For Automation Workflow. 11. Compatible With All Browsers & Devices. 12. SOCKS5 HTTP(S) Proxies. 13. 99.64% Request Success Rate and 99.9% Update. 2. Use Cases: Web Scraping and Data Extraction Use MoMoProxy to access websites anonymously and avoid IP blocking while scraping large volumes of data for research, business intelligence, or competitive analysis. Social Media Management (Multiple Accounts) Manage multiple social media accounts (e.g., Instagram, Twitter, Facebook) simultaneously with different proxy IPs to avoid account bans and increase operational efficiency. SEO and SERP Tracking Use MoMoProxy to perform SEO audits and track search engine result page (SERP) rankings without being blocked by search engines, simulating searches from different geographical locations. E-commerce Price Monitoring Monitor competitors' prices on e-commerce platforms (like Amazon, eBay) by using MoMoProxy's rotating residential IPs to simulate user requests from different regions without getting flagged. Web Testing and Automation Conduct automated web testing by using MoMoProxy to simulate user behavior across different locations, devices, and networks, ensuring that web applications behave consistently under various conditions. Ad Verification Verify online advertisements (display ads, pay-per-click ads) from different IP addresses to ensure proper targeting and compliance with advertising policies. Fraud Prevention and Security Safeguard your online activities (such as financial transactions or account logins) by using MoMoProxy to rotate IP addresses and protect against IP-based attacks or fraud. Market Research Collect data from various sources without being detected or restricted, allowing for comprehensive market research, competitor analysis, and trend forecasting. Mobile App Testing Use MoMoProxy to test mobile applications across different regions and simulate real-world user scenarios, ensuring that apps perform correctly in various network environments. Ticketing and Event Booking Secure tickets for high-demand events by using MoMoProxy to mask your real IP and bypass ticket purchasing limits based on IP addresses. Ad Fraud Prevention Prevent ad fraud by rotating IPs to detect and block suspicious activities related to advertising, ensuring accurate attribution and campaign performance analysis. Academic Research and Surveys Use MoMoProxy to distribute surveys or gather data from different regions without bias due to regional IP filtering or restrictions.   3. Pricing List: ----------------------------------------------- Note: Price List will be changable based on our promotion every month or in some Dig Days. If any question or help please contact our support online timely: Telegram: https://t.me/momoproxy_com Email: support@momoproxy.com 4. Payments: Now MoMoProxy Supports: A. Crypto Currency Payment, including USDT, BTC, and more; B. Alipay HK, UnionPay; C. Doku For local Southeast Asia payment; D. Offline Aliay and WeChat, please contact support Online; (Note: Visa, MasterCard and Paypal is coming within 30 days). 5.Return Policy MoMoProxy Offer 3 days free trial for all new users that will be helpful for you get further experience on MoMoProxy quality before payment. We also provide 24 hours money-back guarantee, which only applies to technical issues related to MoMoProxy servers that we can not fix within 24 hours. 6. FAQ A. How to buy a plan and how about MoMoProxy payments? After logging in, and enter into the user dashboard, please choose the right plan that be suitable for you, and click [Buy Proxy]. Now MoMoProxy Supports: A. Crypto Currency Payment, including USDT, BTC, and more; B. Alipay HK, UnionPay; C. Doku For local Southeast Asia payment; D. Offline Aliay and WeChat, please contact support Online; (Note: Visa, MasterCard and Paypal is coming within 30 days). B. Where can I use residential IP addresses? a. For Handle Proxy Generate, Just Choose [Proxy Setup], Click [Residential Proxies], and go to [Endpoint Generator] Part, and choose [location] and [proxy type], click [Generate] to generate Proxy List, all steps will be easily; b. Residential Proxies (API) is also available for automation. Can I integrate proxies with 3rd party software, bots and automation tools? You can integrate MoMoProxy proxies with all major automation bots under the help of our API. C. Can I select proxies from specific locations? You can access residential proxies through country-specific, state-targeting or city-targeting after using your login credentials (username and password) or in Allowlisted IPs, such as Los Angeles, California, USA. 7. Contact Us Telegram: https://t.me/momoproxy_com Email: support@momoproxy.com 8. How To Get A FREE Trial? Please register your account firstly, and contact support online to get A 1GB Free Trial! Get 1GB Free Trial NOW! Get 1GB Free Trial NOW! Get 1GB Free Trial NOW! Get 1GB Free Trial NOW! Get 1GB Free Trial NOW! Get 1GB Free Trial NOW!
    • Hello! That's funny things: Rates x3 And  "No Donate things affect the game balance"                           GM Donate Shop - B-A-S grade for Donation Coins VIP Status: Rates x8
    • I’ve been using SMS.To for a while now and it’s been solid. No issues with delays so far, and the text messaging works right away for verification. Way easier than dealing with local SIM cards for every site.
    • Good evening, I have a problem with the items+ when I enchant, for example, the armors, the weapons, all the stats are normal. When I put them on my inventory, the +4+5 etc. that I have done do not appear. The project is h5 with the salvation protocol. Can any expert help me fix it? Thanks in advance. some screens... this items is +12   https://prnt.sc/fh2i0pjCHDY_ https://prnt.sc/qc1kLl-S4hn6 https://prnt.sc/CTFw3HOdZDPz  
    • GRAND OPENING TODAY !!!  FROM - 10 OCTOBER 2025, FRIDAY, 20:00 +2GMT.
  • 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