diff --git a/Fishbringer-BCC.toc b/Fishbringer-BCC.toc index 4e23d17..eb30977 100644 --- a/Fishbringer-BCC.toc +++ b/Fishbringer-BCC.toc @@ -1,24 +1,24 @@ -## Interface: 20501 -## Title: Fishbringer -## Title-deDE: Fishbringer -## Title-ruRU: Fishbringer -## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! -## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! -## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! -## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! -## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! -## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! -## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) -## SavedVariables: FishbringerDB -## Version: 2.5.1-4 - -# main: -localization.core.lua -fishy.lua - -# localizations: -Localization.deDE.lua -Localization.ruRU.lua -Localization.esES.lua -Localization.frFR.lua -Localization.ptBR.lua +## Interface: 20504 +## Title: Fishbringer +## Title-deDE: Fishbringer +## Title-ruRU: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## SavedVariables: FishbringerDB +## Version: 3.0.2 + +# main: +localization.core.lua +fishy.lua + +# localizations: +Localization.deDE.lua +Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua diff --git a/Fishbringer-Classic.toc b/Fishbringer-Classic.toc index a849b45..9114b77 100644 --- a/Fishbringer-Classic.toc +++ b/Fishbringer-Classic.toc @@ -1,24 +1,24 @@ -## Interface: 11307 -## Title: Fishbringer -## Title-deDE: Fishbringer -## Title-ruRU: Fishbringer -## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! -## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! -## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! -## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! -## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! -## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! -## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) -## SavedVariables: FishbringerDB -## Version: 2.5.1-4 - -# main: -localization.core.lua -fishy.lua - -# localizations: -Localization.deDE.lua -Localization.ruRU.lua -Localization.esES.lua -Localization.frFR.lua -Localization.ptBR.lua +## Interface: 11403 +## Title: Fishbringer +## Title-deDE: Fishbringer +## Title-ruRU: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## SavedVariables: FishbringerDB +## Version: 3.0.2 + +# main: +localization.core.lua +fishy.lua + +# localizations: +Localization.deDE.lua +Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua diff --git a/Fishbringer-Wrath.toc b/Fishbringer-Wrath.toc new file mode 100644 index 0000000..51327bb --- /dev/null +++ b/Fishbringer-Wrath.toc @@ -0,0 +1,24 @@ +## Interface: 30400 +## Title: Fishbringer +## Title-deDE: Fishbringer +## Title-ruRU: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Notes-deDE: Das legendäre Fishbringer, Leitfaden des Scharlachroten Hochlords! Nat Pagle wäre stolz auf dich! +## Notes-ruRU: Легендарный Рыболов, проводник Повелителя Алого ордена! Нат Пэгл гордился бы тобой! +## Notes-esES: ¡El legendario Fishbringer, guía del Scarlet Highlord! ¡Nat Pagle estaría orgulloso de ti! +## Notes-frFR: Le légendaire Fishbringer, guide du seigneur écarlate ! Nat Pagle serait fier de vous ! +## Notes-ptBR: O lendário Fishbringer, Guia do Highlord Escarlate! Nat Pagle ficaria orgulhoso de você! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## SavedVariables: FishbringerDB +## Version: 3.0.2 + +# main: +localization.core.lua +fishy.lua + +# localizations: +Localization.deDE.lua +Localization.ruRU.lua +Localization.esES.lua +Localization.frFR.lua +Localization.ptBR.lua diff --git a/Fishbringer.toc b/Fishbringer.toc new file mode 100644 index 0000000..4967ac9 --- /dev/null +++ b/Fishbringer.toc @@ -0,0 +1,10 @@ +## Interface: 20503 +## Title: Fishbringer +## Notes: The legendary Fishbringer, Guide of the Scarlet Highlord! Nat Pagle would be proud of you! +## Author: Kalerath, Fye (Localization Code & Bugfixes), Zilom (Bugfixes & Localization Redesigned + Added), leafoe (Russian Localization) +## Version: 2.5.4 + +# main: +localization.core.lua + +# This file is here for compatibility with CurseForge only. it has no function whatsoever \ No newline at end of file diff --git a/fishy.lua b/fishy.lua index ca44314..b24c6bf 100755 --- a/fishy.lua +++ b/fishy.lua @@ -1,4 +1,3 @@ -FishbringerDB = {} local FONT = select(1, GameFontNormalSmall:GetFont()) local fb = CreateFrame"Frame" local db @@ -8,8 +7,9 @@ local L = namespace.L --localization local version = GetAddOnMetadata(ADDON_NAME, "Version") local addoninfo = 'v'..version local _,_,_,interface = GetBuildInfo() -local classicEra = (interface==11307) -local classicTBC = (interface==20501) +local classicEra = (interface>10000 and interface<12000) +local classicTBC = (interface>20000 and interface<30000) +local classicWrath = (interface>30000 and interface<40000) local areaTable = {} @@ -18,6 +18,7 @@ fb:RegisterEvent"ADDON_LOADED" fb:RegisterEvent"COMBAT_LOG_EVENT" fb:RegisterEvent"SKILL_LINES_CHANGED" fb:RegisterEvent"LOOT_READY" +fb:RegisterEvent"LOOT_CLOSED" fb:RegisterEvent"ZONE_CHANGED_NEW_AREA" fb:RegisterEvent"ZONE_CHANGED" fb:RegisterEvent"UNIT_INVENTORY_CHANGED" @@ -27,6 +28,17 @@ local function Print(text) end local zones = { + [114] = 380, + [115] = 380, + [116] = 380, + [117] = 380, + [118] = 480, + [119] = 430, + [123] = 430, + [125] = 430, + [126] = 430, + [127] = 405, + [170] = 480, [1411] = -70, [1412] = -70, [1413] = -20, @@ -103,6 +115,7 @@ local subzones = { [3690] = 405, [3691] = 405, [3692] = 405, + [3979] = 480, [3859] = 405, [3974] = 405, [3975] = 405, @@ -116,7 +129,7 @@ local instances = { [309] = 309, [329] = 330, [349] = 205, - [548] = 405, + [548] = 130, [1001] = 130, [1004] = 130, [1007] = 330, @@ -131,14 +144,26 @@ local fishingpoles = { [19970] = true, [25978] = true, [44050] = true, + [45120] = true, + [45858] = true, + [45991] = true, + [45992] = true, } local function GetNumFishToLevel(skillRank) - if skillRank <= 75 then - return 1 + local classicScale=25 + local expScale=75 + local numFishToLevel + if skillRank <= 300 then + numFishToLevel=math.ceil(skillRank / classicScale)-2 + if numFishToLevel < 1 then + numFishToLevel = 1 + end else - return math.ceil((skillRank - 75) / 25) + numFishToLevel=math.ceil(skillRank/expScale)+5 end + + return numFishToLevel end local function UpdateFishCount(shouldIncrement) @@ -152,8 +177,16 @@ local function UpdateFishCount(shouldIncrement) ) end +local finishedLooting = true +local function LootClosed() + finishedLooting = true +end + local function IncrementFishCount() - UpdateFishCount(true) + if finishedLooting then + finishedLooting = false + UpdateFishCount(true) + end end local function ResetFishCounter(numFish) @@ -204,12 +237,11 @@ local function UpdateCatchInfo() zoneSkill = subzones[areaId] end if not zoneSkill then - zoneText = GetRealZoneText() local mapId = C_Map.GetBestMapForUnit("Player") + zoneText = C_Map.GetMapInfo(mapId).name zoneSkill = zones[mapId] end end - -- Sometimes we can trigger this before the player is in any zone if not zoneText then return @@ -223,7 +255,7 @@ local function UpdateCatchInfo() maxZoneSkill = zoneSkill + 95 end - local chance = ( + FishbringerDB.chance = ( db[char].fishingSkill + db[char].fishingBuff - zoneSkill ) * 0.01 + 0.05 @@ -231,18 +263,18 @@ local function UpdateCatchInfo() zoneSkill = 1 end - if chance > 1 then - chance = 1 - elseif chance < 0 then - chance = 0 + if FishbringerDB.chance > 1 then + FishbringerDB.chance = 1 + elseif FishbringerDB.chance < 0 then + FishbringerDB.chance = 0 end local color - if chance == 0 then + if FishbringerDB.chance == 0 then color = "ffff2020" - elseif chance <= 0.5 then + elseif FishbringerDB.chance <= 0.5 then color = "ffff8040" - elseif chance < 1 then + elseif FishbringerDB.chance < 1 then color = "ffffff00" else color = "ff40bf40" @@ -250,15 +282,15 @@ local function UpdateCatchInfo() if zoneSkill == 0 then Fishbringer.zoneInfo:SetFormattedText( L["\124c%s%s\124r\nNo fish in this zone"], - color, zoneText, zoneSkill, maxZoneSkill, chance * 100 + color, zoneText, zoneSkill, maxZoneSkill, FishbringerDB.chance * 100 ) Fishbringer.catchRate:SetText("") else Fishbringer.zoneInfo:SetFormattedText( L["\124c%s%s\124r\n%d skill needed to fish\n(%d needed for 100%% catch rate)"], - color, zoneText, zoneSkill, maxZoneSkill, chance * 100 + color, zoneText, zoneSkill, maxZoneSkill, FishbringerDB.chance * 100 ) - Fishbringer.catchRate:SetFormattedText(L["%d%% catch rate"], chance * 100) + Fishbringer.catchRate:SetFormattedText(L["%d%% catch rate"], FishbringerDB.chance * 100) end end @@ -288,9 +320,15 @@ local function UpdateSkill(forceResetFishCounter) local skillRankText = skillRank local fishNeeded = GetNumFishToLevel(skillRank) - if skillRank ~= skillMaxRank then + local strFishNeeded + if skillRank ~= skillMaxRank then skillRankText = string.format("%d(%d)", skillRank, skillMaxRank) - fishNeededText = string.format(L["\n%d fish needed to skill up"], fishNeeded) + if fishNeeded>1 then + strFishNeeded = string.format("%d-%d",fishNeeded-1, fishNeeded) + else + strFishNeeded = string.format("%d", fishNeeded) + end + fishNeededText = string.format(L["\n%s fish needed to skill up"], strFishNeeded) end local skillModifierText = "" @@ -393,25 +431,14 @@ local function InitializeDB(resetDatabase) end end -local function classicEraCreateFrame() - return CreateFrame("Frame", "Fishbringer", UIParent) -end -local function classicTBCCreateFrame() - return CreateFrame("Frame", "Fishbringer", UIParent, "BackdropTemplate") -end - local function InitializeFrame() -- Frame madness if Fishbringer then return end - if classicEra then - local Fishbringer = classicEraCreateFrame() - elseif classicTBC then - local Fishbringer = classicTBCCreateFrame() - else - return - end + + local Fishbringer = CreateFrame("Frame", "Fishbringer", UIParent, "BackdropTemplate") + Fishbringer:EnableMouse(true) Fishbringer:SetMovable(true) Fishbringer:SetUserPlaced(true) @@ -502,7 +529,7 @@ local function InitializeFrame() end end -function UpdateFishingSkill() +local function UpdateFishingSkill() return UpdateSkill(false) end @@ -526,6 +553,7 @@ end fb.COMBAT_LOG_EVENT = UpdateFishingSkill fb.SKILL_LINES_CHANGED = UpdateFishingSkill fb.LOOT_READY = IncrementFishCount +fb.LOOT_CLOSED = LootClosed fb.ZONE_CHANGED_NEW_AREA = UpdateCatchInfo fb.ZONE_CHANGED = UpdateCatchInfo fb.UNIT_INVENTORY_CHANGED = CheckForFishingPole