Skip to content
This repository has been archived by the owner on Oct 14, 2021. It is now read-only.

Commit

Permalink
- Cleanup on the item level tracker.
Browse files Browse the repository at this point in the history
- Revamp on the Avoidance tab.
- Increased the font size of the bookmark window.
- Added Hunter's Intimidation as crowd control.
- More update on the RaidCheck plugin.
  • Loading branch information
Tercio authored and Tercio committed Aug 25, 2018
1 parent b5c6465 commit 5733096
Show file tree
Hide file tree
Showing 11 changed files with 418 additions and 548 deletions.
2 changes: 1 addition & 1 deletion Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

local dversion = 99
local dversion = 100
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)

Expand Down
1 change: 1 addition & 0 deletions Libs/DF/spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ DF.CrowdControlSpells = {
[19577] = "HUNTER", --Intimidation
[190927] = "HUNTER", --Harpoon
[162480] = "HUNTER", --Steel Trap
[24394] = "HUNTER", --Intimidation

[119381] = "MONK", --Leg Sweep
[115078] = "MONK", --Paralysis
Expand Down
13 changes: 5 additions & 8 deletions boot.lua

Large diffs are not rendered by default.

79 changes: 4 additions & 75 deletions core/gears.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ local floor = floor

local GetNumGroupMembers = GetNumGroupMembers
local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0")
--local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1")
local LibGroupInSpecT = false
local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1")
--local LibGroupInSpecT = false

local storageDebug = false
local store_instances = _detalhes.InstancesToStoreData
Expand Down Expand Up @@ -1679,31 +1679,6 @@ local MAX_INSPECT_AMOUNT = 1
local MIN_ILEVEL_TO_STORE = 50
local LOOP_TIME = 7

--if the item is an artifact off-hand, get the item level of the main hand
local artifact_offhands = {
["133959"] = true, --mage fire
["128293"] = true, --dk frost
["127830"] = true, --dh havoc
["128831"] = true, --dh vengeance
["128859"] = true, --druid feral
["128822"] = true, --druid guardian
["133948"] = true, --monk ww
["133958"] = true, --priest shadow
["128869"] = true, --rogue assassination
["134552"] = true, --rogue outlaw
["128479"] = true, --rogue subtlety
["128936"] = true, --shaman elemental
["128873"] = true, --shaman en
["128934"] = true, --shaman resto
}

--if the artifact has its main piece as the offhand, when scaning the main hand get the ilevel of the off-hand.
local offhand_ismain = {
["137246"] = true, --warlock demo / spine of thalkiel
["128288"] = true, --warrior prot / scaleshard
["128867"] = true, --paladin prot / oathseeker
}

function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel, talentsSelected, currentSpec)
if (_detalhes.debug) then
local talents = "Invalid Talents"
Expand Down Expand Up @@ -1754,6 +1729,7 @@ end
--> test
--/run _detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true)
--/run wipe (_detalhes.item_level_pool)

function ilvl_core:CalcItemLevel (unitid, guid, shout)

if (type (unitid) == "table") then
Expand All @@ -1770,64 +1746,17 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
local failed = 0

for equip_id = 1, 17 do

if (equip_id ~= 4) then --shirt slot
local item = GetInventoryItemLink (unitid, equip_id)
if (item) then
local _, _, itemRarity, iLevel, _, _, _, _, equipSlot = GetItemInfo (item)
if (iLevel) then

--local _, _, _, _, _, _, _, _, _, _, _, upgradeTypeID, _, numBonusIDs, bonusID1, bonusID2 = strsplit (":", item)
--> upgrades handle by LibItemUpgradeInfo-1.0
--> http://www.wowace.com/addons/libitemupgradeinfo-1-0/

if (equip_id == 16) then --main hand
local itemId = select (2, strsplit (":", item))
--print (itemId, offhand_ismain [itemId], UnitName (unitid))
--128867 nil Lithedora EmeraldDream
if (offhand_ismain [itemId]) then
local offHand = GetInventoryItemLink (unitid, 17)
if (offHand) then
local iName, _, itemRarity, offHandILevel, _, _, _, _, equipSlot = GetItemInfo (offHand)
if (offHandILevel) then
item = offHand
iLevel = offHandILevel
end
end
end

elseif (equip_id == 17) then --off-hand
local itemId = select (2, strsplit (":", item))
if (artifact_offhands [itemId]) then
local mainHand = GetInventoryItemLink (unitid, 16)
if (mainHand) then
local iName, _, itemRarity, mainHandILevel, _, _, _, _, equipSlot = GetItemInfo (mainHand)
if (iLevel) then
item = mainHand
iLevel = mainHandILevel
end
end
end
end

if (ItemUpgradeInfo) then
local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel (item)
item_level = item_level + (ilvl or iLevel)
else
item_level = item_level + iLevel
end

--> timewarped
--[[
if (upgradeTypeID == "512" and bonusID1 == "615") then
item_level = item_level + 660
if (bonusID2 == "656") then
item_level = item_level + 15
end
else
item_level = item_level + iLevel
end
--]]

--> 16 = main hand 17 = off hand
--> if using a two-hand, ignore the off hand slot
Expand All @@ -1851,7 +1780,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
--> register
if (average > 0) then
if (shout) then
_detalhes:Msg (name .. " item level: " .. average)
_detalhes:Msg (UnitName(unitid) .. " item level: " .. average)
end

if (average > MIN_ILEVEL_TO_STORE) then
Expand Down
3 changes: 3 additions & 0 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,9 @@ local default_profile = {
["aura"] = true,
["spellcast"] = true,
},

--> bookmark
bookmark_text_size = 11,

--> cloud capture
cloud_capture = true,
Expand Down
143 changes: 19 additions & 124 deletions functions/slash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -412,51 +412,6 @@ function SlashCmdList.DETAILS (msg, editbox)
print ("GetTime()", GetTime())
print ("time()", time())

elseif (msg == "buffs") then

for buffIndex = 1, 41 do

--local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("player", buffIndex, nil, "HELPFUL")
--if (name) then
-- print (name, unitCaster, spellid)
--end

local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("raid1", buffIndex, nil, "HELPFUL")
if (name) then
print (name, unitCaster, spellid)
end

local name, _, _, _, _, _, _, unitCaster, _, _, spellid = UnitAura ("raid2", buffIndex, nil, "HELPFUL")
if (name) then
print (name, unitCaster, spellid)
end

end


elseif (msg == "malkorok") then

print ("nome | count | unitCaster | spellId | isBossDebuff | value1 | value2 | value3")

do
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff ("player", 1)
if (name) then
print (name, " | ", count, " | ", unitCaster, " | ",spellId, " | ", isBossDebuff, " | ", value1, " | ", value2, " | ", value3)
end
end
do
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff ("player", 2)
if (name) then
print (name, " | ", count, " | ", unitCaster, " | ",spellId, " | ", isBossDebuff, " | ", value1, " | ", value2, " | ", value3)
end
end
do
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff ("player", 3)
if (name) then
print (name, " | ", count, " | ", unitCaster, " | ",spellId, " | ", isBossDebuff, " | ", value1, " | ", value2, " | ", value3)
end
end

elseif (msg == "copy") then
_G.DetailsCopy:Show()
_G.DetailsCopy.MyObject.text:HighlightText()
Expand Down Expand Up @@ -914,6 +869,15 @@ function SlashCmdList.DETAILS (msg, editbox)
print ("running... this is a debug command, details wont work until next /reload.")
_detalhes:PrepareTablesForSave()

elseif (msg == "buffs") then
for i = 1, 40 do
local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellid = UnitBuff ("player", i)
if (not name) then
return
end
print (spellid, name)
end

elseif (msg == "id") then
local one, two = rest:match("^(%S*)%s*(.-)$")
if (one ~= "") then
Expand Down Expand Up @@ -1185,7 +1149,7 @@ Damage Update Status: @INSTANCEDAMAGESTATUS
print ("total loot", total)
_detalhes_global.ALOOT = r

elseif (msg == "ilvl2") then
elseif (msg == "ilvl" or msg == "itemlevel" or msg == "ilevel") then

local item_amount = 16
local item_level = 0
Expand All @@ -1197,60 +1161,23 @@ Damage Update Status: @INSTANCEDAMAGESTATUS
["INVTYPE_RANGEDRIGHT"] = true,
}

local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0")

_detalhes:Msg ("======== Item Level Debug ========")

for equip_id = 1, 17 do

if (equip_id ~= 4) then --shirt slot
local item = GetInventoryItemLink (unitid, equip_id)
if (item) then
local iName, _, itemRarity, iLevel, _, _, _, _, equipSlot = GetItemInfo (item)
local _, _, itemRarity, iLevel, _, _, _, _, equipSlot = GetItemInfo (item)
if (iLevel) then

--local _, _, _, _, _, _, _, _, _, _, _, upgradeTypeID, _, numBonusIDs, bonusID1, bonusID2 = strsplit (":", item)
--> upgrades handle by LibItemUpgradeInfo-1.0
--> http://www.wowace.com/addons/libitemupgradeinfo-1-0/

local artifact_offhands = {
["133959"] = true, --mage fire
["128293"] = true, --dk frost
["127830"] = true, --dh havoc
["128831"] = true, --dh vengeance
["128859"] = true, --druid feral
["128822"] = true, --druid guardian
["133948"] = true, --monk ww
["128866"] = true, --paladin prot
["133958"] = true, --priest shadow
["128869"] = true, --rogue assassination
["134552"] = true, --rogue outlaw
["128479"] = true, --rogue subtlety
["128936"] = true, --shaman elemental
["128873"] = true, --shaman en
["128934"] = true, --shaman resto
["137246"] = true, --warlock demo
["128289"] = true, --warrior prot
}

if (equip_id == 17) then -- and false
local itemId = select (2, strsplit (":", item))
if (artifact_offhands [itemId]) then
local mainHand = GetInventoryItemLink (unitid, 16)
if (mainHand) then
local iName, _, itemRarity, mainHandILevel, _, _, _, _, equipSlot = GetItemInfo (mainHand)
if (iLevel) then
item = mainHand
iLevel = mainHandILevel
end
end
end
end

local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0")
if (ItemUpgradeInfo) then
local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel (item)
item_level = item_level + (ilvl or iLevel)
print (item, ilvl, iLevel)
print (ilvl, item)
else
item_level = item_level + iLevel
print (iName, iLevel, "-|cFFFF0000lib not found|r-")
print (iLevel, item)
end

--> 16 = main hand 17 = off hand
Expand All @@ -1270,41 +1197,9 @@ Damage Update Status: @INSTANCEDAMAGESTATUS
end

local average = item_level / item_amount
print ("gear score:", item_level, "item amount:", item_amount, "ilvl:", average)

elseif (msg == "ilvl") then

--
local ilvl_frame = CreateFrame ("GameTooltip", "details_ilvl_tooltip", UIParent, "GameTooltipTemplate");
local get_ilvl = function (itemLink)
ilvl_frame:SetOwner (UIParent, "ANCHOR_NONE")
ilvl_frame:ClearLines()
ilvl_frame:SetHyperlink (itemLink)

for i = 1, 13 do
local text = _G ["details_ilvl_tooltipTextLeft" .. i] and _G ["details_ilvl_tooltipTextLeft" .. i]:GetText()
if (text and text:find (ITEM_UPGRADE_STAT_AVERAGE_ITEM_LEVEL)) then
print ("ItemLevel:", text:gsub (ITEM_UPGRADE_STAT_AVERAGE_ITEM_LEVEL, ""))
break
end
end
end

local item = GetInventoryItemLink ("player", 14)
get_ilvl (item)
_detalhes:Msg ("gear score: " .. item_level, "| item amount:", item_amount, "| ilvl:", average)

print (item)
local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")
local SlotNames = "Trinket1"
local Slot = GetInventoryItemLink ("player", GetInventorySlotInfo (("%sSlot"):format (SlotNames)))
print (Slot)
--local upgrade, max, delta = ItemUpgradeInfo:GetItemUpgradeInfo (item)
local upgrade, max, delta = ItemUpgradeInfo:GetItemUpgradeInfo (item)
local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel (item)

print (ilvl, upgrade, max, delta)

print (GetItemInfo (item))
_detalhes.ilevel:CalcItemLevel ("player", UnitGUID("player"), true)

elseif (msg == "score") then

Expand Down
Loading

0 comments on commit 5733096

Please sign in to comment.