WoWInterface SVN sCompanions

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 12 to Rev 13
    Reverse comparison

Rev 12 → Rev 13

trunk/sCompanions/sCompanions.toc
1,7 → 1,7
## Interface: 70000
## Title: sCompanions
## Author: Seerah
## Version: 2.0.3
## Version: 2.0.4
## Notes: Divides up your mounts into 2 categories based on land/air, to randomly pick from via a macro. Also provides a random pet macro.
## OptionalDeps: LibPetJournal-2.0
 
trunk/sCompanions/sCompanions.lua
19,11 → 19,12
 
local LPJ = LibStub("LibPetJournal-2.0")
local f = CreateFrame("Frame")
local _,mount
local _, mount
local CMJ = C_MountJournal
local CPJ = C_PetJournal
local wipe = wipe
local tinsert = tinsert
local math_random = math.random
 
 
--local numMounts = CMJ.GetNumMounts() --the game won't add new mounts during a session
91,17 → 92,28
end)
 
 
function sCompanions.MountUp(pool)
if #pool >= 1 then
local id = pool[math.random(#pool)]
local name, isUsable
name, _, _, _, isUsable = CMJ.GetMountInfoByID(id)
function sCompanions.MountUp(pool, compType)
local numAttempts, canMount = 0, true
local numMounts = #pool
if numMounts >= 1 then
local id = pool[math_random(numMounts)]
--local name, isUsable
local name, _, _, _, isUsable = CMJ.GetMountInfoByID(id)
while ignore[name] or not isUsable do
--if not isUsable then print(name) end
id = pool[math.random(#pool)]
id = pool[math_random(numMounts)]
name, _, _, _, isUsable = CMJ.GetMountInfoByID(id)
numAttempts = numAttempts + 1
if numAttempts > numMounts then
canMount = false
break
end
end
CMJ.SummonByID(id)
if canMount then
CMJ.SummonByID(id)
else
print("|cff86b850sCompanions:|r No usable "..compType.." mounts to choose from.")
end
else
print("|cff86b850sCompanions:|r No "..compType.." mounts to choose from.")
end
110,10 → 122,10
function sCompanions.CallPet(pool)
local numpets = #pool
if numpets >= 1 then
local id = pool[math.random(numpets)]
local id = pool[math_random(numpets)]
local _,_,_,_,_,_,name = CPJ.GetPetInfoByPetID(id)
while ignore[name] or CPJ.GetSummonedPetGUID() == id do
id = math.random(pool)
id = math_random(pool)
_,_,_,_,_,_,name = CPJ.GetPetInfoByPetGUID(id)
end
CPJ.SummonPetByGUID(id)
133,7 → 145,7
elseif IsFalling() then
UIErrorsFrame:AddMessage(ERR_NOT_WHILE_FALLING, 1.0, 0.1, 0.1, 1.0)
else
sCompanions.MountUp(pool)
sCompanions.MountUp(pool, compType)
end
end
elseif compType == "pet" then