jp-ganis / JPS

Protected LUA DPS Addon
32 stars 46 forks source link

warlock auto soulstone doesn't work #356

Closed ghost closed 11 years ago

ghost commented 11 years ago

throwed an error for me. Was infight so can't only say it was something with the conditionparser. But the soulstone didn't worked

-- Soulstone Table
function wl.soulStone(unit)
    if not unit then unit = "target" end
    local soulStoneTable = {wl.spells.soulStone, false, unit}
    return function()
        soulStoneTable[2] = IsControlKeyDown() ~=nil and jps.cooldown(wl.spells.soulStone) == 0 and UnitIsDeadOrGhost(unit) == 1 and UnitPlayerControlled(unit)
        return soulStoneTable
    end
end

same for the dk's. Raisy Ally battle Rezz doesn't work, I don't know why:

{ "Raise Ally",'UnitIsDeadOrGhost("target") == 1 and UnitPlayerControlled("target") and jps.UseCds', "target"},
kirk24788 commented 11 years ago

Hmm....I'll look into it later - but the table looks good...

ghost commented 11 years ago

yes I don't know why the conditions doesn't match, but the soulstone doesn't worked, tested it again in a heroic scenario

kirk24788 commented 11 years ago

Got it....the error was my bad....LUA's boolean logic is crap... true and 1 -> 1 so if the last condition evaluated to 1 my function tried to call 1 (since it didn't know how to handle numbers)....fixed Next thing - UnitPlayerControlled(unit) returns nil if the player is a ghost....do'h...fixed for the lock rotation...

Unfortunately jps.canCast() returns false...this can't be easily fixed... jps.UnitExists(unit) seems to be the problem there...but you don't want to remove this..we could add a list of spells (all brezz) for which this condition isn't checked...

ghost commented 11 years ago

thank you :)

htordeux commented 11 years ago

yes you jps.canCast only on alive unit the best would be to write a small local fct just before the spelltable eg local cancastSoulStone = wl.soulStone(unit) if cancastSoulStone then spell = "Raise Ally" target = "target" return end