diff options
author | megamage <none@none> | 2009-04-20 20:33:43 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-20 20:33:43 -0500 |
commit | 624c30138a5519c084c8082d10d2f18da9474773 (patch) | |
tree | 4cd372f06f210bdf138f23a22cb030e2e4dacc60 /src/game/Player.cpp | |
parent | 5bb13802a70196e0d4ae31a01f7185b11a6bd525 (diff) |
[7692] Implement ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE and reimplement ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS. Author: VladimirMangos
Also correctly set this criteria at login.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6d34202b4bc..937b92a47b1 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2955,6 +2955,9 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen SpellLearnSkillNode const* spellLearnSkill = spellmgr.GetSpellLearnSkill(spell_id); + SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id); + SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id); + if(spellLearnSkill) { uint32 skill_value = GetPureSkillValue(spellLearnSkill->skill); @@ -2973,9 +2976,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen else { // not ranked skills - SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id); - SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id); - for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx) { SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId); @@ -3022,10 +3022,16 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } } - if(IsInWorld()) + if(!GetSession()->PlayerLoading()) { + // not ranked skills + for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx) + { + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE,_spell_idx->second->skillId); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,_spell_idx->second->skillId); + } + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL,spell_id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,spell_id); } // return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell |