mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9657] Not include in .list talents disabled spells
Also some more cleanups in free talent points update calls.
This commit is contained in:
parent
034da8f6d4
commit
973a21060b
4 changed files with 7 additions and 11 deletions
|
|
@ -4368,7 +4368,7 @@ bool ChatHandler::HandleListTalentsCommand (const char * /*args*/)
|
||||||
PlayerSpellMap const& uSpells = player->GetSpellMap();
|
PlayerSpellMap const& uSpells = player->GetSpellMap();
|
||||||
for (PlayerSpellMap::const_iterator itr = uSpells.begin(); itr != uSpells.end(); ++itr)
|
for (PlayerSpellMap::const_iterator itr = uSpells.begin(); itr != uSpells.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second.state == PLAYERSPELL_REMOVED)
|
if (itr->second.state == PLAYERSPELL_REMOVED || itr->second.disabled)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint32 cost_itr = GetTalentSpellCost(itr->first);
|
uint32 cost_itr = GetTalentSpellCost(itr->first);
|
||||||
|
|
|
||||||
|
|
@ -1562,7 +1562,7 @@ bool Pet::resetTalents(bool no_cost)
|
||||||
|
|
||||||
if (m_usedTalentCount == 0)
|
if (m_usedTalentCount == 0)
|
||||||
{
|
{
|
||||||
SetFreeTalentPoints(talentPointsForLevel);
|
UpdateFreeTalentPoints(false); // for fix if need counter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1619,7 +1619,7 @@ bool Pet::resetTalents(bool no_cost)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetFreeTalentPoints(talentPointsForLevel);
|
UpdateFreeTalentPoints(false);
|
||||||
|
|
||||||
if(!no_cost)
|
if(!no_cost)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3611,11 +3611,9 @@ bool Player::resetTalents(bool no_cost)
|
||||||
if(HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
|
if(HasAtLoginFlag(AT_LOGIN_RESET_TALENTS))
|
||||||
RemoveAtLoginFlag(AT_LOGIN_RESET_TALENTS,true);
|
RemoveAtLoginFlag(AT_LOGIN_RESET_TALENTS,true);
|
||||||
|
|
||||||
uint32 talentPointsForLevel = CalculateTalentsPoints();
|
|
||||||
|
|
||||||
if (m_usedTalentCount == 0)
|
if (m_usedTalentCount == 0)
|
||||||
{
|
{
|
||||||
SetFreeTalentPoints(talentPointsForLevel);
|
UpdateFreeTalentPoints(false); // for fix if need counter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3681,7 +3679,7 @@ bool Player::resetTalents(bool no_cost)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetFreeTalentPoints(talentPointsForLevel);
|
UpdateFreeTalentPoints(false);
|
||||||
|
|
||||||
if(!no_cost)
|
if(!no_cost)
|
||||||
{
|
{
|
||||||
|
|
@ -20854,6 +20852,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
||||||
if (HasSpell(depTalentInfo->RankID[i]))
|
if (HasSpell(depTalentInfo->RankID[i]))
|
||||||
hasEnoughRank = true;
|
hasEnoughRank = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasEnoughRank)
|
if (!hasEnoughRank)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -21040,9 +21039,6 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
|
||||||
// learn! (other talent ranks will unlearned at learning)
|
// learn! (other talent ranks will unlearned at learning)
|
||||||
pet->learnSpell(spellid);
|
pet->learnSpell(spellid);
|
||||||
sLog.outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
|
sLog.outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
|
||||||
|
|
||||||
// update free talent points
|
|
||||||
pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
|
void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9656"
|
#define REVISION_NR "9657"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue