From 92a62858410c2428fd1edd2f0189b79f861b4e41 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Tue, 29 Aug 2023 21:40:45 -0500 Subject: [PATCH] WotLK ICC Update --- Versions/Classic/MountTable.lua | 9 ++++ Versions/Common/bestride.lua | 6 +++ Versions/Mainline/MountTable.lua | 10 +++++ Versions/Wrath/MountTable.lua | 72 +++++++++++++++++--------------- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/Versions/Classic/MountTable.lua b/Versions/Classic/MountTable.lua index 9061387..61c78d3 100644 --- a/Versions/Classic/MountTable.lua +++ b/Versions/Classic/MountTable.lua @@ -45,4 +45,13 @@ function BeStride:AddNewMount(mountId) ["source"] = BeStride_MountDB[spellID].source, ["type"] = mountType, } +end + +function BeStride:PrintAllMounts() + local num = GetNumCompanions("MOUNT") + print("MountID:name:spellID,icon,isSummoned,mountTypeID") + for i=1, GetNumCompanions("MOUNT") do + local mountID,name,spellID,icon,isSummoned, mountTypeID = GetCompanionInfo("MOUNT", i) + print("" + MountID + ":" + name + ":" + spellID + ":" + icon + ":" + isSummoned + ":" + mountTypeID+"") + end end \ No newline at end of file diff --git a/Versions/Common/bestride.lua b/Versions/Common/bestride.lua index f87aae4..8fea3b3 100644 --- a/Versions/Common/bestride.lua +++ b/Versions/Common/bestride.lua @@ -126,6 +126,8 @@ function BeStride:ChatCommand(input) print(BeStride:SpeedCheck()) elseif command == "mountdb" then self:ListMountDB() + elseif command == "gamemounts" then + self:PrintGameMounts() elseif command == "mountsTable" then self:ListGameMounts() elseif command == "reload" then @@ -197,4 +199,8 @@ function BeStride:ListMountDB() for key,value in pairs(mountTable["master"]) do print("Mount (" .. key .. "):" .. (value.name or "")..":"..(value.spellID or "")..":"..(value.mountID or "")..":"..tostring(value.isActive or "")..":"..tostring(value.faction or "")..":"..(value.source or "")..":"..(value.type or "")) end +end + +function BeStride:PrintGameMounts() + self:PrintAllMounts() end \ No newline at end of file diff --git a/Versions/Mainline/MountTable.lua b/Versions/Mainline/MountTable.lua index 27721de..4d0ca15 100644 --- a/Versions/Mainline/MountTable.lua +++ b/Versions/Mainline/MountTable.lua @@ -42,4 +42,14 @@ function BeStride:AddNewMount(mountId) ["sourceType"] = sourceType, ["type"] = BeStride_Constants.Mount.Types[mountTypeID], } +end + +function BeStride:PrintAllMounts() + for key,value in pairs(C_MountJournal.GetMountIDs()) do + local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isForDragonriding = C_MountJournal.GetMountInfoByID(value) + local creatureDisplayInfoID,description,source,isSelfMount,mountTypeID,uiModelSceneID = C_MountJournal.GetMountInfoExtraByID(mountId) + if isCollected then + print("" + mountID + ":" + name + ":" + spellID + ":" + icon + ":" + isSummoned + ":" + mountTypeID+"") + end + end end \ No newline at end of file diff --git a/Versions/Wrath/MountTable.lua b/Versions/Wrath/MountTable.lua index c058f01..4d0ca15 100644 --- a/Versions/Wrath/MountTable.lua +++ b/Versions/Wrath/MountTable.lua @@ -1,49 +1,55 @@ function BeStride:BuildMasterMountTable() - local num = GetNumCompanions("MOUNT") - --print("Start mount table") - for i=1, GetNumCompanions("MOUNT") do - local mountID,name,spellID,icon,isSummoned = GetCompanionInfo("MOUNT", i) - if mountTable["master"][spellID] == nil then - BeStride:AddNewMount(i) + for key,value in pairs(C_MountJournal.GetMountIDs()) do + local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isForDragonriding = C_MountJournal.GetMountInfoByID(value) + + --print("" .. name .. ":" .. mountID .. ":" .. spellID ) + if isCollected then + BeStride:AddNewMount(value) end end - --print("End mount table") end + function BeStride:AddNewMount(mountId) - local mountID,name,spellID,icon,isSummoned = GetCompanionInfo("MOUNT", mountId) - if not BeStride_MountDB[spellID] then - print("Mount not in DB:") - print("\tMount Number:" .. mountId) - print("\tSpell ID:" .. spellID) - print("\tMount ID:" .. mountID) - if name then - print("\tName: " .. name) - end - return - end + local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isForDragonriding = C_MountJournal.GetMountInfoByID(mountId) + local creatureDisplayInfoID,description,source,isSelfMount,mountTypeID,uiModelSceneID = C_MountJournal.GetMountInfoExtraByID(mountId) - if BeStride_MountDB[spellID].attributes.flying == true then - mountType = "flying" - elseif BeStride_MountDB[spellID].attributes.ground == true then - mountType = "ground" - else - mountType = "unknown" + if BeStride_Constants.Mount.Types[mountTypeID] == nil then + print("" .. name .. ":" .. mountID .. ":" .. spellID .. ":" .. mountTypeID) + --elseif mountId == 678 then + -- print("" .. name .. ":" .. mountID .. ":" .. spellID .. ":" .. mountTypeID) end - - if not name and BeStride_MountDB[spellID].name then - name = BeStride_MountDB[spellID].name + + if isFactionSpecific then + faction = faction + else + faction = nil end - - mountTable["master"][mountID] = { + + mountTable["master"][mountId] = { ["name"] = name, ["spellID"] = spellID, ["mountID"] = mountID, - ["isActive"] = isSummoned, - ["faction"] = nil, + ["factionLocked"] = isFactionSpecific, + ["faction"] = faction, + ["description"] = description, + ["isActive"] = isActive, + ["isUsable"] = isUsable, + ["isCollected"] = isCollected, ["icon"] = icon, - ["source"] = BeStride_MountDB[spellID].source, - ["type"] = mountType, + ["source"] = source, + ["sourceType"] = sourceType, + ["type"] = BeStride_Constants.Mount.Types[mountTypeID], } +end + +function BeStride:PrintAllMounts() + for key,value in pairs(C_MountJournal.GetMountIDs()) do + local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isForDragonriding = C_MountJournal.GetMountInfoByID(value) + local creatureDisplayInfoID,description,source,isSelfMount,mountTypeID,uiModelSceneID = C_MountJournal.GetMountInfoExtraByID(mountId) + if isCollected then + print("" + mountID + ":" + name + ":" + spellID + ":" + icon + ":" + isSummoned + ":" + mountTypeID+"") + end + end end \ No newline at end of file