Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version = "1.06.13"
- --RandomMount
- --Original Author: Mike Hendricks(AttilaTheFun)
- --Continuing Author: t4t3rt0t
- --Description:
- -- This add-on makes it simple to summon a random mount it takes into account ridding level, cold weather flying,
- -- flying areas, Modifiers available, and summons an appropriate mount.
- -- It has a simple interface /mnt: /rmount: Will summon riding/flying mounts in the appropriate areas. mnt and rmount are interchangeable
- -- /mnt riding: Summons riding mounts in flying areas
- -- /mnt flying: Attempt to summon a flying mount
- -- /mnt help: Display help
- -- /mnt r or f (search Term): Summons a mount based on specified search term
- -- example: to summon a skeletal warhorse type: /mnt skeletal
- -- /mnt config: Prints the current configuration
- -- /mnt rfilter: Toggle mount filtering
- -- /mnt safefly: Toggle double click to dismount while flying
- -- /mnt rfilters: List current filters
- -- /mnt locfilter: Toggle filter to summon only specific mounts in specific locations
- -- /mnt addloc % (zone:mount name1, mount name2, ...): Add locations and mounts to location checking. Separate mounts with commas. Use * as a wildcard to specify all mounts.
- -- /mnt removeloc % (zone:mount name1, mount name2, ...): Removes locations and mounts from location checking. Separate mounts with commas.
- -- /mnt loctable: Print the current location filtering table.
- -- /mnt clearloc: Clears location filters
- -- /mnt remove %: Remove all mounts matching % if rfilter is enabled
- -- /mnt clear: Clears all filters
- -- /mnt clearrem: Clears the mount removal table
- -- /mnt whereami: Prints your zone and mini-map zone.
- -- /mnt title: Enable or disable random title change.
- -- /mnt icon: Enable or disable changing random mount macro icons to the last summoned mount.
- -- /mnt PrintHelp("druid: Create a macro for druids that will cancel your form before trying to summon a mount.
- -- /mnt debug: Toggle debug printing for posting error messages
- -- /mnt No Flag: Summon a appropriate mount for the area
- -- Get the Frame that is housing the UIErrorsFrame
- local originalOnEvent = UIErrorsFrame:GetScript("OnEvent")
- -- Listen for SYSTEM Errors from the UIErrorsFrame
- UIErrorsFrame:SetScript("OnEvent", function(self, event, message, r, g, b, ...)
- -- Check the Error Message
- if message == SPELL_FAILED_NOT_HERE or message == SPELL_FAILED_ONLY_UNDERWATER then
- -- Set mountError to true
- mountError = true
- mountErrorMsg = message
- else
- -- Set mountError to false
- mountError = false
- mountErrorMsg = nil
- -- If error is not what we are looking for then return it to the original Frame
- return originalOnEvent(self, event, message, r, g, b, ...)
- end
- end)
- -- mount dictionary to compensate for wow's terrible GetCompanionInfo("MOUNT", i) command.
- --One would assume info would imply useful things like can it fly and what skill is required etc.
- --1 = riding mount
- --2 = flying mount
- --3 = riding / flying mount
- -- Mount Database
- local mountDict = {
- [75207]={1, "Abyssal Seahorse"},
- [48778]={1, "Acherus Deathcharger"},
- [60025]={2, "Albino Drake"},
- [127180]={1, "Albino Riding Crane"},
- [98204]={1, "Amani Battle Bear"},
- [96503]={2, "Amani Dragonhawk"},
- [43688]={1, "Amani War Bear"},
- [123886]={1, "Amber Scorpion"},
- [16056]={1, "Ancient Frostsaber"},
- [66906]={1, "Argent Charger"},
- [63844]={3, "Argent Hippogryph"},
- [67466]={1, "Argent Warhorse"},
- [61230]={3, "Armored Blue Wind Rider"},
- [60114]={1, "Armored Brown Bear"},
- [60116]={1, "Armored Brown Bear"},
- [96491]={1, "Armored Razzashi Raptor"},
- [61229]={3, "Armored Snowy Gryphon"},
- [132117]={2, "Ashen Pandaren Phoenix"},
- [40192]={2, "Ashes of Al'ar"},
- [127170]={2, "Astral Cloud Serpent"},
- [123992]={2, "Azure Cloud Serpent"},
- [59567]={2, "Azure Drake"},
- [41514]={2, "Azure Netherwing Drake"},
- [127174]={1, "Azure Riding Crane"},
- [118089]={1, "Azure Water Strider"},
- [97501]={2, "Beryl Fire Hawk"},
- [51412]={1, "Big Battle Bear"},
- [64987]={1, "Big Blizzard Bear [PH]"},
- [58983]={1, "Big Blizzard Bear"},
- [71342]={3, "Big Love Rocket"},
- [22719]={1, "Black Battlestrider"},
- [127286]={1, "Black Dragon Turtle"},
- [62048]={2, "Black Dragonhawk Mount"},
- [59650]={2, "Black Drake"},
- [35022]={1, "Black Hawkstrider"},
- [16055]={1, "Black Nightsaber"},
- [59572]={1, "Black Polar Bear"},
- [59976]={2, "Black Proto-Drake"},
- [26656]={1, "Black Qiraji Battle Tank"},
- [17461]={1, "Black Ram"},
- [6896]={1, "Black Ram"},
- [130138]={1, "Black Riding Goat"},
- [127209]={1, "Black Riding Yak"},
- [64977]={1, "Black Skeletal Horse"},
- [470]={1, "Black Stallion"},
- [60118]={1, "Black War Bear"},
- [60119]={1, "Black War Bear"},
- [48027]={1, "Black War Elekk"},
- [22718]={1, "Black War Kodo"},
- [59785]={1, "Black War Mammoth"},
- [59788]={1, "Black War Mammoth"},
- [22720]={1, "Black War Ram"},
- [22721]={1, "Black War Raptor"},
- [22717]={1, "Black War Steed"},
- [22723]={1, "Black War Tiger"},
- [22724]={1, "Black War Wolf"},
- [578]={1, "Black Wolf"},
- [64658]={1, "Black Wolf"},
- [107842]={2, "Blazing Drake"},
- [74856]={3, "Blazing Hippogryph"},
- [127220]={1, "Blonde Riding Yak"},
- [72808]={2, "Bloodbathed Frostbrood Vanquisher"},
- [127287]={1, "Blue Dragon Turtle"},
- [61996]={2, "Blue Dragonhawk"},
- [59568]={2, "Blue Drake"},
- [35020]={1, "Blue Hawkstrider"},
- [10969]={1, "Blue Mechanostrider"},
- [33630]={1, "Blue Mechanostrider"},
- [59996]={2, "Blue Proto-Drake"},
- [25953]={1, "Blue Qiraji Battle Tank"},
- [6897]={1, "Blue Ram"},
- [39803]={2, "Blue Riding Nether Ray"},
- [129934]={1, "Blue Shado-Pan Riding Tiger"},
- [17463]={1, "Blue Skeletal Horse"},
- [64656]={1, "Blue Skeletal Warhorse"},
- [32244]={3, "Blue Wind Rider"},
- [50869]={1, "Brewfest Kodo"},
- [43899]={1, "Brewfest Ram"},
- [50870]={1, "Brewfest Ram"},
- [49378]={1, "Brewfest Riding Kodo"},
- [59569]={2, "Bronze Drake"},
- [127288]={1, "Brown Dragon Turtle"},
- [34406]={1, "Brown Elekk"},
- [458]={1, "Brown Horse"},
- [18990]={1, "Brown Kodo"},
- [59573]={1, "Brown Polar Bear"},
- [6899]={1, "Brown Ram"},
- [88748]={1, "Brown Riding Camel"},
- [130086]={1, "Brown Riding Goat"},
- [127213]={1, "Brown Riding Yak"},
- [17464]={1, "Brown Skeletal Horse"},
- [6654]={1, "Brown Wolf"},
- [58615]={2, "Brutal Nether Drake"},
- [124550]={2, "Cataclysmic Gladiator's Twilight Drake"},
- [75614]={3, "Celestial Steed"},
- [43927]={3, "Cenarion War Hippogryph"},
- [23214]={1, "Charger"},
- [6648]={1, "Chestnut Mare"},
- [41515]={2, "Cobalt Netherwing Drake"},
- [39315]={1, "Cobalt Riding Talbuk"},
- [34896]={1, "Cobalt War Talbuk"},
- [97560]={2, "Corrupted Fire Hawk"},
- [102514]={2, "Corrupted Hippogryph"},
- [127156]={2, "Crimson Cloud Serpent"},
- [73313]={1, "Crimson Deathcharger"},
- [129552]={2, "Crimson Pandaren Phoenix"},
- [123160]={1, "Crimson Riding Crane"},
- [127271]={1, "Crimson Water Strider"},
- [68188]={1, "Crusader's Black Warhorse"},
- [68187]={1, "Crusader's White Warhorse"},
- [88990]={2, "Dark Phoenix"},
- [39316]={1, "Dark Riding Talbuk"},
- [34790]={1, "Dark War Talbuk"},
- [103081]={1, "Darkmoon Dancing Bear"},
- [63635]={1, "Darkspear Raptor"},
- [63637]={1, "Darnassian Nightsaber"},
- [121839]={2, "Dawnstone Panther"},
- [64927]={2, "Deadly Gladiator's Frostwyrm"},
- [126507]={2, "Depleted-Kyparium Rocket"},
- [6653]={1, "Dire Wolf"},
- [88335]={2, "Drake of the East Wind"},
- [88742]={2, "Drake of the North Wind"},
- [88744]={2, "Drake of the South Wind"},
- [88741]={2, "Drake of the West Wind"},
- [23161]={1, "Dreadsteed"},
- [32239]={3, "Ebon Gryphon"},
- [132118]={2, "Emerald Pandaren Phoenix"},
- [121837]={2, "Emerald Panther"},
- [8395]={1, "Emerald Raptor"},
- [63639]={1, "Exodar Elekk"},
- [110039]={2, "Experiment 12-B"},
- [5784]={1, "Felsteed"},
- [36702]={1, "Fiery Warhorse"},
- [101542]={1, "Flametalon of Alysrazor"},
- [97359]={3, "Flameward Hippogryph"},
- [17458]={1, "Fluorescent Green Mechanostrider"},
- [61451]={3, "Flying Carpet"},
- [44153]={3, "Flying Machine"},
- [63643]={1, "Forsaken Warhorse"},
- [84751]={1, "Fossilized Raptor"},
- [17460]={1, "Frost Ram"},
- [51960]={2, "Frost Wyrm Mount"},
- [43810]={2, "Frost Wyrm"},
- [23509]={1, "Frostwolf Howler"},
- [75596]={3, "Frosty Flying Carpet"},
- [65439]={2, "Furious Gladiator's Frost Wyrm"},
- [126508]={2, "Geosynchronous World Spinner"},
- [63638]={1, "Gnomeregan Mechanostrider"},
- [87090]={1, "Goblin Trike"},
- [87091]={1, "Goblin Turbo-Trike"},
- [123993]={2, "Golden Cloud Serpent"},
- [32235]={3, "Golden Gryphon"},
- [90621]={1, "Golden King"},
- [127176]={1, "Golden Riding Crane"},
- [16060]={1, "Golden Sabercat"},
- [127278]={1, "Golden Water Strider"},
- [135416]={3, "Grand Armored Gryphon"},
- [59810]={1, "Grand Black War Mammoth"},
- [59811]={1, "Grand Black War Mammoth"},
- [61465]={1, "Grand Black War Mammoth"},
- [61467]={1, "Grand Black War Mammoth"},
- [60136]={1, "Grand Caravan Mammoth"},
- [60140]={1, "Grand Caravan Mammoth"},
- [122708]={1, "Grand Expedition Yak"},
- [136163]={3, "Grand Gryphon"},
- [59802]={1, "Grand Ice Mammoth"},
- [59804]={1, "Grand Ice Mammoth"},
- [61469]={1, "Grand Ice Mammoth"},
- [61470]={1, "Grand Ice Mammoth"},
- [35710]={1, "Gray Elekk"},
- [18989]={1, "Gray Kodo"},
- [6777]={1, "Gray Ram"},
- [459]={1, "Gray Wolf"},
- [63639]={1, "Great Azuremyst Elekk"},
- [127295]={1, "Great Black Dragon Turtle"},
- [127302]={1, "Great Blue Dragon Turtle"},
- [35713]={1, "Great Blue Elekk"},
- [49379]={1, "Great Brewfest Kodo"},
- [127308]={1, "Great Brown Dragon Turtle"},
- [23249]={1, "Great Brown Kodo"},
- [34407]={1, "Great Elite Elekk"},
- [65641]={1, "Great Golden Kodo"},
- [23248]={1, "Great Gray Kodo"},
- [127293]={1, "Great Green Dragon Turtle"},
- [35712]={1, "Great Green Elekk"},
- [127310]={1, "Great Purple Dragon Turtle"},
- [35714]={1, "Great Purple Elekk"},
- [120822]={1, "Great Red Dragon Turtle"},
- [65637]={1, "Great Red Elekk"},
- [23247]={1, "Great White Kodo"},
- [120395]={1, "Green Dragon Turtle"},
- [18991]={1, "Green Kodo"},
- [15780]={1, "Green Mechanostrider"},
- [17453]={1, "Green Mechanostrider"},
- [61294]={2, "Green Proto-Drake"},
- [26056]={1, "Green Qiraji Battle Tank"},
- [39798]={2, "Green Riding Nether Ray"},
- [129932]={1, "Green Shado-Pan Riding Tiger"},
- [17465]={1, "Green Skeletal Warhorse"},
- [32245]={3, "Green Wind Rider"},
- [88750]={1, "Grey Riding Camel"},
- [127216]={1, "Grey Riding Yak"},
- [48025]={3, "Headless Horseman's Mount"},
- [110051]={3, "Heart of the Aspects"},
- [127169]={2, "Heavenly Azure Cloud Serpent"},
- [127161]={2, "Heavenly Crimson Cloud Serpent"},
- [127164]={2, "Heavenly Golden Cloud Serpent"},
- [127165]={2, "Heavenly Jade Cloud Serpent"},
- [127158]={2, "Heavenly Onyx Cloud Serpent"},
- [59797]={1, "Ice Mammoth"},
- [59799]={1, "Ice Mammoth"},
- [72807]={2, "Icebound Frostbrood Vanquisher"},
- [17459]={1, "Icy Blue Mechanostrider Mod A"},
- [124659]={2, "Imperial Quilen"},
- [72286]={3, "Invincible"},
- [63956]={2, "Ironbound Proto-Drake"},
- [63636]={1, "Ironforge Ram"},
- [10795]={1, "Ivory Raptor"},
- [17450]={1, "Ivory Raptor"},
- [113199]={2, "Jade Cloud Serpent"},
- [133023]={2, "Jade Pandaren Kite"},
- [127274]={1, "Jade Water Strider"},
- [120043]={2, "Jeweled Onyx Panther"},
- [127178]={1, "Jungle Riding Crane"},
- [93644]={1, "Kor'kron Annihilator"},
- [107845]={2, "Life-Binder's Handmaiden"},
- [65917]={1, "Magic Rooster"},
- [66122]={1, "Magic Rooster"},
- [66123]={1, "Magic Rooster"},
- [66124]={1, "Magic Rooster"},
- [61309]={3, "Magnificent Flying Carpet"},
- [55531]={1, "Mechano-hog"},
- [60424]={1, "Mekgineer's Chopper"},
- [44317]={2, "Merciless Nether Drake"},
- [44744]={2, "Merciless Nether Drake"},
- [63796]={2, "Mimiron's Head"},
- [93623]={2, "Mottled Drake"},
- [16084]={1, "Mottled Red Raptor"},
- [103195]={1, "Mountain Horse"},
- [29059]={1, "Naxxramas Deathcharger"},
- [28828]={2, "Nether Drake"},
- [3363]={2, "Nether Drake"},
- [121820]={2, "Obsidian Nightwing"},
- [10798]={1, "Obsidian Raptor"},
- [66846]={1, "Ochre Skeletal Warhorse"},
- [127154]={2, "Onyx Cloud Serpent"},
- [41513]={2, "Onyx Netherwing Drake"},
- [69395]={2, "Onyxian Drake"},
- [127272]={1, "Orange Water Strider"},
- [63640]={1, "Orgrimmar Wolf"},
- [471]={1, "Palamino"},
- [16082]={1, "Palomino"},
- [118737]={2, "Pandaren Kite"},
- [130985]={2, "Pandaren Kite"},
- [32345]={2, "Peep the Phoenix Mount"},
- [88718]={2, "Phosphorescent Stone Drake"},
- [472]={1, "Pinto"},
- [60021]={2, "Plagued Proto-Drake"},
- [16058]={1, "Primal Leopard"},
- [97493]={2, "Pureblood Fire Hawk"},
- [127289]={1, "Purple Dragon Turtle"},
- [35711]={1, "Purple Elekk"},
- [35018]={1, "Purple Hawkstrider"},
- [17455]={1, "Purple Mechanostrider"},
- [41516]={2, "Purple Netherwing Drake"},
- [39801]={2, "Purple Riding Nether Ray"},
- [23246]={1, "Purple Skeletal Warhorse"},
- [66090]={1, "Quel'dorei Steed"},
- [41252]={1, "Raven Lord"},
- [17456]={1, "Red and Blue Mechanostrider"},
- [127290]={1, "Red Dragon Turtle"},
- [61997]={2, "Red Dragonhawk"},
- [59570]={2, "Red Drake"},
- [130092]={3, "Red Flying Cloud"},
- [34795]={1, "Red Hawkstrider"},
- [10873]={1, "Red Mechanostrider"},
- [59961]={2, "Red Proto-Drake"},
- [26054]={1, "Red Qiraji Battle Tank"},
- [39800]={2, "Red Riding Nether Ray"},
- [129935]={1, "Red Shado-Pan Riding Tiger"},
- [17462]={1, "Red Skeletal Horse"},
- [22722]={1, "Red Skeletal Warhorse"},
- [16080]={1, "Red Wolf"},
- [579]={1, "Red Wolf"},
- [127177]={1, "Regal Riding Crane"},
- [18363]={1, "Riding Kodo"},
- [30174]={1, "Riding Turtle"},
- [17481]={1, "Rivendare's Deathcharger"},
- [121838]={2, "Ruby Panther"},
- [63963]={2, "Rusted Proto-Drake"},
- [101821]={2, "Ruthless Gladiator's Twilight Drake"},
- [93326]={2, "Sandstone Drake"},
- [121836]={2, "Sapphire Panther"},
- [97581]={1, "Savage Raptor"},
- [64731]={1, "Sea Turtle"},
- [66087]={3, "Silver Covenant Hippogryph"},
- [39802]={2, "Silver Riding Nether Ray"},
- [39317]={1, "Silver Riding Talbuk"},
- [34898]={1, "Silver War Talbuk"},
- [63642]={1, "Silvermoon Hawkstrider"},
- [8980]={1, "Skeletal Horse"},
- [32240]={3, "Snowy Gryphon"},
- [130965]={1, "Son of Galleon"},
- [107516]={2, "Spectral Gryphon"},
- [92231]={1, "Spectral Steed"},
- [42776]={1, "Spectral Tiger"},
- [107517]={2, "Spectral Wind Rider"},
- [92232]={1, "Spectral Wolf"},
- [10789]={1, "Spotted Frostsaber"},
- [15781]={1, "Steel Mechanostrider"},
- [23510]={1, "Stormpike Battle Charger"},
- [63232]={1, "Stormwind Steed"},
- [66847]={1, "Striped Dawnsaber"},
- [8394]={1, "Striped Frostsaber"},
- [10793]={1, "Striped Nightsaber"},
- [98718]={1, "Subdued Seahorse"},
- [34767]={1, "Summon Charger"},
- [73629]={1, "Summon Exarch's Elekk"},
- [73630]={1, "Summon Great Exarch's Elekk"},
- [69826]={1, "Summon Great Sunwalker Kodo"},
- [69820]={1, "Summon Sunwalker Kodo"},
- [34769]={1, "Summon Warhorse"},
- [66088]={2, "Sunreaver Dragonhawk"},
- [66091]={1, "Sunreaver Hawkstrider"},
- [68057]={1, "Swift Alliance Steed"},
- [32242]={3, "Swift Blue Gryphon"},
- [23241]={1, "Swift Blue Raptor"},
- [43900]={1, "Swift Brewfest Ram"},
- [23238]={1, "Swift Brown Ram"},
- [23229]={1, "Swift Brown Steed"},
- [23250]={1, "Swift Brown Wolf"},
- [65646]={1, "Swift Burgundy Wolf"},
- [23220]={1, "Swift Dawnsaber"},
- [102346]={1, "Swift Forest Strider"},
- [23221]={1, "Swift Frostsaber"},
- [23239]={1, "Swift Gray Ram"},
- [65640]={1, "Swift Gray Steed"},
- [23252]={1, "Swift Gray Wolf"},
- [32290]={3, "Swift Green Gryphon"},
- [35025]={1, "Swift Green Hawkstrider"},
- [23225]={1, "Swift Green Mechanostrider"},
- [32295]={3, "Swift Green Wind Rider"},
- [68056]={1, "Swift Horde Wolf"},
- [102350]={1, "Swift Lovebird"},
- [23219]={1, "Swift Mistsaber"},
- [61442]={2, "Swift Mooncloth Carpet"},
- [65636]={1, "Swift Moonsaber"},
- [65638]={1, "Swift Moonsaber"},
- [103196]={1, "Swift Mountain Horse"},
- [37015]={2, "Swift Nether Drake"},
- [23242]={1, "Swift Olive Raptor"},
- [23243]={1, "Swift Orange Raptor"},
- [23227]={1, "Swift Palomino"},
- [33660]={1, "Swift Pink Hawkstrider"},
- [32292]={3, "Swift Purple Gryphon"},
- [35027]={1, "Swift Purple Hawkstrider"},
- [65644]={1, "Swift Purple Raptor"},
- [32297]={3, "Swift Purple Wind Rider"},
- [24242]={1, "Swift Razzashi Raptor"},
- [32289]={3, "Swift Red Gryphon"},
- [65639]={1, "Swift Red Hawkstrider"},
- [32246]={3, "Swift Red Wind Rider"},
- [61444]={2, "Swift Shadoweave Carpet"},
- [101573]={1, "Swift Shorestrider"},
- [42777]={1, "Swift Spectral Tiger"},
- [61446]={2, "Swift Spellfire Carpet"},
- [102349]={1, "Swift Springstrider"},
- [23338]={1, "Swift Stormsaber"},
- [23251]={1, "Swift Timber Wolf"},
- [65643]={1, "Swift Violet Ram"},
- [47037]={1, "Swift War Elekk"},
- [35028]={1, "Swift Warstrider"},
- [46628]={1, "Swift White Hawkstrider"},
- [23223]={1, "Swift White Mechanostrider"},
- [23240]={1, "Swift White Ram"},
- [23228]={1, "Swift White Steed"},
- [23222]={1, "Swift Yellow Mechanostrider"},
- [32296]={3, "Swift Yellow Wind Rider"},
- [48954]={1, "Swift Zhevra"},
- [49322]={1, "Swift Zhevra"},
- [96499]={1, "Swift Zulian Panther"},
- [24252]={1, "Swift Zulian Tiger"},
- [88749]={1, "Tan Riding Camel"},
- [39318]={1, "Tan Riding Talbuk"},
- [34899]={1, "Tan War Talbuk"},
- [16059]={1, "Tawny Sabercat"},
- [32243]={3, "Tawny Wind Rider"},
- [18992]={1, "Teal Kodo"},
- [63641]={1, "Thunder Bluff Kodo"},
- [129918]={2, "Thundering August Cloud Serpent"},
- [124408]={2, "Thundering Jade Cloud Serpent"},
- [132036]={2, "Thundering Ruby Cloud Serpent"},
- [580]={1, "Timber Wolf"},
- [60002]={2, "Time-Lost Proto-Drake"},
- [61425]={1, "Traveler's Tundra Mammoth"},
- [61447]={1, "Traveler's Tundra Mammoth"},
- [44151]={3, "Turbo-Charged Flying Machine"},
- [65642]={1, "Turbostrider"},
- [10796]={1, "Turquoise Raptor"},
- [59571]={2, "Twilight Drake"},
- [107844]={2, "Twilight Harbinger"},
- [107203]={3, "Tyrael's Charger"},
- [92155]={1, "Ultramarine Qiraji Battle Tank"},
- [17454]={1, "Unpainted Mechanostrider"},
- [42781]={1, "Upper Deck - Spectral Tiger Mount"},
- [49193]={2, "Vengeful Nether Drake"},
- [46102]={1, "Venomhide Ravasaur"},
- [64659]={1, "Venomhide Ravasaur"},
- [41517]={2, "Veridian Netherwing Drake"},
- [101282]={2, "Vicious Gladiator's Twilight Drake"},
- [100332]={1, "Vicious War Steed"},
- [100333]={1, "Vicious War Wolf"},
- [41518]={2, "Violet Netherwing Drake"},
- [132119]={2, "Violet Pandaren Phoenix"},
- [60024]={2, "Violet Proto-Drake"},
- [10799]={1, "Violet Raptor"},
- [88746]={2, "Vitreous Stone Drake"},
- [88331]={2, "Volcanic Stone Drake"},
- [13819]={1, "Warhorse"},
- [64657]={1, "White Kodo"},
- [15779]={1, "White Mechanostrider Mod B"},
- [54753]={1, "White Polar Bear Mount"},
- [6898]={1, "White Ram"},
- [102488]={1, "White Riding Camel"},
- [130137]={1, "White Riding Goat"},
- [39319]={1, "White Riding Talbuk"},
- [123182]={1, "White Riding Yak"},
- [65645]={1, "White Skeletal Warhorse"},
- [16083]={1, "White Stallion"},
- [468]={1, "White Stallion"},
- [34897]={1, "White War Talbuk"},
- [98727]={3, "Winged Guardian"},
- [54729]={2, "Winged Steed of the Ebon Blade"},
- [16081]={1, "Winter Wolf"},
- [581]={1, "Winter Wolf"},
- [17229]={1, "Winterspring Frostsaber"},
- [59791]={1, "Wooly Mammoth"},
- [59793]={1, "Wooly Mammoth"},
- [74918]={1, "Wooly White Rhino"},
- [46199]={3, "X-51 Nether-Rocket X-TREME"},
- [46197]={3, "X-51 Nether-Rocket"},
- [75973]={3, "X-53 Touring Rocket"},
- [26055]={1, "Yellow Qiraji Battle Tank"}}
- --Saved Variables
- debug = false --display debug info if enabled
- debug2 = false --Display debug info on all mounts
- notWanted = {} --Mounts that are not wanted to be summoned
- removeMount = false --Enable or disable notWanted mounts
- locationChk = true --enable or disable specific mounts in special locations
- locations = {} --locations to summon specific mounts(specialMounts)
- specialMounts = {} --special mounts to summon if in a specific location
- rndTitle = false --Randomly change the title when summoning a mount
- safeFly = false --Safe flying dismount if flying
- macroIcon = false --Update the macro icon with last summoned mount
- zones = {} --Contains the list of location filters
- mountError = false
- mountErrorMsg = nil
- local nosummonlist = {} --Stores the last few mounts summoned so it won't summon it again
- local lastTime = GetTime() --Safe flying last time that dismount was called
- --bindings
- BINDING_HEADER_RANDOMMOUNT = "Random Mount"
- BINDING_NAME_RANDOMMOUNT_REG = "Auto Summon"
- BINDING_NAME_RANDOMMOUNT_RIDING = "Summon Riding"
- BINDING_NAME_RANDOMMOUNT_FLYING = "Summon Flying"
- -- Run at Load
- function RandomMount_OnLoad()
- SlashCmdList["RandomMount"] = FindMount;
- SLASH_RandomMount1 = "/mnt";
- SLASH_RandomMount2 = "/rmount";
- end
- -- Check if you can Fly
- function CanFlyHere()
- local zoneID = GetCurrentMapAreaID()
- local zoneNum = GetCurrentMapZone()
- local ridingSkill, classicLicense, coldLicense, pandaLicense = GetRidingSkill()
- -- Check for flyable area
- if not IsFlyableArea() then
- return(false)
- elseif IsFlyableArea() then
- if zoneID == 773 or zoneID == 756 then
- return(false)
- else
- for j=1,6 do
- Index = {GetMapZones(j)}
- -- Zone Check
- for i, zone in ipairs(Index) do
- if zoneNum == i then
- if classicLicense == 1 and (j == 1 or j == 2 or j == 5) then
- return(true)
- elseif ridingSkill >= 225 and j == 3 then
- return(true)
- elseif coldLicense == 1 and j == 4 then
- return(true)
- elseif pandaLicense == 1 and j == 6 then
- return(true)
- end
- end
- end
- end
- return(false)
- end
- end
- end
- -- Get your Riding Skill Level
- function GetRidingSkill()
- local ridingSkill = 0
- local classicLicense = 0
- local coldLicense = 0
- local pandaLicense = 0
- local serpentLicense = 0
- local _,_,_,numSpells = GetSpellTabInfo(1)
- for i=1,numSpells do
- local spellName = GetSpellBookItemName(i, BOOKTYPE_SPELL)
- local _, spellID = GetSpellBookItemInfo(spellName)
- if spellID == 90265 then
- ridingSkill = 375
- elseif spellID == 34091 then
- ridingSkill = 300
- elseif spellID == 34090 then
- ridingSkill = 225
- elseif spellID == 33391 then
- ridingSkill = 150
- elseif spellID == 33388 then
- ridingSkill = 75
- elseif spellID == 90267 then
- classicLicense = 1
- elseif spellID == 54197 then
- coldLicense = 1
- elseif spellID == 115913 then
- pandaLicense = 1
- elseif spellID == 130487 then
- serpentLicense = 1
- end
- end
- return ridingSkill, classicLicense, coldLicense, pandaLicense, serpentLicense
- end
- -- Get your Profession Skill Level (Thanks to phuzi0n for the cleaned up code)
- function GetProfessionSkill()
- local taylorSkill = 0
- local engineerSkill = 0
- local prof1, prof2 = GetProfessions()
- prof1 = prof1 or 0
- prof2 = prof2 or 0
- local _, _, skill1, _, _, _, skillLine1 = GetProfessionInfo(prof1)
- local _, _, skill2, _, _, _, skillLine2 = GetProfessionInfo(prof2)
- skillLine1 = skillLine1 or 0
- skillLine2 = skillLine2 or 0
- if skillLine1 == 197 then
- taylorSkill = skill1 or 0
- elseif skillLine2 == 197 then
- taylorSkill = skill2 or 0
- end
- if skillLine1 == 202 then
- engineerSkill = skill1 or 0
- elseif skillLine2 == 202 then
- engineerSkill = skill2 or 0
- end
- return taylorSkill, engineerSkill
- end
- -- Check if you have a Sea Mount
- function seaMount()
- zone = GetCurrentMapAreaID()
- for i=1,GetNumCompanions("MOUNT"),1 do
- local _, _, creatureSpellID = GetCompanionInfo("MOUNT", i)
- if creatureSpellID == 75207 and (zone == 614 or zone == 615 or zone == 610) then
- return(i)
- elseif creatureSpellID == 64731 or creatureSpellID == 98718 then
- return(i)
- end
- end
- return(0)
- end
- function HasZoneMounts(flying, riding, qiraji, searchMount, search)
- --check to see if special zone mounts are learned and process search
- for i=1,GetNumCompanions("MOUNT"),1 do
- local _, creatureName, creatureSpellID = GetCompanionInfo("MOUNT", i)
- if search ~= '' then
- if strfind(strlower(creatureName), strlower(search)) then
- if creatureSpellID ~= 75207 then
- tinsert(searchMount, i)
- end
- end
- end
- local chk = true
- -- Check if you have Qiraji Battle Tank
- if creatureSpellID == 25953 or creatureSpellID == 26054 or creatureSpellID == 26055 or creatureSpellID == 26056 or creatureSpellID == 26656 then
- chk = true
- -- Check if Mount in notWanted List
- for n, notW in ipairs(notWanted) do
- if strfind(strlower(creatureName), strlower(notW)) then
- chk = false
- break
- end
- end
- if chk then
- tinsert(qiraji, i)
- end
- else
- -- Check if Mount is Flying add to List
- if mountDict[creatureSpellID] then
- if mountDict[creatureSpellID][1] >= 2 then
- tinsert(flying, i)
- end
- if mountDict[creatureSpellID][1] == 1 or mountDict[creatureSpellID][1] == 3 then
- tinsert(riding, i)
- end
- else
- PrintHelp(creatureName .. " " .. creatureSpellID .. " not in table, please report Name and ID on http://www.curse.com/addons/wow/random-mount.", "FF00ff00")
- end
- end
- end
- return flying, riding, qiraji, searchMount
- end
- -- Check Locations List for Mount
- function LookForLocation(loc)
- local zone = GetRealZoneText()
- local miniMap = GetMinimapZoneText()
- -- Search Locations List
- for i, v in ipairs(locations) do
- if strfind(strlower(zone), strlower(v)) or strfind(strlower(miniMap), strlower(v)) then
- for j, k in ipairs(specialMounts) do
- for i=1,GetNumCompanions("MOUNT"),1 do
- local _, creatureName = GetCompanionInfo("MOUNT", i)
- if strfind(strlower(creatureName), strlower(k)) then
- return(true)
- end
- end
- end
- end
- end
- return(false)
- end
- -- Check Special Mounts
- function lfmChk(creatureName)
- if locationChk then
- for j, k in ipairs(specialMounts) do
- if strfind(strlower(creatureName), strlower(k)) then
- return(true)
- end
- end
- end
- return(false)
- end
- -- from http://lua-users.org/wiki/SplitJoin by PeterPrade
- function splitString(delimiter, text)
- local list = {}
- local pos = 1
- if strfind("", delimiter, 1) then -- this would result in endless loops
- error("delimiter matches empty string!")
- end
- while 1 do
- local first, last = strfind(text, delimiter, pos)
- if first then -- found?
- tinsert(list, strsub(text, pos, first-1))
- pos = last+1
- else
- tinsert(list, strsub(text, pos))
- break
- end
- end
- return list
- end
- -- Add Mount to Locations List
- function AddLocF(info)
- if string.len(info) > 0 then
- local i = strfind(info, ":");
- local locVar = strsub(info, 0, i - 1)
- local mntVar = splitString(",", strsub(info, i + 1));
- if not zones[strlower(locVar)] then
- zones[strlower(locVar)] = {}
- end
- for i, v in ipairs(mntVar) do
- local found = false
- for n, item in ipairs(zones[strlower(locVar)]) do
- if v == item then
- PrintHelp(v .. " already added.", "FF00ff00")
- found = true
- break
- end
- end
- if not found then
- tinsert(zones[strlower(locVar)], v)
- end
- end
- PrintHelp("When in " .. strlower(locVar) .. " mounts with " .. table.concat(zones[strlower(locVar)], ",") .. " will be summoned.", "FF00ff00")
- end
- end
- -- Print the Location List
- function printLocF()
- PrintHelp("Location Mount database", "FFff00ff")
- for i, v in pairs(zones) do
- PrintHelp(i .. ":", "FF00ff00")
- for j, w in ipairs(zones[i]) do
- PrintHelp(" " .. w, "FF00ff99")
- end
- end
- end
- -- Remove a Filtered Location
- function removeLocF(info)
- if string.len(info) > 0 then
- local i = strfind(info, ":");
- --if : not found then remove zone table
- if not i then
- PrintHelp("Zone " .. info .. " is no longer filtered.", "FF00ff00")
- zones[info] = nil
- else
- local locVar = strsub(info, 0, i - 1)
- local mntVar = splitString(",", strsub(info, i + 1))
- for i, v in ipairs(mntVar) do
- local found = false
- for n, item in ipairs(zones[locVar]) do
- if v == item then
- PrintHelp(v .. " removed from " .. locVar .. ".", "FF00ff99")
- tremove(zones[locVar], n)
- found = true
- break
- end
- end
- if not found then
- PrintHelp(v .. " not found in " .. locVar .. ".", "FF00ff99")
- end
- end
- if #zones[locVar] == 0 then
- PrintHelp(locVar .. " removed because it has no mounts.", "FF00ff00")
- zones[locVar] = nil
- end
- end
- end
- -- if : found then remove zone table elements, not entire table, if table is empty place * to signify empty
- end
- -- Change the Character Title
- function Title()
- if rndTitle then
- local titles = {};
- for i=1,GetNumTitles(),1 do
- if IsTitleKnown(i) == 1 then
- tinsert(titles, i)
- end
- end
- SetCurrentTitle(titles[random(# titles)])
- end
- end
- -- Check to see if we are Swimming or in Vashj'ir
- function checkSwimming()
- local zone = GetCurrentMapAreaID()
- if IsSwimming() then
- return(true)
- elseif not IsSwimming() and (zone == 614 or zone == 615 or zone == 610) then
- return(true)
- else
- return(false)
- end
- end
- -- Add mount to the No Summon List
- function dontSummon(r, numCompanions, searchMount)
- if numCompanions > 10 and GetCurrentMapAreaID() ~= 766 and not checkSwimming() and #(searchMount) == 0 and not removeMount then
- tinsert(nosummonlist, r)
- end
- if #(nosummonlist) > numCompanions/5 then
- tremove(nosummonlist, 1)
- end
- end
- -- Change the Macro Icon
- function Icon(r)
- if macroIcon then
- local _, _, _, icon = GetCompanionInfo("MOUNT", r)
- -- loop to change the icons of macros that are calling /rmount
- local numglobal,_ = GetNumMacros()
- for j=1,numglobal do
- local mbody = GetMacroBody(j)
- if strfind(mbody,"/rmount") or strfind(mbody,"/mnt") then
- EditMacro(j,nil,strsub(icon,17),nil)
- end
- end
- end
- end
- -- Main Mount Call
- function FindMount(arg1)
- local s = 0
- local r
- local qiraji = {} -- Clear qiraji list
- local flying = {} -- Clear flying list
- local riding = {} -- Clear riding list
- local search = ""
- local searchMount = {} -- Clear search list
- local zoneText = GetRealZoneText() -- Get Zone Text
- local canFly = CanFlyHere() -- Check if can fly
- local outdoors = IsOutdoors() -- Check if outdoors
- local ridingSK = GetRidingSkill() -- Set Riding Skill
- local taylorSkill, engineerSkill = GetProfessionSkill() -- Get Profession Skills
- local inLocation = false --Used to check for location
- local zoneChk = true
- local removeMountPrev = removeMount
- -- Check for Modifiers
- argv, _ = SecureCmdOptionParse(arg1)
- -- Check argument after /mnt or /rmount
- if argv == "help" then
- PrintHelp("Random Mount " .. version .. " optional flags:", "FFFFFF00")
- PrintHelp("mnt: rmount: Will summon riding/flying mounts in the appropriate areas. mnt and rmount are interchangeable", "FFFFFF00")
- PrintHelp("riding: Summons riding mounts in flying areas", "FFFFFF00")
- PrintHelp("flying: Attempt to summon a flying mount", "FFFFFF00")
- PrintHelp("help: Display help", "FFFFFF00")
- PrintHelp("[mod:Modifier Name]: Use any Modifier Blizzard Supports", "FFFFFF00")
- PrintHelp("r or f (search Term): Summons a mount based on specified search term \rexample: to summon a skeletal warhorse type: /mnt r skeletal \rto summon a proto-drake type: /mnt f proto", "FFFFFF00")
- PrintHelp("config: Prints the current configuration", "FFFFFF00")
- PrintHelp("rfilter: Toggle mount filtering", "FFFFFF00")
- PrintHelp("safefly: Toggle double click to dismount while flying", "FFFFFF00")
- PrintHelp("rfilters: List current filters", "FFFFFF00")
- PrintHelp("locfilter: Toggle filter to summon only specific mounts in specific locations", "FFFFFF00")
- PrintHelp("addloc % (zone:mount name1, mount name2, ...): Add locations and mounts to location checking. Separate mounts with commas. Use * as a wildcard to specify all mounts.", "FFFFFF00")
- PrintHelp("removeloc % (zone:mount name1, mount name2, ...): Removes locations and mounts from location checking. Separate mounts with commas.", "FFFFFF00")
- PrintHelp("loctable: Print the current location filtering table.", "FFFFFF00")
- PrintHelp("clearloc: Clears location filters", "FFFFFF00")
- PrintHelp("remove %: Remove all mounts matching % if rfilter is enabled", "FFFFFF00")
- PrintHelp("clear: Clears all filters", "FFFFFF00")
- PrintHelp("clearrem: Clears the mount removal table", "FFFFFF00")
- PrintHelp("whereami: Prints your zone and mini-map zone, and map coordinates.", "FFFFFF00")
- PrintHelp("title: Enable or disable random title change.", "FFFFFF00")
- PrintHelp("icon: Enable or disable changing random mount macro icons to the last summoned mount.", "FFFFFF00")
- PrintHelp("debug: Toggle debug printing for posting error messages", "FFFFFF00")
- PrintHelp("No Flag: Summon an appropriate mount for the area", "FFFFFF00")
- return
- elseif argv == "config" then
- if debug then
- PrintHelp("Debug: Enabled", "FF00ff00")
- else
- PrintHelp("Debug: Disabled", "FFff0000")
- end
- if removeMount then
- PrintHelp("Mounts filtered: " .. table.concat(notWanted, ", "), "FF00ff00")
- else
- PrintHelp("Mount Removal Disabled.", "FFff0000")
- end
- if safeFly then
- PrintHelp("Safe flying enabled. Double click to dismount while flying", "FF00ff00")
- else
- PrintHelp("Safe flying disabled.", "FFff0000")
- end
- if rndTitle then
- PrintHelp("Random title enabled.", "FF00ff00")
- else
- PrintHelp("Random title disabled.", "FFff0000")
- end
- if macroIcon then
- PrintHelp("Icon changing enabled.", "FF00ff00")
- else
- PrintHelp("Icon changing disabled.", "FFff0000")
- end
- return
- elseif argv == "whereami" then
- local posX, posY = GetPlayerMapPosition("player")
- PrintHelp("You are in " .. GetRealZoneText() .. ", " .. GetMinimapZoneText() .. ", " .. posX .. ", " .. posY, "FF00ff00")
- return
- elseif argv == "debug" then
- if debug == false then
- debug = true
- PrintHelp("Debug information enabled.", "FF00ff00")
- elseif debug == true then
- debug = false
- PrintHelp("Debug information disabled.", "FFff0000")
- end
- return
- elseif argv == "debug2" then
- if debug2 == false then
- debug2 = true
- debug = true
- PrintHelp("Debug2 information enabled. Your chat window will be spamed.", "FF00ff00")
- elseif debug2 == true then
- debug2 = false
- PrintHelp("Debug2 information disabled.", "FFff0000")
- end
- return
- elseif argv == "locfilter" then
- if locationChk == false then
- locationChk = true
- PrintHelp("Location mount filtering enabled.", "FF00ff00")
- elseif locationChk == true then
- locationChk = false
- PrintHelp("Location mount filtering disabled.", "FFff0000")
- end
- return
- elseif argv == "rfilter" then
- if removeMount == false then
- removeMount = true
- removeMountPrev = removeMount
- PrintHelp("Mount removal enabled.", "FF00ff00")
- elseif removeMount == true then
- removeMount = false
- removeMountPrev = removeMount
- PrintHelp("Mount removal disabled.", "FFff0000")
- end
- return
- elseif argv == "safefly" then
- if safeFly == false then
- safeFly = true
- PrintHelp("Safe flying enabled. Double click to dismount while flying", "FF00ff00")
- elseif safeFly == true then
- safeFly = false
- PrintHelp("Safe flying disabled.", "FFff0000")
- end
- return
- elseif argv == "rfilters" then
- if removeMount then
- PrintHelp("Mounts filtered: " .. table.concat(notWanted, ", "), "FF00ffff")
- else
- PrintHelp("Mount removal disabled.", "FFff0000")
- end
- return
- elseif argv == "title" then
- if rndTitle == false then
- rndTitle = true
- PrintHelp("Random title enabled.", "FF00ff00")
- elseif rndTitle == true then
- rndTitle = false
- PrintHelp("Random title disabled.", "FFff0000")
- end
- return
- elseif argv == "icon" then
- if macroIcon == false then
- macroIcon = true
- PrintHelp("Icon changing enabled.", "FF00ff00")
- elseif macroIcon == true then
- macroIcon = false
- PrintHelp("Icon changing disabled.", "FFff0000")
- end
- return
- elseif argv == "clear" then
- notWanted = {}
- zones = {}
- PrintHelp("All tables cleared.", "FF00ffff")
- return
- elseif argv == "clearrem" then
- notWanted = {}
- PrintHelp("Remove mount table cleared.", "FF00ffff")
- return
- elseif argv == "clearloc" then
- zones = {}
- PrintHelp("Special location table cleared.", "FF00ffff")
- return
- elseif argv == "loctable" then
- printLocF()
- return
- elseif argv:find("removeloc") then
- PrintHelp(strsub(argv, 11), "FF00ff99")
- if string.len(strsub(argv, 11)) > 0 then
- removeLocF(strsub(argv, 11))
- end
- return
- elseif argv == "riding" then
- canFly = false
- elseif argv == "flying" then
- if ridingSK < 225 then
- canFly = false
- else
- canFly = true
- end
- elseif argv:find("addloc") then
- if string.len(strsub(argv, 8)) > 0 then
- AddLocF(strsub(argv, 8))
- end
- return
- elseif argv:find("remove") then
- local found = false
- if strlen(strsub(argv, 8)) > 0 then
- for n, notW in ipairs(notWanted) do
- if strsub(argv, 8) == notW then
- PrintHelp(strsub(argv, 8) .. " already added.", "FF00ffff")
- found = true
- break
- end
- end
- --PrintHelp(table.concat(notWanted, ", "), "FF00ffff")
- if not found then
- PrintHelp("Mounts matching " .. strsub(argv, 8) .. " will no longer be summoned.", "FF00ff00")
- tinsert(notWanted, strsub(argv, 8))
- end
- end
- return
- elseif argv == "rnd" then
- r = random(GetNumCompanions("MOUNT"))
- PrintHelp(r, "FF00ffff")
- elseif strfind(argv, "r%s", 1) then
- canFly = false
- search = strlower(strsub(argv, 3))
- elseif strfind(argv, "f%s", 1) then
- canFly = CanFlyHere()
- if canFly then
- search = strlower(strsub(argv, 3))
- end
- elseif argv == '' then
- search = argv
- else
- PrintHelp("No matching mount found.", "FF00ffff")
- return
- end
- -- Check if we are Mounted
- if IsMounted() then
- if safeFly and IsFlying() then
- local curTime = GetTime()
- if curTime < (lastTime + 0.5) then
- Dismount()
- return
- else
- lastTime = curTime
- return
- end
- else
- Dismount()
- return
- end
- elseif UnitInVehicle(UnitName("player")) then
- VehicleExit()
- return
- end
- -- Run Random Title
- Title()
- -- Get Number of Mounts
- numCompanions = GetNumCompanions("MOUNT")
- -- Check if you have the Appropriate Riding Skill
- if ridingSK >= 75 then
- -- Check for Zone Mounts
- local flying, riding, qiraji, searchMount = HasZoneMounts(flying, riding, qiraji, searchMount, search)
- -- Process Search Mount
- if search ~= '' and #searchMount == 0 then
- PrintHelp("No matching mount found.", "FF00ffff")
- return
- end
- if #(flying) == 0 then
- canFly = false
- end
- -- Check if you Can Fly, IsUsableSpell used for swimming on surface check
- if canFly and IsUsableSpell(88744) then
- -- Repeat picking a Mount until one is found that is appropriate
- for i=0, 1000, 1 do
- r = random(numCompanions)
- -- Test Mount
- s = TestMount(r, ridingSK, zoneText, canFly, flying, qiraji, searchMount, debug, inLocation, zoneChk, taylorSkill, engineerSkill)
- if s then
- break
- end
- end
- -- Summon Mount
- CallCompanion("MOUNT", r)
- -- Check if Summon Failed
- if mountError then
- canFly = false
- -- Check if you are Swimming
- if checkSwimming() then
- -- Get Sea Mount
- r = seaMount()
- -- Check if you have a Sea Mount
- if r ~= 0 then
- CallCompanion("MOUNT", r)
- -- Check if Summon Failed
- if mountErrorMsg ~= SPELL_FAILED_ONLY_UNDERWATER then
- -- Set the Icon of the Sea Mount
- Icon(r)
- return
- end
- end
- end
- -- Reset mountError
- mountError = false
- -- Repeat picking a Mount until one is found that is appropriate
- for i=0, 1000, 1 do
- r = random(numCompanions)
- -- Test Mount
- s = TestMount(r, ridingSK, zoneText, canFly, flying, qiraji, searchMount, debug, inLocation, zoneChk, taylorSkill, engineerSkill)
- if s then
- break
- end
- end
- -- Summon Mount
- CallCompanion("MOUNT", r)
- -- Check if Summon Failed
- if mountError then
- PrintHelp("Cannot Summon Mount", "FFff0000")
- end
- end
- else
- -- Check if you are Swimming
- if checkSwimming() then
- -- Get Sea Mount
- r = seaMount()
- -- Check if you have a Sea Mount
- if r ~= 0 then
- CallCompanion("MOUNT", r)
- -- Check if Summon Failed
- if mountErrorMsg ~= SPELL_FAILED_ONLY_UNDERWATER then
- -- Set the Icon of the Sea Mount
- Icon(r)
- return
- end
- end
- end
- mountError = false
- if #(riding) ~= 0 and outdoors and not InCombatLockdown() then
- -- Repeat picking a Mount until one is found that is appropriate
- for i=0, 1000, 1 do
- r = random(numCompanions)
- -- Test Mount
- s = TestMount(r, ridingSK, zoneText, canFly, flying, qiraji, searchMount, debug, inLocation, zoneChk, taylorSkill, engineerSkill)
- if s then
- break
- end
- end
- -- Summon Mount
- CallCompanion("MOUNT", r)
- -- Check if Summon Failed
- if mountError then
- PrintHelp("Cannot Summon Mount", "FFff0000")
- end
- end
- end
- -- Set Icon of the Mount
- Icon(r)
- return
- end
- end
- -- Test the Mount
- function TestMount(r, ridingSK, zoneText, canFly, flying, qiraji, searchMount, debug, inLocation, zoneChk, taylorSkill, engineerSkill)
- local _, creatureName, creatureSpellID = GetCompanionInfo("MOUNT", r)
- local mv
- -- Check if Mount is in Database
- if mountDict[creatureSpellID] then
- -- Get the Mount type
- mv = mountDict[creatureSpellID][1]
- -- Check if Mount exists in Database
- if mv then
- -- Check if unusable (does not ensure it's usable)
- usable = IsUsableSpell(creatureSpellID)
- if not usable then
- return false
- end
- -- Check Search List
- if #(searchMount) > 0 then
- if tContains(searchMount, r) then
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 12) end
- return(true)
- else
- return(false)
- end
- end
- --Remove Mount processing
- if removeMount then
- for n, notW in ipairs(notWanted) do
- if strfind(strlower(creatureName), strlower(notW)) or creatureSpellID == tonumber(notW) then
- return(false)
- end
- end
- end
- --Zone Checking
- if locationChk and zoneChk then
- realZone = GetCurrentMapAreaID()
- miniMapZone = GetMinimapZoneText()
- local found = false
- if zones[strlower(miniMapZone)] then
- zoneChk = false
- for i, type in ipairs(zones[strlower(miniMapZone)]) do
- if strfind(strlower(creatureName), strlower(type)) or type == "*" then
- zoneChk = true
- found = true
- if debug then PrintHelp(type .. " : " .. creatureName .. " is found", "FFffff00") end
- break
- end
- end
- end
- -- Check your Zone
- if zones[strlower(realZone)] then
- if not found then
- zoneChk = false
- for i, type in ipairs(zones[strlower(realZone)]) do
- if strfind(strlower(creatureName), strlower(type)) or type == "*" then
- zoneChk = true
- if debug then PrintHelp(type .. " : " .. creatureName .. " is found", "FFffff00") end
- break
- end
- end
- end
- end
- if not zoneChk then
- return(false)
- end
- end
- --profession mounts
- if (creatureSpellID == 44153 and engineerSkill < 300) or
- (creatureSpellID == 44151 and engineerSkill < 375) or
- (creatureSpellID == 61451 and taylorSkill < 300) or
- (creatureSpellID == 75596 and taylorSkill < 425) or
- (creatureSpellID == 61309 and taylorSkill < 425) then
- return(false)
- end
- --flying mounts
- if canFly and #flying > 0 and ridingSK >= 225 then
- if mv >= 2 then
- if inLocation then
- if lfmChk(creatureName) then
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 11) end
- return(true)
- end
- else
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 10) end
- return(true)
- end
- end
- --zone specific mounts
- elseif realZone == 766 and #qiraji > 0 then
- if ridingSK >= 150 and mv == 1 then
- if inLocation then
- if lfmChk(creatureName) then
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 36) end
- return(true)
- end
- elseif creatureSpellID == 25953 or creatureSpellID == 26054 or creatureSpellID == 26055 or creatureSpellID == 26056 or creatureSpellID == 26656 then
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 35) end
- return(true)
- end
- end
- --Regular Mounts
- elseif not canFly and ridingSK >= 75 and creatureSpellID ~= 64731 and creatureSpellID ~= 75207 and creatureSpellID ~= 98718 and creatureSpellID ~= 25953 and creatureSpellID ~= 26054 and creatureSpellID ~= 26055 and creatureSpellID ~= 26056 and creatureSpellID ~= 26656 then
- if mv ~= 2 then
- if inLocation then
- if lfmChk(creatureName) then
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 51) end
- return(true)
- end
- else
- if debug then PrintSummon("FF00ffff", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 50) end
- return(true)
- end
- end
- end
- if debug2 then
- PrintSummon("FFffff99", creatureName, r, ridingSK, mountDict[creatureSpellID][1], zoneText, canFly, creatureSpellID, 00)
- end
- end
- end
- end
- -- Print Help
- function PrintHelp(cmd, color)
- print(format('|c%s%s|r', color, cmd))
- end
- -- Print in Summon Color
- function PrintSummon(color, creatureName, r, ridingSK, creatureDict, zoneText, canFly, creatureSpellID, mountNum)
- canFly = tostring(canFly)
- print(format("|c%s%s - Mnt#:%s - Skill: %s - type:%s - %s - %s - flyZone:%s - cID:%s - cond:%s|r", color, creatureName, r, ridingSK, creatureDict, zoneText, GetMinimapZoneText(), canFly, creatureSpellID, mountNum))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement