Core/Quests: Implemented QUEST_OBJECTIVE_KILL_WITH_LABEL

Port From (https://github.com/TrinityCore/TrinityCore/commit/1fb4acc25ae89360e71d33a8f7cba99bcc028b32)
This commit is contained in:
Hondacrx
2025-02-23 14:20:00 -05:00
parent 3a2439ba15
commit 644206f0d5
14 changed files with 108 additions and 4 deletions
+4
View File
@@ -127,6 +127,7 @@ namespace Game.DataStorage
CreatureDisplayInfoStorage = ReadDB2<CreatureDisplayInfoRecord>("CreatureDisplayInfo.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO);
CreatureDisplayInfoExtraStorage = ReadDB2<CreatureDisplayInfoExtraRecord>("CreatureDisplayInfoExtra.db2", HotfixStatements.SEL_CREATURE_DISPLAY_INFO_EXTRA);
CreatureFamilyStorage = ReadDB2<CreatureFamilyRecord>("CreatureFamily.db2", HotfixStatements.SEL_CREATURE_FAMILY, HotfixStatements.SEL_CREATURE_FAMILY_LOCALE);
CreatureLabelStorage = ReadDB2<CreatureLabelRecord>("CreatureLabel.db2", HotfixStatements.SEL_CREATURE_LABEL);
CreatureModelDataStorage = ReadDB2<CreatureModelDataRecord>("CreatureModelData.db2", HotfixStatements.SEL_CREATURE_MODEL_DATA);
CreatureTypeStorage = ReadDB2<CreatureTypeRecord>("CreatureType.db2", HotfixStatements.SEL_CREATURE_TYPE, HotfixStatements.SEL_CREATURE_TYPE_LOCALE);
CriteriaStorage = ReadDB2<CriteriaRecord>("Criteria.db2", HotfixStatements.SEL_CRITERIA);
@@ -152,6 +153,7 @@ namespace Game.DataStorage
FriendshipReputationStorage = ReadDB2<FriendshipReputationRecord>("FriendshipReputation.db2", HotfixStatements.SEL_FRIENDSHIP_REPUTATION, HotfixStatements.SEL_FRIENDSHIP_REPUTATION_LOCALE);
GameObjectArtKitStorage = ReadDB2<GameObjectArtKitRecord>("GameObjectArtKit.db2", HotfixStatements.SEL_GAMEOBJECT_ART_KIT);
GameObjectDisplayInfoStorage = ReadDB2<GameObjectDisplayInfoRecord>("GameObjectDisplayInfo.db2", HotfixStatements.SEL_GAMEOBJECT_DISPLAY_INFO);
GameObjectLabelStorage = ReadDB2<GameObjectLabelRecord>("GameObjectLabel.db2", HotfixStatements.SEL_GAMEOBJECT_LABEL);
GameObjectsStorage = ReadDB2<GameObjectsRecord>("GameObjects.db2", HotfixStatements.SEL_GAMEOBJECTS, HotfixStatements.SEL_GAMEOBJECTS_LOCALE);
GarrAbilityStorage = ReadDB2<GarrAbilityRecord>("GarrAbility.db2", HotfixStatements.SEL_GARR_ABILITY, HotfixStatements.SEL_GARR_ABILITY_LOCALE);
GarrBuildingStorage = ReadDB2<GarrBuildingRecord>("GarrBuilding.db2", HotfixStatements.SEL_GARR_BUILDING, HotfixStatements.SEL_GARR_BUILDING_LOCALE);
@@ -577,6 +579,7 @@ namespace Game.DataStorage
public static DB6Storage<CreatureDisplayInfoRecord> CreatureDisplayInfoStorage;
public static DB6Storage<CreatureDisplayInfoExtraRecord> CreatureDisplayInfoExtraStorage;
public static DB6Storage<CreatureFamilyRecord> CreatureFamilyStorage;
public static DB6Storage<CreatureLabelRecord> CreatureLabelStorage;
public static DB6Storage<CreatureModelDataRecord> CreatureModelDataStorage;
public static DB6Storage<CreatureTypeRecord> CreatureTypeStorage;
public static DB6Storage<CriteriaRecord> CriteriaStorage;
@@ -602,6 +605,7 @@ namespace Game.DataStorage
public static DB6Storage<FriendshipReputationRecord> FriendshipReputationStorage;
public static DB6Storage<GameObjectArtKitRecord> GameObjectArtKitStorage;
public static DB6Storage<GameObjectDisplayInfoRecord> GameObjectDisplayInfoStorage;
public static DB6Storage<GameObjectLabelRecord> GameObjectLabelStorage;
public static DB6Storage<GameObjectsRecord> GameObjectsStorage;
public static DB6Storage<GarrAbilityRecord> GarrAbilityStorage;
public static DB6Storage<GarrBuildingRecord> GarrBuildingStorage;
+19 -1
View File
@@ -255,6 +255,9 @@ namespace Game.DataStorage
foreach (ContentTuningXLabelRecord contentTuningXLabel in ContentTuningXLabelStorage.Values)
_contentTuningLabels.Add((contentTuningXLabel.ContentTuningID, contentTuningXLabel.LabelID));
foreach (var (_, creatureLabel) in CreatureLabelStorage)
_creatureLabels.Add(creatureLabel.CreatureDifficultyID, creatureLabel.LabelID);
foreach (CurrencyContainerRecord currencyContainer in CurrencyContainerStorage.Values)
_currencyContainers.Add(currencyContainer.CurrencyTypesID, currencyContainer);
@@ -282,7 +285,7 @@ namespace Game.DataStorage
_factionTeams.Add(faction.ParentFactionID, faction.Id);
foreach (FriendshipRepReactionRecord friendshipRepReaction in FriendshipRepReactionStorage.Values)
_friendshipRepReactions.Add((uint)friendshipRepReaction.FriendshipRepID, friendshipRepReaction);
_friendshipRepReactions.Add(friendshipRepReaction.FriendshipRepID, friendshipRepReaction);
foreach (var key in _friendshipRepReactions.Keys)
_friendshipRepReactions[key].Sort(new FriendshipRepReactionRecordComparer());
@@ -297,6 +300,9 @@ namespace Game.DataStorage
Extensions.Swap(ref gameObjectDisplayInfo.GeoBox[5], ref gameObjectDisplayInfo.GeoBox[2]);
}
foreach (var (_, gameobjectLabel) in GameObjectLabelStorage)
_gameobjectLabels.Add(gameobjectLabel.GameObjectID, gameobjectLabel.LabelID);
foreach (HeirloomRecord heirloom in HeirloomStorage.Values)
_heirlooms[heirloom.ItemID] = heirloom;
@@ -1175,6 +1181,11 @@ namespace Game.DataStorage
return petFamily.Name[locale][0] != '\0' ? petFamily.Name[locale] : "";
}
public List<int> GetCreatureLabels(int creatureDifficultyId)
{
return _creatureLabels.LookupByKey(creatureDifficultyId);
}
public CurrencyContainerRecord GetCurrencyContainerForCurrencyQuantity(uint currencyId, int quantity)
{
foreach (var record in _currencyContainers.LookupByKey(currencyId))
@@ -1511,6 +1522,11 @@ namespace Game.DataStorage
return _friendshipRepReactions.LookupByKey(friendshipRepID);
}
public List<int> GetGameObjectLabels(uint gameobjectId)
{
return _gameobjectLabels.LookupByKey(gameobjectId);
}
public uint GetGlobalCurveId(GlobalCurve globalCurveType)
{
foreach (var globalCurveEntry in GlobalCurveStorage.Values)
@@ -2341,6 +2357,7 @@ namespace Game.DataStorage
Dictionary<int, ConditionalChrModelRecord> _conditionalChrModelsByChrModelId = new();
Dictionary<uint, List<ConditionalContentTuningRecord>> _conditionalContentTuning = new();
List<(uint, int)> _contentTuningLabels = new();
MultiMap<uint, int> _creatureLabels = new();
MultiMap<uint, CurrencyContainerRecord> _currencyContainers = new();
MultiMap<uint, Vector2> _curvePoints = new();
Dictionary<Tuple<uint, byte, byte, byte>, EmotesTextSoundRecord> _emoteTextSounds = new();
@@ -2349,6 +2366,7 @@ namespace Game.DataStorage
MultiMap<uint, uint> _factionTeams = new();
MultiMap<uint, FriendshipRepReactionRecord> _friendshipRepReactions = new();
Dictionary<uint, HeirloomRecord> _heirlooms = new();
MultiMap<uint, int> _gameobjectLabels = new();
MultiMap<uint, uint> _glyphBindableSpells = new();
MultiMap<uint, ChrSpecialization> _glyphRequiredSpecs = new();
Dictionary<uint, ItemChildEquipmentRecord> _itemChildEquipment = new();
@@ -507,6 +507,13 @@ namespace Game.DataStorage
public short[] SkillLine = new short[2];
}
public sealed class CreatureLabelRecord
{
public uint Id;
public int LabelID;
public uint CreatureDifficultyID;
}
public sealed class CreatureModelDataRecord
{
public uint Id;
@@ -38,6 +38,13 @@ namespace Game.DataStorage
}
}
public sealed class GameObjectLabelRecord
{
public uint Id;
public int LabelID;
public uint GameObjectID;
}
public sealed class GameObjectsRecord
{
public LocalizedString Name;