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: [C++] Talent Points Per Level  (Read 2695 times)

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
[C++] Talent Points Per Level
« 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 :)
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [C++] Talent Points Per Level
« Reply #1 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 );
 
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [C++] Talent Points Per Level
« Reply #2 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

jcarter

  • Registred Member
  • MS Paint Freak
  • *****
  • Posts: 3
    • View Profile
Re: [C++] Talent Points Per Level
« Reply #3 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

XxXGenesisXxX

  • Contributors
  • Model Change Addict
  • *****
  • Posts: 204
    • View Profile
Re: [C++] Talent Points Per Level
« Reply #4 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.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »