Друид

Обмен опытом по созданию ротаций
eminsk
Сообщения: 191
Зарегистрирован: 19 фев 2016, 17:15

Re: Друид

Сообщение eminsk » 25 ноя 2019, 01:38

бфа медведь кот сова хил.rar
(39.43 КБ) 8 скачиваний

Код: Выделить всё

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
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
)
Talents = {{}, {}, {}, {}, {}, {}, {}}
Talents.pvp = {}

local function GetTalents()
  for tier=1,7 do
    for value=1,3 do
      Talents[tier][value] = (select(4, GetTalentInfo(tier, value, 1)))
    end
  end
  for slotN, talentID in ipairs (C_SpecializationInfo.GetAllSelectedPvpTalentIDs()) do
    Talents.pvp[talentID] = true
  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
)

function inPvP()
  return C_PvP.IsWarModeActive() or C_PvP.IsPVPMap()
end

stormi47855
Сообщения: 210
Зарегистрирован: 25 ноя 2016, 10:13

Re: Друид

Сообщение stormi47855 » 02 дек 2019, 07:48

eminsk писал(а):
25 ноя 2019, 01:38
бфа медведь кот сова хил.rar

Код: Выделить всё

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
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
)
Talents = {{}, {}, {}, {}, {}, {}, {}}
Talents.pvp = {}

local function GetTalents()
  for tier=1,7 do
    for value=1,3 do
      Talents[tier][value] = (select(4, GetTalentInfo(tier, value, 1)))
    end
  end
  for slotN, talentID in ipairs (C_SpecializationInfo.GetAllSelectedPvpTalentIDs()) do
    Talents.pvp[talentID] = true
  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
)

function inPvP()
  return C_PvP.IsWarModeActive() or C_PvP.IsPVPMap()
end
брат а можно хоть какоето описание таланты какие брал к примеру и что меняют переключатели в каждой ветке -_-

Ответить

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 1 гость