Skip to content

Commit

Permalink
Updated new aura count function.
Browse files Browse the repository at this point in the history
Fixed talent rank scan issue.
  • Loading branch information
Vae2009 committed Mar 13, 2023
1 parent 40698c6 commit ba4a72d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 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: 10.0.30
## Version: 10.0.31
## Author: Vae
## Interface: 100005
## SavedVariables: ConROPreferences
Expand Down
27 changes: 19 additions & 8 deletions helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function ConRO:CheckTalents()

tinsert(self.PlayerTalents[entryId], {
id = entryId,
["talentName"] = name,
["rank"] = node.ranksPurchased,
talentName = name,
rank = node.currentRank,
})
end
end
Expand Down Expand Up @@ -120,8 +120,20 @@ function ConRO:CheckPvPTalents()
end

function ConRO:TalentChosen(entryCheck, rankCheck)
if rankCheck ~= nil and self.PlayerTalents.entryCheck[rank] >= rankCheck then
return true;
if rankCheck ~= nil then
local talent = self.PlayerTalents[entryCheck];
if talent then
for _,i in pairs(talent) do
for k,v in pairs(i) do
if k == "rank" then
if v >= rankCheck then
return true;
end
end
end
return false;
end
end
else
return self.PlayerTalents[entryCheck];
end
Expand Down Expand Up @@ -511,22 +523,21 @@ end

function ConRO:AnyTargetAura(spellID)
local haveBuff = false;
local count = 0;
for i = 1, 15 do
if UnitExists('nameplate' .. i) then
for x=1, 40 do
local spell = select(10, UnitAura('nameplate' .. i, x, 'PLAYER|HARMFUL'));
if spell == spellID then
haveBuff = true;
count = count + 1;
break;
end
end
if haveBuff then
break;
end
end
end

return haveBuff;
return haveBuff, count;
end

function ConRO:Purgable()
Expand Down

0 comments on commit ba4a72d

Please sign in to comment.