use 30 Day Mounts from AT
Posted: Wed Jan 29, 2014 4:00 pm
This is a piece of code I have on my alts to check if their 30 day temporary mounts from the Ancient Treasures minigame has expired. If they don't have one of the 30 day mounts, it will check their backpack for the required items and create a new mount if the required items are there.
I thought it might come in handy for anyone looking for something like this.
Code: Select all
function checkmounts()
local tempmounts = { -- 30 day Infernal and Abysmal Mounts
206572,
206560
}
local havemount = "no"
for k,v in pairs(tempmounts) do
if inventory:itemTotalCount(v) > 0 then
havemount = "yes"
end
end
if havemount == "no" then
-- check Abysmal items first
local mycount = 0
local mountitems = {
206636, -- Abysmal Nightmare 30 Day Contract
206637, -- Abysmal Nightmare Soul Core
206641, -- Abysmal Nightmare Spiny Armor
206638, -- Abysmal Nightmare Statue Fragment I
206639, -- Abysmal Nightmare Statue Fragment II
206640 -- Abysmal Nightmare Statue Fragment III
}
for k,v in pairs(mountitems) do
if inventory:itemTotalCount(v) > 0 then
mycount = mycount + 1
end
end
if mycount >= 6 then -- all items found
inventory:useItem(206636);
yrest(200)
else -- If no Abysmal, then check Infernal Items
local mycount = 0
local mountitems = {
206631, -- Infernal Nightmare 30 Day Contract
206632, -- Infernal Nightmare Soul Core
206633, -- Infernal Nightmare Statue Fragment I
206634, -- Infernal Nightmare Statue Fragment II
206635 -- Infernal Nightmare Statue Fragment III
}
for k,v in pairs(mountitems) do
if inventory:itemTotalCount(v) > 0 then
mycount = mycount + 1
end
end
if mycount >= 5 then -- all items found
inventory:useItem(206631);
yrest(200)
end
end
end
end