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
-
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
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
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 :)
-
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,
if(!(level % 15))
AddTalentPointsToAllSpec( 1 );
-
Thanks for the reply slumpf. However i tried that an i am still going up one point every level.
-
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.
-
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.