September 16, 20169 yr local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 then CastSpellByName(SpellName, UnitIdString) return end end end hi how can i use this code in fight class or party command plug in Thanks
September 16, 20169 yr Hello, put this code instead of spell name, and use option spell option 'Not spell, is lua...': local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 and IsSpellInRange(SpellName,UnitIdString) then CastSpellByName(SpellName, UnitIdString) return end end end (I have added IsSpellInRange) And add "lua script" condition: Lua script: needToCast=false; local SpellName = GetSpellInfo(109259) for i = 1, 4, 1 do local UnitIdString = "party" .. i .. "target" if UnitExists(UnitIdString) then if GetRaidTargetIndex(UnitIdString) == 8 and IsSpellInRange(SpellName,UnitIdString) then needToCast=true; return end end end Return value research: true Return value var: needToCast To use this code in party chat command just use "Action command type" > "Lua" with the first code of this post. of course, replace 109259 by your spell in in all codes.
July 4, 20178 yr Does not work for me either. Can anyone confirm this is working? I tried several spell IDs and raid target indexes. TBC Private Bot.
Create an account or sign in to comment