This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

  • Sign in to follow this  
    Followers 0

    UseItemOn doesn't work because of Item Cooldown


    Eldunar
    • Version: All Product: Quester Type: Bug Status: Not Added

    So in this quest I have to use an item on 2 different points. It used the item on the first hotspot just fine... but when it arrived at the second hotspot the item was still on cooldown when the bot used it, so it didn't work. It ran back again to the first hotspot and used the item again succesfully, ran again to the second hotspot and it was on cooldown again, creating an infinite loop. I thought I could solve it by creating 2 entries for the same quest in the quest editor and doing them seperately but what this does is pulse the first entry succesfully, then it goes to the second step uses the item (which is still on cooldown) once and then it doesn't do anything anymore. I can solve it manually by running code in a thread but seems like this shouldn't be happening.

     


    Attached Files:


      Report Bug Report
    Sign in to follow this  
    Followers 0


    User Feedback


    Yeah, another possibility. I just think the logic of the useItemOn questclass could be improved, maybe allow setting an item cooldown time. But ofcourse that's up to droidz, im just reporting the issue. 

    Share this comment


    Link to comment
    Share on other sites

    Hello, to bypass this problem, before to pulse this quest add step type runcode:

            robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
            {
                int itemId = 1234;
                int questId = 1234;
    
                if (!wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                    return;
                if (wManager.Wow.Helpers.Conditions.IsAttackedAndCannotIgnore)
                    return;
    
                if (state.DisplayName == "Quester")
                {
                    if (wManager.Wow.Helpers.Quest.HasQuest(questId) &&
                        wManager.Wow.Helpers.Lua.LuaDoString<bool>("local start, duration, enable = GetItemCooldown("+ itemId + "); return enable;"))
                    {
                        cancelable.Cancel = true;
                    }
                }
            };

    (replace spell and item id)

    Share this comment


    Link to comment
    Share on other sites


    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