mirror of
https://github.com/mangosfour/server.git
synced 2025-12-29 07:37:05 +00:00
Various Cleanups (game S)
This commit is contained in:
parent
865f7d7428
commit
08fd085549
18 changed files with 3168 additions and 3146 deletions
|
|
@ -59,7 +59,7 @@ void LoadSkillExtraItemTable()
|
|||
SkillExtraItemStore.clear(); // need for reload
|
||||
|
||||
// 0 1 2 3
|
||||
QueryResult *result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
|
||||
QueryResult* result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template");
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
|
@ -67,7 +67,7 @@ void LoadSkillExtraItemTable()
|
|||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
Field* fields = result->Fetch();
|
||||
bar.step();
|
||||
|
||||
uint32 spellId = fields[0].GetUInt32();
|
||||
|
|
@ -106,7 +106,8 @@ void LoadSkillExtraItemTable()
|
|||
skillExtraItemEntry.additionalMaxNum = additionalMaxNum;
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
|
|
@ -116,25 +117,25 @@ void LoadSkillExtraItemTable()
|
|||
else
|
||||
{
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty." );
|
||||
sLog.outString(">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
|
||||
}
|
||||
}
|
||||
|
||||
bool canCreateExtraItems(Player * player, uint32 spellId, float &additionalChance, uint8 &additionalMax)
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float& additionalChance, uint8& additionalMax)
|
||||
{
|
||||
// get the info for the specified spell
|
||||
SkillExtraItemMap::const_iterator ret = SkillExtraItemStore.find(spellId);
|
||||
if(ret==SkillExtraItemStore.end())
|
||||
if (ret==SkillExtraItemStore.end())
|
||||
return false;
|
||||
|
||||
SkillExtraItemEntry const* specEntry = &ret->second;
|
||||
|
||||
// if no entry, then no extra items can be created
|
||||
if(!specEntry)
|
||||
if (!specEntry)
|
||||
return false;
|
||||
|
||||
// the player doesn't have the required specialization, return false
|
||||
if(!player->HasSpell(specEntry->requiredSpecialization))
|
||||
if (!player->HasSpell(specEntry->requiredSpecialization))
|
||||
return false;
|
||||
|
||||
// set the arguments to the appropriate values
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue