LibProcessable

14.8k Downloads

PickLock by Mechagnomes

ipzaur opened this issue ยท 4 comments

commented

Hi! Can you add picklock for mechagnomes?

For myself I did it like this:

  1. Added check for race to function "isOpenable" (line 135) in lib-file "\Molinari\libs\LibProcessable\LibProcessable.lua"
function lib:IsOpenable(itemID)
    if(type(itemID) == 'string') then
        assert(string.match(itemID, 'item:(%d+):') or tonumber(itemID), 'item must be an item ID or item Link')
        itemID = (tonumber(itemID)) or (GetItemInfoFromHyperlink(itemID))
    end

    if(IsSpellKnown(1804)) then -- Pick Lock, Rogue ability
        local pickLevel = lib.containers[itemID]
        return pickLevel and pickLevel <= (UnitLevel('player') * 5), 1804
    else
        local raceID = select(3, UnitRace("player"))
        if(raceID == 37) then -- Mechagnome race
            local pickLevel = lib.containers[itemID]
            return pickLevel and pickLevel <= (UnitLevel('player') * 5), 312890
        end
    end
end
  1. Change some block (line 120) in hook script "OnTooltipSetItem" in main file "\Molinari\Molinari.lua"
...
    local isMillable, isMortar = LibProcessable:IsMillable(itemID)
    local canPicklock, picklockSkillID = LibProcessable:IsOpenable(itemID)
    if(isMillable and GetItemCount(itemID) >= 5) then
        Molinari:Apply(itemLink, isMortar and 114942 or 51005, 1/2, 1, 1/2, isMortar)
    elseif(LibProcessable:IsProspectable(itemID) and GetItemCount(itemID) >= 5) then
        Molinari:Apply(itemLink, 31252, 1, 1/3, 1/3)
    elseif(LibProcessable:IsDisenchantable(itemLink)) then
        Molinari:Apply(itemLink, 13262, 1/2, 1/2, 1)
    elseif(canPicklock) then
        Molinari:Apply(itemLink, picklockSkillID, 0, 1, 1)
    else
        local isOpenable, keyItemID = LibProcessable:IsOpenableProfession(itemID)
        if(isOpenable) then
            Molinari:Apply(itemLink, keyItemID, 0, 1, 1, true)
        end
    end
...
commented

Funny you should mention this, I came across this spell just yesterday!

commented

Fixed in LibProcessable by: c931eaf
Fixed in Molinari by: p3lim-wow/Molinari@bcbf116

Please test if you can and I'll release asap.

commented

Ok. Thx. I'll try when loot any crate :)

commented

Yes. It's work! Thank you :)