Jump to content

Put DoTs on multiple target


Jhin

Recommended Posts

Hello, I want to create a small fightclass for BDruid pvp, but I don't know how to dot everyone in a 45y radius with Moonfire and Sunfire :/ any help please ? :) ps I am very beginner in lua programming.

Link to comment
Share on other sites

  • 2 weeks later...

I've add a routine in my Rogue Assa Profile. But be aware, you will lose your main target. And @Jhin : You dont want pull all Targets in a range of 45 yard ! Thats a hunter spell and is called barrage. ;-)

2. Line:  check if we have a target and if it is in range (in this case a Meele spell, Rupture). Use your spell with the smallest range, that you want provide

3+4 Line: Other Buffs that we want check

6.Line (from the bottom): Check if the DeBuffs are on the target up and running and if they are run long enough. In this case rupture must run longer then 6 seconds

5.Line (from the bottom); next target will be selected

In the next Code window  i've pasted the XML-Snippet to cut-and-past-and-change it in you fightclass

local Rupture=GetSpellInfo(1943)
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(Rupture,"target")==1) then
	local CripplingPoison=GetSpellInfo(3408)
	local DeadlyPoison=GetSpellInfo(2823)
	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("target",i,"PLAYER 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
		if (buff[Rupture] and buffexp[Rupture] > 6) and buff[CripplingPoison] and buff[DeadlyPoison] then 
			TargetNearestEnemy() 
			result=true
		end
	end
end;

XML-snippet: (dont forget to change the value in "HostileUnitNear")

    <FightClassSpell>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>HostileUnitNear</ContionType>
          <Param xsi:type="FightClassConditionUnitNear">
            <Number>2</Number>
            <Type>BiggerOrEqual</Type>
            <Radius>5</Radius>
          </Param>
        </FightClassCondition>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
local Rupture=GetSpellInfo(1943)
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(Rupture,"target")==1) then
	local CripplingPoison=GetSpellInfo(3408)
	local DeadlyPoison=GetSpellInfo(2823)
	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("target",i,"PLAYER 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
		if (buff[Rupture] and buffexp[Rupture] &gt; 6) and buff[CripplingPoison] and buff[DeadlyPoison] then 
			TargetNearestEnemy() 
			result=true
		end
	end
end;
			
            </LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <SpellName>--NextEnemy</SpellName>
      <Priority>2</Priority>
      <CheckIfKnow>false</CheckIfKnow>
      <CheckIfSpellUsable>false</CheckIfSpellUsable>
      <CheckSpellDistance>false</CheckSpellDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettings>true</AddToSettings>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
    </FightClassSpell>

 

Link to comment
Share on other sites

  • 1 year 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...