PasteSite.Com

Recent Pastes

Sign Up!

PasteSite is open to the public, but with limited features. Register to be able to modify access rights, track your pastes and more...

Change the theme

If you prefer reading light text on a dark background to dark text on a light background, then you might want to try the dark theme.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recv_data)
{
    if(!_player->IsInWorld()) return;
    uint32 skill_line;
    uint32 points_remaining=_player->GetUInt32Value(PLAYER_CHARACTER_POINTS2);
    recv_data >> skill_line;
 
    // Cheater detection
    // if(!_player->HasSkillLine(skill_line)) return;
 
    // Remove any spells within that line that the player has
    _player->RemoveSpellsFromLine(skill_line);
    
    // Finally, remove the skill line.
    _player->_RemoveSkillLine(skill_line);
 
    //added by Zack : This is probably wrong or already made elsewhere : restore skill learnability
    if(points_remaining==_player->GetUInt32Value(PLAYER_CHARACTER_POINTS2))
    {
        //we unlearned a skill so we enable a new one to be learned
        skilllineentry *sk=dbcSkillLine.LookupEntry(skill_line);
        if(!sk)
            return;
        if(sk->type==SKILL_TYPE_PROFESSION && points_remaining<2)
            _player->SetUInt32Value(PLAYER_CHARACTER_POINTS2,points_remaining+1);
    }
}

Reply to This Paste

(leave blank to make this paste permanent)
(if set as private)