I was too lazy to include zones to tame mounts so I made a mount seller modal window via talkactions in revscriptsys, it may be useful for someone:
Features:
Doesn't show mounts you already own/don't have the items to get
Includes a list with all the mounts locked and what item/quantity it needs
Easy to add new mounts
make a .lua file on data/scripts/talkactions or wherever you want in scripts folder and add:
Pics:
Features:
Doesn't show mounts you already own/don't have the items to get
Includes a list with all the mounts locked and what item/quantity it needs
Easy to add new mounts
make a .lua file on data/scripts/talkactions or wherever you want in scripts folder and add:
Lua:
local mounts = {
[1] = {name = 'Widow Queen', id = 1, item = 13307, count = 2}, -- Self explanatory
[2] = {name = 'Racing Bird', id = 2, item = 13298, count = 5},
}
local mount = TalkAction("!mount")
function mount.onSay(player, words, param)
if param == "unlock" then
player:registerEvent("Mount_Modal_Window")
local title = "Mount Unlocker"
local message = "List of available mounts to unlock:"
local window = ModalWindow(1800, title, message)
window:addButton(100, "Unlock")
window:addButton(101, "Cancel")
for i = 1, #mounts do
if (player:getItemCount(mounts[i].item) >= mounts[i].count) and (not player:hasMount(mounts[i].id)) then
window:addChoice(i,""..mounts[i].name)
end
end
window:setDefaultEnterButton(100)
window:setDefaultEscapeButton(101)
window:sendToPlayer(player)
elseif param == "list" then
local list = "List of locked mounts and item needed:"
for j = 1, #mounts do
if not player:hasMount(mounts[j].id) then
list = list ..'\n['.. mounts[j].name..'] \nItem: ' ..ItemType(mounts[j].item):getName() ..' x'..mounts[j].count
end
end
player:showTextDialog(8977, list)
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '\nMount Commands:\n!mount list -- Shows locked mounts\n!mount unlock -- Unlock mounts')
end
return false
end
mount:separator(" ")
mount:register()
local mountmodal = CreatureEvent("Mount_Modal_Window")
mountmodal:type("modalwindow")
function mountmodal.onModalWindow(player, modalWindowId, buttonId, choiceId)
if modalWindowId == 1800 then
if buttonId == 100 then
if doPlayerRemoveItem(player, mounts[choiceId].item, mounts[choiceId].count) then
player:addMount(mounts[choiceId].id)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, ''.. mounts[choiceId].name ..' unlocked!')
else
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Couldn\'t unlock mount.')
end
end
end
player:unregisterEvent("Mount_Modal_Window")
return true
end
mountmodal:register()
Pics: