Jump to content
  • 0

Error mod,(stops attacking and not attacking more)


Question

Posted

Hello, can you help me with a problem?

I need to stop attacking the character for a while when clicking to walk.

I tried two ways.

At first he does not attack until you finish walking, that's bad for archer, in the second he stops attacking and not attacking more, you can tell me why?

I'm trying to make a server with high status, please help me in this.

What area will the forum for these questions, I am newbie in the forum.

Sorry my english and thanks for reading.

 

 

(Check One)

 

Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java

===================================================================

--- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revisão 65)

+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (cópia de trabalho)

@@ -932,7 +932,13 @@

 

if(target == null)

return;

-

+

+ if(isMoving())

+ {

+ sendPacket(ActionFailed.STATIC_PACKET);

+ return;

+ }

+

if(isAlikeDead())

{

// If L2PcInstance is dead or the target is dead, the action is stoped

 

 

(Check Two)

 

Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java

===================================================================

--- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revisão 65)

+++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (cópia de trabalho)

@@ -219,6 +219,10 @@

private boolean _blocked;

private boolean _meditated;

 

+

+ /**MY Variables*/

+ private boolean moved = false;

+

/**

* Zone system<br>

* x^2 or x*x

@@ -932,7 +936,13 @@

 

if(target == null)

return;

-

+

+ if(getMoved())

+ {

+ sendPacket(ActionFailed.STATIC_PACKET);

+ return;

+ }

+

if(isAlikeDead())

{

// If L2PcInstance is dead or the target is dead, the action is stoped

@@ -9589,4 +9599,14 @@

{

    return _isBuffProtected;

}

+

+ public void setMoved(boolean x)

+ {

+ moved = x;

+ }

+

+ public boolean getMoved()

+ {

+ return moved;

+ }

}

Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java

===================================================================

--- head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (revisão 65)

+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/MoveBackwardToLocation.java (cópia de trabalho)

@@ -24,6 +24,7 @@

import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;

import com.l2jfrozen.gameserver.network.serverpackets.StopMove;

import com.l2jfrozen.gameserver.thread.TaskPriority;

+import com.l2jfrozen.gameserver.thread.ThreadPoolManager;

import com.l2jfrozen.gameserver.util.IllegalPlayerAction;

import com.l2jfrozen.gameserver.util.Util;

 

 

@@ -115,22 +116,49 @@

// Can't move if character is confused, or trying to move a huge distance

if (activeChar.isOutOfControl() || dx * dx + dy * dy > 98010000) // 9900*9900

{

activeChar.sendPacket(ActionFailed.STATIC_PACKET);

return;

}

+

+

+ if (activeChar.isInCombat())

+ {

+ activeChar.setMoved(true);

+ ThreadPoolManager.getInstance().scheduleGeneral(new protection(activeChar), 2000);//2 sec

+ }

+

+

activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(_targetX, _targetY, _targetZ, 0));

}

}

@Override

public String getType()

{

return "[C] 01 MoveBackwardToLoc";

}

+

+ class protection implements Runnable

+    {

+            L2PcInstance activeChar;

+            public protection(L2PcInstance player)

+            {

+                    activeChar = player;

+            }

+            @Override

+            public void run()

+            {

+          activeChar.setMoved(false);

+            }

+    }

+   

}

 

1 answer to this question

Recommended Posts

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

    • NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE   **Earn While You Spend - Introducing HS Cashback!**   Every purchase on our site now rewards you with **HS Keys cashback**   EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE   Here's how it works:       **1 USD = 1000 HS Keys**   **Get 3% cashback** on every purchase   **Use your HS Keys to **save on your next order**   ---   ### ⚡ Why this is awesome   * Every order gives you value back   * Stack it with promos & HS usage   * Turn your spending into future discounts   ---   ### Example   Spend **$10** → Get **300 HS Keys** back   Spend **$50** → Get **1500 HS Keys** back   ---   ### Smart system (built for fairness)   * Cashback is rounded to keep things balanced   * Prevents abuse from tiny orders   * Rewards real buyers   ---   ### Start earning now   Every purchase = progress toward your next discount   Shop now and build your HS balance!   #cashback #gamingdeals #d2r #rewards #loyalty   Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com     We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys.   Invite your friends using your personal link.   Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link.   Get your referral link here: www.d2rhiddenstash.com/profile     Start earning today
    • https://jumpshare.com/share/L45ApA5PVrGN2O5Ua5pQ   Skill synchronization with the server: Launching and synchronizing animations, launching and synchronizing effects. All of this is tied to the server's timing  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..