/
end |
function Livestock.PickLandMount() |
local apprenticeRiding = IsUsableSpell(L.LIVESTOCK_SPELL_APPRENTICERIDING) -- Apprentice Riding |
local unitLevel = UnitLevel("player") |
local engineeringLevel = Livestock.GetProfSkillLevel(L.LIVESTOCK_SKILL_ENGR) |
local tailoringLevel = Livestock.GetProfSkillLevel(L.LIVESTOCK_SKILL_TAILOR) |
local leatherworkingLevel = Livestock.GetProfSkillLevel(L.LIVESTOCK_SKILL_LW) |
local mapID = C_Map.GetBestMapForUnit("player") |
local dungeonInfo = MapUtil.GetMapParentInfo(mapID, Enum.UIMapType.Dungeon, true) |
local dungeonID, dungeonName |
if dungeonInfo then |
dungeonID = dungeonInfo.mapID |
dungeonName = dungeonInfo.name |
if debug then |
print("new dungeon ID : "..dungeonID.." "..dungeonName) |
end |
end |
if IsMounted() and ( not IsFlying() or LivestockSettings.safeflying == 0 ) then -- if we're already mounted and NOT flying (no accidents, please!) then dismount and don't pick another mount |
Dismount() |
return |
for k in pairs(LivestockSettings.Mounts) do -- go through the land mounts and add the ones that are selected to the temp table |
if (LivestockSettings.Mounts[k].type == "land") and LivestockSettings.Mounts[k].show == 1 then |
local _, _, _, _, isUsable = C_MountJournal.GetMountInfoByID(LivestockSettings.Mounts[k].index) |
if (LivestockSettings.Mounts[k].spellID == 61451 or |
LivestockSettings.Mounts[k].spellID == 169952 or |
LivestockSettings.Mounts[k].spellID == 61309 or |
LivestockSettings.Mounts[k].spellID == 75596) and tailoringLevel < 300 then |
-- don't try to use the Flying Carpets |
elseif LivestockSettings.Mounts[k].spellID == 44153 and engineeringLevel < 300 then |
-- don't try to use the Flying Machine |
elseif LivestockSettings.Mounts[k].spellID == 44151 and engineeringLevel < 375 then |
-- don't try to use the Turbo-Charged Flying Machine |
elseif (LivestockSettings.Mounts[k].spellID == 25953 or |
LivestockSettings.Mounts[k].spellID == 26056 or |
LivestockSettings.Mounts[k].spellID == 26054 or |
LivestockSettings.Mounts[k].spellID == 26055) and dungeonID ~= 320 then |
-- don't try to use the AQ40 mounts |
elseif LivestockSettings.Mounts[k].spellID == 171844 and leatherworkingLevel < 300 then |
-- don't try to use the Dustmane Direwolf |
elseif unitLevel < 40 and not apprenticeRiding then |
if LivestockSettings.Mounts[k].mountType == 284 then |
tinsert(temp, LivestockSettings.Mounts[k].index) |
end |
elseif isUsable == true then |
if isUsable == true then |
tinsert(temp, LivestockSettings.Mounts[k].index) |
end |
end |
end |
function Livestock.PickFlyingMount() |
local engineeringLevel = Livestock.GetProfSkillLevel(L.LIVESTOCK_SKILL_ENGR) |
local tailoringLevel = Livestock.GetProfSkillLevel(L.LIVESTOCK_SKILL_TAILOR) |
if IsFlying() and LivestockSettings.safeflying == 1 then -- if we're already flying, don't do anything; if we're not and mounted, we're on the ground on a flying mount so dismount instead of summoning another mount |
return |
elseif IsMounted() then |
for k in pairs(LivestockSettings.Mounts) do -- go through the flying mounts and add the ones that are selected to the temp table |
if (LivestockSettings.Mounts[k].type == "flying") and LivestockSettings.Mounts[k].show == 1 then |
local _, _, _, _, isUsable = C_MountJournal.GetMountInfoByID(LivestockSettings.Mounts[k].index) |
if (LivestockSettings.Mounts[k].spellID == 61451 or |
LivestockSettings.Mounts[k].spellID == 169952 or |
LivestockSettings.Mounts[k].spellID == 61309 or |
LivestockSettings.Mounts[k].spellID == 75596) and tailoringLevel < 300 then |
-- don't try to use the Flying Carpets |
elseif LivestockSettings.Mounts[k].spellID == 44153 and engineeringLevel < 300 then |
-- don't try to use the Flying Machine |
elseif LivestockSettings.Mounts[k].spellID == 44151 and engineeringLevel < 375 then |
-- don't try to use the Turbo-Charged Flying Machine |
else |
if isUsable == true then |
tinsert(temp, LivestockSettings.Mounts[k].index) |
end |
if isUsable == true then |
tinsert(temp, LivestockSettings.Mounts[k].index) |
end |
end |
end |
Version 2.7.2 |
- Fixed profession mounts |
Version 2.7.1 |
- Fixed random zone errors, druids, and shamans. |
- Water mounts are fixed. |
- Fixed random zone errors, druids, and shamans |
- Water mounts are fixed |
Version 2.7.0 |
## Title: Livestock |
## Notes: Enables easy random summoning of vanity pets and mounts, including the option of "smart mounting" |
## Author: Kharthus - Deathwing(US) |
## Version: 2.7.1 |
## Version: 2.7.2 |
## SavedVariablesPerCharacter: LivestockSettings |
LibRecompense\RecompenseTools.lua |