comparison 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
comparison
equal deleted inserted replaced
51:9d3c8c1e84f3 52:64e8f8e5fa41
1 -- Copyright (c) 2012, Syzler 1 -- Copyright (c) 2015, Syzler
2 -- All rights reserved. 2 -- All rights reserved.
3 -- 3 --
4 -- Redistribution and use in source and binary forms, with or without 4 -- Redistribution and use in source and binary forms, with or without
5 -- modification, are permitted provided that the following conditions 5 -- modification, are permitted provided that the following conditions
6 -- are met: 6 -- are met:
117 [26656] = "GQ"; -- black qiraji battle tank 117 [26656] = "GQ"; -- black qiraji battle tank
118 [92155] = "GQ"; -- ultramarine qiraji battle tank 118 [92155] = "GQ"; -- ultramarine qiraji battle tank
119 [75207] = "V"; -- abyssal seahorse 119 [75207] = "V"; -- abyssal seahorse
120 }; 120 };
121 121
122 --- Checks whether or not the specified spell ID is a ground mount. 122 --- OBSOLETE. Checks whether or not the specified spell ID is a ground mount.
123 -- @param spellId The spell ID of the mount to be checked. 123 -- @param spellId The spell ID of the mount to be checked.
124 -- @return A Boolean value indicating whether or not the specified spell is a ground mount. 124 -- @return A Boolean value indicating whether or not the specified spell is a ground mount.
125 function MyLilPony.IsGroundMount(spellId) 125 function MyLilPony.IsGroundMount(spellId)
126 local entry = MyLilPony_Mounts[spellId]; 126 local entry = MyLilPony_Mounts[spellId];
127 return entry ~= nil and string.match(entry, "G"); 127 return entry ~= nil and string.match(entry, "G");
128 end 128 end
129 129
130 --- Checks whether or not the specified spell ID is a flying mount. 130 --- OBSOLETE. Checks whether or not the specified spell ID is a flying mount.
131 -- @param spellId The spell ID of the mount to be checked. 131 -- @param spellId The spell ID of the mount to be checked.
132 -- @return A Boolean value indicating whether or not the specified spell is a flying mount. 132 -- @return A Boolean value indicating whether or not the specified spell is a flying mount.
133 function MyLilPony.IsFlyingMount(spellId) 133 function MyLilPony.IsFlyingMount(spellId)
134 local entry = MyLilPony_Mounts[spellId]; 134 local entry = MyLilPony_Mounts[spellId];
135 return entry ~= nil and string.match(entry, "A"); 135 return entry ~= nil and string.match(entry, "A");
136 end 136 end
137 137
138 --- Checks whether or not the specified spell ID is an aquatic mount. 138 --- OBSOLETE. Checks whether or not the specified spell ID is an aquatic mount.
139 -- @param spellId The spell ID of the mount to be checked. 139 -- @param spellId The spell ID of the mount to be checked.
140 -- @return A Boolean value indicating whether or not the specified spell is an aquatic mount. 140 -- @return A Boolean value indicating whether or not the specified spell is an aquatic mount.
141 function MyLilPony.IsAquaticMount(spellId) 141 function MyLilPony.IsAquaticMount(spellId)
142 local entry = MyLilPony_Mounts[spellId]; 142 local entry = MyLilPony_Mounts[spellId];
143 return entry ~= nil and string.match(entry, "S"); 143 return entry ~= nil and string.match(entry, "S");
144 end 144 end
145 145
146 --- Checks whether or not the specified spell ID is a Temple of Ahn'Qiraj mount. 146 --- OBSOLETE. Checks whether or not the specified spell ID is a Temple of Ahn'Qiraj mount.
147 -- @param spellId The spell ID of the mount to be checked. 147 -- @param spellId The spell ID of the mount to be checked.
148 -- @return A Boolean value indicating whether or not the specified spell is a Temple of Ahn'Qiraj mount. 148 -- @return A Boolean value indicating whether or not the specified spell is a Temple of Ahn'Qiraj mount.
149 function MyLilPony.IsAhnQirajMount(spellId) 149 function MyLilPony.IsAhnQirajMount(spellId)
150 local entry = MyLilPony_Mounts[spellId]; 150 local entry = MyLilPony_Mounts[spellId];
151 return entry ~= nil and string.match(entry, "Q"); 151 return entry ~= nil and string.match(entry, "Q");
152 end 152 end
153 153
154 --- Checks whether or not the specified spell ID is a Vashj'ir mount. 154 --- OBSOLETE. Checks whether or not the specified spell ID is a Vashj'ir mount.
155 -- @param spellId The spell ID of the mount to be checked. 155 -- @param spellId The spell ID of the mount to be checked.
156 -- @return A Boolean value indicating whether or not the specified spell is a Vashj'ir mount. 156 -- @return A Boolean value indicating whether or not the specified spell is a Vashj'ir mount.
157 function MyLilPony.IsVashjirMount(spellId) 157 function MyLilPony.IsVashjirMount(spellId)
158 local entry = MyLilPony_Mounts[spellId]; 158 local entry = MyLilPony_Mounts[spellId];
159 return entry ~= nil and string.match(entry, "V"); 159 return entry ~= nil and string.match(entry, "V");
160 end 160 end
161
162 --- Checks whether or not the specified slot ID is a ground mount.
163 -- @param slotID The slot ID of the mount to be checked.
164 -- @return A Boolean value indicating whether or not the specified mount is a ground mount.
165 function MyLilPony.IsGroundMountSlot(slotID)
166 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
167 return mountType == 230 or mountType == 284;
168 end
169
170 --- Checks whether or not the specified slot ID is a flying mount.
171 -- @param slotID The slot ID of the mount to be checked.
172 -- @return A Boolean value indicating whether or not the specified mount is a flying mount.
173 function MyLilPony.IsFlyingMountSlot(slotID)
174 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
175 return mountType ==247 or mountType == 248;
176 end
177
178 --- Checks whether or not the specified slot ID is an aquatic mount.
179 -- @param slotID The slot ID of the mount to be checked.
180 -- @return A Boolean value indicating whether or not the specified mount is an aquatic mount.
181 function MyLilPony.IsAquaticMountSlot(slotID)
182 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
183 return mountType == 231 or mountType == 254;
184 end
185
186 --- Checks whether or not the specified slot ID is a Temple of Ahn'Qiraj mount.
187 -- @param slotID The slot ID of the mount to be checked.
188 -- @return A Boolean value indicating whether or not the specified mount is a Temple of Ahn'Qiraj mount.
189 function MyLilPony.IsAhnQirajMountSlot(slotID)
190 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
191 return mountType == 241;
192 end
193
194 --- Checks whether or not the specified slot ID is a Vashj'ir mount.
195 -- @param slotID The slot ID of the mount to be checked.
196 -- @return A Boolean value indicating whether or not the specified mount is a Vashj'ir mount.
197 function MyLilPony.IsVashjirMountSlot(slotID)
198 local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID);
199 return mountType == 232 or mountType == 231 or mountType == 254;
200 end