Pender : ResetCooldown?


#1

Hello there,

I’m wondering what I’m doing wrong with the resetcooldown skill. Until now, I’ve been using it mostly for goldstorm resets in loop like this :

loop{
    if( this.canCast("goldstorm") {
        this.cast("goldstorm"); // 15sec CD
        this.resetCooldown("goldstorm"); // 20sec CD
    }
}

and it worked nicely. But due to the fact (as I’m aware of) the “spell” resetCooldown can’t be checked with the function : this.canCast(), I have to either keep track of the 20sec CD myself with an external clock (this.now() ) or just leave it as is, knowing I won’t be casting resetCooldown exactly when it’s up.

And more : now that I have complex loops, I wanted to cast a double gold storms every 20sec and be done with it to focus on the battlefield (I wouln’t like to have to cast this double storm on two different iteration of the loop). But I have mixed results with a straight forward approach :

loop{

    now  = this.now() ;
        // Lots of positionning stuff here

    if( now - lastCastResetCD > 20 ) {
        this.cast("goldstorm") ;
        this.resetCooldown("goldstorm");
        this.cast("goldstorm") ;
        lastCastResetCD = now ;

    }

        // lots of fighting stuff here
}

Sometimes, the code above doesn’t summon a double goldstorm. It works somehow half of the time : 1/2 -> simple goldstorm, 1/2 -> double goldstorm. And it’s not a CD problem, as nothing’s better when I extend the condition to :

 if( now - lastCastResetCD > 25 ) {

It seems to be linked to the clumpiness of the 3 spells back to back. But I can’t explain why.
Anyone faced a similar problem with reset cooldown ? Any tip would be welcome :smile:


#2

Try this.isReady("reset-cooldown");

When I got this right resetting the cooldown is not a spell, thus it cannot be checked with canCast.


#3

Well indeed everything runs smoothly when I changed

if( now - lastCastResetCD > 20 ){

by

if( isReady("reset-cooldown") ){

But I can’t explain why… I’ll think about this tomorrow. Time for bed. Thanks for quick reply.