59 QueryResult result =
WorldDatabase.Query(
"SELECT spellId, requiredSpecialization, perfectCreateChance, perfectItemType FROM skill_perfect_item_template");
63 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
71 Field* fields = result->Fetch();
77 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has a non-existing spell id in the `skill_perfect_item_template`!", spellId);
82 if (!
sSpellMgr->GetSpellInfo(requiredSpecialization))
84 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has a non-existing required specialization spell id {} in the `skill_perfect_item_template`!", spellId, requiredSpecialization);
88 float perfectCreateChance = fields[2].
GetFloat();
89 if (perfectCreateChance <= 0.0f)
91 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} has impossibly low proc chance in the `skill_perfect_item_template`!", spellId);
96 if (!
sObjectMgr->GetItemTemplate(perfectItemType))
98 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell {} references a non-existing perfect item id {} in the `skill_perfect_item_template`!", spellId, perfectItemType);
110 while (result->NextRow());
146 QueryResult result =
WorldDatabase.Query(
"SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
150 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
158 Field* fields = result->Fetch();
164 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has a non-existing spell id in the `skill_extra_item_template`!", spellId);
169 if (!
sSpellMgr->GetSpellInfo(requiredSpecialization))
171 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has a non-existing required specialization spell id {} in the `skill_extra_item_template`!", spellId, requiredSpecialization);
175 float additionalCreateChance = fields[2].
GetFloat();
176 if (additionalCreateChance <= 0.0f)
178 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has too low additional create chance in the `skill_extra_item_template`!", spellId);
183 if (!additionalMaxNum)
185 TC_LOG_ERROR(
"sql.sql",
"Skill specialization {} has 0 max number of extra items in the `skill_extra_item_template`!", spellId);
197 while (result->NextRow());
SkillPerfectItemEntry(uint32 rS, float pCC, uint32 pIT)
float perfectCreateChance
uint32 requiredSpecialization