Jump to content

Break Stealth (a solution)


Bugreporter

Recommended Posts

Same usage of a LUA-Script as described

 

"I want to break free" (Queen). In this case we want to break out of stealth. In PvP this will be most done with Cheap Shot , in PvE with Ambush . Ambush will only work, if you are behind the target. Because we couldn't not really be sure, that we are behind the target, I use a shadowstep before, (and a pickpocket. We have it, we should use it ;-) ).

 

If Ambush is not usable (not more behind or spell not known), I try Cheap Shot, Garrote,  Revealing Strike and at last Sinister Strike to get out of Stealth into combat.

    <FightClassSpell>
      <SpellName>--Break Stealth</SpellName>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local attack=0
if IsStealthed() and UnitExists("target") and not UnitIsFriend("player", "target") then
    if not (UnitIsPVP("target")) and (((UnitHealth("target") / UnitHealthMax("target") * 100) &gt; 97) or (UnitLevel("target")==-1)) then
--[[ Ambush only if target is not in PVP and only as Opener OR target is a boss (they are not stuneable, so we prefere Ambush) ]]
        local idShadowStep=36554
        local idPickPocket=921
        local idAmbush=8676
        local start, duration, enabled = GetSpellCooldown(idShadowStep)
        local nameAmbush=GetSpellInfo(idAmbush)
        local timeleft=GetTime()-start
        if (duration==0) then
            local nameShadowStep=GetSpellInfo(idShadowStep)
            if (IsSpellInRange(nameShadowStep, "target")==1) then
                CastSpellByName(nameShadowStep)
            end
        elseif (timeleft &lt; 2) then
            local spellname=GetSpellInfo(idPickPocket)
            CastSpellByName(spellname)
            CastSpellByName(nameAmbush)
            attack=nameAmbush
        end
    end
    if (attack==0) then
--[[ 1. try Ambush (failed if you are not behind the target
                    or you dont now the spell)

     2. try Cheap Shot (failed if unknown)
     3. try Garrote (failed if unknown)
     4. try Revealing Strike (we want to break steal, right ?)
     5. try ( Fifth try? You are not level 20 ????)
            okay, a simple sinister will do the work
--]]
        local idSpells={1833,703,84617,1752}
        for i=1,#idSpells do
            local start, duration, enabled = GetSpellCooldown(idSpells[i])
            if (duration==0) then
                local spellname=GetSpellInfo(idSpells[i])
                if IsStealthed() and (IsSpellInRange(spellname, "target")==1) then
                    CastSpellByName(spellname)
                    attack=spellname
                end
            end
        end
    --[[ no more try. get near to the target !!! You'are a melee !!! ]]
    end
end
if (attack~=0) then
    print(attack)
    result=true
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <Priority>19</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <DescriptionSpell>Break stealth with ambush, Cheap shot or Garrote</DescriptionSpell>
    </FightClassSpell>

based on WoW 5.4.2.

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

This is the same Code with out shadow step for those of us that arent spec'ed into this talent.

 

    <FightClassSpell>
      <SpellName>--Break Stealth</SpellName>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local attack=0
if IsStealthed() and UnitExists("target") and not UnitIsFriend("player", "target") then
    if not (UnitIsPVP("target")) and (((UnitHealth("target") / UnitHealthMax("target") * 100) &gt; 97) or (UnitLevel("target")==-1)) then
--[[ Ambush only if target is not in PVP and only as Opener OR target is a boss (they are not stuneable, so we prefere Ambush) ]]
        local idPickPocket=921
        local idAmbush=8676
        local nameAmbush=GetSpellInfo(idAmbush)
        local spellname=GetSpellInfo(idPickPocket)
            CastSpellByName(spellname)
            CastSpellByName(nameAmbush)
            attack=nameAmbush
        end
    end
    if (attack==0) then
--[[ 1. try Ambush (failed if you are not behind the target
                    or you dont now the spell)

     2. try Cheap Shot (failed if unknown)
     3. try Garrote (failed if unknown)
     4. try Revealing Strike (we want to break steal, right ?)
     5. try ( Fifth try? You are not level 20 ????)
            okay, a simple sinister will do the work
--]]
        local idSpells={1833,703,84617,1752}
        for i=1,#idSpells do
            local start, duration, enabled = GetSpellCooldown(idSpells)
            if (duration==0) then
                local spellname=GetSpellInfo(idSpells)
                if IsStealthed() and (IsSpellInRange(spellname, "target")==1) then
                    CastSpellByName(spellname)
                    attack=spellname
                end
            end
        end
    --[[ no more try. get near to the target !!! You'are a melee !!! ]]
    end
end
if (attack~=0) then
    print(attack)
    result=true
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <Priority>19</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <DescriptionSpell>Break stealth with ambush, Cheap shot or Garrote</DescriptionSpell>
    </FightClassSpell>

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
×
×
  • Create New...