﻿<?xml version="1.0" encoding="utf-16"?>
<FightClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <FightClassGeneralSettings>
    <FightClassName>Rogue - Subtlety</FightClassName>
    <FramePerSecond>25</FramePerSecond>
  </FightClassGeneralSettings>
  <FightClassSpells>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>2</Number>
            <Type>BiggerOrEqual</Type>
            <Radius>10</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") then
	local t=GetTime();
	local buffexp,buff,buffcnt={},{},{};
	local i,n,c,x,id,found=0;
	repeat 
		i=i+1;
		n,_,_,c,_,_,x,_,_,_,id=UnitAura("target",i,"PLAYER HARMFUL"); 
		if n then
			buffcnt[n]=c
			buffexp[n]=x-t
			buff[n]=id;
			found=true
		end
	until (not n) or (i==40);
	if found then
		local sap=select(1,GetSpellInfo(6770))
		local blind=select(1,GetSpellInfo(2094))
		found=false
		if buff[sap] or buff[blind] then
			FocusUnit("target")
			TargetNearestEnemy() 
			if UnitExists("focus") and UnitIsUnit("target","focus") then
				ClearFocus()
			end
			found=true
		end
	end
	--[[ Dont attack death mobs         dont try to attack PvP flaged enemy, if you dont want play pvp ]]
	if (UnitHealth("target")&lt;=1) or (UnitIsPVP("target") and not UnitIsPVP("player")) or (UnitIsPVP("target") and UnitIsPVP("player") and (UnitName("player")~=UnitName("targettarget") and not IsInGroup(LE_PARTY_CATEGORY_INSTANCE)))	then
		if not found then 
			TargetNearestEnemy() 
		end
		result=true
	end
elseif UnitExists("focus") and not UnitIsFriend("player", "focus") then
	TargetUnit("focus")
	ClearFocus()
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Next Enemy</SpellName>
      <Priority>30</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Target next enemy if target has health&lt;=1 (mostly dead)</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Type>Bigger</Type>
            <Radius>60</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
			result=not(IsStealthed())
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeIsFlying</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeInCombat</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Stealth</SpellName>
      <Priority>29</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Stealth. If hostile 60 Yards away. </DescriptionSpell>
      <CastOnSelf>true</CastOnSelf>
      <CastOn>player</CastOn>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local sap=select(1,GetSpellInfo(6770))  --[[ Sap ]]
local found=false
if UnitExists("focus") and not UnitIsFriend("player", "focus") then
	local t=GetTime();
	local buffexp,buff,buffcnt={},{},{};
	local i,n,c,x,id=0;
	repeat 
		i=i+1;
		n,_,_,c,_,_,x,_,_,_,id=UnitAura("focus",i,"PLAYER HARMFUL"); 
		if n then
			buffcnt[n]=c
			buffexp[n]=x-t
			buff[n]=id;
			found=true
		end
	until (not n) or (i==40);
	if found then
		found=false
		if buff[sap] then
			found=true
		end
	end
end
local spellname=GetSpellInfo(6770)  --[[ Sap ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) then
	if IsStealthed() and not found then
		result=true
	end
end;
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Sap</SpellName>
      <Priority>28</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <OncePerTarget>true</OncePerTarget>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Sap. Happy dreaming.</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>KnowSpell</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Pick Pocket</Name>
            <Need>true</Need>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(921)  --[[ Pick Pocket ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) then
	if IsStealthed() then
		result=true
	end
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Pick Pocket</SpellName>
      <Priority>27</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <OncePerTarget>true</OncePerTarget>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>in Stealth. </DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(36554)  --[[ Shadowstep ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	local ssname=""
	if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
		ssname=GetSpellInfo(185438)  --[[ Shadowstrike ]]
	else
		ssname=GetSpellInfo(53)  --[[ Backstab ]]
	end
	result=(IsSpellInRange(ssname,"target")==1)
	if result then
		StartAttack("target")
		CastSpellByName(ssname,"target")
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Aggressive</SpellName>
      <Priority>26</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <OncePerTarget>true</OncePerTarget>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>2</Number>
            <Type>BiggerOrEqual</Type>
            <Radius>10</Radius>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Blind</SpellName>
      <Priority>25</Priority>
      <AddToSettings>true</AddToSettings>
      <DescriptionSpell>Prefere --Kick! Used only to stun. Will not work on a lot of enemys</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(1833)  --[[ Cheap Shot ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and UnitIsPlayer("target") then
	--[[ Stealth, Shadow Dance or Subterfuge ]]
	if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
		result=true
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Cheap Shot</SpellName>
      <Priority>24</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>PVP only. Stun it, whenever you can</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") and (UnitHealth("target")&gt;1) then
	if IsInArenaTeam("player") then
		TargetNearestEnemy()
		FocusUnit("target")
		TargetLastTarget()
	end
end
	
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--autofocus </SpellName>
      <Priority>23</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <OncePerTarget>true</OncePerTarget>
      <DescriptionSpell>Arena only</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(1833)  --[[ Cheap Shot ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) then
	--[[ Stealth, Shadow Dance or Subterfuge ]]
	if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
		result=true
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsBoss</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsElite</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsWorldBoss</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Cheap Shot</SpellName>
      <Priority>22</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>PVE only. Stun it, whenever you can</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(408)  --[[ Kidney Shot ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and UnitIsPlayer("target") then
	result=true
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>BiggerOrEqual</Type>
            <Value>5</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Kidney Shot</SpellName>
      <Priority>21</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>PVP only. Stun it, whenever you can</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(408)  --[[ Kidney Shot ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) then
	result=true
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>BiggerOrEqual</Type>
            <Value>5</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsElite</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsBoss</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsWorldBoss</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Kidney Shot</SpellName>
      <Priority>20</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>PVE only. Stun it, whenever you can</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local ShadowsOfCloak=select(1,GetSpellInfo(155722))
if UnitExists("target") and not UnitIsFriend("player", "target") then
	local t=GetTime();
	local buffexp,buff,buffcnt,bufftyp={},{},{},{};
	local i,n,c,y,x,id,found=0;
	repeat 
		i=i+1;
		n,_,_,c,y,_,x,_,_,_,id=UnitAura("PLAYER",i,"HARMFUL"); 
		if n then
			buffcnt[n]=c
			bufftyp[n]=y
			buffexp[n]=x-t
			buff[n]=id;
			found=true
		end
	until (not n) or (i==40);
	if found then
		local x=""
		for n in pairs(bufftyp) do
			if bufftyp[n]=="Curse" or bufftyp[n]=="Magic" then
				result=true
				x=x..n.." "
			end
		end
		if x~="" then
			print(x.."removed")
		end
	end
end

			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Cloak of Shadows</SpellName>
      <Priority>19</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CastOnSelf>true</CastOnSelf>
      <CastOn>player</CastOn>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>MeInGroup</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>HealthPercent</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Smaller</Type>
            <Value>40</Value>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Crimson Vial</SpellName>
      <Priority>18</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Heal in Group at 40%</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HealthPercent</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Smaller</Type>
            <Value>70</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeInGroup</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Crimson Vial</SpellName>
      <Priority>17</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Heal Solo at 70%</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetTargetingMe</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") then
	if not IsStealthed() then
		local EvasionNeeded="worldboss,rareelite,elite,rare"
		local Mana=0;
		local healthPercent=(UnitHealth("player") / UnitHealthMax("player") * 100)
		result=(((UnitPowerType("target")~=Mana) and (healthPercent &lt; 50)) and ((EvasionNeeded:find(UnitClassification("target"))~=nil) or (UnitLevel("target")&gt;=UnitLevel("player")) or (UnitLevel("target")==-1)))  or (healthPercent &lt; 30)
	end;
end

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Evasion</SpellName>
      <Priority>16</Priority>
      <CastIfMounted>true</CastIfMounted>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local kicked=0
local target={"target","focus"}
for t in pairs(target) do 
	if UnitExists(target[t]) and not UnitIsFriend("player", target[t]) then 
		local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo(target[t]);
		if (spell==nil) then
			spell, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitChannelInfo(target[t]);
		end
		if (spell~=nil) then
			if (nonInterrupt==false) then 
		--[[					(cheapest first)
							   Kick,Blind,Gouge
		--]]	
				local idSpells={1766,2094,1776};		
				local now=GetTime();
				local guid=UnitGUID(target[t]);
				local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
				local dontKick={[82618]={171807};	--[[ Tor'goroth, skip Shadow Bolt to kick Consume Life ]]
								[82682]={166465};	--[[ Archmage Sol, skip Frost Bolt to kick Parasitic Growth ]]
									
		--[[ [86135]={172014,172024,172005};  test Ralshira  ]]

							};
				local ignoreKick=0;
				npcId=tonumber(npcId);
				if (dontKick[npcId]~=nil) then
					if (dontKick[npcId][1]~=nil) then
						for i=1, #dontKick[npcId] do
							if (spell==GetSpellInfo(dontKick[npcId][i])) then
								ignoreKick=1
							end
						end
					end
				end
				for i=1+ignoreKick, #idSpells do
					if (kicked==0) then
						local spellname=GetSpellInfo(idSpells[i])
						local start, duration, enabled = GetSpellCooldown(spellname)
						if (duration==0) then
							if IsSpellInRange(spellname, target[t])==1 then
								CastSpellByName(spellname,target[t])
								kicked=idSpells[i]
						print(spell.." kicked by "..spellname.."("..target[t]..")") 
							end
						end
					end
				end
			else
				local idFeint=1966
				local spellname=GetSpellInfo(idFeint)
				local start, duration, enabled = GetSpellCooldown(spellname)
				if ((duration==0) and not UnitBuff("player",spellname)) then
					CastSpellByName(spellname,target[t])
					kicked=1;  --[[ only for log ]]
				end
			end
		end
	end
end
result=(kicked~=0)</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Kick Spells</SpellName>
      <Priority>15</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Kick &gt; Blind &gt; Gouge for interruptable spells</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") and (UnitHealth("target")&gt;1) and not UnitIsDead("target") then
	if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
		result=true
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>Buff</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Symbols of Death</Name>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Symbols of Death</SpellName>
      <Priority>14</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") then
	if ((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; 100) or (UnitName("player")==UnitName("targettarget")) or (not UnitInParty("player")) then
		if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
			local ssname=GetSpellInfo(185438)  --[[ Shadowstrike ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=true
			end
		else
			local ssname=GetSpellInfo(53)  --[[ Backstab ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=true
			end
		end
	end
end
			
			
			
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadow Blades</SpellName>
      <Priority>13</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>BiggerOrEqual</Type>
            <Value>5</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetBuff</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Nightblade</Name>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsFacing</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(195452)  --[[ Nightblade ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	local ssname=GetSpellInfo(53)  --[[ Backstab ]]
	if IsSpellInRange(ssname,"target")==1 then
		result=true
	end
end

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Nightblade</SpellName>
      <Priority>12</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>MeInGroup</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Vanish</SpellName>
      <Priority>11</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(36554)  --[[ Shadowstep ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	local currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(185313)
	local now=GetTime();
	if (currentCharges&gt;=1) or ((UnitBuff("player",GetSpellInfo(31223))~=nil) and (currentCharges~=0)) then
		result=true
		--[[ Stealth, Shadow Dance or Subterfuge ]]
		if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
			result=false
		end
	end
end
			
			
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadow Dance</SpellName>
      <Priority>10</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Talent: Master of Subtlety mandatory  !!!</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>BiggerOrEqual</Type>
            <Value>5</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsFacing</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(196819)  --[[ Eviscerate ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	local ssname=GetSpellInfo(53)  --[[ Backstab ]]
	if IsSpellInRange(ssname,"target")==1 then
		result=true
	end
end

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Eviscerate</SpellName>
      <Priority>9</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>2</Number>
            <Type>BiggerOrEqual</Type>
            <Radius>10</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
result=true
if UnitExists("focus") and not UnitIsFriend("player", "focus") then
	local t=GetTime();
	local buffexp,buff,buffcnt={},{},{};
	local i,n,c,x,id,found=0;
	repeat 
		i=i+1;
		n,_,_,c,_,_,x,_,_,_,id=UnitAura("focus",i,"PLAYER HARMFUL"); 
		if n then
			buffcnt[n]=c
			buffexp[n]=x-t
			buff[n]=id;
			found=true
		end
	until (not n) or (i==40);
	if found then
		local sap=select(1,GetSpellInfo(6770))
		local blind=select(1,GetSpellInfo(2094))
		if (buff[sap] or buff[blind]) and (IsSpellInRange(sap, "focus")==1) then
			result=false
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shuriken Storm</SpellName>
      <Priority>8</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(185438)  --[[ Shadowstrike ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
		result=((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; 100) or (UnitName("player")==UnitName("targettarget")) or (not UnitInParty("player"))
	end
end
			
			
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadowstrike</SpellName>
      <Priority>7</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(209782)  --[[ Goremaw's Bite ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	result=true
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Goremaw's Bite</SpellName>
      <Priority>6</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>IsFacing</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(53)  --[[ Backstab ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	if ((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; 100) or (UnitName("player")==UnitName("targettarget")) or (not UnitInParty("player")) then
		if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
			result=false
		else
			result=true
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Backstab</SpellName>
      <Priority>4</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(36554)  --[[ Shadowstep ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	if ((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; 100) or (UnitName("player")==UnitName("targettarget")) or (not UnitInParty("player")) then
		result=true
		if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
			local ssname=GetSpellInfo(185438)  --[[ Shadowstrike ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=false
			end
		else
			local ssname=GetSpellInfo(53)  --[[ Backstab ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=false
			end
		end
	end
end</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadowstep</SpellName>
      <Priority>3</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local spellname=GetSpellInfo(36554)  --[[ Shadowstep ]]
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname,"target")==1) and (UnitHealth("target")&gt;1) then
	if ((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; 100) or (UnitName("player")==UnitName("targettarget")) or (not UnitInParty("player")) then
		result=true
		if IsStealthed() or (UnitBuff("player",GetSpellInfo(185313))~=nil) or (UnitBuff("player",GetSpellInfo(108208))~=nil) then
			local ssname=GetSpellInfo(185438)  --[[ Shadowstrike ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=false
			end
		else
			local ssname=GetSpellInfo(53)  --[[ Backstab ]]
			if IsSpellInRange(ssname,"target")==1 then
				result=false
			end
		end
	end
end
			
			
			

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shuriken Toss</SpellName>
      <Priority>2</Priority>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local function UseContainerItemByIDList(search)   --[[ needed below ]]
  local found=nil;
  for bag = 0,4 do
    for slot = 1,GetContainerNumSlots(bag) do
      local itemLink = GetContainerItemLink(bag,slot)
	  if itemLink then
	    local _, _, Color, Ltype, Id, Enchant, Gem1, Gem2, Gem3, Gem4, Suffix, Unique, LinkLvl, Name = string.find(itemLink,"|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*):?(%-?%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")	  
      	if Id then
		  search=','..search..',';
		  if (search:find(","..Id..",")) then 
			if (GetContainerItemCooldown(bag,slot)==0) then
				UseContainerItem(bag,slot)
				found=1;
			end
		  end;
		end
      end
    end
  end
  return found;
end


if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsFlying())  and not (IsFalling())  and not (UnitIsAFK("player")) then
	if not IsStealthed() then 
		--[[ Add your Mob-IDs to the list ]]
		local archlist="114141,114143,114145,114147,114149,114151,114153,114155,114157,114159,114161,114163,114165,114167,114169,114171,114173,114175,114177,114179,114181,114183,114185,114187,114189,114190,114191,114192,114193,114194,114195,114196,114197,114198,114199,114200,114201,114202,114203,114204,114205,114206,114207,79896,79897,79898,79899,79900,79901,79902,79903,79904,79905,79908,79909,79910,79911,79912,79913,79914,79915,79916,79917,95375,95376,95377,95378,95379,95380,95381,95382"
		local fishlist="112633,141975,139656,139657,139655,133715,139661,133716,139662,133713,133714,139663,133710,139658,133712,139660,133711,139659"
		local artefact="140310,138783,138885,142054,141934,138781,138782,141023,141690" --[[  ]]
		if (UseContainerItemByIDList(archlist..","..fishlist..","..artefact)) then			--[[ do not use boxes/bags and similar ]]
		   result=true;
		end
	end;
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Use Item, if exist</SpellName>
      <Priority>1</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>No</CanMoveDuringCast>
      <DescriptionSpell>Useful for Archaelogy (MoP, WoD)</DescriptionSpell>
    </FightClassSpell>
  </FightClassSpells>
</FightClass>