Jump to content
  • 0

Stop Moving if try use skill that have reusedelay on


Question

Posted (edited)

Hello , i am using acis free source and i have a problem i can't fiind where to look for i am drowning :=\

Im asking you guys for any hint or maybe someone who got into same problem can help me.

 

Problem is that , when i try to use a skill that has reuse delay on, for example rapid shot , character stop moving , i have noticed that this thing is not happening when i try to use rapid shot and there is no delay on skill  character will cast/use skill and continue moving where he was moving to before using skill. why is this not happening when skill has reuse delay ? 

 

//edit: it should write skill is not ready or something like this , i don't get any msg also , also when no mp do same stop moving 

 

 

//edit2: problem fixed

 

i moved this checks 

 

        if (getCurrentMp() < getStat().getMpConsume(skill) + getStat().getMpInitialConsume(skill))
        {
            // Send a System Message to the caster
            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_MP));

            abortCast();
            // Send ActionFailed to the L2PcInstance
            sendPacket(ActionFailed.STATIC_PACKET);
            return;
        }
        if (skill == null || isSkillDisabled(skill))
        {
            // Send ActionFailed to the L2PcInstance

            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE).addSkillName(skill));
            abortCast();
            return;
        }

 

from checkDoCastConditions to begincast , only difference is now the return is not written as return false , but only return .. this is still a mistery to me , aa also added this  getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING); 😄

Edited by arm4729

3 answers to this question

Recommended Posts

  • 0
Posted
getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING);

 

This code useless for your problem. EVT_FINISH_CASTING event uses for cases which attached to skill's casting end. In your case you need add check for skill reuse delay before stopMove() action.

  • 0
Posted (edited)

thank you , well now is working fine i added the check in the begin cast , hope is not doing any problems ... 

 

getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING);

to be honest , i didin't know what this is doing but i was trying to get a fix to my problem so i forgot to delete this line 😄

 

can someone explain what is difference between "return" and "Return false" because i think there was the problem , from begintask is only "return" to get and this way character won't stop moving , but from checkskillcondition is only "return false" to get , and this stops char movement .. is there any chance that return false + return false = null ? or something like this

Edited by arm4729
  • 0
Posted (edited)
On 9/2/2021 at 10:06 PM, arm4729 said:

thank you , well now is working fine i added the check in the begin cast , hope is not doing any problems ... 

 

getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING);

to be honest , i didin't know what this is doing but i was trying to get a fix to my problem so i forgot to delete this line 😄

 

can someone explain what is difference between "return" and "Return false" because i think there was the problem , from begintask is only "return" to get and this way character won't stop moving , but from checkskillcondition is only "return false" to get , and this stops char movement .. is there any chance that return false + return false = null ? or something like this

//return false;
public boolean test() 
{
    int x = 1;
    
    if (x == 1) 
    {
        System.out.println("works!!!");
        return true;
    }
       
    return false;
}
//return;
public void testReturn()
{
    if (test())
    {
       System.out.println("our value is True");
       return;
    }
    else 
    {
       System.out.println("our value is False");
       return;
    }
}

first code block will return false as a default value however if the condition is true then will return true.
second bock which uses return will return undefined or void 0. both cases are called falsy. Although if you just want to exit a method it doesnt matter which keyword you'r going to use since both have the same result.

Edited by Sidereal Day

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.

×
×
  • Create New...