Core/DataStores: Moved SkillTiers to database - it no longer exists in dbc form

This commit is contained in:
Shauren
2015-07-05 01:18:57 +02:00
parent 38f9821627
commit d454df54d1
10 changed files with 109 additions and 15 deletions
+61
View File
@@ -0,0 +1,61 @@
--
-- Table structure for table `skill_tiers`
--
DROP TABLE IF EXISTS `skill_tiers`;
CREATE TABLE `skill_tiers` (
`ID` int(10) unsigned NOT NULL DEFAULT '0',
`Value1` int(10) unsigned NOT NULL DEFAULT '0',
`Value2` int(10) unsigned NOT NULL DEFAULT '0',
`Value3` int(10) unsigned NOT NULL DEFAULT '0',
`Value4` int(10) unsigned NOT NULL DEFAULT '0',
`Value5` int(10) unsigned NOT NULL DEFAULT '0',
`Value6` int(10) unsigned NOT NULL DEFAULT '0',
`Value7` int(10) unsigned NOT NULL DEFAULT '0',
`Value8` int(10) unsigned NOT NULL DEFAULT '0',
`Value9` int(10) unsigned NOT NULL DEFAULT '0',
`Value10` int(10) unsigned NOT NULL DEFAULT '0',
`Value11` int(10) unsigned NOT NULL DEFAULT '0',
`Value12` int(10) unsigned NOT NULL DEFAULT '0',
`Value13` int(10) unsigned NOT NULL DEFAULT '0',
`Value14` int(10) unsigned NOT NULL DEFAULT '0',
`Value15` int(10) unsigned NOT NULL DEFAULT '0',
`Value16` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `skill_tiers` (`ID`,`Value1`,`Value2`,`Value3`,`Value4`,`Value5`,`Value6`,`Value7`,`Value8`,`Value9`,`Value10`,`Value11`,`Value12`,`Value13`,`Value14`,`Value15`,`Value16`) VALUES
(2,75,150,225,300,375,450,525,600,700,800,900,1000,0,0,0,0),
(21,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(22,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(23,75,150,225,300,375,450,525,600,700,750,825,900,0,0,0,0),
(24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(41,75,150,225,300,375,450,525,600,700,800,900,1000,1100,1200,1300,1400),
(61,75,150,225,300,375,450,525,600,700,750,825,900,0,0,0,0),
(62,75,150,225,300,375,450,525,600,700,800,900,1000,1100,1200,1300,1400),
(63,75,150,225,300,375,450,525,600,700,750,825,900,0,0,0,0),
(81,75,150,225,0,0,0,0,0,0,0,0,0,0,0,0,0),
(121,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(122,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(123,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(124,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(125,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(126,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(127,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(141,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(142,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(143,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(161,75,150,225,300,375,450,525,600,700,800,900,1000,1100,1200,1300,1400),
(181,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(182,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(221,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(222,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(223,75,150,225,300,375,0,0,0,0,0,0,0,0,0,0,0),
(224,75,150,225,300,375,450,525,600,700,750,825,900,0,0,0,0),
(230,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(233,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(234,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(235,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(236,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(237,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
(295,30,0,0,300,375,450,525,600,700,800,900,1000,0,0,0,0);
-2
View File
@@ -199,7 +199,6 @@ DBCStorage <SkillLineEntry> sSkillLineStore(SkillLinefmt);
DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore(SkillLineAbilityfmt);
DBCStorage <SkillRaceClassInfoEntry> sSkillRaceClassInfoStore(SkillRaceClassInfofmt);
SkillRaceClassInfoMap SkillRaceClassInfoBySkill;
DBCStorage <SkillTiersEntry> sSkillTiersStore(SkillTiersfmt);
DBCStorage <SpecializationSpellsEntry> sSpecializationSpellsStore(SpecializationSpellsEntryfmt);
std::unordered_map<uint32, std::vector<SpecializationSpellsEntry const*>> sSpecializationSpellsBySpecStore;
@@ -459,7 +458,6 @@ void LoadDBCStores(const std::string& dataPath)
LOAD_DBC(sSkillLineStore, "SkillLine.dbc");//19116
LOAD_DBC(sSkillLineAbilityStore, "SkillLineAbility.dbc");//19116
LOAD_DBC(sSkillRaceClassInfoStore, "SkillRaceClassInfo.dbc");//19116
LOAD_DBC(sSkillTiersStore, "SkillTiers.dbc");
LOAD_DBC(sSpecializationSpellsStore, "SpecializationSpells.dbc");
LOAD_DBC(sSpellStore, "Spell.dbc"/*, &CustomSpellEntryfmt, &CustomSpellEntryIndex*/);
LOAD_DBC(sSpellCategoriesStore, "SpellCategories.dbc");//15595
-1
View File
@@ -240,7 +240,6 @@ extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
extern DBCStorage <SkillLineEntry> sSkillLineStore;
extern DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore;
extern DBCStorage <SkillRaceClassInfoEntry> sSkillRaceClassInfoStore;
extern DBCStorage <SkillTiersEntry> sSkillTiersStore;
extern SpellEffectScallingByEffectId sSpellEffectScallingByEffectId;
extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore;
extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore;
@@ -1483,14 +1483,6 @@ struct SkillRaceClassInfoEntry
uint32 SkillTierID; // 7
};
#define MAX_SKILL_STEP 16
struct SkillTiersEntry
{
uint32 ID; // 0
uint32 Value[MAX_SKILL_STEP]; // 1-16
};
// SpecializationSpells.dbc
struct SpecializationSpellsEntry
{
-1
View File
@@ -136,7 +136,6 @@ char const ScalingStatDistributionfmt[] = "niii";
char const SkillLinefmt[] = "nisxixixx";
char const SkillLineAbilityfmt[] = "niiiiiiiiiiii";
char const SkillRaceClassInfofmt[] = "diiiiiii";
char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii";
char const SpecializationSpellsEntryfmt[] = "niiix";
char const SpellCastTimefmt[] = "nixx";
char const SpellCategoriesEntryfmt[] = "diiiiiiiii";
+1 -1
View File
@@ -22843,7 +22843,7 @@ void Player::LearnDefaultSkill(SkillRaceClassInfoEntry const* rcInfo)
if (getClass() == CLASS_DEATH_KNIGHT && skillId == SKILL_FIRST_AID)
rank = 4;
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID);
SkillTiersEntry const* tier = sObjectMgr->GetSkillTier(rcInfo->SkillTierID);
uint16 maxValue = tier->Value[std::max<int32>(rank - 1, 0)];
uint16 skillValue = 1;
if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
+27 -1
View File
@@ -7705,6 +7705,32 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
TC_LOG_INFO("server.loading", ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadSkillTiers()
{
uint32 oldMSTime = getMSTime();
QueryResult result = WorldDatabase.Query("SELECT ID, Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, "
" Value11, Value12, Value13, Value14, Value15, Value16 FROM skill_tiers");
if (!result)
{
TC_LOG_ERROR("server.loading", ">> Loaded 0 skill max values. DB table `skill_tiers` is empty.");
return;
}
do
{
Field* fields = result->Fetch();
uint32 id = fields[0].GetUInt32();
SkillTiersEntry& tier = _skillTiers[id];
for (uint32 i = 0; i < MAX_SKILL_STEP; ++i)
tier.Value[i] = fields[1 + i].GetUInt32();
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u skill max values in %u ms", uint32(_skillTiers.size()), GetMSTimeDiffToNow(oldMSTime));
}
bool ObjectMgr::CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName const& names)
{
// get main part of the name
@@ -7769,7 +7795,7 @@ SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry)
if (!skill)
return SKILL_RANGE_NONE;
if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
if (sObjectMgr->GetSkillTier(rcEntry->SkillTierID))
return SKILL_RANGE_RANK;
if (rcEntry->SkillID == SKILL_RUNEFORGING)
+16
View File
@@ -627,6 +627,14 @@ enum SkillRangeType
SKILL_RANGE_NONE // 0..0 always
};
#define MAX_SKILL_STEP 16
struct SkillTiersEntry
{
uint32 ID; // 0
uint32 Value[MAX_SKILL_STEP]; // 1-16
};
SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry);
#define MAX_PLAYER_NAME 12 // max allowed by client name length
@@ -1019,6 +1027,7 @@ class ObjectMgr
void LoadPetNames();
void LoadPetNumber();
void LoadFishingBaseSkillLevel();
void LoadSkillTiers();
void LoadReputationRewardRate();
void LoadReputationOnKill();
@@ -1053,6 +1062,12 @@ class ObjectMgr
return itr != _fishingBaseForAreaStore.end() ? itr->second : 0;
}
SkillTiersEntry const* GetSkillTier(uint32 skillTierId) const
{
auto itr = _skillTiers.find(skillTierId);
return itr != _skillTiers.end() ? &itr->second : nullptr;
}
void ReturnOrDeleteOldMails(bool serverUp);
CreatureBaseStats const* GetCreatureBaseStats(uint8 level, uint8 unitClass);
@@ -1457,6 +1472,7 @@ class ObjectMgr
typedef std::map<uint32, int32> FishingBaseSkillContainer; // [areaId][base skill level]
FishingBaseSkillContainer _fishingBaseForAreaStore;
std::unordered_map<uint32, SkillTiersEntry> _skillTiers;
typedef std::map<uint32, StringVector> HalfNameContainer;
HalfNameContainer _petHalfName0;
+1 -1
View File
@@ -2485,7 +2485,7 @@ void Spell::EffectLearnSkill(SpellEffIndex /*effIndex*/)
if (!rcEntry)
return;
SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID);
SkillTiersEntry const* tier = sObjectMgr->GetSkillTier(rcEntry->SkillTierID);
if (!tier)
return;
+3
View File
@@ -1735,6 +1735,9 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
TC_LOG_INFO("server.loading", "Loading skill tier info...");
sObjectMgr->LoadSkillTiers();
TC_LOG_INFO("server.loading", "Loading Achievements...");
sAchievementMgr->LoadAchievementReferenceList();
TC_LOG_INFO("server.loading", "Loading Achievement Criteria Modifier trees...");