• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Extra Talent Points for GM ranks

Status
Not open for further replies.

Chronic

Enthusiast
Hello, i've been looking for a way to make it so people who have the Gm rank 1 or higher get 10 extra talent points. I have been looking into it for a while but i'm not the brightest when it comes to C++. so basically everyone gets 76 talent points unless they have a gm rank of 1 or higher then they would get 86 talent points. This is a Trinity 3.3.5 compile, where the level cap is 85. If someone could help me out with this, I would appreciate it a lot.

Thank you,
 

Chronic

Enthusiast
Well, that would be fine if I was just modifying my own talent points. But I want it to modify all the vip / gm ranks, I would have a custom command or a creature gossip to do this but they would have to use the command or talk to the creature every time they create a new character or want to reset there talent points since trinity core doesn't save the amount talent points in the database. I would much rather have it so they can log in and start off with the extra talent points.
 

slp13at420

Mad Scientist
I did something like this with my C++ vip system. It adds extra talent points for vip levels. but you could could probably review my cheatsheat to get an idea of where to start.

Code:
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
-----------------------------------------------------
src/server/game/entities/
Player.cpp
[CODE] line 3157 - void Player::InitTalentForLevel()
        uint32 VIP_TP_BONUS = sWorld->getIntConfig(CONFIG_VIP_TP_BONUS);
        uint8 Pvip = sAccountMgr->GetVIP(GetSession()->GetAccountId());
        uint32 TPMOD = (Pvip * VIP_TP_BONUS);

        uint32 talentPointsForLevel = CalculateTalentsPoints();

Code:
 line 3164 - void Player::InitTalentForLevel()
        if (m_usedTalentCount > (talentPointsForLevel + TPMOD))

Code:
 line 3158 - void Player::InitTalentForLevel()
            SetFreeTalentPoints((talentPointsForLevel + TPMOD) - m_usedTalentCount);
-----------------------------------------------------
Code:
 line 4415 - bool Player::resetTalents(bool no_cost)
    uint8 VIP_TP_BONUS = sWorld->getIntConfig(CONFIG_VIP_TP_BONUS);
    uint8 Pvip = sAccountMgr->GetVIP(GetSession()->GetAccountId());
    uint32 TPMOD = (Pvip * VIP_TP_BONUS);

Code:
 line 4430 - bool Player::resetTalents(bool no_cost)
        SetFreeTalentPoints(talentPointsForLevel + TPMOD);

Code:
 line 4492 - bool Player::resetTalents(bool no_cost)
    SetFreeTalentPoints(talentPointsForLevel + TPMOD);
-----------------------------------------------------
/////////////////////////////////////////////////////
[/CODE]

instead of using the vip level you can use the acct security level.
it works thru resets :D
you could change
uint8 VIP_TP_BONUS = 9;
uint8 Pvip = 0;

then add a check if(player:IsGM()) to set Pvip to 1 then if not it will stay 0 and affect the the math lol
add this after the check
uint32 TPMOD = (Pvip * VIP_TP_BONUS);
 
Last edited:

Chronic

Enthusiast
So far I think I have set it up correctly, just the part I don't understand is

Code:
 line 4415 - bool Player::resetTalents(bool no_cost)
    uint8 VIP_TP_BONUS = sWorld->getIntConfig(CONFIG_VIP_TP_BONUS);
    uint8 Pvip = sAccountMgr->GetVIP(GetSession()->GetAccountId());
    uint32 TPMOD = (Pvip * VIP_TP_BONUS);

Not sure where I would put this part.. Well the edited part of it,

Code:
    for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
    {
        TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);

        if (!talentInfo)
            continue;

        TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); ## This is my line 4415

        if (!talentTabInfo)
            continue;

not even sure if that is the correct spot to put it..
 

slp13at420

Mad Scientist
im initializing variables here:
uint32 VIP_TP_BONUS = sWorld->getIntConfig(CONFIG_VIP_TP_BONUS);
uint8 Pvip = sAccountMgr->GetVIP(GetSession()->GetAccountId());
uint32 TPMOD = (Pvip * VIP_TP_BONUS);

you can change the names like this:
uint32 GM_BONUS = 8;
uint8 multiplier = 0;

if(player:IsGM())then
{
multiplier = 1;
};
uint32 TPMOD = (multiplier * GM_BONUS);

the line numbers are just for reference. find `bool Player::resetTalents(bool no_cost)`
and add those variable lines at the top then find both `SetFreeTalentPoints(talentPointsForLevel)` inside this block and edit both lines to `SetFreeTalentPoints(talentPointsForLevel + TPMOD);

if player is NOT gm then 8*0 = 0 so SetFreeTalentPoints(talentPointsForLevel + 0)
if player is gm then 8*1 = 8 so SetFreeTalentPoints(talentPointsForLevel + 8)
 
Last edited:

Chronic

Enthusiast
Got it to work, thanks so much! Someone can mark it as solved

Just had to set _vipBonus to that

uint32 _vipBonus = Pvip == 0 ? 0 : 10;
 
Last edited:
Status
Not open for further replies.
Top