Jump to content

Recommended Posts

  1. It works fine in wrotation, but not in grinder, because the mobs mostly doesn't stand still in the trap (i.e. Talbuks)
  2. You need the barn in your Garrison
  3. It's optional and off by default
  4. You need to add the ID of the mobs you want to catch to the Variable KillBeast. (wowhead.com and the Development tools/Target Info will help)

 

This  code enable the Iron Trap in your Fightclass. Happy farming

    <FightClassSpell>
      <SpellName>--Iron Trap</SpellName>
      <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 not (IsStealthed()) and UnitExists("target") and not UnitIsFriend("player", "target") 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="87021,87020"		--[[ 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

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <Priority>99</Priority>
      <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
    </FightClassSpell>

Link to comment
https://wrobot.eu/forums/topic/2095-iron-trap-how-to-use-it/
Share on other sites

  • 1 year later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...