blacklist[mh_mask] = true |
|
if mh_equipped then |
-- Try to equip each off-hand weapon to compliment this one |
for oh_mask,item in pairs(slotAvail[offslot]) do |
local oh_equipped = DressToKill:EquipItem(offslot, oh_mask, oh_stash) |
local mh_link = GetInventoryItemLink("player", mainslot) |
local mh_score = weightFunction(mh_link, mainslot) - weapon_base |
local score = mh_score |
|
local mh_link = GetInventoryItemLink("player", mainslot) |
local mh_score = weightFunction(mh_link, mainslot) - weapon_base |
local score = mh_score |
if not IsEquippedItemType("Two-Hand") then |
-- Try to equip each off-hand weapon to compliment this one |
for oh_mask,item in pairs(slotAvail[offslot]) do |
local oh_equipped = DressToKill:EquipItem(offslot, oh_mask, oh_stash) |
|
-- If we equipped offhand, then score it too |
if oh_equipped then |
local oh_link = GetInventoryItemLink("player", offslot) or linen_shirt |
local oh_score = weightFunction(oh_link, offslot) - weapon_base |
score = mh_score + oh_score |
-- If we equipped offhand, then score it too |
if oh_equipped then |
local oh_link = GetInventoryItemLink("player", offslot) or linen_shirt |
local oh_score = weightFunction(oh_link, offslot) - weapon_base |
score = score + oh_score |
end |
|
debug("Got score of %s for %s and %s", score, mh_link, oh_link or "empty") |
if score >= weapon_max then |
weapon_max = score |
weapon_win.mh = mh_mask |
weapon_win.oh = oh_equipped and oh_mask or nil |
end |
|
-- Unequip the offhand item |
if oh_equipped then |
DressToKill:UnequipItem(offslot, oh_mask, oh_stash) |
end |
end |
|
debug("Got score of %s for %s and %s", score, mh_link, oh_link or "empty") |
else |
debug("Got score of %s for %s", score, mh_link) |
if score >= weapon_max then |
weapon_max = score |
weapon_win.mh = mh_mask |
weapon_win.oh = oh_equipped and oh_mask or nil |
weapon_win.oh = nil |
end |
|
-- Unequip the offhand item |
if oh_equipped then |
DressToKill:UnequipItem(offslot, oh_mask, oh_stash) |
end |
end |
|
-- Unequip this mainhand item |