WoW-Pro Guides

WoW-Pro Guides

3M Downloads

Professions in the different modules

Twists opened this issue ยท 18 comments

commented

There is a problem causing certain guides (Darkmoon Fair) not to work because of what is found in the main Broker and what is in the parser modules (World Events, Professions). The section for professions in the parsers have a lot more details with them: profession number to allow multi-language since it doesn't reply on the word "Cooking" but 185 to find the profession, contains a minimum and maximum level (used for the professions guide since you want to check it off at a certain level), and maximum skill your at so it knows when you need training

Solution A : Move the profession section from Broker to the leveling module since this is what it was written for. Plus: easy to do. Minus: Gives us a profession section in several modules.

Solution B: Incorporate the changes from the modules to the Broker. Plus: One set of code since it then can be removed from the individual modules. Minus: Adding the profession number to all the leveling modules that have a profession tag (the rest are defaulted if not found in the |P| tag)

Solution C: ???? Am open to any other solutions.

commented

Done and working!

commented

I am finishing up on the re-write of the professions module. Hope to have it finished and posted in the next couple of days. I have to covert all the guides first to the new style. Once I re-write the guides, do you want me to leave the comments in or out from where it pulled from wow-pro?

commented

Leave em in!

Sent from my iPhone

On Jun 19, 2012, at 6:03 AM, [email protected] wrote:

I am finishing up on the re-write of the professions module. Hope to have it finished and posted in the next couple of days. I have to covert all the guides first to the new style. Once I re-write the guides, do you want me to leave the comments in or out from where it pulled from wow-pro?


Reply to this email directly or view it on GitHub:
#357 (comment)

commented

BTW. I am integrating your change to the broker at the next update

commented

missed a line in broker after line 236. Otherwise, it doesn't check it off. It may not of been in the original code I sent you and added it later. Not sure.

else
WoWPro:Print("Warning: malformed profession tag [%s] at step %d",WoWPro.prof[k],k)
end
if skip then WoWProCharDB.Guide[GID].skipped[k] = true end

commented

Check it in directly.

commented

Oh, I overlooked:

WoWPro_Leveling/Alliance/70_72_Jame_Borean_Tundra.lua

commented

I have a preference for (B) since that is my preferred direction.

The distribution of |P| tags is as follows:

WoWPro_Dailies/Neutral/Ludo_NetherDrake.lua:3
WoWPro_Dailies/Neutral/Twists_ShattSun.lua:3
WoWPro_Leveling/Alliance/13_20_James_Darkshore.lua:3
WoWPro_Profession/Professions/Alchemy.lua:555
WoWPro_Profession/Professions/Blacksmithing.lua:564
WoWPro_Profession/Professions/Enchanting.lua:1
WoWPro_Profession/Professions/Engineering.lua:1
WoWPro_Profession/Professions/First_Aid.lua:531
WoWPro_Profession/Professions/Herbalism.lua:1
WoWPro_Profession/Professions/Inscription.lua:568
WoWPro_Profession/Professions/Jewelcrafting.lua:549
WoWPro_Profession/Professions/Leatherworking.lua:538
WoWPro_Profession/Professions/Skinning.lua:1
WoWPro_Profession/Professions/Tailoring.lua:547
WoWPro_WorldEvents/Neutral/Twists_Darkmoon_Faire.lua:33

So there are not too many places to touch to make things consistent.

commented

BTW, the current code in the professions module is not language independent. It uses a match on the profession name instead of the skillLine return value from GetProfessionInfo().

commented

hmmm.. your right. I thought I had converted all that over. The basics are there for it, just not sure why I didn't get the rest of the code converted over.

commented

OK. Testing a converged version now. Once I finish testing, I will check in.

commented

I went through the darkmoon fair for the first time on a L60 DK and stepped through the guide now with no problems.
The were little random bits of profession handling throughout all the addons and I rectified them all.

Now I need to double-check the leveling guides. Then it is checkin time!

BTW: I added LVL handling for the foods and drinks.

commented

lol.. I also just added LVL in as well that expanded on the current LVL so it can be carreid forward to other modules. But that is fine, can't wait to see how you implemented it. It least it gets in the game.

commented

I checked the whole shebang in!

commented

I handled mine a little different by adding a token to the ones I want to skip. That way the ones without the token will still continue to work and show up as steps that need completing. Also, it has advantage of working with all the modules.

        if level then
        local temp, action = string.split(";",level)
        action = action or 0

            if not completion and not action and tonumber(level) <= UnitLevel("player") then
            WoWProCharDB.Guide[GID].completion[i] = true
            end 
        if not completion and action and tonumber(temp) > UnitLevel("player") then
            WoWProCharDB.Guide[GID].skipped[i] = true
            end 
        end

B Pickled Kod Foot|QID|99602607|ACH|6026;7|LVL|15;1|N|From Stamp Thunderhorn.|L|19305|

I have added it to my fork just in case you want to go this route. Otherwise, I will convert mine to yours.

commented

There was a problem with the Broker part of it and I had to modify the code a bit. Check this out and see if this will work for you. It wouldn't work at all without these changes in the profession module. To test that, you will need to add in the profession numbers (I am working on an update for the module).

    -- Skipping profession quests if their requirements aren't met --
    if WoWPro.prof[k] and not skip then
        local prof, profnum, proflvl, profmaxlvl, profmaxskill = string.split(";",WoWPro.prof[k])
        proflvl = tonumber(proflvl) or 1
        profmaxlvl = tonumber(profmaxlvl) or 700
        profmaxskill = tonumber(profmaxskill) or 700

        if prof and type(prof) == "string" and type(proflvl) == "number" then
            local hasProf = false
            skip = true --Profession steps skipped by default
            local profs = {}
            profs[1], profs[2], profs[3], profs[4], profs[5], profs[6] = GetProfessions()
            for p=1,6 do
                if profs[p] then
                    local skillName, _, skillRank, maxskill, _, _, skillnum = GetProfessionInfo(profs[p])
                    if (tonumber(skillnum) == tonumber(profnum)) then
                        if (skillRank >= proflvl) and (skillRank < profmaxlvl) and (maxskill < profmaxskill) then
                            skip = false -- The step is NOT skipped if the skill is present at the correct level or higher
                        end
                        if ((profmaxlvl < 700) and (profmaxlvl > skillRank)) or ((profmaxskill < 700) and (proflvl > skillRank)) then
                            skip = false
                        end
                            hasProf = true                          
                    end
                end
            end
            -- Zero or max proflvl special skip logic--

-- if hasProf == false and proflvl == 0 then skip = false end
-- if hasProf == false and proflvl == 700 then skip = true end
if hasProf == false and ((profmaxlvl < 700) or (profmaxskill < 700)) then skip = false end
if WoWPro.action[k] == "A" and not hasProf then
-- If they do not have the profession, mark the step and quest as skipped
WoWProCharDB.Guide[GID].skipped[k] = true
WoWProCharDB.skippedQIDs[WoWPro.QID[k]] = true
end
else
WoWPro:Print("Warning: malformed profession tag [%s] at step %d",WoWPro.prof[k],k)
end
if skip then WoWProCharDB.Guide[GID].skipped[k] = true end
end

commented

I've add all the changes to my fork (Broker, Darkmoon Faire guide) if you want to pull it from there. I commented out a few lines to show what has been removed, but you can take those out.

commented

Sorry I missed this; I have been traveling and don't have access to my home computer to properly diff your changes.I'll be back home this coming Saturday.   On 06/11/12, [email protected] wrote: There was a problem with the Broker part of it and I had to modify the code a bit. Check this out and see if this will work for you. It wouldn't work at all without these changes in the profession module. To test that, you will need to add in the profession numbers (I am working on an update for the module).-- Skipping profession quests if their requirements aren't met --if WoWPro.prof[k] and not skip thenlocal prof, profnum, proflvl, profmaxlvl, profmaxskill = string.split(";",WoWPro.prof[k])proflvl = tonumber(proflvl) or 1profmaxlvl = tonumber(profmaxlvl) or 700profmaxskill = tonumber(profmaxskill) or 700if prof and type(prof) == "string" and type(proflvl) == "number" thenlocal hasProf = falseskip = true --Profession steps skipped by defaultlocal profs = {}profs[1], profs[2], profs[3], profs[4], profs[5], profs[6] = GetProfessions()for p=1,6 doif profs[p] thenlocal skillName, _, skillRank, maxskill, _, _, skillnum = GetProfessionInfo(profs[p])if (tonumber(skillnum) == tonumber(profnum)) thenif (skillRank >= proflvl) and (skillRank < profmaxlvl) and (maxskill < profmaxskill) thenskip = false -- The step is NOT skipped if the skill is present at the correct level or higherendif ((profmaxlvl < 700) and (profmaxlvl > skillRank)) or ((profmaxskill < 700) and (proflvl > skillRank)) thenskip = falseendhasProf = true endendend-- Zero or max proflvl special skip logic---- if hasProf == false and proflvl == 0 then skip = false end-- if hasProf == false and proflvl == 700 then skip = true endif hasProf == false and ((profmaxlvl < 700) or (profmaxskill < 700)) then skip = false endif WoWPro.action[k] == "A" and not hasProf then-- If they do not have the profession, mark the step and quest as skippedWoWProCharDB.Guide[GID].skipped[k] = trueWoWProCharDB.skippedQIDs[WoWPro.QID[k]] = trueendelseWoWPro:Print("Warning: malformed profession tag [%s] at step %d",WoWPro.prof[k],k)endif skip then WoWProCharDB.Guide[GID].skipped[k] = true endend---Reply to this email directly or view it on GitHub:#357 (comment)