Try downloading Kennel and then replacing the contents of the Kennel.lua file with this:
Code:
local SOR, FOOD, DRINK = GetSpellInfo(20711), GetSpellInfo(7737), GetSpellInfo(430)
local blistzones = {
["Throne of Kil'jaeden"] = true,
["\208\162\209\128\208\190\208\189 \208\154\208\184\208\187'\208\180\208\182\208\181\208\180\208\181\208\189\208\176"] = true, -- ruRU
["Tr\195\180ne de Kil'jaeden"] = true, -- frFR
}
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...) if self[event] then return self[event](self, event, ...) end end)
f:Hide()
local numpets = 0
local function PutTheCatOut(self, event)
-- Bail out if we're on the Venomhide Ravasaur quest
local z = GetZoneText()
if (z == "Silithus" or z == "Tanaris" or z == "Un'goro Crater") and GetItemCount(46362) > 0 then return end
if InCombatLockdown() then
return self:RegisterEvent("PLAYER_REGEN_ENABLED")
end
if not HasFullControl() then
return self:RegisterEvent("PLAYER_CONTROL_GAINED")
end
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
for i = 1,GetNumCompanions("CRITTER") do
local _, name, _, _, summoned = GetCompanionInfo("CRITTER", i)
if summoned then
return
end
end
self:Show()
end
local elapsed
f:SetScript("OnShow", function()
elapsed = 0
end)
f:SetScript("OnUpdate", function(self, elap)
elapsed = elapsed + elap
if elapsed < 1 then return end
local _, instanceType = IsInInstance()
local pvp = instanceType == "pvp" or instanceType == "arena"
if pvp or InCombatLockdown() or IsStealthed() or IsMounted() or IsFlying() or IsFalling()
or UnitCastingInfo("player") or UnitChannelInfo("player") or blistzones[GetSubZoneText()]
or UnitBuff("player", SOR) or UnitBuff("player", FOOD) or UnitBuff("player", DRINK) then
elapsed = 0
return
end
UIErrorsFrame:AddMessage("You don't have a companion!", 1, 0, 1)
self:Hide()
end)
f.PLAYER_REGEN_ENABLED = PutTheCatOut
f.PLAYER_CONTROL_GAINED = PutTheCatOut
f.PLAYER_LOGIN = PutTheCatOut
f.PLAYER_UNGHOST = PutTheCatOut
f.ZONE_CHANGED = PutTheCatOut
f.ZONE_CHANGED_INDOORS = PutTheCatOut
f.ZONE_CHANGED_NEW_AREA = PutTheCatOut
function f:COMPANION_UPDATE(event, comptype)
if comptype == "CRITTER" then
return PutTheCatOut(self, "COMPANION_UPDATE")
end
end
f:RegisterEvent("COMPANION_UPDATE")
f:RegisterEvent("PLAYER_UNGHOST")
f:RegisterEvent("ZONE_CHANGED")
f:RegisterEvent("ZONE_CHANGED_INDOORS")
f:RegisterEvent("ZONE_CHANGED_NEW_AREA")
I'm still waiting in the queue for my realm (and have been for the last 2 hours) so I can't actually test it right now. If it doesn't work, please post the Lua error(s) it throws at you. If you haven't responded by the time I'm able to test, I'll update this post with any changes needed.