DB/Models: Updated creatures' model data up to 6.0.3.19057
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -812,7 +812,7 @@ struct CreatureDisplayInfoEntry
|
||||
//uint32 ObjectEffectPackageID; // 16
|
||||
//uint32 AnimReplacementSetID; // 17
|
||||
//uint32 Flags; // 18
|
||||
//uint32 Gender; // 19
|
||||
int32 Gender; // 19
|
||||
//uint32 StateSpellVisualKitID; // 20
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ char const ChrRacesEntryfmt[] = "niixiixxxxxxiisxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
char const ChrClassesXPowerTypesfmt[] = "nii";
|
||||
char const ChrSpecializationEntryfmt[] = "nxiiiiiiiiixxxii";
|
||||
char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx";
|
||||
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx";
|
||||
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxix";
|
||||
char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxxx";
|
||||
char const CreatureFamilyfmt[] = "nfifiiiiixsx";
|
||||
char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx";
|
||||
|
||||
@@ -287,8 +287,8 @@ struct CreatureModelInfo
|
||||
{
|
||||
float bounding_radius;
|
||||
float combat_reach;
|
||||
uint8 gender;
|
||||
uint32 modelid_other_gender;
|
||||
int8 gender;
|
||||
uint32 displayId_other_gender;
|
||||
};
|
||||
|
||||
// Benchmarked: Faster than std::map (insert/find)
|
||||
|
||||
@@ -1222,15 +1222,15 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
|
||||
return NULL;
|
||||
|
||||
// If a model for another gender exists, 50% chance to use it
|
||||
if (modelInfo->modelid_other_gender != 0 && urand(0, 1) == 0)
|
||||
if (modelInfo->displayId_other_gender != 0 && urand(0, 1) == 0)
|
||||
{
|
||||
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender);
|
||||
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->displayId_other_gender);
|
||||
if (!minfo_tmp)
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
|
||||
TC_LOG_ERROR("sql.sql", "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->displayId_other_gender);
|
||||
else
|
||||
{
|
||||
// Model ID changed
|
||||
*displayID = modelInfo->modelid_other_gender;
|
||||
// DisplayID changed
|
||||
*displayID = modelInfo->displayId_other_gender;
|
||||
return minfo_tmp;
|
||||
}
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ void ObjectMgr::LoadCreatureModelInfo()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT modelid, bounding_radius, combat_reach, gender, modelid_other_gender FROM creature_model_info");
|
||||
QueryResult result = WorldDatabase.Query("SELECT DisplayID, BoundingRadius, CombatReach, DisplayID_Other_Gender FROM creature_model_info");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -1257,30 +1257,36 @@ void ObjectMgr::LoadCreatureModelInfo()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 modelId = fields[0].GetUInt32();
|
||||
uint32 displayId = fields[0].GetUInt32();
|
||||
|
||||
CreatureModelInfo& modelInfo = _creatureModelStore[modelId];
|
||||
CreatureDisplayInfoEntry const* creatureDisplay = sCreatureDisplayInfoStore.LookupEntry(displayId);
|
||||
if (!creatureDisplay)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has a non-existent DisplayID (ID: %u). Skipped.", displayId);
|
||||
continue;
|
||||
}
|
||||
|
||||
modelInfo.bounding_radius = fields[1].GetFloat();
|
||||
modelInfo.combat_reach = fields[2].GetFloat();
|
||||
modelInfo.gender = fields[3].GetUInt8();
|
||||
modelInfo.modelid_other_gender = fields[4].GetUInt32();
|
||||
CreatureModelInfo& modelInfo = _creatureModelStore[displayId];
|
||||
|
||||
modelInfo.bounding_radius = fields[1].GetFloat();
|
||||
modelInfo.combat_reach = fields[2].GetFloat();
|
||||
modelInfo.displayId_other_gender = fields[3].GetUInt32();
|
||||
modelInfo.gender = creatureDisplay->Gender;
|
||||
|
||||
// Checks
|
||||
|
||||
if (!sCreatureDisplayInfoStore.LookupEntry(modelId))
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has model for nonexistent display id (%u).", modelId);
|
||||
|
||||
if (modelInfo.gender > GENDER_NONE)
|
||||
// to remove when the purpose of GENDER_UNKNOWN is known
|
||||
if (modelInfo.gender == GENDER_UNKNOWN)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId);
|
||||
// We don't need more errors
|
||||
//TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has an unimplemented Gender (ID: %i) being used by DisplayID (ID: %u). Gender set to GENDER_MALE.", modelInfo.gender, modelId);
|
||||
modelInfo.gender = GENDER_MALE;
|
||||
}
|
||||
|
||||
if (modelInfo.modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(modelInfo.modelid_other_gender))
|
||||
if (modelInfo.displayId_other_gender && !sCreatureDisplayInfoStore.LookupEntry(modelInfo.displayId_other_gender))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has nonexistent alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId);
|
||||
modelInfo.modelid_other_gender = 0;
|
||||
TC_LOG_ERROR("sql.sql", "Table `creature_model_info` has a non-existent DisplayID_Other_Gender (ID: %u) being used by DisplayID (ID: %u).", modelInfo.displayId_other_gender, displayId);
|
||||
modelInfo.displayId_other_gender = 0;
|
||||
}
|
||||
|
||||
if (modelInfo.combat_reach < 0.1f)
|
||||
|
||||
@@ -58,9 +58,10 @@ enum Expansions
|
||||
|
||||
enum Gender
|
||||
{
|
||||
GENDER_MALE = 0,
|
||||
GENDER_FEMALE = 1,
|
||||
GENDER_NONE = 2
|
||||
GENDER_UNKNOWN = -1,
|
||||
GENDER_MALE = 0,
|
||||
GENDER_FEMALE = 1,
|
||||
GENDER_NONE = 2
|
||||
};
|
||||
|
||||
// ChrRaces.dbc (6.0.2.18988)
|
||||
|
||||
Reference in New Issue
Block a user