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?

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

    • Sell ready interlude server files, with all popular features and tested, stable source + fully functional premium geodata for free.   Features include: Events: DM CTF TVT LM Dressme system Custom Buffer GM Shop Custom community board Donation manager  Auto Farm   Album: sell c6 — ImgBB   Test Server online: Patch link: https://drive.google.com/file/d/1mvEbv9XESsvfWwc638xFyyzyESeE2U95/view?usp=drive_link Auto acc create and auto admin   Price: 300$. Discord: l2retro
    • Faltan demasiados archivos,  y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable.  Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod  completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto... 
    • I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays. To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
    • 🌐 Website: https://l2adonis.com 📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2) 💬 Discord: https://discord.com/invite/tZBj8JxAwx 🚫 No auto-farm • No auto-macro • No pay-to-win • No custom   Some Basic Info's (More detalied info's on website)  EXP/SP: x25  Adena: x15  Drop: x15  Spoil: x15  Seal Stones: x15  Raid Boss Drop: x10  Epic Boss Drop: x1  Manor: x10  Safe Enchant: +4  Max Enchant: +16  Normal Scroll Chance: 50%  Blessed Scroll Chance: 66% (If enchant fail item remain +4)  Buff Slots (30+4 extra with Divine Inspiration)  Dances/Songs Slots 14  Auto-learn skills  ⚔️ Real PvP • Real Progression • Retail-like experience JOIN NOW and relive the real L2 experience!
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchihamkt.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/uthciha-servicess  | https://campsite.bio/utchihaamkt
  • 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