Jump to content
  • 0

Stop Moving if try use skill that have reusedelay on


arm4729

Question

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
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
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.

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0
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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Posts

    • When it comes to encrypting passwords, using a strong hashing algorithm like SHA-256 or bcrypt is recommended. These algorithms help ensure that passwords are securely stored and protected from being easily decrypted.
    • ***CLExt L2OFF Extender Premium Account Save - Auto Login***   We would like to sell account panel for save accounts for server owners or self player.  You can login and save your id and pass accounts or delete it etc.       Price: 100 euro.   ***CLExt L2OFF Extender Premium Auto-Farm Macro System*** We would like to sell Auto-Farm Macro System for server owners or self player.  You can add your potions and your macro to farm your character with your standars.       Price: 100 euro.   If you like to order send me DM or skype zoumhs999.
    • Diablo III, the action-packed hack-and-slash RPG developed by Blizzard Entertainment, has captivated gamers worldwide since its release in 2012. Now, imagine a world where Diablo III's source code is opened up to the community, inviting developers and enthusiasts alike to enhance and refine this beloved game. This topic delves into the possibilities, challenges, and community desires surrounding the idea of Diablo III as an open-source project.   Key Points: 1. Defining Diablo III: Diablo III is an action role-playing game set in the dark fantasy world of Sanctuary. Players traverse through randomized dungeons, battling hordes of demons and collecting loot to strengthen their characters. With its compelling storyline, addictive gameplay mechanics, and rich lore, Diablo III has amassed a dedicated fanbase over the years.   2. Open Source Potential: Opening up the source code of Diablo III could unlock a wealth of opportunities for the game's future. Community developers could introduce new features, enhance existing gameplay elements, and address long-standing issues. The modding community, known for its creativity and innovation, could breathe new life into the game by creating custom content, game modes, and user interface improvements. 3. Community Interest: The question arises - would the gaming community welcome the idea of Diablo III becoming open source? Many players are eager to see the game evolve beyond its current state, with enhancements such as improved balance, expanded end-game content, and enhanced multiplayer features. By involving the community in the development process, Diablo III could foster a stronger sense of ownership and collaboration among its players. 4. Challenges and Considerations: While the concept of Diablo III as an open source is enticing, it also presents several challenges. Ensuring the integrity of the game's balance and preventing cheating would be paramount concerns. Additionally, coordinating development efforts and maintaining a cohesive vision for the game could prove challenging in a community-driven environment. However, with proper oversight and collaboration, these obstacles can be overcome. 5. Is Diablo III an MMORPG? Diablo III is often categorized as an action RPG rather than a traditional MMORPG (massively multiplayer online role-playing game). While it does feature online multiplayer elements, including cooperative play and player-versus-player combat, it lacks the persistent open world typically associated with MMORPGs. Instead, Diablo III focuses on instanced dungeons and smaller-scale multiplayer interactions. The Benefits of Improvement: Improving Diablo III through open-source development could revitalize the game, attracting new players and re-engaging existing fans. By embracing community-driven innovation, Diablo III could remain relevant and enjoyable for years to come. Additionally, fostering an active modding community could extend the game's longevity and create new opportunities for player expression and creativity.   Source code  
  • Topics

×
×
  • Create New...