59 QueryResult result =
WorldDatabase.
Query(
"SELECT spellId, requiredSpecialization, perfectCreateChance, perfectItemType FROM skill_perfect_item_template");
63 TC_LOG_ERROR(
"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 %u has non-existent spell id in `skill_perfect_item_template`!", spellId);
82 if (!
sSpellMgr->GetSpellInfo(requiredSpecialization))
84 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell %u has non-existent required specialization spell id %u in `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 %u has impossibly low proc chance in `skill_perfect_item_template`!", spellId);
96 if (!
sObjectMgr->GetItemTemplate(perfectItemType))
98 TC_LOG_ERROR(
"sql.sql",
"Skill perfection data for spell %u references non-existent perfect item id %u in `skill_perfect_item_template`!", spellId, perfectItemType);
110 while (result->NextRow());
float GetFloat() const
Definition: Field.h:222
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 perfectItemType
Definition: SkillExtraItems.cpp:38
uint32 getMSTime()
Definition: Timer.h:24
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
#define sObjectMgr
Definition: ObjectMgr.h:1567
float perfectCreateChance
Definition: SkillExtraItems.cpp:36
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint32 GetUInt32() const
Definition: Field.h:146
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: SkillExtraItems.cpp:31
uint32 requiredSpecialization
Definition: SkillExtraItems.cpp:34