﻿<?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>Combat Rogue V2/AoE</FightClassName>
    <FramePerSecond>30</FramePerSecond>
  </FightClassGeneralSettings>
  <FightClassSpells>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") and (GetComboPoints("player")==0) then 
	local spell="nothing"
	local goodMountBuff={164222,165803}
	local goodMount=false
	for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
	if (not IsMounted()) or goodMount then
		if (spell=="nothing") then
			local idMarkDeath=137619
			local idShadowBlades=121471
			local SBname=GetSpellInfo(idShadowBlades)
			local MDname=GetSpellInfo(idMarkDeath)

			--[[ Marked for Death ready ?]]
			local start, duration, enabled = GetSpellCooldown(MDname)
			if (duration==0) and not (SBname==UnitBuff("player",SBname)) then
				local usable,noCP=IsUsableSpell(MDname)
				if (IsSpellInRange(MDname, "target")==1) and (usable) then
					spell=MDname
				end
			end
		end
		if not (spell=="nothing") then 
			CastSpellByName(spell)
	--[[		print ("CP: "..spell) ]]
			result=true
		end
	end
end;	
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--ComboPoints instant</SpellName>
      <Priority>32</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local kicked=0
if UnitExists("target") and not UnitIsFriend("player", "target") then 
	local goodMountBuff={164222,165803}
	local goodMount=false
	for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
	if (not IsMounted()) or goodMount then
		local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target");
		if (spell==nil) then
			spell, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitChannelInfo("target");
		end
		if (spell~=nil) then
			if (nonInterrupt==false) then 
		--[[					(cheapest first)
							   Kick,Blind,Gouge, Kidney Shot
		--]]	
				local idSpells={1766,2094,1776,408};		
				local now=GetTime();
				local guid=UnitGUID("target");
				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")==1) then
								CastSpellByName(spellname)
								kicked=idSpells[i]
						print(spell.." kicked by "..spellname) 
							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)
					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>31</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Kick &gt; Gouge &gt; Kidney Shot for interruptable spells</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetBuff</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Enrage</Name>
            <Need>true</Need>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shiv</SpellName>
      <Priority>30</Priority>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript> 
if UnitExists("target") and not UnitIsDead("target") and not UnitIsFriend("player", "target") then 
	local goodMountBuff={164222,165803}
	local goodMount=false
	for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
	if (not IsMounted()) or goodMount then
	    if not(IsStealthed()) then
			local idSinisterStrike=1752
			local ssname=GetSpellInfo(idSinisterStrike)
			result=(IsSpellInRange(ssname,"target")==1)
			if result then
				RunMacroText("/startattack")
			end
		end
	end
end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--startattack</SpellName>
      <Priority>29</Priority>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <OncePerTarget>true</OncePerTarget>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Important on every new target</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>4</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>5</Number>
            <Type>Bigger</Type>
            <Radius>8</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
  --[[ Dont AOE if Target is Flagged ]]
	if (GetRaidTargetIndex("target")~=nil) then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=not(IsStealthed())
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Crimson Tempest</SpellName>
      <Priority>28</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>AoE. Used on 4 or more hostile.</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") and not UnitIsFriend("player", "target") and not (UnitIsDead("target")) then 
	local buffed=0
	local goodMountBuff={164222,165803}
	local goodMount=false
	for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
	if (not IsMounted()) or goodMount then
		comboPoints = GetComboPoints("player", "target")
		if (comboPoints &gt; 0) then
	--[[				Adrenalin,Combat Readiness,Shadow Blades,Berserking,lifeblood,Blood Flurry ]]
			local idBuffs={13750,74001,121471,26297,121279,20572}
			local idStealth=1784
			local stname=GetSpellInfo(idStealth)
			local idSinisterStrike=1752
			local ssname=GetSpellInfo(idSinisterStrike)
			local start, duration, enabled = GetSpellCooldown(stname)
	--[[ If not stealth and we are in Melee-range (testing with Sinister Strike) ]]		
			if (enabled==1) and (IsSpellInRange(ssname,"target")==1) then
				for i=1, #idBuffs do
					if (IsPlayerSpell(idBuffs[i])) then
						local spellname=GetSpellInfo(idBuffs[i])
						local start, duration, enabled = GetSpellCooldown(spellname)
						if (duration==0) then
							CastSpellByName(spellname)
					--[[	print("buff: "..spellname) ]]
							buffed=buffed+1
						end
					end
				end
				
			end
		end
	end
	result=(buffed&gt;0)
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Buffs</SpellName>
      <Priority>27</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Set all known buffs</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>4</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
	local goodMountBuff={164222,165803}
	local goodMount=false
	for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
	if (not IsMounted()) or goodMount then
		local chkValue=true  --[[1784=Stealth,73651=Recuperate]]
		local chkBuffs={1784,false,73651,false}; 	for n=1,#chkBuffs,2 do chkValue=chkValue and ((UnitBuff("player",GetSpellInfo(chkBuffs[n]))~=nil)==chkBuffs[n+1]); end
		result=chkValue and ((UnitHealth("player") / UnitHealthMax("player") * 100) &lt; 75)
	end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Recuperate</SpellName>
      <Priority>26</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Heal. Trust your Healer. Use it only solo.</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </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 goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount 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;
end

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Evasion</SpellName>
      <Priority>25</Priority>
      <CastIfMounted>true</CastIfMounted>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local function UseContainerItemByName(search)   --[[ needed below ]]
  local found=nil;
  for bag = 0,4 do
    for slot = 1,GetContainerNumSlots(bag) do
      local item = GetContainerItemLink(bag,slot)
      if (item and item:find(search)) then
		if (GetContainerItemCooldown(bag,slot)==0) then
			UseContainerItem(bag,slot)
			found=1;
		end
      end
    end
  end
  return found;
end

if UnitExists("target") and not UnitIsFriend("player", "target") then 
	if not IsStealthed() then 
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			local guid=UnitGUID("target");
			local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
			npcId=tonumber(npcId);

			--[[ Add your Mob-IDs to the list ]]
			local KillBeast="86932,87020,87021,86727,86730,86731"		--[[ list of ID's of Mobs to trap, comma seperated ]]
				
			local maxHealth=95;				--[[ start Trap at 95% of health for non-elite Mobs ]]
			if (UnitClassification("target") == "elite") then
				maxHealth=55				--[[ start Trap  at 55% of health if it is an Elite Mob ]]
			end
			if not (UnitIsPVP("target")) and ((UnitHealth("target") / UnitHealthMax("target") * 100) &lt; maxHealth ) and (string.find(','..KillBeast..',',','..npcId..',')) then
				if (UnitName("player")==UnitName("targettarget")) then   --[[ no Ninjaing, my Mob, my target, my trap ]]
					result=true
					if not (UseContainerItemByName(":115010:")) then			--[[ Level 3 Trap must be equiped and ready]]
						if not (UseContainerItemByName(":115009:")) then		--[[ Level 2 Trap .. ]]
							if not (UseContainerItemByName(":113991:")) then	--[[ Level 1 Trap .. ]]
								result=false
							end
						end
					end
				else						--[[ the fight is over, or another User fight to them ]]
					ClearTarget();
				end
			end
		end
	end;
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Iron Trap</SpellName>
      <Priority>24</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>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then 
	local idBladeFlurry=13877
	local spellname=GetSpellInfo(idBladeFlurry)
	if (UnitBuff("player",spellname)~=nil) then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=(GetRaidTargetIndex("target")~=nil)
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsSpellUsable</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Blade Flurry</Name>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Blade Flurry</SpellName>
      <Priority>23</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>AOE off, if target marked (raid)</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then 
	local idBladeFlurry=13877
	local spellname=GetSpellInfo(idBladeFlurry)
	if (UnitBuff("player",spellname)~=nil) then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=true
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>2</Number>
            <Type>Smaller</Type>
            <Radius>10</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsSpellUsable</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Blade Flurry</Name>
            <Need>true</Need>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Blade Flurry</SpellName>
      <Priority>22</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>AoE. Off, if only one Target,</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>1</Number>
            <Type>Bigger</Type>
            <Radius>10</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsSpellUsable</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Blade Flurry</Name>
            <Need>true</Need>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then 
	local idBladeFlurry=13877
	local spellname=GetSpellInfo(idBladeFlurry)
	if (UnitBuff("player",spellname)==nil) then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then

		--[[ Add your Mob-IDs to the list, if Blade should not be enabled ]]
		--[[ (sometimes mmorobot find hostile units, where no one where) ]]
			local ignoreNPC="77182,77692"		--[[ list of ID's of Mobs to ignore, comma seperated ]]

			local guid=UnitGUID("target");
			local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
			npcId=tonumber(npcId);
			if (npcId~=nil) then 
				if not (string.find(','..ignoreNPC..',',','..npcId..',')) then
					result=(GetRaidTargetIndex("target")==nil)
				end
			end
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Blade Flurry</SpellName>
      <Priority>21</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>AoE. On for 2-7 targets.</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		if IsStealthed() then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				result=true
			end
		end
	end
end;
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Sap</SpellName>
      <Priority>20</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <AddToSettings>true</AddToSettings>
      <OncePerTarget>true</OncePerTarget>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Sap. Happy dreaming.</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <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>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		if IsStealthed() then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				result=true
			end
		end
	end
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Pick Pocket</SpellName>
      <Priority>19</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <AddToSettings>true</AddToSettings>
      <OncePerTarget>true</OncePerTarget>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>in Stealth. if saped</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local spell="nothing"

if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not (UnitLevel("target")==-1) then 
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount 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 spellname then
						if UnitAura(unit,spellname) then return true end
					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)
			result=true
		end
	end
end;
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Stun</SpellName>
      <Priority>18</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>Stun it, whenever you can</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local goodMountBuff={164222,165803}
local goodMount=false
for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
if ((not IsMounted()) or goodMount) and not(IsStealthed()) then
	local chkValue=true  --[[1784=Stealth,73651=Recuperate,5171=Slice and Dice]]
	local chkBuffs={5171,false}; 	for n=1,#chkBuffs,2 do chkValue=chkValue and ((UnitBuff("player",GetSpellInfo(chkBuffs[n]))~=nil)==chkBuffs[n+1]); end
	if chkValue then
		local idSinisterStrike=1752
		local ssname=GetSpellInfo(idSinisterStrike)
		result=(IsSpellInRange(ssname,"target")==1)
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Slice and Dice</SpellName>
      <Priority>17</Priority>
      <CastIfMounted>true</CastIfMounted>
      <OncePerTarget>true</OncePerTarget>
      <DescriptionSpell>Combat. Important. For the first fast start</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>4</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local goodMountBuff={164222,165803}
local goodMount=false
for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
if (not IsMounted()) or goodMount then
	local chkValue=true  --[[1784=Stealth,73651=Recuperate,5171=Slice and Dice]]
	local chkBuffs={1784,false,5171,false}; 	for n=1,#chkBuffs,2 do chkValue=chkValue and ((UnitBuff("player",GetSpellInfo(chkBuffs[n]))~=nil)==chkBuffs[n+1]); end
	if chkValue then
		local idSinisterStrike=1752
		local ssname=GetSpellInfo(idSinisterStrike)
		result=(IsSpellInRange(ssname,"target")==1)
	end
end	
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Slice and Dice</SpellName>
      <Priority>16</Priority>
      <CastIfMounted>true</CastIfMounted>
      <DescriptionSpell>Combat. Important</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsDead("target") then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			local chkValue=true  --[[1784=Stealth,73651=Recuperate,5171=Slice and Dice]]
			local chkBuffs={1784,false,5171,true}; 	for n=1,#chkBuffs,2 do chkValue=chkValue and ((UnitBuff("player",GetSpellInfo(chkBuffs[n]))~=nil)==chkBuffs[n+1]); end
			result=chkValue
		end
	end
end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>4</Value>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Eviscerate</SpellName>
      <Priority>15</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Combat. Important</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetBuff</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Revealing Strike</Name>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=not(IsStealthed());
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Revealing Strike</SpellName>
      <Priority>14</Priority>
      <CastIfMounted>true</CastIfMounted>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Combat. Start the engines</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>ComboPoint</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeInMove</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			local chkValue=true  --[[1784=Stealth,73651=Recuperate,5171=Slice and Dice,13750=Adrenalin Rush]]
			local chkBuffs={1784,false,13750,false}; 	for n=1,#chkBuffs,2 do chkValue=chkValue and ((UnitBuff("player",GetSpellInfo(chkBuffs[n]))~=nil)==chkBuffs[n+1]); end
			result=chkValue
		end
	end
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Killing Spree</SpellName>
      <Priority>13</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <CanMoveDuringCast>No</CanMoveDuringCast>
      <DescriptionSpell>Combat. Important</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=not(IsStealthed())
		end
	end
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Sinister Strike</SpellName>
      <Priority>12</Priority>
      <CastIfMounted>true</CastIfMounted>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Combat. Important</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </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>
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			--[[ PvP or solo AND No Casting and Stealth off and ready ? ]]
			local idStealth=1784
			local start, duration, enabled = GetSpellCooldown(idStealth); 
			result=((UnitIsPVP("player") or (not UnitInParty("player"))) and (duration==0) and (enabled==1) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player"))) 
		end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeIsFlying</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>IsSpellUsable</ContionType>
          <Param xsi:type="FightClassConditionStringBool">
            <Name>Stealth</Name>
            <Need>true</Need>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Stealth</SpellName>
      <Priority>11</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Stealth. If hostile 30 Yards away. only pvp or solo</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>MeInMove</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local goodMountBuff={164222,165803}
local goodMount=false
for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
if (not IsMounted()) or goodMount then
			result=(UnitIsPVP("player") or (UnitInParty("player")==nil))
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>MeInCombat</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Sprint</SpellName>
      <Priority>10</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Target to far ? Never !</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetTargetingMe</ContionType>
          <Param xsi:type="FightClassConditionBool">
            <Value>true</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetDistance</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Smaller</Type>
            <Value>25</Value>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadowstep</SpellName>
      <Priority>9</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Someone targeting me. ME !</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>TargetDistance</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Smaller</Type>
            <Value>25</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetDistance</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>10</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		local guid=UnitGUID("target");
		local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
		npcId=tonumber(npcId);
		local dontStep={[55294]=1;};	--[[ Ultraxion ]]
		if (dontStep[npcId]==nil) then 
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				result=not(IsStealthed()) and (UnitIsPVP("player") or (UnitInParty("player")==nil))
			end
		end
	end
end;
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Shadowstep</SpellName>
      <Priority>8</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>Faster behind the target</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>local attack=0
if UnitExists("target") and not UnitIsFriend("player", "target") then
	if IsStealthed() then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount 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 guid=UnitGUID("target");
				local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
				npcId=tonumber(npcId);
				local dontStep={[55294]=1;};	--[[ Ultraxion ]]
				if (dontStep[npcId]==nil) then 
					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;
			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 spellname=GetSpellInfo(idSpells[i])
					local start, duration, enabled = GetSpellCooldown(spellname)
					if (duration==0) then
						if (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
			result=(attack~=0)
		end
	end
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetIsStunned</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Break Stealth</SpellName>
      <Priority>7</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>Break stealth with ambush, Cheap shot or Garrote</DescriptionSpell>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>MeIsFlying</ContionType>
          <Param xsi:type="FightClassConditionBool" />
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetDistance</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Smaller</Type>
            <Value>31</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>TargetDistance</ContionType>
          <Param xsi:type="FightClassConditionNumber">
            <Type>Bigger</Type>
            <Value>5</Value>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			result=true
		end
	end
end;
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>Throw</SpellName>
      <Priority>6</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <AddToSettings>true</AddToSettings>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <WaitDuringCasting>false</WaitDuringCasting>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		if not IsStealthed() then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				local slot="Trinket1Slot"
				local idSinisterStrike=1752
				local ssname=GetSpellInfo(idSinisterStrike)
				if (GetComboPoints("player") &gt; 0) and (IsSpellInRange(ssname,"target")==1) then
	--[[			RunMacroText("/use 14")  ]]
					local slotId, texture, checkRelic = GetInventorySlotInfo(slot)
					local itemId = GetInventoryItemID("player", slotId)
					local start, duration, enable = GetItemCooldown(itemId)
					if (duration==0) then
						UseInventoryItem( slotId );
	--[[ print("use "..slotId) ]]
						result=true
					end
				end
			end
		end
	end
end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--use 14 (second trinket)</SpellName>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>/use 14</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		if not IsStealthed() then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				local slot="Trinket0Slot"
				local idSinisterStrike=1752
				local ssname=GetSpellInfo(idSinisterStrike)
				if (GetComboPoints("player") &gt; 0) and (IsSpellInRange(ssname,"target")==1) then
	--[[			RunMacroText("/use 13")  ]]
					local slotId, texture, checkRelic = GetInventorySlotInfo(slot)
					local itemId = GetInventoryItemID("player", slotId)
					local start, duration, enable = GetItemCooldown(itemId)
					if (duration==0) then
						UseInventoryItem( slotId );
	--[[ print("use "..slotId)	]]
						result=true
					end
				end
			end
		end
	end
end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--use 13 (first trinket)</SpellName>
      <Priority>4</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>/use 13</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if UnitExists("target") then
	if not UnitIsFriend("player", "target") and not UnitIsDead("target") then
		if not IsStealthed() then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				local slot="HandsSlot"
				local idSinisterStrike=1752
				local ssname=GetSpellInfo(idSinisterStrike)
				if (GetComboPoints("player") &gt; 0) and (IsSpellInRange(ssname,"target")==1) then
	--[[			RunMacroText("/use 10")  ]]
					local slotId, texture, checkRelic = GetInventorySlotInfo(slot)
					local itemId = GetInventoryItemID("player", slotId)
					local start, duration, enable = GetItemCooldown(itemId)
					if (duration==0) then
						UseInventoryItem( slotId );
	--[[ print("use "..slotId)	]]
						result=true
					end
				end
			end
		end
	end
end
			</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--use 10 (Engineers Gloves)</SpellName>
      <Priority>3</Priority>
      <CombatOnly>false</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>Yes</CanMoveDuringCast>
      <DescriptionSpell>/use 10 (good Engineers only)</DescriptionSpell>
    </FightClassSpell>
    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
		local item = GetInventoryItemID("player",17)
		if (item~=nil) then
			local goodMountBuff={164222,165803}
			local goodMount=false
			for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
			if (not IsMounted()) or goodMount then
				if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsFlying())  and not (IsFalling())  and not (IsResting())  and not (UnitIsAFK("player")) then

					--[[ refresh the Poisons if there are less then 13 min left (to be sure that it dont runs out while a raid boss fight ]]
					local timeLeftToCastAgain = 13*60;
					local idPoisons={}
				--[[             instant,Deadly,Wound ]]
					idPoisons[1]={157584,2823,8679}
				--[[             Leeching,Crippling ]]
					idPoisons[2]={108211,3408}
					local now=GetTime();
					for i=1,#idPoisons do
						local spell="";
						local PoisonFound=0
						for j=1,#idPoisons[i] do
							spellname=GetSpellInfo(idPoisons[i][j])
							if (spellname~=nil) then			
								local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitBuff("player",spellname); 
								if (name==spellname) then
									local expireTimeLeft = expirationTime-now;
									PoisonFound=idPoisons[i][j]
									if (expireTimeLeft &lt; timeLeftToCastAgain) then
										if (IsUsableSpell(spellname)) then
											local start, duration, enable = GetSpellCooldown(spellname)
											if (duration==0) then 
												CastSpellByName(spellname);
												spell=spellname;
											end
										end
										
									end
									break;
								end
							else
								print(i..":"..j..":"..idPoisons[i][j].." without spellname");
							end
						end
						if (PoisonFound==0) then
							for j=1,#idPoisons[i] do
								local spellname=GetSpellInfo(idPoisons[i][j])
								if (IsUsableSpell(spellname)) then
									local start, duration, enable = GetSpellCooldown(spellname)
									if (duration==0) then 
										CastSpellByName(spellname);
										spell=spellname;
										break;
									end
								end
							end
						end 
						if not (spell=="") then
				--[[			print("Poison: "..spell) ]]
							result=true
							break;
						end
						
					end
				end
			end
		end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Poison Managment</SpellName>
      <Priority>2</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>No</CanMoveDuringCast>
      <DescriptionSpell>Poison Managment</DescriptionSpell>
    </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 
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount 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 archcrate="87533,87534,87535,87536,87537,87538,87539,87540,87541,117386,117387" ]]
			if (UseContainerItemByIDList(archlist)) then			--[[ do not use boxes/bags and similar ]]
			   result=true;
			end
		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>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>No</CanMoveDuringCast>
    </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 not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (IsFlying())  and not (IsFalling())  and not (UnitIsAFK("player")) then
	if not IsStealthed() then 
		local goodMountBuff={164222,165803}
		local goodMount=false
		for n=1,#goodMountBuff do goodMount=goodMount or (UnitBuff("player",GetSpellInfo(goodMountBuff[n]))~=nil); end
		if (not IsMounted()) or goodMount then
			--[[ Add your Mob-IDs to the list ]]
			local heallist="109223"
			if (UseContainerItemByIDList(heallist)) then			--[[ do not use boxes/bags and similar ]]
			   result=true;
			end
		end
	end;
end
</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--Use Item, if health low</SpellName>
      <Priority>1</Priority>
      <CombatOnly>True</CombatOnly>
      <CastIfMounted>true</CastIfMounted>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>No</CanMoveDuringCast>
    </FightClassSpell>
  </FightClassSpells>
</FightClass>