Forum > Serverside Modding
[C++] Talent Points Per Level
(1/1)
XxXGenesisXxX:
Hey guys. been trying to get it so that instead of gaining one talent point per level, instead you gain them once every 15 levels.
Original Code
--- Code: --- while(newxp >= nextlevelxp && newxp > 0) { ++level; li = objmgr.GetLevelInfo(getRace(), getClass(), level); if(li == NULL) return; newxp -= nextlevelxp; nextlevelxp = li->XPToNextLevel; levelup = true;
if(level > 9) AddTalentPointsToAllSpec( 1 );
if(level >= GetMaxLevel()) break; }
if(level > GetMaxLevel()) level = GetMaxLevel();
--- End code ---
I've tried quite a few different things and keep getting results I'm not after.
Looking for something similar to this but actually working xD
--- Code: --- while(newxp >= nextlevelxp && newxp > 0) { ++level; li = objmgr.GetLevelInfo(getRace(), getClass(), level); if(li == NULL) return; newxp -= nextlevelxp; nextlevelxp = li->XPToNextLevel; levelup = true;
if(level == 15) AddTalentPointsToAllSpec( 1 ); break; if(level == 30) AddTalentPointsToAllSpec( 1 ); break; if(level == 45) AddTalentPointsToAllSpec( 1 ); break; if(level == 60) AddTalentPointsToAllSpec( 1 ); break; if(level >= GetMaxLevel()) break; } --- End code ---
Help and an explanation would be greatly appreciated :)
schlumpf:
There is no reason for all the break; statements. Actually, the way you wrote it, it will not create information for anything but level 1.
Also,
--- Code: --- if(!(level % 15)) AddTalentPointsToAllSpec( 1 ); --- End code ---
XxXGenesisXxX:
Thanks for the reply slumpf. However i tried that an i am still going up one point every level.
jcarter:
Why are you doing this in C++? Is the core you're using not already setup to change that right in the configs?
Trinity Does, I'm not sure about the others...
# # Rate.Talent # Description: Talent point rate. # Default: 1
Rate.Talent = 1
^ Just simple division that is 1:1
I have mine set to .40 but you can easily set it to reward every 15 levels.
XxXGenesisXxX:
At the time of this post that option did not exist within the TrinityCore config. And if it doesn't exist: Create it. Which apparently is exactly what TC did.
Navigation
[0] Message Index
|