This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [HELP] Remove Talent Point Requirement  (Read 6370 times)

Quincent

  • Registred Member
  • BLP Convertor
  • *****
  • Posts: 5
    • View Profile
[HELP] Remove Talent Point Requirement
« on: May 09, 2015, 07:52:04 pm »
I edited my talent.dbc and changed 'PLAYER_TALENTS_PER_TIER = 5 to 1 in 'Talentframebase.xml, but it looks like a missing a step. I cant click the second tier spells.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #1 on: May 10, 2015, 01:21:50 pm »
Skill*.dbcs have requirements. You have to remove these.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #2 on: May 10, 2015, 01:29:14 pm »
I'm quoting a PM history I have on the subject:

Quote
Hello Harry; sorry for not writing a post and asking you this directly, but i saw that you already answered this and it would be a waste of time.

I've seen that you succesfully removed the tier talent requirements ("You need 5 talent points in Arms tree"). But the only thing you said about it was a piece of Lua code that I tried to fit into TalentBaseFrame.lua but it made no difference.

It would be grateful if you could explain me how to do it or at least give me some advice as i'm really lost at this point.

Thanks for your help and I hope you can give me a hand.

No computer access till next week and it'd hard to reply from my phone. Basically I overwrite the tooltip with my own text which is incredibly hacky.

Quote
Thanks for your reply and sorry for making you answering me from your phone. There's no need to answer back to this message immediately.

Then what you did is rewriting TalentBaseFrame.lua?
I'll check it but it seems ain't gonna be easy; it doesn't matter how hacky is it, as it works as I need and the players don't notice anything weird.

It was a really complicated rewrite in the end. I can't remember which files and I can't check until I am back home after the weekend. I reply now because otherwise I will forget, the notification system on here is not that good.

Quote
You would make me the biggest favour ever if you check which files I need to edit. I'm trying to make a complex talent system and I really need to remove the 5 points per tier requirement otherwise i'm gonna have to change it completely.

Thanks for your time.


Apparently those files are no longer in my Dropbox.

You will have to look the talent addon changes I did in my EoC project. I cannot look because the files are too big for me to download - I only have < 1GB free on my computer. :P

http://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-emulator-servers/wow-emu-general-releases/470299-edge-of-chaos-expansion.html

Quote

Thank you for the help, i'm downloading the client right now and i'm gonna check the addon part. I'm not sure if i'm gonna be able to obtain what i'm looking for but i hope so.


PD: HDD sucks hahaha, I had a computer with just 60 GB HDD and it was a pain in the ass :P

Do u know if there's any problem with the rar itself? 7-zip is giving me the error "Invalid compression method for this file" when I try to extract the client :s. I've tried several ways but none of them worked properly.

Sorry for the trouble i'm causing you.

If both files have been downloaded, are in the same directory, and the file sizes match up with what they should be, then it should be as simple as right clicking either one, 7zip, extract here. You may have got a corrupt download.

Quote
Yes, you were right, both files were corrupted; downloaded it three more times and it finally worked properly. Had to install an EnGB client to install the patch and I finally got it to test it.

Such an awesome work you did there, love the login screen and all the functionalities. Buut, i'm in trouble with the talent interface; It says <Click to learn> but as soon as I click it to learn the talent it will show the "You require 5 talent points in..." tooltip and it won't learn anything.

Do u know if i need some modifications in the core to make it run properly?


No, the patch should work fine and if you extract the installed interface folder in patch-4.mpq you should see all the related code. If you send that to me I can test it (just the interface folder).

Quote
Then I should be missing something.

http://www.firedrive.com/file/2D25E6E13105A0CE

This is the link for the Interface folder of your patch. I removed the Icons folder as it was three times heavier than the whole Interface folder itself and it shouldn't make any difference.

And again, thank you so much for your time, you're really helping me out with this issue. :)

Just had a look at the code, this gets complicated fast.

The main logic is handled in InterfaceAddonsBlizzard_TalentUIBlizzard_TalentUI.lua

You can see this function:

Code: [Select]
function PlayerTalentFrameTalent_OnEnter(self)

This handles the game tooltip generation. And I really can't understand it from a glance. I said it was hacked together.

Have you tested to see what happens when you include this file in your MPQ?

Quote
Yes, I tried it in different ways.

Just by including an MPQ with Blizzard_TalentUI.lua & Blizzard_TalentUI.xml: I can't add any talent point at all, if I click on any talent, it won't do anything.

I've also tried to use your whole patch to check what it does.




This is how it's supposed to work and what i'm trying to achieve, but, when I try to learn anything from the second talent tier, I get this.



Do u have any idea of why is this working like this?

Did you change the server side requirement too?

Quote
That's what i'm missing then, though i'm not sure where it is, i'll try to find it.

PD: i'm running TrinityCore
Quote
Yes! Finally got it working! I had to remove some checkings from the core and now it works as I intended.

Thank you very much for the help Stoneharry. If you ever need help with anything i'll try to help you as much as I can.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

xzetaxx

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 15
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #3 on: May 11, 2015, 03:57:00 pm »
Quote
Yes! Finally got it working! I had to remove some checkings from the core and now it works as I intended.

Thank you very much for the help Stoneharry. If you ever need help with anything i'll try to help you as much as I can.

What core checkings did he remove?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #4 on: May 11, 2015, 04:11:42 pm »
Quote from: "xzetaxx"
Quote
Yes! Finally got it working! I had to remove some checkings from the core and now it works as I intended.

Thank you very much for the help Stoneharry. If you ever need help with anything i'll try to help you as much as I can.

What core checkings did he remove?
What core do you need ?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

xzetaxx

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 15
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #5 on: May 11, 2015, 04:56:59 pm »
Quote from: "Ascathos"
Quote from: "xzetaxx"
Quote
Yes! Finally got it working! I had to remove some checkings from the core and now it works as I intended.

Thank you very much for the help Stoneharry. If you ever need help with anything i'll try to help you as much as I can.

What core checkings did he remove?
What core do you need ?
Trinity
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Ascathos

  • Moderators
  • Creator of Worlds
  • *****
  • Posts: 1129
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #6 on: May 11, 2015, 05:30:38 pm »
If you do not want one talent requiring another,

comment this one out:

Player.cpp
Code: [Select]
   if (talentInfo->DependsOn > 0)
    {
        if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
        {
            bool hasEnoughRank = false;
            for (uint8 rank = talentInfo->DependsOnRank; rank < MAX_TALENT_RANK; rank++)
            {
                if (depTalentInfo->RankID[rank] != 0)
                    if (HasSpell(depTalentInfo->RankID[rank]))
                        hasEnoughRank = true;
            }
            if (!hasEnoughRank)
                return;
        }
    }

If you do not want to require a certain number of points in a tab;

Code: [Select]
   uint32 spentPoints = 0;

    uint32 tTab = talentInfo->TalentTab;
    if (talentInfo->Row > 0)
    {
        uint32 numRows = sTalentStore.GetNumRows();
        for (uint32 i = 0; i < numRows; i++)          // Loop through all talents.
        {
            // Someday, someone needs to revamp
            const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
            if (tmpTalent)                                  // the way talents are tracked
            {
                if (tmpTalent->TalentTab == tTab)
                {
                    for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
                    {
                        if (tmpTalent->RankID[rank] != 0)
                        {
                            if (HasSpell(tmpTalent->RankID[rank]))
                            {
                                spentPoints += (rank + 1);
                            }
                        }
                    }
                }
            }
        }
    }

Not sure what else is requiring, but those are some of the most glaring.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #7 on: February 27, 2016, 10:43:33 am »
Bumping this because the full fix was never fully clarified.

Also, if the server-side check is removed, what's stopping someone from just manually removing their own client-side check and placing talent points however they want?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Grymskvll

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 65
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #8 on: March 03, 2016, 08:02:09 am »
Quote from: "Vortalex"
Bumping this because the full fix was never fully clarified.

Also, if the server-side check is removed, what's stopping someone from just manually removing their own client-side check and placing talent points however they want?

I'm very new to emulation so apologies if I made a mistake and please correct me.

You don't have to change the server-side check, you can just change it to whatever you like. Client-side and server-side talent requirements should always be identical, otherwise you get either:
-a bug like in the OP's pic where the player's client says that you can put a point in the next row of talents, but you can't (because the client-side requirement is more relaxed than the server side one)
or:
-the opposite, where at some point the next tier is grayed out but you can still learn talents from it (sort of like the vulnerability you describe, except the player doesn't even need to modify their client to get access to talents that the server thinks you can learn)

To modify the required number of talent points spent to unlock the next tier/row (TrinityCore WotLK):
  • in InterfaceFrameXMLTalentFrameBase.lua change PLAYER_TALENTS_PER_TIER to your desired points requirement. This is the client-side (cosmetic) change. Every player needs to have this.
  • in gameEntitiesPlayerPlayer.cpp change this part:
    Code: [Select]
    if (spentPoints < (talentInfo->Row * MAX_TALENT_RANK))to something like this (note the added parentheses to account for order of operations):
    Code: [Select]
    if (spentPoints < (talentInfo->Row * (MAX_TALENT_RANK - 2) ))
  • Hunter pet talents: if you want to change hunter pet talent requirements per tier, you need to change PET_TALENTS_PER_TIER in TalentFrameBase.lua like you did for player talents, and in Player.cpp, make the same change you did for player talents, except in Player::LearnPetTalent this time, where it reads:
    Code: [Select]
    if (spentPoints < (talentInfo->Row * MAX_PET_TALENT_RANK))

WoW will crash if you try to start it with modified interface files, so you (and everyone else using the client-side modification) need to use a cracked Wow.exe found here.

In this case, the server-side requirement would be 5 - 2 = 3 per tier (3 points spent required for tier 2, 6 points spent required for tier 3, etc), and you would likewise set PLAYER_TALENTS_PER_TIER to 3 to avoid bugs. MAX_TALENT_RANK is defined as 5 in gameDataStoresDBCStructure.h, but it's used for other things and I don't know what the results would be if you changed it directly. MAX_PET_TALENT_RANK is defined as 3.

In the following image I set the per-tier requirement to 4 points spent:


Edit: see next post to fix mouseover tooltips and preview talents!


Unfortunately this has a minor cosmetic bug. Even though you can change when tiers unlock, if you mouse over a talent that you don't meet the original points requirement for, it puts "Requires X points in Y Talents" in the tooltip, and doesn't have the green "Click to learn" text at the bottom.

Moving a talent to an earlier row client-side affects whether a talent is deemed out of the player's reach or not, as the "Requires" text goes away and the "Click to learn" text appears, so I assume this requires another client-side edit, but I have no idea where.


All this required was changing the row for Soul Siphon in Talent.dbc, so the mouseover tooltip for talents somehow (directly or indirectly) looks at that value, right?

Does anyone know how to fix this? Unfortunately the download for stoneharry's Edge of Chaos client is no longer available at that link, so I can't check how it was done there (if at all).
« Last Edit: March 07, 2016, 03:51:49 am by Admin »

Grymskvll

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 65
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #9 on: March 03, 2016, 09:19:32 pm »

This solution is experimental. I haven't had any issues with it, but I haven't tested it extensively and I barely even understand how this works. For another method that uses a LUA edit, see stoneharry's post on the next page. With LUA edits, at worst you'll get a LUA error (I think?). With this edit, at worst your game will crash (though I haven't had any).



To fix talent mouseover tooltips having or missing the red "Requires [5 * tier] points in Y talents" or the green "Click to learn" text, and to fix preview talents, you need to make another change in Wow.exe (using for example OllyDbg).
This is for 3.3.5a (it should be similar for other versions, but you might have to improvise). This assumes you want players to have a higher per-tier requirement than pets. See note at the bottom if you want pets to require more points than players. Player and hunter pet talents can be changed independently.

Part 1: Fixing tooltips
  • fill in the following (value is in hexadecimal, convert numbers here if it's above 9):
    • Player requirement per tier (playerreq) =
    • Hunter pet requirement per tier (petreq) =
    • Difference = playerreq - petreq =
  • Open Wow.exe in OllyDbg and go to the below address, or right click -> Search for -> All referenced strings and find "TOOLTIP_TALENT_TIER_POINTS" in the results, then scroll up a little (it's one of the WoW constants described here):
    Code: [Select]
    006226E5      85FF          TEST EDI,EDI
    006226E7      0F94C0        SETE AL
    006226EA      8D4400 03     LEA EAX,[EAX+EAX+3]
  • Select these lines
  • Right click -> Edit -> Fill with NOPs
  • With the 9 NOP lines selected, press space to assemble (or right click -> assemble)
  • fill each line with the following one by one (swap "petreq" with your value, and only copy the command, not the address or hex value)
    Code: [Select]
    006226E5     /E9 0B010000   JMP 006227F5
    006226EA     |8D40 04       LEA EAX,[EAX+petreq]
    006226ED     |90            NOP
  • select the lines you edited (they're highlighted in red) and right click -> Edit -> Copy to executable. A popup will appear. Check that your edited lines are present in the popup, then go back to the original window (without closing the popup). You may want to resize the windows. You can recognize the popup by the D icon in the top-left, while the original window has a C icon.
  • Now scroll down a little and you'll see this:
    Code: [Select]
    006227F5      CC            INT3
    006227F6      CC            INT3
    006227F7      CC            INT3
    006227F8      CC            INT3
    006227F9      CC            INT3
    006227FA      CC            INT3
    006227FB      CC            INT3
    006227FC      CC            INT3
    006227FD      CC            INT3
    006227FE      CC            INT3
    006227FF      CC            INT3
  • Select these 11 lines and again fill with NOPs (right click -> Edit -> FIll with NOPs)
  • With the lines selected, press space to Assemble (or right click -> assemble)
  • Fill each line with the following one by one (swap "difference" with your value, and again only copy the command)
    Code: [Select]
    006227F5      85FF          TEST EDI,EDI
    006227F7      74 02         JNE SHORT 006227FB
    006227F9      B0 05         MOV AL,difference
    006227FB    ^ E9 EAFEFFFF   JMP 006226EA
  • Select these 4 red lines, right click -> Edit -> Copy to executable again. Check that all 7 total edited lines are in the popup window (D icon in top-left), split into 3 lines above and 4 lines below. Again, don't close the popup, just minimize or move to the side.

Part 2: Fixing preview talents
One more bunch of lines need to be edited to fix talent preview mode.
  • Go to the below address (ctrl+G and enter 005C7468, or right click -> Go to -> Expression and enter 005C7468)
    Code: [Select]
    005C7468      0F94C2        SETE DL
    005C746B      0358 04       ADD EBX,DWORD PTR DS:[EAX+4]
    005C746E      894D EC       MOV DWORD PTR SS:[EBP-14],ECX
    005C7471      8D5412 03     LEA EDX,[EDX+EDX+3]
  • Select these 4 lines and fill with NOPs (right click -> Edit -> FIll with NOPs)
  • With the NOP lines selected, pres space to Assemble (or right click -> assemble)
  • Fill each line with the following one by one (swap "difference" and "petreq" with your values)
    Code: [Select]
    005C7468     /75 02         JNE SHORT 005C746C
    005C746A     |B2 02         MOV DL,difference
    005C746C     358 04       ADD EBX,DWORD PTR DS:[EAX+4]
    005C746F      894D EC       MOV DWORD PTR SS:[EBP-14],ECX
    005C7472      8D52 07       LEA EDX,[EDX+petreq]
  • Select these 5 lines and right click -> Edit -> copy to executable
  • Right click the popup (D icon) and select "Save file...". Change the name so you're not overwriting your Wow.exe, save and test it.

Note:
This assumes you want players to have a higher requirement per tier of talents than hunter pets. If you want pets to require more points per tier than players, change the following:
  • Swap playerreq and petreq around when calculating the difference so you don't get a negative number.
    this: Difference = playerreq - petreq =
    becomes: Difference = petreq - playerreq =
  • In the first block, replace "petreq" with "playerreq"
  • In the second block, instead of JNE SHORT 006227FB use JE SHORT 006227FB
  • in the third block, replace "petreq" with "playerreq" and change JNE SHORT 005C746C to JE SHORT 005C746C

The general idea is you use the lower of the two as a base requirement for both (MOV AL,difference, AL is a part of EAX so when it checks EAX it finds what you placed in AL), then add the difference to the lower requirement to get the higher requirement (LEA EAX,[EAX+lower of the two requirements]).
« Last Edit: March 07, 2016, 04:37:37 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #10 on: March 05, 2016, 02:31:44 am »
Now THAT is what I call clarification. Good fuckin job bro.

I tried it exactly how you described and it worked perfectly. This was very easy to do, took me like 10 minutes. Awesome tutorial bro. If I could rep I would.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #11 on: March 05, 2016, 04:22:14 am »
Actually I was wrong. Server side requirement has been set, but server still says "Nope, not gonna let you put that point in there"

Must be another line of code somewhere that needs to be changed.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Grymskvll

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 65
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #12 on: March 05, 2016, 08:09:09 am »
Quote from: "Vortalex"
Actually I was wrong. Server side requirement has been set, but server still says "Nope, not gonna let you put that point in there"

Must be another line of code somewhere that needs to be changed.

That's odd. For me it works even if the only change is in Player.cpp. Did you recompile? If not, I think you can just build "game" and "worldserver" to save time. If you did, can you post what you changed the line to in Player.cpp?

Also, you might need to reset talents on the character you're testing it on. Forgot to mention that earlier, but I vaguely remember that being something when I was trying it out.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Vortalex

  • Registred Member
  • Model Change Addict
  • *****
  • Posts: 253
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #13 on: March 05, 2016, 08:18:39 am »
Quote
   // not have required min points spent in talent tree
    if (spentPoints < (talentInfo->Row * (MAX_TALENT_RANK - 2) ))
        return;

Ain't doin shit.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

Grymskvll

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 65
    • View Profile
Re: [HELP] Remove Talent Point Requirement
« Reply #14 on: March 05, 2016, 09:08:27 am »
I just tried that code and it worked as expected. According to Git Extensions, that's the only change I've made to the source.

I don't know what the problem could be so I'll just ask you to follow these steps exactly:
  • make sure you don't have worldserver.exe running
  • Open TrinityCore.sln in (hopefully, for the sake of parity) Visual Studio
  • Double check that Player.cpp has the correct modification
  • In the solution explorer window of Visual Studio, click "game" and ctrl+click "worldserver". While they're both highlighted, right click either and click "Build Selection"
  • When it's done, check that the worldserver.exe that you use has been modified in the last few minutes
  • Log into your server and make a new character. Level it up and try to spend talent points. Make sure you're not being tricked by the buttons staying grayed out (if you haven't made client-side changes)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »