mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -65,7 +65,7 @@ void LoadSkillDiscoveryTable()
|
||||
if (chance <= 0) // chance
|
||||
{
|
||||
ssNonDiscoverableEntries << "spellId = " << spellId << " reqSkillOrSpell = " << reqSkillOrSpell
|
||||
<< " reqSkillValue = " << reqSkillValue << " chance = " << chance << "(chance problem)\n";
|
||||
<< " reqSkillValue = " << reqSkillValue << " chance = " << chance << "(chance problem)\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ void LoadSkillDiscoveryTable()
|
||||
|
||||
// mechanic discovery
|
||||
if (reqSpellInfo->Mechanic != MECHANIC_DISCOVERY &&
|
||||
// explicit discovery ability
|
||||
!reqSpellInfo->IsExplicitDiscovery())
|
||||
// explicit discovery ability
|
||||
!reqSpellInfo->IsExplicitDiscovery())
|
||||
{
|
||||
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
|
||||
{
|
||||
sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
|
||||
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
|
||||
absReqSkillOrSpell, spellId);
|
||||
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
|
||||
absReqSkillOrSpell, spellId);
|
||||
reportedReqSpells.insert(absReqSkillOrSpell);
|
||||
}
|
||||
continue;
|
||||
@@ -120,8 +120,7 @@ void LoadSkillDiscoveryTable()
|
||||
}
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
if (!ssNonDiscoverableEntries.str().empty())
|
||||
sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
|
||||
@@ -212,8 +211,8 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
|
||||
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
{
|
||||
if (roll_chance_f(item_iter->chance * sWorld->getRate(RATE_SKILL_DISCOVERY)) &&
|
||||
item_iter->reqSkillValue <= skillvalue &&
|
||||
!player->HasSpell(item_iter->spellId))
|
||||
item_iter->reqSkillValue <= skillvalue &&
|
||||
!player->HasSpell(item_iter->spellId))
|
||||
return item_iter->spellId;
|
||||
}
|
||||
|
||||
@@ -230,8 +229,8 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
|
||||
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
{
|
||||
if (roll_chance_f(item_iter->chance * sWorld->getRate(RATE_SKILL_DISCOVERY)) &&
|
||||
item_iter->reqSkillValue <= skillvalue &&
|
||||
!player->HasSpell(item_iter->spellId))
|
||||
item_iter->reqSkillValue <= skillvalue &&
|
||||
!player->HasSpell(item_iter->spellId))
|
||||
return item_iter->spellId;
|
||||
}
|
||||
|
||||
|
||||
@@ -181,14 +181,13 @@ void LoadSkillExtraItemTable()
|
||||
skillExtraItemEntry.newMaxOrEntry = newMaxOrEntry;
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
bool CanCreatePerfectItem(Player* player, uint32 spellId, float &perfectCreateChance, uint32 &perfectItemType)
|
||||
bool CanCreatePerfectItem(Player* player, uint32 spellId, float& perfectCreateChance, uint32& perfectItemType)
|
||||
{
|
||||
SkillPerfectItemMap::const_iterator ret = SkillPerfectItemStore.find(spellId);
|
||||
// no entry in DB means no perfection proc possible
|
||||
@@ -212,7 +211,7 @@ bool CanCreatePerfectItem(Player* player, uint32 spellId, float &perfectCreateCh
|
||||
return true;
|
||||
}
|
||||
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, int32 &newMaxOrEntry)
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float& additionalChance, int32& newMaxOrEntry)
|
||||
{
|
||||
// get the info for the specified spell
|
||||
SkillExtraItemMap::const_iterator ret = SkillExtraItemStore.find(spellId);
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
// predef classes used in functions
|
||||
class Player;
|
||||
// returns true and sets the appropriate info if the player can create a perfect item with the given spellId
|
||||
bool CanCreatePerfectItem(Player* player, uint32 spellId, float &perfectCreateChance, uint32 &perfectItemType);
|
||||
bool CanCreatePerfectItem(Player* player, uint32 spellId, float& perfectCreateChance, uint32& perfectItemType);
|
||||
// load perfection proc info from DB
|
||||
void LoadSkillPerfectItemTable();
|
||||
// returns true and sets the appropriate info if the player can create extra items with the given spellId
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, int32 &newMaxOrEntry);
|
||||
bool canCreateExtraItems(Player* player, uint32 spellId, float& additionalChance, int32& newMaxOrEntry);
|
||||
// function to load the extra item creation info from DB
|
||||
void LoadSkillExtraItemTable();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user