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
This commit is contained in:
Easelm
2016-03-17 18:45:23 -04:00
parent d6cbadfec9
commit e19f56ba23

View File

@@ -3236,23 +3236,18 @@ namespace LuaPlayer
if (!step) if (!step)
return 0; 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, for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i)
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)
{ {
if (player->HasSkill(skillsArray[i])) if (SkillLineEntry const* entry = sSkillLineStore.LookupEntry(i))
player->UpdateSkill(skillsArray[i], step); {
if (entry->categoryId == 10 || entry->categoryId == 12)
continue;
if (player->HasSkill(entry->id))
player->UpdateSkill(entry->id, step);
}
} }
return 0; return 0;
} }