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
+10
View File
@@ -3160,6 +3160,16 @@ namespace Game.Entities
return base.GetName(locale);
}
public bool HasLabel(int cretureLabel)
{
return GetLabels().Contains(cretureLabel);
}
public List<int> GetLabels()
{
return Global.DB2Mgr.GetCreatureLabels(GetCreatureDifficulty().CreatureDifficultyID);
}
public virtual int GetPetAutoSpellSize()
{
return SharedConst.MaxSpellCharm;
@@ -2752,6 +2752,16 @@ namespace Game.Entities
return base.GetName(locale);
}
public bool HasLabel(int gameobjectLabel)
{
return GetLabels().Contains(gameobjectLabel);
}
public List<int> GetLabels()
{
return Global.DB2Mgr.GetGameObjectLabels(GetEntry());
}
public void UpdatePackedRotation()
{
const int PACK_YZ = 1 << 20;
@@ -2539,6 +2539,9 @@ namespace Game.Entities
for (byte i = 0; i < 2; ++i)
if (cInfo.KillCredit[i] != 0)
KilledMonsterCredit(cInfo.KillCredit[i]);
foreach (int label in creature.GetLabels())
UpdateQuestObjectiveProgress(QuestObjectiveType.KillWithLabel, label, 1, creature.GetGUID());
}
public void KilledMonsterCredit(uint entry, ObjectGuid guid = default)
@@ -3025,6 +3028,7 @@ namespace Game.Entities
case QuestObjectiveType.HaveCurrency:
case QuestObjectiveType.ObtainCurrency:
case QuestObjectiveType.IncreaseReputation:
case QuestObjectiveType.KillWithLabel:
if (GetQuestSlotObjectiveData(slot, objective) < objective.Amount)
return false;
break;