Skip to content

Commit

Permalink
added "spellbook" to skills that are added to spellbook instead of tr…
Browse files Browse the repository at this point in the history
…adeskillframe, so they get shown as "learned" properly

added racial bonus for Enchanting & Jewelcrafting
added ability to show the 2nd vendor using reputation when available
  • Loading branch information
Thumbkin committed Jun 16, 2021
1 parent 08ce7c5 commit 807c372
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 32 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ Minimap button & Enhanced tooltip
### Latest version (v2.5.07)

* All professions should now have all the correct data
* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error
* Added the reputation needed for all items sold by any TBC faction quartermaster
* Added the TBC factions to the filter frame
* Addded racial bonus for Enchanting (Blood Elf) & Jewelcrafting (Draenei)
* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error
* Fixed bug where skills learned in spellbook still showed as unlearned
* Added ability to show the 2nd vendor using reputation when available

### Support

Expand Down
7 changes: 5 additions & 2 deletions VERSION_HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
## Version History

### v2.5.07 (June 16, 2021)
### v2.5.07 (June 17, 2021)

* All professions should now have all the correct data
* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error
* Added the reputation needed for all items sold by any TBC faction quartermaster
* Added the TBC factions to the filter frame
* Addded racial bonus for Enchanting (Blood Elf) & Jewelcrafting (Draenei)
* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error
* Fixed bug where skills learned in spellbook still showed as unlearned
* Added ability to show the 2nd vendor using reputation when available

### v2.5.06 (June 14, 2021)

Expand Down
1 change: 1 addition & 0 deletions data/Fishing/skills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ MTSL_DATA["skills"]["Fishing"] =
["Taiwanese"] = "尋找漁點",
},
["phase"] = 1,
["spellbook"] = 1,
},
}
1 change: 1 addition & 0 deletions data/Jewelcrafting/skills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3278,6 +3278,7 @@ MTSL_DATA["skills"]["Jewelcrafting"] =
["Taiwanese"] = "勘探",
},
["phase"] = 1,
["spellbook"] = 1,
["trainers"] = {
["price"] = 100,
["sources"] = {
Expand Down
30 changes: 17 additions & 13 deletions logic/player_npc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -626,13 +626,6 @@ MTSL_LOGIC_PLAYER_NPC = {
-- get the list of learned skills
local known_skill_names = MTSL_LOGIC_PROFESSION:GetSkillNamesCurrentTradeSkill()

if profession_name == "First Aid" then
for _, skill_name in pairs(known_skill_names) do
print(skill_name)
end
end


-- get the list of available skills in the current phase for the profession,
local available_skills = MTSL_LOGIC_PROFESSION:GetAllAvailableSkillsForProfession(profession_name, MTSL_DATA.CURRENT_PATCH_LEVEL, MTSL_CURRENT_PLAYER.CLASS)

Expand All @@ -642,12 +635,23 @@ MTSL_LOGIC_PLAYER_NPC = {
table.insert(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].LEARNED_SKILLS, skill.id)
MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_LEARNED = MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_LEARNED + 1
else
-- Add skill to unlearned if we dont have a specialisation, skill doenst have specialisation or if player specialisation is same as the skill specialisation
if amount_specs_learned <= 0 or skill.specialisation == nil or (skill.specialisation ~= nil and
MTSL_TOOLS:ListContainsNumber(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].SPELLIDS_SPECIALISATION, skill.specialisation) == true) then
table.insert(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].MISSING_SKILLS, skill.id)
MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING = MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING + 1
end
-- it might be a spellbook spell, so it does not show in the tradeskill frame
if skill.spellbook then
if IsSpellKnown(skill.id) then
table.insert(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].LEARNED_SKILLS, skill.id)
MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_LEARNED = MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_LEARNED + 1
else
table.insert(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].MISSING_SKILLS, skill.id)
MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING = MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING + 1
end
else
-- Add skill to unlearned if we dont have a specialisation, skill doenst have specialisation or if player specialisation is same as the skill specialisation
if amount_specs_learned <= 0 or skill.specialisation == nil or (skill.specialisation ~= nil and
MTSL_TOOLS:ListContainsNumber(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].SPELLIDS_SPECIALISATION, skill.specialisation) == true) then
table.insert(MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].MISSING_SKILLS, skill.id)
MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING = MTSL_CURRENT_PLAYER.TRADESKILLS[profession_name].AMOUNT_MISSING + 1
end
end
end
end
end,
Expand Down
10 changes: 7 additions & 3 deletions logic/profession.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
---------------------------------------------

MTSL_LOGIC_PROFESSION = {
RACIAL_BONUS = 15,
BONUS_RACIAL = {
["Enchanting"] = 10, -- Blood Elf,
["Herbalism"] = 15, -- Tauren
["Jewelcrafting"] = 5, -- Draenei
},

----------------------------------------------------------------------------------------
-- Returns the current rank learned for a profession (1 Apprentice to 4 Artisan)
Expand All @@ -16,8 +20,8 @@ MTSL_LOGIC_PROFESSION = {
GetRankForProfessionByMaxLevel = function(self, profession_name, max_level)
local ranks = self:GetRanksForProfession(profession_name)
for _, v in pairs(ranks) do
-- calculate Tauren racial bonus as well
if v.max_skill == max_level or v.max_skill + self.RACIAL_BONUS == max_level then
-- also add racial if exsists
if v.max_skill == max_level or (self.BONUS_RACIAL[profession_name] and v.max_skill + self.BONUS_RACIAL[profession_name] == max_level) then
return v.rank
end
end
Expand Down
39 changes: 32 additions & 7 deletions ui/common/skill_detail_frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ MTSLUI_SKILL_DETAIL_FRAME = {

if skill.items ~= nil then
self:ShowDetailsOfSkillTypeItem(skill.items[1], profession_name, current_xp_level, 0, 0)
-- Fix for a 2nd vendor for same item
if skill.items[2] then
self:ShowDetailsOfSkillTypeItem(skill.items[2], profession_name, current_xp_level, 1, 0)
end
elseif skill.trainers ~= nil then
self:ShowDetailsOfSkillTypeTrainer(skill.trainers)
elseif skill.quests ~= nil then
Expand Down Expand Up @@ -492,6 +496,7 @@ MTSLUI_SKILL_DETAIL_FRAME = {
----------------------------------------------------------------------------
SetRequiredReputationWithFaction = function(self, reputation, current_xp_level)
-- Check if require reputation to acquire
local current_text = self.labels.requires_rep.value:GetText()
if reputation ~= nil then
local faction = MTSL_LOGIC_FACTION_REPUTATION:GetFactionNameById(reputation.faction_id)
local rep_level = MTSL_LOGIC_FACTION_REPUTATION:GetReputationLevelById(reputation.level_id)
Expand All @@ -505,9 +510,16 @@ MTSLUI_SKILL_DETAIL_FRAME = {
rep_status = MTSLUI_FONTS.COLORS.AVAILABLE.NO
end
end
self.labels.requires_rep.value:SetText(rep_status .. faction .. " [" .. MTSLUI_TOOLS:GetLocalisedData(rep_level) .. "]")
-- append if needed
if not current_text or current_text == "" or current_text == "-" then
self.labels.requires_rep.value:SetText(rep_status .. faction .. " [" .. MTSLUI_TOOLS:GetLocalisedData(rep_level) .. "]")
else
self.labels.requires_rep.value:SetText(current_text .. " / " .. rep_status .. faction .. " [" .. MTSLUI_TOOLS:GetLocalisedData(rep_level) .. "]")
end
else
self.labels.requires_rep.value:SetText(MTSLUI_FONTS.COLORS.TEXT.NORMAL .. "-")
if not current_text or current_text == "" then
self.labels.requires_rep.value:SetText(MTSLUI_FONTS.COLORS.TEXT.NORMAL .. "-")
end
end
end,

Expand Down Expand Up @@ -740,7 +752,7 @@ MTSLUI_SKILL_DETAIL_FRAME = {
self:HideTooltipFrameShowAltSourceName()
else
-- check if we have more then 1 source to activate the split
if amount_sources > 1 then
if amount_sources > 1 or is_alternative_source == 1 then
-- adjust the height of the source frames to split situation
self.labels.alt_sources.title:Show()
self.labels.alt_source.title:Show()
Expand All @@ -755,16 +767,29 @@ MTSLUI_SKILL_DETAIL_FRAME = {
if has_vendors > 0 then
self:SetSourceType(MTSLUI_FONTS.COLORS.TEXT.NORMAL .. MTSLUI_TOOLS:GetLocalisedLabel("vendor"), is_alternative_source, 1)
self.tooltip_source_name = "item:" .. item_id
self.labels.sources.title:SetText(MTSLUI_FONTS.COLORS.TEXT.TITLE .. MTSLUI_TOOLS:GetLocalisedLabel("sold by"))
if is_alternative_source == 1 then
self.labels.sources.title:SetText(MTSLUI_FONTS.COLORS.TEXT.TITLE .. MTSLUI_TOOLS:GetLocalisedLabel("sold by"))
else
self.labels.alt_sources.title:SetText(MTSLUI_FONTS.COLORS.TEXT.TITLE .. MTSLUI_TOOLS:GetLocalisedLabel("sold by"))
end

-- if its a currency, dont convert price to gold
if item.vendors.currency then
self.labels.price.value:SetText(item.vendors.price .. " " .. MTSL_LOGIC_ITEM_OBJECT:GetCurrencyNameById(item.vendors.currency))
if is_alternative_source == 1 and self.labels.price.value:GetText() ~= "" then
self.labels.price.value:SetText(self.labels.price.value:GetText() .. " / " .. item.vendors.price .. " " .. MTSL_LOGIC_ITEM_OBJECT:GetCurrencyNameById(item.vendors.currency))
else
self.labels.price.value:SetText(item.vendors.price .. " " .. MTSL_LOGIC_ITEM_OBJECT:GetCurrencyNameById(item.vendors.currency))
end
else
self.labels.price.value:SetText(MTSL_TOOLS:GetNumberAsMoneyString(item.vendors.price))
if is_alternative_source == 1 and self.labels.price.value:GetText() ~= "" then
self.labels.price.value:SetText(self.labels.price.value:GetText() .. " / " .. MTSL_TOOLS:GetNumberAsMoneyString(item.vendors.price))
else
self.labels.price.value:SetText(MTSL_TOOLS:GetNumberAsMoneyString(item.vendors.price))
end
end
-- Get all "available" vendors for the player
local vendors = MTSL_LOGIC_PLAYER_NPC:GetNpcsByIds(item.vendors.sources)
self:ShowDetailsOfNpcs(vendors, 0)
self:ShowDetailsOfNpcs(vendors, is_alternative_source)
end
-- Obtained from a quest
if has_quests > 0 then
Expand Down
16 changes: 10 additions & 6 deletions ui/global_variables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ MTSLUI_ADDON = {
NAME = "Missing TradeSkills List (TBC)",
VERSION = "2.5.07",
PATCH_TEXT = '* All professions should now have all the correct data\n' ..
'* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error\n' ..
'* Added the reputation needed for all items sold by any TBC faction quartermaster\n' ..
'* Added the TBC factions to the filter frame\n',
'* Fixed bug when showing the details of a Quest with NPCs lead to "nil" error\n' ..
'* Fixed bug where skills learned in spellbook still showed as unlearned\n' ..
'* Added the reputation needed for all items sold by any TBC faction quartermaster\n' ..
'* Added the TBC factions to the filter frame\n' ..
'* Addded racial bonus for Enchanting (Blood Elf) & Jewelcrafting (Draenei)\n' ..
'* Added ability to show the 2nd vendor using reputation when available\n',

SERVER_VERSION_PHASES = {
-- max build number from server for phase 1,
{
Expand Down Expand Up @@ -41,10 +45,10 @@ MTSLUI_ICONS_PROFESSION = {
-- Primary professions
["Alchemy"] = "136240",
["Blacksmithing"] = "136241",
["Enchanting"] = "136244", -- craft
["Enchanting"] = "136244", -- craft
["Engineering"] = "136243",
["Herbalism"] = "136065",
["Jewelcrafting"] = "134071", -- New for TBC
["Jewelcrafting"] = "134071", -- New for TBC
["Leatherworking"] = "133611",
["Mining"] = "136248",
["Skinning"] = "134366",
Expand All @@ -54,7 +58,7 @@ MTSLUI_ICONS_PROFESSION = {
["First Aid"] = "135966",
["Fishing"] = "136245",
-- Rogue only
["Poisons"] = "136242",
["Poisons"] = "136242",
}

MTSLUI_ADDON_PATH = "Interface\\AddOns\\MissingTradeSkillsList_TBC"

0 comments on commit 807c372

Please sign in to comment.