Thread Tools Display Modes
Prev Previous Post   Next Post Next
03-04-17, 04:02 AM   #1
Uggers
A Fallenroot Satyr
 
Uggers's Avatar
Join Date: May 2008
Posts: 26
Mount Journal Help

Hiya,

I'm trying to get an addon working properly again called MountManager, With the legion C_MountJournal changes I made some edits to get the addon working again from a functionality point of view.

The scanning function of the addon to check the journal I believe is this portion of the LUA

Lua Code:
  1. function MountManager:ScanForNewMounts()
  2.     local newMounts = 0
  3.     for index = 1,C_MountJournal.GetNumMounts() do
  4.         local _, spellID, _, _, _, _, _, isFactionSpecific, faction, _, isCollected = C_MountJournal.GetMountInfoByID(index)
  5.         --make sure its valid and not already found
  6.         local correctFaction = not isFactionSpecific or (self.db.char.faction == "Horde" and faction == 0) or (self.db.char.faction == "Alliance" and faction == 1)
  7.         if correctFaction == true and isCollected == true and not self:MountExists(spellID) then
  8.             newMounts = newMounts + 1
  9.            
  10.             local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(index)
  11.            
  12.             -- 269 for 2 Water Striders (Azure and Crimson)
  13.             -- 254 for 1 Subdued Seahorse (Vashj'ir and water)
  14.             -- 248 for 163 "typical" flying mounts, including those that change based on level
  15.             -- 247 for 1 Red Flying Cloud (flying mount)
  16.             -- 242 for 1 Swift Spectral Gryphon (the one we fly while dead)
  17.             -- 241 for 4 Qiraji Battle Tanks (AQ only)
  18.             -- 232 for 1 Abyssal Seahorse (Vashj'ir only)
  19.             -- 231 for 2 Turtles (Riding and Sea)
  20.             -- 230 for 298 land mounts
  21.             if mountType == 241 then
  22.                 self.db.char.mounts["aq"] = self.db.char.mounts["aq"] or {}
  23.                 self.db.char.mounts["aq"][spellID] = true
  24.             end
  25.             if mountType == 232 or mountType == 254 then
  26.                 self.db.char.mounts["vashj"] = self.db.char.mounts["vashj"] or {}
  27.                 self.db.char.mounts["vashj"][spellID] = true
  28.             end
  29.             if mountType == 247 or mountType == 248 then
  30.                 self.db.char.mounts["flying"] = self.db.char.mounts["flying"] or {}
  31.                 self.db.char.mounts["flying"][spellID] = true
  32.             end
  33.             if mountType == 231 or mountType == 254 or mountType == 269 then
  34.                 self.db.char.mounts["water"] = self.db.char.mounts["water"] or {}
  35.                 self.db.char.mounts["water"][spellID] = true
  36.             end
  37.             if mountType == 230 or mountType == 231 or mountType == 269 then
  38.                 self.db.char.mounts["ground"] = self.db.char.mounts["ground"] or {}
  39.                 self.db.char.mounts["ground"][spellID] = true
  40.             end
  41.         end
  42.     end
  43.    
  44.     if newMounts > 0 then
  45.         self:Print(string.format("|cff20ff20%s|r %s", newMounts, L["new mount(s) found!"]))
  46.         self:UpdateMountChecks()
  47.     end
  48. end
  49. function MountManager:ScanForRaceClass()
  50.     if self.db.char.race == "Worgen" and self.db.char.mount_skill > 0 then
  51.         self.db.char.mounts["ground"][worgenRacial] = true;
  52.     end
  53.     if self.db.char.class == "Druid" then
  54.         self:UPDATE_SHAPESHIFT_FORMS()
  55.     end
  56.     if self.db.char.class == "Monk" then
  57.         self.db.char.mounts["flying"][zenFlight] = IsSpellKnown(zenFlight);
  58.     end
  59.     if self.db.char.class == "Shaman" and self.db.char.level > 14 then
  60.         self.db.char.mounts["skill"][ghostWolf] = true;
  61.     end
  62. end
  63. function MountManager:MountExists(spellID)
  64.     for mountType, typeTable in pairs(self.db.char.mounts) do
  65.         if typeTable[spellID] ~= nil then
  66.             return true
  67.         end
  68.     end
  69.     return false
  70. end
  71. function MountManager:SummonMount(mount)
  72.     for index = 1,C_MountJournal.GetNumMounts() do
  73.         local spellID = select(2, C_MountJournal.GetMountInfoByID(index))
  74.         if spellID == mount then
  75.             C_MountJournal.SummonByID(index)
  76.         end
  77.     end
  78. end

While it no longer throws up any errors in this format it no longer adds new mounts that seem to have been created since its last update. I've got no idea why exactly maybe I missing something somewhere else. But I'd love to get this working again.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Mount Journal Help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off