Merge commit 'origin/master' into 310

Conflicts:
	src/game/Player.cpp
This commit is contained in:
tomrus88 2009-05-06 09:40:35 +04:00
commit 6821c24268
27 changed files with 414 additions and 105 deletions

View file

@ -5927,6 +5927,76 @@ void ObjectMgr::LoadPointsOfInterest()
sLog.outString(">> Loaded %u Points of Interest definitions", count);
}
void ObjectMgr::LoadNPCSpellClickSpells()
{
uint32 count = 0;
mSpellClickInfoMap.clear();
QueryResult *result = WorldDatabase.Query("SELECT npc_entry, spell_id, quest_id, cast_flags FROM npc_spellclick_spells");
if(!result)
{
barGoLink bar(1);
bar.step();
sLog.outString();
sLog.outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
return;
}
barGoLink bar(result->GetRowCount());
do
{
Field *fields = result->Fetch();
bar.step();
uint32 npc_entry = fields[0].GetUInt32();
CreatureInfo const* cInfo = GetCreatureTemplate(npc_entry);
if (!cInfo)
{
sLog.outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
continue;
}
uint32 spellid = fields[1].GetUInt32();
SpellEntry const *spellinfo = sSpellStore.LookupEntry(spellid);
if (!spellinfo)
{
sLog.outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
continue;
}
uint32 quest = fields[2].GetUInt32();
// quest might be 0 to enable spellclick independent of any quest
if (quest)
{
if(mQuestTemplates.find(quest) == mQuestTemplates.end())
{
sLog.outErrorDb("Table npc_spellclick_spells references unknown quest %u. Skipping entry.", spellid);
continue;
}
}
uint8 castFlags = fields[3].GetUInt8();
SpellClickInfo info;
info.spellId = spellid;
info.questId = quest;
info.castFlags = castFlags;
mSpellClickInfoMap.insert(SpellClickInfoMap::value_type(npc_entry, info));
++count;
} while (result->NextRow());
delete result;
sLog.outString();
sLog.outString(">> Loaded %u spellclick definitions", count);
}
void ObjectMgr::LoadWeatherZoneChances()
{
uint32 count = 0;