[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
This commit is contained in:
+11
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user