Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: XxXGenesisXxX on May 30, 2012, 12:19:05 am

Title: [C++] Talent Points Per Level
Post by: XxXGenesisXxX on May 30, 2012, 12:19:05 am
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: [Select]
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();

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: [Select]
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;
}

Help and an explanation would be greatly appreciated :)
Title: Re: [C++] Talent Points Per Level
Post by: schlumpf on May 30, 2012, 09:09:53 am
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: [Select]
     if(!(level % 15))
         AddTalentPointsToAllSpec( 1 );
 
Title: Re: [C++] Talent Points Per Level
Post by: XxXGenesisXxX on June 05, 2012, 10:27:53 pm
Thanks for the reply slumpf. However i tried that an i am still going up one point every level.
Title: Re: [C++] Talent Points Per Level
Post by: jcarter on December 31, 2013, 03:55:33 pm
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.
Title: Re: [C++] Talent Points Per Level
Post by: XxXGenesisXxX on January 28, 2014, 10:16:01 pm
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.