Jump to content

Stun, stun, stun and stun (a solution)


Bugreporter

Recommended Posts

This snippet needs the snippet or another solution to handle Cheap Shot

 

What do we do ?

  1. We check, if the target is stuned.
  2. If not, we try a Kidney Shot,
  3. If Kidney Shot not ready AND we are in PvP OR in a Group AND attack the same Mob AND Vanish and Cheapshot are ready we vanish.
  4. ...(and now?)...
  5. Your (or my ()) Cheap Shot solution do its best to stun again.
  6. We remember Preparation...and use it.
  7. And we start at point  3. again
  8. After this Kidney Shot should be ready again. (20 sek cd)

I use Kidney Shot with 4 or more Combo Points. If you want it faster, change the value after GetComboPoints (btw: do you know Nerve Strike ?)

    <FightClassSpell>
      <SpellName>--Stun</SpellName>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local spell="nothing"
if UnitExists("target") and not UnitIsFriend("player", "target") and not (UnitLevel("target")==-1) then
    local stunId =    {
                        1833,         --[[ Cheap Shot ]]
                        408,          --[[ Kidney Shot ]]
                        47481,        --[[ Gnaw ]]
                        5211,         --[[ Bash ]]
                        22570,        --[[ Maim ]]
                        9005,         --[[ Pounce ]]
                        24394,        --[[ Intimidation ]]
                        91797,        --[[ Monstrous Blow ]]
                        50519,        --[[ Sonic Blast ]]
                        44572,        --[[ Deep Freeze ]]
                        118271,       --[[ Impact ]]
                        853,          --[[ Hammer of Justice ]]
                        89766,        --[[ Axe Toss ]]
                        54786,        --[[ Demon Leap ]]
                        30283,        --[[ Shadowfury ]]
                        7922,         --[[ Charge Stun ]]
                        46968,        --[[ Shockwave ]]
                        56,           --[[ Stun ]]
                        20549         --[[ War Stomp ]]
                    }
                        
    local function isStunned(unit)
        for i=1,#stunId do
            local spellname=GetSpellInfo(stunId[i])
            if UnitAura(unit,spellname) then return true end
        end
        return false
    end
    
    if not isStunned("target") then
--[[ not stunned? maybe I can help... ]]    
        if not IsStealthed() then
            local idKidneyShot=408
            local start, duration, enabled = GetSpellCooldown(idKidneyShot)
            if (duration==0) then
--[[ Combo Points &gt; 3 ? Gooood...night ]]
                if (GetComboPoints("player", "target") &gt; 3) then
                    local spellname=GetSpellInfo(idKidneyShot)
                    if (IsSpellInRange(spellname, "target")==1) then
                        spell=spellname
                    end
                end;
            else
                --[[ Vanish only in PvP or if another group-member attack this target
                      test:  set "tryVanish=1" at training dummys ]]
                local tryVanish=0
                
                if UnitIsPVP("player") and UnitIsPVP("target") then
                    tryVanish=1;
                else
                    local group="party"
                    if IsInRaid() then 
                        group = "raid"
                    end
                    for i=1,GetNumGroupMembers() do
                        local member=group..i
                        if not (UnitIsUnit(member,"player")) then
                            if (UnitIsUnit(member.."target","target")) then
                                tryVanish=1
                                break
                            end
                        end
                    end
                end
                if (tryVanish==1) then
                    local idVanish=1856
                    local idPreparation=14185
                    local idCheapShot=1833
                    local start, duration, enabled = GetSpellCooldown(idVanish)
                    local CSstart, CSduration, CSenabled = GetSpellCooldown(idCheapShot)
                    --[[ Vanish AND CheapShot ready? And Target in CS-range ? ]]
                    if (duration==0) and (CSduration==0) then
                        local spellname=GetSpellInfo(idCheapShot)
                        if (IsSpellInRange(spellname, "target")==1) then
                            spell=GetSpellInfo(idVanish)
                        end
                    else
                        local start, duration, enabled = GetSpellCooldown(idPreparation)
                        if (duration==0) then
                            spell=GetSpellInfo(idPreparation)
                        end
                    end
                end
            end
        end
    end
end
if not (spell=="nothing") then
    CastSpellByName(spell)
    print("stun: "..spell)
    result=true
end;</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <Priority>18</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <DescriptionSpell>Stun it, whenever you can</DescriptionSpell>
    </FightClassSpell>


based on WoW 5.4.2.

 

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