aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/AchievementMgr.cpp5
-rw-r--r--src/game/DBCStores.cpp4
-rw-r--r--src/game/GameEventMgr.cpp70
-rw-r--r--src/game/InstanceSaveMgr.cpp24
-rw-r--r--src/game/ObjectMgr.cpp36
-rw-r--r--src/game/ObjectMgr.h4
-rw-r--r--src/game/PoolHandler.cpp18
-rw-r--r--src/game/SpellMgr.cpp204
-rw-r--r--src/game/WaypointManager.cpp8
-rw-r--r--src/game/World.cpp44
10 files changed, 284 insertions, 133 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 3be46b081ff..7a905055de1 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -2201,14 +2201,15 @@ void AchievementGlobalMgr::LoadRewardLocales()
QueryResult *result = WorldDatabase.Query("SELECT entry,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward");
- if(!result)
+ if (!result)
{
barGoLink bar(1);
bar.step();
sLog.outString();
- sLog.outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty.");
+ sLog.outString(">> Loaded 0 achievement reward locale strings.");
+ sLog.outString(">> DB table `locales_achievement_reward` is empty.");
return;
}
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index fb96c37028b..bc1165323b4 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -217,12 +217,12 @@ void LoadDBCStores(const std::string& dataPath)
const uint32 DBCFilesCount = 82;
- barGoLink bar( DBCFilesCount );
+ barGoLink bar(DBCFilesCount);
StoreProblemList bad_dbc_files;
uint32 availableDbcLocales = 0xFFFFFFFF;
- LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc");
+ LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaStore, dbcPath, "AreaTable.dbc");
// must be after sAreaStore loading
for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp
index c48a0f3f892..a15e6046d56 100644
--- a/src/game/GameEventMgr.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -195,7 +195,7 @@ void GameEventMgr::LoadFromDB()
{
{
QueryResult *result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event");
- if( !result )
+ if (!result)
{
sLog.outString(">> Table game_event is empty.");
sLog.outString();
@@ -211,7 +211,7 @@ void GameEventMgr::LoadFromDB()
}
QueryResult *result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event");
- if( !result )
+ if (!result)
{
mGameEvent.clear();
sLog.outString(">> Table game_event is empty!");
@@ -222,7 +222,7 @@ void GameEventMgr::LoadFromDB()
uint32 count = 0;
{
- barGoLink bar( result->GetRowCount() );
+ barGoLink bar(result->GetRowCount());
do
{
++count;
@@ -274,11 +274,14 @@ void GameEventMgr::LoadFromDB()
}
// load game event saves
- // 0 1 2
+
+ sLog.outString("Loading Game Event Saves Data...");
+
+ // 0 1 2
result = CharacterDatabase.Query("SELECT event_id, state, UNIX_TIMESTAMP(next_start) FROM game_event_save");
count = 0;
- if( !result )
+ if (!result)
{
barGoLink bar2(1);
bar2.step();
@@ -324,8 +327,11 @@ void GameEventMgr::LoadFromDB()
}
// load game event links (prerequisites)
+
+ sLog.outString("Loading Game Event Prerequisite Data...");
+
result = WorldDatabase.Query("SELECT event_id, prerequisite_event FROM game_event_prerequisite");
- if( !result )
+ if (!result)
{
barGoLink bar2(1);
bar2.step();
@@ -369,14 +375,18 @@ void GameEventMgr::LoadFromDB()
++count;
- } while( result->NextRow() );
+ } while (result->NextRow());
sLog.outString();
sLog.outString( ">> Loaded %u game event prerequisites in game events", count );
delete result;
}
+ // Creatures
+
+ sLog.outString("Loading Game Event Creature Data...");
+
mGameEventCreatureGuids.resize(mGameEvent.size()*2-1);
- // 1 2
+ // 1 2
result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.event "
"FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid");
@@ -421,6 +431,10 @@ void GameEventMgr::LoadFromDB()
sLog.outString( ">> Loaded %u creatures in game events", count );
}
+ // Gameobjects
+
+ sLog.outString("Loading Game Event GO Data...");
+
mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1);
// 1 2
result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.event "
@@ -467,6 +481,10 @@ void GameEventMgr::LoadFromDB()
sLog.outString( ">> Loaded %u gameobjects in game events", count );
}
+ // Model/Equipment Changes
+
+ sLog.outString("Loading Game Event Model/Equipment Change Data...");
+
mGameEventModelEquip.resize(mGameEvent.size());
// 0 1 2
result = WorldDatabase.Query("SELECT creature.guid, game_event_model_equip.event, game_event_model_equip.modelid,"
@@ -527,6 +545,10 @@ void GameEventMgr::LoadFromDB()
sLog.outString( ">> Loaded %u model/equipment changes in game events", count );
}
+ // Quests
+
+ sLog.outString("Loading Game Event Quest Data...");
+
mGameEventCreatureQuests.resize(mGameEvent.size());
// 0 1 2
result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_creature_quest");
@@ -570,6 +592,10 @@ void GameEventMgr::LoadFromDB()
delete result;
}
+ // GO Quests
+
+ sLog.outString("Loading Game Event GO Quest Data...");
+
mGameEventGameObjectQuests.resize(mGameEvent.size());
// 0 1 2
result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_gameobject_quest");
@@ -615,6 +641,8 @@ void GameEventMgr::LoadFromDB()
// Load quest to (event,condition) mapping
// 0 1 2 3
+
+ sLog.outString("Loading Game Event Quest Condition Data...");
result = WorldDatabase.Query("SELECT quest, event_id, condition_id, num FROM game_event_quest_condition");
count = 0;
@@ -659,7 +687,10 @@ void GameEventMgr::LoadFromDB()
}
// load conditions of the events
- // 0 1 2 3 4
+ // 0 1 2 3 4
+
+ sLog.outString("Loading Game Event Condition Data...");
+
result = WorldDatabase.Query("SELECT event_id, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition");
count = 0;
@@ -704,7 +735,10 @@ void GameEventMgr::LoadFromDB()
}
// load condition saves
- // 0 1 2
+
+ sLog.outString("Loading Game Event Condition Save Data...");
+
+ // 0 1 2
result = CharacterDatabase.Query("SELECT event_id, condition_id, done FROM game_event_condition_save");
count = 0;
@@ -756,6 +790,9 @@ void GameEventMgr::LoadFromDB()
mGameEventNPCFlags.resize(mGameEvent.size());
// load game event npcflag
+
+ sLog.outString("Loading Game Event NPCflag Data...");
+
// 0 1 2
result = WorldDatabase.Query("SELECT guid, event_id, npcflag FROM game_event_npcflag");
@@ -798,7 +835,11 @@ void GameEventMgr::LoadFromDB()
delete result;
}
+ // Vendor
mGameEventVendors.resize(mGameEvent.size());
+
+ sLog.outString("Loading Game Event Vendor Additions Data...");
+
// 0 1 2 3 4 5
result = WorldDatabase.Query("SELECT event, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor");
@@ -866,6 +907,9 @@ void GameEventMgr::LoadFromDB()
}
// load game event npc gossip ids
+
+ sLog.outString("Loading Game Event NPC Gossip Data...");
+
// 0 1 2
result = WorldDatabase.Query("SELECT guid, event_id, textid FROM game_event_npc_gossip");
@@ -911,6 +955,9 @@ void GameEventMgr::LoadFromDB()
// set all flags to 0
mGameEventBattleGroundHolidays.resize(mGameEvent.size(),0);
// load game event battleground flags
+
+ sLog.outString("Loading Game Event Battleground Data...");
+
// 0 1
result = WorldDatabase.Query("SELECT event, bgflag FROM game_event_battleground_holiday");
@@ -957,6 +1004,9 @@ void GameEventMgr::LoadFromDB()
////////////////////////
mGameEventPoolIds.resize(mGameEvent.size()*2-1);
+
+ sLog.outString("Loading Game Event Pool Data...");
+
// 1 2
result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.event "
"FROM pool_template JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry");
diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp
index eadc20c4acc..dbb4414949f 100644
--- a/src/game/InstanceSaveMgr.cpp
+++ b/src/game/InstanceSaveMgr.cpp
@@ -282,7 +282,7 @@ void InstanceSaveManager::CleanupInstances()
// first, obtain total instance set
std::set<uint32> InstanceSet;
QueryResult *result = CharacterDatabase.Query("SELECT id FROM instance");
- if( result )
+ if (result)
{
do
{
@@ -295,12 +295,12 @@ void InstanceSaveManager::CleanupInstances()
// creature_respawn
result = WorldDatabase.Query("SELECT DISTINCT(instance) FROM creature_respawn WHERE instance <> 0");
- if( result )
+ if (result)
{
do
{
Field *fields = result->Fetch();
- if(InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
+ if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
WorldDatabase.DirectPExecute("DELETE FROM creature_respawn WHERE instance = '%u'", fields[0].GetUInt32());
}
while (result->NextRow());
@@ -309,12 +309,12 @@ void InstanceSaveManager::CleanupInstances()
// gameobject_respawn
result = WorldDatabase.Query("SELECT DISTINCT(instance) FROM gameobject_respawn WHERE instance <> 0");
- if( result )
+ if (result)
{
do
{
Field *fields = result->Fetch();
- if(InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
+ if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
WorldDatabase.DirectPExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'", fields[0].GetUInt32());
}
while (result->NextRow());
@@ -323,12 +323,12 @@ void InstanceSaveManager::CleanupInstances()
// characters
result = CharacterDatabase.Query("SELECT DISTINCT(instance_id) FROM characters WHERE instance_id <> 0");
- if( result )
+ if (result)
{
do
{
Field *fields = result->Fetch();
- if(InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
+ if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
CharacterDatabase.PExecute("UPDATE characters SET instance_id = '0' WHERE instance_id = '%u'", fields[0].GetUInt32());
}
while (result->NextRow());
@@ -337,12 +337,12 @@ void InstanceSaveManager::CleanupInstances()
// corpse
result = CharacterDatabase.Query("SELECT DISTINCT(instance) FROM corpse WHERE instance <> 0");
- if( result )
+ if (result)
{
do
{
Field *fields = result->Fetch();
- if(InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
+ if (InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
CharacterDatabase.PExecute("UPDATE corpse SET instance = '0' WHERE instance = '%u'", fields[0].GetUInt32());
}
while (result->NextRow());
@@ -366,7 +366,7 @@ void InstanceSaveManager::PackInstances()
// any associations to ids not in this table are assumed to be
// cleaned already in CleanupInstances
QueryResult *result = CharacterDatabase.Query("SELECT id FROM instance");
- if( result )
+ if (result)
{
do
{
@@ -377,7 +377,7 @@ void InstanceSaveManager::PackInstances()
delete result;
}
- barGoLink bar( InstanceSet.size() + 1);
+ barGoLink bar(InstanceSet.size() + 1);
bar.step();
uint32 InstanceNumber = 1;
@@ -400,8 +400,8 @@ void InstanceSaveManager::PackInstances()
bar.step();
}
- sLog.outString( ">> Instance numbers remapped, next instance id is %u", InstanceNumber );
sLog.outString();
+ sLog.outString( ">> Instance numbers remapped, next instance id is %u", InstanceNumber );
}
void InstanceSaveManager::LoadResetTimes()
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 887cd9b3467..4197f52c689 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -898,6 +898,7 @@ void ObjectMgr::LoadCreatureAddons()
if(!sCreatureStorage.LookupEntry<CreatureInfo>(addon->guidOrEntry))
sLog.outErrorDb("Creature (Entry: %u) does not exist but has a record in `%s`",addon->guidOrEntry, sCreatureInfoAddonStorage.GetTableName());
+ sLog.outString( "Loading Creature Addon Data..." );
LoadCreatureAddons(sCreatureDataAddonStorage,"GUID","creature addons");
// check entry ids
@@ -1690,7 +1691,7 @@ void ObjectMgr::LoadCreatureRespawnTimes()
QueryResult *result = WorldDatabase.Query("SELECT guid,respawntime,instance FROM creature_respawn");
- if(!result)
+ if (!result)
{
barGoLink bar(1);
@@ -1719,8 +1720,8 @@ void ObjectMgr::LoadCreatureRespawnTimes()
delete result;
- sLog.outString( ">> Loaded %lu creature respawn times", (unsigned long)mCreatureRespawnTimes.size() );
sLog.outString();
+ sLog.outString( ">> Loaded %lu creature respawn times", (unsigned long)mCreatureRespawnTimes.size() );
}
void ObjectMgr::LoadGameobjectRespawnTimes()
@@ -2636,6 +2637,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Load playercreate items
+ sLog.outString("Loading Player Create Items Data...");
{
// 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT race, class, itemid, amount FROM playercreateinfo_item");
@@ -2706,6 +2708,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Load playercreate spells
+ sLog.outString("Loading Player Create Spell Data...");
{
QueryResult *result = NULL;
@@ -2772,6 +2775,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Load playercreate actions
+ sLog.outString("Loading Player Create Action Data...");
{
// 0 1 2 3 4
QueryResult *result = WorldDatabase.Query("SELECT race, class, button, action, type FROM playercreateinfo_action");
@@ -2824,6 +2828,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Loading levels data (class only dependent)
+ sLog.outString("Loading Player Create Level HP/Mana Data...");
{
// 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT class, level, basehp, basemana FROM player_classlevelstats");
@@ -2915,6 +2920,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Loading levels data (class/race dependent)
+ sLog.outString("Loading Player Create Level Stats Data...");
{
// 0 1 2 3 4 5 6 7
QueryResult *result = WorldDatabase.Query("SELECT race, class, level, str, agi, sta, inte, spi FROM player_levelstats");
@@ -3034,6 +3040,7 @@ void ObjectMgr::LoadPlayerInfo()
}
// Loading xp per level data
+ sLog.outString("Loading Player Create XP Data...");
{
mPlayerXPperLevel.resize(sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
for (uint8 level = 0; level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL); ++level)
@@ -4722,10 +4729,10 @@ void ObjectMgr::LoadPageTexts()
{
// check data correctness
PageText const* page = sPageTextStore.LookupEntry<PageText>(i);
- if(!page)
+ if (!page)
continue;
- if(page->Next_Page && !sPageTextStore.LookupEntry<PageText>(page->Next_Page))
+ if (page->Next_Page && !sPageTextStore.LookupEntry<PageText>(page->Next_Page))
{
sLog.outErrorDb("Page text (Id: %u) has not existing next page (Id:%u)", i,page->Next_Page);
continue;
@@ -4735,13 +4742,13 @@ void ObjectMgr::LoadPageTexts()
std::set<uint32> checkedPages;
for (PageText const* pageItr = page; pageItr; pageItr = sPageTextStore.LookupEntry<PageText>(pageItr->Next_Page))
{
- if(!pageItr->Next_Page)
+ if (!pageItr->Next_Page)
break;
checkedPages.insert(pageItr->Page_ID);
- if(checkedPages.find(pageItr->Next_Page)!=checkedPages.end())
+ if (checkedPages.find(pageItr->Next_Page)!= checkedPages.end())
{
std::ostringstream ss;
- ss<< "The text page(s) ";
+ ss << "The text page(s) ";
for (std::set<uint32>::iterator itr= checkedPages.begin(); itr!=checkedPages.end(); ++itr)
ss << *itr << " ";
ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page "
@@ -6952,7 +6959,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map,char const* table)
QueryResult *result = WorldDatabase.PQuery("SELECT id,quest FROM %s",table);
- if(!result)
+ if (!result)
{
barGoLink bar(1);
@@ -8576,16 +8583,16 @@ void ObjectMgr::LoadScriptNames()
"UNION "
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
- if( !result )
+ if (!result)
{
- barGoLink bar( 1 );
+ barGoLink bar(1);
bar.step();
sLog.outString();
sLog.outErrorDb(">> Loaded empty set of Script Names!");
return;
}
- barGoLink bar( result->GetRowCount() );
+ barGoLink bar(result->GetRowCount());
//OnEvent Changes
m_scriptNames.push_back("scripted_on_events");
@@ -8761,7 +8768,10 @@ void ObjectMgr::LoadGMTickets()
if(!result)
{
- sLog.outString(" \n>> GM Tickets table is empty, no tickets were loaded.\n" );
+ barGoLink bar(1);
+ bar.step();
+ sLog.outString();
+ sLog.outString(">> GM Tickets table is empty, no tickets were loaded." );
return;
}
@@ -8804,7 +8814,7 @@ void ObjectMgr::LoadGMTickets()
}
delete result;
- sLog.outString(">>> %u GM Tickets loaded from the database.", count);
+ sLog.outString(">> Loaded %u GM Tickets from the database.", count);
}
void ObjectMgr::AddOrUpdateGMTicket(GM_Ticket &ticket, bool create)
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 62a896cd5f2..98c818838e5 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -548,9 +548,13 @@ class ObjectMgr
void LoadQuests();
void LoadQuestRelations()
{
+ sLog.outString("Loading GO Start Quest Data...");
LoadGameobjectQuestRelations();
+ sLog.outString("Loading GO End Quest Data...");
LoadGameobjectInvolvedRelations();
+ sLog.outString("Loading Creature Start Quest Data...");
LoadCreatureQuestRelations();
+ sLog.outString("Loading Creature End Quest Data...");
LoadCreatureInvolvedRelations();
}
void LoadGameobjectQuestRelations();
diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp
index da2f432fa40..c2cb8045b81 100644
--- a/src/game/PoolHandler.cpp
+++ b/src/game/PoolHandler.cpp
@@ -392,12 +392,16 @@ void PoolHandler::LoadFromDB()
} while (result->NextRow());
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u objects pools", count );
- delete result;
// Creatures
+ sLog.outString();
+ sLog.outString( "Loading Creatures Pooling Data..." );
+
mPoolCreatureGroups.resize(max_pool_id + 1);
mCreatureSearchMap.clear();
// 1 2 3
@@ -459,6 +463,8 @@ void PoolHandler::LoadFromDB()
// Gameobjects
+ sLog.outString( "Loading Gameobject Pooling Data..." );
+
mPoolGameobjectGroups.resize(max_pool_id + 1);
mGameobjectSearchMap.clear();
// 1 2 3
@@ -528,12 +534,15 @@ void PoolHandler::LoadFromDB()
}
// Pool of pools
+
+ sLog.outString( "Loading Mother Pooling Data..." );
+
mPoolPoolGroups.resize(max_pool_id + 1);
- // 1 2 3
+ // 1 2 3
result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool");
count = 0;
- if( !result )
+ if (!result)
{
barGoLink bar2(1);
bar2.step();
@@ -610,9 +619,10 @@ void PoolHandler::LoadFromDB()
}
}
}
+ delete result;
+
sLog.outString();
sLog.outString( ">> Loaded %u pools in mother pools", count );
- delete result;
}
}
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index b2c0abbdd82..a6935cf9077 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1329,7 +1329,7 @@ void SpellMgr::LoadSpellProcEvents()
sLog.outString();
if (customProc)
- sLog.outString( ">> Loaded %u extra spell proc event conditions +%u custom", count, customProc );
+ sLog.outString( ">> Loaded %u extra spell proc event conditions + %u custom", count, customProc );
else
sLog.outString( ">> Loaded %u extra spell proc event conditions", count );
}
@@ -1567,10 +1567,10 @@ void SpellMgr::LoadSpellThreats()
// 0 1
QueryResult *result = WorldDatabase.Query("SELECT entry, Threat FROM spell_threat");
- if( !result )
+ if (!result)
{
- barGoLink bar( 1 );
+ barGoLink bar(1);
bar.step();
@@ -1579,7 +1579,7 @@ void SpellMgr::LoadSpellThreats()
return;
}
- barGoLink bar( result->GetRowCount() );
+ barGoLink bar(result->GetRowCount());
do
{
@@ -1599,7 +1599,7 @@ void SpellMgr::LoadSpellThreats()
mSpellThreatMap[entry] = Threat;
++count;
- } while( result->NextRow() );
+ } while (result->NextRow());
delete result;
@@ -1765,7 +1765,7 @@ void SpellMgr::LoadSpellLearnSkills()
// search auto-learned skills and add its to map also for use in unlearn spells/talents
uint32 dbc_count = 0;
- barGoLink bar( sSpellStore.GetNumRows() );
+ barGoLink bar(sSpellStore.GetNumRows());
for (uint32 spell = 0; spell < sSpellStore.GetNumRows(); ++spell)
{
bar.step();
@@ -1774,13 +1774,13 @@ void SpellMgr::LoadSpellLearnSkills()
if(!entry)
continue;
- for (int i = 0; i < 3; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if(entry->Effect[i]==SPELL_EFFECT_SKILL)
{
SpellLearnSkillNode dbc_node;
- dbc_node.skill = entry->EffectMiscValue[i];
- if ( dbc_node.skill != SKILL_RIDING )
+ dbc_node.skill = entry->EffectMiscValue[i];
+ if (dbc_node.skill != SKILL_RIDING)
dbc_node.value = 1;
else
dbc_node.value = entry->CalculateSimpleValue(i)*75;
@@ -1803,11 +1803,11 @@ void SpellMgr::LoadSpellLearnSpells()
{
mSpellLearnSpells.clear(); // need for reload case
- // 0 1 2
+ // 0 1 2
QueryResult *result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
- if(!result)
+ if (!result)
{
- barGoLink bar( 1 );
+ barGoLink bar(1);
bar.step();
sLog.outString();
@@ -1818,41 +1818,41 @@ void SpellMgr::LoadSpellLearnSpells()
uint32 count = 0;
- barGoLink bar( result->GetRowCount() );
+ barGoLink bar(result->GetRowCount());
do
{
bar.step();
Field *fields = result->Fetch();
- uint32 spell_id = fields[0].GetUInt32();
+ uint32 spell_id = fields[0].GetUInt32();
SpellLearnSpellNode node;
node.spell = fields[1].GetUInt32();
node.active = fields[2].GetBool();
node.autoLearned= false;
- if(!sSpellStore.LookupEntry(spell_id))
+ if (!sSpellStore.LookupEntry(spell_id))
{
- sLog.outErrorDb("Spell %u listed in `spell_learn_spell` does not exist",spell_id);
+ sLog.outErrorDb("Spell %u listed in `spell_learn_spell` does not exist", spell_id);
continue;
}
- if(!sSpellStore.LookupEntry(node.spell))
+ if (!sSpellStore.LookupEntry(node.spell))
{
- sLog.outErrorDb("Spell %u listed in `spell_learn_spell` learning not existed spell %u",spell_id,node.spell);
+ sLog.outErrorDb("Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
continue;
}
- if(GetTalentSpellCost(node.spell))
+ if (GetTalentSpellCost(node.spell))
{
- sLog.outErrorDb("Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped",spell_id,node.spell);
+ sLog.outErrorDb("Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
continue;
}
mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id,node));
++count;
- } while( result->NextRow() );
+ } while (result->NextRow());
delete result;
@@ -1862,19 +1862,19 @@ void SpellMgr::LoadSpellLearnSpells()
{
SpellEntry const* entry = sSpellStore.LookupEntry(spell);
- if(!entry)
+ if (!entry)
continue;
- for (int i = 0; i < 3; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if(entry->Effect[i]==SPELL_EFFECT_LEARN_SPELL)
{
SpellLearnSpellNode dbc_node;
- dbc_node.spell = entry->EffectTriggerSpell[i];
- dbc_node.active = true; // all dbc based learned spells is active (show in spell book or hide by client itself)
+ dbc_node.spell = entry->EffectTriggerSpell[i];
+ dbc_node.active = true; // all dbc based learned spells is active (show in spell book or hide by client itself)
// ignore learning not existed spells (broken/outdated/or generic learnig spell 483
- if(!sSpellStore.LookupEntry(dbc_node.spell))
+ if (!sSpellStore.LookupEntry(dbc_node.spell))
continue;
// talent or passive spells or skill-step spells auto-casted and not need dependent learning,
@@ -1887,7 +1887,7 @@ void SpellMgr::LoadSpellLearnSpells()
bool found = false;
for (SpellLearnSpellMap::const_iterator itr = db_node_bounds.first; itr != db_node_bounds.second; ++itr)
{
- if(itr->second.spell == dbc_node.spell)
+ if (itr->second.spell == dbc_node.spell)
{
sLog.outErrorDb("Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
spell,dbc_node.spell);
@@ -1896,7 +1896,7 @@ void SpellMgr::LoadSpellLearnSpells()
}
}
- if(!found) // add new spell-spell pair if not found
+ if (!found) // add new spell-spell pair if not found
{
mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell,dbc_node));
++dbc_count;
@@ -2027,7 +2027,7 @@ void SpellMgr::LoadSpellScriptTarget()
continue;
bool found = false;
- for (uint8 j = 0; j < 3; ++j)
+ for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
switch (spellInfo->EffectImplicitTargetA[j])
{
@@ -2041,6 +2041,7 @@ void SpellMgr::LoadSpellScriptTarget()
}
if (found)
break;
+
switch (spellInfo->EffectImplicitTargetB[j])
{
case TARGET_UNIT_AREA_ENTRY_SRC:
@@ -2051,14 +2052,15 @@ void SpellMgr::LoadSpellScriptTarget()
found = true;
break;
}
+
if (found)
break;
}
if (found)
{
SpellScriptTargetBounds bounds = spellmgr.GetSpellScriptTargetBounds(i);
-// if (bounds.first == bounds.second)
-// sLog.outDebug("Spell (ID: %u) does not have record in `spell_script_target`", i);
+ //if (bounds.first == bounds.second)
+ //sLog.outDebug("Spell (ID: %u) does not have record in `spell_script_target`", i);
}
}
@@ -2072,11 +2074,10 @@ void SpellMgr::LoadSpellPetAuras()
uint32 count = 0;
- // 0 1 2 3
+ // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
if (!result)
{
-
barGoLink bar(1);
bar.step();
@@ -2145,10 +2146,14 @@ void SpellMgr::LoadPetLevelupSpellMap()
uint32 count = 0;
uint32 family_count = 0;
+ barGoLink bar(sCreatureFamilyStore.GetNumRows());
+
for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
{
+ bar.step();
+
CreatureFamilyEntry const *creatureFamily = sCreatureFamilyStore.LookupEntry(i);
- if(!creatureFamily) // not exist
+ if (!creatureFamily) // not exist
continue;
for (uint8 j = 0; j < 2; ++j)
@@ -2166,7 +2171,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
// (!creatureFamily->skillLine[1] || skillLine->skillId!=creatureFamily->skillLine[1]))
// continue;
- if (skillLine->skillId!=creatureFamily->skillLine[j])
+ if (skillLine->skillId != creatureFamily->skillLine[j])
continue;
if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL)
@@ -2248,8 +2253,12 @@ void SpellMgr::LoadPetDefaultSpells()
uint32 countCreature = 0;
uint32 countData = 0;
+ barGoLink bar(sCreatureStorage.MaxEntry + sSpellStore.GetNumRows());
+
for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
{
+ bar.step();
+
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i);
if (!cInfo)
continue;
@@ -2277,11 +2286,13 @@ void SpellMgr::LoadPetDefaultSpells()
// different summon spells
for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i)
{
+ bar.step();
+
SpellEntry const* spellEntry = sSpellStore.LookupEntry(i);
if (!spellEntry)
continue;
- for (uint8 k = 0; k < 3; ++k)
+ for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
{
if (spellEntry->Effect[k] == SPELL_EFFECT_SUMMON || spellEntry->Effect[k] == SPELL_EFFECT_SUMMON_PET)
{
@@ -2313,7 +2324,8 @@ void SpellMgr::LoadPetDefaultSpells()
}
sLog.outString();
- sLog.outString( ">> Loaded addition spells for %u pet spell data entries and %u summonable creature templates", countData, countCreature );
+ sLog.outString( ">> Loaded addition spells for %u pet spell data entries.", countData );
+ sLog.outString( ">> Loaded %u summonable creature templates.", countCreature );
}
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
@@ -2402,7 +2414,7 @@ void SpellMgr::LoadSpellAreas()
uint32 count = 0;
- // 0 1 2 3 4 5 6 7 8
+ // 0 1 2 3 4 5 6 7 8
QueryResult *result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
if (!result)
@@ -2436,7 +2448,7 @@ void SpellMgr::LoadSpellAreas()
spellArea.gender = Gender(fields[7].GetUInt8());
spellArea.autocast = fields[8].GetBool();
- if(const SpellEntry* spellInfo = sSpellStore.LookupEntry(spell))
+ if (const SpellEntry* spellInfo = sSpellStore.LookupEntry(spell))
{
if(spellArea.autocast)
const_cast<SpellEntry*>(spellInfo)->Attributes |= SPELL_ATTR_CANT_CANCEL;
@@ -3180,12 +3192,11 @@ void SpellMgr::LoadSpellEnchantProcData()
uint32 count = 0;
- // 0 1 2 3
+ // 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
- if( !result )
+ if (!result)
{
-
- barGoLink bar( 1 );
+ barGoLink bar(1);
bar.step();
@@ -3194,7 +3205,7 @@ void SpellMgr::LoadSpellEnchantProcData()
return;
}
- barGoLink bar( result->GetRowCount() );
+ barGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
@@ -3223,6 +3234,7 @@ void SpellMgr::LoadSpellEnchantProcData()
delete result;
+ sLog.outString();
sLog.outString( ">> Loaded %u enchant proc data definitions", count);
}
@@ -3233,7 +3245,7 @@ void SpellMgr::LoadSpellRequired()
QueryResult *result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required");
- if(result == NULL)
+ if (!result)
{
barGoLink bar(1);
bar.step();
@@ -3251,13 +3263,14 @@ void SpellMgr::LoadSpellRequired()
bar.step();
Field *fields = result->Fetch();
- uint32 spell_id = fields[0].GetUInt32();
+ uint32 spell_id = fields[0].GetUInt32();
uint32 spell_req = fields[1].GetUInt32();
mSpellsReqSpell.insert (std::pair<uint32, uint32>(spell_req, spell_id));
mSpellReq[spell_id] = spell_req;
++rows;
} while (result->NextRow());
+
delete result;
sLog.outString();
@@ -3567,24 +3580,32 @@ void SpellMgr::LoadSpellCustomAttr()
{
mSpellCustomAttr.resize(GetSpellStore()->GetNumRows());
+ barGoLink bar(GetSpellStore()->GetNumRows());
+
+ uint32 count = 0;
+
SpellEntry *spellInfo;
for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
+ bar.step();
+
mSpellCustomAttr[i] = 0;
spellInfo = (SpellEntry*)GetSpellStore()->LookupEntry(i);
if (!spellInfo)
continue;
- for (uint32 j = 0; j < 3; ++j)
+ for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
switch (spellInfo->EffectApplyAuraName[j])
{
case SPELL_AURA_MOD_ROOT:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC;
mSpellCustomAttr[i] |= SPELL_ATTR_CU_MOVEMENT_IMPAIR;
+ count++;
break;
case SPELL_AURA_MOD_DECREASE_SPEED:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_MOVEMENT_IMPAIR;
+ count++;
break;
default:
break;
@@ -3599,6 +3620,7 @@ void SpellMgr::LoadSpellCustomAttr()
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
case SPELL_EFFECT_HEAL:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_DIRECT_DAMAGE;
+ count++;
break;
case SPELL_EFFECT_CHARGE:
case SPELL_EFFECT_JUMP:
@@ -3607,11 +3629,13 @@ void SpellMgr::LoadSpellCustomAttr()
if(!spellInfo->speed && !spellInfo->SpellFamilyName)
spellInfo->speed = SPEED_CHARGE;
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CHARGE;
+ count++;
break;
case SPELL_EFFECT_TRIGGER_SPELL:
if (IsPositionTarget(spellInfo->EffectImplicitTargetA[j]) ||
spellInfo->Targets & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION))
spellInfo->Effect[j] = SPELL_EFFECT_TRIGGER_MISSILE;
+ count++;
break;
}
@@ -3620,6 +3644,7 @@ void SpellMgr::LoadSpellCustomAttr()
case TARGET_TYPE_UNIT_TARGET:
case TARGET_TYPE_DEST_TARGET:
spellInfo->Targets |= TARGET_FLAG_UNIT;
+ count++;
break;
//case TARGET_TYPE_AREA_DST:
//case TARGET_TYPE_DEST_DEST:
@@ -3628,7 +3653,7 @@ void SpellMgr::LoadSpellCustomAttr()
}
}
- for (uint32 j = 0; j < 3; ++j)
+ for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
switch (spellInfo->EffectApplyAuraName[j])
{
@@ -3640,32 +3665,50 @@ void SpellMgr::LoadSpellCustomAttr()
case SPELL_AURA_MOD_STUN:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC;
mSpellCustomAttr[i] &= ~SPELL_ATTR_CU_MOVEMENT_IMPAIR;
+ count++;
break;
}
}
if (!_isPositiveEffect(i, 0, false))
+ {
mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF0;
+ count++;
+ }
if (!_isPositiveEffect(i, 1, false))
+ {
mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF1;
+ count++;
+ }
if (!_isPositiveEffect(i, 2, false))
+ {
mSpellCustomAttr[i] |= SPELL_ATTR_CU_NEGATIVE_EFF2;
+ count++;
+ }
if (spellInfo->SpellVisual[0] == 3879)
+ {
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK;
+ count++;
+ }
if (spellInfo->activeIconID == 2158) // flight
+ {
spellInfo->Attributes |= SPELL_ATTR_PASSIVE;
+ count++;
+ }
switch(i)
{
// Heroism
case 32182:
spellInfo->excludeCasterAuraSpell = 57723; // Exhaustion
+ count++;
break;
// Bloodlust
case 2825:
spellInfo->excludeCasterAuraSpell = 57724; // Sated
+ count++;
break;
// Heart of the Crusader
case 20335:
@@ -3673,16 +3716,19 @@ void SpellMgr::LoadSpellCustomAttr()
case 20337:
// Entries were not updated after spell effect change, we have to do that manually :/
spellInfo->AttributesEx3 |= SPELL_ATTR_EX3_CAN_PROC_TRIGGERED;
+ count++;
break;
case 16007: // Draco-Incarcinatrix 900
// was 46, but effect is aura effect
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_NEARBY_ENTRY;
spellInfo->EffectImplicitTargetB[0] = TARGET_DST_NEARBY_ENTRY;
+ count++;
break;
case 26029: // dark glare
case 37433: // spout
case 43140: case 43215: // flame breath
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_LINE;
+ count++;
break;
case 24340: case 26558: case 28884: // Meteor
case 36837: case 38903: case 41276: // Meteor
@@ -3696,16 +3742,19 @@ void SpellMgr::LoadSpellCustomAttr()
case 64422: case 64688: // Sonic Screech
// ONLY SPELLS WITH SPELLFAMILY_GENERIC and EFFECT_SCHOOL_DAMAGE
mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE;
+ count++;
break;
case 59725: // Improved Spell Reflection - aoe aura
// Target entry seems to be wrong for this spell :/
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_PARTY_CASTER;
spellInfo->EffectRadiusIndex[0] = 45;
+ count++;
break;
case 27820: // Mana Detonation
//case 28062: case 39090: // Positive/Negative Charge
//case 28085: case 39093:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF;
+ count++;
break;
case 44978: case 45001: case 45002: // Wild Magic
case 45004: case 45006: case 45010: // Wild Magic
@@ -3718,12 +3767,14 @@ void SpellMgr::LoadSpellCustomAttr()
case 41071: // Raise Dead (HACK)
case 52124: // Sky Darkener Assault
spellInfo->MaxAffectedTargets = 1;
+ count++;
break;
case 52479: // Gift of the Harvester
spellInfo->MaxAffectedTargets = 1;
// a trap always has dst = src?
spellInfo->EffectImplicitTargetA[0] = TARGET_DST_CASTER;
spellInfo->EffectImplicitTargetA[1] = TARGET_DST_CASTER;
+ count++;
break;
case 41376: // Spite
case 39992: // Needle Spine
@@ -3737,10 +3788,12 @@ void SpellMgr::LoadSpellCustomAttr()
case 29213: // Curse of the Plaguebringer - Noth
case 28542: // Life Drain - Sapphiron
spellInfo->MaxAffectedTargets = 3;
+ count++;
break;
case 38310: // Multi-Shot
case 53385: // Divine Storm (Damage)
spellInfo->MaxAffectedTargets = 4;
+ count++;
break;
case 42005: // Bloodboil
case 38296: // Spitfire Totem
@@ -3750,6 +3803,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 55665: // Life Drain - Sapphiron (H)
case 28796: // Poison Bolt Volly - Faerlina
spellInfo->MaxAffectedTargets = 5;
+ count++;
break;
case 40827: // Sinful Beam
case 40859: // Sinister Beam
@@ -3758,10 +3812,12 @@ void SpellMgr::LoadSpellCustomAttr()
case 54835: // Curse of the Plaguebringer - Noth (H)
case 54098: // Poison Bolt Volly - Faerlina (H)
spellInfo->MaxAffectedTargets = 10;
+ count++;
break;
case 38794: case 33711: //Murmur's Touch
spellInfo->MaxAffectedTargets = 1;
spellInfo->EffectTriggerSpell[0] = 33760;
+ count++;
break;
case 17941: // Shadow Trance
case 22008: // Netherwind Focus
@@ -3776,55 +3832,70 @@ void SpellMgr::LoadSpellCustomAttr()
case 52437: // Sudden Death
case 64823: // Item - Druid T8 Balance 4P Bonus
spellInfo->procCharges = 1;
+ count++;
break;
case SPELL_TIDAL_WAVES_51566: // Tidal Wave
spellInfo->procCharges = 2;
+ count++;
break;
case 44544: // Fingers of Frost
spellInfo->procCharges = 2;
spellInfo->EffectSpellClassMask[0] = flag96(685904631,1151048,0);
+ count++;
break;
case 28200: // Ascendance (Talisman of Ascendance trinket)
spellInfo->procCharges = 6;
+ count++;
break;
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
spellInfo->EffectMiscValue[0] |= 1;
+ count++;
break;
case 52025: // Cleansing Totem Effect
spellInfo->EffectDieSides[1] = 1;
+ count++;
break;
case 51904: // Summon Ghouls On Scarlet Crusade (core does not know the triggered spell is summon spell)
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER;
+ count++;
break;
case 29809: // Desecration Arm - 36 instead of 37 - typo? :/
spellInfo->EffectRadiusIndex[0] = 37;
+ count++;
break;
// Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data
// To prevent aura staying on target after talent unlearned
case 48420:
spellInfo->Stances = 1 << (FORM_CAT - 1);
+ count++;
break;
case 48421:
spellInfo->Stances = 1 << (FORM_MOONKIN - 1);
+ count++;
break;
case 48422:
spellInfo->Stances = 1 << (FORM_TREE - 1);
+ count++;
break;
case 30421: // Nether Portal - Perseverence
spellInfo->EffectBasePoints[2] += 30000;
+ count++;
break;
// some dummy spell only has dest, should push caster in this case
case 62324: // Throw Passenger
spellInfo->Targets |= TARGET_FLAG_CASTER;
+ count++;
break;
case 51735: // Ebon Plague
case 51734:
case 51726:
spellInfo->SpellFamilyFlags[2] = 0x10;
+ count++;
break;
// cleansing totem pulse when it is spawned
case 8172:
spellInfo->AttributesEx5 |= SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY;
+ count++;
break;
default:
break;
@@ -3834,9 +3905,11 @@ void SpellMgr::LoadSpellCustomAttr()
{
case SPELLFAMILY_WARRIOR:
// Shout
- if(spellInfo->SpellFamilyFlags[0] & 0x20000
- || spellInfo->SpellFamilyFlags[1] & 0x20)
+ if(spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20)
mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC;
+ else
+ break;
+ count++;
break;
case SPELLFAMILY_DRUID:
// Starfall Target Selection
@@ -3848,11 +3921,17 @@ void SpellMgr::LoadSpellCustomAttr()
// Roar
else if(spellInfo->SpellFamilyFlags[0] & 0x8)
mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC;
+ else
+ break;
+ count++;
break;
// Do not allow Deadly throw and Slice and Dice to proc twice
case SPELLFAMILY_ROGUE:
if(spellInfo->SpellFamilyFlags[1] & 0x1 || spellInfo->SpellFamilyFlags[0] & 0x40000)
spellInfo->AttributesEx4 |= SPELL_ATTR_EX4_CANT_PROC_FROM_SELFCAST;
+ else
+ break;
+ count++;
break;
}
}
@@ -3863,6 +3942,9 @@ void SpellMgr::LoadSpellCustomAttr()
properties->Type = SUMMON_TYPE_TOTEM;
CreatureAI::FillAISpellInfo();
+
+ sLog.outString();
+ sLog.outString(">> Loaded %u custom spell attributes", count );
}
// Fill custom data about enchancments
@@ -3871,11 +3953,17 @@ void SpellMgr::LoadEnchantCustomAttr()
uint32 size = sSpellItemEnchantmentStore.GetNumRows();
mEnchantCustomAttr.resize(size);
- for (uint32 i = 0; i<size; ++i)
+ barGoLink bar(GetSpellStore()->GetNumRows());
+
+ uint32 count = 0;
+
+ for (uint32 i = 0; i < size; ++i)
mEnchantCustomAttr[i] = 0;
for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
+ bar.step();
+
SpellEntry * spellInfo = (SpellEntry*)GetSpellStore()->LookupEntry(i);
if(!spellInfo)
continue;
@@ -3884,7 +3972,7 @@ void SpellMgr::LoadEnchantCustomAttr()
if (!(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_UNK13) || !(spellInfo->Attributes & SPELL_ATTR_NOT_SHAPESHIFT))
continue;
- for (uint32 j = 0; j < 3; ++j)
+ for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
if(spellInfo->Effect[j] == SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY)
{
@@ -3893,10 +3981,14 @@ void SpellMgr::LoadEnchantCustomAttr()
if (!enchId)
continue;
mEnchantCustomAttr[enchId] = true;
+ count++;
break;
}
}
}
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u custom enchant attributes", count );
}
bool SpellMgr::IsSkillTypeSpell(uint32 spellId, SkillType type) const
@@ -3917,9 +4009,9 @@ void SpellMgr::LoadSpellLinked()
// 0 1 2
QueryResult *result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
- if( !result )
+ if (!result)
{
- barGoLink bar( 1 );
+ barGoLink bar(1);
bar.step();
sLog.outString();
sLog.outString( ">> Loaded %u linked spells", count );
@@ -3935,8 +4027,8 @@ void SpellMgr::LoadSpellLinked()
bar.step();
int32 trigger = fields[0].GetInt32();
- int32 effect = fields[1].GetInt32();
- int32 type = fields[2].GetInt32();
+ int32 effect = fields[1].GetInt32();
+ int32 type = fields[2].GetInt32();
SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(trigger));
if (!spellInfo)
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index e7079321206..11ab6a70f18 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -35,7 +35,7 @@ void WaypointStore::Free()
void WaypointStore::Load()
{
QueryResult *result = WorldDatabase.PQuery("SELECT COUNT(id) FROM waypoint_data");
- if(!result)
+ if (!result)
{
sLog.outError("an error occured while loading the table `waypoint_data` (maybe it doesn't exist ?)");
exit(1); // Stop server at loading non exited table or not accessable table
@@ -54,7 +54,8 @@ void WaypointStore::Load()
WaypointPath* path_data;
uint32 total_records = result->GetRowCount();
- barGoLink bar( total_records);
+ barGoLink bar(total_records);
+ uint32 count = 0;
Field *fields;
uint32 last_id = 0;
@@ -63,6 +64,7 @@ void WaypointStore::Load()
fields = result->Fetch();
uint32 id = fields[0].GetUInt32();
bar.step();
+ count++;
WaypointData *wp = new WaypointData;
if(last_id != id)
@@ -95,6 +97,8 @@ void WaypointStore::Load()
} while(result->NextRow()) ;
delete result;
+ sLog.outString();
+ sLog.outString(">> Loaded %u waypoints", count);
}
void WaypointStore::UpdatePath(uint32 id)
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 7a8256995f9..a9d2376ef7a 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1283,7 +1283,7 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading Script Names...");
objmgr.LoadScriptNames();
- sLog.outString("Loading InstanceTemplate...");
+ sLog.outString("Loading Instance Template...");
objmgr.LoadInstanceTemplate();
sLog.outString("Loading SkillLineAbilityMultiMap Data...");
@@ -1296,7 +1296,6 @@ void World::SetInitialWorldSettings()
sLog.outString("Packing instances...");
sInstanceSaveManager.PackInstances();
- sLog.outString();
sLog.outString("Loading Localization strings...");
objmgr.LoadCreatureLocales();
objmgr.LoadGameObjectLocales();
@@ -1391,11 +1390,8 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading pet default spell additional to levelup spells...");
spellmgr.LoadPetDefaultSpells();
- sLog.outString("Loading Creature Addon Data...");
- sLog.outString();
+ sLog.outString("Loading Creature Template Addon Data...");
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
- sLog.outString(">>> Creature Addon Data loaded");
- sLog.outString();
sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances()
objmgr.LoadCreatureRespawnTimes();
@@ -1410,22 +1406,14 @@ void World::SetInitialWorldSettings()
poolhandler.LoadFromDB();
sLog.outString("Loading Game Event Data...");
- sLog.outString();
gameeventmgr.LoadFromDB();
- sLog.outString(">>> Game Event Data loaded");
- sLog.outString();
sLog.outString("Loading Weather Data...");
objmgr.LoadWeatherZoneChances();
sLog.outString("Loading Quests...");
objmgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
-
- sLog.outString("Loading Quests Relations...");
- sLog.outString();
objmgr.LoadQuestRelations(); // must be after quest load
- sLog.outString(">>> Quests Relations loaded");
- sLog.outString();
sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data...");
objmgr.LoadNPCSpellClickSpells();
@@ -1457,7 +1445,7 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading spell pet auras...");
spellmgr.LoadSpellPetAuras();
- sLog.outString("Loading spell extra attributes...(TODO)");
+ sLog.outString("Loading spell extra attributes...");
spellmgr.LoadSpellCustomAttr();
sLog.outString("Loading enchant custom attributes...");
@@ -1466,11 +1454,8 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading linked spells...");
spellmgr.LoadSpellLinked();
- sLog.outString("Loading Player Create Info & Level Stats...");
- sLog.outString();
+ sLog.outString("Loading Player Create Data...");
objmgr.LoadPlayerInfo();
- sLog.outString(">>> Player Create Info & Level Stats loaded");
- sLog.outString();
sLog.outString("Loading Exploration BaseXP Data...");
objmgr.LoadExplorationBaseXP();
@@ -1493,11 +1478,8 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading Disabled Spells...");
objmgr.LoadSpellDisabledEntrys();
- sLog.outString("Loading Loot Tables...");
- sLog.outString();
+ // Loot tables
LoadLootTables();
- sLog.outString(">>> Loot Tables loaded");
- sLog.outString();
sLog.outString("Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
@@ -1509,23 +1491,23 @@ void World::SetInitialWorldSettings()
objmgr.LoadFishingBaseSkillLevel();
sLog.outString("Loading Achievements...");
- sLog.outString();
achievementmgr.LoadAchievementReferenceList();
+ sLog.outString("Loading Achievement Criteria Lists...");
achievementmgr.LoadAchievementCriteriaList();
+ sLog.outString("Loading Achievement Criteria Data...");
achievementmgr.LoadAchievementCriteriaData();
+ sLog.outString("Loading Achievement Rewards...");
achievementmgr.LoadRewards();
+ sLog.outString("Loading Achievement Reward Locales...");
achievementmgr.LoadRewardLocales();
+ sLog.outString("Loading Completed Achievements...");
achievementmgr.LoadCompletedAchievements();
- sLog.outString(">>> Achievements loaded");
- sLog.outString();
///- Load dynamic data tables from the database
- sLog.outString("Loading Auctions...");
- sLog.outString();
+ sLog.outString("Loading Item Auctions...");
auctionmgr.LoadAuctionItems();
+ sLog.outString("Loading Auctions...");
auctionmgr.LoadAuctions();
- sLog.outString(">>> Auctions loaded");
- sLog.outString();
sLog.outString("Loading Guilds...");
objmgr.LoadGuilds();
@@ -1551,7 +1533,6 @@ void World::SetInitialWorldSettings()
sLog.outString("Loading Npc Text Id...");
objmgr.LoadNpcTextId(); // must be after load Creature and NpcText
- sLog.outString( "Loading Gossip scripts...");
objmgr.LoadGossipScripts(); // must be before gossip menu options
sLog.outString("Loading Gossip menu...");
@@ -1567,7 +1548,6 @@ void World::SetInitialWorldSettings()
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate
sLog.outString("Loading Waypoints...");
- sLog.outString();
WaypointMgr.Load();
sLog.outString("Loading Creature Formations...");