Core/Creatures: Move creature difficulty specific data from creature_template table to creature_template_difficulty

Port From (https://github.com/TrinityCore/TrinityCore/commit/06d0b16f158e8793860d9edd11b990f20b1d0dac)
This commit is contained in:
hondacrx
2023-05-30 08:16:40 -04:00
parent 77febfdee5
commit 068ccd990f
26 changed files with 399 additions and 539 deletions
+2 -2
View File
@@ -458,7 +458,7 @@ namespace Game
if (dstPet != null)
{
CreatureTemplate creatureInfo = Global.ObjectMgr.GetCreatureTemplate(dstPet.CreatureId);
if (creatureInfo == null || !creatureInfo.IsTameable(_player.CanTameExoticPets()))
if (creatureInfo == null || !creatureInfo.IsTameable(_player.CanTameExoticPets(), creatureInfo.GetDifficulty(Difficulty.None)))
{
SendPetStableResult(StableResult.CantControlExotic);
return;
@@ -484,7 +484,7 @@ namespace Game
}
CreatureTemplate creatureInfo = Global.ObjectMgr.GetCreatureTemplate(srcPet.CreatureId);
if (creatureInfo == null || !creatureInfo.IsTameable(_player.CanTameExoticPets()))
if (creatureInfo == null || !creatureInfo.IsTameable(_player.CanTameExoticPets(), creatureInfo.GetDifficulty(Difficulty.None)))
{
SendPetStableResult(StableResult.CantControlExotic);
return;
+7 -22
View File
@@ -99,31 +99,16 @@ namespace Game
CreatureTemplate ci = Global.ObjectMgr.GetCreatureTemplate(packet.CreatureID);
if (ci != null)
{
if (!WorldConfig.GetBoolValue(WorldCfg.CacheDataQueries))
ci.InitializeQueryData();
Difficulty difficulty = _player.GetMap().GetDifficultyID();
QueryCreatureResponse queryCreatureResponse = ci.QueryData;
Locale loc = GetSessionDbLocaleIndex();
if (loc != Locale.enUS)
// Cache only exists for difficulty base
if (!WorldConfig.GetBoolValue(WorldCfg.CacheDataQueries) && difficulty == Difficulty.None)
SendPacket(ci.QueryData[(int)GetSessionDbLocaleIndex()]);
else
{
CreatureLocale creatureLocale = Global.ObjectMgr.GetCreatureLocale(ci.Entry);
if (creatureLocale != null)
{
string name = queryCreatureResponse.Stats.Name[0];
string nameAlt = queryCreatureResponse.Stats.NameAlt[0];
ObjectManager.GetLocaleString(creatureLocale.Name, loc, ref name);
ObjectManager.GetLocaleString(creatureLocale.NameAlt, loc, ref nameAlt);
ObjectManager.GetLocaleString(creatureLocale.Title, loc, ref queryCreatureResponse.Stats.Title);
ObjectManager.GetLocaleString(creatureLocale.TitleAlt, loc, ref queryCreatureResponse.Stats.TitleAlt);
queryCreatureResponse.Stats.Name[0] = name;
queryCreatureResponse.Stats.NameAlt[0] = nameAlt;
}
var response = ci.BuildQueryData(GetSessionDbLocaleIndex(), difficulty);
SendPacket(response);
}
SendPacket(queryCreatureResponse);
}
else
{