Merge branch 'master' into Playerbot
# Conflicts: # src/server/game/Entities/Creature/Creature.cpp # src/server/game/Entities/Creature/Creature.h # src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
This commit is contained in:
@@ -22,10 +22,12 @@
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "CreatureAIFactory.h"
|
||||
#include "Config.h"
|
||||
#include "Containers.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GameObjectAIFactory.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "GossipDef.h"
|
||||
@@ -979,6 +981,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (!cInfo->AIName.empty() && !sCreatureAIRegistry->HasItem(cInfo->AIName))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) has non-registered `AIName` '{}' set, removing", cInfo->Entry, cInfo->AIName);
|
||||
const_cast<CreatureTemplate*>(cInfo)->AIName.clear();
|
||||
}
|
||||
|
||||
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction);
|
||||
if (!factionTemplate)
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) has non-existing faction template ({}).", cInfo->Entry, cInfo->faction);
|
||||
@@ -2162,6 +2170,11 @@ void ObjectMgr::LoadCreatures()
|
||||
LOG_ERROR("sql.sql", "Table `creature` have creature (SpawnId: {} Entries: {}, {}, {}) with a `creature_template`.`flags_extra` in one or more entries including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.",
|
||||
spawnId, data.id1, data.id2, data.id3);
|
||||
}
|
||||
if (data.movementType >= MAX_DB_MOTION_TYPE)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `creature` has creature (SpawnId: {} Entries: {}, {}, {}) with wrong movement generator type ({}), ignored and set to IDLE.", spawnId, data.id1, data.id2, data.id3, data.movementType);
|
||||
data.movementType = IDLE_MOTION_TYPE;
|
||||
}
|
||||
if (data.wander_distance < 0.0f)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `creature` have creature (SpawnId: {} Entries: {}, {}, {}) with `wander_distance`< 0, set to 0.", spawnId, data.id1, data.id2, data.id3);
|
||||
@@ -2665,7 +2678,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
for (uint8 i = 0; i < itemTemplate.StatsCount; ++i)
|
||||
{
|
||||
itemTemplate.ItemStat[i].ItemStatType = uint32(fields[28 + i * 2].Get<uint8>());
|
||||
itemTemplate.ItemStat[i].ItemStatValue = int32(fields[29 + i * 2].Get<int16>());
|
||||
itemTemplate.ItemStat[i].ItemStatValue = fields[29 + i * 2].Get<int32>();
|
||||
}
|
||||
|
||||
itemTemplate.ScalingStatDistribution = uint32(fields[48].Get<uint16>());
|
||||
@@ -2678,13 +2691,13 @@ void ObjectMgr::LoadItemTemplates()
|
||||
itemTemplate.Damage[i].DamageType = uint32(fields[52 + i * 3].Get<uint8>());
|
||||
}
|
||||
|
||||
itemTemplate.Armor = uint32(fields[56].Get<uint16>());
|
||||
itemTemplate.HolyRes = uint32(fields[57].Get<uint8>());
|
||||
itemTemplate.FireRes = uint32(fields[58].Get<uint8>());
|
||||
itemTemplate.NatureRes = uint32(fields[59].Get<uint8>());
|
||||
itemTemplate.FrostRes = uint32(fields[60].Get<uint8>());
|
||||
itemTemplate.ShadowRes = uint32(fields[61].Get<uint8>());
|
||||
itemTemplate.ArcaneRes = uint32(fields[62].Get<uint8>());
|
||||
itemTemplate.Armor = fields[56].Get<uint32>();
|
||||
itemTemplate.HolyRes = fields[57].Get<uint32>();
|
||||
itemTemplate.FireRes = fields[58].Get<uint32>();
|
||||
itemTemplate.NatureRes = fields[59].Get<uint32>();
|
||||
itemTemplate.FrostRes = fields[60].Get<uint32>();
|
||||
itemTemplate.ShadowRes = fields[61].Get<uint32>();
|
||||
itemTemplate.ArcaneRes = fields[62].Get<uint32>();
|
||||
itemTemplate.Delay = uint32(fields[63].Get<uint16>());
|
||||
itemTemplate.AmmoType = uint32(fields[64].Get<uint8>());
|
||||
itemTemplate.RangedModRange = fields[65].Get<float>();
|
||||
@@ -3435,14 +3448,14 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
// data for level 1 stored in [0] array element, ...
|
||||
PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level - 1];
|
||||
|
||||
pLevelInfo->health = fields[2].Get<uint16>();
|
||||
pLevelInfo->mana = fields[3].Get<uint16>();
|
||||
pLevelInfo->health = fields[2].Get<uint32>();
|
||||
pLevelInfo->mana = fields[3].Get<uint32>();
|
||||
pLevelInfo->armor = fields[9].Get<uint32>();
|
||||
pLevelInfo->min_dmg = fields[10].Get<uint16>();
|
||||
pLevelInfo->max_dmg = fields[11].Get<uint16>();
|
||||
for (int i = 0; i < MAX_STATS; i++)
|
||||
pLevelInfo->min_dmg = fields[10].Get<uint32>();
|
||||
pLevelInfo->max_dmg = fields[11].Get<uint32>();
|
||||
for (uint8 i = 0; i < MAX_STATS; i++)
|
||||
{
|
||||
pLevelInfo->stats[i] = fields[i + 4].Get<uint16>();
|
||||
pLevelInfo->stats[i] = fields[i + 4].Get<uint32>();
|
||||
}
|
||||
|
||||
++count;
|
||||
@@ -3960,8 +3973,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
|
||||
PlayerClassLevelInfo& levelInfo = info->levelInfo[current_level - 1];
|
||||
|
||||
levelInfo.basehealth = fields[2].Get<uint16>();
|
||||
levelInfo.basemana = fields[3].Get<uint16>();
|
||||
levelInfo.basehealth = fields[2].Get<uint32>();
|
||||
levelInfo.basemana = fields[3].Get<uint32>();
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -4051,8 +4064,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
info->levelInfo = new PlayerLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
PlayerLevelInfo& levelInfo = info->levelInfo[current_level - 1];
|
||||
for (int i = 0; i < MAX_STATS; i++)
|
||||
levelInfo.stats[i] = fields[i + 3].Get<uint8>();
|
||||
for (uint8 i = 0; i < MAX_STATS; i++)
|
||||
levelInfo.stats[i] = fields[i + 3].Get<uint32>();
|
||||
}
|
||||
|
||||
++count;
|
||||
@@ -7040,6 +7053,10 @@ void ObjectMgr::LoadGameObjectTemplate()
|
||||
got.IsForQuests = false;
|
||||
|
||||
// Checks
|
||||
if (!got.AIName.empty() && !sGameObjectAIRegistry->HasItem(got.AIName))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "GameObject (Entry: {}) has non-registered `AIName` '{}' set, removing", got.entry, got.AIName);
|
||||
}
|
||||
|
||||
switch (got.type)
|
||||
{
|
||||
@@ -9342,7 +9359,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
|
||||
for (uint8 i = 0; i < MAX_EXPANSIONS; ++i)
|
||||
{
|
||||
stats.BaseHealth[i] = fields[2 + i].Get<uint16>();
|
||||
stats.BaseHealth[i] = fields[2 + i].Get<uint32>();
|
||||
|
||||
if (stats.BaseHealth[i] == 0)
|
||||
{
|
||||
@@ -9372,11 +9389,11 @@ void ObjectMgr::LoadCreatureClassLevelStats()
|
||||
}
|
||||
}
|
||||
|
||||
stats.BaseMana = fields[5].Get<uint16>();
|
||||
stats.BaseArmor = fields[6].Get<uint16>();
|
||||
stats.BaseMana = fields[5].Get<uint32>();
|
||||
stats.BaseArmor = fields[6].Get<uint32>();
|
||||
|
||||
stats.AttackPower = fields[7].Get<uint16>();
|
||||
stats.RangedAttackPower = fields[8].Get<uint16>();
|
||||
stats.AttackPower = fields[7].Get<uint32>();
|
||||
stats.RangedAttackPower = fields[8].Get<uint32>();
|
||||
|
||||
_creatureBaseStatsStore[MAKE_PAIR16(Level, Class)] = stats;
|
||||
|
||||
|
||||
@@ -520,14 +520,17 @@ typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator
|
||||
|
||||
struct PetLevelInfo
|
||||
{
|
||||
PetLevelInfo() { for (unsigned short & stat : stats) stat = 0; }
|
||||
PetLevelInfo()
|
||||
{
|
||||
stats.fill(0);
|
||||
}
|
||||
|
||||
uint16 stats[MAX_STATS];
|
||||
uint16 health{0};
|
||||
uint16 mana{0};
|
||||
std::array<uint32, MAX_STATS> stats = { };
|
||||
uint32 health{0};
|
||||
uint32 mana{0};
|
||||
uint32 armor{0};
|
||||
uint16 min_dmg{0};
|
||||
uint16 max_dmg{0};
|
||||
uint32 min_dmg{0};
|
||||
uint32 max_dmg{0};
|
||||
};
|
||||
|
||||
struct MailLevelReward
|
||||
|
||||
Reference in New Issue
Block a user