Skip to content

Commit

Permalink
Merge pull request #260 from Bestride/icc
Browse files Browse the repository at this point in the history
Update for Phase 4
  • Loading branch information
DanSheps authored Oct 10, 2023
2 parents 87278c8 + 92a6285 commit 82bcd13
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 33 deletions.
9 changes: 9 additions & 0 deletions Versions/Classic/MountTable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions Versions/Common/bestride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions Versions/Mainline/MountTable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
72 changes: 39 additions & 33 deletions Versions/Wrath/MountTable.lua
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 82bcd13

Please sign in to comment.