Skip to content

Commit

Permalink
Tweaked the Enemies in Range function to ignore mobs not in combat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vae2009 committed Dec 3, 2024
1 parent 10f1a39 commit 98eee63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion ConRO.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Title:-|cffFFFFFFConRO|r- Conflict Rotation Optimizer
## Notes: Rotation helper framework.
## Version: 11.0.6
## Version: 11.0.7
## Author: Vae
## Interface: 110005
## SavedVariables: ConROPreferences
Expand Down
32 changes: 16 additions & 16 deletions helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -445,71 +445,71 @@ function ConRO:Targets(spellID)
local target_in_range = false;
local number_in_range = 0;
if spellID == "Melee" then
if not UnitIsFriend("player", "target") and UnitExists("target") then
if UnitIsEnemy("player", "target") and UnitExists("target") then
if C_Item.IsItemInRange(37727, "target") then
target_in_range = true;
end
end

for i = 1, 15 do
if not UnitIsFriend("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and C_Item.IsItemInRange(37727, "nameplate"..i) == true and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitIsEnemy("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and C_Item.IsItemInRange(37727, "nameplate"..i) == true then
number_in_range = number_in_range + 1
end
end
end
elseif spellID == "10" then
if not UnitIsFriend("player", "target") and UnitExists("target") then
if UnitIsEnemy("player", "target") and UnitExists("target") then
if C_Item.IsItemInRange(32321, "target") then
target_in_range = true;
end
end

for i = 1, 15 do
if not UnitIsFriend("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and C_Item.IsItemInRange(32321, "nameplate"..i) == true and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitIsEnemy("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and C_Item.IsItemInRange(32321, "nameplate"..i) == true then
number_in_range = number_in_range + 1
end
end
end
elseif spellID == "15" then
if not UnitIsFriend("player", "target") and UnitExists("target") then
if UnitIsEnemy("player", "target") and UnitExists("target") then
if C_Item.IsItemInRange(33069, "target") then
target_in_range = true;
end
end

for i = 1, 15 do
if not UnitIsFriend("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and C_Item.IsItemInRange(33069, "nameplate"..i) == true and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitIsEnemy("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and C_Item.IsItemInRange(33069, "nameplate"..i) == true then
number_in_range = number_in_range + 1
end
end
end
elseif spellID == "25" then
if not UnitIsFriend("player", "target") and UnitExists("target") then
if UnitIsEnemy("player", "target") and UnitExists("target") then
if C_Item.IsItemInRange(24268, "target") then
target_in_range = true;
end
end

for i = 1, 15 do
if not UnitIsFriend("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and C_Item.IsItemInRange(24268, "nameplate"..i) == true and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitIsEnemy("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and C_Item.IsItemInRange(24268, "nameplate"..i) == true then
number_in_range = number_in_range + 1
end
end
end
elseif spellID == "40" then
if not UnitIsFriend("player", "target") and UnitExists("target") then
if UnitIsEnemy("player", "target") and UnitExists("target") then
if C_Item.IsItemInRange(28767, "target") then
target_in_range = true;
end
end

for i = 1, 15 do
if not UnitIsFriend("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and C_Item.IsItemInRange(28767, "nameplate"..i) == true and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitIsEnemy("player", 'nameplate' .. i) then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and C_Item.IsItemInRange(28767, "nameplate"..i) == true then
number_in_range = number_in_range + 1
end
end
Expand All @@ -520,7 +520,7 @@ function ConRO:Targets(spellID)
end

for i = 1, 15 do
if UnitExists('nameplate' .. i) and ConRO:IsSpellInRange(spellID, 'nameplate' .. i) and UnitName('nameplate' .. i) ~= "Explosive" and UnitName('nameplate' .. i) ~= "Incorporeal Being" then
if UnitExists('nameplate' .. i) and UnitAffectingCombat('nameplate' .. i) and ConRO:IsSpellInRange(spellID, 'nameplate' .. i) then
number_in_range = number_in_range + 1
end
end
Expand Down

0 comments on commit 98eee63

Please sign in to comment.