Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Player/Player.cpp src/server/game/Handlers/MailHandler.cpp
This commit is contained in:
commit
529c4b7592
61 files changed
+1104
-311
No files matched your search
@@ -1446,6 +1446,92 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadTempSummons()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult result = WorldDatabase.Query("SELECT summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime FROM creature_summon_groups");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 summonerId = fields[0].GetUInt32();
|
||||
SummonerType summonerType = SummonerType(fields[1].GetUInt8());
|
||||
uint8 group = fields[2].GetUInt8();
|
||||
|
||||
switch (summonerType)
|
||||
{
|
||||
case SUMMONER_TYPE_CREATURE:
|
||||
if (!GetCreatureTemplate(summonerId))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has summoner with non existing entry %u for creature summoner type, skipped.", summonerId);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case SUMMONER_TYPE_GAMEOBJECT:
|
||||
if (!GetGameObjectTemplate(summonerId))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has summoner with non existing entry %u for gameobject summoner type, skipped.", summonerId);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case SUMMONER_TYPE_MAP:
|
||||
if (!sMapStore.LookupEntry(summonerId))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has summoner with non existing entry %u for map summoner type, skipped.", summonerId);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has unhandled summoner type %u for summoner %u, skipped.", summonerType, summonerId);
|
||||
continue;
|
||||
}
|
||||
|
||||
TempSummonData data;
|
||||
data.entry = fields[3].GetUInt32();
|
||||
|
||||
if (!GetCreatureTemplate(data.entry))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has creature in group [Summoner ID: %u, Summoner Type: %u, Group ID: %u] with non existing creature entry %u, skipped.", summonerId, summonerType, group, data.entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
float posX = fields[4].GetFloat();
|
||||
float posY = fields[5].GetFloat();
|
||||
float posZ = fields[6].GetFloat();
|
||||
float orientation = fields[7].GetFloat();
|
||||
|
||||
data.pos.Relocate(posX, posY, posZ, orientation);
|
||||
|
||||
data.type = TempSummonType(fields[8].GetUInt8());
|
||||
|
||||
if (data.type > TEMPSUMMON_MANUAL_DESPAWN)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Table `creature_summon_groups` has unhandled temp summon type %u in group [Summoner ID: %u, Summoner Type: %u, Group ID: %u] for creature entry %u, skipped.", data.type, summonerId, summonerType, group, data.entry);
|
||||
continue;
|
||||
}
|
||||
|
||||
data.time = fields[9].GetUInt32();
|
||||
|
||||
TempSummonGroupKey key(summonerId, summonerType, group);
|
||||
_tempSummonDataStore[key].push_back(data);
|
||||
|
||||
++count;
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u temp summons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatures()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
Reference in new issue
Block a user