Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Initialize random seed for Lua 5.1
- math.randomseed(os.time())
- mountListGround = {
- "Black War Bear",
- "Purple Hawkstrider",
- "Black War Wolf",
- "Summon Charger",
- "Traveler's Tundra Mammoth"
- }
- mountListFlying = {
- "Green Proto-Drake",
- "Blue Wind Rider",
- "Albino Drake"
- }
- -- First run after reloading - getting indices
- if not builtIndices then
- mountListGroundIndices = {}
- mountListFlyingIndices = {}
- mountListWintergraspIndices = {}
- for i = 1, GetNumCompanions("MOUNT") do
- local id, name = GetCompanionInfo("MOUNT", i)
- if tContains(mountListGround, name) then
- tinsert(mountListGroundIndices, i)
- if name ~= "Purple Hawkstrider" then
- tinsert(mountListWintergraspIndices, i)
- end
- end
- if tContains(mountListFlying, name) then
- tinsert(mountListFlyingIndices, i)
- end
- if name == "Traveler's Tundra Mammoth" then
- tundraIndex = i
- end
- end
- builtIndices = true
- end
- -- Random CallCompanion alias
- function callMount(indexTable)
- CallCompanion("MOUNT", indexTable[math.random(#indexTable)])
- end
- -- Dismounter
- if not IsFlying() and IsMounted() then
- Dismount()
- end
- -- Main function
- if not InCombatLockdown() then
- cancelShapeshifts()
- if IsAltKeyDown() then
- CallCompanion("MOUNT", tundraIndex)
- else
- if not IsFlyableArea() then
- callMount(mountListGroundIndices)
- else
- if not IsFlying() then
- if IsShiftKeyDown() then
- callMount(mountListGroundIndices)
- else
- if GetZoneText() == "Wintergrasp" and not GetWintergraspWaitTime() then
- callMount(mountListWintergraspIndices)
- else
- callMount(mountListFlyingIndices)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement