annotate libMyLilPony/libMyLilPony_mountData.lua @ 52:64e8f8e5fa41

Simplified some functions since mount type is can be determined from slot ID
author syzler
date Sat, 07 Mar 2015 14:15:17 -0500
parents 83e9649a6606
children 81145a681a59
rev   line source
syzler@52 1 -- Copyright (c) 2015, Syzler
syzler@14 2 -- All rights reserved.
syzler@1 3 --
syzler@14 4 -- Redistribution and use in source and binary forms, with or without
syzler@14 5 -- modification, are permitted provided that the following conditions
syzler@14 6 -- are met:
syzler@1 7 --
syzler@14 8 -- * Redistributions of source code must retain the above copyright
syzler@14 9 -- notice, this list of conditions and the following disclaimer.
syzler@14 10 -- * Redistributions in binary form must reproduce the above copyright
syzler@14 11 -- notice, this list of conditions and the following disclaimer in
syzler@14 12 -- the documentation and/or other materials provided with the
syzler@14 13 -- distribution.
syzler@14 14 -- * Neither the name of the MyLilPony Project nor the names of its
syzler@14 15 -- contributors may be used to endorse or promote products derived
syzler@14 16 -- from this software without specific prior written permission.
syzler@1 17 --
syzler@14 18 -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
syzler@14 19 -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
syzler@14 20 -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
syzler@14 21 -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
syzler@14 22 -- COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
syzler@14 23 -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
syzler@14 24 -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
syzler@14 25 -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
syzler@14 26 -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
syzler@14 27 -- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
syzler@14 28 -- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
syzler@14 29 -- POSSIBILITY OF SUCH DAMAGE.
syzler@1 30
syzler@15 31 ------------------------------------------------------------------------
syzler@15 32 -- Project: libMyLilPony
syzler@15 33 -- Project Version: @project-version@
syzler@15 34 -- Last Author: @file-author@
syzler@15 35 -- Last Updated: @file-date-iso@
syzler@15 36 --
syzler@1 37 -- Mount data table and API functions for checking type of mount
syzler@15 38 ------------------------------------------------------------------------
syzler@1 39
syzler@1 40 local MyLilPony_Mounts = {
syzler@1 41 -- standard ground mounts
syzler@1 42 [458] = "G"; [470] = "G"; [472] = "G"; [579] = "G"; [580] = "G"; [5784] = "G"; [6648] = "G";
syzler@1 43 [6653] = "G"; [6654] = "G"; [6777] = "G"; [6898] = "G"; [6899] = "G"; [8394] = "G"; [8395] = "G";
syzler@1 44 [10789] = "G"; [10793] = "G"; [10795] = "G"; [10796] = "G"; [10799] = "G"; [10873] = "G";
syzler@1 45 [10969] = "G"; [13819] = "G"; [15779] = "G"; [15780] = "G"; [15781] = "G"; [16055] = "G";
syzler@1 46 [16056] = "G"; [16058] = "G"; [16059] = "G"; [16060] = "G"; [16080] = "G"; [16081] = "G";
syzler@1 47 [16082] = "G"; [16083] = "G"; [16084] = "G"; [17229] = "G"; [17450] = "G"; [17453] = "G";
syzler@1 48 [17454] = "G"; [17455] = "G"; [17456] = "G"; [17458] = "G"; [17459] = "G"; [17460] = "G";
syzler@1 49 [17461] = "G"; [17462] = "G"; [17463] = "G"; [17464] = "G"; [17465] = "G"; [17481] = "G";
syzler@1 50 [18363] = "G"; [18989] = "G"; [18990] = "G"; [18991] = "G"; [18992] = "G"; [22717] = "G";
syzler@1 51 [22718] = "G"; [22719] = "G"; [22720] = "G"; [22721] = "G"; [22722] = "G"; [22723] = "G";
syzler@1 52 [22724] = "G"; [23161] = "G"; [23214] = "G"; [23219] = "G"; [23220] = "G"; [23221] = "G";
syzler@1 53 [23222] = "G"; [23223] = "G"; [23225] = "G"; [23227] = "G"; [23228] = "G"; [23229] = "G";
syzler@1 54 [23238] = "G"; [23239] = "G"; [23240] = "G"; [23241] = "G"; [23242] = "G"; [23243] = "G";
syzler@1 55 [23246] = "G"; [23247] = "G"; [23248] = "G"; [23249] = "G"; [23250] = "G"; [23251] = "G";
syzler@1 56 [23252] = "G"; [23338] = "G"; [23509] = "G"; [23510] = "G"; [24242] = "G"; [24252] = "G";
syzler@1 57 [30174] = "G"; [33630] = "G"; [33660] = "G"; [34406] = "G"; [34407] = "G"; [34767] = "G";
syzler@1 58 [34769] = "G"; [34790] = "G"; [34795] = "G"; [34896] = "G"; [34897] = "G"; [34898] = "G";
syzler@1 59 [34899] = "G"; [35018] = "G"; [35020] = "G"; [35022] = "G"; [35025] = "G"; [35027] = "G";
syzler@1 60 [35028] = "G"; [35710] = "G"; [35711] = "G"; [35712] = "G"; [35713] = "G"; [35714] = "G";
syzler@1 61 [36702] = "G"; [39315] = "G"; [39316] = "G"; [39317] = "G"; [39318] = "G"; [39319] = "G";
syzler@1 62 [41252] = "G"; [42776] = "G"; [42777] = "G"; [43688] = "G"; [43899] = "G"; [43900] = "G";
syzler@1 63 [46628] = "G"; [47037] = "G"; [48027] = "G"; [48778] = "G"; [48954] = "G"; [49322] = "G";
syzler@1 64 [49378] = "G"; [49379] = "G"; [50281] = "G"; [50869] = "G"; [51412] = "G"; [54753] = "G";
syzler@1 65 [55531] = "G"; [59572] = "G"; [59573] = "G"; [59785] = "G"; [59788] = "G"; [59791] = "G";
syzler@1 66 [59793] = "G"; [59797] = "G"; [59799] = "G"; [59802] = "G"; [59804] = "G"; [59810] = "G";
syzler@1 67 [59811] = "G"; [60114] = "G"; [60116] = "G"; [60118] = "G"; [60119] = "G"; [60136] = "G";
syzler@1 68 [60140] = "G"; [60424] = "G"; [61425] = "G"; [61447] = "G"; [61465] = "G"; [61466] = "G";
syzler@1 69 [61467] = "G"; [61469] = "G"; [61470] = "G"; [63232] = "G"; [63234] = "G"; [63635] = "G";
syzler@1 70 [63636] = "G"; [63637] = "G"; [63638] = "G"; [63639] = "G"; [63640] = "G"; [63641] = "G";
syzler@1 71 [63642] = "G"; [63643] = "G"; [64657] = "G"; [64658] = "G"; [64659] = "G"; [64977] = "G";
syzler@1 72 [65637] = "G"; [65638] = "G"; [65639] = "G"; [65640] = "G"; [65641] = "G"; [65642] = "G";
syzler@1 73 [65643] = "G"; [65644] = "G"; [65645] = "G"; [65646] = "G"; [66091] = "G"; [66846] = "G";
syzler@1 74 [66847] = "G"; [66906] = "G"; [67466] = "G"; [68056] = "G"; [68188] = "G"; [73313] = "G";
syzler@1 75 [74918] = "G"; [87090] = "G"; [87091] = "G"; [88748] = "G"; [88749] = "G"; [88750] = "G";
syzler@31 76 [92231] = "G"; [96491] = "G"; [96499] = "G"; [97390] = "G"; [97581] = "G"; [98204] = "G";
syzler@41 77 [100332] = "G"; [100333] = "G"; [101542] = "G"; [101573] = "G"; [102346] = "G"; [102349] = "G";
syzler@44 78 [102350] = "G"; [102488] = "G"; [103081] = "G"; [103195] = "G"; [103196] = "G"; [118089] = "G";
syzler@44 79 [120822] = "G"; [122708] = "G"; [123160] = "G"; [123182] = "G"; [123886] = "G";
syzler@1 80
syzler@1 81 -- standard flying mounts
syzler@1 82 [3363] = "A"; [28828] = "A"; [32235] = "A"; [32239] = "A"; [32240] = "A"; [32242] = "A";
syzler@1 83 [32243] = "A"; [32244] = "A"; [32245] = "A"; [32246] = "A"; [32289] = "A"; [32290] = "A";
syzler@1 84 [32292] = "A"; [32295] = "A"; [32296] = "A"; [32297] = "A"; [32345] = "A"; [33176] = "A";
syzler@1 85 [33182] = "A"; [33184] = "A"; [37011] = "A"; [37015] = "A"; [39798] = "A"; [39800] = "A";
syzler@1 86 [39801] = "A"; [39802] = "A"; [39803] = "A"; [40192] = "A"; [41513] = "A"; [41514] = "A";
syzler@1 87 [41515] = "A"; [41516] = "A"; [41517] = "A"; [41518] = "A"; [43810] = "A"; [43927] = "A";
syzler@1 88 [44151] = "A"; [44153] = "A"; [44221] = "A"; [44229] = "A"; [44317] = "A"; [44744] = "A";
syzler@1 89 [46197] = "A"; [46199] = "A"; [49193] = "A"; [51960] = "A"; [54729] = "A"; [55164] = "A";
syzler@1 90 [58615] = "A"; [59567] = "A"; [59568] = "A"; [59569] = "A"; [59570] = "A"; [59571] = "A";
syzler@1 91 [59650] = "A"; [59961] = "A"; [59976] = "A"; [59996] = "A"; [60002] = "A"; [60021] = "A";
syzler@1 92 [60024] = "A"; [60025] = "A"; [61229] = "A"; [61230] = "A"; [61294] = "A"; [61309] = "A";
syzler@1 93 [61442] = "A"; [61444] = "A"; [61446] = "A"; [61451] = "A"; [61996] = "A"; [61997] = "A";
syzler@1 94 [62048] = "A"; [63796] = "A"; [63844] = "A"; [63956] = "A"; [63963] = "A"; [64927] = "A";
syzler@1 95 [65439] = "A"; [66087] = "A"; [66088] = "A"; [67336] = "A"; [69395] = "A"; [71342] = "A";
syzler@1 96 [71810] = "A"; [72807] = "A"; [72808] = "A"; [74856] = "A"; [75596] = "A"; [75973] = "A";
syzler@1 97 [88331] = "A"; [88335] = "A"; [88718] = "A"; [88741] = "A"; [88742] = "A"; [88744] = "A";
syzler@31 98 [88746] = "A"; [88990] = "A"; [93463] = "A"; [93623] = "A"; [96503] = "A"; [97359] = "A";
syzler@41 99 [97493] = "A"; [97501] = "A"; [97560] = "A"; [101282] = "A"; [101821] = "A"; [102514] = "A";
syzler@41 100 [107516] = "A"; [107517] = "A"; [107842] = "A"; [107844] = "A"; [107845] = "A"; [110039] = "A";
syzler@44 101 [113120] = "A"; [113199] = "A"; [118737] = "A"; [120043] = "A"; [121820] = "A"; [121836] = "A";
syzler@44 102 [121837] = "A"; [121838] = "A"; [121839] = "A"; [123992] = "A"; [123993] = "A";
syzler@1 103
syzler@1 104 -- special mounts
syzler@1 105 [48025] = "AG"; -- headless horseman's mount
syzler@1 106 [72286] = "AG"; -- invincible (king lichy's mount)
syzler@1 107 [75614] = "AG"; -- celestial steed
syzler@31 108 [98727] = "AG"; -- winged guardian
syzler@41 109 [107203] = "AG"; -- tyrael's charger
syzler@41 110 [110051] = "AG"; -- heart of the aspects
syzler@1 111 [64731] = "SV"; -- sea turtle
syzler@31 112 [98718] = "SV"; -- subdued seahorse
syzler@1 113 [25953] = "Q"; -- blue qiraji battle tank
syzler@1 114 [26054] = "Q"; -- red qiraji battle tank
syzler@1 115 [26055] = "Q"; -- yellow qiraji battle tank
syzler@1 116 [26056] = "Q"; -- green qiraji battle tank
syzler@1 117 [26656] = "GQ"; -- black qiraji battle tank
syzler@1 118 [92155] = "GQ"; -- ultramarine qiraji battle tank
syzler@1 119 [75207] = "V"; -- abyssal seahorse
syzler@1 120 };
syzler@1 121
syzler@52 122 --- OBSOLETE. Checks whether or not the specified spell ID is a ground mount.
syzler@7 123 -- @param spellId The spell ID of the mount to be checked.
syzler@7 124 -- @return A Boolean value indicating whether or not the specified spell is a ground mount.
syzler@1 125 function MyLilPony.IsGroundMount(spellId)
syzler@1 126 local entry = MyLilPony_Mounts[spellId];
syzler@1 127 return entry ~= nil and string.match(entry, "G");
syzler@1 128 end
syzler@1 129
syzler@52 130 --- OBSOLETE. Checks whether or not the specified spell ID is a flying mount.
syzler@7 131 -- @param spellId The spell ID of the mount to be checked.
syzler@7 132 -- @return A Boolean value indicating whether or not the specified spell is a flying mount.
syzler@1 133 function MyLilPony.IsFlyingMount(spellId)
syzler@1 134 local entry = MyLilPony_Mounts[spellId];
syzler@1 135 return entry ~= nil and string.match(entry, "A");
syzler@1 136 end
syzler@1 137
syzler@52 138 --- OBSOLETE. Checks whether or not the specified spell ID is an aquatic mount.
syzler@7 139 -- @param spellId The spell ID of the mount to be checked.
syzler@7 140 -- @return A Boolean value indicating whether or not the specified spell is an aquatic mount.
syzler@1 141 function MyLilPony.IsAquaticMount(spellId)
syzler@1 142 local entry = MyLilPony_Mounts[spellId];
syzler@1 143 return entry ~= nil and string.match(entry, "S");
syzler@1 144 end
syzler@1 145
syzler@52 146 --- OBSOLETE. Checks whether or not the specified spell ID is a Temple of Ahn'Qiraj mount.
syzler@7 147 -- @param spellId The spell ID of the mount to be checked.
syzler@7 148 -- @return A Boolean value indicating whether or not the specified spell is a Temple of Ahn'Qiraj mount.
syzler@1 149 function MyLilPony.IsAhnQirajMount(spellId)
syzler@1 150 local entry = MyLilPony_Mounts[spellId];
syzler@1 151 return entry ~= nil and string.match(entry, "Q");
syzler@1 152 end
syzler@1 153
syzler@52 154 --- OBSOLETE. Checks whether or not the specified spell ID is a Vashj'ir mount.
syzler@7 155 -- @param spellId The spell ID of the mount to be checked.
syzler@48 156 -- @return A Boolean value indicating whether or not the specified spell is a Vashj'ir mount.
syzler@1 157 function MyLilPony.IsVashjirMount(spellId)
syzler@1 158 local entry = MyLilPony_Mounts[spellId];
syzler@1 159 return entry ~= nil and string.match(entry, "V");
syzler@1 160 end
syzler@52 161
syzler@52 162 --- Checks whether or not the specified slot ID is a ground mount.
syzler@52 163 -- @param slotID The slot ID of the mount to be checked.
syzler@52 164 -- @return A Boolean value indicating whether or not the specified mount is a ground mount.
syzler@52 165 function MyLilPony.IsGroundMountSlot(slotID)
syzler@52 166 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
syzler@52 167 return mountType == 230 or mountType == 284;
syzler@52 168 end
syzler@52 169
syzler@52 170 --- Checks whether or not the specified slot ID is a flying mount.
syzler@52 171 -- @param slotID The slot ID of the mount to be checked.
syzler@52 172 -- @return A Boolean value indicating whether or not the specified mount is a flying mount.
syzler@52 173 function MyLilPony.IsFlyingMountSlot(slotID)
syzler@52 174 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
syzler@52 175 return mountType ==247 or mountType == 248;
syzler@52 176 end
syzler@52 177
syzler@52 178 --- Checks whether or not the specified slot ID is an aquatic mount.
syzler@52 179 -- @param slotID The slot ID of the mount to be checked.
syzler@52 180 -- @return A Boolean value indicating whether or not the specified mount is an aquatic mount.
syzler@52 181 function MyLilPony.IsAquaticMountSlot(slotID)
syzler@52 182 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
syzler@52 183 return mountType == 231 or mountType == 254;
syzler@52 184 end
syzler@52 185
syzler@52 186 --- Checks whether or not the specified slot ID is a Temple of Ahn'Qiraj mount.
syzler@52 187 -- @param slotID The slot ID of the mount to be checked.
syzler@52 188 -- @return A Boolean value indicating whether or not the specified mount is a Temple of Ahn'Qiraj mount.
syzler@52 189 function MyLilPony.IsAhnQirajMountSlot(slotID)
syzler@52 190 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
syzler@52 191 return mountType == 241;
syzler@52 192 end
syzler@52 193
syzler@52 194 --- Checks whether or not the specified slot ID is a Vashj'ir mount.
syzler@52 195 -- @param slotID The slot ID of the mount to be checked.
syzler@52 196 -- @return A Boolean value indicating whether or not the specified mount is a Vashj'ir mount.
syzler@52 197 function MyLilPony.IsVashjirMountSlot(slotID)
syzler@52 198 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
syzler@52 199 return mountType == 232 or mountType == 231 or mountType == 254;
syzler@52 200 end