Re: Охотник на Демонов
Добавлено: 12 авг 2019, 16:01
Люди добрые! очень прошу, поделитесь пожалуйста сборочкой на танка в БФА
Код: Выделить всё
function CheckUseItem(itemId)
local status = false;
local count = GetItemCount(itemId);
if (count or 0) > 0 then
local start,duration,enable = GetItemCooldown(itemId);
if start == 0 and duration == 0 and enable then
status = true;
end
end
return status;
end
Talents = {{}, {}, {}, {}, {}, {}, {}}
local function GetTalents()
for tier=1,7 do
for value=1,3 do
Talents[tier][value] = (select(4, GetTalentInfo(tier, value, 1)))
end
end
end
local Eye = CreateFrame("Frame")
Eye:RegisterEvent("PLAYER_ENTERING_WORLD")
Eye:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
Eye:RegisterEvent("PLAYER_TALENT_UPDATE")
Eye:SetScript("OnEvent",
function(self, event, ...)
if event == "PLAYER_TALENT_UPDATE" then
GetTalents()
elseif event == "PLAYER_SPECIALIZATION_CHANGED" then
GetTalents()
elseif event == "PLAYER_ENTERING_WORLD" then
GetTalents()
Eye:UnregisterEvent("PLAYER_ENTERING_WORLD")
end
end
)
AzeriteSpells = {}
local function GetAzeriteSpells()
local slotIDs = {1, 3, 5} -- Inventory slots with azerite talents
for _,slot in ipairs(slotIDs) do
if GetInventoryItemID("player",slot)~=nil then
local itemLocation = ItemLocation:CreateFromEquipmentSlot(slot)
if C_AzeriteEmpoweredItem.IsAzeriteEmpoweredItem(itemLocation) then
local allTierInfo = C_AzeriteEmpoweredItem.GetAllTierInfo(itemLocation)
for _, tier in ipairs(allTierInfo) do
for _, azeritePowerID in ipairs(tier.azeritePowerIDs) do
if C_AzeriteEmpoweredItem.IsPowerSelected(itemLocation, azeritePowerID) then
AzeriteSpells[C_AzeriteEmpoweredItem.GetPowerInfo(azeritePowerID).spellID]=true
end
end
end
end
end
end
end
local Eye = CreateFrame("Frame")
Eye:RegisterEvent("PLAYER_ENTERING_WORLD")
Eye:RegisterEvent("PLAYER_EQUIPMENT_CHANGED")
Eye:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
Eye:RegisterEvent("AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED")
Eye:SetScript("OnEvent",
function(self, event, ...)
if event == "PLAYER_EQUIPMENT_CHANGED" then
GetAzeriteSpells()
elseif event == "AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED" then
GetAzeriteSpells()
elseif event == "PLAYER_SPECIALIZATION_CHANGED" then
GetAzeriteSpells()
elseif event == "PLAYER_ENTERING_WORLD" then
GetAzeriteSpells()
Eye:UnregisterEvent("PLAYER_ENTERING_WORLD")
end
end
)