/trunk
movingaspects = 0, -- Smart Mounting casts AotC / AotP when outside and moving |
slowfall = 0, -- Smart Mounting casts Slow Fall / Levitate while falling and not in combat |
useweights = 0, -- Whether or not Smart Mounting should use weighted summons |
version = 1.51, -- swimming turtle fix |
version = 1.5, -- New mount detection |
} |
LIVESTOCK_VERSION = GetAddOnMetadata("Livestock", "Version"); |
LivestockSettings[k] = v |
end |
end |
if LivestockSettings.version < defaults.version then |
LivestockSettings.Mounts = {} |
LivestockSettings.version = defaults.version |
end |
for k, v in pairs(LivestockSettings) do |
if not defaults[k] then |
LivestockSettings[k] = nil |
function Livestock.RenumberCompanions() -- because the game does not distinguish between learning a new mount or a new critter, it's safest just to redo both indices |
for i = 1, GetNumCompanions("CRITTER") do |
local _, name = GetCompanionInfo("CRITTER",i) |
local _,name = GetCompanionInfo("CRITTER",i) |
if name and not LivestockSettings.Critters[name] then -- sometimes Blizzard's code returns nil for the name. If we have a valid name but no associated data in the SV, then we need to add it. |
LivestockSettings.Critters[name] = { -- save the index and set the default show value to on |
show = 1, |
end |
for i = 1, GetNumCompanions("MOUNT") do |
local _, name, spellID, _, _, mountFlags = GetCompanionInfo("MOUNT",i) |
local _, name, _, _, _, mountFlags = GetCompanionInfo("MOUNT",i) |
if name and not LivestockSettings.Mounts[name] then -- if the name is valid and we don't have SV data for it, we need to make it |
local name2 = strconcat(name, "-") |
LivestockSettings.Mounts[name] = { index = i, } -- set the index of the mount |
Flying mounts = 7 |
Water mounts = 12 |
Ground mounts = 29 |
Flying carpets = 23 (they can't swim) |
Ground mounts = 29 (includes swimming turtles) |
Multi-purpose = 31 |
]] |
LivestockSettings.Mounts[name].type = "water" |
else -- otherwise, a land mount |
LivestockSettings.Mounts[name].type = "land" |
-- swimming turtle exception |
if spellID == 30174 or spellID == 64731 then |
LivestockSettings.Mounts[name].type = "water" |
end |
end |
LivestockSettings.Mounts[name].show = 1 |
elseif name then -- if we do have SV data for it, update the index. |
Version 1.5.1 |
- Added exceptions for swimming turtle mounts |
Version 1.5 |
- Separated ground and flying mount selections (Thanks XDragonX) |
## Notes: Enables easy random summoning of vanity pets and mounts, including the option of "smart mounting." |
## Author: Recompense - Uldum(US) |
## X-eMail: scott.snowman@gmail.com |
## Version: 1.5.1 |
## Version: 1.5 |
## SavedVariablesPerCharacter: LivestockSettings |
LibRecompense\RecompenseTools.lua |