*Massive cleanup redux.
--HG-- branch : trunk
This commit is contained in:
@@ -126,7 +126,7 @@ void LoadSkillDiscoveryTable()
|
||||
continue;
|
||||
}
|
||||
|
||||
for(SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
|
||||
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
|
||||
SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back( SkillDiscoveryEntry(spellId, reqSkillValue, chance) );
|
||||
}
|
||||
else
|
||||
@@ -146,7 +146,7 @@ void LoadSkillDiscoveryTable()
|
||||
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());
|
||||
|
||||
// report about empty data for explicit discovery spells
|
||||
for(uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id)
|
||||
for (uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id)
|
||||
{
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spell_id);
|
||||
if (!spellEntry)
|
||||
@@ -173,7 +173,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
|
||||
uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0;
|
||||
|
||||
float full_chance = 0;
|
||||
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
if (item_iter->reqSkillValue <= skillvalue)
|
||||
if (!player->HasSpell(item_iter->spellId))
|
||||
full_chance += item_iter->chance;
|
||||
@@ -181,7 +181,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
|
||||
float rate = full_chance / 100.0f;
|
||||
float roll = rand_chance() * rate; // roll now in range 0..full_chance
|
||||
|
||||
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
{
|
||||
if (item_iter->reqSkillValue > skillvalue)
|
||||
continue;
|
||||
@@ -207,7 +207,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
|
||||
|
||||
if (tab != SkillDiscoveryStore.end())
|
||||
{
|
||||
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
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 &&
|
||||
@@ -225,7 +225,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player)
|
||||
tab = SkillDiscoveryStore.find(-(int32)skillId);
|
||||
if (tab != SkillDiscoveryStore.end())
|
||||
{
|
||||
for(SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter)
|
||||
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 &&
|
||||
|
||||
Reference in New Issue
Block a user