From e19f56ba2333ceffd716f57beeda12103374ff6a Mon Sep 17 00:00:00 2001 From: Easelm Date: Thu, 17 Mar 2016 18:45:23 -0400 Subject: [PATCH] Update Player:AdvanceAllSkills method Ref: #193 - Tested on TrinityCore WotLK, works fine. Code should be consistent throughout all sources. Still needs to be compiled & tested on other sources however. Test script: http://pastebin.com/bNCsRBqN --- PlayerMethods.h | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/PlayerMethods.h b/PlayerMethods.h index ef47dad..d7504cd 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -3236,23 +3236,18 @@ namespace LuaPlayer if (!step) return 0; - static const uint32 skillsArray[] = { SKILL_DEFENSE, SKILL_BOWS, SKILL_CROSSBOWS, SKILL_GUNS, SKILL_WANDS, SKILL_THROWN, SKILL_DAGGERS, SKILL_UNARMED, SKILL_FIST_WEAPONS, SKILL_AXES, - SKILL_MACES, SKILL_SWORDS, SKILL_POLEARMS, SKILL_STAVES, SKILL_2H_AXES, SKILL_2H_MACES, SKILL_2H_SWORDS, SKILL_SHIELD, SKILL_MINING, SKILL_ENCHANTING, SKILL_BLACKSMITHING, - SKILL_ALCHEMY, SKILL_HERBALISM, SKILL_ENGINEERING, SKILL_LEATHERWORKING, SKILL_LOCKPICKING, SKILL_SKINNING, SKILL_TAILORING, SKILL_COOKING, SKILL_FIRST_AID, SKILL_FISHING, -#ifndef CLASSIC - SKILL_JEWELCRAFTING, -#endif -#if (!defined(TBC) && !defined(CLASSIC)) - SKILL_INSCRIPTION, -#endif - }; - static const uint32 skillsSize = sizeof(skillsArray) / sizeof(*skillsArray); - - for (uint32 i = 0; i < skillsSize; ++i) + for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i) { - if (player->HasSkill(skillsArray[i])) - player->UpdateSkill(skillsArray[i], step); + if (SkillLineEntry const* entry = sSkillLineStore.LookupEntry(i)) + { + if (entry->categoryId == 10 || entry->categoryId == 12) + continue; + + if (player->HasSkill(entry->id)) + player->UpdateSkill(entry->id, step); + } } + return 0; }