From 690e3d67d349e11d350465813dd3e64e621b26b3 Mon Sep 17 00:00:00 2001 From: cloudbells Date: Sun, 25 Aug 2019 19:01:27 +0200 Subject: [PATCH] Finished Warlock trainers --- Database/Trainers.lua | 198 +++++++++++++++++++++++++++++++++++++++++- FieldGuide.lua | 34 ++++---- README.md | 4 +- Util.lua | 132 +++++++++------------------- 4 files changed, 257 insertions(+), 111 deletions(-) diff --git a/Database/Trainers.lua b/Database/Trainers.lua index db2f50f..1c2b480 100644 --- a/Database/Trainers.lua +++ b/Database/Trainers.lua @@ -278,10 +278,204 @@ FieldGuide.HUNTER_PET_TRAINERS = { FieldGuide.WARLOCK_PET_TRAINERS = { ["ALLIANCE"] = { - + [1] = { + ["name"] = "Wren Darkspring", + ["rep"] = FieldGuide.factions.gnomeregan_exiles, + ["map"] = FieldGuide.maps.dun_morogh, + ["x"] = 28.8, + ["y"] = 66.2, + ["Blood Pact"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true + }, + [2] = { + ["name"] = "Dane Winslow", + ["rep"] = FieldGuide.factions.stormwind, + ["map"] = FieldGuide.maps.elwynn_forest, + ["x"] = 50.0, + ["y"] = 42.6, + ["Blood Pact"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true + }, + [3] = { + ["name"] = "Dannie Fizzwizzle", + ["rep"] = FieldGuide.factions.gnomeregan_exiles, + ["map"] = FieldGuide.maps.dun_morogh, + ["x"] = 47.2, + ["y"] = 53.6, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Suffering"] = true, + ["Torment"] = true + }, + [4] = { + ["name"] = "Dannie Fizzwizzle", + ["rep"] = FieldGuide.factions.stormwind, + ["map"] = FieldGuide.maps.elwynn_forest, + ["x"] = 44.4, + ["y"] = 66.0, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Suffering"] = true, + ["Torment"] = true + }, + [5] = { + ["name"] = "Jubahl Corpseseeker", + ["rep"] = FieldGuide.factions.gnomeregan_exiles, + ["map"] = FieldGuide.maps.ironforge, + ["x"] = 52.7, + ["y"] = 6.1, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Devour Magic"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Lash of Pain"] = true, + ["Lesser Invisibility"] = true, + ["Paranoia"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Seduction"] = true, + ["Soothing Kiss"] = true, + ["Spell Lock"] = true, + ["Suffering"] = true, + ["Tainted Blood"] = true, + ["Torment"] = true + }, + [6] = { + ["name"] = "Spackle Thornberry", + ["rep"] = FieldGuide.factions.gnomeregan_exiles, + ["map"] = FieldGuide.maps.stormwind, + ["x"] = 25.7, + ["y"] = 77.7, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Devour Magic"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Lash of Pain"] = true, + ["Lesser Invisibility"] = true, + ["Paranoia"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Seduction"] = true, + ["Soothing Kiss"] = true, + ["Spell Lock"] = true, + ["Suffering"] = true, + ["Tainted Blood"] = true, + ["Torment"] = true + } }, ["HORDE"] = { - + [1] = { + ["name"] = "Kayla Smithe", + ["rep"] = FieldGuide.factions.undercity, + ["map"] = FieldGuide.maps.tirisfal_glades, + ["x"] = 30.8, + ["y"] = 66.2, + ["Blood Pact"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true + }, + [2] = { + ["name"] = "Hraug", + ["rep"] = FieldGuide.factions.orgrimmar, + ["map"] = FieldGuide.maps.durotar, + ["x"] = 40.6, + ["y"] = 68.4, + ["Blood Pact"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true + }, + [3] = { + ["name"] = "Gina Lang", + ["rep"] = FieldGuide.factions.undercity, + ["map"] = FieldGuide.maps.tirisfal_glades, + ["x"] = 61.6, + ["y"] = 52.6, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Suffering"] = true, + ["Torment"] = true + }, + [4] = { + ["name"] = "Kitha", + ["rep"] = FieldGuide.factions.orgrimmar, + ["map"] = FieldGuide.maps.durotar, + ["x"] = 54.6, + ["y"] = 41.4, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Suffering"] = true, + ["Torment"] = true + }, + [5] = { + ["name"] = "Kurgul", + ["rep"] = FieldGuide.factions.orgrimmar, + ["map"] = FieldGuide.maps.orgrimmar, + ["x"] = 47.6, + ["y"] = 47.6, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Devour Magic"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Lash of Pain"] = true, + ["Lesser Invisibility"] = true, + ["Paranoia"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Seduction"] = true, + ["Soothing Kiss"] = true, + ["Spell Lock"] = true, + ["Suffering"] = true, + ["Tainted Blood"] = true, + ["Torment"] = true + }, + [6] = { + ["name"] = "Martha Strain", + ["rep"] = FieldGuide.factions.undercity, + ["map"] = FieldGuide.maps.undercity, + ["x"] = 85.6, + ["y"] = 15.8, + ["Blood Pact"] = true, + ["Consume Shadows"] = true, + ["Devour Magic"] = true, + ["Fire Shield"] = true, + ["Firebolt"] = true, + ["Lash of Pain"] = true, + ["Lesser Invisibility"] = true, + ["Paranoia"] = true, + ["Phase Shift"] = true, + ["Sacrifice"] = true, + ["Seduction"] = true, + ["Soothing Kiss"] = true, + ["Spell Lock"] = true, + ["Suffering"] = true, + ["Tainted Blood"] = true, + ["Torment"] = true + } } } diff --git a/FieldGuide.lua b/FieldGuide.lua index 2e2ea71..8308fee 100644 --- a/FieldGuide.lua +++ b/FieldGuide.lua @@ -1,20 +1,15 @@ --[[ TODO: --------------------------------------- - 1. Add price for the pinned vendor in the tooltip. - 2. Add Warlock trainers. - 3. Add logic for finding closest Warlock pet trainer – refactor so it isn't shit. - 4. Add tomes. - 5. Add tutorial (shift+scroll for horizontal scroll/shift+right-click for marking all of the same spells etc) - 6. (Add racials.) - 7. (Add professions.) - 8. (Allow player to scroll manually.) - 9. (Make it so the scroll doesn't reset back to the top after each filtering option changes.) - 10. (Add travel logic.) - 11. Add PvP rank and change uimapid's for launch. - 12. Update README's. - 13. Take a new pic for curseforge/github. - 14. Upload to wowinterface. + 1. Add tomes. + 2. Add tutorial (shift+scroll for horizontal scroll/shift+right-click for marking all of the same spells etc) + 3. (Add racials.) + 4. (Add professions.) + 5. (Allow player to scroll manually.) + 6. (Make it so the scroll doesn't reset back to the top after each filtering option changes.) + 7. Update README's. + 8. Take a new pic for curseforge/github. + 9. Upload to wowinterface. --------------------------------------- ]] @@ -127,7 +122,9 @@ local function findClosestTrainer(skill) or (selectedClass == "HUNTER_PETS" and FieldGuide.HUNTER_PET_TRAINERS[tempFaction]) or (selectedClass == "WARLOCK_PETS" and FieldGuide.WARLOCK_PET_TRAINERS[tempFaction]) or FieldGuide.SPELL_TRAINERS[selectedClass][tempFaction]) do - if selectedClass == "WEAPONS" and trainer[skill.spellId] or skill.level ~= nil and not (skill.level > 6 and trainer.noob) then + if selectedClass == "WARLOCK_PETS" and trainer[skill.name] + or selectedClass == "WEAPONS" and trainer[skill.spellId] + or selectedClass ~= "WARLOCK_PETS" and selectedClass ~= "HUNTER_PETS" and skill.level ~= nil and not (skill.level > 6 and trainer.noob) then local distance = getDistance(trainer.x / 100, trainer.y / 100, trainer.map) if FieldGuide.getContinent(trainer.map) == instance and distance < sameContinentDistance then sameContinentDistance = distance @@ -210,7 +207,7 @@ end -- Returns the cost modifier (0.9 if player is honored or rank 3, 0.8 if both, 1 otherwise). local function getCostModifier() local honored = false - -- local rankThree = UnitPVPRank("player") > 7 + local rankThree = UnitPVPRank("player") > 7 if isAlliance() then honored = select(3, GetFactionInfoByID(72)) > 5 or select(3, GetFactionInfoByID(69)) > 5 or select(3, GetFactionInfoByID(47)) > 5 or select(3, GetFactionInfoByID(54)) > 5 else @@ -745,7 +742,7 @@ function FieldGuideSpellButton_OnClick(self, button) else trainer = findClosestTrainer(self) end - if not doesPinExist(trainer.name) and self.spellCost ~= 0 then + if tomtom and self.spellCost ~= 0 or not doesPinExist(trainer.name) and self.spellCost ~= 0 then addMapPin(trainer.map, trainer.x, trainer.y, trainer.name) if not tomtom then FieldGuideOptions.pins[#FieldGuideOptions.pins + 1] = { @@ -755,7 +752,8 @@ function FieldGuideSpellButton_OnClick(self, button) ["name"] = trainer.name } end - print("Added a marker to your closest trainer!") + print("|cFFFFFF00[Field Guide]:|r Added a marker to |cFFFF0000" .. trainer.name .. "|r in " .. hbd:GetLocalizedMap(trainer.map) .. + " at |cFF00FF00(" .. trainer.x * 100 .. ", " .. trainer.y * 100 .. ")|r.") end end end diff --git a/README.md b/README.md index 8a5885a..68a8cf6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Best used with [TomTom](https://www.curseforge.com/wow/addons/tomtom). - Right click to mark spells as unwanted. - Shift-right click a spell to mark all ranks of that spell as unwanted. -![Current progress](https://i.imgur.com/CIbDcin.png) +![Current progress](https://i.imgur.com/bhADKsT.png) ## Features - Shows you which spells each class learns every level to plan when you need to go back to town (includes Warlock demon spells and Hunter pet skills). @@ -29,3 +29,5 @@ Best used with [TomTom](https://www.curseforge.com/wow/addons/tomtom). ## Bugs - Some spells and ranks might be wrong, as I've gone off private server and Classic Wowhead (please get an API) data, both of which currently aren't very accurate. For example, on a certain private server (rhymes with Blight's Rope), Shadowburn rank 6 cost 2g 20s while it should have cost 11s only (baseline). + +If you notice any inaccuracies or bugs please let me know! \ No newline at end of file diff --git a/Util.lua b/Util.lua index 2c715f7..58b7c54 100644 --- a/Util.lua +++ b/Util.lua @@ -15,101 +15,53 @@ FieldGuide.factions = { } FieldGuide.maps = { - ["stormwind"] = 84, - ["ironforge"] = 87, - ["darnassus"] = 89, - ["orgrimmar"] = 85, - ["thunder_bluff"] = 88, - ["undercity"] = 90, - ["elwynn_forest"] = 37, - ["dun_morogh"] = 27, - ["teldrassil"] = 57, - ["tirisfal_glades"] = 18, - ["durotar"] = 1, - ["swamp_of_sorrows"] = 51, - ["felwood"] = 77, - ["moonglade"] = 80, - ["mulgore"] = 7, - ["feralas"] = 69, - ["stranglethorn_vale"] = 224, - ["stonetalon_mountains"] = 65, - ["ashenvale"] = 63, - ["loch_modan"] = 48, - ["dustwallow_marsh"] = 70 + ["stormwind"] = 1453, + ["ironforge"] = 1455, + ["darnassus"] = 1457, + ["orgrimmar"] = 1454, + ["thunder_bluff"] = 1456, + ["undercity"] = 1458, + ["elwynn_forest"] = 1429, + ["dun_morogh"] = 1426, + ["teldrassil"] = 1438, + ["tirisfal_glades"] = 1420, + ["durotar"] = 1411, + ["swamp_of_sorrows"] = 1435, + ["felwood"] = 1448, + ["moonglade"] = 1450, + ["mulgore"] = 1412, + ["feralas"] = 1444, + ["stranglethorn_vale"] = 1434, + ["stonetalon_mountains"] = 1442, + ["ashenvale"] = 1440, + ["loch_modan"] = 1432, + ["dustwallow_marsh"] = 1445 } local continents = { - [84] = 0, -- Eastern Kingdoms. - [87] = 0, - [89] = 1, -- Kalimdor. - [85] = 1, - [88] = 1, - [90] = 0, - [37] = 0, - [27] = 0, - [57] = 1, - [18] = 0, - [1] = 1, - [51] = 0, - [77] = 1, - [80] = 1, - [7] = 1, - [69] = 1, - [224] = 0, - [65] = 1, - [63] = 1, - [48] = 0, - [70] = 1 + [1453] = 0, -- Eastern Kingdoms. + [1455] = 0, + [1457] = 1, -- Kalimdor. + [1454] = 1, + [1456] = 1, + [1458] = 0, + [1429] = 0, + [1426] = 0, + [1438] = 1, + [1420] = 0, + [1411] = 1, + [1435] = 0, + [1448] = 1, + [1450] = 1, + [1412] = 1, + [1444] = 1, + [1434] = 0, + [1442] = 1, + [1440] = 1, + [1432] = 0, + [1445] = 1 } --- FieldGuide.maps = { - -- ["stormwind"] = 1453, - -- ["ironforge"] = 1455, - -- ["darnassus"] = 1457, - -- ["orgrimmar"] = 1454, - -- ["thunder_bluff"] = 1456, - -- ["undercity"] = 1458, - -- ["elwynn_forest"] = 1429, - -- ["dun_morogh"] = 1426, - -- ["teldrassil"] = 1438, - -- ["tirisfal_glades"] = 1420, - -- ["durotar"] = 1411, - -- ["swamp_of_sorrows"] = 1435, - -- ["felwood"] = 1448, - -- ["moonglade"] = 1450, - -- ["mulgore"] = 1412, - -- ["feralas"] = 1444, - -- ["stranglethorn_vale"] = 1434, - -- ["stonetalon_mountains"] = 1442, - -- ["ashenvale"] = 1440, - -- ["loch_modan"] = 1432, - -- ["dustwallow_marsh"] = 1445 --- } - --- local continents = { - -- [1453] = 0, -- Eastern Kingdoms. - -- [1455] = 0, - -- [1457] = 1, -- Kalimdor. - -- [1454] = 1, - -- [1456] = 1, - -- [1458] = 0, - -- [1429] = 0, - -- [1426] = 0, - -- [1438] = 1, - -- [1420] = 0, - -- [1411] = 1, - -- [1435] = 0, - -- [1448] = 1, - -- [1450] = 1, - -- [1412] = 1, - -- [1444] = 1, - -- [1434] = 0, - -- [1442] = 1, - -- [1440] = 1, - -- [1432] = 0, - -- [1445] = 1 --- } - FieldGuide.pinPool = {} function FieldGuide:getPin()